diff --git a/.config/CredScanSuppressions.json b/.config/CredScanSuppressions.json index da14baee20e3..984a86f68e69 100644 --- a/.config/CredScanSuppressions.json +++ b/.config/CredScanSuppressions.json @@ -1,49 +1,70 @@ { - "tool": "Credential Scanner", - "suppressions": [ - { - "file": [ - "/eng/common/internal-feed-operations.ps1", - "/eng/common/internal-feed-operations.sh", - "/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs", - "/src/libraries/Common/src/System/Security/Cryptography/EccSecurityTransforms.cs", - "/src/libraries/Common/tests/System/Net/Configuration.Certificates.cs", - "/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs", - "/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs", - "/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.DefaultProxyCredentials.cs", - "/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Proxy.cs", - "/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.ServerCertificates.cs", - "/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs", - "/src/libraries/Common/tests/System/Net/Prerequisites/Deployment/setup_certificates.ps1", - "/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.cs", - "/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.LimitedPrivate.cs", - "/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAKeyFileTests.cs", - "/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAKeyPemTests.cs", - "/src/libraries/System.Data.Common/tests/System/Data/Common/DbConnectionStringBuilderTest.cs", - "/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs", - "/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/constants.cs", - "/src/libraries/System.DirectoryServices.AccountManagement/tests/PrincipalTest.cs", - "/src/libraries/System.DirectoryServices.AccountManagement/tests/UserPrincipalTest.cs", - "/src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs", - "/src/libraries/System.Net.Http/tests/UnitTests/DigestAuthenticationTests.cs", - "/src/libraries/System.Net.Http/tests/UnitTests/HttpEnvironmentProxyTest.cs", - "/src/libraries/System.Net.Mail/tests/Functional/SmtpClientTest.cs", - "/src/libraries/System.Net.Requests/src/System/Net/FtpControlStream.cs", - "/src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs", - "/src/libraries/System.Net.WebSockets.Client/tests/ConnectTest.cs", - "/src/libraries/System.Private.Uri/tests/ExtendedFunctionalTests/UriRelativeResolutionTest.cs", - "/src/libraries/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs", - "/src/libraries/System.Private.Uri/tests/FunctionalTests/UriBuilderTests.cs", - "/src/libraries/System.Private.Uri/tests/FunctionalTests/UriRelativeResolutionTest.cs", - "/src/libraries/System.Runtime/tests/System/Uri.CreateStringTests.cs", - "/src/libraries/System.Security.Cryptography.Algorithms/tests/Rfc2898Tests.cs", - "/src/libraries/System.Security.Cryptography.Pkcs/tests/Pkcs12/Pkcs12Documents.cs", - "/src/libraries/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs", - "/src/libraries/System.Security.Cryptography.Xml/tests/EncryptedXmlTest.cs", - "/src/libraries/System.Security.Cryptography.Xml/tests/SignedXmlTest.cs", - "/src/libraries/System.Security.Cryptography.Xml/tests/TestHelpers.cs" - ], - "_justification": "Mostly test files. Other files contain harmless examples or constants." - }, - ] + "tool": "Credential Scanner", + "suppressions": [ + { + "_justification": "Unit test containing connection strings under the test.", + "file": [ + "src/libraries/System.Data.Common/tests/System/Data/Common/DbConnectionStringBuilderTest.cs" + ] + }, + { + "_justification": "Private key for testing purpose.", + "file": [ + "src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSAKeyPemTests.cs", + "src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyPemTests.cs", + "src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/RSA/RSAKeyPemTests.cs", + "src/libraries/System.Security.Cryptography.X509Certificates/tests/TestData.cs" + ], + "placeholder": [ + "-----BEGIN PRIVATE KEY-----", + "-----BEGIN * PRIVATE KEY-----" + ] + }, + { + "_justification": "Test credential for Uri testing", + "file": [ + "src/libraries/System.Net.Http/tests/UnitTests/HttpEnvironmentProxyTest.cs", + "src/libraries/System.Private.Uri/tests/ExtendedFunctionalTests/UriRelativeResolutionTest.cs", + "src/libraries/System.Private.Uri/tests/FunctionalTests/UriBuilderRefreshTest.cs", + "src/libraries/System.Private.Uri/tests/FunctionalTests/UriBuilderTests.cs", + "src/libraries/System.Private.Uri/tests/FunctionalTests/UriRelativeResolutionTest.cs", + "src/libraries/System.Runtime/tests/System/Uri.CreateStringTests.cs" + ], + "placeholder": [ + "//*:;&$=123USERINFO@", + "//*:bar@", + "//*:bar1@", + "//*:password1@", + "//*:psw@", + "//*:userinfo2@" + ] + }, + { + "_justification": "Generic test password.", + "file": [ + "src/libraries/Common/tests/System/Net/Configuration.Certificates.cs", + "src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.Authentication.cs", + "src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs", + "src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.DefaultProxyCredentials.cs", + "src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs", + "src/libraries/Common/tests/System/Net/Prerequisites/Deployment/setup_certificates.ps1", + "src/libraries/System.Net.Http/tests/FunctionalTests/SocketsHttpHandlerTest.cs", + "src/libraries/System.Net.Http/tests/UnitTests/DigestAuthenticationTests.cs", + "src/libraries/System.Net.Http/tests/UnitTests/HttpEnvironmentProxyTest.cs", + "src/libraries/System.Net.Mail/tests/Functional/SmtpClientTest.cs", + "src/libraries/System.Security.Cryptography.Xml/tests/SignedXmlTest.cs", + "src/libraries/System.Security.Cryptography.Xml/tests/TestHelpers.cs" + ], + "placeholder": [ + "\"anotherpassword\"", + "\"bar\"", + "\"mono\"", + "\"password1\"", + "\"rightpassword\"", + "\"testcertificate\"", + "\"unused\"", + "\"wrongpassword\"" + ] + } + ] } diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 519943094947..d706d96a00e0 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "1.0.0-prerelease.20352.2", + "version": "1.0.0-prerelease.20530.4", "commands": [ "xharness" ] diff --git a/.editorconfig b/.editorconfig index 9d03bd30636c..4986cd7d1964 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,6 +15,10 @@ trim_trailing_whitespace = true [project.json] indent_size = 2 +# Generated code +[*{_AssemblyInfo.cs,.notsupported.cs}] +generated_code = true + # C# files [*.cs] # New line preferences @@ -155,10 +159,11 @@ csharp_space_between_square_brackets = false # Analyzers dotnet_code_quality.ca1802.api_surface = private, internal +dotnet_code_quality.ca1822.api_surface = private, internal dotnet_code_quality.ca2208.api_surface = public # License header -file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.\n +file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license. # C++ Files [*.{cpp,h,in}] diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000000..769b0081686d --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,62 @@ +# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths. +# See https://help.github.com/articles/about-code-owners/ + +/src/libraries/Common/src/System/Net/Http/aspnetcore/ @dotnet/http +/src/libraries/Common/tests/Tests/System/Net/aspnetcore/ @dotnet/http +/src/libraries/System.Text.Json/ @ahsonkhan @steveharter @layomia @Jozkee +/src/libraries/System.Buffers/ @ahsonkhan +/src/libraries/System.Memory/ @ahsonkhan + +# CoreCLR Code Owners + +/src/coreclr/src/inc/corinfo.h @dotnet/jit-contrib +/src/coreclr/src/inc/corjit.h @dotnet/jit-contrib +/src/coreclr/src/jit/ @dotnet/jit-contrib + +# Mono Code Owners + +/src/mono @marek-safar + +/src/mono/llvm @vargaz @SamMonoRT @imhameed @EgorBo + +/src/mono/mono/arch @vargaz +/src/mono/mono/benchmark @SamMonoRT @naricc +/src/mono/mono/dis @lambdageek @vargaz +/src/mono/mono/eglib @vargaz @lambdageek @CoffeeFlux + +/src/mono/mono/metadata @vargaz @lambdageek @thaystg @CoffeeFlux +/src/mono/mono/metadata/*-win* @lateralusX @lambdageek @CoffeeFlux +/src/mono/mono/metadata/handle* @lambdageek @vargaz +/src/mono/mono/metadata/monitor* @brzvlad @vargaz +/src/mono/mono/metadata/sgen* @brzvlad @vargaz @naricc +/src/mono/mono/metadata/thread* @lateralusX @lambdageek +/src/mono/mono/metadata/w32* @lateralusX @lambdageek @CoffeeFlux + +/src/mono/mono/mini @vargaz @lambdageek @SamMonoRT @CoffeeFlux +/src/mono/mono/mini/*cfgdump* @vargaz +/src/mono/mono/mini/*exceptions* @vargaz @BrzVlad +/src/mono/mono/mini/*llvm* @vargaz @imhameed @EgorBo +/src/mono/mono/mini/*ppc* @vargaz +/src/mono/mono/mini/*profiler* @BrzVlad @lambdageek +/src/mono/mono/mini/*riscv* @alexrp +/src/mono/mono/mini/*type-check* @lambdageek +/src/mono/mono/mini/debugger-agent.c @vargaz @thaystg @DavidKarlas @lambdageek +/src/mono/mono/mini/interp/* @BrzVlad @vargaz + +/src/mono/mono/native @egorbo @marek-safar +/src/mono/mono/profiler @BrzVlad @lambdageek +/src/mono/mono/sgen @BrzVlad @lambdageek @naricc + +/src/mono/mono/utils @vargaz @lambdageek @CoffeeFlux +/src/mono/mono/utils/*-win* @lateralusX @lambdageek @CoffeeFlux +/src/mono/mono/utils/atomic* @vargaz +/src/mono/mono/utils/mono-hwcap* @vargaz +/src/mono/mono/utils/mono-mem* @vargaz +/src/mono/mono/utils/mono-merp* @lambdageek @naricc @imhameed +/src/mono/mono/utils/mono-state* @lambdageek +/src/mono/mono/utils/mono-threads* @lambdageek @vargaz + +/src/mono/msvc @lateralusX @kg @akoeplinger +/src/mono/msvc/scripts @akoeplinger @kg + +/src/mono/netcore @marek-safar @akoeplinger @egorbo @vargaz @steveisok \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md index ddca1a08888f..b6b9a0a295ef 100644 --- a/.github/ISSUE_TEMPLATE/01_bug_report.md +++ b/.github/ISSUE_TEMPLATE/01_bug_report.md @@ -24,6 +24,7 @@ assignees: '' * What OS and version, and what distro if applicable? * What is the architecture (x64, x86, ARM, ARM64)? * Do you know whether it is specific to that configuration? +* If you're using Blazor, which web browser(s) do you see this issue in? --> ### Regression? diff --git a/.github/PULL_REQUEST_TEMPLATE/servicing_pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/servicing_pull_request_template.md new file mode 100644 index 000000000000..ae585706a99b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/servicing_pull_request_template.md @@ -0,0 +1,23 @@ +Fixes Issue + +Master PR + +# Description + + + +# Customer Impact + + + +# Regression + + + +# Testing + + + +# Risk + + diff --git a/.github/move.yml b/.github/move.yml new file mode 100644 index 000000000000..013f705a0883 --- /dev/null +++ b/.github/move.yml @@ -0,0 +1,27 @@ +# Configuration for Move Issues - https://github.com/dessant/move-issues + +# Delete the command comment when it contains no other content +deleteCommand: true + +# Close the source issue after moving +closeSourceIssue: true + +# Lock the source issue after moving +lockSourceIssue: false + +# Mention issue and comment authors +mentionAuthors: true + +# Preserve mentions in the issue content +keepContentMentions: false + +# Move labels that also exist on the target repository +moveLabels: false + +# Set custom aliases for targets +# aliases: +# r: repo +# or: owner/repo + +# Repository to extend settings from +# _extends: repo diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 000000000000..79cde1d3ce29 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,26 @@ +name: Backport PR to branch +on: + issue_comment: + types: [created] + +jobs: + backport: + if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/backport to') + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v2 + - name: Run backport + uses: ./eng/actions/backport + with: + auth_token: ${{ secrets.GITHUB_TOKEN }} + pr_description_template: | + Backport of #%source_pr_number% to %target_branch% + + /cc %cc_users% + + ## Customer Impact + + ## Testing + + ## Risk diff --git a/.gitignore b/.gitignore index bfe14adb6c04..7596f954d951 100644 --- a/.gitignore +++ b/.gitignore @@ -319,7 +319,6 @@ Vagrantfile CMakeFiles/ cmake_install.cmake CMakeCache.txt -Makefile # Cross compilation cross/rootfs/* @@ -353,3 +352,7 @@ src/coreclr/src/System.Private.CoreLib/common # The debug directory should not be ignored !src/coreclr/src/debug + +# Mono Wasm-specific excludes +src/mono/wasm/emsdk/ +src/mono/wasm/.stamp-wasm-install-and-select* diff --git a/Build.proj b/Build.proj index dc4a15ab5f41..2d96f02056fe 100644 --- a/Build.proj +++ b/Build.proj @@ -1,5 +1,9 @@ + + BuildTargetFramework=$([MSBuild]::ValueOrDefault('$(BuildTargetFramework)', '$(NetCoreAppCurrent)')) + + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'installer.tasks')) $([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'netstandard2.0', 'installer.tasks.dll')) - $([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'net46', 'installer.tasks.dll')) + $([MSBuild]::NormalizePath('$(InstallerTasksOutputPath)', 'Debug', 'net461', 'installer.tasks.dll')) $([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'docs')) $([MSBuild]::NormalizeDirectory('$(DocsDir)', 'manpages')) + + $([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'System.Private.CoreLib', 'src')) + $([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'src', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj')) + $([MSBuild]::NormalizePath('$(MonoProjectRoot)', 'netcore', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj')) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AppleAppBuilder', 'Debug', '$(NetCoreAppCurrent)')) - $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AndroidAppBuilder', 'Debug', '$(NetCoreAppCurrent)')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AndroidAppBuilder', 'Debug', '$(NetCoreAppCurrent)', 'publish')) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmAppBuilder', 'Debug', '$(NetCoreAppCurrent)', 'publish')) + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmBuildTasks', 'Debug', '$(NetCoreAppCurrent)', 'publish')) $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoAOTCompiler', 'Debug', '$(NetCoreAppCurrent)')) $([MSBuild]::NormalizePath('$(AppleAppBuilderDir)', 'AppleAppBuilder.dll')) $([MSBuild]::NormalizePath('$(AndroidAppBuilderDir)', 'AndroidAppBuilder.dll')) $([MSBuild]::NormalizePath('$(WasmAppBuilderDir)', 'WasmAppBuilder.dll')) + $([MSBuild]::NormalizePath('$(WasmBuildTasksDir)', 'WasmBuildTasks.dll')) $([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll')) @@ -84,6 +90,9 @@ false + + + false @@ -92,15 +101,18 @@ preview latest true + true true + + false Properties - $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + $([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) diff --git a/Directory.Build.targets b/Directory.Build.targets index f16e04d9b4e2..9d18986a3f87 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -6,6 +6,8 @@ tell Microsoft.Common.targets not to import Directory.Build.targets again --> false + + false @@ -20,4 +22,27 @@ $(MajorVersion).$(MinorVersion) + + + + + + diff --git a/NuGet.config b/NuGet.config index 13929bbcd87a..5f2930685412 100644 --- a/NuGet.config +++ b/NuGet.config @@ -16,6 +16,8 @@ + + diff --git a/README.md b/README.md index b1d2839ea39e..71c5ae530856 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://dnceng.visualstudio.com/public/_apis/build/status/dotnet/runtime/runtime?branchName=master)](https://dnceng.visualstudio.com/public/_build/latest?definitionId=686&branchName=master) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dotnet/runtime) +[![Discord](https://img.shields.io/discord/732297728826277939?style=flat-square&label=Discord&logo=discord&logoColor=white&color=7289DA)](https://aka.ms/dotnet-discord) This repo contains the code to build the .NET runtime, libraries and shared host (`dotnet`) installers for all supported platforms, as well as the sources to .NET runtime and libraries. @@ -12,7 +13,7 @@ Official Starting Page: https://dotnet.microsoft.com/ * [How to use .NET](https://docs.microsoft.com/dotnet/core/get-started) (with VS, VS Code, command-line CLI) * [Install official releases](https://dotnet.microsoft.com/download) - * [Install daily builds](https://github.com/dotnet/installer#installers-and-binaries) + * [Install daily builds](docs/project/dogfooding.md) * [Documentation](https://docs.microsoft.com/dotnet/core) (Get Started, Tutorials, Porting from .NET Framework, API reference, ...) * [Deploying apps](https://docs.microsoft.com/dotnet/core/deploying) * [Supported OS versions](https://github.com/dotnet/core/blob/master/os-lifecycle-policy.md) @@ -48,6 +49,7 @@ For other issues, please use the following repos: * [API Reference docs](https://docs.microsoft.com/dotnet/api/?view=netcore-3.1) * [.NET API Catalog](http://apisof.net) (incl. APIs from daily builds and API usage info) * [API docs writing guidelines](https://github.com/dotnet/dotnet-api-docs/wiki) - useful when writing /// comments +* [.NET Discord Server](https://aka.ms/dotnet-discord) - a place to talk and hang out with .NET community ## .NET Foundation diff --git a/SECURITY.md b/SECURITY.md index 29863ccaa542..8312d20e4537 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,8 +6,8 @@ The .NET Core and ASP.NET Core support policy, including supported versions can ## Reporting a Vulnerability -Security issues and bugs should be reported privately to the Microsoft Security Response Center (MSRC), either by emailing secure@microsoft.com or via the portal at https://msrc.microsoft.com. -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your +Security issues and bugs should be reported privately to the Microsoft Security Response Center (MSRC), either by emailing secure@microsoft.com or via the portal at https://msrc.microsoft.com. +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [MSRC Report an Issue FAQ](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue). Reports via MSRC may qualify for the .NET Core Bug Bounty. Details of the .NET Core Bug Bounty including terms and conditions are at [https://aka.ms/corebounty](https://aka.ms/corebounty). diff --git a/THIRD-PARTY-NOTICES.TXT b/THIRD-PARTY-NOTICES.TXT index 32e23122d71a..111dcf586ab5 100644 --- a/THIRD-PARTY-NOTICES.TXT +++ b/THIRD-PARTY-NOTICES.TXT @@ -520,12 +520,9 @@ Greg Parker gparker@cs.stanford.edu December 2000 This code is in the public domain and may be copied or modified without permission. -License notice for libunwind8 based code +License notice for libunwind based code ---------------------------------------- -Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P. - Contributed by David Mosberger-Tang - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including diff --git a/build.cmd b/build.cmd index 76f4d8418947..fd4aba34c4c9 100644 --- a/build.cmd +++ b/build.cmd @@ -3,6 +3,7 @@ setlocal set _args=%* if "%~1"=="-?" set _args=-help +if "%~1"=="/?" set _args=-help powershell -ExecutionPolicy ByPass -NoProfile -Command "& '%~dp0eng\build.ps1'" %_args% exit /b %ERRORLEVEL% diff --git a/docs/README.md b/docs/README.md index 130c5fa144fc..bbbc1515913f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,7 +14,7 @@ Getting Started - [Installing the .NET SDK](https://dotnet.microsoft.com/download) - [Official .NET Docs](https://docs.microsoft.com/dotnet/core/) -Workflow (Building, testing, etc.) +Workflow (Building, testing, benchmarking, profiling, etc.) =============== If you want to contribute a code change to this repo, start here. diff --git a/docs/area-owners.md b/docs/area-owners.md index 17b260a9c9ea..c84e0f573d3e 100644 --- a/docs/area-owners.md +++ b/docs/area-owners.md @@ -1,6 +1,10 @@ -If you need to tag folks on an issue or PR, you will generally want to tag the owners (not the lead). +# Pull Requests Tagging -Note: Editing this file doesn't update the mapping used by the `@msftbot` issue notification bot to tag owners. Some area owners prefer not to get those notifications. To update those notifications, contact any one of `@danmosemsft`, `@jeffschw`, `@ericstj`, or `@karelz`. If you're a community member interested in these notifications, you won't appear in this table but we can add you to notifications - just let us know. +If you need to tag folks on an issue or PR, you will generally want to tag the owners (not the lead) for [area](#areas) to which the change or issue is closest to. For areas which are large and can be operating system or architecture specific it's better to tag owners of [OS](#operating-systems) or [Architecture](#architectures). + +## Areas + +Note: Editing this file doesn't update the mapping used by the `@msftbot` issue notification bot to tag owners. Some area owners prefer not to get those notifications. To update those notifications, contact any one of `@danmosemsft`, `@jeffschw`, `@marek-safar`, `@ericstj`, `@karelz`, or `@jeffhandley`; they have permissions to update [`msftbot` configuration](https://fabric-cp.azurewebsites.net/bot/?repo=dotnet/runtime). If you're a community member interested in these notifications, you won't appear in this table but we can add you to notifications - just let us know. | Area | Lead | Owners (area experts to tag in PR's and issues) | Description | |------------------------------------------------|---------------|-----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -16,7 +20,7 @@ Note: Editing this file doesn't update the mapping used by the `@msftbot` issue | area-CoreLib-mono | @marek-safar | @vargaz | | | area-CrossGen/NGEN-coreclr | @mangod9 | @nattress | | | area-crossgen2-coreclr | @mangod9 | @nattress @trylek @dotnet/crossgen-contrib | | -| area-Debugger-mono | @lewing | @thaystg | | +| area-Debugger-mono | @lewing | @thaystg @radical | | | area-DependencyModel | @eerhardt | @eerhardt | Microsoft.Extensions.DependencyModel | | area-Diagnostics-coreclr | @tommcdon | @tommcdon | | | area-ExceptionHandling-coreclr | @mangod9 | @janvorli | | @@ -25,14 +29,14 @@ Note: Editing this file doesn't update the mapping used by the `@msftbot` issue | area-Extensions-DependencyInjection | @ericstj | @maryamariyan @eerhardt | | | area-Extensions-FileSystem | @ericstj | @maryamariyan @carlossanlop | | | area-Extensions-Hosting | @ericstj | @maryamariyan @eerhardt | | -| area-Extensions-HttpClientFactory | @ericstj | @dotnet/ncl @maryamariyan | | +| area-Extensions-HttpClientFactory | @ericstj | @dotnet/ncl | | | area-Extensions-Logging | @ericstj | @maryamariyan @tarekgh | | | area-Extensions-Options | @ericstj | @maryamariyan @ViktorHofer | | | area-Extensions-Primitives | @ericstj | @maryamariyan @eerhardt | | | area-GC-coreclr | @jeffschwMSFT | @Maoni0 | | | area-GC-mono | @SamMonoRT | @BrzVlad | | -| area-Host | @agocke | @jeffschwMSFT @vitek-karas @swaroop-sridhar | Issues with dotnet.exe including bootstrapping, framework detection, hostfxr.dll and hostpolicy.dll | -| area-HostModel | @agocke | @vitek-karas @swaroop-sridhar | | +| area-Host | @agocke | @jeffschwMSFT @vitek-karas | 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 | @ViktorHofer @jeffschwMSFT @dleeapho | | @@ -43,17 +47,17 @@ Note: Editing this file doesn't update the mapping used by the `@msftbot` issue | area-Interop-coreclr | @jeffschwMSFT | @jeffschwMSFT @AaronRobinsonMSFT | | | area-Interop-mono | @marek-safar | @lambdageek | | | area-Meta | @ericstj | @joperezr | Issues without clear association to any specific API/contract, e.g.
  • new contract proposals
  • cross-cutting code/test pattern changes (e.g. FxCop failures)
  • project-wide docs

| -| area-Microsoft.CSharp | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#33170](https://github.com/dotnet/corefx/issues/33170)) | +| 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 | | -| area-Microsoft.VisualBasic | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#33170](https://github.com/dotnet/corefx/issues/33170)) | +| area-Microsoft.VisualBasic | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#27790](https://github.com/dotnet/runtime/issues/27790)) | | area-Microsoft.Win32 | @ericstj | @maryamariyan @Anipik | Including System.Windows.Extensions | | area-PAL-coreclr | @mangod9 | @janvorli | | | area-Performance-mono | @SamMonoRT | @SamMonoRT | | | area-R2RDump-coreclr | @mangod9 | @nattress | | -| area-ReadyToRun-coreclr | @mangod9 | @nattress | | +| area-ReadyToRun-coreclr | @mangod9 | @nattress | | | | area-Serialization | @HongGit | @StephenMolloy @HongGit | Packages:
  • System.Runtime.Serialization.Xml
  • System.Runtime.Serialization.Json
  • System.Private.DataContractSerialization
  • System.Xml.XmlSerializer
Excluded:
  • System.Runtime.Serialization.Formatters
| | area-Setup | @dleeapho | @NikolaMilosavljevic @dleeapho | Distro-specific (Linux, Mac and Windows) setup packages and msi files | -| area-Single-File | @agocke | @swaroop-sridhar | | +| area-Single-File | @agocke | @vitek-karas | | | area-Snap | @dleeapho | @dleeapho @leecow @MichaelSimons | | | area-System.Buffers | @jeffhandley | @tannergooding @GrabYourPitchforks @pgovind | | | area-System.CodeDom | @jeffhandley | @buyaa-n @krwq | | @@ -73,23 +77,27 @@ Note: Editing this file doesn't update the mapping used by the `@msftbot` issue | area-System.Diagnostics.Tracing | @tommcdon | @noahfalk @tommcdon @tarekgh @Anipik | Packages:
  • System.Diagnostics.DiagnosticSource
  • System.Diagnostics.PerformanceCounter - [@Anipik](https://github.com/Anipik)
  • System.Diagnostics.Tracing
  • System.Diagnostics.TraceSource - [@Anipik](https://github.com/Anipik)

| | area-System.DirectoryServices | @tquerec | @tquerec @josephisenhour @joperezr | | | area-System.Drawing | @jeffhandley | @safern @tannergooding | | -| area-System.Dynamic.Runtime | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#33170](https://github.com/dotnet/corefx/issues/33170)) | +| 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, @eiriktsarpalis, @GrabYourPitchforks | | +| area-System.Formats.Cbor | @jeffhandley | @eiriktsarpalis, @bartonjs | | | area-System.Globalization | @ericstj | @safern @tarekgh @krwq | | | area-System.IO | @jeffhandley | @carlossanlop @jozkee | | | area-System.IO.Compression | @jeffhandley | @carlossanlop @ericstj |
  • Also includes System.IO.Packaging
| | area-System.IO.Pipelines | @kevinpi | @davidfowl @halter73 @jkotalik | | | area-System.Linq | @jeffhandley | @eiriktsarpalis @adamsitnik | | -| area-System.Linq.Expressions | @jaredpar | @cston @333fred | Archived component - limited churn/contributions (see [#33170](https://github.com/dotnet/corefx/issues/33170)) | +| 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 | @ericstj | @tarekgh @kouvel | | | area-System.Management | @ericstj | @Anipik | WMI | | area-System.Memory | @jeffhandley | @GrabYourPitchforks @adamsitnik | | | area-System.Net | @karelz | @dotnet/ncl | Included:
  • System.Uri
| | 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 @pgovind | | | area-System.Numerics.Tensors | @jeffhandley | @pgovind @eiriktsarpalis | | | area-System.Reflection | @ericstj | @steveharter @GrabYourPitchforks | | +| area-System.Reflection-mono | @SamMonoRT | @lambdageek @CoffeeFlux | MonoVM-specific reflection and reflection-emit issues | | area-System.Reflection.Emit | @ericstj | @steveharter @GrabYourPitchforks | | | area-System.Reflection.Metadata | @ericstj | @tmat @steveharter | | | area-System.Resources | @jeffhandley | @buyaa-n @tarekgh @krwq | | @@ -114,10 +122,26 @@ Note: Editing this file doesn't update the mapping used by the `@msftbot` issue | area-System.Xml | @jeffhandley | @buyaa-n @krwq | | | area-Threading-mono | @SamMonoRT | @lambdageek | | | area-TieredCompilation-coreclr | @mangod9 | @kouvel | | -| area-Tizen | | @alpencolt @gbalykov | | | area-Tracing-coreclr | @tommcdon | @sywhang @josalem | | | area-Tracing-mono | @steveisok | @lateralusX | | | area-TypeSystem-coreclr | @mangod9 | @davidwrighton @MichalStrehovsky @janvorli @mangod9 | | | area-UWP | @tommcdon | @jashook | UWP-specific issues including Microsoft.NETCore.UniversalWindowsPlatform and Microsoft.Net.UWPCoreRuntimeSdk | | area-VM-coreclr | @mangod9 | @mangod9 | | | area-VM-meta-mono | @SamMonoRT | @lambdageek @CoffeeFlux | | +## Operating Systems + +| Operating System | Lead | Owners (area experts to tag in PR's and issues) | Description | +|------------------|---------------|-----------------------------------------------------|--------------| +| os-alpine | | | | +| os-android | @steveisok | @akoeplinger | | +| os-freebsd | | | | +| os-mac-os-x | @steveisok | | | +| os-ios | @steveisok | @vargaz | | +| os-tvos | @steveisok | @vargaz | | + +## Architectures + +| Architecture | Lead | Owners (area experts to tag in PR's and issues) | Description | +|-----------------|---------------|-----------------------------------------------------|--------------| +| arch-wasm | @lewing | @lewing @BrzVlad | | + diff --git a/docs/coding-guidelines/api-guidelines/System.Memory.md b/docs/coding-guidelines/api-guidelines/System.Memory.md index 894b8ca77d9e..6df28c18ca5d 100644 --- a/docs/coding-guidelines/api-guidelines/System.Memory.md +++ b/docs/coding-guidelines/api-guidelines/System.Memory.md @@ -51,4 +51,4 @@ specs can be found here: can be implicitly converted to `ReadOnlySpan`. * **AVOID** providing overloads for both `ReadOnlySpan`/`Span` as well as pointers and arrays as those can be implicitly converted to - `ReadOnlySpan`/`Span`. \ No newline at end of file + `ReadOnlySpan`/`Span`. diff --git a/docs/coding-guidelines/api-guidelines/nullability.md b/docs/coding-guidelines/api-guidelines/nullability.md index 8c029d01fcce..9cb1b96525c2 100644 --- a/docs/coding-guidelines/api-guidelines/nullability.md +++ b/docs/coding-guidelines/api-guidelines/nullability.md @@ -99,6 +99,7 @@ The C# compiler respects a set of attributes that impact its flow analysis. We - **DO** add `[NotNullIfNotNull(string)]` if nullable ref argument will be non-`null` upon exit, when an other argument passed evaluated to non-`null`, pass that argument name as string. Example: `public void Exchange([NotNullIfNotNull("value")] ref object? location, object? value);`. - **DO** add `[return: NotNullIfNotNull(string)]` if a method would not return `null` in case an argument passed evaluated to non-`null`, pass that argument name as string. Example: `[return: NotNullIfNotNull("name")] public string? FormatName(string? name);` - **DO** add `[MemberNotNull(string fieldName)]` to a helper method which initializes member field(s), passing in the field name. Example: `[MemberNotNull("_buffer")] private void InitializeBuffer()`. This will help to avoid spurious warnings at call sites that call the initialization method and then proceed to use the specified field. Note that there are two constructors to `MemberNotNull`; one that takes a single `string`, and one that takes a `params string[]`. When the number of fields initialized is small (e.g. <= 3), it's preferable to use multiple `[MemberNotNull(string)]` attributes on the method rather than one `[MemberNotNull(string, string, string, ...)]` attribute, as the latter is not CLS compliant and will likely require `#pragma warning disable` and `#pragma warning restore` around the line to suppress warnings. +- **AVOID** using `[MaybeNull]`, not because it's problematic, but because there's almost always a better option, such as `T?` (as of this writing, in all of the dotnet/runtime there are only 7 occurrences of `[MaybeNull]`). One example of where it's applicable is `AsyncLocal.Value`; `[DisallowNull]` can't be used here, because `null` is valid if `T` is nullable, and `T?` shouldn't be used because `Value` shouldn't be set to `null` if `T` isn't nullable. Another is in the relatively rare case where a public or protected field is exposed, may begin life as null, but shouldn't be explicitly set to null. ## Code Review Guidance @@ -113,7 +114,7 @@ A code review for enabling nullability generally involves three passes: - Adding `!` to reference type usage. These essentially suppress the null warning, telling the compiler to treat the expression as if it's non-null. These evaporate at compile-time. - Adding `Debug.Assert(reference != null);` statements. These inform the compiler that the mentioned reference is non-`null`, which will cause the compiler to factor that in and have the effect of suppressing subsequent warnings on that reference (until the flow analysis suggests that could change). As with any `Debug.Assert`, these evaporate at compile-time in release builds (where `DEBUG` isn't defined). - + - Most any other changes have the potential to change the IL, which should not be necessary for the feature. In particular, it's common for `?`s on dereferences to sneak in, e.g. changing `someVar.SomeMethod()` to `someVar?.SomeMethod()`; that is a change to the IL, and should only be employed when there's an actual known bug that's important to fix, as otherwise we're incurring unnecessary cost. Similarly, it's easy to accidentally add `?` to value types, which has a significant impact, changing the `T` to a `Nullable` and should be avoided. - Any `!`s added that should have been unnecessary and are required due to either a compiler issue or due to lack of expressibility about annotations should have a `// TODO-NULLABLE: http://link/to/relevant/issue` comment added on the same line. diff --git a/docs/coding-guidelines/breaking-change-definitions.md b/docs/coding-guidelines/breaking-change-definitions.md index 6eb6f958fc7e..dbcbfd6c6cde 100644 --- a/docs/coding-guidelines/breaking-change-definitions.md +++ b/docs/coding-guidelines/breaking-change-definitions.md @@ -6,7 +6,7 @@ Behavioral Change A behavioral change represents changes to the behavior of a member. A behavioral change may including throwing a new exception, adding or removing internal method calls, or alternating the way in which a return value is calculated. Behavioral changes can be the hardest type of change to categorize as acceptable or not - they can be severe in impact, or relatively innocuous. -Binary Compatibility +Binary Compatibility -------------------- Refers to the ability of existing consumers of an API to be able to use a newer version without recompilation. By definition, if an assembly's public signatures have been removed, or altered so that consumers can no longer access the same interface exposed by the assembly, the change is said to be a _binary incompatible change_. @@ -16,19 +16,19 @@ Source Compatibility Refers to the ability of existing consumers of an API to recompile against a newer version without any source changes. By definition, if a consumer needs to make changes to its code in order for it to build successfully against a newer version of an API, the change is said to be a _source incompatible change_. -Design-Time Compatibility +Design-Time Compatibility ------------------------- _Design-time compatibility_ refers to preserving the design-time experience across versions of Visual Studio and other design-time environments. This can involve details around the UI of the designer, but by far the most interesting design-time compatibility is project compatibility. A potential project (or solution), must be able to be opened, and used on a newer version of a designer. -Backwards Compatibility +Backwards Compatibility ----------------------- -_Backwards compatibility_ refers to the ability of an existing consumer of an API to run against, and behave in the same way against a newer version. By definition, if a consumer is not able to run, or behaves differently against the newer version of the API, then the API is said to be _backwards incompatible_. +_Backwards compatibility_ refers to the ability of an existing consumer of an API to run against, and behave in the same way against a newer version. By definition, if a consumer is not able to run, or behaves differently against the newer version of the API, then the API is said to be _backwards incompatible_. Changes that affect backwards compatibility are strongly discouraged. All alternates should be actively considered, since developers will, by default, expect backwards compatibility in newer versions of an API. -Forwards Compatibility +Forwards Compatibility ---------------------- _Forwards compatibility_ is the exact reverse of backwards compatibility; it refers to the ability of an existing consumer of an API to run against, and behave in the way against a _older_ version. By definition, if a consumer is not able to run, or behaves differently against an older version of the API, then the API is said to be _forwards incompatible_. diff --git a/docs/coding-guidelines/breaking-change-rules.md b/docs/coding-guidelines/breaking-change-rules.md index 6fff08837e16..ab230f9d279a 100644 --- a/docs/coding-guidelines/breaking-change-rules.md +++ b/docs/coding-guidelines/breaking-change-rules.md @@ -19,14 +19,14 @@ Breaking Change Rules ### Property, Field, Parameter and Return Values ✓ **Allowed** * Increasing the range of accepted values for a property or parameter if the member _is not_ `virtual` - + Note that the range can only increase to the extent that it does not impact the static type. e.g. it is OK to remove `if (x > 10) throw new ArgumentOutOfRangeException("x")`, but it is not OK to change the type of `x` from `int` to `long` or `int?`. * Returning a value of a more derived type for a property, field, return or `out` value Note, again, that the static type cannot change. e.g. it is OK to return a `string` instance where an `object` was returned previously, but it is not OK to change the return type from `object` to `string`. -✗ **Disallowed** +✗ **Disallowed** * Increasing the range of accepted values for a property or parameter if the member _is_ `virtual` This is breaking because any existing overridden members will now not function correctly for the extended range of values. @@ -135,7 +135,7 @@ Breaking Change Rules So long as it does not introduce any new abstract members or change the semantics or behavior of existing members, a type can be introduced into a hierarchy between two existing types. For example, between .NET Framework 1.1 and .NET Framework 2.0, we introduced `DbConnection` as a new base class for `SqlConnection` which previously derived from `Component`. * Adding an interface implementation to a type - + This is acceptable because it will not adversely affect existing clients. Any changes which could be made to the type being changed in this situation, will have to work within the boundaries of acceptable changes defined here, in order for the new implementation to remain acceptable. Extreme caution is urged when adding interfaces that directly affect the ability of the designer or serializer to generate code or data, that cannot be consumed down-level. An example is the `ISerializable` interface. Care should be taken when the interface (or one of the interfaces that this interface requires) has default interface implementations for other interface methods. The default implementation could conflict with other default implementations in a derived class. @@ -205,7 +205,7 @@ Breaking Change Rules * Adding an overload that precludes an existing overload, and defines different behavior - This will break existing clients that were bound to the previous overload. For example, if you have a class that has a single version of a method that accepts a `uint`, an existing consumer will + This will break existing clients that were bound to the previous overload. For example, if you have a class that has a single version of a method that accepts a `uint`, an existing consumer will successfully bind to that overload, if simply passing an `int` value. However, if you add an overload that accepts an `int`, recompiling or via late-binding the application will now bind to the new overload. If different behavior results, then this is a breaking change. * Moving an exposed field onto a class higher in the hierarchy tree of the type from which it was removed diff --git a/docs/coding-guidelines/breaking-changes.md b/docs/coding-guidelines/breaking-changes.md index 5e4798cf7d1b..78b787cb70b8 100644 --- a/docs/coding-guidelines/breaking-changes.md +++ b/docs/coding-guidelines/breaking-changes.md @@ -97,7 +97,7 @@ more latitude here in .NET Core. For buckets #2 and #3 we apply a risk-benefit analysis. It doesn't matter if the old behavior is "wrong", we still need to think through the implications. This -can result in one of the following outcomes: +can result in one of the following outcomes: * **Accepted with compat switch**. Depending on the estimated customer impact, we may decide to add a compat switch that allows consumers to bring back the diff --git a/docs/coding-guidelines/coding-style.md b/docs/coding-guidelines/coding-style.md index 6686ac7702df..6181ee3dbe99 100644 --- a/docs/coding-guidelines/coding-style.md +++ b/docs/coding-guidelines/coding-style.md @@ -24,13 +24,14 @@ The general rule we follow is "use Visual Studio defaults". 9. If a file happens to differ in style from these guidelines (e.g. private members are named `m_member` rather than `_member`), the existing style in that file takes precedence. 10. We only use `var` when it's obvious what the variable type is (e.g. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`). -11. We use language keywords instead of BCL types (e.g. `int, string, float` instead of `Int32, String, Single`, etc) for both type references as well as method calls (e.g. `int.Parse` instead of `Int32.Parse`). See issue [391](https://github.com/dotnet/corefx/issues/391) for examples. +11. We use language keywords instead of BCL types (e.g. `int, string, float` instead of `Int32, String, Single`, etc) for both type references as well as method calls (e.g. `int.Parse` instead of `Int32.Parse`). See issue [#13976](https://github.com/dotnet/runtime/issues/13976) for examples. 12. We use PascalCasing to name all our constant local variables and fields. The only exception is for interop code where the constant value should exactly match the name and value of the code you are calling via interop. -13. We use ```nameof(...)``` instead of ```"..."``` whenever possible and relevant. -14. Fields should be specified at the top within type declarations. -15. When including non-ASCII characters in the source code use Unicode escape sequences (\uXXXX) instead of literal characters. Literal non-ASCII characters occasionally get garbled by a tool or editor. -16. When using labels (for goto), indent the label one less than the current indentation. -17. When using a single-statement if, we follow these conventions: +13. We use PascalCasing for all method names, including local functions. +14. We use ```nameof(...)``` instead of ```"..."``` whenever possible and relevant. +15. Fields should be specified at the top within type declarations. +16. When including non-ASCII characters in the source code use Unicode escape sequences (\uXXXX) instead of literal characters. Literal non-ASCII characters occasionally get garbled by a tool or editor. +17. When using labels (for goto), indent the label one less than the current indentation. +18. When using a single-statement if, we follow these conventions: - Never use single-line form (for example: `if (source == null) throw new ArgumentNullException("source");`) - Using braces is always accepted, and required if any block of an `if`/`else if`/.../`else` compound statement uses braces or if a single statement body spans multiple lines. - Braces may be omitted only if the body of *every* block associated with an `if`/`else if`/.../`else` compound statement is placed on a single line. diff --git a/docs/coding-guidelines/interop-guidelines.md b/docs/coding-guidelines/interop-guidelines.md index e6e3a1d32060..7dff0711a8d3 100644 --- a/docs/coding-guidelines/interop-guidelines.md +++ b/docs/coding-guidelines/interop-guidelines.md @@ -58,7 +58,7 @@ internal static partial class Interop ``` As shown above, platforms may be additive, in that an assembly may use functionality from multiple folders, e.g. System.IO.FileSystem's Linux build will use functionality both from Unix (common across all Unix systems) and from Linux (specific to Linux and not available across non-Linux Unix systems). -   + - Interop.*.cs files are created in a way such that every assembly consuming the file will need every DllImport it contains. - If multiple related DllImports will all be needed by every consumer, they may be declared in the same file, named for the functionality grouping, e.g. Interop.IOErrors.cs. - Otherwise, in the limit (and the expected case for most situations) each Interop.*.cs file will contain a single DllImport and associated interop types (e.g. the structs used with that signature) and helper wrappers, e.g. Interop.strerror.cs. @@ -104,7 +104,7 @@ internal static partial class Interop // contents of Common\src\Interop\Windows\ ``` (Note that this will likely result in some extra constants defined in each assembly that uses interop, which minimally violates one of the goals, but it's very minimal.) -   + - .csproj project files then include the interop code they need, e.g. ```XML @@ -170,10 +170,10 @@ To address this, we're moving to a model where all UNIX interop from dotnet/runt Guidelines for shim C++ API: -- Keep them as "thin"/1:1 as possible. - - We want to write the majority of code in C#. +- Keep them as "thin"/1:1 as possible. + - We want to write the majority of code in C#. - Never skip the shim and P/Invoke directly to the underlying platform API. It's easy to assume something is safe/guaranteed when it isn't. -- Don't cheat and take advantage of coincidental agreement between one flavor's ABI and the shim's ABI. +- Don't cheat and take advantage of coincidental agreement between one flavor's ABI and the shim's ABI. - Use PascalCase in a style closer to Win32 than libc. - If an export point has a 1:1 correspondence to the platform API, then name it after the platform API in PascalCase (e.g. stat -> Stat, fstat -> FStat). - If an export is not 1:1, then spell things out as we typically would in dotnet/runtime code (i.e. don't use abbreviations unless they come from the underlying API. diff --git a/docs/coding-guidelines/project-guidelines.md b/docs/coding-guidelines/project-guidelines.md index 36a43555afff..afc05f4037b2 100644 --- a/docs/coding-guidelines/project-guidelines.md +++ b/docs/coding-guidelines/project-guidelines.md @@ -1,41 +1,33 @@ # Build Project Guidelines -In order to work in dotnet/runtime repo you must first run build.cmd/sh from the root of the repo at least -once before you can iterate and work on a given library project. +In order to work in the dotnet/runtime repo you must first run build.cmd/sh from the root of the repo at least once before you can iterate and work on a given library project. ## Behind the scenes with build.cmd/sh -- Setup tools (currently done in restore in build.cmd/sh) +- Restore tools - Restore external dependencies - CoreCLR - Copy to `bin\runtime\$(BuildTargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)` - - Netstandard Library - Copy to `bin\ref\netstandard2.0` - - NetFx targeting pack - Copy to `bin\ref\net472` - Build targeting pack - Build src\libraries\ref.proj which builds all references assembly projects. For reference assembly project information see [ref](#ref) - Build product - Build src\libraries\src.proj which builds all the source library projects. For source library project information see [src](#src). -- Sign product - - Build src\sign.proj # Build Pivots Below is a list of all the various options we pivot the project builds on: -- **Target Frameworks:** NetFx (aka Desktop), netstandard (aka dotnet/Portable), NETCoreApp (aka .NET Core) -- **Platform Runtimes:** NetFx (aka CLR/Desktop), CoreCLR, Mono +- **Target Frameworks:** .NETFramework, .NETStandard, .NETCoreApp +- **Platform Runtimes:** .NETFramework (aka CLR/Desktop), CoreCLR, Mono - **OS:** Windows_NT, Linux, OSX, FreeBSD, AnyOS - **Flavor:** Debug, Release -- **Architecture:** x86, x64, arm, arm64, AnyCPU ## Individual build properties The following are the properties associated with each build pivot -- `$(BuildTargetFramework) -> netstandard2.1 | net5.0 | net472` +- `$(BuildTargetFramework) -> Any .NETCoreApp or .NETFramework TFM, e.g. net5.0` - `$(TargetOS) -> Windows | Linux | OSX | FreeBSD | [defaults to running OS when empty]` - `$(Configuration) -> Release | [defaults to Debug when empty]` - `$(TargetArchitecture) - x86 | x64 | arm | arm64 | [defaults to x64 when empty]` - `$(RuntimeOS) - win7 | osx10.10 | ubuntu.14.04 | [any other RID OS+version] | [defaults to running OS when empty]` See [RIDs](https://github.com/dotnet/runtime/tree/master/src/libraries/pkg/Microsoft.NETCore.Platforms) for more info. -For more information on various targets see also [.NET Standard](https://github.com/dotnet/standard/blob/master/docs/versions.md) - ## Aggregate build properties Each project will define a set of supported TargetFrameworks @@ -60,21 +52,8 @@ Pure netstandard configuration: All supported targets with unique windows/unix build for netcoreapp: ``` - $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetFrameworkCurrent)-Windows_NT - -``` - -### Placeholder Target Frameworks -Placeholder Target Framework can be added to the `` property to indicate the build system that the specific project is inbox in that framework and that Build Setting needs to be ignored. - -Placeholder target frameworks start with _ prefix. - -Example: -When we have a project that has a `netstandard2.0` target framework that means that this project is compatible with any build setting. So if we do a vertical build for `net472` this project will be built as part of the vertical because `net472` is compatible with `netstandard2.0`. This means that in the runtime and testhost binaries the netstandard2.0 implementation will be included, and we will test against those assets instead of testing against the framework inbox asset. In order to tell the build system to not include this project as part of the `net472` vertical we need to add a placeholder target framework: -``` + $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;net461-Windows_NT - netstandard2.0;_net472 - ``` ## Options for building @@ -94,7 +73,7 @@ When building an individual project the `BuildTargetFramework` and `TargetOS` wi ## Supported full build settings - .NET Core latest on current OS (default) -> `$(NetCoreAppCurrent)-[RunningOS]` -- .NET Framework latest -> `$(NetFrameworkCurrent)-Windows_NT` +- .NET Framework latest -> `net48-Windows_NT` # Library project guidelines @@ -152,44 +131,34 @@ Reference assemblies are required for any library that has more than one impleme In the ref directory for the library there should be at most **one** `.csproj` that contains the latest API for the reference assembly for the library. That project can contain multiple entries in its `TargetFrameworks` property. Ref projects should use `` for its dependencies. ### ref output -The output for the ref project build will be a flat targeting pack folder in the following directory: +All ref outputs should be under -`bin\ref\$(TargetFramework)` - -
//**CONSIDER**: Do we need a specific BuildTargetFramework version of TargetFramework for this output path to ensure all projects output to same targeting path? +`bin\$(MSBuildProjectName)\ref\$(TargetFramework)` ## src In the src directory for a library there should be only **one** `.csproj` file that contains any information necessary to build the library in various target frameworks. All supported target frameworks should be listed in the `TargetFrameworks` property. -All libraries should use `` for all their project references. That will cause them to be resolved against a targeting pack (i.e. `bin\ref\net5.0` or `\bin\ref\netstandard2.0`) based on the project target framework. There should not be any direct project references to other libraries. The only exception to that rule right now is for partial facades which directly reference System.Private.CoreLib and thus need to directly reference other partial facades to avoid type conflicts. -
//**CONSIDER**: just using Reference and use a reference to System.Private.CoreLib as a trigger to turn the other References into a ProjectReference automatically. That will allow us to have consistency where all projects just use Reference. +All libraries should use `` for all their references to libraries that compose the shared framework of the current .NETCoreApp. That will cause them to be resolved against the locally built targeting pack which is located at `artifacts\bin\microsoft.netcore.app.ref`. The only exception to that rule right now is for partial facades which directly reference System.Private.CoreLib and thus need to directly reference other partial facades to avoid type conflicts. -### src output -The output for the src product build will be a flat runtime folder into the following directory: +Other target frameworks than .NETCoreApp latest (i.e. `netstandard2.0`, `net461`, `netcoreapp3.0`) should use ProjectReference items to reference dependencies. -`bin\runtime\$(BuildSettings)` +### src output +All src outputs are under -Note: The `BuildSettings` is a global property and not the project setting because we need all projects to output to the same runtime directory no matter which compatible target framework we select and build the project with. -```$(BuildTargetFramework)-$(TargetOS)-(Configuration)-(TargetArchitecture)``` +`bin\$(MSBuildProjectName)\$(TargetFramework)` ## pkg In the pkg directory for the library there should be only **one** `.pkgproj` for the primary package for the library. If the library has platform-specific implementations those should be split into platform specific projects in a subfolder for each platform. (see [Package projects](./package-projects.md)) -TODO: Outline changes needed for pkgprojs - ## tests Similar to the src projects tests projects will define a `TargetFrameworks` property so they can list out the set of target frameworks they support. -Tests should not have any `` or `` items in their project because they will automatically reference everything in the targeting pack based on the TargetFramework they are building in. The only exception to this is a `` can be used to reference other test helper libraries or assets. - -In order to build and run a test project in a given build target framework a root level build.cmd/sh must have been completed for that build target framework first. Tests will run on the live built runtime at `bin\runtime\$(BuildSettings)`. -TODO: We need update our test host so that it can run from the shared runtime directory as well as resolve assemblies from the test output directory. +Tests don't need to reference default references which are part of the targeting packs (i.e. `mscorlib` on .NETFramework or `System.Runtime` on .NETCoreApp). Everything on top of targeting packs should be referenced via ProjectReference items for live built assets. ### tests output All test outputs should be under -`bin\tests\$(MSBuildProjectName)\$(TargetFramework)` or -`bin\tests\$(MSBuildProjectName)\netstandard2.0` +`bin\$(MSBuildProjectName)\$(TargetFramework)` ## Facades Facade are unique in that they don't have any code and instead are generated by finding a contract reference assembly with the matching identity and generating type forwards for all the types to where they live in the implementation assemblies (aka facade seeds). There are also partial facades which contain some type forwards as well as some code definitions. All the various build configurations should be contained in the one csproj file per library. diff --git a/docs/coding-guidelines/updating-ref-source.md b/docs/coding-guidelines/updating-ref-source.md index a906f97eb040..a0599fae4dec 100644 --- a/docs/coding-guidelines/updating-ref-source.md +++ b/docs/coding-guidelines/updating-ref-source.md @@ -3,7 +3,7 @@ This document provides the steps you need to take to update the reference assemb ## For most assemblies within libraries 1. Implement the API in the source assembly and [build it](../workflow/building/libraries/README.md#building-individual-libraries). Note that when adding new public types, this might fail with a `TypeMustExist` error. The deadlock can be worked around by disabling the `RunApiCompat` property: `dotnet build /p:RunApiCompat=false`. -2. Run the following command (from the src directory) `msbuild /t:GenerateReferenceAssemblySource` to update the reference assembly**. +2. Run the following command (from the src directory) `dotnet msbuild /t:GenerateReferenceAssemblySource` to update the reference assembly**. 3. Navigate to the ref directory and build the reference assembly. 4. Add, build, and run tests. @@ -15,3 +15,11 @@ These steps can also be applied to some unique assemblies which depend on change 1) Run `dotnet build --no-incremental /t:GenerateReferenceSource` from the System.Runtime/src directory. 2) Filter out all unrelated changes and extract the changes you care about (ignore certain attributes being removed). Generally, this step is not required for other reference assemblies. + +## For Full Facade Assemblies + +For assemblies that are "full facades" over another assembly (ex. System.Runtime.Serialization.Json or System.Xml.XDocument), use the following command to generate the reference source code instead: + +``` +dotnet msbuild /t:GenerateReferenceAssemblySource /p:GenAPIAdditionalParameters=--follow-type-forwards +``` diff --git a/docs/design/coreclr/botr/corelib.md b/docs/design/coreclr/botr/corelib.md index b23ddba8143a..288e4be0353b 100644 --- a/docs/design/coreclr/botr/corelib.md +++ b/docs/design/coreclr/botr/corelib.md @@ -201,7 +201,7 @@ Here's a real-world example from the `String` class: ```CSharp public partial sealed class String -{ +{ [MethodImpl(MethodImplOptions.InternalCall)] private extern string? IsInterned(); diff --git a/docs/design/coreclr/botr/method-descriptor.md b/docs/design/coreclr/botr/method-descriptor.md index 7d3f24ccf40f..453e850f1d7e 100644 --- a/docs/design/coreclr/botr/method-descriptor.md +++ b/docs/design/coreclr/botr/method-descriptor.md @@ -1,4 +1,4 @@ -Method Descriptor +Method Descriptor ================= Author: Jan Kotas ([@jkotas](https://github.com/jkotas)) - 2006 diff --git a/docs/design/coreclr/botr/readytorun-format.md b/docs/design/coreclr/botr/readytorun-format.md index 8db3423dbadf..ff48f53c16c3 100644 --- a/docs/design/coreclr/botr/readytorun-format.md +++ b/docs/design/coreclr/botr/readytorun-format.md @@ -9,7 +9,7 @@ Revisions: # Introduction This document describes ReadyToRun format 3.1 implemented in CoreCLR as of June 2019 and not yet -implemented proposed extensions 4.1 for the support of composite R2R file format. +implemented proposed extensions 4.1 for the support of composite R2R file format. **Composite R2R file format** has basically the same structure as the traditional R2R file format defined in earlier revisions except that the output file represents a larger number of input MSIL assemblies compiled together as a logical unit. @@ -320,8 +320,8 @@ basic encoding, with extended encoding for large values). ## ReadyToRunSectionType.RuntimeFunctions -This section contains sorted array of `RUNTIME_FUNCTION` entries that describe all code blocks in the image with pointers to their unwind info. -Despite the name, these code block might represent a method body, or it could be just a part of it (e.g. a funclet) that requires its own unwind data. +This section contains sorted array of `RUNTIME_FUNCTION` entries that describe all code blocks in the image with pointers to their unwind info. +Despite the name, these code block might represent a method body, or it could be just a part of it (e.g. a funclet) that requires its own unwind data. The standard Windows xdata/pdata format is used. ARM format is used for x86 to compensate for the lack of x86 unwind info standard. The unwind info blob is immediately followed by the GC info blob. The encoding slightly differs for amd64 diff --git a/docs/design/coreclr/botr/shared-generics.md b/docs/design/coreclr/botr/shared-generics.md index 6b23563ebf22..367d2caa6d8b 100644 --- a/docs/design/coreclr/botr/shared-generics.md +++ b/docs/design/coreclr/botr/shared-generics.md @@ -47,7 +47,7 @@ This feature is currently only supported for instantiations over reference types The dictionary used by any given generic method is pointed at by the `m_pPerInstInfo` field on the `InstantiatedMethodDesc` structure of that method. It's a direct pointer to the contents of the generic dictionary data. -On generic types, there's an extra level of indirection: the `m_pPerInstInfo` field on the `MethodTable` structure is a pointer to a table of dictionaries, and each entry in that table is a pointer to the actual generic dictionary data. This is because types have inheritance, and derived generic types inherit the dictionaries of their base types. +On generic types, there's an extra level of indirection: the `m_pPerInstInfo` field on the `MethodTable` structure is a pointer to a table of dictionaries, and each entry in that table is a pointer to the actual generic dictionary data. This is because types have inheritance, and derived generic types inherit the dictionaries of their base types. Here's an example: ```c# diff --git a/docs/design/coreclr/botr/type-system.md b/docs/design/coreclr/botr/type-system.md index dba3a0e22fa7..d111fd79f03f 100644 --- a/docs/design/coreclr/botr/type-system.md +++ b/docs/design/coreclr/botr/type-system.md @@ -1,4 +1,4 @@ -Type System Overview +Type System Overview ==================== Author: David Wrighton ([@davidwrighton](https://github.com/davidwrighton)) - 2010 diff --git a/docs/design/coreclr/botr/vectors-and-intrinsics.md b/docs/design/coreclr/botr/vectors-and-intrinsics.md index 0e0848950c2c..2688db9ca376 100644 --- a/docs/design/coreclr/botr/vectors-and-intrinsics.md +++ b/docs/design/coreclr/botr/vectors-and-intrinsics.md @@ -3,7 +3,7 @@ Vectors and Hardware Intrinsics Support --- # Introduction -The CoreCLR runtime has support for several varieties of hardware intrinsics, and various ways to compile code which uses them. This support varies by target processor, and the code produced depends on how the jit compiler is invoked. This document describes the various behaviors of intrinsics in the runtime, and concludes with implications for developers working on the runtime and libraries portions of the runtime. +The CoreCLR runtime has support for several varieties of hardware intrinsics, and various ways to compile code which uses them. This support varies by target processor, and the code produced depends on how the jit compiler is invoked. This document describes the various behaviors of intrinsics in the runtime, and concludes with implications for developers working on the runtime and libraries portions of the runtime. # Acronyms and definitions | Acronym | Definition @@ -44,8 +44,8 @@ There are 2 different implementations of AOT compilation under development at th ###Code written in System.Private.CoreLib.dll #### Crossgen implementation rules -- Any code which uses `Vector` will not be compiled AOT. (See code which throws a TypeLoadException using `IDS_EE_SIMD_NGEN_DISALLOWED`) -- Code which uses Sse and Sse2 platform hardware intrinsics is always generated as it would be at jit time. +- Any code which uses `Vector` will not be compiled AOT. (See code which throws a TypeLoadException using `IDS_EE_SIMD_NGEN_DISALLOWED`) +- Code which uses Sse and Sse2 platform hardware intrinsics is always generated as it would be at jit time. - Code which uses Sse3, Ssse3, Sse41, Sse42, Popcnt, Pclmulqdq, and Lzcnt instruction sets will be generated, but the associated IsSupported check will be a runtime check. See `FilterNamedIntrinsicMethodAttribs` for details on how this is done. - Code which uses other instruction sets will be generated as if the processor does not support that instruction set. (For instance, a usage of Avx2.IsSupported in CoreLib will generate native code where it unconditionally returns false, and then if and when tiered compilation occurs, the function may be rejitted and have code where the property returns true.) - Non-platform intrinsics which require more hardware support than the minimum supported hardware capability will not take advantage of that capability. In particular the code generated for `Vector2/3/4.Dot`, and `Math.Round`, and `MathF.Round`. See `FilterNamedIntrinsicMethodAttribs` for details. MethodImplOptions.AggressiveOptimization may be used to disable precompilation compilation of this sub-par code. @@ -58,8 +58,8 @@ The rules here provide the following characteristics. - AOT generated code which could take advantage of more advanced hardware support experiences a performance penalty until rejitted. (If a customer chooses to disable tiered compilation, then customer code may always run slowly). #### Code review rules for code written in System.Private.CoreLib.dll -- Any use of a platform intrinsic in the codebase MUST be wrapped with a call to the associated IsSupported property. This wrapping MUST be done within the same function that uses the hardware intrinsic, and MUST NOT be in a wrapper function unless it is one of the intrinsics that are enabled by default for crossgen compilation of System.Private.CoreLib (See list above in the implementation rules section). -- Within a single function that uses platform intrinsics, it must behave identically regardless of whether IsSupported returns true or not. This rule is required as code inside of an IsSupported check that calls a helper function cannot assume that the helper function will itself see its use of the same IsSupported check return true. This is due to the impact of tiered compilation on code execution within the process. +- Any use of a platform intrinsic in the codebase MUST be wrapped with a call to the associated IsSupported property. This wrapping MUST be done within the same function that uses the hardware intrinsic, and MUST NOT be in a wrapper function unless it is one of the intrinsics that are enabled by default for crossgen compilation of System.Private.CoreLib (See list above in the implementation rules section). +- Within a single function that uses platform intrinsics, it must behave identically regardless of whether IsSupported returns true or not. This rule is required as code inside of an IsSupported check that calls a helper function cannot assume that the helper function will itself see its use of the same IsSupported check return true. This is due to the impact of tiered compilation on code execution within the process. - Excessive use of intrinsics may cause startup performance problems due to additional jitting, or may not achieve desired performance characteristics due to suboptimal codegen. ACCEPTABLE Code @@ -130,7 +130,7 @@ public class BitOperations of this method may be compiled as if the Avx2 feature is not available, and is not reliably rejitted at the same time as the PopCount function. - As a special note, on the x86 and x64 platforms, this generally unsafe pattern may be used + As a special note, on the x86 and x64 platforms, this generally unsafe pattern may be used with the Sse, Sse2, Sse3, Sssse3, Ssse41 and Sse42 instruction sets as those instruction sets are treated specially by both crossgen1 and crossgen2 when compiling System.Private.CoreLib.dll. } @@ -140,16 +140,16 @@ public class BitOperations ### Code written in other assemblies (both first and third party) #### Crossgen implementation rules -- Any code which uses an intrinsic from the `System.Runtime.Intrinsics.Arm` or `System.Runtime.Intrinsics.X86` namespace will not be compiled AOT. (See code which throws a TypeLoadException using `IDS_EE_HWINTRINSIC_NGEN_DISALLOWED`) -- Any code which uses `Vector` will not be compiled AOT. (See code which throws a TypeLoadException using `IDS_EE_SIMD_NGEN_DISALLOWED`) -- Any code which uses `Vector64`, `Vector128` or `Vector256` will not be compiled AOT. (See code which throws a TypeLoadException using `IDS_EE_HWINTRINSIC_NGEN_DISALLOWED`) +- Any code which uses an intrinsic from the `System.Runtime.Intrinsics.Arm` or `System.Runtime.Intrinsics.X86` namespace will not be compiled AOT. (See code which throws a TypeLoadException using `IDS_EE_HWINTRINSIC_NGEN_DISALLOWED`) +- Any code which uses `Vector` will not be compiled AOT. (See code which throws a TypeLoadException using `IDS_EE_SIMD_NGEN_DISALLOWED`) +- Any code which uses `Vector64`, `Vector128` or `Vector256` will not be compiled AOT. (See code which throws a TypeLoadException using `IDS_EE_HWINTRINSIC_NGEN_DISALLOWED`) - Non-platform intrinsics which require more hardware support than the minimum supported hardware capability will not take advantage of that capability. In particular the code generated for Vector2/3/4 is sub-optimal. MethodImplOptions.AggressiveOptimization may be used to disable compilation of this sub-par code. #### Characteristics which result from rules The rules here provide the following characteristics. - Use of platform specific hardware intrinsics causes runtime jit and startup time concerns. - Use of `Vector` causes runtime jit and startup time concerns -- AOT generated code which could take advantage of more advanced hardware support experiences a performance penalty until rejitted. (If a customer chooses to disable tiered compilation, then customer code may always run slowly). +- AOT generated code which could take advantage of more advanced hardware support experiences a performance penalty until rejitted. (If a customer chooses to disable tiered compilation, then customer code may always run slowly). #### Code review rules for use of platform intrinsics - Any use of a platform intrinsic in the codebase SHOULD be wrapped with a call to the associated IsSupported property. This wrapping may be done within the same function that uses the hardware intrinsic, but this is not required as long as the programmer can control all entrypoints to a function that uses the hardware intrinsic. @@ -183,7 +183,7 @@ Since System.Private.CoreLib.dll is known to be code reviewed with the code revi # Mechanisms in the JIT to generate correct code to handle varied instruction set support -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 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. diff --git a/docs/design/coreclr/botr/virtual-stub-dispatch.md b/docs/design/coreclr/botr/virtual-stub-dispatch.md index af80f0a84c96..bf67c5895bcb 100644 --- a/docs/design/coreclr/botr/virtual-stub-dispatch.md +++ b/docs/design/coreclr/botr/virtual-stub-dispatch.md @@ -91,7 +91,7 @@ The following is a small class structure (modeled in C#), and what the resulting ![Figure 1](images/virtualstubdispatch-fig1.png) -Thus, looking at this map, we see that the first column of the sub-maps of the slot maps correspond to the slot number in the classic virtual table view (remember that System.Object contributes four virtual methods of its own, which are omitted for clarity). Searches for method implementations are always bottom-up. Thus, if I had an object of type _B_ and I wished to invoke _I.Foo_, I would look for a mapping of _I.Foo_ starting at _B_'s slot map. Not finding it there, I would look in _A_'s slot map and find it there. It states that virtual slot 0 of _I_ (corresponding to _I.Foo_) is implemented by virtual slot 0. Then I return to _B_'s slot map and search for an implementation for slot 0, and find that it is implemented by slot 1 in its own implementation table. +Thus, looking at this map, we see that the first column of the sub-maps of the slot maps correspond to the slot number in the classic virtual table view (remember that System.Object contributes four virtual methods of its own, which are omitted for clarity). Searches for method implementations are always bottom-up. Thus, if I had an object of type _B_ and I wished to invoke _I.Foo_, I would look for a mapping of _I.Foo_ starting at _B_'s slot map. Not finding it there, I would look in _A_'s slot map and find it there. It states that virtual slot 0 of _I_ (corresponding to _I.Foo_) is implemented by virtual slot 4. Then I return to _B_'s slot map and search for an implementation for virtual slot 4, and find that it is implemented by slot 1 in its own implementation table. ### Additional Uses diff --git a/docs/design/coreclr/botr/xplat-minidump-generation.md b/docs/design/coreclr/botr/xplat-minidump-generation.md index f0836ae5c214..46fd6bdf3727 100644 --- a/docs/design/coreclr/botr/xplat-minidump-generation.md +++ b/docs/design/coreclr/botr/xplat-minidump-generation.md @@ -1,6 +1,6 @@ # Introduction # -Core dump generation on Linux and other non-Windows platforms has several challenges. Dumps can be very large and the default name/location of a dump is not consistent across all our supported platforms. The size of a full core dumps can be controlled somewhat with the "coredump_filter" file/flags but even with the smallest settings may be still too large and may not contain all the managed state needed for debugging. By default, some platforms use _core_ as the name and place the core dump in the current directory from where the program is launched; others add the _pid_ to the name. Configuring the core name and location requires superuser permission. Requiring superuser to make this consistent is not a satisfactory option. +Dump generation on Windows, Linux and other non-Windows platforms has several challenges. Dumps can be very large and the default name/location of a dump is not consistent across all our supported platforms. The size of a full core dumps can be controlled somewhat with the "coredump_filter" file/flags but even with the smallest settings may be still too large and may not contain all the managed state needed for debugging. By default, some platforms use _core_ as the name and place the core dump in the current directory from where the program is launched; others add the _pid_ to the name. Configuring the core name and location requires superuser permission. Requiring superuser to make this consistent is not a satisfactory option. Our goal is to generate core dumps that are on par with WER (Windows Error Reporting) crash dumps on any supported Linux platform. To the very least we want to enable the following: - automatic generation of minimal size minidumps. The quality and quantity of the information contained in the dump should be on par with the information contained in a traditional Windows mini-dump. @@ -12,7 +12,7 @@ Our solution at this time is to intercept any unhandled exception in the PAL lay We looked at the existing technologies like Breakpad and its derivatives (e.g.: an internal MS version called _msbreakpad_ from the SQL team....). Breakpad generates Windows minidumps but they are not compatible with existing tools like Windbg, etc. Msbreakpad even more so. There is a minidump to Linux core conversion utility but it seems like a wasted extra step. _Breakpad_ does allow the minidump to be generated in-process inside the signal handlers. It restricts the APIs to what was allowed in a "async" signal handler (like SIGSEGV) and has a small subset of the C++ runtime that was also similarly constrained. We also need to add the set of memory regions for the "managed" state which requires loading and using the _DAC_'s (*) enumerate memory interfaces. Loading modules is not allowed in an async signal handler but forking/execve is allowed so launching an utility that loads the _DAC_, enumerates the list of memory regions and writes the dump is the only reasonable option. It would also allow uploading the dump to a server too. -\* The _DAC_ is a special build of parts of the coreclr runtime that allows inspection of the runtime's managed state (stacks, variables, GC state heaps) out of context. One of the many interfaces it provides is [ICLRDataEnumMemoryRegions](https://github.com/dotnet/runtime/blob/master/src/coreclr/src/debug/daccess/dacimpl.h) which enumerates all the managed state a minidump would require to enable a fuitful debugging experience. +\* The _DAC_ is a special build of parts of the coreclr runtime that allows inspection of the runtime's managed state (stacks, variables, GC state heaps) out of context. One of the many interfaces it provides is [ICLRDataEnumMemoryRegions](https://github.com/dotnet/runtime/blob/master/src/coreclr/src/debug/daccess/dacimpl.h) which enumerates all the managed state a minidump would require to enable a fruitful debugging experience. _Breakpad_ could have still been used out of context in the generation utility but there seemed no value to their Windows-like minidump format when it would have to be converted to the native Linux core format away because in most scenarios using the platform tools like _lldb_ is necessary. It also adds a coreclr build dependency on Google's _Breakpad_ or SQL's _msbreakpad_ source repo. The only advantage is that the breakpad minidumps may be a little smaller because minidumps memory regions are byte granule and Linux core memory regions need to be page granule. @@ -42,7 +42,11 @@ There will be some differences gathering the crash information but these platfor ### OS X ### -Gathering the crash information on OS X will be quite a bit different than Linux and the core dump will be written in the Mach-O format instead of ELF. The OS X support currently has not been implemented. +As of .NET 5.0, createdump is supported on MacOS but instead of the MachO dump format, it generates the ELF coredumps. This is because of time constraints developing a MachO dump writer on the generation side and a MachO reader for the diagnostics tooling side (dotnet-dump and CLRMD). This means the native debuggers like gdb and lldb will not work with these dumps but the dotnet-dump tool will allow the managed state to be analyzed. Because of this behavior an additional environment variable will need to be set (COMPlus_DbgEnableElfDumpOnMacOS=1) along with the ones below in the Configuration/Policy section. + +### Windows ### + +As of .NET 5.0, createdump and the below configuration environment variables are supported on Windows. It is implemented using the Windows MiniDumpWriteDump API. This allows consistent crash/unhandled exception dumps across all of our platforms. # Configuration/Policy # @@ -75,14 +79,25 @@ The createdump utility can also be run from the command line on arbitrary .NET C `sudo createdump ` - createdump [options] pid - -f, --name - dump path and file name. The pid can be placed in the name with %d. The default is "/tmp/coredump.%d" - -n, --normal - create minidump (default). - -h, --withheap - create minidump with heap. + -f, --name - dump path and file name. The %p, %e, %h %t format characters are supported. The default is '/tmp/coredump.%p' + -n, --normal - create minidump. + -h, --withheap - create minidump with heap (default). -t, --triage - create triage minidump. -u, --full - create full core dump. -d, --diag - enable diagnostic messages. + +**Dump name formatting** + +As of .NET 5.0, the following subset of the core pattern (see [core](https://man7.org/linux/man-pages/man5/core.5.html)) dump name formatting is supported: + + %% A single % character. + %d PID of dumped process (for backwards createdump compatibility). + %p PID of dumped process. + %e The process executable filename. + %h Hostname return by gethostname(). + %t Time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). + # Testing # The test plan is to modify the SOS tests in the (still) private debuggertests repo to trigger and use the core minidumps generated. Debugging managed core dumps on Linux is not supported by _mdbg_ at this time until we have a ELF core dump reader so only the SOS tests (which use _lldb_ on Linux) will be modified. diff --git a/docs/design/coreclr/jit/GuardedDevirtualization.md b/docs/design/coreclr/jit/GuardedDevirtualization.md index 95b3caa65364..84eeaa085f72 100644 --- a/docs/design/coreclr/jit/GuardedDevirtualization.md +++ b/docs/design/coreclr/jit/GuardedDevirtualization.md @@ -28,7 +28,7 @@ happens quite early (during importation) and there is only minimal ability to do data flow analysis at this stage. So for current devirtualization the source of the type information and the consumption must be fairly close in the code. A more detailed accounting of some of the shortcomings can be found in -[CoreCLR#9908](https://github.com/dotnet/coreclr/issues/9908). +[#7541](https://github.com/dotnet/runtime/issues/7541). Resolution of these issues will improve the ability of the JIT to devirtualize, but even the best analysis possible will still miss out on many cases. Some call @@ -277,7 +277,7 @@ setup, may be able to optimize away the null check, and opens the door for inlining. So it should be slightly cheaper on average and significantly cheaper in some cases. -(Note [CoreCLR#1422](https://github.com/dotnet/coreclr/issues/14222) indicates +(Note [#9027](https://github.com/dotnet/runtime/issues/9027) indicates we should be able to optimize away the null check in any case). If the guarded tests fails we've filtered out one method table the dispatch cell diff --git a/docs/design/coreclr/jit/JitOptimizerTodoAssessment.md b/docs/design/coreclr/jit/JitOptimizerTodoAssessment.md index 7799abdabf6c..1c1eec65a4b6 100644 --- a/docs/design/coreclr/jit/JitOptimizerTodoAssessment.md +++ b/docs/design/coreclr/jit/JitOptimizerTodoAssessment.md @@ -72,8 +72,8 @@ high priority. We haven't been targeting benchmarks that spend a lot of time doing computations in an inner loop. Pursuing loop optimizations for the peanut butter effect would seem odd. So this simply hasn't bubbled up in priority yet, though it's -bound to eventually. Obvious candidates include [IV widening](https://github.com/dotnet/coreclr/issues/9179), -[unrolling](https://github.com/dotnet/coreclr/issues/11606), load/store motion, +bound to eventually. Obvious candidates include [IV widening](https://github.com/dotnet/runtime/issues/7312), +[unrolling](https://github.com/dotnet/runtime/issues/8107), load/store motion, and strength reduction. @@ -112,7 +112,7 @@ handle SSA renames. We've made note of the prevalence of async/await in modern code (and particularly in web server code such as TechEmpower), and have some opportunities listed in -[#7914](https://github.com/dotnet/coreclr/issues/7914). Some sort of study of +[#6916](https://github.com/dotnet/runtime/issues/6916). Some sort of study of async peanut butter to find more opportunities is probably in order, but what would that look like? @@ -120,7 +120,7 @@ would that look like? ### If-Conversion (cmov formation) This hits big in microbenchmarks where it hits. There's some work in flight -on this (see [#7447](https://github.com/dotnet/coreclr/issues/7447) and +on this (see [#6749](https://github.com/dotnet/runtime/issues/6749) and [#10861](https://github.com/dotnet/coreclr/pull/10861)). @@ -149,7 +149,7 @@ helpers that are known not to trash them, but the information about which helpers trash which registers is spread across a few places in the codebase, and has some puzzling quirks like separate "GC" and "NoGC" kill sets for the same helper. Unifying the information sources and then refining the recorded -kill sets would help avoid more stack traffic. See [#12940](https://github.com/dotnet/coreclr/issues/12940). +kill sets would help avoid more stack traffic. See [#8605](https://github.com/dotnet/runtime/issues/8605). Low-Hanging Fruit ----------------- @@ -160,8 +160,8 @@ The MSIL `switch` instruction is actually encoded as a jump table, so (for better or worse) intelligent optimization of source-level switch statements largely falls to the MSIL generator (e.g. Roslyn), since encoding sparse switches as jump tables in MSIL would be impractical. That said, when the MSIL -has a switch of just a few cases (as in [#12868](https://github.com/dotnet/coreclr/issues/12868)), -or just a few distinct cases that can be efficiently checked (as in [#12477](https://github.com/dotnet/coreclr/issues/12477)), +has a switch of just a few cases (as in [#8573](https://github.com/dotnet/runtime/issues/8573)), +or just a few distinct cases that can be efficiently checked (as in [#8418](https://github.com/dotnet/runtime/issues/8418)), the JIT needn't blindly emit these as jump tables in the native code. Work is underway to address the latter case in [#12552](https://github.com/dotnet/coreclr/pull/12552). @@ -170,7 +170,7 @@ underway to address the latter case in [#12552](https://github.com/dotnet/corecl A number of suggestions have been made for having the JIT recognize certain patterns and emit specialized write barriers that avoid various overheads -- -see [#13006](https://github.com/dotnet/coreclr/issues/13006) and [#12812](https://github.com/dotnet/coreclr/issues/12812). +see [#8627](https://github.com/dotnet/runtime/issues/8627) and [#8547](https://github.com/dotnet/runtime/issues/8547). ### Byref-Exposed Store/Load Value Propagation @@ -178,8 +178,8 @@ see [#13006](https://github.com/dotnet/coreclr/issues/13006) and [#12812](https: There are a few tweaks to our value-numbering for byref-exposed loads and stores to share some of the machinery we use for heap loads and stores that would allow better propagation through byref-exposed locals and out parameters -- -see [#13457](https://github.com/dotnet/coreclr/issues/13457) and -[#13458](https://github.com/dotnet/coreclr/issues/13458). +see [#8767](https://github.com/dotnet/runtime/issues/8767) and +[#8768](https://github.com/dotnet/runtime/issues/8768). Miscellaneous ------------- @@ -199,4 +199,4 @@ Maybe it's worth reconsidering the priority based on throughput? RyuJIT has an implementation that handles the valuable cases (see [analysis](https://gist.github.com/JosephTremoulet/c1246b17ea2803e93e203b9969ee5a25#file-mulshift-md) and [follow-up](https://github.com/dotnet/coreclr/pull/13128) for details). The current implementation is split across Morph and CodeGen; ideally it would -be moved to Lower, which is tracked by [#13150](https://github.com/dotnet/coreclr/issues/13150). +be moved to Lower, which is tracked by [#8668](https://github.com/dotnet/runtime/issues/8668). diff --git a/docs/design/coreclr/jit/first-class-structs.md b/docs/design/coreclr/jit/first-class-structs.md index 2153b8cb96aa..91e889831561 100644 --- a/docs/design/coreclr/jit/first-class-structs.md +++ b/docs/design/coreclr/jit/first-class-structs.md @@ -213,7 +213,7 @@ This would be done in multiple phases: for a general idea of the kinds of VM changes that may be required. * Defer retyping of struct return types (`Compiler::impFixupStructReturnType()` and `Compiler::impFixupCallStructReturn()`) - * This is probably the "right" way to fix [#26491](https://github.com/dotnet/coreclr/issues/26491). + * This is probably the "right" way to fix [#13355](https://github.com/dotnet/runtime/issues/13355). * Next, eliminate the "pessimizations". * For cases where `GT_LCL_FLD` is currently used to "retype" the struct, change it to use *either* `GT_LCL_FLD`, if it is already address-taken, or to use a `GT_BITCAST` otherwise. @@ -230,7 +230,7 @@ This would be done in multiple phases: * The removal of each of these pessimizations should result in improved code generation in cases where previously disabled optimizations are now enabled. * Other ABI-related issues: - * [#8289](https://github.com/dotnet/coreclr/issues/8289) - code generation for x86 promoted struct args. + * [#7048](https://github.com/dotnet/runtime/issues/7048) - code generation for x86 promoted struct args. Related issues: #1133 (maybe), #4766, #23675, #23129 @@ -262,14 +262,14 @@ This would be enabled first by [Defer ABI-specific transformations to Lowering]( (#10019, #9594, #7313) * Support partial struct promotion when some fields are more frequently accessed. * Aggressively promote lclVar struct incoming or outgoing args or returns whose fields match the ABI requirements. - * This should address [\#26710](https://github.com/dotnet/coreclr/issues/26710). + * This should address [\#13417](https://github.com/dotnet/runtime/issues/13417). * Aggressively promote pointer-sized fields of structs used as args or returns * Allow struct promotion of locals that are passed or returned in a way that doesn't match the field types. * Investigate whether it would be useful to re-type single-field structs, rather than creating new lclVars. This would complicate type analysis when copied, passed or returned, but would avoid unnecessarily expanding the lclVar data structures. - * Allow promotion of 32-byte SIMD on 16-byte alignment [\#24368](https://github.com/dotnet/coreclr/issues/24368) + * Allow promotion of 32-byte SIMD on 16-byte alignment [\#12623](https://github.com/dotnet/runtime/issues/12623) * Related: #6839, #9477, #16887 * Also, #11888, which suggests adding a struct promotion stress mode. @@ -294,7 +294,7 @@ Struct-Related Issues in RyuJIT The following issues illustrate some of the motivation for improving the handling of value types (structs) in RyuJIT: -* [\#11407 [RyuJIT] Fully enregister structs that fit into a single register when profitable](https://github.com/dotnet/coreclr/issues/11407), also VSO Bug 98404: .NET JIT x86 - poor code generated for value type initialization +* [\#8016 [RyuJIT] Fully enregister structs that fit into a single register when profitable](https://github.com/dotnet/runtime/issues/8016), also VSO Bug 98404: .NET JIT x86 - poor code generated for value type initialization * This is a simple test case that should generate simply `xor eax; ret` on x86 and x64, but instead generates many unnecessary copies. It is addressed by full enregistration of structs that fit into a register. See [Support Full Enregistration of Struct Types](#support-full-enregistration-of-struct-types): @@ -304,7 +304,7 @@ struct foo { public byte b1, b2, b3, b4; } static foo getfoo() { return new foo(); } ``` -* [\#1133 JIT: Excessive copies when inlining](https://github.com/dotnet/coreclr/issues/1133) +* [\#4308 JIT: Excessive copies when inlining](https://github.com/dotnet/runtime/issues/4308) * The scenario given in this issue involves a struct that is larger than 8 bytes, so it is not impacted by the fixed-size types. However, by enabling value numbering and assertion propagation for struct types (which, in turn is made easier by using normal assignments), the @@ -314,54 +314,54 @@ static foo getfoo() { return new foo(); } in the first place. * This case may now be handled; needs verification -* [\#1161 RyuJIT properly optimizes structs with a single field if the field type is int but not if it is double](https://github.com/dotnet/coreclr/issues/1161) +* [\#4323 RyuJIT properly optimizes structs with a single field if the field type is int but not if it is double](https://github.com/dotnet/runtime/issues/4323) * This issue arises because we never promote a struct with a single double field, due to the fact that such a struct may be passed or returned in a general purpose register. This issue could be addressed independently, but should "fall out" of improved heuristics for when to promote and enregister structs. - * Related: [\#8828](https://github.com/dotnet/coreclr/issues/8828) + * Related: [\#7200](https://github.com/dotnet/runtime/issues/7200) * [\#1636 Add optimization to avoid copying a struct if passed by reference and there are no - writes to and no reads after passed to a callee](https://github.com/dotnet/coreclr/issues/1636). + writes to and no reads after passed to a callee](https://github.com/dotnet/runtime/issues/4524). * This issue is related to #1133, except that in this case the desire is to eliminate unneeded copies locally (i.e. not just due to inlining), in the case where the struct may or may not be passed or returned directly. * Unfortunately, there is not currently a scenario or test case for this issue. -* [\#19425 Unix: Unnecessary struct copy while passsing struct of size <=16](https://github.com/dotnet/coreclr/issues/19425) -* [\#16619 [RyuJIT] Eliminate unecessary copies when passing structs](https://github.com/dotnet/coreclr/issues/16619) +* [\#10879 Unix: Unnecessary struct copy while passing struct of size <=16](https://github.com/dotnet/runtime/issues/10879) +* [\#9839 [RyuJIT] Eliminate unecessary copies when passing structs](https://github.com/dotnet/runtime/issues/9839) * These require changing both the callsite and the callee to avoid copying the parameter onto the stack. -* [\#3144 Avoid marking tmp as DoNotEnregister in tmp=GT_CALL() where call returns a - enregisterable struct in two return registers](https://github.com/dotnet/coreclr/issues/3144) +* [\#5112 Avoid marking tmp as DoNotEnregister in tmp=GT_CALL() where call returns a + enregisterable struct in two return registers](https://github.com/dotnet/runtime/issues/5112) * This issue could be addressed without First Class Structs. However, it should be done along with the streamlining of the handling of ABI-specific struct passing and return values. -* [\#4766 Pi-Digits: Extra Struct copies of BigInteger](https://github.com/dotnet/coreclr/issues/4766) +* [\#5785 Pi-Digits: Extra Struct copies of BigInteger](https://github.com/dotnet/runtime/issues/5785) * In addition to suffering from the same issue as #1133, this has a struct that is promoted even though it is passed (by reference) to its non-inlined constructor. This means that any copy to/from this struct will be field-by-field. -* [\#11816 Extra zeroing with structs and inlining](https://github.com/dotnet/coreclr/issues/11816) +* [\#8186 Extra zeroing with structs and inlining](https://github.com/dotnet/runtime/issues/8186) * This issue illustrates the failure of the JIT to eliminate zero-initialization of structs that are subsequently fully defined. It is a related but somewhat different manifestation of the issue in #1133, i.e. that structs are not fully supported in value numbering and optimization. -* [\#12865 JIT: inefficient codegen for calls returning 16-byte structs on Linux x64](https://github.com/dotnet/coreclr/issues/12865) +* [\#8571 JIT: inefficient codegen for calls returning 16-byte structs on Linux x64](https://github.com/dotnet/runtime/issues/8571) * This is related to #3144, and requires supporting the assignment of a multi-reg call return into a promoted local variable, and enabling subsequent elimination of any redundant copies. -* [\#22445](https://github.com/dotnet/coreclr/issues/22445) and [\#22319](https://github.com/dotnet/coreclr/issues/22319) +* [\#11992](https://github.com/dotnet/runtime/issues/11992) and [\#11940](https://github.com/dotnet/runtime/issues/11940) * These are both cases where we introduce a `GT_LCL_FLD` to retype a value that needs to be passed in a register. ## Other Struct-related Issues -* [\#17207](https://github.com/dotnet/coreclr/issues/17207) +* [\#10029](https://github.com/dotnet/runtime/issues/10029) * This suffers from pessimization due to poor handling of conversion (`Unsafe.As`) from `Quaternion` to `Vector4`. It's not immediately clear what's the best way to improve this. -* [#7740](https://github.com/dotnet/coreclr/issues/7740) +* [#6858](https://github.com/dotnet/runtime/issues/6858) * Addressing mode expression optimization for struct fields Sample IR diff --git a/docs/design/coreclr/jit/jit-call-morphing.md b/docs/design/coreclr/jit/jit-call-morphing.md index cf46fa674b14..5c99ac293912 100644 --- a/docs/design/coreclr/jit/jit-call-morphing.md +++ b/docs/design/coreclr/jit/jit-call-morphing.md @@ -17,7 +17,6 @@ post/pre increment, perhaps like this: `Foo(j, a[j++])`. Here `j` is updated vi when the second arg is evaluated, so the earlier uses of `j` would need to be evaluated and saved in a new LclVar. -  One simple approach would be to create new single definition, single use LclVars for every argument that is passed. This would preserve the evaluation order. However, it would potentially create hundreds of LclVar for moderately sized methods and that would overflow the limited number of @@ -25,7 +24,6 @@ tracked local variables in the JIT. One observation is that many arguments to m either constants or LclVars and can be set up anytime we want. They usually will not need a new LclVar to preserve the order of evaluation rule. -  Each argument is an arbitrary expression tree. The JIT tracks a summary of observable side-effects using a set of five bit flags in every GenTree node: `GTF_ASG`, `GTF_CALL`, `GTF_EXCEPT`, `GTF_GLOB_REF`, and `GTF_ORDER_SIDEEFF`. These flags are propagated up the tree so that the top node has a particular diff --git a/docs/design/coreclr/jit/lsra-detail.md b/docs/design/coreclr/jit/lsra-detail.md index 7a35d1947adf..a637b8ac6982 100644 --- a/docs/design/coreclr/jit/lsra-detail.md +++ b/docs/design/coreclr/jit/lsra-detail.md @@ -3,25 +3,54 @@ Linear Scan Register Allocation: Design and Implementation Notes Table of Contents ----------------- -[Overview](#overview) - -[Preconditions](#preconditions) - -[Post-Conditions](#post-conditions) - -[LSRA Phases](#lsra-phases) - -[Key Data Structures](#key-data-structures) - -[Dumps and Debugging Support](#dumps-and-debugging-support) - -[LSRA Stress Modes](#lsra-stress-modes) - -[Assertions & Validation](#assertions-validation) - -[Future Extensions and Enhancements](#future-extensions-and-enhancements) - -[References](#references) + * [Overview](#overview) + * [Preconditions](#preconditions) + + [Lowered IR Form (LIR)](#lowered-ir-form-lir) + + [Register Requirements](#register-requirements) + * [Post-Conditions](#post-conditions) + * [LSRA Phases](#lsra-phases) + + [Liveness and Candidate Identification](#liveness-and-candidate-identification) + + [Block Ordering](#block-ordering) + + [Building Intervals and RefPositions](#building-intervals-and-refpositions) + + [Register allocation (doLinearScan)](#register-allocation-dolinearscan) + * [Key Data Structures](#key-data-structures) + + [Live In](#live-in) + + [currentLiveVars](#currentlivevars) + + [Referenceable](#referenceable) + + [Interval](#interval) + + [RegRecord](#regrecord) + + [RefPosition](#refposition) + + [GenTree Nodes](#gentree-nodes) + + [VarToRegMap](#vartoregmap) + * [Dumps and Debugging Support](#dumps-and-debugging-support) + * [LSRA Stress Modes](#lsra-stress-modes) + * [Assertions & Validation](#assertions--validation) + * [Future Extensions and Enhancements](#future-extensions-and-enhancements) + * [Feature Enhancements](#feature-enhancements) + + [Support for Allocating Consecutive Registers](#support-for-allocating-consecutive-registers) + * [Code Quality Enhancements](#code-quality-enhancements) + + [Merge Allocation of Free and Busy Registers](#merge-allocation-of-free-and-busy-registers) + + [Auto-tuning of register selection](#auto-tuning-of-register-selection) + + [Pre-allocating high frequency lclVars](#pre-allocating-high-frequency-lclvars) + + [Avoid Splitting Loop Backedges](#avoid-splitting-loop-backedges) + + [Enable EHWriteThru by default](#enable-ehwritethru-by-default) + + [Avoid Spill When Stack Copy is Valid](#avoid-spill-when-stack-copy-is-valid) + + [Rematerialization](#rematerialization) + + [Improving Reg-Optional Support](#improving-reg-optional-support) + - [Reg-Optional Defs](#reg-optional-defs) + - [Don't Pre-determine Reg-Optional Operand](#dont-pre-determine-reg-optional-operand) + - [Don't Mark DelayFree for Duplicate Operands](#dont-mark-delayfree-for-duplicate-operands) + + [Improving Preferencing](#improving-preferencing) + + [Leveraging SSA form](#leveraging-ssa-form) + + [Spanning trees for physical registers](#spanning-trees-for-physical-registers) + + [Improve the handling of def/use conflicts](#improve-the-handling-of-defuse-conflicts) + * [Throughput Enhancements](#throughput-enhancements) + + [Allocation Window for Min-Opts and Tier 0](#allocation-window-for-min-opts-and-tier-0) + + [Distinguish Intra-Block versus Inter-Block Variables](#distinguish-intra-block-versus-inter-block-variables) + + [Improve the VarToRegMap](#improve-the-vartoregmap) + + [Other Throughput Investigations](#other-throughput-investigations) + * [Test and Cleanup Issues](#test-and-cleanup-issues) + * [References](#references) Overview -------- @@ -63,7 +92,7 @@ There are four main phases to LSRA: - Note that the order doesn't affect correctness, as the location of `lclVar`s across block boundaries is fixed up - as necessary by the resolution phase. When not optimizing + as necessary by the resolution phase. When not optimizing, `lclVar`s are not enregistered, so there is no benefit to using a different order. @@ -98,6 +127,12 @@ There are four main phases to LSRA: as both a source and target (where the source is not marked `delayRegFree`. + - An exception is multi-reg local stores of multi-reg sources. + For these, the code generator will read each source register, + and then move it, if needed, to the destination register. + These nodes have 2*N locations where N is the number of registers, + so that the liveness can be reflected accordingly. + - For each node, `RefPosition`s are built to reflect the uses, definitions and kills of any registers involved in the evaluation of the node. @@ -119,7 +154,8 @@ There are four main phases to LSRA: - Splitting or spilling an `Interval` doesn't involve creating a new one. Instead, the `RefPosition` simply gets a new assignment, and is either marked for reload/copy or its location is simply - updated in the incoming map. + updated in the incoming map. This differs from other linear-scan + allocators, where separate intervals are constructed for this case. - The resolution phase has two parts: @@ -246,11 +282,11 @@ Post-Conditions After LSRA, the graph has the following properties: -- The `gtRegNum` of each tree node contains the allocated register, +- The `_gtRegNum` of each tree node (`GetRegNum()`) contains the allocated register, if any. Nodes that produce multiple registers are similarly assigned, via extended register number fields. If the node does not produce a value directly (i.e. it is either of void type, or it is - evaluated as part of its parent) its gtRegNum is set to REG_NA. + evaluated as part of its parent) its `_gtRegNum` is set to `REG_NA`. - In most cases, this register must satisfy the constraints specified for each `RefPosition` by the `BuildNode` methods. @@ -273,20 +309,24 @@ After LSRA, the graph has the following properties: - However, if such a node is constrained to a set of registers, and its current location does not satisfy that requirement, LSRA - must insert a `GT_COPY` node between the node and its parent.  - The gtRegNum on the `GT_COPY` node must satisfy the register + must insert a `GT_COPY` node between the node and its parent. + The `_gtRegNum` on the `GT_COPY` node must satisfy the register requirement of the parent. -- GenTree::gtRsvdRegs has a set of registers used for internal temps. +- `GenTree::gtRsvdRegs` has a set of registers used for internal temps. These must satisfy the constraints specified by the associated `RefPosition`s. - A tree node is marked `GTF_SPILL` if the tree node must be spilled by the code generator after it has been evaluated. + - Note that a write-thru variable def is always written to the stack, and the `GTF_SPILLED` + flag (not otherwise used for pure defs) to indicate that it also remains live + in the assigned register. + - A tree node is marked `GTF_SPILLED` if it is a lclVar that must be reloaded prior to use. - - The register (gtRegNum) on the node indicates the register to + - The register (`_gtRegNum`) on the node indicates the register to which it must be reloaded. - For lclVar nodes, since the uses and defs are distinct tree @@ -299,18 +339,23 @@ After LSRA, the graph has the following properties: insert a `GT_RELOAD` node to specify the register to which it should be reloaded. +- Note that `GT_COPY` and `GT_RELOAD` nodes are inserted immediately after the + instruction that must be copied or reloaded. However, the reload or copy + isn't actually generated until the code generator is generating code for + the consuming node. + - Local variable table (`LclVarDsc`): - `LclVarDsc::lvRegister` is set to true if a local variable has the same register assignment for its entire lifetime. - - `LclVarDsc::lvRegNum` is initialized to its initial register + - `LclVarDsc::_lvRegNum` is initialized to its initial register assignment. - For incoming parameters, this is the register to which `genFnPrologCalleeRegArgs()` will move it. - - Codegen will set `lvRegNum` to its current value as it processes + - Codegen will set `_lvRegNum` to its current value as it processes the trees, since a variable can be assigned different registers over its lifetimes. @@ -347,7 +392,7 @@ well as supporting components) in more depth. should probably handle them in `Compiler::lvaMarkLocalVars()` when it is called after `Lowering`. - - It sets the ` lvLRACandidate` flag on lclVars that are going + - It sets the `lvLRACandidate` flag on lclVars that are going to be register candidates. ### Block Ordering @@ -364,6 +409,8 @@ that satisfies the following properties: - We use block weight, since edge weight is not tracked in the JIT. +- Blocks that enter EH regions have no predecessor. All live-in vars are on the stack. + The order of the `BasicBlock`s is captured in the `blockSequence` member of `LinearScan`. Other implementations of linear scan register allocation aim to ensure @@ -389,7 +436,8 @@ critical edges. This also captured in the `LsraBlockInfo` and is used by the res `Interval`s are built for lclVars up-front. These are maintained in an array, `localVarIntervals` which is indexed by the `lvVarIndex` (not the `varNum`, since we never allocate registers for non-tracked lclVars). Other intervals (for tree temps and -internal registers) are constructed as the relevant node is encountered. +internal registers) are constructed as the relevant node is encountered. Intervals for +`lclVar`s that are live into an exception region are marked `isWriteThru`. The building of `RefPosition`s is done via a traversal of the nodes, using the `blockSequence` constructed as described above. This traversal invokes `LinearScan::BuildNode()` for each @@ -412,6 +460,7 @@ node, which builds `RefPositions` according to the liveness model described abov - A contained memory operand or addressing mode will cause `RefPosition`s to be created for any (non-contained) base or index registers. + - A single `RefPosition` is created for non-contained nodes. In order to build these uses, we need to find the `Interval` associated with the @@ -420,7 +469,8 @@ node, which builds `RefPositions` according to the liveness model described abov have not yet seen the use. This is a simple list on the assumption that the distance between defs and uses of tree temps is rarely very great. - For x86 and x64, when we have an instruction that will overwrite one of its sources, + When we have an instruction that will overwrite one of its sources, such as RMW + operands common on x86 and x64, we need to ensure that the other source isn't given the same register as the target. For this, we annotate the use `RefPosition` with `delayRegFree`. @@ -428,12 +478,15 @@ node, which builds `RefPositions` according to the liveness model described abov This is cleared before the next instruction is handled. - Next, any registers in the kill set for the instruction are killed. This is performed - by `buildKillPositionsForNode()`, which takes a kill mask that is generally provided - by a `getKillSetForXXX()` method. + by `buildKillPositionsForNode()`, which takes a kill mask that is node-specific and + either provided directly by the `buildXXX()` method for the node, or by a `getKillSetForXXX()` + method. There is a debug-only method, `getKillSetForNode()` which is only used for validation. - Finally, we create `RefTypeDef` `RefPositions` for any registers that are defined by the node. + - For a `STORE_LCL_VAR` of a write-thru `lclVar`, the `RefPosition` is marked `writeThru`. + - A `RefTypeBB` `RefPosition` marks the beginning of a block, at which the incoming live variables are set to their locations at the end of the selected predecessor. @@ -462,13 +515,7 @@ During this phase, preferences are set: (at a previous definition) been assigned a register, and we want to try to use that register again, as well as the case where it has yet to be assigned a register. - This area has room for improvement: - - - A specific case that could be improved is [Issue #25312](https://github.com/dotnet/coreclr/issues/25312) - which involves preferencing for HW intrinsics. - - - Issue [#22374](https://github.com/dotnet/coreclr/issues/22374) also has a pointer - to some methods that could benefit from improved preferencing. + This area has room for improvement, (see [Improving Preferencing](#improving-preferencing)). - Register preferences are set: @@ -528,7 +575,7 @@ LinearScanAllocation(List refPositions) - Currently, parameters may not be allocated a register if their weighted reference count is less than `BB_UNITY_WEIGHT`, however plenty of room remains for improving the allocation of - parameters [Issue \#11356](https://github.com/dotnet/coreclr/issues/11356) + parameters [Issue \#7999](https://github.com/dotnet/runtime/issues/7999) - `TryAllocateFreeReg()` iterates over the registers, attempting to find the best free register (if any) to allocate: @@ -547,17 +594,21 @@ LinearScanAllocation(List refPositions) which is not currently live, but which previously occupied that register). + - Currently it doesn't take encoding size into account. + [Issue \#7996](https://github.com/dotnet/runtime/issues/7996) + tracks this. + - It always uses the same order for iterating over the registers. The jit32 register allocator used a different ordering for tree temps than for lclVars. It's unclear if this matters for LSRA, - but [Issue \#11357](https://github.com/dotnet/coreclr/issues/11357) + but [Issue \#8000](https://github.com/dotnet/runtime/issues/8000) tracks this question. - `AllocateBusyReg()` iterates over all the registers trying to find the best register to spill (it must only be called if `tryAllocateFreeReg()` was unable to find one): - - It takes into account the following: + - It takes into account a number of heuristics including: - The distance to the next use of the `Interval` being spilled @@ -567,16 +618,15 @@ LinearScanAllocation(List refPositions) - Whether the `RefPosition` being allocated, or the one potentially being spilled, is reg-optional + - Both `tryAllocateFreeReg()` and `allocateBusyReg()` currently fully evaluate the "goodness" + of each register. + - It will always spill an `Interval` either at its most recent use, or at the entry to the current block. - - Issues [\#7609](https://github.com/dotnet/coreclr/issues/7609) and - [\#7665](https://github.com/dotnet/coreclr/issues/7665) track improvement of spill - placement. - - - It is quite possible that combining `TryAllocateFreeReg()` and + - It is quite likely that combining `TryAllocateFreeReg()` and `AllocateBusyReg()` would be more effective, see - [Merge Allocation of Free and Busy Registers](#combine) + [Merge Allocation of Free and Busy Registers](#merge-allocation-of-free-and-busy-registers) - Resolution @@ -599,18 +649,10 @@ LinearScanAllocation(List refPositions) - Resolution of exception edges - - This is currently done by ensuring that any variable that's - live in to an exception region is maintained on stack. - - - Issue \#6001 raises the performance issue due to this - implementation. - - - Work is in-progress to support the notion - of "write-thru" variables; for these, all definitions - would write to memory, but uses could use a register - value, if available. + - When `COMPlus_EnableEHWriteThru == 0`, any variable that's + live in to an exception region is always referenced on the stack. - - The value is reloaded at exception boundaries. + - See [Enable EHWriteThru by default](#enable-EHWriteThru-by-default). - Code generation (genGenerateCode) @@ -699,7 +741,7 @@ fixed registers. The representation of `TYP_DOUBLE` registers on 32-bit `Arm` is complicated by the fact that they overlap two `TYP_FLOAT` registers. The handling of this -case could be improved. +case could be improved. See [Support for Allocating Consecutive Registers](#Support-for-Allocating-Consecutive-Registers). ### RefPosition @@ -727,14 +769,11 @@ enregisterable variable or temporary or physical register. It contains - `RefTypeUse` is a pure use of an `Interval` . - `RefTypeKill` is a location at which a physical register is - killed. These only exist on `RegRecord`s, not on `Interval`s - - - Note that this type is probably not needed -- see especially - notes about physical registers in "future" section. + killed. These only exist on `RegRecord`s, not on `Interval`s - `RefTypeBB` is really just a marker in the list of `RefPosition`s, - where the register allocator needs to record the register - locations at block boundaries. It is not associated with an + where the register allocator needs to record the register + locations at block boundaries. It is not associated with an `Interval` or `RegRecord`. - `RefTypeFixedReg` is a `RefPosition` on a `RegRecord` that marks a @@ -807,7 +846,7 @@ The following dumps and debugging modes are provided: - For each incoming arg: its type and incoming location - For each instruction: - - The current contents of the `OperandToLocationInfoMap`. + - The current contents of the `defList`. This corresponds to all the nodes that have defined values that have not yet been consumed. - An abbreviated dump of the GenTree node. @@ -822,8 +861,8 @@ The following dumps and debugging modes are provided: progresses. - After allocation - - A dump of `RefPosition`s, sequentially, and grouped for Var - `Interval` s + - A dump of `RefPosition`s, sequentially, and grouped for `lclVar` + `Interval`s - During resolution - A list of the candidates for resolution at each split, join or @@ -895,18 +934,15 @@ exclusive: - Never allocate a register for a `RefPosition` marked `regOptional` (0x1000). -It may be useful to also have a stress mode that deliberately trashes registers that -are not currently occupied (e.g. at block boundaries). Issue [#18944](https://github.com/dotnet/coreclr/issues/18944). - Assertions & Validation ----------------------- There are many assertions in `LinearScan`. The following are the most effective at identifying issues (i.e. they frequently show up in bugs): -- The node information isn't showing the number of consumed registers - that are expected: - - `assert((consume == 0) || (ComputeAvailableSrcCount(tree) == consume));` +- The def and use counts don't match what's expected: + - See the asserts at the end of the `LinearScan::BuildNode()` method (these are + architecture-specific, and can be found in lsraxarch.cpp, lsraarm64.cpp and lsraarm.cpp). - This usually means that the `BuildXXX` method for this node is not building `RefPosition`s for all of its uses (which is what `consume` has been set to). - The liveness information is incorrect. This assert comes from `LinearScan::checkLastUses()` which @@ -918,19 +954,26 @@ effective at identifying issues (i.e. they frequently show up in bugs): possibly because it is a stress mode, and the instruction hasn't correctly specified its minimum number of registers. -At the end of write-back (`resolveRegisters()`), `verifyFinalAllocation()` runs. It doesn't do a lot of validation, but it - prints the final allocation (including final spill placement), so is useful for tracking down correctness issues. +At the end of write-back (`resolveRegisters()`), `verifyFinalAllocation()` runs. It doesn't do a +lot of validation, but it prints the final allocation (including final spill placement), so is +useful for tracking down correctness issues. Future Extensions and Enhancements ---------------------------------- -The potential enhancements to the JIT, some of which are referenced in this document, can generally be found by [searching for LSRA in open issues](https://github.com/dotnet/coreclr/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+LSRA+in%3Atitle). The ones that are focused on JIT throughput are labeled `JITThroughput`. +The potential enhancements to the JIT, some of which are referenced in this document, can generally be found by [searching for LSRA in open issues](https://github.com/dotnet/runtime/issues?q=is%3Aissue+is%3Aopen+lsra+in%3Atitle). The ones that are focused on JIT throughput are labeled `JITThroughput`. + +## Feature Enhancements + +### Support for Allocating Consecutive Registers + +This is [\#39457](https://github.com/dotnet/runtime/issues/39457). As described there, the challenge is to do this without impacting the common path. This should also include cleaning up the allocating of consecutive registers for `TYP_DOUBLE` for Arm32 [\#8758](https://github.com/dotnet/runtime/issues/8758). ## Code Quality Enhancements -### Merge Allocation of Free and Busy Registers +### Merge Allocation of Free and Busy Registers -This is captured as [\#15408](https://github.com/dotnet/coreclr/issues/15408) +This is captured as [\#9399](https://github.com/dotnet/runtime/issues/9399) Consider merging allocating free & busy regs. Currently the register allocator will always allocate an available register, even if it only meets @@ -943,31 +986,34 @@ The alternative approach under consideration is to combine free and busy registe (`tryAllocateFreeReg()` and `allocateBusyReg()`) such that a busy register will be spilled if there are no suitable free registers, and the current `Interval` has greater weight than the `Interval` occupying the register. This must be accompanied by some improvements in the efficiency of the -checks, so as not to degrade throughput. This is currently a work-in-progress (https://github.com/CarolEidt/coreclr/tree/CombineAlloc) but hasn't yet been ported to the runtime repo, and needs +checks, so as not to degrade throughput. This is currently a work-in-progress (https://github.com/CarolEidt/runtime/tree/CombineAlloc), and needs further work to eliminate diffs and improve throughput. This would make it possible to spill a register for a higher weight `lclVar` rather than "settling" for a register that's a poor fit for its requirements. This is probably the best approach to -address Issues [\#7664](https://github.com/dotnet/coreclr/issues/7664) +address Issues [\#6824](https://github.com/dotnet/runtime/issues/6824): Heuristics for callee saved reg allocation and -[\#13735](https://github.com/dotnet/coreclr/issues/13735) +[\#8846](https://github.com/dotnet/runtime/issues/8846): Let variables within a loop use register first. The following issues are related: -* Both `tryAllocateFreeReg()` and `allocateBusyReg()` currently fully evaluate the "goodness" of each register. - Issue [\#7301](https://github.com/dotnet/coreclr/issues/7301) tracks the possibility of short-circuiting - this evaluation. - Making such an improvement should probably be done in conjunction with this work. +- Issues [\#6806](https://github.com/dotnet/runtime/issues/6806) and + [\#6825](https://github.com/dotnet/runtime/issues/6825) track improvement of spill + placement. + +- Issue [\#6705](https://github.com/dotnet/runtime/issues/6705) tracks the possibility of + short-circuiting this evaluation. + Making such an improvement should probably be done in conjunction with this work. -* Issue [\#26847](https://github.com/dotnet/coreclr/issues/26847) - Heuristics for callee saved reg allocation. +- Issue [\#13466](https://github.com/dotnet/runtime/issues/13466): + Inefficient register allocation in simple method which dereferences a span ### Auto-tuning of register selection This is not yet captured as a GitHub issue. -This would be best done after [Merge Allocation of Free and Busy Registers](#combine). +This would be best done after [Merge Allocation of Free and Busy Registers](#merge-allocation-of-free-and-busy-registers). The idea would be to add support to change the weight given to the various selection heuristics according to a configuration specification, allowing them to be auto-tuned. @@ -980,7 +1026,7 @@ would be added as an alternate path in the register allocator, leaving the defau ### Pre-allocating high frequency lclVars -This is captured as Issue [\#11424](https://github.com/dotnet/coreclr/issues/11424) +This is captured as Issue [\#8019](https://github.com/dotnet/runtime/issues/8019) Consider pre-allocating high-frequency lclVars. The idea here is to ensure that high frequency lclVars aren't forced to use less-than-optimal @@ -1015,7 +1061,7 @@ One strategy would be to do something along the lines of (appropriate hand-wavin ### Avoid Splitting Loop Backedges -This is captured as Issue [\#16857](https://github.com/dotnet/coreclr/issues/16857). +This is captured as Issue [\#9909](https://github.com/dotnet/runtime/issues/9909). When the register allocator performs resolution across block boundaries, it may split critical edges (edges from a block with multiple successors to a block with multiple predecessors). @@ -1029,16 +1075,43 @@ set would ensure that the variable locations match. This would eliminate not jus but all the extra branches currently inserted for resolution. It remains to be seen whether this would outweigh the impact of cases where more resolution moves would be required. +I have an old experimental branch where I started working on this: https://github.com/CarolEidt/coreclr/tree/NoEdgeSplitting (not yet ported to the runtime repo). + +### Enable EHWriteThru by default + +When `COMPlus_EnableEHWriteThru` is set, some performance regressions are observed. When an EH write-thru variable (i.e. one that is live into an exception region) is defined, its value is +always stored, in addition to potentially remaining live in a register. This increases register +pressure which may result in worse code. + +Further investigation is needed, but the following mitigations may be effective (here the +term "EH Var" means a `lclVar` marked `lvLiveInOutOfHndlr`): + +- Adjust the heuristics: + + 1. For determining whether an EH var should be a candidate for register allocation, + e.g. if the defs outweight the uses. + + 2. For determining when a definition of an EH var should be only stored to the stack, + rather than also remaining live in the register. + +- If the weight of the defs exceeds the weight of the blocks with successors in exception + regions, consider spilling the `lclVar` to the stack only at those boundaries. + +The original issue to enable EH WriteThru is [#6212](https://github.com/dotnet/runtime/issues/6212). +It remains open pending the resolution of the performance regressions. + ### Avoid Spill When Stack Copy is Valid The idea here is to avoid spilling at a use if the value on the stack is already the correct value. -Issues that this might address include [\#11344] Spill single-def vars at def, [\#7665] Improve spill placement, -and [\#7465] Avoiding reg spill to memory when reg-value is consistent with memory. +Issues that this might address include: +- [\#7994](https://github.com/dotnet/runtime/issues/7994) Spill single-def vars at def, +- [\#6825](https://github.com/dotnet/runtime/issues/6825) Improve spill placement, and +- [\#6761](https://github.com/dotnet/runtime/issues/6761) Avoiding reg spill to memory when reg-value is consistent with memory. Currently the register allocator doesn't track whether a local variable has the same value on the stack -as in a register. The work-in-progress to support "write-thru" EH variables (variables live across exception -boundaries) adds capability to liveness analysis and code generation (in addition to the register allocator) +as in a register. The support for "write-thru" EH variables (variables live across exception +boundaries) has added the capability to liveness analysis and code generation (in addition to the register allocator) to handle variables that are live in both registers and on the stack. This support could be further leveraged to avoid spilling single-def variables to memory if they have already been spilled at their definition. @@ -1047,19 +1120,29 @@ Extending such support to more generally track whether there is already a valid work. Fully general support would require such information at block boundaries, but it might be worth investigating whether it would be worthwhile and cheaper to simply track this information within a block. -### Support Reg-Optional Defs +### Rematerialization + +This would involve identifying `Interval`s whose values are cheaper to recompute than to spill +and reload. Without SSA form, this would probably be easiest to do when there's a single def. +Issue [\#6264](https://github.com/dotnet/runtime/issues/6264). + +### Improving Reg-Optional Support + +#### Reg-Optional Defs -Issues [\#7752](https://github.com/dotnet/coreclr/issues/7752) and -[\#7753](https://github.com/dotnet/coreclr/issues/7753) track the +Issues [\#6862](https://github.com/dotnet/runtime/issues/6862) and +[\#6863](https://github.com/dotnet/runtime/issues/6863) track the proposal to support "folding" of operations using a tree temp when the defining operation supports read-modify-write (RMW) to memory. This involves supporting the possibility of a def being reg-optional, as well as its use, so that it need never occupy a register. -### Don't Pre-determine Reg-Optional Operand +I have an old experimental branch: https://github.com/CarolEidt/coreclr/tree/RegOptDef where I started working on this. -Issue [\#6361](https://github.com/dotnet/coreclr/issues/6361) +#### Don't Pre-determine Reg-Optional Operand + +Issue [\#6358](https://github.com/dotnet/runtime/issues/6358) tracks the problem that `Lowering` currently has to select a single operand to be reg-optional, even if either operand could be. This requires some additional state because @@ -1067,6 +1150,18 @@ LSRA can't easily navigate from one use to the other to communicate whether the first operand has been assigned a register. +#### Don't Mark DelayFree for Duplicate Operands + +Issue [\#9896](https://github.com/dotnet/runtime/issues/9896). + +### Improving Preferencing + +- Issue [#12945](https://github.com/dotnet/runtime/issues/12945) + involves preferencing for HW intrinsics. + +- Issue [#11959](https://github.com/dotnet/runtime/issues/11959) also has a pointer + to some methods that could benefit from improved preferencing. + ### Leveraging SSA form This has not yet been opened as a github issue. @@ -1083,7 +1178,7 @@ Making SSA form available to LSRA would: This has not yet been opened as a github issue. LLVM has extended their linear scan register allocator with something it -calls "Greedy Register Allocation". This uses a priority queue for the +calls "Greedy Register Allocation"[[6](#6),[7](#7)]. This uses a priority queue for the order of allocation (sorted by decreasing spill cost), and a B+ tree to represent each physical register. I think that using the B+ trees for physical registers would be an improvement over the current PhysRegs, @@ -1091,6 +1186,13 @@ and we may want to experiment with changing the allocation order as well. It would not be necessary to significantly modify the process of creating `Interval`s, nor the resolution phase. +### Improve the handling of def/use conflicts + +Def/use conflicts arise when the producing and conusming nodes each have register requirements, +and they conflict. The current mechanism, in which the register assignment of one of the +`RefPosition`s is changed, can lead to problems because there's then +no associated `RefTypeFixedReg` for that reference. This is Issue [\#10196](https://github.com/dotnet/runtime/issues/10196). + ## Throughput Enhancements ### Allocation Window for Min-Opts and Tier 0 @@ -1111,48 +1213,75 @@ form of a `defList` that holds all of the tree temp values that have been define Once this is empty, the register allocator could process the current list of `RefPosition`s and then start over. +[Issue \#6690](https://github.com/dotnet/runtime/issues/6690) proposes to build `RefPositions` incrementally, which is part of this item. + ### Distinguish Intra-Block versus Inter-Block Variables It is unclear whether it would be beneficial, but if we could keep track of the variables that are only used within a block (presumably true of many introduced temps), we may find that we could continue to limit the number of variables whose liveness is tracked across blocks, keeping an expanded -set only for transient liveness. Issue [\#11339](https://github.com/dotnet/coreclr/issues/11339). +set only for transient liveness. Issue [\#7992](https://github.com/dotnet/runtime/issues/7992). Note that this would only improve JIT throughput for optimized code. ### Improve the VarToRegMap -The `VarToRegMap` incurs non-trivial JIT-time overhead. Issue \#11396 addresses +The `VarToRegMap` incurs non-trivial JIT-time overhead. +Issue [\#8013](https://github.com/dotnet/runtime/issues/8013) addresses the question of whether there is an alternative that would have better performance. This would also improve JIT throughput only for optimized code. +### Other Throughput Investigations + +Issue [\#7998](https://github.com/dotnet/runtime/issues/7998) suggests evluating the throughput cost of updating the preferences at each +kill site. + +## Test and Cleanup Issues + +Issue [\#9767](https://github.com/dotnet/runtime/issues/9767) captures the issue that the +"spill always" stress mode, `LSRA_SPILL_ALWAYS`, `COMPlus_JitStressRegs=0x800` doesn't work properly. + +Issue [\#6261](https://github.com/dotnet/runtime/issues/6261) has to do with `RegOptional` +`RefPositions` that are marked as `copyReg` or `moveReg`. See the notes on this issue; +I don't think such cases should arise, but there may be some cleanup needed here. + +Issue [\#5793](https://github.com/dotnet/runtime/issues/5793) suggests adding a stress mode that +allocates registers forr mullti-reg nodes in the reverse of the ABI requirements. + +Issue [#10691](https://github.com/dotnet/runtime/issues/10691) suggests adding a stress mode that +deliberately trashes registers that are not currently occupied (e.g. at block boundaries). + References ---------- -1. Boissinot, B. et +1. Boissinot, B. et al "Fast liveness checking for ssa-form programs," CGO 2008, pp. 35-44. http://portal.acm.org/citation.cfm?id=1356058.1356064&coll=ACM&dl=ACM&CFID=105967773&CFTOKEN=80545349 -2. Boissinot, B. et al, "Revisiting +2. Boissinot, B. et al, "Revisiting Out-of-SSA Translation for Correctness, Code Quality and Efficiency," CGO 2009, pp. 114-125. -3. Wimmer, C. and Mössenböck, D. "Optimized +3. Wimmer, C. and Mössenböck, D. "Optimized Interval Splitting in a Linear Scan Register Allocator," ACM VEE 2005, pp. 132-141. -4. Wimmer, C. and Franz, M. "Linear Scan +4. Wimmer, C. and Franz, M. "Linear Scan Register Allocation on SSA Form," ACM CGO 2010, pp. 170-179. -5. Traub, O. et al "Quality and Speed in Linear-scan Register +5. Traub, O. et al "Quality and Speed in Linear-scan Register Allocation," SIGPLAN '98, pp. 142-151. -6. Olesen, J. "Greedy Register Allocation in LLVM 3.0," LLVM Project Blog, Sept. 2011. +6. Olesen, J. "Greedy Register Allocation in LLVM 3.0," LLVM Project Blog, Sept. 2011. - (Last retrieved Feb. 2012) + (Last retrieved July 2020) + +7. Yatsina, M. "LLVM Greedy Register Allocator," LLVM Dev Meeting, April 2018. + + (Last retrieved July 2020) diff --git a/docs/design/coreclr/jit/object-stack-allocation.md b/docs/design/coreclr/jit/object-stack-allocation.md index ec6fe14b3d64..914013878000 100644 --- a/docs/design/coreclr/jit/object-stack-allocation.md +++ b/docs/design/coreclr/jit/object-stack-allocation.md @@ -21,7 +21,7 @@ various Java runtimes. This optimization is more important for Java since it do [roslyn #2104](https://github.com/dotnet/roslyn/issues/2104) Compiler should optimize "alloc temporary small object" to "alloc on stack" -[coreclr #1784](https://github.com/dotnet/coreclr/issues/1784) CLR/JIT should optimize "alloc temporary small object" to "alloc on stack" automatically +[runtime #4584](https://github.com/dotnet/runtime/issues/4584) CLR/JIT should optimize "alloc temporary small object" to "alloc on stack" automatically ## Escape Analysis @@ -157,7 +157,7 @@ So the upper bound from this experiment is 22.2%. @AndyAyersMS recently resurrected @echesakovMSFT work and used it to [prototype stack allocation of a simple delegate that's directly invoked](https://github.com/dotnet/coreclr/compare/master...AndyAyersMS:NonNullPlusStackAlloc). It exposed a number of things that need to be done in the jit to generate better code for stack-allocated objects. The details are in comments of -[coreclr #1784](https://github.com/dotnet/coreclr/issues/1784). +[runtime #4584](https://github.com/dotnet/runtime/issues/4584). We did some analysis of Roslyn csc self-build to see where this optimization may be beneficial. One hot place was found in [GreenNode.WriteTo](https://github.com/dotnet/roslyn/blob/fab7134296816fc80019c60b0f5bef7400cf23ea/src/Compilers/Core/Portable/Syntax/GreenNode.cs#L647). This object allocation accounts for 8.17% of all object allocations in this scenario. The number is not as impressive as a percentage diff --git a/docs/design/coreclr/jit/ryujit-tutorial.md b/docs/design/coreclr/jit/ryujit-tutorial.md index 050c11495b6a..69e90580fbfa 100644 --- a/docs/design/coreclr/jit/ryujit-tutorial.md +++ b/docs/design/coreclr/jit/ryujit-tutorial.md @@ -606,7 +606,7 @@ public static int PopCount(ulong bitVectorArg) #### Notes The sample I'm going to walk through implements support for pop count (counting the number of '1' bits in a 64-bit value). -  + We're going to start by assuming that we have a method with a known signature that implements PopCount. Here's the implementation we're going to use. It simply takes the input value, and keeps anding with one, and then shifting right. We're first going to simply recognize the name and signature, and replace the method call with a simple PopCnt IR node. diff --git a/docs/design/coreclr/jit/variabletracking.md b/docs/design/coreclr/jit/variabletracking.md index e37dd8b54f4a..c4f86a6cd56d 100644 --- a/docs/design/coreclr/jit/variabletracking.md +++ b/docs/design/coreclr/jit/variabletracking.md @@ -338,7 +338,7 @@ There are many things we can do to improve optimized debugging: Currently we don't have the IL offset of them. And this is broadly used to improve code performance. -- [Promoted structs](https://github.com/dotnet/coreclr/issues/23542): There is no debug support for fields of promoted structs, we just report the struct itself. +- [Promoted structs](https://github.com/dotnet/runtime/issues/12369): There is no debug support for fields of promoted structs, we just report the struct itself. -- [Reduce space used for VariableLiveDescriptor](https://github.com/dotnet/coreclr/issues/23544): we are currently using a `jitstd::list`, which is a double linked list. +- [Reduce space used for VariableLiveDescriptor](https://github.com/dotnet/runtime/issues/12371): we are currently using a `jitstd::list`, which is a double linked list. We could use a simple single linked list with push_back(), head(), tail(), size() operations and an iterator and we would be saving memory. diff --git a/docs/design/coreclr/profiling/Profiler Attach on CoreCLR.md b/docs/design/coreclr/profiling/Profiler Attach on CoreCLR.md index 1e494a79f364..6a724e4fdc2f 100644 --- a/docs/design/coreclr/profiling/Profiler Attach on CoreCLR.md +++ b/docs/design/coreclr/profiling/Profiler Attach on CoreCLR.md @@ -13,7 +13,7 @@ Attaching a profiler to a running CoreCLR process involves sending a message fro 2) `uint attachTimeout` - (Required) A timeout that informs the runtime how long to wait while attempting to attach. This does not impact the timeout of trying to send the attach message. 3) `Guid profilerGuid` - (Required) The profiler's GUID to use when initializing. 4) `string profilerPath` - (Required) The path to the profiler on disk. -5) `byte[] additionalData` - (Optional) A data blob that will be passed to `ICorProfilerCallback3::InitializeForAttach` as `pvClientData`. +5) `byte[] additionalData` - (Optional) A data blob that will be passed to `ICorProfilerCallback3::InitializeForAttach` as `pvClientData`. This method returns a status HR following the usual convention, 0 (S_OK) means a profiler was successfully attached and any other value is an error indicating what went wrong. diff --git a/docs/design/coreclr/profiling/Profiler Breaking Changes.md b/docs/design/coreclr/profiling/Profiler Breaking Changes.md index 07c54c7277ff..0e6d5e2444b9 100644 --- a/docs/design/coreclr/profiling/Profiler Breaking Changes.md +++ b/docs/design/coreclr/profiling/Profiler Breaking Changes.md @@ -4,4 +4,4 @@ Over time we will need to modify the Profiler APIs, this document will serve as 1. Code Versioning introduced changes documented [here](../../features/code-versioning-profiler-breaking-changes.md) 2. The work to allow adding new types and methods after module load means ICorProfilerInfo7::ApplyMetadata will now potentially trigger a GC, and will not be callable in situations where a GC can not happen (for example ICorProfilerCallback::RootReferences). -3. As part of the work to allow ReJIT on attach ReJITted methods will no longer be inlined (ever). Since the inlining is blocked there won't be a `ICorProfilerCallback::JITInlining` callback. \ No newline at end of file +3. As part of the work to allow ReJIT on attach ReJITted methods will no longer be inlined (ever). Since the inlining is blocked there won't be a `ICorProfilerCallback::JITInlining` callback. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Attach.md b/docs/design/coreclr/profiling/davbr-blog-archive/Attach.md index 93335dd51fec..f9f08680f24f 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Attach.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Attach.md @@ -7,8 +7,6 @@ Profiler attach is a feature that allows you to attach a profiler to an already Please note! You can't just take any profiler you bought and suddenly be able to attach it to a running application. The profiler must be built with "attachability" in mind. So if you're a profiler developer looking to pump some attachability into your product, read on--this article is for you. Everyone else, this article will probably be less useful--but just as riveting. -# - # The Players So how do you get your profiler attached to a running process? The process has already started, and the CLR code which interrogates the environment to determine whether to load a profiler has already run. So how do you kick the process into loading your profiler? The answer: Another process! @@ -19,17 +17,17 @@ In order to force your profiler DLL to load into the target profilee process, yo # Inside the Trigger Process -Your trigger uses a simple API method, AttachProfiler, to request the target process to load your profiler. Where is this method defined? Well, it doesn't make much sense to put it on ICorProfilerInfo, since that interface is only available to a profiler after it's been loaded. You could imagine a C export from mscoree.dll. But because of in-process side-by-side CLR instances, we're moving away from mscoree.dll exports to a COM-based interface model called "metahost". +Your trigger uses a simple API method, AttachProfiler, to request the target process to load your profiler. Where is this method defined? Well, it doesn't make much sense to put it on ICorProfilerInfo, since that interface is only available to a profiler after it's been loaded. You could imagine a C export from mscoree.dll. But because of in-process side-by-side CLR instances, we're moving away from mscoree.dll exports to a COM-based interface model called "metahost". ## Meta-whos-its? Whereas the "hosting" interfaces enable one to host and manage a CLR in a process, the "metahost" interfaces allow one to manage multiple CLRs that may be installed onto a machine or loaded into a single process. Here's a high-level view of how you navigate your way through metahost to find AttachProfiler() (there’s a pointer to actual sample code below). -- Get ICLRMetaHost -- Enumerate the CLRs loaded into the target process -- Get ICLRRuntimeInfo for the particular CLR in the target process you want to profile -- Get the corresponding ICLRProfiling -- Call ICLRProfiling::AttachProfiler +- Get ICLRMetaHost +- Enumerate the CLRs loaded into the target process +- Get ICLRRuntimeInfo for the particular CLR in the target process you want to profile +- Get the corresponding ICLRProfiling +- Call ICLRProfiling::AttachProfiler ## Users and Integrity @@ -57,8 +55,6 @@ From your InitializeForAttach implementation, your profiler will call SetEventMa It was impossible to enable all profiling scenarios for attach in the time we had for the V4 release. So only profilers that do **sampling** and **memory** analysis will function properly after attaching to a live process. Attempts to use other profiling APIs after attach will be met with CORPROF\_E\_UNSUPPORTED\_FOR\_ATTACHING\_PROFILER. -### - ## Specific Callback Limitations When your attaching profiler calls SetEventMask, you will be limited to only those event mask flags present in the COR\_PRF\_ALLOWABLE\_AFTER\_ATTACH bitmask (you'll find it in corprof.idl). Any other flags, and SetEventMask will return CORPROF\_E\_UNSUPPORTED\_FOR\_ATTACHING\_PROFILER. @@ -67,14 +63,14 @@ When your attaching profiler calls SetEventMask, you will be limited to only tho Most of the ICorProfilerInfo\* methods are available to your attaching profiler, however some are not--particularly those involved in **IL rewriting**. Here's a list of all ICorProfilerInfo\* methods NOT supported for attaching profilers: -- GetILFunctionBody -- GetILFunctionBodyAllocator -- SetILFunctionBody -- SetILInstrumentedCodeMap -- SetEnterLeaveFunctionHooks\* -- SetFunctionIDMapper\* -- GetNotifiedExceptionClauseInfo -- All methods related to Enter/Leave/Tailcall +- GetILFunctionBody +- GetILFunctionBodyAllocator +- SetILFunctionBody +- SetILInstrumentedCodeMap +- SetEnterLeaveFunctionHooks\* +- SetFunctionIDMapper\* +- GetNotifiedExceptionClauseInfo +- All methods related to Enter/Leave/Tailcall It's expected that future releases of the CLR will enable more API methods for use by attaching profilers. @@ -84,9 +80,9 @@ It's expected that future releases of the CLR will enable more API methods for u To understand limitations around the GC modes, here's a quick review of the GC modes an app can run under: -- **Workstation Blocking mode**. The thread that triggered the GC performs the GC while all other threads executing managed code must wait. -- **Workstation Concurrent / Background mode (the default)**. Concurrent GC (V1 & V2) allows portions of a full GC to execute while other threads are allowed to run. Background GC (its replacement in V4) takes it one step further, and also allows an ephemeral GC (i.e., gen 0 or gen 1) to execute while a gen 2 GC is executing. -- **Server mode**. Hosts like ASP.NET may choose to enable server mode which creates a heap + dedicated GC thread per CPU. This allows GCs to be fanned out to multiple threads. +- **Workstation Blocking mode**. The thread that triggered the GC performs the GC while all other threads executing managed code must wait. +- **Workstation Concurrent / Background mode (the default)**. Concurrent GC (V1 & V2) allows portions of a full GC to execute while other threads are allowed to run. Background GC (its replacement in V4) takes it one step further, and also allows an ephemeral GC (i.e., gen 0 or gen 1) to execute while a gen 2 GC is executing. +- **Server mode**. Hosts like ASP.NET may choose to enable server mode which creates a heap + dedicated GC thread per CPU. This allows GCs to be fanned out to multiple threads. Of course, [Maoni's blog](https://devblogs.microsoft.com/dotnet/author/maoni/) is required reading for anyone who wants to understand how the GC works. @@ -96,15 +92,13 @@ So here's the catch. What if a V4 app starts up in background GC mode _without_ Of course, you could forcibly turn off concurrent / background mode every time the app starts up via a config file: -| - -\ - \ - \ - \ -\ - - | +```xml + + + + + +``` But you don't really want to be running your apps with a sub-optimal GC mode all the time, just on the off-chance you might need to attach a memory profiler to it. If you suspect you might need to do some memory profiling of a client app, you should just start up your app with the memory profiler to begin with. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Attach2.md b/docs/design/coreclr/profiling/davbr-blog-archive/Attach2.md index d2db6ca61301..6ff0409ebebd 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Attach2.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Attach2.md @@ -11,12 +11,12 @@ A profiler that loads on startup of an application has the option to know the en [NoBirthAnnouncement](media/NoBirthAnnouncement.JPG) Drawing by Magdalena Hermawan - + There are two fundamental ways your profiler can catch up on the current state of an application: -- Lazy catch-up—as the profiler encounters new IDs, the profiler queries information about those IDs as it needs them, rather than assuming it has a full cache that’s always built up as the IDs are first created. This is analogous to Dorothy meeting a new grown-up, and gracefully accepting the fact that that person exists. -- Enumeration—for certain kinds of IDs, the profiler can (at attach time) request a complete list of the currently active IDs and query information about them at that time. Sort of like Dorothy first going to the Oz City Hall and looking up the birth records for everyone. +- Lazy catch-up—as the profiler encounters new IDs, the profiler queries information about those IDs as it needs them, rather than assuming it has a full cache that’s always built up as the IDs are first created. This is analogous to Dorothy meeting a new grown-up, and gracefully accepting the fact that that person exists. +- Enumeration—for certain kinds of IDs, the profiler can (at attach time) request a complete list of the currently active IDs and query information about them at that time. Sort of like Dorothy first going to the Oz City Hall and looking up the birth records for everyone. Lazy catch-up is fairly self-explanatory. For example, if your sampling profiler encounters an IP in a FunctionID you’ve never seen before, just look up whatever info you need about that FunctionID the first time you encounter it, rather than assuming you’d already built up a cache when the function was first JITted. And if you discover that FunctionID resides in a module you’ve never seen before, then just look up whatever info you need about that ModuleID at that point, rather than assuming you already have a complete cache of all modules. Many of you are already doing something like this today if you support sampling against regular NGENd images (since you don’t get JIT notifications of those functions anyway). @@ -26,8 +26,8 @@ Enumeration, on the other hand, has some caveats and is worthwhile to describe i Some kinds of IDs have new enumerator methods as part of the profiling API. In particular: -- ICorProfilerInfo3::EnumModules -- ICorProfilerInfo3::EnumJITedFunctions +- ICorProfilerInfo3::EnumModules +- ICorProfilerInfo3::EnumJITedFunctions Your profiler calls these methods, and they return a standard enumerator you use to iterate through all of the currently-loaded IDs of that type. It’s worth noting that EnumJITedFunctions only enumerates FunctionIDs for which you would receive JITCompilationStarted/Finished events, and will not include FunctionIDs from NGENd modules. @@ -39,24 +39,24 @@ As you may recall, once your profiler is attached to the process, the CLR calls Bad timeline (loading; enumerating too soon): -1. Profiler attaches -2. Profiler calls EnumModules -3. Module starts to load -4. ModuleID is now enumerable -5. ModuleLoadFinished event would fire here if events were enabled (but they’re not yet!) -6. CLR enables events +1. Profiler attaches +2. Profiler calls EnumModules +3. Module starts to load +4. ModuleID is now enumerable +5. ModuleLoadFinished event would fire here if events were enabled (but they’re not yet!) +6. CLR enables events The problem is that the profiler calls EnumModules too early. If your profiler only calls EnumModules after CLR enables events, then you’re assured of either seeing a ModuleID via EnumModules or via a ModuleLoad event. In the above scenario, your profiler might as well have never done enumeration at all, since it will still not be notified of the ModuleID before it comes across that ModuleID in action later on. It gets even worse for modules that unload: Bad timeline (unloading; enumerating too soon): -1. Module loads -2. ModuleID is now enumerable -3. Profiler attaches -4. Profiler calls EnumModules (includes the ModuleID) -5. Module starts to unload -6. ModuleUnloadStarted event would fire here if events were enabled (but they’re not yet!) -7. CLR enables events +1. Module loads +2. ModuleID is now enumerable +3. Profiler attaches +4. Profiler calls EnumModules (includes the ModuleID) +5. Module starts to unload +6. ModuleUnloadStarted event would fire here if events were enabled (but they’re not yet!) +7. CLR enables events In the above case, the profiler discovers a ModuleID via EnumModules, but has no idea that the module is now in the process of unloading. So the profiler might query information about the stale ModuleID, potentially causing an AV. Again, this is caused because the profiler called the enumeration API too soon (i.e., before the CLR enabled event callbacks). @@ -68,24 +68,24 @@ When your profiler calls the Enum\* methods, the CLR creates a snapshot of all Bad timeline (loading): -1. Module starts to load -2. ModuleLoadFinished event would fire here if events were enabled (but they’re not yet—no profiler is attached!) -3. Profiler attaches -4. CLR enables events, calls ProfilerAttachComplete() -5. Profiler calls EnumModules -6. ModuleID is now enumerable +1. Module starts to load +2. ModuleLoadFinished event would fire here if events were enabled (but they’re not yet—no profiler is attached!) +3. Profiler attaches +4. CLR enables events, calls ProfilerAttachComplete() +5. Profiler calls EnumModules +6. ModuleID is now enumerable Because 2 comes before 6, it’s possible for a profiler to attach and grab an enumeration in the middle, and thus never hear about a ModuleID (even though the profiler avoided Race #1 from the previous section). Again, an even worse problem occurs for module unloading. Suppose the CLR were to change an ID’s enumerable status to false after sending the unload event. That would also lead to holes: Bad timeline (unloading): -1. Module loads, event would fire if profiler were attached (but it’s not), then ModuleID becomes enumerable -2. Module starts to unload -3. ModuleUnloadStarted event would fire here if events were enabled (but they’re not yet—no profiler is attached!) -4. Profiler attaches -5. CLR enables events, calls ProfilerAttachComplete() -6. Profiler calls EnumModules (ModuleID is still enumerable, so profiler discovers ModuleID at this point) -7. ModuleID is no longer enumerable +1. Module loads, event would fire if profiler were attached (but it’s not), then ModuleID becomes enumerable +2. Module starts to unload +3. ModuleUnloadStarted event would fire here if events were enabled (but they’re not yet—no profiler is attached!) +4. Profiler attaches +5. CLR enables events, calls ProfilerAttachComplete() +6. Profiler calls EnumModules (ModuleID is still enumerable, so profiler discovers ModuleID at this point) +7. ModuleID is no longer enumerable Because 3 comes before 7, a profiler could attach in the middle, grab an enumeration, discover the ModuleID via the enumeration, and have no idea that module was in the process of unloading. If the profiler were to use that ModuleID later on, an AV could result. The above led to the following golden rule: @@ -93,10 +93,10 @@ Because 3 comes before 7, a profiler could attach in the middle, grab an enumera In other words, an ID becomes enumerable _before_ the LoadFinished (or JITCompilationFinished) event. And an ID ceases to be enumerable _before_ the UnloadStarted event. Or you can think of it as, “The event is always last”. This eliminates any potential holes. So to be even more explicit, here’s the enumerability vs. event ordering: -1. ID available in enumerations snapped now -2. LoadFinished -3. ID no longer in enumerations snapped now -4. UnloadStarted +1. ID available in enumerations snapped now +2. LoadFinished +3. ID no longer in enumerations snapped now +4. UnloadStarted If an ID is present, the profiler will discover the ID via the enumerator or a LoadFinished event (or both). If an ID is not present, the profiler will either not see the ID via the enumerator or will see an UnloadStarted event (or both). In all cases, the event is more recent, and so the profiler should always trust an event over an enumeration that was generated prior. (More on that last point later.) @@ -104,36 +104,36 @@ The astute reader will notice that what we’ve done here is trade one race for Good timeline (loading with duplicate): -1. Module starts to load -2. ModuleID is now enumerable -3. Profiler attaches -4. CLR enables events, calls ProfilerAttachComplete() -5. Profiler calls EnumModules -6. Profiler receives ModuleLoadFinished +1. Module starts to load +2. ModuleID is now enumerable +3. Profiler attaches +4. CLR enables events, calls ProfilerAttachComplete() +5. Profiler calls EnumModules +6. Profiler receives ModuleLoadFinished At first it might seem a little strange. The enumerator contains the ModuleID, so the profiler sees that the module is loaded. But then the profiler receives a ModuleLoadFinished event, which might seem odd, since the enumerator implied the module was already loaded. This is what I mean by “duplicate”—the profiler is notified of a ModuleID twice (once via the enumeration, and once via the event). The profiler will need to be resilient to this. Although it’s a bit awkward, it’s better than the alternative of a hole, since the profiler would have no way to know the hole occurred. Unloading has a similar situation: Good timeline (unloading with duplicate): -1. Module loads, event would have fired if profiler were attached (but it’s not), ModuleID becomes enumerable -2. Module starts to unload -3. ModuleID is no longer enumerable -4. Profiler attaches -5. CLR enables events, calls ProfilerAttachComplete() -6. Profiler calls EnumModules -7. Profiler receives ModuleUnloadStarted event +1. Module loads, event would have fired if profiler were attached (but it’s not), ModuleID becomes enumerable +2. Module starts to unload +3. ModuleID is no longer enumerable +4. Profiler attaches +5. CLR enables events, calls ProfilerAttachComplete() +6. Profiler calls EnumModules +7. Profiler receives ModuleUnloadStarted event In step 6, the profiler does not see the unloading ModuleID (since it’s no longer enumerable). But in step 7 the profiler is notified that the ModuleID is unloading. Perhaps it’s a bit awkward that the profiler would be told that a seemingly nonexistent ModuleID is unloading. But again, this is better than the alternative, where a profiler finds an unloading ID in the enumeration, and is never told that the ModuleID got unloaded. One more case that’s worthwhile to bring out occurs when we move the profiler attach a bit earlier in the sequence. Good timeline (unloading without duplicate): -1. Module loads, event would fire if profiler were attached, ModuleID becomes enumerable -2. Module starts to unload -3. Profiler attaches -4. CLR enables events, calls ProfilerAttachComplete() -5. Profiler calls EnumModules (ModuleID is still present in the enumeration) -6. ModuleID is no longer enumerable -7. Profiler receives ModuleUnloadStarted event +1. Module loads, event would fire if profiler were attached, ModuleID becomes enumerable +2. Module starts to unload +3. Profiler attaches +4. CLR enables events, calls ProfilerAttachComplete() +5. Profiler calls EnumModules (ModuleID is still present in the enumeration) +6. ModuleID is no longer enumerable +7. Profiler receives ModuleUnloadStarted event Here the profiler discovers the ModuleID exists in step 5 (as the ModuleID is still enumerable at that point), but the profiler almost immediately after discovers that the module is unloading in step 7. As stated above, events are more recent, and should always take precedence over enumerations that were generated prior. This could get a bit tricky, though, as the profiler generates an enumeration before it iterates over the enumeration. In the above sequence, the enumeration is generated in step 5. However, the profiler could be iterating though the generated enumeration for quite some time, and might not come across the unloading ModuleID until after step 7 (multiple threads means fun for everyone!). For this reason, it’s important for the profiler to give precedence to events that occur after the enumeration was _generated_, even though iteration over that enumeration might occur later. @@ -151,7 +151,5 @@ It may be beneficial to program your profiler such that, upon attaching to the p It’s worth reiterating a limitation I stated in the first attach post (linked above): the ObjectAllocated() callback is unavailable to profilers that attach to running processes. Therefore, any logic your profiler has that assumes it gets all the ObjectAllocated() callbacks will need to be addressed. Any objects newly allocated since the last GC may still be unknown to your profiler until it comes across their references via GC callbacks during the next GC (unless your profiler comes across those objects in other ways—example: as parameters to methods you hook with the Enter/Leave/Tailcall probes). - - OK, that about covers the first steps your profiler should take once it attaches to a running process. It will either need to use lazy catch-up or the catch-up enumerations (or, quite likely, a combination of both). When using the enumerations, be careful to avoid holes (by calling the enumeration methods from inside ProfilerAttachComplete()), and be resilient to receiving information duplicated across the enumeration and the load / unload events. For memory profilers, be wary of GCs already in progress at the time your profiler attaches, and consider inducing your own GC at attach-time to build your initial cache of GC objects. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/CORPROF_E_UNSUPPORTED_CALL_SEQUENCE.md b/docs/design/coreclr/profiling/davbr-blog-archive/CORPROF_E_UNSUPPORTED_CALL_SEQUENCE.md index c6feb97c779a..b2a900ca8757 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/CORPROF_E_UNSUPPORTED_CALL_SEQUENCE.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/CORPROF_E_UNSUPPORTED_CALL_SEQUENCE.md @@ -11,24 +11,24 @@ On the other hand, if you're hijacking or otherwise calling ICorProfilerInfo fun In 2.0 we've added some simple checks to help you avoid this problem. If you call an unsafe ICorProfilerInfo function asynchronously, instead of crossing its fingers and trying, it will fail with CORPROF\_E\_UNSUPPORTED\_CALL\_SEQUENCE. The general rule of thumb is, nothing is safe to call asynchronously. But here are the exceptions that are safe, and that we specifically allow to be called asynchronously: -- GetEventMask/SetEventMask -- GetCurrentThreadID -- GetThreadContext -- GetThreadAppDomain -- GetFunctionFromIP -- GetFunctionInfo/GetFunctionInfo2 -- GetCodeInfo/GetCodeInfo2 -- GetModuleInfo -- GetClassIDInfo/GetClassIDInfo2 -- IsArrayClass -- SetFunctionIDMapper -- DoStackSnapshot +- GetEventMask/SetEventMask +- GetCurrentThreadID +- GetThreadContext +- GetThreadAppDomain +- GetFunctionFromIP +- GetFunctionInfo/GetFunctionInfo2 +- GetCodeInfo/GetCodeInfo2 +- GetModuleInfo +- GetClassIDInfo/GetClassIDInfo2 +- IsArrayClass +- SetFunctionIDMapper +- DoStackSnapshot There are also a few things to keep in mind: -1. ICorProfilerInfo calls made from within the fast-path Enter/Leave callbacks are considered asynchronous. (Though ICorProfilerInfo calls made from within the _slow_-path Enter/Leave callbacks are considered synchronous.) See the blog entries [here](ELT - The Basics.md) and [here](http://blogs.msdn.com/jkeljo/archive/2005/08/11/450506.aspx) for more info on fast / slow path. -2. ICorProfilerInfo calls made from within instrumented code (i.e., IL you've rewritten to call into your profiler and then into ICorProfilerInfo) are considered asynchronous. -3. Calls made inside your FunctionIDMapper hook are considered to be synchronous. -4. Calls made on threads created by your profiler, are always considered to be synchronous. (This is because there's no danger of conflicts resulting from interrupting and then re-entering the CLR on that thread, since a profiler-created thread was not in the CLR to begin with.) -5. Calls made inside a StackSnapshotCallback are considered to be synchronous iff the call to DoStackSnapshot was synchronous. +1. ICorProfilerInfo calls made from within the fast-path Enter/Leave callbacks are considered asynchronous. (Though ICorProfilerInfo calls made from within the _slow_-path Enter/Leave callbacks are considered synchronous.) See the blog entries [here](ELT - The Basics.md) and [here](http://blogs.msdn.com/jkeljo/archive/2005/08/11/450506.aspx) for more info on fast / slow path. +2. ICorProfilerInfo calls made from within instrumented code (i.e., IL you've rewritten to call into your profiler and then into ICorProfilerInfo) are considered asynchronous. +3. Calls made inside your FunctionIDMapper hook are considered to be synchronous. +4. Calls made on threads created by your profiler, are always considered to be synchronous. (This is because there's no danger of conflicts resulting from interrupting and then re-entering the CLR on that thread, since a profiler-created thread was not in the CLR to begin with.) +5. Calls made inside a StackSnapshotCallback are considered to be synchronous iff the call to DoStackSnapshot was synchronous. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - Activation.md b/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - Activation.md index 79ee3e1d291a..4afd8111db88 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - Activation.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - Activation.md @@ -15,9 +15,8 @@ Environment variables --\> Registry --\> Profiler DLL on File system. The first link in this chain is to check the environment variables inside the process that should be profiled. If you're running the process from a command-prompt, you can just try a "set co" from the command prompt: -| ``` -**C:\>** set co +C:\> set co (blah blah, other vars beginning with "co") ``` @@ -25,7 +24,6 @@ The first link in this chain is to check the environment variables inside the pr Cor_Enable_Profiling=0x1 COR_PROFILER={C5F90153-B93E-4138-9DB7-EB7156B07C4C} ``` - | If your scenario doesn't allow you to just run the process from a command prompt, like say an asp.net scenario, you may want to attach a debugger to the process that's supposed to be profiled, or use IFEO (HKEY\_LOCAL\_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options) to force a debugger to start when the worker process starts. In the debugger, you can then use "!peb" to view the environment block, which will include the environment variables. @@ -62,4 +60,3 @@ or even set a breakpoint inside your Profiler DLL's **DllMain.** Now go, and s If you're still going strong, set a breakpoint in your profiler's **Initialize** () callback. Failures here are actually a popular cause for activation problems. Inside your Initialize() callback, your profiler is likely calling QueryInterface for the ICorProfilerInfoX interface of your choice, and then calling SetEventMask, and doing other initialization-related tasks, like calling SetEnterLeaveFunctionHooks(2). Do any of these fail? Is your Initialize() callback returning a failure HRESULT? Hopefully by now you've isolated the failure point. If not, and your Initialize() is happily returning S\_OK, then your profiler is apparently loading just fine. At least it is when you're debugging it. :-) - diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - SOS and IDs.md b/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - SOS and IDs.md index 8f032244926c..7616327f8773 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - SOS and IDs.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Debugging - SOS and IDs.md @@ -9,9 +9,8 @@ SOS.DLL is a debugger extension DLL that ships with the CLR. You'll find it sit In windbg, you'll need mscorwks.dll to load first, and then you can load SOS. Often, I don't need SOS until well into my debugging session, at which point mscorwks.dll has already been loaded anyway. However, there are some cases where you'd like SOS loaded at the first possible moment, so you can use some of its commands early (like !bpmd to set a breakpoint on a managed method). So a surefire way to get SOS loaded ASAP is to have the debugger break when mscorwks gets loaded (e.g., "sxe ld mscorwks"). Once mscorwks is loaded, you can load SOS using the .loadby command: -| ``` -0:000\> **sxe ld mscorwks** +0:000\> sxe ld mscorwks 0:000\> g ModLoad: 79e70000 7a3ff000 C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll eax=00000000 ebx=00000000 ecx=00000000 edx=00000000 esi=7efdd000 edi=20000000 @@ -19,9 +18,8 @@ In windbg, you'll need mscorwks.dll to load first, and then you can load SOS. O cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000202 ntdll!NtMapViewOfSection+0x12: 77a1a9fa c22800 ret 28h - 0:000\> **.loadby sos mscorwks** + 0:000\> .loadby sos mscorwks ``` - | With SOS loaded, you can now use its commands to inspect the various IDs that the profiling API passes to your profiler. @@ -35,7 +33,6 @@ As far as your profiler is concerned, a FunctionID is just an opaque number. It Ok, so FunctionID = (MethodDesc \*). How does that help you? SOS just so happens to have a command to inspect MethodDescs: !dumpmd. So if you're in a debugger looking at your profiler code that's operating on a FunctionID, it can beneficial to you to find out which function that FunctionID actually refers to. In the example below, the debugger will break in my proifler's JITCompilationStarted callback and look at the FunctionID. It's assumed that you've already loaded SOS as per above. -| ``` 0:000\> bu UnitTestSampleProfiler!SampleCallbackImpl::JITCompilationStarted 0:000\> g @@ -50,36 +47,30 @@ Breakpoint 0 hit UnitTestSampleProfiler!SampleCallbackImpl::JITCompilationStarted: 10003fc0 55 push ebp ``` - | The debugger is now sitting at the beginning of my profiler's JITCompilationStarted callback. Let's take a look at the parameters. -| ``` 0:000\> dv this = 0x00c133f8 - **functionID = 0x1e3170** + functionID = 0x1e3170 fIsSafeToBlock = 1 ``` - | Aha, that's the FunctionID about to get JITted. Now use SOS to see what that function really is. -| ``` 0:000\> !dumpmd 0x1e3170 Method Name: test.Class1.Main(System.String[]) Class: 001e1288 -**MethodTable: 001e3180** mdToken: 06000001 +MethodTable: 001e3180 mdToken: 06000001 Module: 001e2d8c IsJitted: no m\_CodeOrIL: ffffffff ``` - | Lots of juicy info here, though the Method Name typically is what helps me the most in my debugging sessions. mdToken tells us the metadata token for this method. MethodTable tells us where another internal CLR data structure is stored that contains information about the class containing the function. In fact, the profiing API's ClassID is simply a MethodTable \*. [Note: the "Class: 001e1288" in the output above is very different from the MethodTable, and thus different from the profiling API's ClassID. Don't let the name fool you!] So we could go and inspect a bit further by dumping information about the MethodTable: -| ``` 0:000\> !dumpmt 0x001e3180 EEClass: 001e1288 @@ -91,7 +82,6 @@ Lots of juicy info here, though the Method Name typically is what helps me the m Number of IFaces in IFaceMap: 0 Slots in VTable: 6 ``` - | And of course, !dumpmt can be used anytime you come across a ClassID and want more info on it. @@ -126,17 +116,15 @@ It would probably be quicker to list what _isn't_ useful! I encourage you to do !bpmd lets you place a breakpoint on a managed method. Just specify the module name and the fully-qualified method name. For example: -| ``` !bpmd MyModule.exe MyNamespace.MyClass.Foo ``` - | If the method hasn't jitted yet, no worries. A "pending" breakpoint is placed. If your profiler performs IL rewriting, then using !bpmd on startup to set a managed breakpoint can be a handy way to break into the debugger just before your instrumented code will run (which, in turn, is typically just after your instrumented code has been jitted). This can help you in reproducing and diagnosing issues your profiler may run into when instrumenting particular functions (due to something interesting about the signature, generics, etc.). !PrintException: If you use this without arguments you get to see a pretty-printing of the last outstanding managed exception on the thread; or specify a particular Exception object's address. - + Ok, that about does it for SOS. Hopefully this info can help you track down problems a little faster, or better yet, perhaps this can help you step through and verify your code before problems arise. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - Callback CONTEXT Registers.md b/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - Callback CONTEXT Registers.md index 2f6576708260..784e65b09103 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - Callback CONTEXT Registers.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - Callback CONTEXT Registers.md @@ -5,9 +5,6 @@ In my initial [post](DoStackSnapshot - Exception Filters.md) about DoStackSnapsh The quick answer is that **nonvolatile (i.e., preserved), integer registers** should be valid. You don't really need many registers to walk the stack anyway. Obviously, you want a good stack pointer and instruction pointer. And hey, a frame pointer is handy when you come across an EBP-based frame in x86 (RBP on x64). These are all included in the set, of course. Specifically by architecture, you can trust these fields in your context: -x86: Edi, Esi, Ebx, Ebp, Esp, Eip -x64: Rdi, Rsi, Rbx, Rbp, Rsp, Rip, R12:R15 -ia64: IntS0:IntS3, RsBSP, StIFS, RsPFS, IntSp, StIIP, StIPSR - - - +- x86: Edi, Esi, Ebx, Ebp, Esp, Eip +- x64: Rdi, Rsi, Rbx, Rbp, Rsp, Rip, R12:R15 +- ia64: IntS0:IntS3, RsBSP, StIFS, RsPFS, IntSp, StIIP, StIPSR diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - Exception Filters.md b/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - Exception Filters.md index 60ce221b4600..7e9a9484f3fd 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - Exception Filters.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - Exception Filters.md @@ -7,38 +7,38 @@ For those of you diehard C# fans, you might be unaware of the existence of excep First, a little background. For the full deal, check out the MSDN Library topic on VB.NET's [try/catch/finally statements](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmTryCatchFinally.asp). But here's an appetizer. In VB.NET you can do this: -``` -Function Negative() As Boolean - Return False -End Function - -Function Positive() As Boolean - Return True -End Function - -Sub Thrower - Throw New Exception -End Sub - -Sub Main() - Try - Thrower() - Catch ex As Exception When Negative() - MsgBox("Negative") - Catch ex As Exception When Positive() - MsgBox("Positive") - End Try -End Sub ``` +Function Negative() As Boolean + Return False +End Function -The filters are the things that come after "When". We all know that, when an exception is thrown, its type must match the type specified in a Catch clause in order for that Catch clause to be executed. "When" is a way to further restrict whether a Catch clause will be executed. Now, not only must the exception's type match, but also the When clause must evaluate to True for that Catch clause to be chosen. In the example above, when we run, we'll skip the first Catch clause (because its filter returned False), and execute the second, thus showing a message box with "Positive" in it. - -The thing you need to realize about DoStackSnapshot's behavior (indeed, CLR in general) is that the execution of a When clause is really a separate function call. In the above example, imagine we take a stack snapshot while inside Positive(). Our managed-only stack trace, as reported by DoStackSnapshot, would then look like this (stack grows up): - -Positive -Main -Thrower -Main - -It's that highlighted Main that seems odd at first. While the exception is thrown inside Thrower(), the CLR needs to execute the filter clauses to figure out which Catch wins. These filter executions are actually _function calls_. Since filter clauses don't have their own names, we just use the name of the function containing the filter clause for stack reporting purposes. Thus, the highlighted Main above is the execution of a filter clause located inside Main (in this case, "When Positive()"). When each filter clause completes, we "return" back to Thrower() to continue our search for the filter that returns True. Since this is how the call stack is built up, that's what DoStackSnapshot will report. +Function Positive() As Boolean + Return True +End Function + +Sub Thrower + Throw New Exception +End Sub + +Sub Main() + Try + Thrower() + Catch ex As Exception When Negative() + MsgBox("Negative") + Catch ex As Exception When Positive() + MsgBox("Positive") + End Try +End Sub +``` + +The filters are the things that come after "When". We all know that, when an exception is thrown, its type must match the type specified in a Catch clause in order for that Catch clause to be executed. "When" is a way to further restrict whether a Catch clause will be executed. Now, not only must the exception's type match, but also the When clause must evaluate to True for that Catch clause to be chosen. In the example above, when we run, we'll skip the first Catch clause (because its filter returned False), and execute the second, thus showing a message box with "Positive" in it. + +The thing you need to realize about DoStackSnapshot's behavior (indeed, CLR in general) is that the execution of a When clause is really a separate function call. In the above example, imagine we take a stack snapshot while inside Positive(). Our managed-only stack trace, as reported by DoStackSnapshot, would then look like this (stack grows up): + +Positive\ +Main\ +Thrower\ +Main + +It's that highlighted Main that seems odd at first. While the exception is thrown inside Thrower(), the CLR needs to execute the filter clauses to figure out which Catch wins. These filter executions are actually _function calls_. Since filter clauses don't have their own names, we just use the name of the function containing the filter clause for stack reporting purposes. Thus, the highlighted Main above is the execution of a filter clause located inside Main (in this case, "When Positive()"). When each filter clause completes, we "return" back to Thrower() to continue our search for the filter that returns True. Since this is how the call stack is built up, that's what DoStackSnapshot will report. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - HRESULTs.md b/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - HRESULTs.md index 7d9952ff7545..59d46109f365 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - HRESULTs.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/DoStackSnapshot - HRESULTs.md @@ -5,14 +5,14 @@ Generally, corerror.h tells you all you need to know about what kinds of HRESULT ### E\_FAIL -I don't much like E\_FAIL. If DoStackSnapshot fails, you will typically see a more descriptive, custom HRESULT. However, there are regrettably a few ways DoStackSnapshot can fail where you'll see the dreaded E\_FAIL instead. From your code's point of view, you shouldn't assume E\_FAIL will always imply one of the cases below (or conversely that each of these cases will always result in E\_FAIL). But this is just good stuff to know as you develop and debug your profiler, so you don't get blindsided. - -1) No managed frames on stack - +I don't much like E\_FAIL. If DoStackSnapshot fails, you will typically see a more descriptive, custom HRESULT. However, there are regrettably a few ways DoStackSnapshot can fail where you'll see the dreaded E\_FAIL instead. From your code's point of view, you shouldn't assume E\_FAIL will always imply one of the cases below (or conversely that each of these cases will always result in E\_FAIL). But this is just good stuff to know as you develop and debug your profiler, so you don't get blindsided. + +1) No managed frames on stack + If you call DoStackSnapshot when there are no managed functions on your target thread's stack, you can get E\_FAIL. For example, if you try to walk the stack of a target thread very early on in its execution, there simply might not be any managed frames there yet. Or, if you try to walk the stack of the finalizer thread while it's waiting to do work, there will certainly be no managed frames on its stack. It's also possible that walking a stack with no managed frames on it will yield S\_OK instead of E\_FAIL (e.g., if the target thread is jit-compiling the first managed function to be called on that thread). Again, your code probably doesn't need to worry about all these cases. If we call your StackSnapshotCallback for a managed frame, you can trust that frame is there. If we don't call your StackSnapshotCallback, you can assume there are no managed frames on the stack. -2) OS kernel handling a hardware exception - +2) OS kernel handling a hardware exception + This one is less likely to happen, but it certainly can. When an app throws a hardware exception (e.g., divide by 0), the offending thread enters the Windows kernel. The kernel spends some time recording the thread's current user-mode register context, modifying some registers, and moving the instruction pointer to the user-mode exception dispatch routine. At this point the thread is ready to reenter user-mode. But if you are unlucky enough to call DoStackSnapshot while the target thread is still in the kernel doing this stuff, you will get E\_FAIL. 3) Detectably bad seed @@ -25,11 +25,11 @@ Generally, this HRESULT means that your profiler requested to abort the stack wa One of the beautiful things about running 64-bit Windows is that you can get the Windows OS to perform (native) stack walks for you. Read up on [RtlVirtualUnwind](http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/rtlvirtualunwind.asp) if you're unfamiliar with this. The Windows OS has a critical section to protect a block of memory used to help perform this stack walk. So what would happen if: -- The OS's exception handling code causes a thread to walk its own stack -- The thread therefore enters this critical section -- Your profiler (via DoStackSnapshot) suspends this thread while the thread is still inside the critical section -- DoStackSnapshot uses RtlVirtualUnwind to help walk this suspended thread -- RtlVirtualUnwind (executing on the current thread) tries to enter the critical section (already owned by suspended target thread) +- The OS's exception handling code causes a thread to walk its own stack +- The thread therefore enters this critical section +- Your profiler (via DoStackSnapshot) suspends this thread while the thread is still inside the critical section +- DoStackSnapshot uses RtlVirtualUnwind to help walk this suspended thread +- RtlVirtualUnwind (executing on the current thread) tries to enter the critical section (already owned by suspended target thread) If your answer was "deadlock", congratulations! DoStackSnapshot has some code that tries to avoid this scenario, by aborting the stack walk before the deadlock can occur. When this happens, DoStackSnapshot will return CORPROF\_E\_STACKSNAPSHOT\_ABORTED. Note that this whole scenario is pretty rare, and only happens on WIN64. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - The Basics.md b/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - The Basics.md index af5d867ee4a4..7acb138cbd1e 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - The Basics.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - The Basics.md @@ -5,79 +5,84 @@ The CLR Profiling API allows you to hook managed functions so that your profiler ### Setting up the hooks -1. On initialization, your profiler must call SetEnterLeaveFunctionHooks(2) to specify which functions inside your profiler should be called whenever a managed function is entered, returns, or exits via tail call, respectively. - _(Profiler calls this…)_ +1. On initialization, your profiler must call SetEnterLeaveFunctionHooks(2) to specify which functions inside your profiler should be called whenever a managed function is entered, returns, or exits via tail call, respectively. + + _(Profiler calls this…)_ + ``` HRESULT SetEnterLeaveFunctionHooks( - [in] FunctionEnter \*pFuncEnter, - [in] FunctionLeave \*pFuncLeave, - [in] FunctionTailcall \*pFuncTailcall); - ``` - - _(Profiler implements these…)_ - ``` - typedef void FunctionEnter(FunctionID funcID); - typedef void FunctionLeave(FunctionID funcID); - typedef void FunctionTailcall(FunctionID funcID); + [in] FunctionEnter *pFuncEnter, + [in] FunctionLeave *pFuncLeave, + [in] FunctionTailcall *pFuncTailcall); ``` - **OR** + _(Profiler implements these…)_ - _(Profiler calls this…)_ - ``` - HRESULT SetEnterLeaveFunctionHooks2( - [in] FunctionEnter2 *pFuncEnter, - [in] FunctionLeave2 *pFuncLeave, - [in] FunctionTailcall2 *pFuncTailcall); - ``` - + ``` + typedef void FunctionEnter(FunctionID funcID); + typedef void FunctionLeave(FunctionID funcID); + typedef void FunctionTailcall(FunctionID funcID); + ``` - _(Profiler implements these…)_ - ``` - typedef void FunctionEnter2( - FunctionID funcId, - UINT_PTR clientData, - COR_PRF_FRAME_INFO func, - COR_PRF_FUNCTION_ARGUMENT_INFO *argumentInfo); - - typedef void FunctionLeave2( - FunctionID funcId, - UINT_PTR clientData, - COR_PRF_FRAME_INFO func, - COR_PRF_FUNCTION_ARGUMENT_RANGE *retvalRange); - - typedef void FunctionTailcall2( - FunctionID funcId, - UINT_PTR clientData, - COR_PRF_FRAME_INFO func); - ``` + **OR** + + _(Profiler calls this…)_ + + ``` + HRESULT SetEnterLeaveFunctionHooks2( + [in] FunctionEnter2 *pFuncEnter, + [in] FunctionLeave2 *pFuncLeave, + [in] FunctionTailcall2 *pFuncTailcall); + ``` - This step alone does not cause the enter/leave/tailcall (ELT) hooks to be called. But you must do this on startup to get things rolling. + _(Profiler implements these…)_ -2. At any time during the run, your profiler calls SetEventMask specifying COR\_PRF\_MONITOR\_ENTERLEAVE in the bitmask. Your profiler may set or reset this flag at any time to cause ELT hooks to be called or ignored, respectively. + ``` + typedef void FunctionEnter2( + FunctionID funcId, + UINT_PTR clientData, + COR_PRF_FRAME_INFO func, + COR_PRF_FUNCTION_ARGUMENT_INFO *argumentInfo); + + typedef void FunctionLeave2( + FunctionID funcId, + UINT_PTR clientData, + COR_PRF_FRAME_INFO func, + COR_PRF_FUNCTION_ARGUMENT_RANGE *retvalRange); + + typedef void FunctionTailcall2( + FunctionID funcId, + UINT_PTR clientData, + COR_PRF_FRAME_INFO func); + ``` + + This step alone does not cause the enter/leave/tailcall (ELT) hooks to be called. But you must do this on startup to get things rolling. + +2. At any time during the run, your profiler calls SetEventMask specifying COR\_PRF\_MONITOR\_ENTERLEAVE in the bitmask. Your profiler may set or reset this flag at any time to cause ELT hooks to be called or ignored, respectively. ### FunctionIDMapper In addition to the above two steps, your profiler may specify more granularly which managed functions should have ELT hooks compiled into them: -1. At any time, your profiler may call ICorProfilerInfo2::SetFunctionIDMapper to specify a special hook to be called when a function is JITted. +1. At any time, your profiler may call ICorProfilerInfo2::SetFunctionIDMapper to specify a special hook to be called when a function is JITted. + + _(Profiler calls this…)_ -_(Profiler calls this…)_ -``` - HRESULT SetFunctionIDMapper([in] FunctionIDMapper \*pFunc); -``` - + ``` + HRESULT SetFunctionIDMapper([in] FunctionIDMapper \*pFunc); + ``` + + _(Profiler implements this…)_ + + ``` + typedef UINT_PTR __stdcall FunctionIDMapper( + FunctionID funcId, + BOOL *pbHookFunction); + ``` - _(Profiler implements this…)_ -``` -typedef UINT_PTR __stdcall FunctionIDMapper( - FunctionID funcId, - BOOL *pbHookFunction); -``` - 2. When FunctionIDMapper is called: - a. Your profiler sets the pbHookFunction [out] parameter appropriately to determine whether the function identified by funcId should have ELT hooks compiled into it. + a. Your profiler sets the pbHookFunction \[out] parameter appropriately to determine whether the function identified by funcId should have ELT hooks compiled into it. b. Of course, the primary purpose of FunctionIDMapper is to allow your profiler to specify an alternate ID for that function. Your profiler does this by returning that ID from FunctionIDMapper . The CLR will pass this alternate ID to your ELT hooks (as funcID if you're using the 1.x ELT, and as clientData if you're using the 2.x ELT). ### Writing your ELT hooks @@ -92,8 +97,6 @@ The solution is “NGEN /Profile”. For example, if you run this command agains `ngen install MyAssembly.dll /Profile` - - it will NGEN MyAssembly.dll with the “Profile” flavor (also called “profiler-enhanced”). This flavor causes extra hooks to be baked in to enable features like ELT hooks, loader callbacks, managed/unmanaged code transition callbacks, and the JITCachedFunctionSearchStarted/Finished callbacks. The original NGENd versions of all your assemblies still stay around in your NGEN cache. NGEN /Profile simply causes a new set of NGENd assemblies to be generated as well, marked as the “profiler-enhanced” set of NGENd assemblies. At run-time, the CLR determines which flavor should be loaded. If a profiler is attached and enables certain features that only work with profiler-enhanced (not regular) NGENd assemblies (such as ELT via a call to SetEnterLeaveFunctionHooks(2), or any of several other features that are requested by setting particular event flags via SetEventMask), then the CLR will only load profiler-enhanced NGENd images--and if none exist then the CLR degrades to JIT in order to support the features requested by the profiler. In contrast, if the profiler does not specify such event flags, or there is no profiler to begin with, then the CLR loads the regular-flavored NGENd assemblies. @@ -128,4 +131,3 @@ Why do you care? Well, it's always good to know what price you're paying. If you ### Next time... That about covers it for the ELT basics. Next installment of this riveting series will talk about that enigma known as tailcall. - diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - tail calls.md b/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - tail calls.md index 3cca8c9a9c5c..d00ceba195e7 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - tail calls.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/ELT Hooks - tail calls.md @@ -79,7 +79,7 @@ typedef void FunctionTailcall2( COR_PRF_FRAME_INFO func); ``` -**Tip** : More than once I've seen profiler writers make the following mistake. They will take their naked assembly-language wrapper for their Enter2 and Leave2 hooks, and paste it again to use as the Tailcall2 assembly-language wrapper. The problem is they forget that the Tailcall2 hook takes a different number of parameters than the Enter2 / Leave2 hooks (or, more to the point, a different number of _bytes_ is passed on the stack to invoke the Tailcall2 hook). So, they'll take the "ret 16" at the end of their Enter2/Leave2 hook wrappers and stick that into their Tailcall2 hook wrapper, forgetting to change it to a "ret 12". Don't make the same mistake! +**Tip** : More than once I've seen profiler writers make the following mistake. They will take their naked assembly-language wrapper for their Enter2 and Leave2 hooks, and paste it again to use as the Tailcall2 assembly-language wrapper. The problem is they forget that the Tailcall2 hook takes a different number of parameters than the Enter2 / Leave2 hooks (or, more to the point, a different number of _bytes_ is passed on the stack to invoke the Tailcall2 hook). So, they'll take the "ret 16" at the end of their Enter2/Leave2 hook wrappers and stick that into their Tailcall2 hook wrapper, forgetting to change it to a "ret 12". Don't make the same mistake! It's worth noting what these parameters mean. With the Enter and Leave hooks it's pretty obvious that the parameters your hook is given (e.g., funcId) apply to the function being Entered or Left. But what about the Tailcall hook? Do the Tailcall hook's parameters describe the caller (function making the tail call) or the callee (function being tail called into)? @@ -95,7 +95,7 @@ Ok, enough dilly-dallying. What should your profiler do in its Tailcall hook? Tw The [CLRProfiler](http://www.microsoft.com/downloads/details.aspx?FamilyID=a362781c-3870-43be-8926-862b40aa0cd0&DisplayLang=en) is a great example of using Enter/Leave/Tailcall hooks to maintain shadow stacks. A shadow stack is your profiler's own copy of the current stack of function calls on a given thread at any given time. Upon Enter of a function, you push that FunctionID (and whatever other info interests you, such as arguments) onto your data structure that represents that thread's stack. Upon Leave of a function, you pop that FunctionID. This gives you a live list of managed calls in play on the thread. The CLRProfiler uses shadow stacks so that whenever the managed app being profiled chooses to allocate a new object, the CLRProfiler can know the managed call stack that led to the allocation. (Note that an alternate way of accomplishing this would be to call DoStackSnapshot at every allocation point instead of maintaining a shadow stack. Since objects are allocated so frequently, however, you'd end up calling DoStackSnapshot extremely frequently and will often see worse performance than if you had been maintaining shadow stacks in the first place.) - + OK, so when your profiler maintains a shadow stack, it's clear what your profiler should do on Enter or Leave, but what should it do on Tailcall? There are a couple ways one could imagine answering that question, but only one of them will work! Taking the example from the top of this post, imagine the stack looks like this: @@ -121,9 +121,11 @@ Method 2: On tailcall, "mark" the FunctionID at the top of your stack as needing With this strategy, for the duration of the call to Three(), the shadow stack will look like this: -Three -Helper (marked for deferred pop) -Main +``` +Three +Helper (marked for deferred pop) +Main +``` which some might consider more user-friendly. And as soon as Three() returns, your profiler will sneakily do a double-pop leaving just this: @@ -163,9 +165,11 @@ Method 2: Shadow stack fails At stage (4), the shadow stack looks like this: -Helper -Thread.Sleep (marked for "deferred pop") +``` +Helper +Thread.Sleep (marked for "deferred pop") Main +``` If you think it might be complicated to explain tail calls to your users so they can understand the Method 1 form of shadow stack presentation, just try explaining why it makes sense to present to them that Thread.Sleep() is calling Helper()! @@ -184,11 +188,11 @@ static public void Main() would yield: ``` -Helper -Thread.Sleep (marked for "deferred pop") -Thread.Sleep (marked for "deferred pop") -Thread.Sleep (marked for "deferred pop") -Thread.Sleep (marked for "deferred pop") +Helper +Thread.Sleep (marked for "deferred pop") +Thread.Sleep (marked for "deferred pop") +Thread.Sleep (marked for "deferred pop") +Thread.Sleep (marked for "deferred pop") Main ``` @@ -211,11 +215,11 @@ static public void Helper() would yield: ``` -Thread.Sleep (marked for "deferred pop") -Thread.Sleep (marked for "deferred pop") -Thread.Sleep (marked for "deferred pop") -Thread.Sleep (marked for "deferred pop") -Helper +Thread.Sleep (marked for "deferred pop") +Thread.Sleep (marked for "deferred pop") +Thread.Sleep (marked for "deferred pop") +Thread.Sleep (marked for "deferred pop") +Helper Main ``` @@ -337,7 +341,7 @@ ildasm Class1.exe Inside ildasm, use File.Dump to generate a text file that contains a textual representation of the IL from Class1.exe. Call it Class1WithTail.il. Open up that file and add the tail. prefix just before the call you want optimized into a tail call (see highlighted yellow for changes): ``` -.method private hidebysig static int32 +.method private hidebysig static int32 Helper(int32 i) cil managed { ~~// Code size 45 (0x2d) @@ -386,5 +390,5 @@ If you didn't learn anything, I hope you at least got some refreshing sleep than - Since some managed functions may tail call into native helper functions inside the CLR (for which you won't get an Enter hook notification), your Tailcall hook should treat the tail call as if it were a Leave, and not depend on the next Enter hook correlating to the target of the last tail call. With shadow stacks, for example, this means you should simply pop the calling function off your shadow stack in your Tailcall hook. - Since tail calls can be elusive to find in practice, it's well worth your while to use ildasm/ilasm to manufacture explicit tail calls so you can step through your Tailcall hook and test its logic. -_David has been a developer at Microsoft for over 70 years (allowing for his upcoming time-displacement correction). He joined Microsoft in 2079, first starting in the experimental time-travel group. His current assignment is to apply his knowledge of the future to eliminate the "Wait for V3" effect customers commonly experience in his source universe. By using Retroactive Hindsight-ellisenseTM his goal is to "get it right the first time, this time" in a variety of product groups._ +_David has been a developer at Microsoft for over 70 years (allowing for his upcoming time-displacement correction). He joined Microsoft in 2079, first starting in the experimental time-travel group. His current assignment is to apply his knowledge of the future to eliminate the "Wait for V3" effect customers commonly experience in his source universe. By using Retroactive Hindsight-ellisenseTM his goal is to "get it right the first time, this time" in a variety of product groups._ diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Generics and Your Profiler.md b/docs/design/coreclr/profiling/davbr-blog-archive/Generics and Your Profiler.md index 149a0c0a7888..856290fd9931 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Generics and Your Profiler.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Generics and Your Profiler.md @@ -7,7 +7,7 @@ If you’re writing a profiler that you expect to run against CLR 2.0 or greater Let's say a C# developer writes code like this: - + ``` class MyClass { @@ -57,8 +57,6 @@ HRESULT GetFunctionInfo2([in] FunctionID funcId, typeArgs[]: This is the array of **type arguments** to MyClass\.Foo\. So this will be an array of only one element: the ClassID for float. (The int in MyClass\ is a type argument to MyClass, not to Foo, and you would only see that when you call GetClassIDInfo2 with MyClass\.) -## - ## GetClassIDInfo2 OK, someone in parentheses said something about calling GetClassIDInfo2, so let’s do that. Since we got the ClassID for MyClass\ above, let’s pass it to GetClassIDInfo2 to see what we get: @@ -89,21 +87,19 @@ To understand why, it’s necessary to understand an internal optimization the C For now, the important point is that, once we’re inside JITted code that is shared across different generic instantiations, how can one know which instantiation is the actual one that caused the current invocation? Well, in many cases, the CLR may not have that data readily lying around. However, as a profiler, you can capture this information and pass it back to the CLR when it needs it. This is done through a COR\_PRF\_FRAME\_INFO. There are two ways your profiler can get a COR\_PRF\_FRAME\_INFO: -1. Via slow-path Enter/Leave/Tailcall probes -2. Via your DoStackSnapshot callback +1. Via slow-path Enter/Leave/Tailcall probes +2. Via your DoStackSnapshot callback I lied. #1 is really the only way for your profiler to get a COR\_PRF\_FRAME\_INFO. #2 may seem like a way—at least the profiling API suggests that the CLR gives your profiler a COR\_PRF\_FRAME\_INFO in the DSS callback—but unfortunately the COR\_PRF\_FRAME\_INFO you get there is pretty useless. I suspect the COR\_PRF\_FRAME\_INFO parameter was added to the signature of the profiler’s DSS callback function so that it could “light up” at some point in the future when we could work on finding out how to create a sufficiently helpful COR\_PRF\_FRAME\_INFO during stack walks. However, that day has not yet arrived. So if you want a COR\_PRF\_FRAME\_INFO, you’ll need to grab it—and use it from—your slow-path Enter/Leave/Tailcall probe. With a valid COR\_PRF\_FRAME\_INFO, GetFunctionInfo2 will give you helpful, specific ClassIDs in the typeArgs [out] array and pClassId [out] parameter. If the profiler passes NULL for COR\_PRF\_FRAME\_INFO, here’s what you can expect: -- If you’re using CLR V2, pClassId will point to NULL if the function sits on _any_ generic class (shared or not). In CLR V4 this got a little better, and you’ll generally only see pClassId point to NULL if the function sits on a “shared” generic class (instantiated with reference types). - - Note: If it’s impossible for the profiler to have a COR\_PRF\_FRAME\_INFO handy to pass to GetFunctionInfo2, and that results in a NULL \*pClassID, the profiler can always use the metadata interfaces to find the mdTypeDef token of the class on which the function resides for the purposes of pretty-printing the class name to the user. Of course, the profiler will not know the specific instantiating type arguments that were used on the class in that case. -- the typeArgs [out] array will contain the ClassID for **System.\_\_Canon** , rather than the actual instantiating type(s), if the function itself is generic and is instantiated with reference type argument(s). +- If you’re using CLR V2, pClassId will point to NULL if the function sits on _any_ generic class (shared or not). In CLR V4 this got a little better, and you’ll generally only see pClassId point to NULL if the function sits on a “shared” generic class (instantiated with reference types). + - Note: If it’s impossible for the profiler to have a COR\_PRF\_FRAME\_INFO handy to pass to GetFunctionInfo2, and that results in a NULL \*pClassID, the profiler can always use the metadata interfaces to find the mdTypeDef token of the class on which the function resides for the purposes of pretty-printing the class name to the user. Of course, the profiler will not know the specific instantiating type arguments that were used on the class in that case. +- the typeArgs [out] array will contain the ClassID for **System.\_\_Canon** , rather than the actual instantiating type(s), if the function itself is generic and is instantiated with reference type argument(s). It’s worth noting here that there is a bug in GetFunctionInfo2, in that the [out] pClassId you get for the class containing the function can be wrong with generic virtual functions. Take a look at [this forum post](http://social.msdn.microsoft.com/Forums/en-US/netfxtoolsdev/thread/ed6f972f-712a-48df-8cce-74f8951503fa/) for more information and a workaround. -## - ## ClassIDs & FunctionIDs vs. Metadata Tokens Although you can infer this from the above, let’s take a breather and review. When you have multiple generic instantiations of a generic type, that type is defined with one mdTypeDef (metadata token), but you’ll see multiple ClassIDs (one per instantiation). When you have multiple generic instantiations of a generic method, it’s defined with one mdMethodDef (metadata token), but you’ll see multiple FunctionIDs (one per instantiation). @@ -120,14 +116,14 @@ If you got curious, and ran such a profiler under the debugger, you could use th If your profiler performs IL rewriting, it’s important to understand that it must NOT do instantiation-specific IL rewriting. Huh? Let’s take an example. Suppose you’re profiling code that uses MyClass\.Foo\ and MyClass\.Foo\. Your profiler will see two JITCompilationStarted callbacks, and will have two opportunities to rewrite the IL. Your profiler may call GetFunctionInfo2 on those two FunctionIDs and determine that they’re two different instantiations of the same generic function. You may then be tempted to make use of the fact that one is instantiated with float, and the other with long, and provide different IL for the two different JIT compilations. The problem with this is that the IL stored in metadata, as well as the IL provided to SetILFunctionBody, is always specified relative to the mdMethodDef. (Remember, SetILFunctionBody doesn’t take a FunctionID as input; it takes an mdMethodDef.) And it’s the profiler’s responsibility always to specify the same rewritten IL for any given mdMethodDef no matter how many times it’s JITted. And a given mdMethodDef can be JITted multiple times due to a number of reasons: -- Two threads simultaneously trying to call the same function for the first time (and thus both trying to JIT that function) -- Strange dependency chains involving class constructors (more on this in the MSDN [reference topic](http://msdn.microsoft.com/en-us/library/ms230586.aspx)) -- Multiple AppDomains using the same (non-domain-neutral) function -- And of course multiple generic instantiations! +- Two threads simultaneously trying to call the same function for the first time (and thus both trying to JIT that function) +- Strange dependency chains involving class constructors (more on this in the MSDN [reference topic](http://msdn.microsoft.com/en-us/library/ms230586.aspx)) +- Multiple AppDomains using the same (non-domain-neutral) function +- And of course multiple generic instantiations! Regardless of the reason, the profiler must always rewrite with exactly the same IL. Otherwise, an invariant in the CLR will have been broken by the profiler, and you will get strange, undefined behavior as a result. And no one wants that. - + That’s it! Hopefully this gives you a good idea of how the CLR Profiling API will behave in the face of generic classes and functions, and what is expected of your profiler. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Metadata Tokens, Run-Time IDs, and Type Loading.md b/docs/design/coreclr/profiling/davbr-blog-archive/Metadata Tokens, Run-Time IDs, and Type Loading.md index 1b1e2f74d7a3..283194e860dd 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Metadata Tokens, Run-Time IDs, and Type Loading.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Metadata Tokens, Run-Time IDs, and Type Loading.md @@ -31,16 +31,12 @@ Yes, that is a good example. You are an astute reader. Memory profilers that w # Going from metadata token to run-time ID -# - -# - As I mentioned above, the safest way to do this is to build up your own map and do reverse-lookups as necessary. If that scheme meets your needs, then by all means do that, and stop reading! But in the cases where this is insufficient, you may need to resort to using GetFunctionFromToken(AndTypeArgs) and GetClassFromToken(AndTypeArgs). There is no simple, foolproof way to use these APIs safely, but here is your guideline: **Never call GetFunctionFromToken(AndTypeArgs) and GetClassFromToken(AndTypeArgs) unless you’re certain the relevant types have been loaded.** (“Relevant types” include the ClassID containing the FunctionID whose mdMethodDef you pass to GetFunctionFromToken(AndTypeArgs), and the ClassID whose mdTypeDef you pass to GetClassFromToken(AndTypeArgs).) If these types have not been loaded, _you may cause them to be loaded now_! This is bad because: -- This is an easy way to crash the app. Trying to load a type at the wrong time could cause cycles, causing infinite loops (depending on what your profiler does in response to class load notifications) or outright crashes. For example, trying to load a type while its containing assembly is still in an early phase of loading is a great and fun way to crash the CLR. -- You will impact the behavior of the app. If you’re lucky enough not to crash the app, you’ve still impacted its behavior, by causing types to get loaded in a different order than they normally would. Any impact to app behavior like this makes it difficult for your users to reproduce problems that they are trying to use your tool to diagnose, or may hide problems that they don’t discover until they run their application outside of your tool. +- This is an easy way to crash the app. Trying to load a type at the wrong time could cause cycles, causing infinite loops (depending on what your profiler does in response to class load notifications) or outright crashes. For example, trying to load a type while its containing assembly is still in an early phase of loading is a great and fun way to crash the CLR. +- You will impact the behavior of the app. If you’re lucky enough not to crash the app, you’ve still impacted its behavior, by causing types to get loaded in a different order than they normally would. Any impact to app behavior like this makes it difficult for your users to reproduce problems that they are trying to use your tool to diagnose, or may hide problems that they don’t discover until they run their application outside of your tool. ## Determining whether a class was loaded @@ -54,14 +50,14 @@ MyRetType MyClass::MyFunction(MyArgumentType myArgumentType) then you can be reasonably assured that the following are loaded: -- MyClass -- MyArgumentType (if it’s a value-type) -- MyRetType (if it’s a value-type) -- For any class you know is loaded, so should be: - - its base class - - its value-type fields (not necessarily reference-type fields!) - - implemented interfaces - - value-type generic type arguments (and even reference-type generic type arguments in the case of MyClass) +- MyClass +- MyArgumentType (if it’s a value-type) +- MyRetType (if it’s a value-type) +- For any class you know is loaded, so should be: + - its base class + - its value-type fields (not necessarily reference-type fields!) + - implemented interfaces + - value-type generic type arguments (and even reference-type generic type arguments in the case of MyClass) So much for stacks. What if you encounter an instance of a class on the heap? Surely the class is loaded then, right? Well, probably. If you encounter an object on heap just after GC (inside **GarbageCollectionFinished** , before you return), it should be safe to inspect the class’s layout, and then peek through ObjectIDs to see the values of their fields. @@ -73,7 +69,7 @@ In general, a lot of the uncertainty above comes from types stored in NGENd modu Now is a good time remind you that, not only is it dangerous to inspect run-time IDs too early (i.e., before they load); it’s also dangerous to inspect run-time IDs too late (i.e., after they **unload** ). For example, if you store ClassIDs and FunctionIDs for later use, and use them “too late”, you can easily crash the CLR. The profiling API does pretty much no validation of anything (in many cases, it’s incapable of doing so without using up significant amounts of memory to maintain lookup tables for everything). So we generally take any run-time ID that you pass to ICorProfilerInfo\* methods, cast it to an internal CLR structure ptr, and go boom if the ID is bad. -There is no way to just ask the CLR if a FunctionID or ClassID is valid. Indeed, classes could get unloaded, and new classes loaded, and your ClassID may now refer to a totally different (valid) class. +There is no way to just ask the CLR if a FunctionID or ClassID is valid. Indeed, classes could get unloaded, and new classes loaded, and your ClassID may now refer to a totally different (valid) class. You need to keep track of the unloads yourself. You are notified when run-time IDs go out of scope (today, this happens at the level of an AppDomain unloading or a collectible assembly unloading—in both cases all IDs “contained” in the unloading thing are now invalid). Once a run-time ID is out of scope, you are not allowed to pass that run-time ID back to the CLR. In fact, you should consider whether thread synchronization will be necessary in your profiler to maintain this invariant. For example, if a run-time ID gets unloaded on thread A, you’re still not allowed to pass that run-time ID back to the CLR on thread B. So you may need to block on a critical section in thread A during the \*UnloadStarted / AppDomainShutdown\* callbacks, to prevent them from returning to the CLR until any uses of the contained IDs in thread B are finished. @@ -91,16 +87,16 @@ ResolveTypeRef doesn’t know about any of this—it was never designed to be us If you absolutely need to resolve refs to defs, your best bet may be to use your own algorithm which will be as accurate as you can make it, under the circumstances, and which will never try to locate a module that hasn’t been loaded yet. That means that you shouldn’t try to resolve a ref to a def if that def hasn’t actually been loaded into a type by the CLR. Consider using an algorithm similar to the following: -1. Get the AssemblyRef from the TypeRef to get to the name, public key token and version of the assembly where the type should reside. -2. Enumerate all loaded modules that the Profiling API has notified you of (or via [EnumModules](http://msdn.microsoft.com/en-us/library/dd490890)) (you can filter out a specific AppDomain at this point if you want). -3. In each enumerated module, search for a TypeDef with the same name and namespace as the TypeRef (IMetaDataImport::FindTypeDefByName) -4. Pay attention to **type forwarding**! Once you find the TypeDef, it may actually be an “exported” type, in which case you will need to follow the trail to the next module. Read toward the bottom of [this post](Type Forwarding.md) for more info. +1. Get the AssemblyRef from the TypeRef to get to the name, public key token and version of the assembly where the type should reside. +2. Enumerate all loaded modules that the Profiling API has notified you of (or via [EnumModules](http://msdn.microsoft.com/en-us/library/dd490890)) (you can filter out a specific AppDomain at this point if you want). +3. In each enumerated module, search for a TypeDef with the same name and namespace as the TypeRef (IMetaDataImport::FindTypeDefByName) +4. Pay attention to **type forwarding**! Once you find the TypeDef, it may actually be an “exported” type, in which case you will need to follow the trail to the next module. Read toward the bottom of [this post](Type Forwarding.md) for more info. The above can be a little bit smarter by paying attention to what order you choose to search through the modules: -- First search for the TypeDef in assemblies which exactly match the name, public key token and version for the AssemblyRef. -- If that fails, then search through assemblies matching name and public key token (where the version is higher than the one supplied – this can happen for Framework assemblies). -- If that fails, then search through all the other assemblies +- First search for the TypeDef in assemblies which exactly match the name, public key token and version for the AssemblyRef. +- If that fails, then search through assemblies matching name and public key token (where the version is higher than the one supplied – this can happen for Framework assemblies). +- If that fails, then search through all the other assemblies I must warn you that the above scheme is **not tested and not supported. Use at your own risk!** @@ -108,7 +104,7 @@ I must warn you that the above scheme is **not tested and not supported. Use at Although I cannot comment on what will or will not be in any particular future version of the CLR, I can tell you that it is clear to us on the CLR team that we have work to do, to make dealing with metadata tokens and their corresponding run-time type information easier from the profiling API. After all, it doesn’t take a rocket scientist to read the above and conclude that it does take a rocket scientist to actually follow all this advice. So for now, enjoy the fact that what you do is really hard, making you difficult to replace, and thus your job all the more secure. You’re welcome. - + Special thanks to David Wrighton and Karel Zikmund, who have helped considerably with all content in this entry around the type system and metadata. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Profiler Detach.md b/docs/design/coreclr/profiling/davbr-blog-archive/Profiler Detach.md index 987ee24507b4..4b87a0018c44 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Profiler Detach.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Profiler Detach.md @@ -9,9 +9,9 @@ The Detach feature allows a profiler that the user is finished with to be unload Not every V4 profiler is allowed to detach from a running process. The general rule is that a profiler which has caused an irreversible impact in the process it’s profiling should _not_ attempt to detach. The CLR catches the following cases: -- Profiler set immutable flags (COR\_PRF\_MONITOR\_IMMUTABLE) via SetEventMask. -- Profiler performed IL rewriting via SetILFunctionBody -- Profiler used the Enter/Leave/Tailcall methods to add callouts to its probes +- Profiler set immutable flags (COR\_PRF\_MONITOR\_IMMUTABLE) via SetEventMask. +- Profiler performed IL rewriting via SetILFunctionBody +- Profiler used the Enter/Leave/Tailcall methods to add callouts to its probes If the profiler attempts to detach after doing any of the above, the CLR will disallow the attempt (see below for details). @@ -25,20 +25,20 @@ There’s one, deceptively simple-looking method the profiler calls to detach it So, the sequence works like this: -1. The profiler **deactivates all the ways control could enter the profiler** (aside from the CLR Profiling API itself). This means removing any Windows callbacks, timer interrupts, hijacking, disabling any other components that may try to call into the profiler DLL, etc. The profiler must also wait for all threads that it has created (e.g., a sampling thread, inter-process communication threads, a ForceGC thread, etc.) to exit, except for the one thread the profiler will use to call RequestProfilerDetach(). Any threads created by the CLR, of course, should not be tampered with. - - Your profiler must block here until all those ways control can enter your profiler DLL have truly been deactivated (e.g., just setting a flag to disable sampling may not be enough if your sampling thread is currently performing a sample already in progress). You must coordinate with all components of your profiler so that your profiler DLL knows that everything is verifiably deactivated, and all profiler-created threads have exited (except for the one thread the profiler will use to call RequestProfilerDetach()). -2. If the profiler will use a thread of its own creation to call RequestProfilerDetach() (which is the typical way this API will be called), that thread must own a reference onto the profiler’s DLL, via its own **LoadLibrary()** call that it makes on the profiler DLL. This can either be done when the thread starts up, or now, or sometime in between. But that reference must be added at some point before calling RequestProfilerDetach(). -3. Profiler calls ICorProfilerInfo3:: **RequestProfilerDetach** (). - - (A) This causes the CLR to (synchronously) set internal state to avoid making any further calls into the profiler via the ICorProfilerCallback\* interfaces, and to refuse any calls from the profiler into ICorProfilerInfo\* interfaces (such calls will now fail early with CORPROF\_E\_PROFILER\_DETACHING). - - (B) The CLR also (asynchronously) begins a period safety check on another thread to determine when all pre-existing calls into the profiler via the ICorProfilerCallback\* interfaces have returned. - - Note: It is expected that your profiler will not make any more “unsolicited” calls back into the CLR via any interfaces (ICorProfilerInfo\*, hosting, metahost, metadata, etc.). By “unsolicited”, I’m referring to calls that didn’t originate from the CLR via ICorProfilerCallback\*. In other words, it’s ok for the profiler to continue to do its usual stuff in its implementation of ICorProfilerCallback methods (which may include calling into the CLR via ICorProfilerInfo\*), as the CLR will wait for those outer ICorProfilerCallback methods to return as per 3B. But the profiler must not make any other calls into the CLR (i.e., that are not sandwiched inside an ICorProfilerCallback call). You should already have deactivated any component of your profiler that would make such unsolicited calls in step 1. -4. Assuming the above RequestProfilerDetach call was made on a profiler-created thread, that thread must now call [**FreeLibraryAndExitThread**](http://msdn.microsoft.com/en-us/library/ms683153(VS.85).aspx)**()**. (Note: that’s a specialized Windows API that combines FreeLibrary() and ExitThread() in such a way that races can be avoided—do not call FreeLibrary() and ExitThread() separately.) -5. On another thread, the CLR continues its **period safety checks** from 3B above. Eventually the CLR determines that there are no more ICorProfilerCallback\* interface calls currently executing, and it is therefore safe to unload the profiler. -6. The CLR calls ICorProfilerCallback3:: **ProfilerDetachSucceeded**. The profiler can use this signal to know that it’s about to be unloaded. It’s expected that the profiler will do very little in this callback—probably just notifying the user that the profiler is about to be unloaded. Any cleanup the profiler needs to do should already have been done during step 1. -7. CLR makes the necessary number of **Release** () calls on ICorProfilerCallback3. The reference count should go down to 0 at this point, and the profiler may deallocate any memory it had previously allocated to support its callback implementation. -8. CLR calls **FreeLibrary** () on the profiler DLL. This should be the last reference to the profiler’s DLL, and your DLL will now be unloaded. - - Note: in some cases, it’s theoretically possible that step 4 doesn’t happen until _after_ this step, in which case the last reference to the profiler’s DLL will actually be released by your profiler’s thread that called RequestProfilerDetach and then FreeLibraryAndExitThread. That’s because steps 1-4 happen on your profiler’s thread, and steps 5-8 happen on a dedicated CLR thread (for detaching profilers) sometime after step 3 is completed. So there’s a race between step 4 and all of steps 5-8. There’s no harm in this, so long as you’re playing nice by doing your own LoadLibrary and FreeLibraryAndExitThread as described above. -9. The CLR adds an Informational entry to the Application Event Log noting that the profiler has been unloaded. The CLR is now ready to service any profiler attach requests. +1. The profiler **deactivates all the ways control could enter the profiler** (aside from the CLR Profiling API itself). This means removing any Windows callbacks, timer interrupts, hijacking, disabling any other components that may try to call into the profiler DLL, etc. The profiler must also wait for all threads that it has created (e.g., a sampling thread, inter-process communication threads, a ForceGC thread, etc.) to exit, except for the one thread the profiler will use to call RequestProfilerDetach(). Any threads created by the CLR, of course, should not be tampered with. + - Your profiler must block here until all those ways control can enter your profiler DLL have truly been deactivated (e.g., just setting a flag to disable sampling may not be enough if your sampling thread is currently performing a sample already in progress). You must coordinate with all components of your profiler so that your profiler DLL knows that everything is verifiably deactivated, and all profiler-created threads have exited (except for the one thread the profiler will use to call RequestProfilerDetach()). +2. If the profiler will use a thread of its own creation to call RequestProfilerDetach() (which is the typical way this API will be called), that thread must own a reference onto the profiler’s DLL, via its own **LoadLibrary()** call that it makes on the profiler DLL. This can either be done when the thread starts up, or now, or sometime in between. But that reference must be added at some point before calling RequestProfilerDetach(). +3. Profiler calls ICorProfilerInfo3:: **RequestProfilerDetach** (). + - (A) This causes the CLR to (synchronously) set internal state to avoid making any further calls into the profiler via the ICorProfilerCallback\* interfaces, and to refuse any calls from the profiler into ICorProfilerInfo\* interfaces (such calls will now fail early with CORPROF\_E\_PROFILER\_DETACHING). + - (B) The CLR also (asynchronously) begins a period safety check on another thread to determine when all pre-existing calls into the profiler via the ICorProfilerCallback\* interfaces have returned. + - Note: It is expected that your profiler will not make any more “unsolicited” calls back into the CLR via any interfaces (ICorProfilerInfo\*, hosting, metahost, metadata, etc.). By “unsolicited”, I’m referring to calls that didn’t originate from the CLR via ICorProfilerCallback\*. In other words, it’s ok for the profiler to continue to do its usual stuff in its implementation of ICorProfilerCallback methods (which may include calling into the CLR via ICorProfilerInfo\*), as the CLR will wait for those outer ICorProfilerCallback methods to return as per 3B. But the profiler must not make any other calls into the CLR (i.e., that are not sandwiched inside an ICorProfilerCallback call). You should already have deactivated any component of your profiler that would make such unsolicited calls in step 1. +4. Assuming the above RequestProfilerDetach call was made on a profiler-created thread, that thread must now call [**FreeLibraryAndExitThread**](http://msdn.microsoft.com/en-us/library/ms683153(VS.85).aspx)**()**. (Note: that’s a specialized Windows API that combines FreeLibrary() and ExitThread() in such a way that races can be avoided—do not call FreeLibrary() and ExitThread() separately.) +5. On another thread, the CLR continues its **period safety checks** from 3B above. Eventually the CLR determines that there are no more ICorProfilerCallback\* interface calls currently executing, and it is therefore safe to unload the profiler. +6. The CLR calls ICorProfilerCallback3:: **ProfilerDetachSucceeded**. The profiler can use this signal to know that it’s about to be unloaded. It’s expected that the profiler will do very little in this callback—probably just notifying the user that the profiler is about to be unloaded. Any cleanup the profiler needs to do should already have been done during step 1. +7. CLR makes the necessary number of **Release** () calls on ICorProfilerCallback3. The reference count should go down to 0 at this point, and the profiler may deallocate any memory it had previously allocated to support its callback implementation. +8. CLR calls **FreeLibrary** () on the profiler DLL. This should be the last reference to the profiler’s DLL, and your DLL will now be unloaded. + - Note: in some cases, it’s theoretically possible that step 4 doesn’t happen until _after_ this step, in which case the last reference to the profiler’s DLL will actually be released by your profiler’s thread that called RequestProfilerDetach and then FreeLibraryAndExitThread. That’s because steps 1-4 happen on your profiler’s thread, and steps 5-8 happen on a dedicated CLR thread (for detaching profilers) sometime after step 3 is completed. So there’s a race between step 4 and all of steps 5-8. There’s no harm in this, so long as you’re playing nice by doing your own LoadLibrary and FreeLibraryAndExitThread as described above. +9. The CLR adds an Informational entry to the Application Event Log noting that the profiler has been unloaded. The CLR is now ready to service any profiler attach requests. ## RequestProfilerDetach @@ -46,17 +46,17 @@ Let’s dive a little deeper into the method you call to detach your profiler: `HRESULT RequestProfilerDetach([in] DWORD dwExpectedCompletionMilliseconds);` - + First off, you’ll notice this is on ICorProfilerInfo3, the interface your profiler DLL uses, in the same process as your profilee. Although the AttachProfiler API is called from outside the process, this detach method is called from in-process. Why? Well, the general rule with profilers is that _everything_ is done in-process. Attach is an exception because your profiler isn’t in the process yet. You need to somehow trigger your profiler to load, and you can’t do that from a process in which you have no code executing yet! So Attach is sort of a boot-strapping API that has to be called from a process of your own making. Once your profiler DLL is up and running, it is in charge of everything, from within the same process as the profilee. And detach is no exception. Now with that said, it’s probably typical that your profiler will detach in response to an end user action—probably via some GUI that you ship that runs in its own process. So a case could be made that the CLR team could have made your life easier by providing an out-of-process way to do a detach, so that your GUI could easily trigger a detach, just as it triggered the attach. However, you could make that same argument about all the ways you might want to control a profiler via a GUI, such as these commands: -- Do a GC now and show me the heap -- Dial up or down the sampling frequency -- Change which instrumented methods should log their invocations -- Start / stop monitoring exceptions -- etc. +- Do a GC now and show me the heap +- Dial up or down the sampling frequency +- Change which instrumented methods should log their invocations +- Start / stop monitoring exceptions +- etc. The point is, if you have a GUI to control your profiler, then you probably already have an inter-process mechanism for the GUI to communicate with your profiler DLL. So think of “detach” as yet one more command your GUI will send to your profiler DLL. @@ -66,10 +66,10 @@ The CLR uses that value in its Sleep() statement that sits between each periodic Until the profiler can be unloaded, it will be considered “loaded” (though deactivated in the sense that no new callback methods will be called). This prevents any new profiler from attaching. - + Ok, that wraps up how detaching works. If you remember only one thing from this post, remember that it’s really easy to cause an application you profile to AV after your profiler unloads if you’re not careful. While the CLR tracks outgoing ICorProfilerCallback\* calls, it does not track any other way that control can enter your profiler DLL. _Before_ your profiler calls RequestProfilerDetach: -- You must take care to deactivate all other ways control can enter your profiler DLL -- Your profiler must block until all those other ways control can enter your profiler DLL have verifiably been deactivated +- You must take care to deactivate all other ways control can enter your profiler DLL +- Your profiler must block until all those other ways control can enter your profiler DLL have verifiably been deactivated diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Profiler stack walking Basics and beyond.md b/docs/design/coreclr/profiling/davbr-blog-archive/Profiler stack walking Basics and beyond.md index 682ad7bf583e..935138b64f90 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Profiler stack walking Basics and beyond.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Profiler stack walking Basics and beyond.md @@ -17,31 +17,31 @@ It’s nice to be able to get call stacks whenever you want them. But with powe So let’s take a look at the beast. Here’s what your profiler calls (you can find this in ICorProfilerInfo2, in corprof.idl): ``` -HRESULT DoStackSnapshot( - [in] ThreadID thread, - [in] StackSnapshotCallback *callback, - [in] ULONG32 infoFlags, - [in] void *clientData, - [in, size_is(contextSize), length_is(contextSize)] BYTE context[], +HRESULT DoStackSnapshot( + [in] ThreadID thread, + [in] StackSnapshotCallback *callback, + [in] ULONG32 infoFlags, + [in] void *clientData, + [in, size_is(contextSize), length_is(contextSize)] BYTE context[], [in] ULONG32 contextSize); ``` And here’s what the CLR calls on your profiler (you can also find this in corprof.idl). You’ll pass a pointer to your implementation of this function in the callback parameter above. ``` -typedef HRESULT \_\_stdcall StackSnapshotCallback( - FunctionID funcId, - UINT_PTR ip, - COR_PRF_FRAME_INFO frameInfo, - ULONG32 contextSize, - BYTE context[], +typedef HRESULT __stdcall StackSnapshotCallback( + FunctionID funcId, + UINT_PTR ip, + COR_PRF_FRAME_INFO frameInfo, + ULONG32 contextSize, + BYTE context[], void *clientData); ``` It’s like a sandwich. When your profiler wants to walk the stack, you call DoStackSnapshot. Before the CLR returns from that call, it calls your StackSnapshotCallback several times, once for each managed frame (or run of unmanaged frames) on the stack: ``` -Profiler calls DoStackSnapshot. Whole wheat bread - CLR calls StackSnapshotCallback. Lettuce frame (“leaf”-most frame, ha) - CLR calls StackSnapshotCallback. Tomato frame - CLR calls StackSnapshotCallback. Bacon frame (root or “main” frame) +Profiler calls DoStackSnapshot. Whole wheat bread + CLR calls StackSnapshotCallback. Lettuce frame (“leaf”-most frame, ha) + CLR calls StackSnapshotCallback. Tomato frame + CLR calls StackSnapshotCallback. Bacon frame (root or “main” frame) CLR returns back to profiler from DoStackSnapshot Whole wheat bread ``` @@ -77,50 +77,20 @@ Before I continue from this exciting cliffhanger, a brief interlude. Everyone k Now that we’re speaking the same language. Let’s look at a mixed-mode stack: -| - +``` Unmanaged - - | -| - D (Managed) - - | -| - Unmanaged - - | -| - C (Managed) - - | -| - B (Managed) - - | -| - Unmanaged - - | -| - A (Managed) - - | -| - Main (Managed) - - | +``` Stepping back a bit, it’s worthwhile to understand why DoStackSnapshot exists in the first place. It’s there to help you walk _managed_ frames on the stack. If you tried to walk managed frames yourself, you would get unreliable results, particularly on 32 bits, because of some wacky calling conventions used in managed code. The CLR understands these calling conventions, and DoStackSnapshot is therefore in a uniquely suitable position to help you decode them. However, DoStackSnapshot is not a complete solution if you want to be able to walk the entire stack, including unmanaged frames. Here’s where you have a choice: -1. Do nothing and report stacks with “unmanaged holes” to your users, or +1. Do nothing and report stacks with “unmanaged holes” to your users, or 2. Write your own unmanaged stack walker to fill in those holes. When DoStackSnapshot comes across a block of unmanaged frames, it calls your StackSnapshotCallback with funcId=0. (I think I mentioned this before, but I’m not sure you were listening.) If you’re going with option #1 above, simply do nothing in your callback when funcId=0. We’ll call you again for the next managed frame and you can wake up at that point. @@ -145,81 +115,67 @@ But before you get too deep, note that the issue of whether and how to seed a st For the truly adventurous profiler that is doing an asynchronous, cross-thread, seeded stack walk while filling in the unmanaged holes, here’s what it would look like. -| - -Block of -Unmanaged -Frames +Block of Unmanaged Frames - | -1. You suspend the target thread (target thread’s suspend count is now 1) -2. You get the target thread’s current register context -3. You determine if the register context points to unmanaged code (e.g., call ICorProfilerInfo2::GetFunctionFromIP(), and see if you get back a 0 FunctionID) +1. You suspend the target thread (target thread’s suspend count is now 1) +2. You get the target thread’s current register context +3. You determine if the register context points to unmanaged code (e.g., call ICorProfilerInfo2::GetFunctionFromIP(), and see if you get back a 0 FunctionID) 4. In this case the register context does point to unmanaged code, so you perform an unmanaged stack walk until you find the top-most managed frame (D) - | -| -Function D -(Managed) + ``` + Function D + (Managed) + ``` - | 1. You call DoStackSnapshot with your seed context. CLR suspends target thread again: its suspend count is now 2. Our sandwich begins. 1. CLR calls your StackSnapshotCallback with FunctionID for D. - | -| -Block of -Unmanaged -Frames + ``` + Block of + Unmanaged + Frames + ``` - | 1. CLR calls your StackSnapshotCallback with FunctionID=0. You’ll need to walk this block yourself. You can stop when you hit the first managed frame, or you can cheat: delay your unmanaged walk until sometime after your next callback, as the next callback will tell you exactly where the next managed frame begins (and thus where your unmanaged walk should end). - | -| -Function C -(Managed) - - | + ``` + Function C + (Managed) + ``` 1. CLR calls your StackSnapshotCallback with FunctionID for C. - | -| -Function B -(Managed) + ``` + Function B + (Managed) + ``` - | 1. CLR calls your StackSnapshotCallback with FunctionID for B. - | -| -Block of -Unmanaged -Frames + ``` + Block of + Unmanaged + Frames + ``` - | 1. CLR calls your StackSnapshotCallback with FunctionID=0. Again, you’ll need to walk this block yourself. - | -| -Function A -(Managed) + ``` + Function A + (Managed) + ``` - | 1. CLR calls your StackSnapshotCallback with FunctionID for A. - | -| -Main -(Managed) + ``` + Main + (Managed) + ``` - | -1. CLR calls your StackSnapshotCallback with FunctionID for Main. +1. CLR calls your StackSnapshotCallback with FunctionID for Main. 2. DoStackSnapshot “resumes” target thread (its suspend count is now 1) and returns. Our sandwich is complete. 1. You resume target thread (its suspend count is now 0, so it’s resumed for real). - | **Triumph over evil** @@ -253,8 +209,8 @@ Problem 2: _While you suspend the target thread, the target thread tries to susp “Come on! Like that could really happen.” Believe it or not, if: -- Your app runs on a multiproc box, and -- Thread A runs on one proc and thread B runs on another, and +- Your app runs on a multiproc box, and +- Thread A runs on one proc and thread B runs on another, and - A tries to suspend B while B tries to suspend A then it’s possible that both suspensions win, and both threads end up suspended. It’s like the line from that movie: “Multiproc means never having to say, ‘I lose.’”. Since each thread is waiting for the other to wake it up, they stay suspended forever. It is the most romantic of all deadlocks. @@ -265,7 +221,7 @@ Ok, so, why is the target thread trying to suspend you anyway? Well, in a hypot A less obvious reason that the target thread might try to suspend your walking thread is due to the inner workings of the CLR. The CLR suspends application threads to help with things like garbage collection. So if your walker tries to walk (and thus suspend) the thread doing the GC at the same time the thread doing the GC tries to suspend your walker, you are hosed. -The way out, fortunately, is quite simple. The CLR is only going to suspend threads it needs to suspend in order to do its work. Let’s label the two threads involved in your stack walk: Thread A = the current thread (the thread performing the walk), and Thread B = the target thread (the thread whose stack is walked). As long as Thread A has _never executed managed code_ (and is therefore of no use to the CLR during a garbage collection), then the CLR will never try to suspend Thread A. This means it’s safe for your profiler to have Thread A suspend Thread B, as the CLR will have no reason for B to suspend A. +The way out, fortunately, is quite simple. The CLR is only going to suspend threads it needs to suspend in order to do its work. Let’s label the two threads involved in your stack walk: Thread A = the current thread (the thread performing the walk), and Thread B = the target thread (the thread whose stack is walked). As long as Thread A has _never executed managed code_ (and is therefore of no use to the CLR during a garbage collection), then the CLR will never try to suspend Thread A. This means it’s safe for your profiler to have Thread A suspend Thread B, as the CLR will have no reason for B to suspend A. If you’re writing a sampling profiler, it’s quite natural to ensure all of this. You will typically have a separate thread of your own creation that responds to timer interrupts and walks the stacks of other threads. Call this your sampler thread. Since you create this sampler thread yourself and have control over what it executes, the CLR will have no reason to suspend it. And this also fixes the “poorly-written profiler” example above, since this sampler thread is the only thread of your profiler trying to walk or suspend other threads. So your profiler will never try to directly suspend the sampler thread. @@ -281,7 +237,7 @@ Lucky for you, the CLR notifies profilers when a thread is about to be destroyed Rule 2: Block in ThreadDestroyed callback until that thread’s stack walk is complete - + **_GC helps you make a cycle_** @@ -293,25 +249,25 @@ A while back I mentioned that it is clearly a bad idea for your profiler to hold Example #1: -- Thread A successfully grabs and now owns one of your profiler locks -- Thread B = thread doing the GC -- Thread B calls profiler’s GarbageCollectionStarted callback -- Thread B blocks on the same profiler lock -- Thread A executes GetClassFromTokenAndTypeArgs() -- GetClassFromTokenAndTypeArgs tries to trigger a GC, but notices a GC is already in progress. -- Thread A blocks, waiting for GC currently in progress (Thread B) to complete +- Thread A successfully grabs and now owns one of your profiler locks +- Thread B = thread doing the GC +- Thread B calls profiler’s GarbageCollectionStarted callback +- Thread B blocks on the same profiler lock +- Thread A executes GetClassFromTokenAndTypeArgs() +- GetClassFromTokenAndTypeArgs tries to trigger a GC, but notices a GC is already in progress. +- Thread A blocks, waiting for GC currently in progress (Thread B) to complete - But B is waiting for A, because of your profiler lock. ![](media/gccycle.jpg) Example #2: -- Thread A successfully grabs and now owns one of your profiler locks -- Thread B calls profiler’s ModuleLoadStarted callback -- Thread B blocks on the same profiler lock -- Thread A executes GetClassFromTokenAndTypeArgs() -- GetClassFromTokenAndTypeArgs triggers a GC -- Thread A (now doing the GC) waits for B to be ready to be collected +- Thread A successfully grabs and now owns one of your profiler locks +- Thread B calls profiler’s ModuleLoadStarted callback +- Thread B blocks on the same profiler lock +- Thread A executes GetClassFromTokenAndTypeArgs() +- GetClassFromTokenAndTypeArgs triggers a GC +- Thread A (now doing the GC) waits for B to be ready to be collected - But B is waiting for A, because of your profiler lock. ![](media/deadlock.jpg) @@ -332,10 +288,10 @@ Yeah, if you read carefully, you’ll see that this rule never even mentions DoS I’m just about tuckered out, so I’m gonna close this out with a quick summary of the highlights. Here's what's important to remember. -1. Synchronous stack walks involve walking the current thread in response to a profiler callback. These don’t require seeding, suspending, or any special rules. Enjoy! -2. Asynchronous walks require a seed if the top of the stack is unmanaged code not part of a PInvoke or COM call. You supply a seed by directly suspending the target thread and walking it yourself, until you find the top-most managed frame. If you don’t supply a seed in this case, DoStackSnapshot will just return a failure code to you. -3. If you directly suspend threads, remember that only a thread that has never run managed code can suspend another thread -4. When doing asynchronous walks, always block in your ThreadDestroyed callback until that thread’s stack walk is complete +1. Synchronous stack walks involve walking the current thread in response to a profiler callback. These don’t require seeding, suspending, or any special rules. Enjoy! +2. Asynchronous walks require a seed if the top of the stack is unmanaged code not part of a PInvoke or COM call. You supply a seed by directly suspending the target thread and walking it yourself, until you find the top-most managed frame. If you don’t supply a seed in this case, DoStackSnapshot will just return a failure code to you. +3. If you directly suspend threads, remember that only a thread that has never run managed code can suspend another thread +4. When doing asynchronous walks, always block in your ThreadDestroyed callback until that thread’s stack walk is complete 5. Do not hold a lock while your profiler calls into a CLR function that can trigger a GC Finally, a note of thanks to the rest of the CLR Profiling API team, as the writing of these rules is truly a team effort. And special thanks to Sean Selitrennikoff who provided an earlier incarnation of much of this content. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/ReJIT - The Basics.md b/docs/design/coreclr/profiling/davbr-blog-archive/ReJIT - The Basics.md index 746a45d38c0c..544e0da32d0f 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/ReJIT - The Basics.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/ReJIT - The Basics.md @@ -2,13 +2,13 @@ This post is organized in chronological order, telling what your profiler should be doing at the following times in the process: -- Startup Time -- ModuleLoadFinished Time -- RequestReJIT Time -- Actual ReJIT Time -- RequestRevert Time +- Startup Time +- ModuleLoadFinished Time +- RequestReJIT Time +- Actual ReJIT Time +- RequestRevert Time + - ## Startup Time @@ -22,12 +22,6 @@ Typically, your profiler will also create a new thread at this point, call it yo ## ModuleLoadFinished Time -### - -### - -### - ### Metadata Changes As each module loads, you will likely need to add metadata so that your future ReJITs will have the tokens they need. What you do here heavily depends on the kind of instrumentation you want to do. I’m assuming you’re doing instrumentation that adds some calls from the user code into brand new profiler helper methods you will add somewhere. If you plan to instrument mscorlib, you will likely want to add those profiler helper methods into mscorlib (remember, mscorlib is not allowed to contain an AssemblyRef that points to any other assembly!). Otherwise, perhaps you plan to ship a managed helper assembly that will sit on your user’s disk, and all your profiler helper methods will reside in this on-disk managed helper assembly. @@ -46,19 +40,15 @@ This won’t make much sense until you’ve read the next section, but I’m pla Now imagine your user has turned some dial on your out-of-process GUI, to request that some functions get instrumented (or re-instrumented (or re-re-instrumented (or …))). This results in a signal sent to your in-process profiler component. Your ReJIT Thread now knows it must call **RequestReJIT**. You can call this API once in bulk for a list of functions to ReJIT. Note that functions are expressed in terms of ModuleID + mdMethodDef metadata tokens. A few things to note about this: -- You request that all instantiations of a generic function (or function on a generic class) get ReJITted with a single ModuleID + mdMethodDef pair. You cannot request a specific instantiation be ReJITted, or provide instantiation-specific IL. This is nothing new, as classic first-JIT-instrumentation should never be customized per instantiation either. But the ReJIT API is designed with this restriction in mind, as you’ll see later on. -- ModuleID is specific to one AppDomain for unshared modules, or the SharedDomain for shared modules. Thus: - - If ModuleID is shared, then your request will simultaneously apply to all domains using the shared copy of this module (and thus function) - - If ModuleID is unshared, then your request will apply only to the single AppDomain using this module (and function) - - Therefore, if you want this ReJIT request to apply to _all unshared copies_ of this function: - - You’ll need to include all such ModuleIDs in this request. - - And… any _future_ unshared loads of this module will result in new ModuleIDs. So as those loads happen, you’ll need to make further calls to RequestReJIT with the new ModuleIDs to ensure those copies get ReJITted as well. - - This is optional, and only need be done if you truly want this ReJIT request to apply to all unshared copies of the function. You’re perfectly welcome to ReJIT only those unshared copies you want (and / or the shared copy). - - Now you can re-read the “Re-Request Prior ReJITs” section above. :-) - -## - -### +- You request that all instantiations of a generic function (or function on a generic class) get ReJITted with a single ModuleID + mdMethodDef pair. You cannot request a specific instantiation be ReJITted, or provide instantiation-specific IL. This is nothing new, as classic first-JIT-instrumentation should never be customized per instantiation either. But the ReJIT API is designed with this restriction in mind, as you’ll see later on. +- ModuleID is specific to one AppDomain for unshared modules, or the SharedDomain for shared modules. Thus: + - If ModuleID is shared, then your request will simultaneously apply to all domains using the shared copy of this module (and thus function) + - If ModuleID is unshared, then your request will apply only to the single AppDomain using this module (and function) + - Therefore, if you want this ReJIT request to apply to _all unshared copies_ of this function: + - You’ll need to include all such ModuleIDs in this request. + - And… any _future_ unshared loads of this module will result in new ModuleIDs. So as those loads happen, you’ll need to make further calls to RequestReJIT with the new ModuleIDs to ensure those copies get ReJITted as well. + - This is optional, and only need be done if you truly want this ReJIT request to apply to all unshared copies of the function. You’re perfectly welcome to ReJIT only those unshared copies you want (and / or the shared copy). + - Now you can re-read the “Re-Request Prior ReJITs” section above. :-) ### More on AppDomains @@ -81,18 +71,18 @@ You may have noticed that you have read a whole lot of words so far, but we have IF this is the first generic instantiation to ReJIT, for a given RequestReJIT call (or this is not a generic at all), THEN: - CLR calls **GetReJITParameters** - - This callback passes an ICorProfilerFunctionControl to your profiler. Inside your implementation of GetReJITParameters (and no later!) you may call into ICorProfilerFunctionControl to provide the instrumented IL and codegen flags that the CLR should use during the ReJIT - - Therefore it is here where you may: - - Call GetILFunctionBody - - Add any new LocalVarSigTokens to the function’s module’s metadata. (You may not do any other metadata modifications here, though!) - - Rewrite the IL to your specifications, passing it to ICorProfilerFunctionControl::SetILFunctionBody. - - You may NOT call ICorProfilerInfo::SetILFunctionBody for a ReJIT! This API still exists if you want to do classic first-JIT IL rewriting only. - - Note that GetReJITParameters expresses the function getting compiled in terms of the ModuleID + mdMethodDef pair you previously specified to RequestReJIT, and _not_ in terms of a FunctionID. As mentioned before, you may not provide instantiation-specific IL! + - This callback passes an ICorProfilerFunctionControl to your profiler. Inside your implementation of GetReJITParameters (and no later!) you may call into ICorProfilerFunctionControl to provide the instrumented IL and codegen flags that the CLR should use during the ReJIT + - Therefore it is here where you may: + - Call GetILFunctionBody + - Add any new LocalVarSigTokens to the function’s module’s metadata. (You may not do any other metadata modifications here, though!) + - Rewrite the IL to your specifications, passing it to ICorProfilerFunctionControl::SetILFunctionBody. + - You may NOT call ICorProfilerInfo::SetILFunctionBody for a ReJIT! This API still exists if you want to do classic first-JIT IL rewriting only. + - Note that GetReJITParameters expresses the function getting compiled in terms of the ModuleID + mdMethodDef pair you previously specified to RequestReJIT, and _not_ in terms of a FunctionID. As mentioned before, you may not provide instantiation-specific IL! And then, for all ReJITs (regardless of whether they are for the first generic instantiation or not): -- CLR calls **ReJITCompilationStarted** -- CLR calls **ReJITCompilationFinished** +- CLR calls **ReJITCompilationStarted** +- CLR calls **ReJITCompilationFinished** These callbacks express the function getting compiled in terms of FunctionID + ReJITID. (ReJITID is simply a disambiguating value so that each ReJITted version of a function instantiation can be uniquely identified via FunctionID + ReJITID.) Your profiler doesn’t need to do anything in the above callbacks if it doesn’t want to. They just notify you that the ReJIT is occurring, and get called for each generic instantiation (or non-generic) that gets ReJITted. @@ -114,12 +104,12 @@ Note that RequestRevert allows you to revert back to the original JITted IL, and If there are any errors with performing the ReJIT, you will be notified by the dedicated callback ICorProfilerCallback4::ReJITError(). Errors can happen at a couple times: -- RequestReJIT Time: These are fundamental errors with the request itself. This can include bad parameter values, requesting to ReJIT dynamic (Ref.Emit) code, out of memory, etc. If errors occur here, you’ll get a callback to your implementation of ReJITError(), sandwiched inside your call to RequestReJIT on your ReJIT Thread. -- Actual ReJIT Time: These are errors we don’t encounter until actually trying to ReJIT the function itself. When these later errors occur, your implementation of ReJITError() is called on whatever CLR thread encountered the error. +- RequestReJIT Time: These are fundamental errors with the request itself. This can include bad parameter values, requesting to ReJIT dynamic (Ref.Emit) code, out of memory, etc. If errors occur here, you’ll get a callback to your implementation of ReJITError(), sandwiched inside your call to RequestReJIT on your ReJIT Thread. +- Actual ReJIT Time: These are errors we don’t encounter until actually trying to ReJIT the function itself. When these later errors occur, your implementation of ReJITError() is called on whatever CLR thread encountered the error. You’ll note that ReJITError can provide you not only the ModuleID + mdMethodDef pair that caused the error, but optionally a FunctionID as well. Depending on the nature of the error occurred, the FunctionID may be available, so that your profiler may know the exact generic instantiation involved with the error. If FunctionID is null, then the error was fundamental to the generic function itself (and thus occurred for all instantiations). - + Ok, that about covers it on how your profiler is expected to use ReJIT. As you can see, there are several different tasks your profiler needs to do at different times to get everything right. But I trust you, you’re smart. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Sample A Signature Blob Parser for your Profiler.md b/docs/design/coreclr/profiling/davbr-blog-archive/Sample A Signature Blob Parser for your Profiler.md index 34be8594412d..88ab78844b3d 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Sample A Signature Blob Parser for your Profiler.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Sample A Signature Blob Parser for your Profiler.md @@ -3,43 +3,46 @@ If your profiler plays with metadata, you've undoubtedly come across signature blobs. They’re used to encode type information for method definitions & references, local variables, and a whole lot more. They’re wonderfully compact, recursively versatile, and sometimes, well, challenging to parse. Fortunately, [Rico Mariani](https://docs.microsoft.com/en-us/archive/blogs/ricom/) was feeling generous one day, and churned out a simple parser that can read these types of signatures: -MethodDefSig -MethodRefSig -StandAloneMethodSig -FieldSig -PropertySig -LocalVarSig - -Here are the files: -[sigparse.cpp](samples/sigparse.cpp) (Rico's signature parser) -[sigformat.cpp](samples/sigformat.cpp) (An example extension to the parser) -[PlugInToYourProfiler.cpp](samples/PlugInToYourProfiler.cpp) (Example code to plug the extension into your profiler) +- MethodDefSig +- MethodRefSig +- StandAloneMethodSig +- FieldSig +- PropertySig +- LocalVarSig + +Here are the files: + +- [sigparse.cpp](samples/sigparse.cpp) (Rico's signature parser) +- [sigformat.cpp](samples/sigformat.cpp) (An example extension to the parser) +- [PlugInToYourProfiler.cpp](samples/PlugInToYourProfiler.cpp) (Example code to plug the extension into your profiler) Open up **sigparse.cpp** in your favorite editor and take a look at the grammar at the top. The grammar comes from the ECMA CLI spec. Jonathan Keljo has a [link](http://blogs.msdn.com/jkeljo/archive/2005/08/04/447726.aspx) to it from his blog. This tells you the types of signature blobs the parser can handle. Sigparse.cpp is structured without any dependencies on any headers, so you can easily absorb it into your profiler project. There are two things you will need to do to make use of the code. I provided examples of each of these in the download above to help you out: -1. You will **extend the code** to make use of the parsed components of the signature however you like. Perhaps you’ll build up your own internal structures based on what you find. Or maybe you’ll build a pretty-printer that displays method prototypes in the managed language of your choice. -2. You will then **call the code** to perform the parse on signature blobs you encounter while profiling. +1. You will **extend the code** to make use of the parsed components of the signature however you like. Perhaps you’ll build up your own internal structures based on what you find. Or maybe you’ll build a pretty-printer that displays method prototypes in the managed language of your choice. +2. You will then **call the code** to perform the parse on signature blobs you encounter while profiling. ## Extending the code Simply derive a new class from SigParser, and override the virtual functions. The functions you override are events to be handled as the parser traverses the signature in top-down fashion. For example, when the parser encounters a MethodDef, you might see calls to your overrides of: -NotifyBeginMethod() - NotifyParamCount() - NotifyBeginRetType() - NotifyBeginType() - NotifyTypeSimple() - NotifyEndType() - NotifyEndRetType() - NotifyBeginParam() - NotifyBeginType() - NotifyTypeSimple() - NotifyEndType() - NotifyEndParam() - _… (more parameter notifications occur here if more parameters exist)_ +``` +NotifyBeginMethod() + NotifyParamCount() + NotifyBeginRetType() + NotifyBeginType() + NotifyTypeSimple() + NotifyEndType() + NotifyEndRetType() + NotifyBeginParam() + NotifyBeginType() + NotifyTypeSimple() + NotifyEndType() + NotifyEndParam() + _… (more parameter notifications occur here if more parameters exist)_ NotifyEndMethod() +``` And yes, generics are handled as well. @@ -60,4 +63,3 @@ Don't worry, it's optional. I mentioned above that only signatures whose grammar The only gotcha is that TypeSpecs & MethodSpecs don’t have a unique byte that introduces them. For example, GENERICINST could indicate the beginning of a TypeSpec or a MethodSpec. You’ll see that SigParser::Parse() switches on the intro byte to determine what it’s looking at. So to keep things simple, you’ll want to add a couple more top-level functions to SigParser to parse TypeSpecs & MethodSpecs (say, ParseTypeSpec() & ParseMethodSpec()). You’d then call those functions instead of Parse() when you have a TypeSpec or MethodSpec on your hands. Of course, if you don’t care about TypeSpecs and MethodSpecs, you can use the code as is and not worry. But this stuff is so much fun, you’ll probably want to add the capability anyway. Hope you find this useful. And thanks again to Rico Mariani for sigparse.cpp! - diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Tail call JIT conditions.md b/docs/design/coreclr/profiling/davbr-blog-archive/Tail call JIT conditions.md index 194c0ba517aa..ad3e937e8e3a 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Tail call JIT conditions.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Tail call JIT conditions.md @@ -8,28 +8,28 @@ _First, Grant talked about the 64-bit JITs (one for x64, one for ia64):_ For the 64-bit JIT, we tail call whenever we’re allowed to. Here’s what prevents us from tail calling (in no particular order): - We inline the call instead (we never inline recursive calls to the same method, but we will tail call them) -- The call/callvirt/calli is followed by something other than nop or ret IL instructions. -- The caller or callee return a value type. -- The caller and callee return different types. -- The caller is synchronized (MethodImplOptions.Synchronized). -- The caller is a shared generic method. -- The caller has imperative security (a call to Assert, Demand, Deny, etc.). -- The caller has declarative security (custom attributes). +- The call/callvirt/calli is followed by something other than nop or ret IL instructions. +- The caller or callee return a value type. +- The caller and callee return different types. +- The caller is synchronized (MethodImplOptions.Synchronized). +- The caller is a shared generic method. +- The caller has imperative security (a call to Assert, Demand, Deny, etc.). +- The caller has declarative security (custom attributes). - The caller is varargs -- The callee is varargs. +- The callee is varargs. - The runtime forbids the JIT to tail call. (_There are various reasons the runtime may disallow tail calling, such as caller / callee being in different assemblies, the call going to the application's entrypoint, any conflicts with usage of security features, and other esoteric cases._) -- The il did not have the tail. prefix and we are not optimizing (the profiler and debugger control this) -- The il did not have the tail. prefix and the caller had a localloc instruction (think alloca or dynamic stack allocation) -- The caller is getting some GS security cookie checks -- The il did not have the tail. prefix and a local or parameter has had its address taken (ldarga, or ldloca) +- The il did not have the tail. prefix and we are not optimizing (the profiler and debugger control this) +- The il did not have the tail. prefix and the caller had a localloc instruction (think alloca or dynamic stack allocation) +- The caller is getting some GS security cookie checks +- The il did not have the tail. prefix and a local or parameter has had its address taken (ldarga, or ldloca) - The caller is the same as the callee and the runtime disallows inlining - The callee is invoked via stub dispatch (_i.e., via intermediate code that's generated at runtime to optimize certain types of calls_). -- For x64 we have these additional restrictions: +- For x64 we have these additional restrictions: - - The callee has one or more parameters that are valuetypes of size 3,5,6,7 or \>8 bytes - - The callee has more than 4 arguments (don’t forget to count the this pointer, generics, etc.) and more than the caller + - The callee has one or more parameters that are valuetypes of size 3,5,6,7 or \>8 bytes + - The callee has more than 4 arguments (don’t forget to count the this pointer, generics, etc.) and more than the caller - For all of the parameters passed on the stack the GC-ness must match between the caller and callee. (_"GC-ness" means the state of being a pointer to the beginning of an object managed by the GC, or a pointer to the interior of an object managed by the GC (e.g., a byref field), or neither (e.g., an integer or struct)._) -- For ia64 we have this additional restriction: +- For ia64 we have this additional restriction: - Any of the callee arguments do not get passed in a register. diff --git a/docs/design/coreclr/profiling/davbr-blog-archive/Type Forwarding.md b/docs/design/coreclr/profiling/davbr-blog-archive/Type Forwarding.md index f503b612cda3..aae3f7d87402 100644 --- a/docs/design/coreclr/profiling/davbr-blog-archive/Type Forwarding.md +++ b/docs/design/coreclr/profiling/davbr-blog-archive/Type Forwarding.md @@ -9,14 +9,12 @@ Type forwarding is nothing new. However, in CLR V4, we are enabling type forwar The example I’ll use where the .NET Framework uses type forwarding is the TimeZoneInfo class. In CLR V4, TimeZoneInfo is now forwarded from System.Core.dll to mscorlib.dll. If you open the CLR V4 copy of System.Core.dll in ildasm and choose Dump, you'll see the following: -| ``` .class extern /*27000004*/ forwarder System.TimeZoneInfo { - .assembly extern mscorlib /*23000001*/ + .assembly extern mscorlib /*23000001*/ } ``` - | In each assembly’s metadata is an exported types table. The above means that System.Core.dll's exported types table includes an entry for System.TimeZoneInfo (indexed by token 27000004). What's significant is that System.Core.dll no longer has a typeDef for System.TimeZoneInfo, only an exported type. The fact that the token begins at the left with 0x27 tells you that it's an mdtExportedType (not a mdtTypeDef, which begins at the left with 0x02). @@ -28,15 +26,15 @@ This walkthrough assumes you have .NET 4.0 or later installed **and** an older r Code up a simple C# app that uses System.TimeZoneInfo: ``` -namespace test -{ - class Class1 - { - static void Main(string[] args) - { - System.TimeZoneInfo ti = null; - } - } +namespace test +{ + class Class1 + { + static void Main(string[] args) + { + System.TimeZoneInfo ti = null; + } + } } ``` @@ -49,7 +47,7 @@ csc /debug+ /o- /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framew Again, be sure you’re using an old csc.exe from, say, a NET 3.5 installation. To verify, open up Class1.exe in ildasm, and take a look at Main(). It should look something like this: ``` -.method /*06000001*/ private hidebysig static +.method /*06000001*/ private hidebysig static void Main(string[] args) cil managed { .entrypoint @@ -70,11 +68,11 @@ Note that, if you were to build the above C# code using the .NET 4.0 C# compiler Ok, so how do we run this pre-.NET 4.0 executable against .NET 4.0? A config file, of course. Paste the following into a file named Class1.exe.config that sits next to Class1.exe: ``` - - - - - + + + + + ``` The above will force Class1.exe to bind against .NET 4.0 Beta 1. And when it comes time to look for TimeZoneInfo, the CLR will first look in System.Core.dll, find the exported types table entry, and then hop over to mscorlib.dll to load the type. What does that look like to your profiler? Make your guess and hold that thought. First, another walkthrough… @@ -83,14 +81,14 @@ The above will force Class1.exe to bind against .NET 4.0 Beta 1. And when it co To experiment with forwarding your own types, the process is: -- Create Version 1 of your library - - - Create version 1 of your library assembly that defines your type (MyLibAssemblyA.dll) - - Create an app that references your type in MyLibAssemblyA.dll (MyClient.exe) -- Create version 2 of your library - - - Recompile MyLibAssemblyA.dll to forward your type elsewhere (MyLibAssemblyB.dll) - - Don’t recompile MyClient.exe. Let it still think the type is defined in MyLibAssemblyA.dll. +- Create Version 1 of your library + + - Create version 1 of your library assembly that defines your type (MyLibAssemblyA.dll) + - Create an app that references your type in MyLibAssemblyA.dll (MyClient.exe) +- Create version 2 of your library + + - Recompile MyLibAssemblyA.dll to forward your type elsewhere (MyLibAssemblyB.dll) + - Don’t recompile MyClient.exe. Let it still think the type is defined in MyLibAssemblyA.dll. ### Version 1 @@ -140,9 +138,9 @@ Ok, time to upgrade! ### Version 2 Time goes by, your library is growing, and its time to split it into two DLLs. Gotta move Foo into the new DLL. Save this into MyLibAssemblyB.cs ``` -using System; -public class Foo -{ +using System; +public class Foo +{ } ``` @@ -170,7 +168,7 @@ Foo, MyLibAssemblyB, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null And this all despite the fact that MyClient.exe still believes that Foo lives in MyLibAssemblyA: ``` -.method /*06000001*/ public hidebysig static +.method /*06000001*/ public hidebysig static void Main() cil managed { .entrypoint @@ -188,7 +186,6 @@ And this all despite the fact that MyClient.exe still believes that Foo lives in IL\_001c: ret } // end of method Test::Main ``` - | ## Profilers @@ -199,5 +196,3 @@ This should make life easy for profilers, since they generally expect to be able However, type forwarding is important to understand if your profiler needs to follow metadata references directly. More generally, if your profiler is reading through metadata and expects to come across a typeDef (e.g., perhaps a metadata reference points to a type in that module, or perhaps your profiler expects certain known types to be in certain modules), then your profiler should be prepared to find an mdtExportedType instead, and to deal gracefully with it rather than doing something silly like crashing. In any case, whether you think your profiler will be affected by type forwarding, be sure to test, test, test! - - \ No newline at end of file diff --git a/docs/design/features/COM-activation.md b/docs/design/features/COM-activation.md index c4302e53f2b1..409d950f045a 100644 --- a/docs/design/features/COM-activation.md +++ b/docs/design/features/COM-activation.md @@ -105,7 +105,7 @@ When `DllGetClassObject()` is called in a COM activation scenario, the following ``` Note this API is not exposed outside of `System.Private.CoreLib` and is subject to change at any time. * The loading of the assembly will take place in a new [`AssemblyLoadContext`](https://docs.microsoft.com/dotnet/api/system.runtime.loader.assemblyloadcontext) for dependency isolation. Each assembly path will get a seperate `AssemblyLoadContext`. This means that if an assembly provides multiple COM servers all of the servers from that assembly will reside in the same `AssemblyLoadContext`. - * The created `AssemblyLoadContext` will use an [`AssemblyDependencyResolver`](https://github.com/dotnet/corefx/issues/33165) that was supplied with the path to the assembly to load assemblies. + * The created `AssemblyLoadContext` will use an [`AssemblyDependencyResolver`](https://github.com/dotnet/runtime/issues/27787) that was supplied with the path to the assembly to load assemblies. 1) The `IClassFactory` instance is returned to the caller of `DllGetClassObject()` to attempt class activation. The `DllCanUnloadNow()` function will always return `S_FALSE` indicating the shim is never able to be unloaded. This matches .NET Framework semantics but may be adjusted in the future if needed. diff --git a/docs/design/features/DotNetCore-SharedPackageStore.md b/docs/design/features/DotNetCore-SharedPackageStore.md index 45b7aaa01828..ad60f8e8a5dd 100644 --- a/docs/design/features/DotNetCore-SharedPackageStore.md +++ b/docs/design/features/DotNetCore-SharedPackageStore.md @@ -24,7 +24,7 @@ The package store can be either a global system-wide folder or a dotnet.exe rela + netcoreapp2.1 + refs + netcoreapp2.0 - + netcoreapp2.1 + + netcoreapp2.1 ``` The layout within `netcoreapp*` folders is a NuGet cache layout. @@ -34,7 +34,7 @@ The layout within `netcoreapp*` folders is a NuGet cache layout. To compose the layout of the shared package store, we will use a dotnet command called `dotnet store`. We expect the *hosting providers* (ex: Antares) to use the command to prime their machines and framework authors who want to provide *pre-optimized package archives* create the compressed archive layouts. -The layout is composed from a list of package names and versions specified as xml: +The layout is composed from a list of package names and versions specified as xml: **Roslyn Example** ```xml @@ -72,7 +72,7 @@ The output folder will be consumed by the runtime by adding to the `DOTNET_SHARE # Building apps with shared packages -The current mechanism to build applications that share assemblies is by not specifying a RID in the project file. Then, a portable app model is assumed and assemblies that are part of Microsoft.NETCore.App are found under the `dotnet` install root. With shared package store, applications have the ability to filter any set of packages from their publish output. Thus the decision of a portable or a standalone application is not made at the time of project authoring but is instead done at publish time. +The current mechanism to build applications that share assemblies is by not specifying a RID in the project file. Then, a portable app model is assumed and assemblies that are part of Microsoft.NETCore.App are found under the `dotnet` install root. With shared package store, applications have the ability to filter any set of packages from their publish output. Thus the decision of a portable or a standalone application is not made at the time of project authoring but is instead done at publish time. ## Project Authoring We will by default treat `Microsoft.NETCore.App` as though `type: platform` is always specified, thus requiring no explicit RID specification by the user. It will be an `ERROR` to specify a RID in the csproj file using the `` tag. diff --git a/docs/design/features/DynamicPgo.md b/docs/design/features/DynamicPgo.md new file mode 100644 index 000000000000..b29f165ddd5e --- /dev/null +++ b/docs/design/features/DynamicPgo.md @@ -0,0 +1,696 @@ +# Dynamic PGO + +The following document outlines the overall approach to profile guided optimization (aka PGO) that I'd like to see us adopt in the JIT. + +It is based on past experience and familiarity with profile guided optimization in several different AOT compilation toolchains, namely +* HP-UX Compilers (circa 1993-1997, known as PBO) +* MSVC's implementation of PGO (and PGO2) +* Midori's implementation of PGO in Bartok/Phoenix +* LLVM's implementation of PGO (known as FDO) + +However, the approach described here differs materially from those efforts because the primary focus of this work is a jitted environment. As such, it presents unique challenges and compelling new opportunities. That being said, much of the work proposed below will also benefit AOT scenarios. + +We are calling this effort "Dynamic PGO". + +A good portion of what follows is background and exposition. If you're mainly interested in the proposed work, you may want to [skip to that section](#ProposedWork). + +You may already be familiar with the legacy .NET approach to profile feedback, commonly called IBC (Instrumented Block Counts). If not, there is a brief [writeup on IBC](#IBC) at the end of the document. + +## General Idea + +Profile based optimization relies heavily on the principle that past behavior is a good predictor of future behavior. Thus observations about past program behavior can steer optimization decisions in profitable directions, so that future program execution is more efficient. + +These observations may come from the recent past, perhaps even from the current execution of a program, or from the distant past. Observations can be from the same version of the program or from different versions. + +Observations are most often block counts, but can cover many different aspects of behavior; some of these are sketched below. + +A number of important optimizations are really only practical when profile feedback is available. Key among these is aggressive inlining, but many other speculative, time-consuming, or size-expanding optimizations fall in this category. + +Profile feedback is especially crucial in JIT-based environments, where compile time is at a premium. Indeed, one can argue that the performance of modern Java and Javascript implementations hinges crucially on effective leverage of profile feedback. + +Profile guided optimization benefits both JIT and AOT compilation. While this document focuses largely on the benefits to JIT compilation, but much of what follows is also applicable to AOT. The big distinction is ease of use -- in a jitted environment profile based optimization can be done automatically, and so can be offered as a platform feature without requiring any changes to applications. + +.NET currently has a somewhat arm's-length approach to profile guided optimization, and does not obtain much benefit from it. Significant opportunity awaits us if we can tap into this technology. + +## Overview + +Broadly put, there are three main aspects to profile guided optimization: +* How to [gather profile data](#Gather) +* How to [represent and maintain profile data](#RepMain) during compilation +* How to [leverage profile data](#Opt) for optimization + +The following sections explore these in detail. + +## Gathering Profile Data + + +Profile data is most commonly thought of as execution counts for basic blocks. But other kinds of data can be collected, for instance histograms for the distribution of runtime types, indirect call targets, argument lengths to key methods, switch value histograms, and so on. Profile data can also be contextual, representing counts or distributions in specific circumstances. Profile data can try and capture traces or paths instead of simple counts. + +For histogram style data one can create approximate histograms using relatively small amounts space using techniques inspired by "online sampling" of data bases. Often exact counts are not needed; what is interesting are cases where a small number of items occur with high frequency. For example, when instrumenting an indirect call site, the interesting case is where one or two targets stand out from all the rest. + +Profile feedback can be approximate in other ways, for example derived via "random" sampling based on timers or hardware counter interrupts. It is important that the consumption of profile data be robust in the presence of errors and be tolerant of inconsistent information. + +Key techniques for profile feedback are: +* Instrumentation +* Sampling +* Synthesis +* User Annotation +* Contextual Profiling +* Hybrid Approaches + +### Instrumentation + +Instrumentation describes techniques where some version of the code being measured is explicitly modified to measure events of interest. + +#### The "Fixed Point" + +For a given class of instrumentation, there is typically one place in the JIT -- the so-called fixed point -- where code is instrumented and/or profile data is read from an external source. + +If the profile data is being used to drive optimization, the fixed point must happen before the optimizations. Since the major beneficiary of profile feedback is the inliner and the inlining phase runs quite early, the nominal place for the fixed point is just before inlining. + +If the profile data is used for other purposes (say offline analysis) then instrumentation can happen most anywhere. Often it is interesting to have a very late instrumentation pass that can measure the execution frequency of the basic blocks. + +#### Probes + +Instrumentation sequences to measure aspects of behavior are commonly called probes. + +#### Minimizing Probe Costs + +There are two aspects to probe costs. + +The first is a static cost proportional to the number of probes and the size of each probe. Instrumented code is larger and takes longer to produce. Thus it behooves us to use as few probes as possible and to try and produce compact instruction sequences for each probe. + +The second is a dynamic cost -- as each probe is executed at runtime it slows down the overall computation. + +As we'll see below there is considerable redundancy in the count data across the blocks and edges of a flow graph. So a simplistic instrumentation scheme that instruments each block collects more data than is strictly necessary. We can use a sparse instrumentation scheme. + +One common approach to building a sparse scheme is to leverage flow graph structure. We first build a spanning tree on the graph (a tree starting at method entry that connects all nodes, such that adding back any of the omitted edges would turn the tree into a dag or a graph with a cycle). Then we only need put probes on the edges of the graph not in the spanning tree. This will minimize static probe costs. + +If we've run profile synthesis or are instrumenting a flowgraph with profile data, we can form a maximum weight spanning tree. This will minimize dynamic probe costs. + +Proper count reconstruction from sparse instrumentation requires that at the point of profile ingestion we can build an exactly matching flow graph to the one we had at instrumentation time. Thus it's not well suited for cases where we have profile data from prior versions of the program. But for in-process profiling it should work well. + +One can also consider taking advantage of so-called "counted" loops to remove probes from some loop bodies. However this may require program analysis capabilities that are not available in the compiler doing the instrumentation. + +We should set goals for profiling overhead, including +* additional time needed to generate Tier0 code +* additional size for Tier0 code +* additional time to execute Tier0 code +* amount of memory needed to hold profile data + +#### Methods With No Control Flow + +If a method has no control flow we should consider not instrumenting it at all -- more precisely, there is not much point in gathering block counts. We'll lose any semblance of [global importance](#Global) (that is, we won't know how often such methods are called) but perhaps we can get at that information some other way (e.g. the call counting data the runtime keeps to trigger tiered compilation, or some kind of low-overhead background sampling). + +.NET, particularly Tier0, has lots of tiny simple methods like property getters that don't need any instrumentation. + +#### Dynamic Range + +Modern processors are fairly fast and a 32 bit count value can roll over or saturate in a matter of seconds for a compute intensive loop. We should seriously consider using 64 bit counters and/or using doubles for counts. + +Using doubles has the nice property that count values naturally saturate and so there is no concern of roll-over. However there tend not to be compact sequences for incrementing double values (or RMW ops) so this may also increase probe cost. + +If we do end up using 32 bit counts then the profile ingestion system will have to tolerate the cases where counts have rolled over. This will likely show up as large-scale inconsistencies in the ingested profile, and likely at that point the entire set of data will need to be dropped. + +#### Instrumentation and Inlining + +When producing instrumented code we may also want to enable other optimizations like inlining (this is especially important in AOT). The ideal situation here is for inlinees to "carry their probes" with them so that there is one set of counts per inlinee. + +Currently Crossgen's IBC mode inlines but does not put any probes in inlinees; this leads to an unfortunate data loss for any inlinee with control flow. + +One can consider more elaborate schemes where profile data for inlinees is collected per-caller or per-callsite. More on this below (see contextual profiling). + +Similar concerns apply to any other code duplicating optimization within the compiler. But since the profile fixed point tends to be early in the phase pipeline, the probe IR sequences are added early, and so these sequences get duplicated naturally as optimizations unfold. An optimization that duplicates a block -- say for example the `for loop` to `do-while loop` transformation -- will also create a duplicate count probe. The original probe and the duplicate probe will both increment to the same counter, and so at runtime, the counter will end up with a count value that properly reflects the count for the code seen when the code was instrumented. + +Whenever code is duplicated like this there is an opportunity here to instead create a distinct set of counters; this creates a version of [contextual profiling](#context) which can be useful -- for example, capturing zero trip counts of loops. More on this below too. + +#### Where Profile Data is Kept + +For dynamic PGO the probes need to write their data into some sort of storage pool that lives as long as the associated method. + +The current prototype (TieredPGO) has the runtime allocate a fixed-sized slab for profile data. As each method is instrumented during Tier0, a chunk of this slab is reserved for that method. The JIT fills in key bits of keying and schema information, and bakes the addresses of the counter slots into the individual probes. As the instrumented method runs these slots accumulate the counts. If the slab fills up then subsequently jitted Tier0 methods simply aren't instrumented. + +When a Tier1 method is jitted, the JIT asks the runtime to find the associated profile data; this currently uses the keying information to search the slab, and returns the reserved section. The JIT then reads the values from the section. + +Note the Tier0 method may still be running when the Tier1 rejit happens, so it's possible for the count data to be changing as the Tier1 rejit is reading it. This may cause issues for count consistency and may also make accurate SPMI replay tricky (SPMI will record possibly a different count snapshot than the JIT sees). + +The implementation for TieredPGO was intentionally kept simple (in part to allow easy import and export) and a "production ready" implementation will likely do things differently: +* allow one slab per method, or multiple slabs +* directly associate reserved part of slab with method so we don't have to search for it during Tier1 +* (perhaps) reclaim slabs once Tier0 code is retired +* use a more memory efficient representation + +#### Externalizing Data + +If we want to externalize data for offline analysis or to feed into a subsequent run of the program, we also need to produce some keying data so that the per-method data can be matched up properly later on. + +This is surprisingly challenging in .NET as there's not a strong external notion of method identity from one run to the next. We currently rely on token, hash, and il size as keys. Note things like the multi-core JIT must solve similar problems. We will leverage David Wrighton's [dotnet-pgo](https://github.com/dotnet/runtime/blob/master/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo-experiment.md) work here. + +We may also wish to externalize flow graphs to allow offline analysis or to allow some kind of fuzzy matching of old profile data in a new version of the program (this is done by MSVC for example). + +### Sampling + +Instead of instrumenting we can simply interrupt the running program and keep track of what code it is executing, similar to what a performance profiler would do. The appeal of sampling is that it can run on any version of the code and potentially has less overall overhead than instrumentation. + +But there are a number of challenges posed by sampling which we'll touch on briefly. + +The first is that sample data is sparse and so count reconstruction becomes more challenging. The second is that samples are often imprecise and implicate the wrong instructions or basic blocks (commonly called "sample skid"). The third is that sampling happens on the emitted code, and the results must be projected back to the desired profile fixed point, which is commonly early in the phase pipeline (this is especially challenging if we're sampling optimized code). The fourth is that samples can produce isolated profile islands (eg in a method with a hot loop, we may only see samples in the loop) and we might have no data on how control flow reached or left the loop. + +### Sampling-Instrumentation Hybrids + +Another technique for reducing dynamic instrumentation cost is to run the instrumented version of the code only every so often. That is, we prepare two ve versions of each method, one with probes and one without, and run the version with probes every so often, or randomly. + +[Arnold and Grove](#AG05) describe a technique like this used in the `Jikes RVM`, where the system leverages patchpoints to allow occasional transitions to instrumented versions of methods; we could consider something similar. + +### Synthesis + +Profile synthesis is the term we use for fabricating profile data out of thin air. While it might not seem prudent to make up data, program structure and programmer practice create learnable patterns of behavior that in turn can be used to produce plausible profiles (note: this is one area where we might be able to leverage machine learning / big data). + +Indeed many program optimizations already leverage program structure to guide their decision making, e.g. boosting the importance of code within loops, or reducing the importance of code that leads to exceptions. Profile synthesis, in effect, simply recasts this idea of leverage in the guise of profile data, so that these sorts of importance estimations are made uniformly and consistently across the compiler. + +And once we've done this all JIT optimizations can leverage profile data in a consistent and uniform manner, as profile data is always present, and always incorporates "the best information available." + +The classic paper on profile synthesis is [Ball-Larus](#BL93), which presents a set of local or near-local heuristics to predict block successor probabilities. These can be turned into profile counts using an algorithm like [Wu-Larus](#WL94) or by simply solving the associated system of linear equations. Other researchers have extended this work in various dimensions but the basic principle remains: use aspects of the program structure, operations, and data to predict execution flow. + +Profile synthesis is interesting even if instrumented or sampled profile data is available. + +First, even in a jitted environment, the JIT may be asked to generate code for methods that have not yet executed, or that have for various reasons bypassed the stage of the system that runs instrumented versions. Profile synthesis can step in and provide provisional profile data. + +Second, even if profile feedback is available, it may not be as representative as one might like. In particular parts of methods may not have been executed, or may have distorted profiles. Given the linearity of profile data, we can blend together the actual observations with a synthetic profile to produce a hybrid profile, so that our optimizations do not over-react to the actual profile (think of this as a kind of insurance policy: we want to make sure that if program behavior changes and we suddenly veer into un-profiled or thinly profiled areas, we don't fall off some kind of performance cliff). More on this below. + +### User Annotations + +There have been various proposals to allow users to convey profile data via annotations or more likely via a special set of intrinsic methods: +``` +// indicates b is likely true with probability p +[Intrinsic] +bool Likely(bool b, double p = 0.9) => b + +// indicates b is likely false with probability p +[Intrinsic] +bool Unlikely(bool b, double p = 0.9) => b +``` +Typical usage would be to control block layout or provide hints for the inliner +``` +bool b = ...; + +while (Likely(b, 0.99)) +{ + // expect this loop will iterate ~ 100 times +} + +if (Unlikely(b)) +{ + // this code is fairly cold +} +``` +We can consider others, e.g. for indicating likely types. Note if the probability is not a JIT-time constant the construct is ignored. + +GCC / LLVM have similar constructs. + +If used in a control flow context, these would feed values into profile synthesis, or additional `{eij}` into blended/hedged profile modes, if we also have actual profile feedback. + +### Contextual Profiling + + +As noted above we sometimes may want to profile dependent aspects of program behavior. Assuming B and C call A, we could for instance keep separate counts for A called by B and A called by C. Since we expect callee behavior to be (to some extent) caller dependent, this potentially gives us a more precise picture. + +More simply, we may want to track context-dependent behavior of a block we know we are likely to duplicate based on flow. The common example here is the loop exit test for a `for loop` or `while loop`; frontend compilers will typically just include one such copy of this test block, but we commonly will duplicate the test block to create guarded `do-while` loops so we know loop bodies will execute at least one iteration (so we can do loop invariant code hoisting, etc). The key here is that we have a "critical block" in the flow graph, one with two incoming and two outgoing edges. For critical blocks a custom instrumentation scheme can track the outgoing edge probability based on which incoming edge was taken. + +Another example in this category is profiling to detect inherently unpredictable branches (to enable profitable use of `cmov` and similar instructions). A flat profile can identify potentially unpredictable branches; these are blocks with two successors where the successor probabilities are close to .50/.50. But that's not sufficient; the branch behavior may still be predictable by hardware. So a more sophisticated probing scheme is needed, one that keeps track of the recent history of the branch. + +The ingestion and maintenance of contextual profiling data is more challenging than for regular profiling. And contextual profiling can greatly increase the size of the collected profile data. In my experience, this extra complexity and cost makes contextual profiling less appealing and not a priority for the work proposed here. + +### Histogram Style Probes + +Lastly we consider probes that try and describe the distribution of values. For example the likely values of a code pointer at an indirect call, or of a class type at a class test, or of argument values to a callee or the trip count of a loop. + +A scheme I've used successfully in the past is to use randomized sampling to construct an approximate histogram for the distribution of values. + +For discrete things like types, the histogram aims to determine the frequency of occurrence of the most likely types. For continuous things like lengths we may be more interested in relative magnitudes rather than absolute values, so we +may map the values to a discrete set first (say via approximate log2 or similar) and histogram that. + +These histogram probes must strike a balance between accuracy on the one hand and runtime size and cost on the other. Typically we don't need a lot of accuracy, but even a minimalist histogram probe will need enough space to hold some number of values and associated counts, so each histogram probe will occupy the space of some number of count probes. + +Ideally we'd be smart enough when instrumenting to not create redundant histogram probes. If we have say two back to back virtual calls: +```C# + x->V(); + x->V(); +``` +one probe would be sufficient to describe the possible types for `x`. But our current plans call for instrumenting at Tier0, and currently Tier0 has no dataflow analysis capabilities. We'll have to experiment to see whether or not we need to adjust our strategy here. + +### Other Considerations + +#### Global Importance + + +TieredPGO doesn't give us profile data for all methods. And what data it does give us may not be sufficient to really optimize effectively. + +Ideally the JIT would focus optimization efforts on the methods that use the most CPU, or are otherwise performance critical -- that is the methods that are globally most important. We get hints of this from the fact that a method gets promoted to Tier1, but it's not a direct or strong a signal. + +If we do not have a good measure of global importance then we don't know which methods we should optimize more aggressively, so we have to be a bit more conservative than we'd like. + +If we confidently could identify the top N% of methods (say 5%) then one could imagine optimizing those more aggressively than others, with a larger code size and JIT time budget than normal. + +#### Dynamic PGO and R2R + +R2R methods bypass Tier0 and so don't get instrumentation in the current TieredPGO prototype. We probably don't want to instrument the code in the R2R image. And many of these R2R methods are key framework methods that are important for performance. So we need to find a way to get data for these methods. + +There are a few basic ideas: +* Leverage IBC. If there is IBC data in the R2R image then we can make that data available to the JIT. It may not be as relevant as in-process collected data, but it's quite likely better than synthetic data or no data. +* Sampled instrumentation for R2R methods. Produce an instrumented version and run it every so often before the method gets promoted to Tier1. This may be costly, especially if we have to use unoptimized methods for instrumentation, as we'll do quite a bit of extra jitting. +* Make R2R methods go through Tier0 on their way to Tier1. Likely introduces an unacceptable perf hit. + +#### Dynamic PGO, QuickJitForLoops, OSR + +Some other methods also bypass Tier0 and so won't get profiled. Notably, in our current system, any method with a loop. + +We can address this by having loop methods run at Tier0; doing so safely also requires that we enable OSR so we can escape from long-running instance of these methods. + +OSR methods are jitted at Tier1 and so will pick up profile from their Tier0 counterparts. However OSR methods currently represent the "full continuation" of a method at a patchpoint, so if we have a method with multiple loops we may transition to the OSR version while we're still in the first loop and so never collect profile data for the other loops. + +A potential fix here is to have OSR methods only encompass a loop body, and rejoin the original Tier0 method upon exit from the loop. This approach is used in JavaScript engines like Chakra. + +#### Tier0 as a Data Provider + +It's possible we may not get good quality data out of the current scheme where we instrument Tier0 code. The number of times a Tier0 method runs before the Tier1 rejit happens is unpredictable, but it may be as few as 30. In the bring-up phase we can increase the call count threshold and force methods to remain in Tier0 longer, but we may need to find other solutions where we can get both good startup and good profile data. + +### Gathering Profile Data: Proposal for Initial Work + +For DynamicPGO, initially we'll rely on Tier0 for instrumentation, and use that to build up the capabilities of the JIT. We'll do both block instrumentation and some form of type profiling for virtual and interface calls. + +As the abilities of the JIT mature we will likely come back to ensuring that all the important code ends up passing through a profile gathering stage, and that the profiling process is efficient. + +## Handling of Profile Data in the JIT + + +Once profile data has been collected, we need to incorporate, represent, and maintain the data during compilation. + +### Background and General Principles + +Block and edge count data is typically stored directly on the flow graph nodes and edges respectively. There are a number of design choices here but typically we prefer the "normalized" representation where counts are expressed relative to the method entry count. + +Other kinds of profile data are typically associated with the related IR construct -- e.g. an indirect call profile would be attached in some fashion to the indirect call node. + +Optimizations that are profile sensitive then will query these values as needed. + +As the flow graph and IR are transformed during compilation, we must take care to properly update profile data so that later phases still see reasonable values. + +One might object to the idea that we intentionally modify the profile data as we are compiling, but it is a necessary thing if relative counts from disparate parts of the method are to retain any sort of significance. + +One way of thinking about profile maintenance is that these modifications typically arise when we discover some fact about the program that could have been accurately described by the right sort of contextual profile. But we usually won't have that profile. So if all we have as "flat" profile we have to project what happens to profile data as we modify the program. + +For example, suppose we have A called by B and C. When we inline A into B we only have one set of counts for the blocks in A. So if there's a difference in how A behaves when called by B and C it might only become evident later as we optimize B+A. Initially we won't know if there is such behavior, and we have to produce some kind of profile for A, so we simply use appropriately scaled counts. And because this isn't always going to be correct, later on we may need to make some repairs. + +#### Kirchhoff's Laws + +In general we expect that the flow graph the JIT creates to be a comprehensive picture of actual control flow. In practice we often ignore certain details; e.g. exactly where in the flow exceptions might occur. But modulo these sorts of details, we can expect that execution flow must follow the paths described by the flow graph, and hence flow is "conserved" and can't randomly start or end at one place or another. Because of this, one can generally expect that the profile counts flowing into a basic block should match the profile counts flowing out of the block. + +This picture of profile flow is entirely analogous to the conservation of current in electrical circuits or other flow problems, and the same principles apply. Abstractly one can create a system of linear equations whose structure is induced by the flow graph that relates the counts in the various blocks and edges. Profile data also flows into the graph from entry points (method entries) and out of the graph at exit points (method returns); these establish the boundary conditions. + +For example consider a flow graph with 4 nodes and 4 edges arranged in a simple if-then-else-join diamond. Call the nodes `Xi` edges `Eij`, and where this does not lend to confusion, use the same symbols for the execution counts for these nodes and edges. Then the equations are: +``` +Node X0 (entry, f): X0 = E01 + E02 = IN +Node X1 (then): X1 = E01 = E13 +Node X2 (else): X2 = E02 = E23 +Node X3 (join, exit): X3 = E13 + E23 = OUT (= IN) +``` +Note there are really only two independent values here, e.g. `IN` and `X1`; once we know those all other values are determined. Hence only two instrumentation probes are needed to fully determine the counts for every block and edge in this method. We'll explore the implications of this later. + +Kirchhoff's Laws take on the following general form (here focusing on flow into of blocks): +``` +Xi = INi + Sum{j}(Eji) +``` +That is, the counts flowing into block `i` are the sum of the external counts into `i` plus counts flowing into `i` from its predecessors. A similar equation holds for flows out of a block: +``` +Xi = OUTi = Sum{j}(Eij) +``` + +#### Linearity + +A key property of the block and edge equations is that they are linear. This means if we have two consistent sets of counts (`IN`, `OUT`, `Bi`, `Eij`) and (`IN'`, `OUT'`, `Bi'`, `Eij'`) then any linear combination of these counts is also consistent. Typically we think of this as a weighed sum where the weights w determine the relative importance of the two sets of data: + +``` +IN'' = w * IN + w' * IN' +Bi'' = w * Bi + w' + IN' +Eij'' = w * Eij + w' * Eij' +``` + +Linearity comes in handy when we want to consider blending two or more sources of profile data, for example if we want to use synthetic profile data to hedge against over-reliance on sample or instrumented data. See below. + +#### Normalization + +If we divide all the counts by `IN` we end up with a "normalized" set of counts. Normalized counts have the nice property that the count value determines how often that part of the graph is traversed (on average) when the method is called. That is, a normalized value of 3 on a block with a call means that callee is called (from this point) 3 times as often as the root method. For most JIT optimizations the absolute value of counts is not as interesting as the normalized values. + +Normalized values greater than 1 are only possible in methods with loops. + +#### Branch Probability View + +An alternative representation to having node and edge counts is to have node counts and outgoing edge probabilities (`eij`). This is a kind of fine-scale normalization where edge counts are now implicit: `Eij = Ni * eij`. + +The benefit of this representation is that these edge probabilities tend to be somewhat stable as we modify the flow graph in various JIT phases. + +Also note there is redundancy here as `SUM(j){eij} == 1`, that is, the sum outgoing probabilities is 1 -- flow must leave this block somehow. Since most blocks have exactly 1 or 2 successors, we generally only need to record a single value for the probability. + +We will sometimes encounter degenerate cases where the only possible exit from a loop is via an exception or other runtime event that we don't model explicitly in the flow graph. If we're not careful these can lead to various profile computations diverging off to infinity. The usual remedy is to add an artificial exit edge of some sort with very low probability to limit the "amplification" this kind of loop can provide. + +In this view the input flow equations become +``` +Xi = INi + Sum{j}(eji * Xj) +``` +and the output flow equations +``` +Xi = OUT + Sum{j}(eij * Xj) +``` + +### Incorporation of Data + +To incorporate profile data from an external source we need some kind of keying scheme to pair up an artifact from the current compilation with the corresponding information in the profile data source. + +For the JIT we use some aspect method of identity (say token + hash + ilSize) as the primary key to locate the information relevant to this method, and then some aspect of code identity (say ilOffset, for block counts) to locate the particular item. + +If the external data is from an older/different version of the application then some kind of fuzzy matching may be appropriate. + +External data may or may not be self-consistent, so one of the initial steps is to establish consistency. + +### Count Reconstruction from Probabilities + +It is possible to reconstruct node (and hence edge) counts from just the edge probabilities eij and the external counts. Given that edge probabilities are a somewhat durable "truth" this gives us an avenue to repairing profile data that has become inconsistent during optimization, and/or a methodology for updating profile data when we make flow graph edits, a way to reconstruct a full profile from locally deduced likelihoods in profile synthesis. + +For flow graphs without loops the counts can quickly be derived in one pass. For flow graphs with "reducible" loops we can use the classic [Wu-Larus](#WL94) algorithm. For more complex flow we can either try to solve the general linear system (via say Gauss-Seidel iteration) or just approximate. Note that the linear system is likely quite sparse and there is no need to form the full coefficient matrix `{eji}` explicitly, so using a general iterative solver may not be as expensive as one might imagine. + +### Initial consistency + +After the profile data is ingested we need to check consistency and possibly adjust counts. Once counts are consistent we can then derive the `{eij}` which we then rely on as the "source of truth" for the remainder of compilation. + +If we have dense counts then we can simply use the local `{eij}` derived from those counts. This may not be globally consistent, e.g. the system of equations +``` +eij * Bi = I +``` +where `I` is the input count vector may not hold (note if we've normalized and the entry block is `Bk` then `I` is a vector with `Ik=1` and all other entries zero). + +To solve this we simply find an `B'i` such that the above holds -- this is a straightforward linear system solution. Then we adjust the block counts as needed. Note we need to ensure that the solution `B'i` is strictly non-negative; it turns out that for a well-formed `eij` (exit probabilities between 0 and 1, and sum to 1 for each node) this is the case. + +If we have a mixture of profiled and synthesized nodes the above works equally well as synthesis establishes the `{eij}` for the unprofiled nodes. + +If we have sparse data (say from a spanning tree) then we may initially need to reconstruct some block counts; this again may produce inconsistent data. Once we've done that we can run the above. + +### Reconstruction + +As we optimize we may find the global counts again become inconsistent. Assuming we have trustworthy `{eij}` we can reconstruct globally consistent counts at any time. + +### Edges and Nodes + +As noted above there is some redundancy in a system that represents counts on both nodes and edges, and any time there is this kind of redundancy there is an increased chance of inconsistency and an extra maintenance burden. + +If the primary representation for profile data is block counts and successor probabilities then local maintenance is simple and does not require much data. + +One challenge we'd face here is that the current JIT flowgraph is predecessor oriented -- that is, from a node, one can easily enumerate the predecessor flow edges, but not so easily the successor edges. Updating it to be successor oriented may not be practical, and representing edge counts as block counts and predecessor probabilities is not semantically as meaningful. + +### Min and Max Edge Counts + +The current JIT actually keeps two sets of counts for edges, min and max. The motivation for this is unclear but it immediately poses a dilemma for any consumer: which count to use? I do not see this as adding value and suggest we simply rely on a single value (which would be the node count * successor probability). + +### Dynamic Range and Fractional Counts + +Profile counts can span a wide dynamic range, and we often will want to divide and scale them. Using an integer representation is challenging because of the limited dynamic range and the inability to represent fractions. + +The JIT has traditionally used a fixed-point representation where the count is scaled upwards by 100, so it can represent some fractions. However I propose that we simply use floats or doubles. This greatly simplifies a lot of the math. + +### Hedging (blending profiles) + +As noted above, even if we have profile data available, we may want to also run synthesis, both to fill in any gaps in profiling, and to provide "downside" insurance in case the profile data is not as representative as we'd like. + +The idea is to basically always run synthesis first, producing local probabilities `{eij}`. We then incorporate the actual profile data and update the `{eij}` to reflect primarily the profiled values. Where we have both a profiled and a synthesized probability, and they disagree, we blend the values using [Dempster-Shafer Theory](https://en.wikipedia.org/wiki/Dempster%E2%80%93Shafer_theory) or some other approach to combining predictions, strongly favoring the profile data. + +We then induce counts from the blended probabilities. + +To make this work, we need to ensure that synthetic profiles do not make too many harsh predictions; that is there should be relatively few cases where the synthetic profile predicts an edge is taken with zero probability, so that even in ostensibly cold areas of code we can reason about the relative importance of things. Note because we're using floating math we can have very small probabilities. + +### Ongoing Maintenance + +Whenever there is a change to the flow graph we must consider how best to update the profile information. Ideally we'd keep it consistent and correct at all times, but that is not possible or practical. + +The general principle here, following the approach outlined by [Wu](#W02), is to consider the local probabilities `{eij}` as the fundamental sources of best information. Everything else can be derived from those. So when we transform the flow graph at a minimum we should try and make sure the `{eij}` are locally consistent -- and local consistency is easy to achieve as we just need to make sure the exit probabilities of each block sum to one. + +Global consistency is harder and more costly, and we may be willing to allow the data to become globally inconsistent, and only try and re-establish global consistency when we know a phase will rely on it in some critical way. Past experience shows the key phases that rely on profile data are the inliner, block layout, and allocator; the first happens early in the phase pipeline and the others towards the end, so perhaps just one profile repair is needed, right before those latter phases. + +For some sorts of changes the updates are simple and local and preserve global consistency. e.g. inverting a branch condition simply swaps the probabilities of the associated edges; since the targets of those edges also get swapped, everything remains consistent. + +But other cases are not quite so simple: +* conversion of computation to flow +* optimizations that remove edges (or bypass creating edges) +* optimizations that duplicate blocks +* inlining +* tail recursion to loop optimization + +We touch on each of these in turn. + +#### Conversion of computation to flow + +One example of this in the JIT is QMARK expansion. Here flow is introduced where there was a statement before. Since the overall computation is unchanged and the QMARK expands into a conditional execution tree, it is straight forward to reconstruct the counts if we know the relative probabilities. So the expansion needs simply set the `eij` for each newly introduced block, and then propagate the counts downwards. + +We can sometimes collapse control flow into computation, e.g. introducing conditionally executed code like CMOV. Typically a prerequisite for such transformations is the identification of a suitable "hammock" in the control flow graph, and the optimization shrinks the hammock to a single node whose profile count is the hammock entry or exit count. + +#### Removing Edges + +When an edge is removed it is generally expensive to regain global count consistency, as counts may need to be adjusted all over the graph. + +It might be surprising at first that edges with nonzero profile counts can be removed, or that blocks with nonzero counts can become dead. But recall that over time the profile data in the flow graph can diverge away from "true" behavior because we lack contextual information. And because of this, we may find ourselves removing blocks and edges with profile counts. + +#### Duplicating Blocks + +Whenever we duplicate flow we have to make some sort of determination about the profile counts in both the original and the duplicate regions. + +Sometimes this determination is simple; for example if we clone a finally we can generally presume the inlined version gets all the counts, and the remaining "fault" version has none (or some very minimally scaled down set of counts). + +When we duplicate a loop exit condition to convert loops to if-do-while, we need to determine how often the loop will "zero trip". Typically I've just preserved the probabilities here, so say if the loop originally iterated 8 times (so the exit test ran 9 times, and back-edge probability is 8/9) then we assume the loop is entered with that same probability. But this may not be at all accurate. It could be that the loop trip count varies widely at runtime. + +Similar considerations apply to other loop optimizations like unrolling. + +#### Inlining + +When inlining the common practice is to "normalize" the inlinee and then multiply each count by the call site count (or normalized call site count). This presumes that the behavior of the callee is not correlated with the call site. + +It turns out that callsite-callee correlations are common and one might consider techniques like contextual profiling where we capture callsite (or caller) specific behavior; however these impose extra costs during instrumentation and (in my opinion) haven't yet proven to be worth the extra trouble. Callsite specific specialization often happens organically during inlining direct substitution and/or subsequent optimization. + +#### Tail Recursion to Loop Optimization + +In this optimization, a tail-recursive call is replaced by a jump back to the method entry block. From a flow perspective this introduces a loop into a method where there wasn't one before, and one can reasonably expect that this in turn will increase the count of the blocks in the loop. But this increase might also seem a bit odd, especially in a world where we've normalized counts; how do we justify these increases? + +The resolution of this quandary is to realize that this optimization also reduces the call count of the method, and so also reduces the normalizing factor, so the extra counts added to the loop blocks are really just a "renormalization" of sorts. + +For example, suppose we have a method that is called 100 times and has a tail-recursive site that is hit 80 times. In the "before" picture the call site block has a normalized count of 0.8; if the "after" picture the proper normalized count is now 4 (80 / (100 - 80)). + +Two further points are worth mentioning. + +First, the normalized count of any recursive call site in any viable method must be less than 1; otherwise the method suffers from runaway recursion. Likewise, the total normalized sum of all the recursive call sites must be less than one. We can try and leverage this during profile synthesis; the more recursive sites a method has, the less likely each site is to be hit at runtime. Note these recursive sites may only become evident after inlining. + +This impacts tail recursion to loop optimizations because if we don't properly respect the recursive probability constraint, there's a chance that after converting the tail recursive sites to loop edges, profile re-computation for the method may diverge. So code that recomputes profiles from local block probabilities needs to guard against this case, and potentially must arbitrarily change some of those probabilities to recover convergence. + +Second, if we intend to assess or prioritize inlines based on profile feedback, we might want to anticipate this profile boosting effect. If a method A is tail recursive and also calls B along the path from entry to the tail recursive site, the absolute number of calls to B isn't altered when we convert A's tail call into a loop, but the relative number of calls to B per call to A increases, making B look like a more attractive inline in a relative sense. Since this transformation happens well after inlining and may not always be possible, we might need to develop an predictor that anticipates this optimization. + +### Handling Profile Data: Proposal for Initial Work + +The initial goal will be to ensure that the inliner and indirect call transformations see profile data. From there we'll broaden out to work on simplifying how data is represented in the JIT and to ensuring that downstream phases see reasonable data, perhaps working on count reconstruction. + +As we gain experience with Dynamic PGO we'll consider adding synthesis and hedging strategies to ensure that even unprofiled code gets reasonable performance. + +## Use of Profile Data in the JIT + + +Experience has shown that while profile data can improve many optimizations, the main benefit accrues from inlining (and things that enable inlining) and code layout. Those will be our initial areas of focus. + +### Guarded Devirtualization + +In [dotnet/coreclr#21270](https://github.com/dotnet/coreclr/pull/21270) we introduced the Guarded Devirtualization optimization, where the JIT introduces an explicit class test upstream of a virtual or interface call, and then devirtualizes (and inlines) the call if the test succeeds. + +This is not enabled by default; two key ingredients are missing: +* what class to guess for +* when to guess + +Dynamic PGO can address both of these. + +Using customized probes to collect class histograms (we may also rely on runtime mechanisms here, e.g. the state of the VSD cache, or by some state tracking in the runtime itself), we can look for calls that have a single or preferred target, and guess for those. + +Using block profiles we can transform only highly profiled call sites, so that we do not cause too much code expansion. (Note code expansion can be further mitigated by partial compilation, but that most likely won't be a part of our toolbox, initially.) + +### Inlining + +The JIT's current inline heuristics already take profile data into account, but the modelling is simplistic. We envision creating a new profile-based policy that relies much more heavily on profile data to guide inlining. We may try and leverage machine learning to evolve such a policy. + +### Block Layout and Method Hot/Cold Splitting + +Block layout can have a significant impact on code execution time, and profile data provides strong clues on how to produce an effective layout. + +It also provides a built-in scoring mechanism (figure of merit) for a given layout that allows us to implement hill climbing or other randomized optimization approaches. + +In Midori we developed an algorithm based on an approach proposed by [Young et al](#Y93) that models block layout as a variant of a travelling salesperson problem (TSP) and then uses well-known iterative technique (3-OPT) to search for a better layout. It proved quite effective and I propose that we port it over to the JIT. + +One complication here is that it does not take code alignment demands into account; adding that in may be a challenge. + +Profile data also naturally leads to identification of hot and cold parts of methods. Performance gains can be had if the method is then split into two parts that are physically separated, aka hot/cold splitting. We already have JIT and runtime support for this in places (though mainly for prejitted code), so we propose to extend this to also cover jitted code. + +These gains mainly come because splitting allows the runtime to pack the hot parts of the application code into smaller numbers of cache lines and pages, reducing ICache and ITLB miss rates. For applications with large amounts of code these sorts of misses can often severely impact performance. + +### Other Optimizations + +Many other current and possible future heuristic-driven optimizations in the JIT can leverage profile data. We list some of them here: +* basic block cloning +* loop rotation (for loop -> do while loop) +* loop cloning +* finally cloning +* loop unrolling +* loop unswitching +* common subexpression elimination +* register allocation +* if conversion (use of `cmov` and other conditional execution instructions) and other conversion of branching code to branch-free forms +* partial inlining +* shrink wrapping +* struct promotion +* ordering of locals on the stack frame + +The hope is that all current (and any future) optimizations are set up in such a way that "better" profile input yields better generated code. Unfortunately this is not always the case, and it's likely we'll have to spend some time sprucing up the heuristics for some of the above. + +### Other Phases + +The main work in other phases is to ensure that they maintain profile data appropriately, and that their heuristics make use of profile data (where it makes sense). + +Optimizations that involve tradeoffs need profitability heuristics; ideally these incorporate profile data as part of their reasoning. One of the initial tasks is to audit the various heuristics to see how much (or little) work is needed to ensure they make best use of profile information. + +### Using Profile Data: Proposal for Initial Work + +The initial focus will be on improving inline heuristics, and subsequently, to enabling guarded devirtualization. + +## Proposed Work + + +The aspirational goal for Dynamic PGO is to have most of the key problems addressed during the .NET 6 development cycle, so we can enable it as a new mode of .NET operation. + +The initial focus of the work will be on the representation and use of data by the JIT. Once we are relatively happy with this (as demonstrated by performance improvements in key benchmarks and applications) we will work on ensuring that we have profile data for all methods. + +The key initial target for unlocking performance gains is the inliner. It would also be nice to enable guarded devirtualization; this will require some form of class type profiling. + +### Details of the Plan +--- +#### Group 1: Make Profile Data Available + +1. Make DynamicPGO data available for inlinees (done) +2. Implement profile count checker to look for inconsistencies (done) +3. Fix significant profile maintenance issues +4. Change profile data in JIT to be floating point +5. Change most of JIT to only ever deal with normalized counts +6. Remove min/max edge count in favor of just one count +7. Read profiled data for R2R methods (runtime dependence) +8. Support user annotations +9. Remove explicit edge count in favor of successor probability +10. Implement profile reconstruction from successor probabilities +11. Implement custom probe for interface/virtual calls, or moral equivalent +12. Move creation of "full" flow graph so it happens just after the importer +13. Implement profile synthesis +14. Implement blended / hedged profiles + +We likely need to get through at least item 7 to meet our aspirational goals. + +----- +#### Group 2: Leverage Profile Data + +1. Implement new inlining policy +2. Craft heuristics for the new policy +3. Enable guarded devirtualization +4. Enable hot/cold splitting (runtime dependence) for jitted code +5. Implement profile-based block layout (based on "TSP" algorithm above) + +We likely need to get through at least item 3 to meet our aspirational goals. + +----- +#### Group 3: Profile Handling by Runtime and JIT + +1. Update runtime to allow profile storage to grow over time +2. Remove IL offsets from profile storage for dynamic PGO (?) This may be tricky because the Tier1 importer does not produce exactly the same flow graph as Tier0. +3. If count tearing is an issue, implement copy scheme (?) +4. Implement downstream count reconstruction (pre RA/Block Layout) if needed +5. Fix heuristics in other optimization phases as needed + +We likely need at least item 1 here to meet our aspirational goals. + +----- +#### Group 4: Efficient Instrumentation + +1. Don't instrument methods with no control flow +2. Have the JIT produce compact instrumentation sequences +3. Design and implement efficient probe for histogramming +4. Implement spanning tree approach for flow counts +5. Investigate feasibility of using float/double as counter type + +We likely need to get through at least item 3 to meet our aspirational goals. + +----- +#### Group 5: Testing and Infrastructure + +1. Enable regular testing of Dynamic PGO (partially done) +2. SPMI collection of profile-based runs +3. Export and check in side-loaded PGO data so we can leverage PMI based diffs +4. Regular runs of Dynamic PGO in the perf lab +5. Regular runs of Dynamic PGO by key 1st party apps +6. Ensure BenchmarkDotNet gives accurate measurements of Dynamic PGO perf + +We likely need to get through all these items to meet our aspirational goals. + +----- + +### Risks to the Plan + +We may find that the benefit of Dynamic PGO is hinges upon an effective solution for R2R compiled methods. Ideally we'll have IBC data for key methods in the framework, which should help. + +Likewise we may find that we need to enable QuickJitForLoops, and that may entail a fully supported (and perhaps modified) OSR. + +We may find that after aggressively inlining that downstream phases require modifications and upgrades, so that we can't exhibit the full performance we hope to see. + +We may need some better measure of [global importance](#Global) effectively manage code size growth and JIT time. Many methods in a long running program will eventually JIT at Tier1; not all of them are important. + +We may find that Tier0 instrumentation doesn't give us good quality profile data, because Tier0 methods run for unpredictable amounts of time. + +We may find that Tier0 methods don't give us representative sample data, because methods exhibit phased behavior. + +### Runtime Asks + +* Make IBC counts available to the JIT ([dotnet/runtime#13672](https://github.com/dotnet/runtime/issues/13672)) +* Support hot/cold splitting for jitted code and possibly for crossgenned code +* Partner with us in evolving the runtime side of Dynamic PGO (exact work TBD) + +### Performance Team Asks + +* Ensure BenchmarkDotNet properly measures Dynamic PGO performance +* Enable benchmark runs with Dynamic PGO and comparisons vs default runtime perf + +## Appendix: IBC + + +NET's legacy approach to PGO is called IBC (Instrumented Block Counts). It is available for prejitted code only. + +A special instrumentation mode in crossgen/ngen instructs the JIT to add code to collect per-block counts and (for ngen) also instructs the runtime to track which ngen data structures are accessed at runtime, on a per-assembly basis. This information is externalized from the runtime and can be inspected and manipulated by IBCMerge. It is eventually packaged up and added back to the corresponding assembly, where it can be accessed by a subsequent "optimizing" run of crossgen/ngen. This run makes the per-block data available to the JIT and (for ngen) uses the internal runtime counters to rearrange the runtime data structures so they can be accessed more efficiently. Prejitting can also use the data to determine which methods should be prejitted (so called partial ngen). + +The JIT (when prejitting) uses the IBC data much as we propose to use PGO data to optimize the generated code. It also splits methods into hot and cold portions. The runtime leverages IBC data to + +The main aspiration of IBC is to improve startup, by ensuring that the important parts of prejitted code and data are compact and can be fetched efficiently from disk. + +IBC count data is not currently available to the JIT as the IBC payload is not copied to the optimized assembly. + +IBC is available in .NET Core, but is only usable by first-party assemblies; the IBCMerge tool is not available externally. + +With the advent of crossgen/R2R much of the startup benefit of IBC has been lost, as the data structures that were organized by ngen now simply get recreated. Also crossgen/R2R does not yet support hot/cold splitting of methods. + +## References + +Arnold, M., and Grove, D. Collecting and exploiting high-accuracy call graph profiles in virtual machines. CGO 2005. + +Ball, T. and Larus, J. Branch Prediction for Free, PLDI 93, 300-313. + +Calder, B., Grunwald, D., Lindsay, D., Martin, J., Mozer, M., & Zorn, B. Corpus-based Static Branch Prediction. PLDI 95, 79-92. + +Wu, Y., and Larus, J. Static Branch Frequency and Program Profile Analysis. MICRO 27 (1994). San Jose, CA: ACM. + +Wu, Y. Accuracy of Profile Maintenance in Optimizing Compilers. INTERACT 2002. + +Young, C., Johnson, D., Karger, D., and Smith. M. Near-optimal Intraprocedural Branch Alignment. PLDI 93. diff --git a/docs/design/features/IJW-activation.md b/docs/design/features/IJW-activation.md index 4f63f1327418..4d0fe9c17375 100644 --- a/docs/design/features/IJW-activation.md +++ b/docs/design/features/IJW-activation.md @@ -8,7 +8,7 @@ To support any C++/CLI users that wish to use .NET Core, the runtime and hosting * Load the appropriate version of .NET Core for the assembly if a .NET Core instance is not running, or validate that the currently running .NET Core instance can satisfy the assemblies requirements. * Load the (already-in-memory) assembly into the runtime. * Patch the vtfixup table tokens to point to JIT stubs. - + ## Design IJW activation has a variety of hard problems associated with it, mainly with loading in mixed mode assemblies that are not the application. diff --git a/docs/design/features/Linux-Hugepage-Crossgen2.md b/docs/design/features/Linux-Hugepage-Crossgen2.md index dcc37774b398..32083cc39eba 100644 --- a/docs/design/features/Linux-Hugepage-Crossgen2.md +++ b/docs/design/features/Linux-Hugepage-Crossgen2.md @@ -1,7 +1,7 @@ Configuring Huge Pages for loading composite binaries using CoreCLR on Linux ---- -Huge pages can provide performance benefits to reduce the cost of TLB cache misses when +Huge pages can provide performance benefits to reduce the cost of TLB cache misses when executing code. In general, the largest available wins may be achieved by enabling huge pages for use by the GC, which will dominate the memory use in the process, but in some circumstances, if the application is sufficiently large, there may be a benefit to using @@ -16,7 +16,7 @@ images using the hugetlbfs. Doing some requires several steps. 2. The composite image must be copied into a hugetlbfs filesystem which is visible to the .NET process instead of the composite image being loaded from the normal path. - IMPORTANT: The composite image must NOT be located in the normal path next to the application binary, or that file will be used instead of the huge page version. - The environment variable `COMPlus_NativeImageSearchPaths` must be set to point at the location of the hugetlbfs in use. For instance, `COMPlus_NativeImageSearchPaths` might be set to `/var/lib/hugetlbfs/user/USER/pagesize-2MB` - - As the cp command does not support copying into a hugetlbfs due to lack of support for the write syscall in that file system, a custom copy application must be used. A sample application that may be used to perform this task has a source listing in Appendix A. + - As the cp command does not support copying into a hugetlbfs due to lack of support for the write syscall in that file system, a custom copy application must be used. A sample application that may be used to perform this task has a source listing in Appendix A. 3. The machine must be configured to have sufficient huge pages available in the appropriate huge page pool. The memory requirements of huge page PE loading are as follows. - Sufficient pages to hold the unmodified copy of the composite image in the hugetlbfs. These pages will be used by the initial copy which emplaces the composite image into huge pages. - By default the runtime will map each page of the composite image using a MAP_PRIVATE mapping. This will require that the maximum number of huge pages is large enough to hold a completely separate copy of the image as loaded. @@ -62,7 +62,7 @@ int main(int argc, char** argv) printf("fdSrc fstat failed\n"); return 1; } - + addrSrc = mmap(0, st.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fdSrc, 0); if (addrSrc == MAP_FAILED) { diff --git a/docs/design/features/OnStackReplacement.md b/docs/design/features/OnStackReplacement.md index 905696875046..757eb05dcba0 100644 --- a/docs/design/features/OnStackReplacement.md +++ b/docs/design/features/OnStackReplacement.md @@ -120,7 +120,7 @@ while the old code is active in some stack frames. An implementation must come up with solutions to several related sub problems, which we describe briefly here, and in more detail below. -* **Patchpoints** : Identify where in the original method OSR is possible. +* **Patchpoints** : Identify where in the original method OSR is possible. We will use the term _patchpoint_ to describe a particular location in a method's code that supports OSR transitions. * **Triggers** : Determine what will trigger an OSR transition @@ -258,13 +258,13 @@ PatchpointHelper(int ppID, int* counter) switch (s) { - case Unknown: - *counter = initialThreshold; + case Unknown: + *counter = initialThreshold; SetState(s, Active); return; - case Active: - *counter = checkThreshold; + case Active: + *counter = checkThreshold; SetState(s, Pending); RequestAlternative(ppID); return; @@ -273,7 +273,7 @@ PatchpointHelper(int ppID, int* counter) *counter = checkThreshold; return; - case Ready: + case Ready: Transition(...); // does not return } } @@ -483,7 +483,7 @@ this is to just leave the original frame in place, and have the OSR frame #### 3.4.1 The Prototype The original method conditionally calls to the patchpoint helper at -patchpoints. The helper will return if there is no transition. +patchpoints. The helper will return if there is no transition. For a transition, the helper will capture context and virtually unwind itself and the original method from the stack to recover callee-save register values @@ -554,7 +554,7 @@ frame pointers. When control is executing in a funclet there are effectively two activation records on the stack that share a single frame: the parent frame and the funclet frame. The funclet frame is largely a stub frame and most of the frame -state is kept in the parent frame. +state is kept in the parent frame. These two frames are not adjacent; they are separated by some number of runtime frames. This means it is going to be difficult for our system to handle @@ -799,7 +799,7 @@ G_M6138_IG03: FFC9 dec ecx 894DF0 mov dword ptr [rbp-10H], ecx 837DF000 cmp dword ptr [rbp-10H], 0 // ... > 0 ? - 7F0E jg SHORT G_M6138_IG05 + 7F0E jg SHORT G_M6138_IG05 G_M6138_IG04: ;; bbWeight=0.01 488D4DF0 lea rcx, bword ptr [rbp-10H] // &patchpointCounter @@ -910,7 +910,7 @@ For example: 5F pop rdi 4883C448 add rsp, 72 5D pop rbp - C3 ret + C3 ret ``` with unwind info: ``` diff --git a/docs/design/features/PinnedHeap.md b/docs/design/features/PinnedHeap.md index d9d2ffa30047..81c76e620804 100644 --- a/docs/design/features/PinnedHeap.md +++ b/docs/design/features/PinnedHeap.md @@ -42,7 +42,7 @@ An object allocated on the pinned heap can be referenced by other objects normal ## API - allocating an array on the pinned heap -For users who want to allocate their objects pinned, we provide [a new API](https://github.com/dotnet/corefx/issues/31787) to allocate such an object. The API declaration is the following: +For users who want to allocate their objects pinned, we provide [a new API](https://github.com/dotnet/runtime/issues/27146) to allocate such an object. The API declaration is the following: ```csharp class GC @@ -154,7 +154,7 @@ It might make sense to provide an additional API to allocate an array of these o **Alignment support** -However, there is another scenario for high perf that could warrant a generational pinned heap which is objects with a specified alignment mostly [for SIMD operations](https://github.com/dotnet/corefx/issues/22790) or aligning on cache lines to avoid false sharing. This scenario doesn’t imply the object always needs to be pinned, however being pinned does mean they would be convenient for interop. For example, matrix multiplication with SIMD where the matrix is also used in native code. It also isn’t clear the object is necessarily long lived, however we do make the assumption that the amount of memory occupied by pinned objects should be small compared to non pinned objects so treating all of them as part of gen2 is acceptable. A different design option would be to allocate these on the normal heap but keep their alignment when compacting but this makes compaction slower. +However, there is another scenario for high perf that could warrant a generational pinned heap which is objects with a specified alignment mostly [for SIMD operations](https://github.com/dotnet/runtime/issues/22990) or aligning on cache lines to avoid false sharing. This scenario doesn’t imply the object always needs to be pinned, however being pinned does mean they would be convenient for interop. For example, matrix multiplication with SIMD where the matrix is also used in native code. It also isn’t clear the object is necessarily long lived, however we do make the assumption that the amount of memory occupied by pinned objects should be small compared to non pinned objects so treating all of them as part of gen2 is acceptable. A different design option would be to allocate these on the normal heap but keep their alignment when compacting but this makes compaction slower. For alignment support, we can also limit it to a few specific alignments if it makes the implementation noticeably easier – 16, 32, 64, 128 bytes, and possibly page size (unclear if this is really needed). diff --git a/docs/design/features/StringDeduplication.md b/docs/design/features/StringDeduplication.md index edd3d0abd9a7..fa69d2c21b88 100644 --- a/docs/design/features/StringDeduplication.md +++ b/docs/design/features/StringDeduplication.md @@ -14,18 +14,18 @@ Dedup - string deduplication is often shortened to dedup in this document. This is an opt-in feature and should have no performance penalty when it’s off. And by default it’s off. -When it’s on, we aim to – +When it’s on, we aim to – - Only deduplicate strings in old generations of the GC heap. - Not increase the STW pauses for ephemeral GCs. - Not regress string allocation speed. -- Provide static analysis and runtime checks to detect patterns incompatible with string deduping. This is required to enable customers to opt-in into this feature with confidence. +- Provide static analysis and runtime checks to detect patterns incompatible with string deduping. This is required to enable customers to opt-in into this feature with confidence. ## Details -#### **History** +#### **History** -The string deduplication feature has been brought up before. See [runtime issue #9022](https://github.com/dotnet/runtime/issues/9022) for discussion. +The string deduplication feature has been brought up before. See [runtime issue #9022](https://github.com/dotnet/runtime/issues/9022) for discussion. And a proof of concept was gracefully [attempted](https://github.com/dotnet/coreclr/pull/15135) by [@Rattenkrieg](https://github.com/Rattenkrieg) before. But it was incomplete and the design didn’t have the kind of perf characteristics desired – it had most of the logic in GC vs outside GC. @@ -33,9 +33,9 @@ An example of a user implemented string deduplication is Roslyn’s [StringTable #### **Customer impact estimation and validation** -As a general rule we want to have this for all features we add to the runtime. +As a general rule we want to have this for all features we add to the runtime. -Issue #[9022](https://github.com/dotnet/runtime/issues/9022) It mentioned some general data: +Issue #[9022](https://github.com/dotnet/runtime/issues/9022) It mentioned some general data: “The expectation is that typical apps have 20% of their GC heap be strings. Some measurements we have seen is that for at least some applications, 10-30% of strings all may be duplicated, so this might save 2-3% of the GC heap. Not huge, but the feature is not that difficult either.” @@ -48,9 +48,9 @@ There are 2 sources of data we could get – #### **Design outline** -This is an opt in feature. When the runtime detects it’s turned on, it creates a dedup thread to do the work. +This is an opt in feature. When the runtime detects it’s turned on, it creates a dedup thread to do the work. -Detection of duplicated strings is done by looking into a hash table. The key into this hash table is the hash code of the content of a string. Detailed description of this detection is later in this doc. +Detection of duplicated strings is done by looking into a hash table. The key into this hash table is the hash code of the content of a string. Detailed description of this detection is later in this doc. As the dedup thread goes through the old generations linearly, it looks for references to a string object (denoted by the method table) and either calculates or looks up the hash code of that string to see if it already exists in the hash table. If so it will attempt to change the reference to point to that string with a CAS operation. If this fails, which means some other thread changed the reference at the mean time, we simply ignore this and move on. We expect the CAS failure rate to be very low. @@ -58,17 +58,17 @@ Since the new string reference we will write to the heap has the exact same type The dedup hash table acts as weak references to the strings. Depending on the scenario we might choose to null out these weak references or not (if it’s more performant to rebuild the hash table). If we we do the former these weak references would be treated as short weak handles so the following will happen before we scan for finalization - -- During BGC final mark phase we will need to null out the strings that are not marked in the hash table. This can be made concurrent. +- During BGC final mark phase we will need to null out the strings that are not marked in the hash table. This can be made concurrent. - During a full blocking GC we will need to null out the strings that are not marked in the hash table, and relocate the ones that got promoted if we are doing a compacting GC. **Alternate design points** -- Should we create multiple threads to do the work? +- Should we create multiple threads to do the work? -Deduping can be done leisurely, so it doesn’t merit having multiple threads. +Deduping can be done leisurely, so it doesn’t merit having multiple threads. -- Can we use an existing thread to do the work on? +- Can we use an existing thread to do the work on? The finalizer thread is something that’s idling most of the time. However there are already plenty of types of work scheduled to potentially run on the finalizer thread so adding yet another thing, especially an opt in feature, can get messy. @@ -80,9 +80,9 @@ Only strings allocated on the managed heap will be considered for deduplication. Currently calling GetHashCode of a string calculates a 32-bit hash code. This is not stored anywhere, unlike the default hash code that’s stored either in the syncblk or a syncblk entry, depending whether the syncblk is also used by something else like locking. As the deduping thread goes through the heap it will calculate the 32-bit hash code and actually install it. -However, a 32-bit hash code means we always need to check for collision by actually comparing the string content if the hash code is the same. And for large strings having to compare the string content could be very costly. For LOH compaction we already allocate a padding object for each large object (which currently takes up at most 0.4% of LOH space on 64-bit). We could make this padding object 1-ptr size larger and store the address of the string it’s deduped too. Likewise we can also use this to store the fact “this is the copy the hash table keeps track of so no need to dedup”. This way we can avoid having to do the detection multiple times for the same string. Below illustrates a scenario where large strings are deduplicated. +However, a 32-bit hash code means we always need to check for collision by actually comparing the string content if the hash code is the same. And for large strings having to compare the string content could be very costly. For LOH compaction we already allocate a padding object for each large object (which currently takes up at most 0.4% of LOH space on 64-bit). We could make this padding object 1-ptr size larger and store the address of the string it’s deduped too. Likewise we can also use this to store the fact “this is the copy the hash table keeps track of so no need to dedup”. This way we can avoid having to do the detection multiple times for the same string. Below illustrates a scenario where large strings are deduplicated. -`pad | s0 | pad | s1 | pad | s0_1` +`pad | s0 | pad | s1 | pad | s0_1` `obj0 (-> s0) | obj1 (-> s0_1) | obj2 (->s1) | obj3 (->s0_1) | obj4 (->s1) ` @@ -90,12 +90,12 @@ Each string obj, ie, s*, is a string on LOH and has a padding object in front of s0_1 has the same content as s0. s1 has the same hash code but not the same content. -"obj->s" means obj points to a string object s, or has a ref to s. So obj0 has a ref to s0, obj1 has a ref to s0_1, obj2 has a ref to s1 and so on. +"obj->s" means obj points to a string object s, or has a ref to s. So obj0 has a ref to s0, obj1 has a ref to s0_1, obj2 has a ref to s1 and so on. 1. As we go through the heap, we see obj0 which points to s0. 2. s0’s hash is calculated which we use to look into the hash table. 3. We see that no entries exist for that hash so we create an entry for it and in s0’s padding indicates that it’s stored in the hash table, ie, it’s the copy we keep. -4. Then we see obj1 which points to s0_1 whose hash doesn’t exist yet. We calculate the hash for s0_1, and see that there’s an entry for this hash already in the hash table, now we compare the content and see that it’s the same, now we store s0 in the padding object before s0_1 and change obj1’s ref to point to s0. +4. Then we see obj1 which points to s0_1 whose hash doesn’t exist yet. We calculate the hash for s0_1, and see that there’s an entry for this hash already in the hash table, now we compare the content and see that it’s the same, now we store s0 in the padding object before s0_1 and change obj1’s ref to point to s0. 5. Then we see obj2 and calculate s1’s hash. We notice an entry already exists for that hash so we compare the content and the content is not the same as s0’s. So we enter s1 into the hash table and indicate that it’s stored in the hash table. 6. Then we see obj3, and s0_1 indicates that it should be deduped to s0 so we change obj3’s ref to point to s0_1 right away. 7. Then we see obj4 which points to s1 and s1 indicates it’s stored in the hash table so we don’t need to dedup. @@ -106,11 +106,11 @@ Since we know the size of a string object trivially, we know which strings are o - If `InterlockCompareExchangePointer` fails because the ref was modified while we were finding a copy to dedup to (or insert into the hash table), we skip this ref. - If too many collisions exist for a hash code, we skip deduping for strings with that hash code. This avoids the DoS attack by creating too many strings for the same hash. -- If the string is too large. At some point going through a very large string to calculate its hash code will become simply not worth the effort. We'll need to do some perf investigation to figure out a good limit. +- If the string is too large. At some point going through a very large string to calculate its hash code will become simply not worth the effort. We'll need to do some perf investigation to figure out a good limit. **Alternate design points** -- Should we calculate the hash codes for SOH strings as gen1 GCs promote them into gen2? +- Should we calculate the hash codes for SOH strings as gen1 GCs promote them into gen2? This would increase gen1 pause. @@ -132,7 +132,7 @@ The following scenarios become problematic or more problematic when deduping is - Mutating the string content -Strings are supposed to be immutable. However in unsafe code you can change the string content after it’s created. Changing string content already asking for trouble without deduping – you could be changing the interned copy which means you are modifying someone else’s string which could cause completely unpredictable results for them. +Strings are supposed to be immutable. However in unsafe code you can change the string content after it’s created. Changing string content already asking for trouble without deduping – you could be changing the interned copy which means you are modifying someone else’s string which could cause completely unpredictable results for them. The most common way is to use the fixed keyword: @@ -143,7 +143,7 @@ fixed (char* p = str) } ``` -There are other ways such as +There are other ways such as `((char*)(gcHandlePointingToString.AddrOfPinnedObject())) = 'c';` @@ -153,7 +153,7 @@ Or - Locking on a string -Locking on a string object is already discouraged due to a string can be interned. Having string dedup on can make this problematic more often if the string you called lock on is now deduped to a different string object. +Locking on a string object is already discouraged due to a string can be interned. Having string dedup on can make this problematic more often if the string you called lock on is now deduped to a different string object. - Reference equality @@ -187,7 +187,7 @@ To start with we will provide analysis for the following – I’m seeing that there are almost 600 places in libraries that do `fixed (char*` but hopefully most of them do not actually modify the string content. We should definitely be encouraging folks to switch to using `string.Create` like what [PR#31700](https://github.com/dotnet/runtime/pull/31700) did. -2. Using lock on a string object. +2. Using lock on a string object. - Reference equality checks on strings @@ -195,13 +195,13 @@ Since `ReferenceEquals` is performance critical API, we cannot do checks in its We do have some libraries that rely on `ReferenceEquals`. We need to figure out what to do about them. See discussion [here](https://github.com/dotnet/runtime/pull/31971#pullrequestreview-355531406). -- Additional checks in heap verification +- Additional checks in heap verification Heap verification will now include checks to verify that no one changes the string content after it’s hash is computed. This can be turned on when a certain level of COMPlus_HeapVerify is specified. - Stress mode -Instead of waiting till the productive moment to start the next deduping cycle, we can have a stress mode where we dedup randomly to catch problems sooner, same idea as GC stress to detect GC holes sooner. +Instead of waiting till the productive moment to start the next deduping cycle, we can have a stress mode where we dedup randomly to catch problems sooner, same idea as GC stress to detect GC holes sooner. We could even artificially create duplicates in this stress mode to find places that depend on object identity. @@ -219,8 +219,8 @@ We might see some performance gains using RTM (Restricted Transactional Memory) **Deduping other types of objects** -We might consider to not limit deduping to just strings. There was a discussion in [runtime issue #12628](https://github.com/dotnet/runtime/issues/12628). +We might consider to not limit deduping to just strings. There was a discussion in [runtime issue #12628](https://github.com/dotnet/runtime/issues/12628). -**Deduping long lived references on stack** +**Deduping long lived references on stack** -There might be merit to look into deduping long lived refs on the stack. The amount of work it requires and the return makes it low priority but it may help with some corner cases. \ No newline at end of file +There might be merit to look into deduping long lived refs on the stack. The amount of work it requires and the return makes it low priority but it may help with some corner cases. diff --git a/docs/design/features/additional-deps.md b/docs/design/features/additional-deps.md index b7046ea7067c..2bc3e59492c8 100644 --- a/docs/design/features/additional-deps.md +++ b/docs/design/features/additional-deps.md @@ -52,9 +52,7 @@ The proposal for this is to "roll-backwards" starting with the "found" version. #### Roll-forward uses app's TFM -A secondary issue with with the store's naming convention for framework. It contains a path such as: - `\dotnet\store\x64\netcoreapp2.0\microsoft.applicationinsights\2.4.0` -where 'netcoreapp2.0' is a "tfm" (target framework moniker). During roll-forward cases, the tfm is still the value specified in the app's runtimeconfig. The host only includes store folders that match that tfm, so it may not find packages from other deps files that were generated off a different tfm. In addition, with the advent of multiple frameworks, it makes it cumbersome to be forced to install to every tfm because multiple frameworks may use the same package, and because each package is still identified by an exact version. +A secondary issue with with the store's naming convention for framework. It contains a path such as: `\dotnet\store\x64\netcoreapp2.0\microsoft.applicationinsights\2.4.0` where 'netcoreapp2.0' is a "tfm" (target framework moniker). During roll-forward cases, the tfm is still the value specified in the app's runtimeconfig. The host only includes store folders that match that tfm, so it may not find packages from other deps files that were generated off a different tfm. In addition, with the advent of multiple frameworks, it makes it cumbersome to be forced to install to every tfm because multiple frameworks may use the same package, and because each package is still identified by an exact version. The proposal for this is to add an "any" tfm. @@ -80,9 +78,8 @@ Where "found" means the version that is being used at run time including roll-fo ## 2.1 proposal (add an "any" tfm to store) For example, `\dotnet\store\x64\any\microsoft.applicationinsights\2.4.0` - -The `any` tfm would be used if the specified tfm (e.g. netcoreapp2.0) is not found: - `\dotnet\store\x64\netcoreapp2.0\microsoft.applicationinsights\2.4.0` + +The `any` tfm would be used if the specified tfm (e.g. netcoreapp2.0) is not found: `\dotnet\store\x64\netcoreapp2.0\microsoft.applicationinsights\2.4.0` _Possible risk: doesn't this make "uninstall" more difficult? Because multiple installs may write the same packages and try to remove packages that another installer created?_ @@ -95,7 +92,7 @@ The current ordering for resolving deps files is: 1) The app's deps file 2) The additional-deps file(s) 3) The framework(s) deps file(s) - + The order is important because "first-in" wins. Since the additional-deps is before the framework, the additional-deps will "win" in all cases except during a minor\major roll-forward. The reason minor\major roll-forward is different is because the framework has special logic (new in 2.1) to compare assembly and file version numbers from the deps files, and pick the newest. The proposed ordering change for 2.1 is: @@ -108,7 +105,7 @@ In addition, the additional-deps will always look for assembly and file version ## 2.1 proposal (add runtimeconfig knob to to disable `%DOTNET_ADDITIONAL_DEPS%`) Add an `additionalDepsLookup` option to the runtimeconfig with these values: - + 0) The `%DOTNET_ADDITIONAL_DEPS%` is not used 1) `DOTNET_ADDITIONAL_DEPS` is used (the default) diff --git a/docs/design/features/arm64-intrinsics.md b/docs/design/features/arm64-intrinsics.md index 67aff026878d..e814833ad126 100644 --- a/docs/design/features/arm64-intrinsics.md +++ b/docs/design/features/arm64-intrinsics.md @@ -289,7 +289,7 @@ This document will refer to half precision floating point as `Half`. + CoreCLR and `CIL` in general do not have general support for a `Half` type + There is an open request to expose `Half` intrinsics + There is an outstanding proposal to add `System.Half` to support this request -https://github.com/dotnet/corefx/issues/25702 +https://github.com/dotnet/runtime/issues/936 + Implementation of `Half` features will be adjusted based on + Implementation of the `System.Half` proposal + Availability of supporting hardware (extensions) diff --git a/docs/design/features/code-versioning-profiler-breaking-changes.md b/docs/design/features/code-versioning-profiler-breaking-changes.md index 7a7add6323b0..760623741cb6 100644 --- a/docs/design/features/code-versioning-profiler-breaking-changes.md +++ b/docs/design/features/code-versioning-profiler-breaking-changes.md @@ -26,4 +26,4 @@ Code versioning, and in particular its use for tiered compilation means that the 2. The timing of ReJITCompilationFinished has been adjusted to be slightly earlier (after the new code body is generated, but prior to updating the previous jitted code to modify control flow). This raises a slim possibility for a ReJIT error to be reported after ReJITCompilationFinished in the case of OOM or process memory corruption. -There are likely some other variations of the changed behavior I haven't thought of yet, but if further testing, code review, or discussion brings it to the surface I'll add it here. Feel free to get in touch on github (@noahfalk), or if you have anything you want to discuss in private you can email me at noahfalk AT microsoft.com \ No newline at end of file +There are likely some other variations of the changed behavior I haven't thought of yet, but if further testing, code review, or discussion brings it to the surface I'll add it here. Feel free to get in touch on github (@noahfalk), or if you have anything you want to discuss in private you can email me at noahfalk AT microsoft.com diff --git a/docs/design/features/covariant-return-methods.md b/docs/design/features/covariant-return-methods.md index 3c9ac8c4db89..9416253ebf06 100644 --- a/docs/design/features/covariant-return-methods.md +++ b/docs/design/features/covariant-return-methods.md @@ -2,7 +2,7 @@ Covariant return methods is a runtime feature designed to support the [covariant return types](https://github.com/dotnet/csharplang/blob/master/proposals/covariant-returns.md) and [records](https://github.com/dotnet/csharplang/blob/master/proposals/records.md) C# language features posed for C# 9.0. -This feature allows an overriding method to have a return type that is different than the one on the method it overrides, but compatible with it. The type compability rules are defined in ECMA I.8.7.1. Example: using a more derived return type. +This feature allows an overriding method to have a return type that is different than the one on the method it overrides, but compatible with it. The type compability rules are defined in ECMA I.8.7.1. Example: using a more derived return type. Covariant return methods can only be described through MethodImpl records, and as an initial implementation will only be applicable to methods on reference types. Methods on interfaces and value types will not be supported (may be supported later in the future). @@ -24,9 +24,9 @@ During enumeration of MethodImpls on a type (`MethodTableBuilder::EnumerateMetho + Load the `TypeHandle` of the return type of the method on base type. + Load the `TypeHandle` of the return type of the method on the current type being validated. + Verify that the second `TypeHandle` is compatible with the first `TypeHandle` using the `MethodTable::CanCastTo()` API. If they are not compatible, a TypeLoadException is thrown. - + The only exception where `CanCastTo()` will return true for an incompatible type according to the ECMA rules is for structs implementing interfaces, so we explicitly check for that case and throw a TypeLoadException if we hit it. - + Once a method is flagged for return type checking, every time the vtable slot containing that method gets overridden on a derived type, the new override will also be checked for compatiblity. This is to ensure that no derived type can implicitly override some virtual method that has already been overridden by some MethodImpl with a covariant return type. ### VTable Slot Unification @@ -64,7 +64,7 @@ This slot unification step will also take place during the last step of type loa An interface method may be both non-final and have a MethodImpl that declares that it overrides another interface method. If it does, NO other interface method may .override it. Instead further overrides must override the method that it overrode. Also the overriding method may only override 1 method. The default interface method resolution algorithm shall change from: - + ``` console Given interface method M and type T. Let MSearch = M diff --git a/docs/design/features/cross-platform-cryptography.md b/docs/design/features/cross-platform-cryptography.md index f93190aa63d9..b6f1d125552e 100644 --- a/docs/design/features/cross-platform-cryptography.md +++ b/docs/design/features/cross-platform-cryptography.md @@ -24,14 +24,23 @@ This would result in a `PlatformNotSupportedException` when invoking the `Create The underlying ciphers and chaining are performed by the system libraries. -| Cipher + Mode | Windows | Linux | macOS | -|---------------|---------|-------|-------| -| AES-CBC | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| AES-ECB | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 3DES-CBC | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 3DES-ECB | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| DES-CBC | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| DES-ECB | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Cipher + Mode | Windows 8 - 10 | Windows 7 | Linux | macOS | +|---------------|--------------------|----------------------|--------------------|--------------------| +| AES-CBC | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| AES-ECB | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| AES-CFB8* | :white_check_mark: | :white_check_mark:** | :white_check_mark: | :white_check_mark: | +| AES-CFB128* | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | +| 3DES-CBC | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| 3DES-ECB | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| 3DES-CFB8* | :white_check_mark: | :white_check_mark:** | :white_check_mark: | :white_check_mark: | +| 3DES-CFB64* | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | +| DES-CBC | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| DES-ECB | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| DES-CFB8* | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: | + +\* Available starting in .NET 5. + +** Available starting in .NET 6. In the future there is a possibility that new ciphers may be added to .NET Core before one (or more) supported platforms have system support for it. This would result in a `PlatformNotSupportedException` when invoking the `Create()` method for the algorithm. diff --git a/docs/design/features/crossgen2-compilation-structure-enhancements.md b/docs/design/features/crossgen2-compilation-structure-enhancements.md index bf164d89fd0b..7f993df95e88 100644 --- a/docs/design/features/crossgen2-compilation-structure-enhancements.md +++ b/docs/design/features/crossgen2-compilation-structure-enhancements.md @@ -59,7 +59,7 @@ Note, this approach is probably more complete than we will finish in one release For non-generic code this is straightforward. Either compile all the non-generic code in the binary, or compile only that which is specified via a profile guided optimization step. This choice shall be driven by a per "input assembly" switch as in the presence of a composite R2R image we likely will want to have different policy for different assemblies, as has proven valuable in the past. Until proven otherwise, per assembly specification of this behavior shall be considered to be sufficient. -We shall set a guideline for how much generic code to generate, and the amount of generic code to generate shall be gated as a multiplier of the amount of non-generic code generated. +We shall set a guideline for how much generic code to generate, and the amount of generic code to generate shall be gated as a multiplier of the amount of non-generic code generated. For generic code we also need a per assembly switch to adjust between various behaviors, but the proposal is as follows: @@ -87,7 +87,7 @@ Runtime Layer Each layer in this stack will be compiled as a consistent set of crossgen2 compilations. -I propose to reduce the generics duplication problem to allow duplication between layers, but not within a layer. There are two ways to do this. The first of which is to produce composite R2R images for a layer. Within a single composite R2R image generation, running heuristics and generating generics eagerly should be straightforward. This composite R2R image would have all instantiations statically computed that are local to that particular layer of compilation, and also any instantiations from other layers. The duplication problem would be reduced in that a single analysis would trigger these multi-layer dependent compilations, and so which there may be duplication between layers, there wouldn't be duplication within a layer. And given that the count of layers is not expected to exceed 3 or 4, that duplication will not be a major concern. +I propose to reduce the generics duplication problem to allow duplication between layers, but not within a layer. There are two ways to do this. The first of which is to produce composite R2R images for a layer. Within a single composite R2R image generation, running heuristics and generating generics eagerly should be straightforward. This composite R2R image would have all instantiations statically computed that are local to that particular layer of compilation, and also any instantiations from other layers. The duplication problem would be reduced in that a single analysis would trigger these multi-layer dependent compilations, and so which there may be duplication between layers, there wouldn't be duplication within a layer. And given that the count of layers is not expected to exceed 3 or 4, that duplication will not be a major concern. The second approach is to split compilation up into assembly level units, run the heuristics per assembly, generate the completely local generics in the individual assemblies, and then nominate a final mop up assembly that consumes a series of data files produced by the individual assembly compilations and holds all of the stuff that didn't make sense in the individual assemblies. In my opinion this second approach would be better for debug builds, but the first approach is strictly better for release builds, and really shouldn't be terribly slow. diff --git a/docs/design/features/event-counter.md b/docs/design/features/event-counter.md index 29fa231f03ae..935a42b47f86 100644 --- a/docs/design/features/event-counter.md +++ b/docs/design/features/event-counter.md @@ -108,4 +108,4 @@ For EventCounter and PollingCounter we expect simple viewers to use the display ### Metadata -To add any optional metadata about the counters that we do not already provide a way of encoding, users can call the `AddMetaData(string key, string value)` API. This API exists on all variants of the Counter APIs, and allows users to add one or many key-value pairs of metadata, which is dumped to the Payload as a comma-separated string value. This API exists so that users can add any metadata about their Counter that is not known to us and is different from the ones we provide by default (i.e. `DisplayName`, `CounterType`, `DisplayRateTimeScale`). \ No newline at end of file +To add any optional metadata about the counters that we do not already provide a way of encoding, users can call the `AddMetaData(string key, string value)` API. This API exists on all variants of the Counter APIs, and allows users to add one or many key-value pairs of metadata, which is dumped to the Payload as a comma-separated string value. This API exists so that users can add any metadata about their Counter that is not known to us and is different from the ones we provide by default (i.e. `DisplayName`, `CounterType`, `DisplayRateTimeScale`). diff --git a/docs/design/features/framework-version-resolution.md b/docs/design/features/framework-version-resolution.md index cd20470ce34f..349d0f250191 100644 --- a/docs/design/features/framework-version-resolution.md +++ b/docs/design/features/framework-version-resolution.md @@ -30,8 +30,7 @@ In the `.runtimeconfig.json` these values are defined like this: ``` #### Framework name -Each framework reference identifies the framework by its name. -Framework names are case sensitive (since they're used as folder names even on Linux systems). +Each framework reference identifies the framework by its name. Framework names are case sensitive (since they're used as folder names even on Linux systems). #### Version Framework version must be a [SemVer V2](https://semver.org) valid version. @@ -146,13 +145,15 @@ Pros Cons * Testing behavior of new releases with pre-release versions is not fully possible (see below). -* Some special cases don't work: -One special case which would not work: -*Component A which asks for `2.0.0 LatestMajor` is loaded first on a machine which has `3.0.0` and also `3.1.0-preview` installed. Because it's the first in the process it will resolve the runtime according to the above rules - that is prefer release version - and thus will select `3.0.0`. -Later on component B is loaded which asks for `3.1.0-preview LatestMajor` (for example the one in active development). This load will fail since `3.0.0` is not enough to run this component. -Loading the components in reverse order (B first and then A) will work since the `3.1.0-preview` runtime will be selected.* +* Some special cases don't work. -Modification to automatic roll forward to latest patch: + One special case which would not work: + *Component A which asks for `2.0.0 LatestMajor` is loaded first on a machine which has `3.0.0` and also `3.1.0-preview` installed. Because it's the first in the process it will resolve the runtime according to the above rules - that is prefer release version - and thus will select `3.0.0`.* + + *Later on component B is loaded which asks for `3.1.0-preview LatestMajor` (for example the one in active development). This load will fail since `3.0.0` is not enough to run this component.* + *Loading the components in reverse order (B first and then A) will work since the `3.1.0-preview` runtime will be selected.* + +Modification to automatic roll forward to latest patch: Existing behavior is to find a matching framework based on the above rules and then apply roll forward to latest patch (except if `Disable` is specified). The new behavior should be: * If the above rules find a matching pre-release version of a framework, then automatic roll forward to latest patch is not applied. * If the above rules find a matching release version of a framework, automatic roll forward to latest patch is applied. @@ -218,12 +219,12 @@ Items lower in the list override those higher in the list. At each precedence sc This setting is also described in [roll-forward-on-no-candidate-fx](roll-forward-on-no-candidate-fx.md). It can be specified as a property either for the entire `.runtimeconfig.json` or per framework reference (it has no environment variable of command line argument). It disables rolling forward to the latest patch. The host will compute effective value of `applyPatches` for each framework reference. -The `applyPatches` value is only considered if the effective `rollForward` value for a given framework reference is +The `applyPatches` value is only considered if the effective `rollForward` value for a given framework reference is * `LatestPatch` * `Minor` * `Major` -For the other values `applyPatches` is ignored. +For the other values `applyPatches` is ignored. *This is to maintain backward compatibility with `rollForwardOnNoCandidateFx`. `applyPatches` is now considered obsolete.* If `applyPatches` is set to `true` (the default), then the roll-forward rules described above apply fully. @@ -259,7 +260,7 @@ There's a direct mapping from the `rollForward` setting to the internal represen | `rollForward` | `version_compatibility_range` | `roll_to_highest_version` | | --------------------- | ----------------------------- | ------------------------------------------ | | `Disable` | `exact` | `false` | -| `LatestPatch` | `patch` | `false` (always picks latest patch anyway) | +| `LatestPatch` | `patch` | `false` (always picks latest patch anyway) | | `Minor` | `minor` | `false` | | `LatestMinor` | `minor` | `true` | | `Major` | `major` | `false` | @@ -306,7 +307,7 @@ Steps * By doing this for all `framework references` here, before the next loop, we minimize the number of re-try attempts. 4. For each `framework reference` in `config fx references`: 5. --> If the framework's `name` is not in `resolved frameworks` Then resolve the `framework reference` to the actual framework on disk: - * If the framework `name` already exists in the `effective fx references` reconcile the currently processed `framework reference` with the one from the `effective fx references` (see above for the algorithm). + * If the framework `name` already exists in the `effective fx references` reconcile the currently processed `framework reference` with the one from the `effective fx references` (see above for the algorithm). *Term "reconcile framework references" is used for this in the code, this used to be called "soft-roll-forward" as well.* * The reconciliation will always pick the higher `version` and will merge the `rollForward` and `applyPatches` settings. * The reconciliation may fail if it's not possible to roll forward from one `framework reference` to the other. @@ -368,7 +369,7 @@ This might be more of an issue for components (COM and such), which we will reco The above proposal will impact behavior of existing apps (because framework resolution is in `hostfxr` which is global on the machine for all frameworks). This is a description of the changes as they apply to apps using either default settings, `rollForwardOnNoCandidateFx` or `applyPatches`. ### Fixing ordering issues -In 2.* the algorithm had a bug in it which caused it to resolve different version depending solely on the order of framework references. Consider this example: +In 2.* the algorithm had a bug in it which caused it to resolve different version depending solely on the order of framework references. Consider this example: `Microsoft.NETCore.App` is available on the machine with versions `2.1.1` and `2.1.2`. diff --git a/docs/design/features/globalization-invariant-mode.md b/docs/design/features/globalization-invariant-mode.md index 3112ce7dd42a..f3c4132fcc0d 100644 --- a/docs/design/features/globalization-invariant-mode.md +++ b/docs/design/features/globalization-invariant-mode.md @@ -1,5 +1,5 @@ # .NET Core Globalization Invariant Mode - + Author: [Tarek Mahmoud Sayed](https://github.com/tarekgh) The globalization invariant mode - new in .NET Core 2.0 - enables you to remove application dependencies on globalization data and [globalization behavior](https://docs.microsoft.com/en-us/dotnet/standard/globalization-localization/). This mode is an opt-in feature that provides more flexibility if you care more about reducing dependencies and the size of distribution than globalization functionality or globalization-correctness. @@ -17,7 +17,7 @@ The following scenarios are affected when the invariant mode is enabled. Their i - Time Zone display name on Linux ## Background - + Globalization rules and the data that represents those rules frequently change, often due to country-specific policy changes (for example, changes in currency symbol, sorting behavior or time zones). Developers expect globalization behavior to always be current and for their applications to adapt to new data over time. In order to keep up with those changes, .NET Core (and the .NET Framework, too) depends on the underlying OS to keep up with these changes. Relying on the underlying OS for globalization data has the following benefits: @@ -32,11 +32,11 @@ Globalization support has the following potential challenges for applications: * Installing/carrying the [ICU](http://icu-project.org) package on Linux (~28 MB). Note: On Linux, .NET Core relies on globalization data from ICU. For example, [.NET Core Linux Docker images](https://github.com/dotnet/dotnet-docker/blob/master/2.0/runtime-deps/stretch/amd64/Dockerfile) install this component. Globalization data is available on Windows and macOS as part of their base installs. - + ## Cultures and culture data - -When enabling the invariant mode, all cultures behave like the invariant culture. The invariant culture has the following characteristics: - + +When enabling the invariant mode, all cultures behave like the invariant culture. The invariant culture has the following characteristics: + * Culture names (English, native display, ISO, language names) will return invariant names. For instance, when requesting culture native name, you will get "Invariant Language (Invariant Country)". * All cultures LCID will have value 0x1000 (which means Custom Locale ID). The exception is the invariant cultures which will still have 0x7F. * All culture parents will be invariant. In other word, there will not be any neutral cultures by default but the apps can still create a culture like "en". @@ -45,45 +45,45 @@ When enabling the invariant mode, all cultures behave like the invariant culture * Numbers will always be formatted as the invariant culture. For example, decimal point will always be formatted as ".". Number strings previously formatted with cultures that have different symbols will fail parsing. * All cultures will have currency symbol as "¤" * Culture enumeration will always return a list with one culture which is the invariant culture. - + ## String casing - + String casing (ToUpper and ToLower) will be performed for the ASCII range only. Requests to case code points outside that range will not be performed, however no exception will be thrown. In other words, casing will only be performed for character range ['a'..'z']. - + Turkish I casing will not be supported when using Turkish cultures. - + ## String sorting and searching String operations like [Compare](https://docs.microsoft.com/dotnet/api/?term=string.compare), [IndexOf](https://docs.microsoft.com/dotnet/api/?term=string.indexof) and [LastIndexOf](https://docs.microsoft.com/dotnet/api/?term=string.lastindexof) are always performed as [ordinal](https://en.wikipedia.org/wiki/Ordinal_number) and not linguistic operations regardless of the string comparing options passed to the APIs. - + The [ignore case](https://docs.microsoft.com/dotnet/api/system.globalization.compareoptions.ignorecase) string sorting option is supported but only for the ASCII range as mentioned previously. - + For example, the following comparison will resolve to being unequal: * 'i', compared to * Turkish I '\u0130', given -* Turkish culture, using +* Turkish culture, using * CompareOptions.Ignorecase However, the following comparison will resolve to being equal: * 'i', compared to -* 'I', using +* 'I', using * CompareOptions.Ignorecase - + It is worth noticing that all other [sort comparison options](https://docs.microsoft.com/dotnet/api/system.globalization.compareoptions) (for example, ignore symbols, ignore space, Katakana, Hiragana) will have no effect in the invariant mode (they are ignored). - + ## Sort keys - + Sort keys are used mostly when indexing some data (for example, database indexing). When generating sort keys of 2 strings and comparing the sort keys the results should hold the exact same results as if comparing the original 2 strings. In the invariant mode, sort keys will be generated according to ordinal comparison while respecting ignore casing options. - + ## String normalization - -String normalization normalizes a string into some form (for example, composed, decomposed forms). Normalization data is required to perform these operations, which isn't available in invariant mode. In this mode, all strings are considered as already normalized, per the following behavior: -* If the app requested to normalize any string, the original string is returned without modification. +String normalization normalizes a string into some form (for example, composed, decomposed forms). Normalization data is required to perform these operations, which isn't available in invariant mode. In this mode, all strings are considered as already normalized, per the following behavior: + +* If the app requested to normalize any string, the original string is returned without modification. * If the app asked if any string is normalized, the return value will always be `true`. - + ## Internationalized Domain Names (IDN) support [Internationalized Domain Names](https://en.wikipedia.org/wiki/Internationalized_domain_name) require globalization data to perform conversion to ASCII or Unicode forms, which isn't available in the invariant mode. In this mode, IDN functionality has the following behavior: @@ -91,13 +91,13 @@ String normalization normalizes a string into some form (for example, composed, * IDN support doesn't conform to the latest standard. * IDN support will be incorrect if the input IDN string is not normalized since normalization is not supported in invariant mode. * Some basic IDN strings will still produce correct values. - + ## Time zone display name in Linux - + When running on Linux, ICU is used to get the time zone display name. In invariant mode, the standard time zone names are returned instead. - + ## Enabling the invariant mode - + Applications can enable the invariant mode by either of the following: 1. in project file: @@ -119,13 +119,13 @@ Applications can enable the invariant mode by either of the following: } } ``` - + 3. setting environment variable value `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT` to `true` or `1`. Note: value set in project file or `runtimeconfig.json` has higher priority than the environment variable. ## APP behavior with and without the invariant config switch - + - If the invariant config switch is not set or it is set false - The framework will depend on the OS for the globalization support. - On Linux, if the ICU package is not installed, the application will fail to start. diff --git a/docs/design/features/host-component-dependencies-resolution.md b/docs/design/features/host-component-dependencies-resolution.md index 094f3d082e94..f107961714e5 100644 --- a/docs/design/features/host-component-dependencies-resolution.md +++ b/docs/design/features/host-component-dependencies-resolution.md @@ -40,4 +40,4 @@ This feature certainly provides a somewhat duplicate functionality to the existi * Currently we don't consider frameworks for the app when computing probing paths for resolving assets from the component's `.deps.json`. This is a different behavior from the app startup where these are considered. Is it important - needed? * Add ability to corelate tracing with the runtime - probably some kind of activity ID * Handling of native assets - currently returning just probing paths. Would be cleaner to return full resolved paths. But we would have to keep some probing paths. In the case of missing `.deps.json` the native library should be looked for in the component directory - thus requires probing - we can't figure out which of the files in the folder are native libraries in the hosts. -* Handling of satellite assemblies (resource assets) - currently returning just probing paths which exclude the culture. So from a resolved asset `./foo/en-us/resource.dll` we only take `./foo` as the probing path. Consider using full paths instead - probably would require more parsing as we would have to be able to figure out the culture ID somewhere to build the true map AssemblyName->path in the managed class. Just like for native assets, if there's no `.deps.json` the only possible solution is to use probing, so the probing semantics would have to be supported anyway. \ No newline at end of file +* Handling of satellite assemblies (resource assets) - currently returning just probing paths which exclude the culture. So from a resolved asset `./foo/en-us/resource.dll` we only take `./foo` as the probing path. Consider using full paths instead - probably would require more parsing as we would have to be able to figure out the culture ID somewhere to build the true map AssemblyName->path in the managed class. Just like for native assets, if there's no `.deps.json` the only possible solution is to use probing, so the probing semantics would have to be supported anyway. diff --git a/docs/design/features/host-error-codes.md b/docs/design/features/host-error-codes.md index 941c2a92a001..a041edb6d2c2 100644 --- a/docs/design/features/host-error-codes.md +++ b/docs/design/features/host-error-codes.md @@ -1,113 +1,51 @@ # Hosting layer error and exit codes This document lists all the values returned as special exit codes when running `dotnet.exe` or `apphost` or returned by the hosting APIs (`hostfxr`, `hostpolicy` and `nethost`). +Those exit codes are also specified in signed 32-bit form (what you would see if you run `echo %ERRORLEVEL%` on Winodws) and in 8-bit form (what you would see if you run `echo $?` on Linux). Note that the exit code returned by running an application via `dotnet.exe` or `apphost` can either be one of the below values or the exit code of the managed application itself. - ### Success error/exit codes - -* `Success` (`0`) - Operation was successful. - -* `Success_HostAlreadyInitialized` (`0x00000001`) - Initialization was successful, but another host context is already initialized, so the returned context is "secondary". The requested context was otherwise fully compatible with the already initialized context. -This is returned by `hostfxr_initialize_for_runtime_config` if it's called when the host is already initialized in the process. Comes from `corehost_initialize` in `hostpolicy`. - -* `Success_DifferentRuntimeProperties` (`0x00000002`) - Initialization was successful, but another host context is already initialized and the requested context specified some runtime properties which are not the same (either in value or in presence) to the already initialized context. -This is returned by `hostfxr_initialize_for_runtime_config` if it's called when the host is already initialized in the process. Comes from `corehost_initialize` in `hostpolicy`. +| Name | Value | Value (signed, 32-bit) | Value (8-bit) | Description | +| ------------------------------------- | ------------ | ---------------------- | ------------- | ----------- | +| `Success` | `0x00000000` | `0` | `0` | Operation was successful. | +| `Success_HostAlreadyInitialized` | `0x00000001` | `1` | `1` | Initialization was successful, but another host context is already initialized, so the returned context is "secondary". The requested context was otherwise fully compatible with the already initialized context. This is returned by `hostfxr_initialize_for_runtime_config` if it's called when the host is already initialized in the process. Comes from `corehost_initialize` in `hostpolicy`. | +| `Success_DifferentRuntimeProperties` | `0x00000002` | `2` | `2` | Initialization was successful, but another host context is already initialized and the requested context specified some runtime properties which are not the same (either in value or in presence) to the already initialized context. This is returned by `hostfxr_initialize_for_runtime_config` if it's called when the host is already initialized in the process. Comes from `corehost_initialize` in `hostpolicy`. | ### Failure error/exit codes - -* `InvalidArgFailure` (`0x80008081`) - One of the specified arguments for the operation is invalid. - -* `CoreHostLibLoadFailure` (`0x80008082`) - There was a failure loading a dependent library. If any of the hosting components calls `LoadLibrary`/`dlopen` on a dependent library and the call fails, this error code is returned. The most common case for this failure is if the dependent library is missing some of its dependencies (for example the necessary CRT is missing on the machine), likely corrupt or incomplete install. -This error code is also returned from `corehost_resolve_component_dependencies` if it's called on a `hostpolicy` which has not been initialized via the hosting layer. This would typically happen if `coreclr` is loaded directly without the hosting layer and then `AssemblyDependencyResolver` is used (which is an unsupported scenario). - -* `CoreHostLibMissingFailure` (`0x80008083`) - One of the dependent libraries is missing. Typically when the `hostfxr`, `hostpolicy` or `coreclr` dynamic libraries are not present in the expected locations. Probably means corrupted or incomplete installation. - -* `CoreHostEntryPointFailure` (`0x80008084`) - One of the dependent libraries is missing a required entry point. - -* `CoreHostCurHostFindFailure` (`0x80008085`) - If the hosting component is trying to use the path to the current module (the hosting component itself) and from it deduce the location of the installation. Either the location of the current module could not be determined (some weird OS call failure) or the location is not in the right place relative to other expected components. -For example the `hostfxr` may look at its location and try to deduce the location of the `shared` folder with the framework from it. It assumes the typical install layout on disk. If this doesn't work, this error will be returned. - -* `CoreClrResolveFailure` (`0x80008087`) - If the `coreclr` library could not be found. The hosting layer (`hostpolicy`) looks for `coreclr` library either next to the app itself (for self-contained) or in the root framework (for framework-dependent). This search can be done purely by looking at disk or more commonly by looking into the respective `.deps.json`. If the `coreclr` library is missing in `.deps.json` or it's there but doesn't exist on disk, this error is returned. - -* `CoreClrBindFailure` (`0x80008088`) - The loaded `coreclr` library doesn't have one of the required entry points. - -* `CoreClrInitFailure` (`0x80008089`) - The call to `coreclr_initialize` failed. The actual error returned by `coreclr` is reported in the error message. - -* `CoreClrExeFailure` (`0x8000808a`) - The call to `coreclr_execute_assembly` failed. Note that this does not mean anything about the app's exit code, this failure occurs if `coreclr` failed to run the app itself. - -* `ResolverInitFailure` (`0x8000808b`) - Initialization of the `hostpolicy` dependency resolver failed. This can be: - * One of the frameworks or the app is missing a required `.deps.json` file. - * One of the `.deps.json` files is invalid (invalid JSON, or missing required properties and so on). - -* `ResolverResolveFailure` (`0x8000808c`) - Resolution of dependencies in `hostpolicy` failed. This can mean many different things, but in general one of the processed `.deps.json` contains entry for a file which could not found, or its resolution failed for some other reason (conflict for example). - -* `LibHostCurExeFindFailure` (`0x8000808d`) - Failure to determine the location of the current executable. The hosting layer uses the current executable path to deduce the install location in some cases. If this path can't be obtained (OS call fails, or the returned path doesn't exist), this error is returned. - -* `LibHostInitFailure` (`0x8000808e`) - Initialization of the `hostpolicy` library failed. The `corehost_load` method takes a structure with lot of initialization parameters. If the version of this structure doesn't match the expected value, this error code is returned. This would in general mean incompatibility between the `hostfxr` and `hostpolicy`, which should really only happen if somehow a newer `hostpolicy` is used by older `hostfxr`. This typically means corrupted installation. - -* `LibHostSdkFindFailure` (`0x80008091`) - Failure to find the requested SDK. This happens in the `hostfxr` when an SDK (also called CLI) command is used with `dotnet`. In this case the hosting layer tries to find an installed .NET SDK to run the command on. The search is based on deduced install location and on the requested version from potential `global.json` file. If either no matching SDK version can be found, or that version exists, but it's missing the `dotnet.dll` file, this error code is returned. - -* `LibHostInvalidArgs` (`0x80008092`) - Arguments to `hostpolicy` are invalid. This is used in three unrelated places in the `hostpolicy`, but in all cases it means the component calling `hostpolicy` did something wrong: - * Command line arguments for the app - the failure would typically mean that wrong argument was passed or such. For example if the application main assembly is not specified on the command line. On its own this should not happen as `hostfxr` should have parsed and validated all command line arguments. - * `hostpolicy` context's `get_delegate` - if the requested delegate enum value is not recognized. Again this would mean `hostfxr` passed the wrong value. - * `corehost_resolve_component_dependencies` - if something went wrong initializing `hostpolicy` internal structures. Would happen for example when the `component_main_assembly_path` argument is wrong. - -* `InvalidConfigFile` (`0x80008093`) - The `.runtimeconfig.json` file is invalid. The reasons for this failure can be among these: - * Failure to read from the file - * Invalid JSON - * Invalid value for a property (for example number for property which requires a string) - * Missing required property - * Other inconsistencies (for example `rollForward` and `applyPatches` are not allowed to be specified in the same config file) - * Any of the above failures reading the `.runtimecofig.dev.json` file - * Self-contained `.runtimeconfig.json` used in `hostfxr_initialize_for_runtime_config` -Note that missing `.runtimconfig.json` is not an error (means self-contained app). -This error code is also used when there is a problem reading the CLSID map file in `comhost`. - -* `AppArgNotRunnable` (`0x80008094`) - Used internally when the command line for `dotnet.exe` doesn't contain path to the application to run. In such case the command line is considered to be a CLI/SDK command. This error code should never be returned to external caller. - -* `AppHostExeNotBoundFailure` (`0x80008095`) - `apphost` failed to determine which application to run. This can mean: - * The `apphost` binary has not been imprinted with the path to the app to run (so freshly built `apphost.exe` from the branch will fail to run like this) - * The `apphost` is a bundle (single-file exe) and it failed to extract correctly. - -* `FrameworkMissingFailure` (`0x80008096`) - It was not possible to find a compatible framework version. This originates in `hostfxr` (`resolve_framework_reference`) and means that the app specified a reference to a framework in its `.runtimeconfig.json` which could not be resolved. The failure to resolve can mean that no such framework is available on the disk, or that the available frameworks don't match the minimum version specified or that the roll forward options specified excluded all available frameworks. -Typically this would be used if a 3.0 app is trying to run on a machine which has no 3.0 installed. -It would also be used for example if a 32bit 3.0 app is running on a machine which has 3.0 installed but only for 64bit. - -* `HostApiFailed` (`0x80008097`) - Returned by `hostfxr_get_native_search_directories` if the `hostpolicy` could not calculate the `NATIVE_DLL_SEARCH_DIRECTORIES`. - -* `HostApiBufferTooSmall` (`0x80008098`) - Returned when the buffer specified to an API is not big enough to fit the requested value. Can be returned from: - * `hostfxr_get_runtime_properties` - * `hostfxr_get_native_search_directories` - * `get_hostfxr_path` - -* `LibHostUnknownCommand` (`0x80008099`) - Returned by `hostpolicy` if the `corehost_main_with_output_buffer` is called with unsupported host command. This error code means there is incompatibility between the `hostfxr` and `hostpolicy`. In reality this should pretty much never happen. - -* `LibHostAppRootFindFailure` (`0x8000809a`) - Returned by `apphost` if the imprinted application path doesn't exist. This would happen if the app is built with an executable (the `apphost`) and the main `app.dll` is missing. - -* `SdkResolverResolveFailure` (`0x8000809b`) - Returned from `hostfxr_resolve_sdk2` when it fails to find matching SDK. Similar to `LibHostSdkFindFailure` but only used in the `hostfxr_resolve_sdk2`. - -* `FrameworkCompatFailure` (`0x8000809c`) - During processing of `.runtimeconfig.json` there were two framework references to the same framework which were not compatible. This can happen if the app specified a framework reference to a lower-level framework which is also specified by a higher-level framework which is also used by the app. -For example, this would happen if the app referenced `Microsoft.AspNet.App` version 2.0 and `Microsoft.NETCore.App` version 3.0. In such case the `Microsoft.AspNet.App` has `.runtimeconfig.json` which also references `Microsoft.NETCore.App` but it only allows versions 2.0 up to 2.9 (via roll forward options). So the version 3.0 requested by the app is incompatible. - -* `FrameworkCompatRetry` (`0x8000809d`) - Error used internally if the processing of framework references from `.runtimeconfig.json` reached a point where it needs to reprocess another already processed framework reference. If this error is returned to the external caller, it would mean there's a bug in the framework resolution algorithm. - -* `AppHostExeNotBundle` (`0x8000809e`) - Error reading the bundle footer metadata from a single-file `apphost`. This would mean a corrupted `apphost`. - -* `BundleExtractionFailure` (`0x8000809f`) - Error extracting single-file `apphost` bundle. This is used in case of any error related to the bundle itself. Typically would mean a corrupted bundle. - -* `BundleExtractionIOError` (`0x800080a0`) - Error reading or writing files during single-file `apphost` bundle extraction. - -* `LibHostDuplicateProperty` (`0x800080a1`) - The `.runtimeconfig.json` specified by the app contains a runtime property which is also produced by the hosting layer. For example if the `.runtimeconfig.json` would specify a property `TRUSTED_PLATFORM_ROOTS`, this error code would be returned. It is not allowed to specify properties which are otherwise populated by the hosting layer (`hostpolicy`) as there is not good way to resolve such conflicts. - -* `HostApiUnsupportedVersion` (`0x800080a2`) - Feature which requires certain version of the hosting layer binaries was used on a version which doesn't support it. -For example if COM component specified to run on 2.0 `Microsoft.NETCore.App` - as that contains older version of `hostpolicy` which doesn't support the necessary features to provide COM services. - -* `HostInvalidState` (`0x800080a3`) - Error code returned by the hosting APIs in `hostfxr` if the current state is incompatible with the requested operation. There are many such cases, please refer to the documentation of the hosting APIs for details. -For example if `hostfxr_get_runtime_property_value` is called with the `host_context_handle` `nullptr` (meaning get property from the active runtime) but there's no active runtime in the process. - -* `HostPropertyNotFound` (`0x800080a4`) - property requested by `hostfxr_get_runtime_property_value` doesn't exist. - -* `CoreHostIncompatibleConfig` (`0x800080a5`) - Error returned by `hostfxr_initialize_for_runtime_config` if the component being initialized requires framework which is not available or incompatible with the frameworks loaded by the runtime already in the process. For example trying to load a component which requires 3.0 into a process which is already running a 2.0 runtime. - -* `HostApiUnsupportedScenario` (`0x800080a6`) - Error returned by `hostfxr_get_runtime_delegate` when `hostfxr` doesn't currently support requesting the given delegate type using the given context. +| Name | Value | Value (signed, 32-bit) | Value (8-bit) | Description | +| ------------------------------------- | ------------ | ---------------------- | ------------- | ----------- | +| `InvalidArgFailure` | `0x80008081` | `-2147450751` | `129` | One of the specified arguments for the operation is invalid. | +| `CoreHostLibLoadFailure` | `0x80008082` | `-2147450750` | `130` | There was a failure loading a dependent library. If any of the hosting components calls `LoadLibrary`/`dlopen` on a dependent library and the call fails, this error code is returned. The most common case for this failure is if the dependent library is missing some of its dependencies (for example the necessary CRT is missing on the machine), likely corrupt or incomplete install. This error code is also returned from `corehost_resolve_component_dependencies` if it's called on a `hostpolicy` which has not been initialized via the hosting layer. This would typically happen if `coreclr` is loaded directly without the hosting layer and then `AssemblyDependencyResolver` is used (which is an unsupported scenario). | +| `CoreHostLibMissingFailure` | `0x80008083` | `-2147450749` | `131` | One of the dependent libraries is missing. Typically when the `hostfxr`, `hostpolicy` or `coreclr` dynamic libraries are not present in the expected locations. Probably means corrupted or incomplete installation. | +| `CoreHostEntryPointFailure` | `0x80008084` | `-2147450748` | `132` | One of the dependent libraries is missing a required entry point. | +| `CoreHostCurHostFindFailure` | `0x80008085` | `-2147450747` | `133` | If the hosting component is trying to use the path to the current module (the hosting component itself) and from it deduce the location of the installation. Either the location of the current module could not be determined (some weird OS call failure) or the location is not in the right place relative to other expected components. For example the `hostfxr` may look at its location and try to deduce the location of the `shared` folder with the framework from it. It assumes the typical install layout on disk. If this doesn't work, this error will be returned. | +| `CoreClrResolveFailure` | `0x80008087` | `-2147450745` | `135` | If the `coreclr` library could not be found. The hosting layer (`hostpolicy`) looks for `coreclr` library either next to the app itself (for self-contained) or in the root framework (for framework-dependent). This search can be done purely by looking at disk or more commonly by looking into the respective `.deps.json`. If the `coreclr` library is missing in `.deps.json` or it's there but doesn't exist on disk, this error is returned. | +| `CoreClrBindFailure` | `0x80008088` | `-2147450744` | `136` | The loaded `coreclr` library doesn't have one of the required entry points. | +| `CoreClrInitFailure` | `0x80008089` | `-2147450743` | `137` | The call to `coreclr_initialize` failed. The actual error returned by `coreclr` is reported in the error message. | +| `CoreClrExeFailure` | `0x8000808a` | `-2147450742` | `138` | The call to `coreclr_execute_assembly` failed. Note that this does not mean anything about the app's exit code, this failure occurs if `coreclr` failed to run the app itself. | +| `ResolverInitFailure` | `0x8000808b` | `-2147450741` | `139` | Initialization of the `hostpolicy` dependency resolver failed. This can be:
  • One of the frameworks or the app is missing a required `.deps.json` file.
  • One of the `.deps.json` files is invalid (invalid JSON, or missing required properties and so on).
| +| `ResolverResolveFailure` | `0x8000808c` | `-2147450740` | `140` | Resolution of dependencies in `hostpolicy` failed. This can mean many different things, but in general one of the processed `.deps.json` contains entry for a file which could not found, or its resolution failed for some other reason (conflict for example). | +| `LibHostCurExeFindFailure` | `0x8000808d` | `-2147450739` | `141` | Failure to determine the location of the current executable. The hosting layer uses the current executable path to deduce the install location in some cases. If this path can't be obtained (OS call fails, or the returned path doesn't exist), this error is returned. | +| `LibHostInitFailure` | `0x8000808e` | `-2147450738` | `142` | Initialization of the `hostpolicy` library failed. The `corehost_load` method takes a structure with lot of initialization parameters. If the version of this structure doesn't match the expected value, this error code is returned. This would in general mean incompatibility between the `hostfxr` and `hostpolicy`, which should really only happen if somehow a newer `hostpolicy` is used by older `hostfxr`. This typically means corrupted installation. | +| `LibHostSdkFindFailure` | `0x80008091` | `-2147450735` | `145` | Failure to find the requested SDK. This happens in the `hostfxr` when an SDK (also called CLI) command is used with `dotnet`. In this case the hosting layer tries to find an installed .NET SDK to run the command on. The search is based on deduced install location and on the requested version from potential `global.json` file. If either no matching SDK version can be found, or that version exists, but it's missing the `dotnet.dll` file, this error code is returned. | +| `LibHostInvalidArgs` | `0x80008092` | `-2147450734` | `146` | Arguments to `hostpolicy` are invalid. This is used in three unrelated places in the `hostpolicy`, but in all cases it means the component calling `hostpolicy` did something wrong:
  • Command line arguments for the app - the failure would typically mean that wrong argument was passed or such. For example if the application main assembly is not specified on the command line. On its own this should not happen as `hostfxr` should have parsed and validated all command line arguments.
  • `hostpolicy` context's `get_delegate` - if the requested delegate enum value is not recognized. Again this would mean `hostfxr` passed the wrong value.
  • `corehost_resolve_component_dependencies` - if something went wrong initializing `hostpolicy` internal structures. Would happen for example when the `component_main_assembly_path` argument is wrong.
| +| `InvalidConfigFile` | `0x80008093` | `-2147450733` | `147` | The `.runtimeconfig.json` file is invalid. The reasons for this failure can be among these:
  • Failure to read from the file
  • Invalid JSON
  • Invalid value for a property (for example number for property which requires a string)
  • Missing required property
  • Other inconsistencies (for example `rollForward` and `applyPatches` are not allowed to be specified in the same config file)
  • Any of the above failures reading the `.runtimecofig.dev.json` file
  • Self-contained `.runtimeconfig.json` used in `hostfxr_initialize_for_runtime_config`. Note that missing `.runtimconfig.json` is not an error (means self-contained app). This error code is also used when there is a problem reading the CLSID map file in `comhost`.
| +| `AppArgNotRunnable` | `0x80008094` | `-2147450732` | `148` | Used internally when the command line for `dotnet.exe` doesn't contain path to the application to run. In such case the command line is considered to be a CLI/SDK command. This error code should never be returned to external caller. | +| `AppHostExeNotBoundFailure` | `0x80008095` | `-2147450731` | `149` | `apphost` failed to determine which application to run. This can mean:
  • The `apphost` binary has not been imprinted with the path to the app to run (so freshly built `apphost.exe` from the branch will fail to run like this)
  • The `apphost` is a bundle (single-file exe) and it failed to extract correctly.
| +| `FrameworkMissingFailure` | `0x80008096` | `-2147450730` | `150` | It was not possible to find a compatible framework version. This originates in `hostfxr` (`resolve_framework_reference`) and means that the app specified a reference to a framework in its `.runtimeconfig.json` which could not be resolved. The failure to resolve can mean that no such framework is available on the disk, or that the available frameworks don't match the minimum version specified or that the roll forward options specified excluded all available frameworks. Typically this would be used if a 3.0 app is trying to run on a machine which has no 3.0 installed. It would also be used for example if a 32bit 3.0 app is running on a machine which has 3.0 installed but only for 64bit. | +| `HostApiFailed` | `0x80008097` | `-2147450729` | `151` | Returned by `hostfxr_get_native_search_directories` if the `hostpolicy` could not calculate the `NATIVE_DLL_SEARCH_DIRECTORIES`. | +| `HostApiBufferTooSmall` | `0x80008098` | `-2147450728` | `152` | Returned when the buffer specified to an API is not big enough to fit the requested value. Can be returned from:
  • `hostfxr_get_runtime_properties`
  • `hostfxr_get_native_search_directories`
  • `get_hostfxr_path`
| +| `LibHostUnknownCommand` | `0x80008099` | `-2147450727` | `153` | Returned by `hostpolicy` if the `corehost_main_with_output_buffer` is called with unsupported host command. This error code means there is incompatibility between the `hostfxr` and `hostpolicy`. In reality this should pretty much never happen. | +| `LibHostAppRootFindFailure` | `0x8000809a` | `-2147450726` | `154` | Returned by `apphost` if the imprinted application path doesn't exist. This would happen if the app is built with an executable (the `apphost`) and the main `app.dll` is missing. | +| `SdkResolverResolveFailure` | `0x8000809b` | `-2147450725` | `155` | Returned from `hostfxr_resolve_sdk2` when it fails to find matching SDK. Similar to `LibHostSdkFindFailure` but only used in the `hostfxr_resolve_sdk2`. | +| `FrameworkCompatFailure` | `0x8000809c` | `-2147450724` | `156` | During processing of `.runtimeconfig.json` there were two framework references to the same framework which were not compatible. This can happen if the app specified a framework reference to a lower-level framework which is also specified by a higher-level framework which is also used by the app. For example, this would happen if the app referenced `Microsoft.AspNet.App` version 2.0 and `Microsoft.NETCore.App` version 3.0. In such case the `Microsoft.AspNet.App` has `.runtimeconfig.json` which also references `Microsoft.NETCore.App` but it only allows versions 2.0 up to 2.9 (via roll forward options). So the version 3.0 requested by the app is incompatible. | +| `FrameworkCompatRetry` | `0x8000809d` | `-2147450723` | `157` | Error used internally if the processing of framework references from `.runtimeconfig.json` reached a point where it needs to reprocess another already processed framework reference. If this error is returned to the external caller, it would mean there's a bug in the framework resolution algorithm. | +| `AppHostExeNotBundle` | `0x8000809e` | `-2147450722` | `158` | Error reading the bundle footer metadata from a single-file `apphost`. This would mean a corrupted `apphost`. | +| `BundleExtractionFailure` | `0x8000809f` | `-2147450721` | `159` | Error extracting single-file `apphost` bundle. This is used in case of any error related to the bundle itself. Typically would mean a corrupted bundle. | +| `BundleExtractionIOError` | `0x800080a0` | `-2147450720` | `160` | Error reading or writing files during single-file `apphost` bundle extraction. | +| `LibHostDuplicateProperty` | `0x800080a1` | `-2147450719` | `161` | The `.runtimeconfig.json` specified by the app contains a runtime property which is also produced by the hosting layer. For example if the `.runtimeconfig.json` would specify a property `TRUSTED_PLATFORM_ROOTS`, this error code would be returned. It is not allowed to specify properties which are otherwise populated by the hosting layer (`hostpolicy`) as there is not good way to resolve such conflicts. | +| `HostApiUnsupportedVersion` | `0x800080a2` | `-2147450718` | `162` | Feature which requires certain version of the hosting layer binaries was used on a version which doesn't support it. For example if COM component specified to run on 2.0 `Microsoft.NETCore.App` - as that contains older version of `hostpolicy` which doesn't support the necessary features to provide COM services. | +| `HostInvalidState` | `0x800080a3` | `-2147450717` | `163` | Error code returned by the hosting APIs in `hostfxr` if the current state is incompatible with the requested operation. There are many such cases, please refer to the documentation of the hosting APIs for details. For example if `hostfxr_get_runtime_property_value` is called with the `host_context_handle` `nullptr` (meaning get property from the active runtime) but there's no active runtime in the process. | +| `HostPropertyNotFound` | `0x800080a4` | `-2147450716` | `164` | property requested by `hostfxr_get_runtime_property_value` doesn't exist. | +| `CoreHostIncompatibleConfig` | `0x800080a5` | `-2147450715` | `165` | Error returned by `hostfxr_initialize_for_runtime_config` if the component being initialized requires framework which is not available or incompatible with the frameworks loaded by the runtime already in the process. For example trying to load a component which requires 3.0 into a process which is already running a 2.0 runtime. | +| `HostApiUnsupportedScenario` | `0x800080a6` | `-2147450714` | `166` | Error returned by `hostfxr_get_runtime_delegate` when `hostfxr` doesn't currently support requesting the given delegate type using the given context. | diff --git a/docs/design/features/host-probing.md b/docs/design/features/host-probing.md index 9883c676ca08..38df2347406b 100644 --- a/docs/design/features/host-probing.md +++ b/docs/design/features/host-probing.md @@ -25,29 +25,29 @@ The dotnet host uses probing when it searches for actual file on disk for a give The library relative path in this case is `newtonsoft.json/11.0.2` and the asset relative path is `lib/netstandard2.0/Newtonsoft.Json.dll`. So the goal of the probing logic is to find the `Newtonsoft.Json.dll` file using the above relative paths. ## Probing -The probing itself is done by going over a list of probing paths, which are ordered according to their priority. For each path, the host will append the relative parts of the path as per above and see if the file actually exists on the disk. -If the file is found, the probing is done, and the full path just resolved is stored. +The probing itself is done by going over a list of probing paths, which are ordered according to their priority. For each path, the host will append the relative parts of the path as per above and see if the file actually exists on the disk. +If the file is found, the probing is done, and the full path just resolved is stored. If the file is not found, the probing continues with the next path on the list. If all paths are tried and the asset is still not found this is reported as an error (with the exception of app's `.deps.json` asset, in which case it's ignored). ## Probing paths The list of probing paths ordered according to their priority. First path in the list below is tried first and so on. -* Servicing paths - Servicing paths are only used for serviceable assets, that is the corresponding library record must specify `serviceable: true`. +* Servicing paths + Servicing paths are only used for serviceable assets, that is the corresponding library record must specify `serviceable: true`. The base servicing path is * On Windows x64 `%ProgramFiles(x86)%\coreservicing` * On Windows x86 `%ProgramFiles%\coreservicing` - * Otherwise (Linux/Mac) `$CORE_SERVICING` + * Otherwise (Linux/Mac) `$CORE_SERVICING` Given the base servicing path, the probing paths are * Servicing NI probe path `/|arch|` - this is used only for `runtime` assets * Servicing normal probe path `/pkgs` - this is used for all assets * The application (or framework if we're resolving framework assets) directory -* Framework directories - If the app (or framework) has dependencies on frameworks, these frameworks are used as probing paths. - The order is from the higher level framework to lower level framework. The app is considered the highest level, it direct dependencies are next and so on. - For assets from frameworks, only that framework and lower level frameworks are considered. +* Framework directories + If the app (or framework) has dependencies on frameworks, these frameworks are used as probing paths. + The order is from the higher level framework to lower level framework. The app is considered the highest level, it direct dependencies are next and so on. + For assets from frameworks, only that framework and lower level frameworks are considered. Note: These directories come directly out of the framework resolution process. Special note on Windows where global locations are always considered even if the app is not executed via the shared `dotnet.exe`. More details can be found in [Multi-level Shared FX Lookup](multilevel-sharedfx-lookup.md). * Shared store paths * `$DOTNET_SHARED_STORE/|arch|/|tfm|` - The environment variable `DOTNET_SHARED_STORE` can contain multiple paths, in which case each is appended with `|arch|/|tfm|` and used as a probing path. @@ -56,10 +56,10 @@ The list of probing paths ordered according to their priority. First path in the * On Windows, the global shared store is used * If running in WOW64 mode - `%ProgramFiles(x86)%\dotnet\store\|arch|\|tfm|` * Otherwise - `%ProgramFiles%\dotnet\store\|arch|\|tfm|` -* Additional probing paths +* Additional probing paths In these paths the `|arch|/|tfm|` string can be used and will be replaced with the actual values before using the path. * `--additionalprobingpath` command line arguments * `additionalProbingPaths` specified in `.runtimeconfig.json` and `.runtimeconfig.dev.json` for the app and each framework (highest to lowest) - Note about framework-dependent and self-contained apps. With regard to probing the main difference is that self-contained apps don't have any framework dependencies, so all assets (including assemblies which normally come from a framework) are probed for in the app's directory. \ No newline at end of file + Note about framework-dependent and self-contained apps. With regard to probing the main difference is that self-contained apps don't have any framework dependencies, so all assets (including assemblies which normally come from a framework) are probed for in the app's directory. diff --git a/docs/design/features/host-startup-hook.md b/docs/design/features/host-startup-hook.md index b5c29871a282..e2b4623fab03 100644 --- a/docs/design/features/host-startup-hook.md +++ b/docs/design/features/host-startup-hook.md @@ -57,8 +57,8 @@ Each part may be either * the assembly name must be considered a valid assembly name as specified by the `AssemblyName` class. -Note that white-spaces are preserved and considered part of the specified -path/name. So for example path separator followed by a white-space and +Note that white-spaces are preserved and considered part of the specified +path/name. So for example path separator followed by a white-space and another path separator is invalid, since the white-space only string in between the path separators will be considered as assembly name. @@ -90,10 +90,10 @@ centralized, while still allowing user code to do its own thing if it so desires. The producer of `StartupHook.dll` needs to ensure that -`StartupHook.dll` is compatible with the dependencies specified in the -main application's deps.json, since those dependencies are put on the -Trusted Platform Assemblies (TPA) list during the runtime startup, -before `StartupHook.dll` is loaded. This means that `StartupHook.dll` +`StartupHook.dll` is compatible with the dependencies specified in the +main application's deps.json, since those dependencies are put on the +Trusted Platform Assemblies (TPA) list during the runtime startup, +before `StartupHook.dll` is loaded. This means that `StartupHook.dll` needs to be built against the same or lower version of .NET Core than the app. ## Example diff --git a/docs/design/features/host-tracing.md b/docs/design/features/host-tracing.md index be60e9e5db2c..78f4b3ca4e75 100644 --- a/docs/design/features/host-tracing.md +++ b/docs/design/features/host-tracing.md @@ -1,6 +1,6 @@ # Host tracing -The various .NET Core host components provide detailed tracing of diagnostic information which can help solve issues around runtime, framework and assembly resolution and others. +The various .NET Core host components provide detailed tracing of diagnostic information which can help solve issues around runtime, framework and assembly resolution and others. ## Existing support Currently (as of .NET Core 2.1) the host tracing is only written to the `stderr` output of the process. It can be turned on by setting `COREHOST_TRACE=1`. @@ -47,13 +47,13 @@ The functions behave exactly the same in both components. The `listener` paramet * a pointer to an implementation of `host_trace_listener` which is then registered the only listener for all tracing. * `NULL` value which unregisters any previously registered listener. After this call tracing is disabled. -Custom host can and should register the trace listener as the first thing it does with the respective host component to ensure that all tracing is routed to it. +Custom host can and should register the trace listener as the first thing it does with the respective host component to ensure that all tracing is routed to it. -Only one trace listener can be registered at any given time. +Only one trace listener can be registered at any given time. Registering custom trace listener or setting it to `NULL` doesn't override the tracing enabled by environment variables. If a trace listener is registered and the `COREHOST_TRACE=1` is set as well, the traces will be routed to both the `stderr` as well as the registered listener. -The `hostfxr` component will propagate the trace listener to the `hostpolicy` component before it calls into it. So custom host only needs to register its trace listener with the `hostfxr` component and not both. The propagation of the trace listener is only done for the duration necessary after which it will be unregistered again. So custom host might need to register its own listener if it makes calls directly to `hostpolicy` on top of the calls to `hostfxr`. +The `hostfxr` component will propagate the trace listener to the `hostpolicy` component before it calls into it. So custom host only needs to register its trace listener with the `hostfxr` component and not both. The propagation of the trace listener is only done for the duration necessary after which it will be unregistered again. So custom host might need to register its own listener if it makes calls directly to `hostpolicy` on top of the calls to `hostfxr`. In case of new (.NET Core 3) `hostfxr` component which would call into an old (.NET Core 2.1) `hostpolicy` component, the `hostfxr` will not perform the propagation in any way since the older `hostpolicy` doesn't support this mechanism. The trace listener interface looks like this: @@ -68,14 +68,14 @@ struct host_trace_listener } ``` -The `message` parameter is a standard `NUL` terminated string and it's the message to trace with the respective verbosity level. +The `message` parameter is a standard `NUL` terminated string and it's the message to trace with the respective verbosity level. The `activityId` parameter is a standard `NUL` terminated string. It's used to correlate traces for a given binding event. The content of the string is not yet defined, but the trace listeners should consider it opaque. Trace listeners should include this string in the trace of the message in some form. The parameter may be `NULL` in which case the trace doesn't really belong to any specific binding event. Methods on the trace listener interface can be called from any thread in the app, and should be able to handle multiple calls at the same time from different threads. ## Future investments ### Trace content -Currently the host components tend to trace a lot. The trace contains lot of interesting information but it's done in a very verbose way which is sometimes hard to navigate. Future investment should look at the common scenarios which are using the host tracing and optimize the trace output for those scenarios. This doesn't necessarily mean decrease the amount of tracing, but possibly introduce "summary sections" which would describe the end result decisions for certain scenarios. +Currently the host components tend to trace a lot. The trace contains lot of interesting information but it's done in a very verbose way which is sometimes hard to navigate. Future investment should look at the common scenarios which are using the host tracing and optimize the trace output for those scenarios. This doesn't necessarily mean decrease the amount of tracing, but possibly introduce "summary sections" which would describe the end result decisions for certain scenarios. It would also be good to review the usage of verbose versus info tracing and make it consistent. ### Interaction with other diagnostics in the .NET Core diff --git a/docs/design/features/hw-intrinsics.md b/docs/design/features/hw-intrinsics.md index fb1287c42185..0abddc147cae 100644 --- a/docs/design/features/hw-intrinsics.md +++ b/docs/design/features/hw-intrinsics.md @@ -30,7 +30,7 @@ The vector types supported by one or more target ISAs are supported across platf * `Vector256` - A 256-bit vector of type `T` * `Vector256` intrinsics are supported only on x86 (and x64). -Note that these are generic types, which distinguishes these from native intrinsic vector types. It also somewhat complicates interop, as the runtime currently doesn't support interop for generic types. See https://github.com/dotnet/coreclr/issues/1685 +Note that these are generic types, which distinguishes these from native intrinsic vector types. It also somewhat complicates interop, as the runtime currently doesn't support interop for generic types. See https://github.com/dotnet/runtime/issues/4547 Not all intrinsics defined on these types support all primitive type parameters. When not supported, they are expected to throw `NotSupportedException`. This is generally handled by the C# implementation code, though for the most part this is a non-issue, as the ISA-specific intrinsics are declared over all supported concrete types (e.g. `Vector128` rather than `Vector128`). @@ -69,7 +69,7 @@ Currently, the JIT determines in the importer whether it will: * Generate a call (e.g. if it is a recognized intrinsic but an operand is not immediate as it is expected to be). The `mustExpand` option, which is returned by the VM as an "out" parameter to the `getIntrinsicID` method, must be false in this case. * Throw `PlatformNotSupportedException` if it is not a recognized and supported intrinsic for the current platform. -There is some room for improvement here. For example, it may be that an argument that appears to be non-constant could later be determined to be a constant value (https://github.com/dotnet/coreclr/issues/17108). +There is some room for improvement here. For example, it may be that an argument that appears to be non-constant could later be determined to be a constant value (https://github.com/dotnet/runtime/issues/9989). ### Hardware Intrinsics Table @@ -114,7 +114,7 @@ The only thing that makes the hardware intrinsics different in the area of instr The encodings are largely specified by `coreclr\src\jit\instrs{arch}.h`, and most of the target-specific code is in the `emit{arch}.*` files. -This is an area of the JIT that could use some redesign and refactoring (https://github.com/dotnet/coreclr/issues/23006 and https://github.com/dotnet/coreclr/issues/21441 among others). +This is an area of the JIT that could use some redesign and refactoring (https://github.com/dotnet/runtime/issues/12178 and https://github.com/dotnet/runtime/issues/11631 among others). ## Testing diff --git a/docs/design/features/raw-eventlistener.md b/docs/design/features/raw-eventlistener.md index f13b6a6096e0..aaf562ff3b72 100644 --- a/docs/design/features/raw-eventlistener.md +++ b/docs/design/features/raw-eventlistener.md @@ -23,7 +23,7 @@ public enum EventListenerSettings None, RawEventDispatch } -``` +``` This parameter is used to specify the desired dispatch behavior (in this case, do not deserialize event payloads). @@ -33,7 +33,7 @@ The new raw dispatch API will be: ``` public void OnEventWrittenRaw(RawEventWrittenEventArgs args); - + public sealed class RawEventWrittenEventArgs { @@ -52,9 +52,9 @@ public sealed class RawEventWrittenEventArgs public EventLevel Level { get; } public long OSThreadId { get; } public DateTime TimeStamp { get; } - + // Replacement properties for Payload and PayloadNames. - public ReadOnlySpan Metadata { get; } + public ReadOnlySpan Metadata { get; } public ReadOnlySpan Payload { get; } } ``` diff --git a/docs/design/features/readytorun-composite-format-design.md b/docs/design/features/readytorun-composite-format-design.md index b0fcf288874b..afa7a4ed1574 100644 --- a/docs/design/features/readytorun-composite-format-design.md +++ b/docs/design/features/readytorun-composite-format-design.md @@ -50,7 +50,7 @@ we propose using two complementary strategies: * In the composite R2R file with embedded metadata, there must be a new table of COR headers and metadata blobs representing the MSIL metadata from all the input assemblies. The table -must be indexable by simple assembly name for fast lookup. +must be indexable by simple assembly name for fast lookup. * in contrast to managed assemblies and single-input R2R executables, composite R2R files don't expose any COR header (it's not meaningful as the file potentially contains a larger @@ -98,7 +98,7 @@ this encoding are still work in progress and likely to further evolve. version bubble is represented by an arbitrary mixture of single-input and composite R2R files. If that is the case, manifest metadata would need to be decoupled from the index to `READYTORUN_SECTION_ASSEMBLIES`. - + Alternatively we could make it such that `READYTORUN_SECTION_MANIFEST_METADATA` holds all component assemblies of the current composite image at the beginning of the AssemblyRef table followed by the other needed assemblies *within the version bubble outside of the current @@ -157,7 +157,7 @@ that could be subsequently opened by ILDASM or ILSpy. Ideally we should patch ILDASM / ILSpy to cleanly handle the composite R2R file format; sadly this may end up being a relatively complex change due to the presence of multiple MSIL metadata blocks in the -file. +file. # Required diagnostic changes diff --git a/docs/design/features/roll-forward-on-no-candidate-fx.md b/docs/design/features/roll-forward-on-no-candidate-fx.md index dbfc04b632cb..7417498675d4 100644 --- a/docs/design/features/roll-forward-on-no-candidate-fx.md +++ b/docs/design/features/roll-forward-on-no-candidate-fx.md @@ -11,19 +11,19 @@ If the version specified is a _production_ version, the default behavior is: ``` For instance: - + Desired version: 1.0.1 Available versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.1.1, 2.0.1 Chosen version: 1.0.3 - + Desired version: 1.0.1 Available versions: 1.0.0, 1.1.0-preview1-x, 1.1.0-preview2-x, 1.2.0-preview1-x Chosen version: 1.1.0-preview2-x - + Desired version: 1.0.1 Available versions: 1.0.0, 1.1.0-preview1-x, 1.2.0, 1.2.1-preview1-x Chosen version: 1.2.0 - + Desired version: 1.0.1 Available versions: 1.0.0, 2.0.0 Chosen version: there is no compatible version available @@ -40,14 +40,14 @@ This means _preview_ is never rolled forward to _production_. Desired version: 1.0.1-preview2-x Available versions: 1.0.1-preview2-x, 1.0.1-preview3-x Chosen version: 1.0.1-preview2-x - + Desired version: 1.0.1-preview2-x Available versions: 1.0.1-preview3-x Chosen version: 1.0.1-preview3-x - + Desired version: 1.0.1-preview2-x Available versions: 1.0.1, 1.0.2-preview3-x - Chosen version: there is no compatible version available + Chosen version: there is no compatible version available ## Settings to control behavior ### applyPatches @@ -59,7 +59,7 @@ Once a compatible framework version is chosen as explained above, the latest pat Desired version: 1.0.1 Available versions: 1.0.1, 1.0.2 Chosen version: 1.0.2 - + Patch roll forward: disabled Desired version: 1.0.1 Available versions: 1.0.1, 1.0.2 @@ -79,7 +79,7 @@ To specify the exact desired framework version, use the command line argument '- - Command line argument ('--roll-forward-on-no-candidate-fx' argument) - Runtime configuration file ('rollForwardOnNoCandidateFx' property) - DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX environment variable - + The valid values: 0) Off (_do not roll forward_) @@ -101,7 +101,7 @@ If this feature is enabled and no compatible framework version is found, we'll s Desired Version: 1.0.0 Available versions: 1.1.1, 1.1.3, 1.2.0 Chosen version: 1.1.1 - + Patch roll forward: enabled Roll Forward On No Candidate Fx: 0 (disabled) Desired Version: 1.0.0 @@ -111,7 +111,7 @@ If this feature is enabled and no compatible framework version is found, we'll s It's important to notice that, even if "Roll Forward On No Candidate Fx" is enabled, only the specified framework version will be accepted if the '--fx-version' argument is used. -Since there are three ways to specify the values, conflicts will be resolved by the order listed above (command line has priority over config, which has priority over the environment variable). +Since there are three ways to specify the values, conflicts will be resolved by the order listed above (command line has priority over config, which has priority over the environment variable). ``` For instance: @@ -123,8 +123,8 @@ Since there are three ways to specify the values, conflicts will be resolved by 'rollForwardOnNoCandidateFx' property is set to '1' DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX env var is set to '1' The feature is DISABLED. -``` - +``` + There is no inheritance when there are chained framework references. If the app references FX1, and FX1 references FX2, then the resolution of FX2 only takes into account settings from `.runtimeconfig.json` in FX1, CLI and env. variable. The settings in the app's `.runtimeconfig.json` have no effect on resolution of FX2. ## Multilevel SharedFx Lookup diff --git a/docs/design/features/source-generator-pinvokes.md b/docs/design/features/source-generator-pinvokes.md index 1efec51604bc..fbd588950df9 100644 --- a/docs/design/features/source-generator-pinvokes.md +++ b/docs/design/features/source-generator-pinvokes.md @@ -2,7 +2,7 @@ ## Purpose -The CLR possesses a rich built-in marshaling mechanism for interoperability with native code that is handled at runtime. This system was designed to free .NET developers from having to author complex and potentially ABI sensitive [type conversion code][typemarshal_link] from a managed to an unmanaged environment. The built-in system works with both [P/Invoke][pinvoke_link] (i.e. `DllImportAttribute`) and [COM interop](https://docs.microsoft.com/dotnet/standard/native-interop/cominterop). The generated portion is typically called an ["IL Stub"][il_stub_link] since the stub is generated by inserting IL instructions into a stream and then passing that stream to the JIT for compilation. +The CLR possesses a rich built-in marshaling mechanism for interoperability with native code that is handled at runtime. This system was designed to free .NET developers from having to author complex and potentially ABI sensitive [type conversion code][typemarshal_link] from a managed to an unmanaged environment. The built-in system works with both [P/Invoke][pinvoke_link] (i.e. `DllImportAttribute`) and [COM interop](https://docs.microsoft.com/dotnet/standard/native-interop/cominterop). The generated portion is typically called an ["IL Stub"][il_stub_link] since the stub is generated by inserting IL instructions into a stream and then passing that stream to the JIT for compilation. A consequence of this approach is that marshaling code is not immediately available post-link for AOT scenarios (e.g. [`crossgen`](../../workflow/building/coreclr/crossgen.md) and [`crossgen2`](crossgen2-compilation-structure-enhancements.md)). The immediate unavailability of this code has been mitigated by a complex mechanism to have marshalling code generated by during AOT compilation. The [IL Linker][ilinker_link] is another tool that struggles with runtime generated code since it is unable to understand all potential used types without seeing what is generated. diff --git a/docs/design/features/tiered-compilation.md b/docs/design/features/tiered-compilation.md index 242dbc94b3ac..caedd79f94f1 100644 --- a/docs/design/features/tiered-compilation.md +++ b/docs/design/features/tiered-compilation.md @@ -92,4 +92,4 @@ Most of the implementation is relatively straightforward given the design and be 1. The current call counter implementation is utterly naive and using the PreStub has a high per-invocation cost relative to other more sophisticated implementation options. We expected it would need to change sooner, but so far despite having some measurable cost it hasn't been reached the top of the priority list for performance gain vs. work necessary. Part of what makes it not as bad as it looks is that there is a bound on the number of times it can be called for any one method and relative to typical 100,000 cycle costs for jitting a method even an expensive call counter doesn't make a huge impact. -2. Right now background compilation is limited to a single thread taken from the threadpool and used for up to 10ms. If we need more time than that we return the thread and request another. The goal is to be a good citizen in the threadpool's overall workload while still doing enough work in chunks that we get decent cache and thread quantum utilization. It's possible we could do better as the policy here hasn't been profiled much. Thus far we haven't profiled any performance issues that suggested we should be handling this differently. \ No newline at end of file +2. Right now background compilation is limited to a single thread taken from the threadpool and used for up to 10ms. If we need more time than that we return the thread and request another. The goal is to be a good citizen in the threadpool's overall workload while still doing enough work in chunks that we get decent cache and thread quantum utilization. It's possible we could do better as the policy here hasn't been profiled much. Thus far we haven't profiled any performance issues that suggested we should be handling this differently. diff --git a/docs/design/features/unloadability.md b/docs/design/features/unloadability.md index 4b61b0f8b3ce..0d1cddd0f096 100644 --- a/docs/design/features/unloadability.md +++ b/docs/design/features/unloadability.md @@ -1,4 +1,4 @@ -# `AssemblyLoadContext` unloadability +# `AssemblyLoadContext` unloadability ## Goals * Provide a building block for unloadable plug-ins * Users can load an assembly and its dependencies into an unloadable `AssemblyLoadContext`. @@ -100,7 +100,7 @@ Unloading is initialized by the user code calling `AssemblyLoadContext.Unload` m * The `AssemblyLoadContext` fires the `Unloading` event to allow the user code to perform cleanup if required (e.g. stop threads running inside of the context, remove references and destroy handles, etc.) * The `AssemblyLoadContext.InitiateUnload` method is called. It creates a strong GC handle referring to the `AssemblyLoadContext` to keep it around until the unload is complete. For example, finalizers of types that are loaded into the `AssemblyLoadContext` may need access to the `AssemblyLoadContext`. * Then it calls `AssemblyNative::PrepareForAssemblyLoadContextRelease` method with that strong handle as an argument, which in turn calls `CLRPrivBinderAssemblyLoadContext::PrepareForLoadContextRelease` -* That method stores the passed in strong GC handle in `CLRPrivBinderAssemblyLoadContext::m_ptrManagedStrongAssemblyLoadContext`. +* That method stores the passed in strong GC handle in `CLRPrivBinderAssemblyLoadContext::m_ptrManagedStrongAssemblyLoadContext`. * Then it decrements refcount of the `AssemblyLoaderAllocator` the `CLRPrivBinderAssemblyLoadContext` points to. * Finally, it destroys the strong handle to the managed `LoaderAllocator`. That allows the `LoaderAllocator` to be collected. ### Second phase of unloading diff --git a/docs/design/specs/Ecma-335-Augments.md b/docs/design/specs/Ecma-335-Augments.md index 1d42a5e4c909..df4e429912a1 100644 --- a/docs/design/specs/Ecma-335-Augments.md +++ b/docs/design/specs/Ecma-335-Augments.md @@ -147,7 +147,7 @@ error with a suitable message rather than a stack overflow. Related issues: * https://github.com/dotnet/roslyn/issues/7971 -* https://github.com/dotnet/coreclr/issues/2674 +* https://github.com/dotnet/runtime/issues/4945 #### Proposed specification change @@ -195,13 +195,13 @@ c) In section II.23.2.6 LocalVarSig, replace the diagram with production rules: ```ebnf LocalVarSig ::= LOCAL_SIG Count LocalVarType+ - + LocalVarType ::= Type CustomMod* Constraint BYREF? Type CustomMod* BYREF Type CustomMod* TYPEDBYREF - + ``` d) In section II.23.2.10 Param, replace the diagram with production rules: @@ -227,7 +227,7 @@ f) In section II.23.2.12 Type, add a production rule to the definition of `Type` ```ebnf Type ::= CustomMod* Type - + ``` g) In sections II.23.2.12 Type and II.23.2.14 TypeSpec replace production rule diff --git a/docs/design/specs/PE-COFF.md b/docs/design/specs/PE-COFF.md index 69074307155d..dff7248a326c 100644 --- a/docs/design/specs/PE-COFF.md +++ b/docs/design/specs/PE-COFF.md @@ -19,11 +19,11 @@ PE/COFF Specification defines the structure of Debug Directory in section 5.1.1. | Offset | Size | Field | Description | |:-------|:-----|:---------------|----------------------------------------------------------------| | 0 | 4 | Signature | 0x52 0x53 0x44 0x53 (ASCII string: "RSDS") | -| 4 | 16 | Guid | GUID (Globally Unique Identifier) of the associated PDB. +| 4 | 16 | Guid | GUID (Globally Unique Identifier) of the associated PDB. | 20 | 4 | Age | Iteration of the PDB. The first iteration is 1. The iteration is incremented each time the PDB content is augmented. | 24 | | Path | UTF-8 NUL-terminated path to the associated .pdb file | -Guid and Age are used to match PE/COFF image with the associated PDB. +Guid and Age are used to match PE/COFF image with the associated PDB. The associated .pdb file may not exist at the path indicated by Path field. If it doesn't the Path, Guid and Age can be used to find the corresponding PDB file locally or on a symbol server. The exact search algorithm used by tools to locate the PDB depends on the tool and its configuration. @@ -37,11 +37,11 @@ If the containing PE/COFF file is deterministic the Guid field above and DateTim The entry doesn't have any data associated with it. All fields of the entry, but Type shall be zero. -Presence of this entry indicates that the containing PE/COFF file is deterministic. +Presence of this entry indicates that the containing PE/COFF file is deterministic. ### Embedded Portable PDB Debug Directory Entry (type 17) -Declares that debugging information is embedded in the PE file at location specified by PointerToRawData. +Declares that debugging information is embedded in the PE file at location specified by PointerToRawData. *Version Major=any, Minor=0x0100* of the data format: @@ -49,7 +49,7 @@ Declares that debugging information is embedded in the PE file at location speci |:-------|:---------------|:-----------------|-------------------------------------------------------| | 0 | 4 | Signature | 0x4D 0x50 0x44 0x42 | | 4 | 4 | UncompressedSize | The size of decompressed Portable PDB image | -| 8 | SizeOfData - 8 | PortablePdbImage | Portable PDB image compressed using Deflate algorithm | +| 8 | SizeOfData - 8 | PortablePdbImage | Portable PDB image compressed using Deflate algorithm | If both CodeView and Embedded Portable PDB entries are present then they shall represent the same data. @@ -70,9 +70,9 @@ The value of Stamp field in the entry shall be 0. Stores crypto hash of the content of the symbol file the PE/COFF file was built with. -The hash can be used to validate that a given PDB file was built with the PE/COFF file and not altered in any way. +The hash can be used to validate that a given PDB file was built with the PE/COFF file and not altered in any way. -More than one entry can be present, in case multiple PDBs were produced during the build of the PE/COFF file (e.g. private and public symbols). +More than one entry can be present, in case multiple PDBs were produced during the build of the PE/COFF file (e.g. private and public symbols). *Version Major=0x0001, Minor=0x0000* of the entry data format is following: @@ -103,7 +103,7 @@ When validating that Portable PDB matches the debug directory record check that If the symbol format is Windows PDB the checksum is calculated by hashing the entire content of the PDB file with the PDB signature comprising of 16B GUID and 4B timestamp zeroed. -When validating that Windows PDB matches the debug directory record check that the checksums match and that the PDB signature (both GUID and timestamp values) match the data in the corresponding [CodeView record](#WindowsCodeViewEntry). +When validating that Windows PDB matches the debug directory record check that the checksums match and that the PDB signature (both GUID and timestamp values) match the data in the corresponding [CodeView record](#WindowsCodeViewEntry). > Note that when the debugger (or other tool) searches for the PDB only GUID and Age fields are used to match the PDB, but the timestamp of the CodeView debug directory entry does not need to match the timestamp stored in the PDB. Therefore, to verify byte-for-byte identity of the PDB, the timestamp field should also be checked. diff --git a/docs/design/specs/PortablePdb-Metadata.md b/docs/design/specs/PortablePdb-Metadata.md index d3d9b1277abd..d642bc0a6523 100644 --- a/docs/design/specs/PortablePdb-Metadata.md +++ b/docs/design/specs/PortablePdb-Metadata.md @@ -34,7 +34,7 @@ When debugging metadata is generated to a separate data blob "#Pdb" and "#~" str #### #Pdb stream The #Pdb stream has the following structure: - + | Offset | Size | Field | Description | |:-------|:-----|:---------------|----------------------------------------------------------------| | 0 | 20 | PDB id | A byte sequence uniquely representing the debugging metadata blob content. | @@ -42,10 +42,10 @@ The #Pdb stream has the following structure: | 24 | 8 | ReferencedTypeSystemTables | Bit vector of referenced type system metadata tables, let n be the number of bits that are 1. | | 32 | 4*n | TypeSystemTableRows | Array of n 4-byte unsigned integers indicating the number of rows for each referenced type system metadata table. | -#### #~ stream +#### #~ stream "#~" stream shall only contain debugging information tables defined above. - + References to heaps (strings, blobs, guids) are references to heaps of the debugging metadata. The sizes of references to type system tables are determined using the algorithm described in ECMA-335-II Chapter 24.2.6, except their respective row counts are found in _TypeSystemTableRows_ field of the #Pdb stream. ### Document Table: 0x30 @@ -58,7 +58,7 @@ The Document table has the following columns: The table is not required to be sorted. -There shall be no duplicate rows in the _Document_ table, based upon document name. +There shall be no duplicate rows in the _Document_ table, based upon document name. _Name_ shall not be nil. It can however encode an empty name string. @@ -170,7 +170,7 @@ _InitialDocument_ is only present if the _Document_ field of the _MethodDebugInf | _δILOffset_ | 0 | unsigned compressed | | _Document_ | Document row id | unsigned compressed | -Each _SequencePointRecord_ represents a single sequence point. The sequence point inherits the value of _Document_ property from the previous record (_SequencePointRecord_ or _document-record_), from the _Document_ field of the _MethodDebugInformation_ table if it's the first sequence point of a method body that spans a single document, or from _InitialDocument_ if it's the first sequence point of a method body that spans multiple documents. The value of _IL Offset_ is calculated using the value of the previous sequence point (if any) and the value stored in the record. +Each _SequencePointRecord_ represents a single sequence point. The sequence point inherits the value of _Document_ property from the previous record (_SequencePointRecord_ or _document-record_), from the _Document_ field of the _MethodDebugInformation_ table if it's the first sequence point of a method body that spans a single document, or from _InitialDocument_ if it's the first sequence point of a method body that spans multiple documents. The value of _IL Offset_ is calculated using the value of the previous sequence point (if any) and the value stored in the record. The values of _Start Line_, _Start Column_, _End Line_ and _End Column_ of a non-hidden sequence point are calculated based upon the values of the previous non-hidden sequence point (if any) and the data stored in the record. @@ -253,14 +253,14 @@ There shall be no duplicate rows in the LocalConstant table, based upon owner an The structure of the blob is Blob ::= CustomMod* (PrimitiveConstant | EnumConstant | GeneralConstant) - - PrimitiveConstant ::= PrimitiveTypeCode PrimitiveValue + + PrimitiveConstant ::= PrimitiveTypeCode PrimitiveValue PrimitiveTypeCode ::= BOOLEAN | CHAR | I1 | U1 | I2 | U2 | I4 | U4 | I8 | U8 | R4 | R8 | STRING - - EnumConstant ::= EnumTypeCode EnumValue EnumType + + EnumConstant ::= EnumTypeCode EnumValue EnumType EnumTypeCode ::= BOOLEAN | CHAR | I1 | U1 | I2 | U2 | I4 | U4 | I8 | U8 EnumType ::= TypeDefOrRefOrSpecEncoded - + GeneralConstant ::= (CLASS | VALUETYPE) TypeDefOrRefOrSpecEncoded GeneralValue? | OBJECT @@ -289,18 +289,18 @@ The encoding of the _PrimitiveValue_ and _EnumValue_ is determined based upon th | ```U8``` | uint64 | | ```R4``` | float32 | | ```R8``` | float64 | -| ```STRING``` | A single byte 0xff (represents a null string reference), or a UTF-16 little-endian encoded string (possibly empty). | +| ```STRING``` | A single byte 0xff (represents a null string reference), or a UTF-16 little-endian encoded string (possibly empty). | The numeric values of the type codes are defined by ECMA-335 §II.23.1.16. _EnumType_ must be an enum type as defined in ECMA-335 §II.14.3. The value of _EnumTypeCode_ must match the underlying type of the _EnumType_. -The encoding of the _GeneralValue_ is determined based upon the type expressed by _TypeDefOrRefOrSpecEncoded_ specified in _GeneralConstant_. _GeneralValue_ for special types listed in the table below has to be present and is encoded as specified. If the _GeneralValue_ is not present the value of the constant is the default value of the type. If the type is a reference type the value is a null reference, if the type is a pointer type the value is a null pointer, etc. +The encoding of the _GeneralValue_ is determined based upon the type expressed by _TypeDefOrRefOrSpecEncoded_ specified in _GeneralConstant_. _GeneralValue_ for special types listed in the table below has to be present and is encoded as specified. If the _GeneralValue_ is not present the value of the constant is the default value of the type. If the type is a reference type the value is a null reference, if the type is a pointer type the value is a null pointer, etc. | Namespace | Name | _GeneralValue_ encoding | |:--------------|:---------|:-------------------------| | System | Decimal | sign (highest bit), scale (bits 0..7), low (uint32), mid (uint32), high (uint32) | -| System | DateTime | int64: ticks | +| System | DateTime | int64: ticks | ### ImportScope Table: 0x35 The ImportScope table has the following columns: diff --git a/docs/infra/buildtriage.md b/docs/infra/buildtriage.md new file mode 100644 index 000000000000..ed0589f986e7 --- /dev/null +++ b/docs/infra/buildtriage.md @@ -0,0 +1,45 @@ +## Build Triage Rotation + +The responsibility of this role is triaging our rolling / official builds, filing issues to track broken tests, submitting changes to dotnet/runtime to work around issues (disabling a test, undoing a PR that broke the build). + +In some cases this will require working with core-eng team when the issues are in Helix / Azure / Arcade. This person will also attend CI Council with the infra manager to provide updates on our reliability status. + +This directly impacts developer productivity and the need to promptly fix such breaks can span across time zones. Hence it will be the collective responsibility of the Scout pool to investigate such breaks. + +This role will work on a rotation basis. There are six people in the role and each rotation will last for a calendar month. + +## Tracking Build Failures +All the CI failures can be tracked through the CI Council dashboards i.e. [Public](https://dev.azure.com/dnceng/public/_dashboards/dashboard/40ac4990-3498-4b3a-85dd-2ffde961d672), [Internal](https://dev.azure.com/dnceng/internal/_dashboards/dashboard/e1bb572d-a2b0-488f-a58a-54c73a547f0d). +We have different dashboards for public(Rolling & PR Builds) and internal builds. + +Tests are not run during the internal builds. Publishing and signing steps are run only during internal builds. Rolling builds run tests for the full matrix. + +For new issues, try to provide a runfo search which will make it easy to isolate repeated instances of that failure. + +Contact @chcosta if you are having any trouble accessing the dashboards. +Contact @Chrisboh if you don't have the calendar invite for the CI Council meeting. +Contact @jaredpar if you are having any trouble with runfo, site or utility. + +## Ongoing Issues + +All the issues causing the builds to fail should be marked with [`blocking-clean-ci`](https://github.com/dotnet/runtime/issues?q=is%3Aissue+is%3Aopen+label%3Ablocking-clean-ci) label. +Any issues causing build breaks in the official build should be marked with [`blocking-clean-official`](https://github.com/dotnet/runtime/issues?q=is%3Aissue+is%3Aopen+label%3Ablocking-clean-official). +It helps in tracking issues effectively. + +The main meta-bug linking to currently tracked issues is [here](https://github.com/dotnet/runtime/issues/702). + +## Some helpful resources +- [runfo Website](https://runfo.azurewebsites.net/) +- [runfo command-line util](https://github.com/jaredpar/devops-util) +- [runfo Documentation](https://github.com/jaredpar/devops-util/tree/master/runfo) +- [Internal Build Definition](https://dev.azure.com/dnceng/internal/_build?definitionId=679) +- [Public Build Definition](https://dev.azure.com/dnceng/public/_build?definitionId=686) + +## Build Rotation for upcoming months + +| Month | Alias | +|-------|-----------| +| September | @directhex | +| October | @jkoritzinsky | +| November | @aik-jahoda | +| December | @akoeplinger | diff --git a/docs/issues-pr-management.md b/docs/issues-pr-management.md index 05090b2332e5..503de72b452d 100644 --- a/docs/issues-pr-management.md +++ b/docs/issues-pr-management.md @@ -12,7 +12,7 @@ dotnet/runtime issues and pull requests are a shared resource. As such, it will Here are a few of the most salient components of working well together, and the FAQ has much more detail. ## Scenarios where we all have to work together: -- All incoming issues and pull requests will be automatically labeled with an `area-*` label. The bot will also assign the `untriaged` label to only issues, once they get created. +- All incoming issues and pull requests will be automatically labeled with an `area-*` label. The bot will also assign the `untriaged` label to only issues, once they get created. - All issues and pull requests should have exactly 1 `area-*` label. - Issues are considered triaged when the `untriaged` label has been removed. - When issues have `area-*` labels switched, the `untriaged` label must be added. This prevents issues being lost in a `triaged` state when they have not actually been triaged by the area owner. In the future, a bot may automatically ensure this happens. diff --git a/docs/pr-guide.md b/docs/pr-guide.md index 9074d699186f..7e1454b0bf9c 100644 --- a/docs/pr-guide.md +++ b/docs/pr-guide.md @@ -27,7 +27,7 @@ Anyone with write access can merge a pull request manually or by setting the [au * The PR successfully builds and passes all tests in the Continuous Integration (CI) system. * Depending on your change, you may need to re-run validation. See [rerunning validation](#rerunning-validation) below. -Please always **squash** the pull request unless there are special circumstances. Do so, even if the PR contains only one commit. It creates a simpler history than a Merge Commit. "Special circumstances" are rare, and typically mean that there are a series of cleanly separated changes that will be too hard to understand if squashed together, or for some reason we want to preserve the ability to bisect them. +Typically, PRs are merged as one commit. It creates a simpler history than a Merge Commit. "Special circumstances" are rare, and typically mean that there are a series of cleanly separated changes that will be too hard to understand if squashed together, or for some reason we want to preserve the ability to bisect them. ## Rerunning Validation diff --git a/docs/project/dogfooding.md b/docs/project/dogfooding.md index 6b564f7ec239..b6de50d2d3f6 100644 --- a/docs/project/dogfooding.md +++ b/docs/project/dogfooding.md @@ -1,10 +1,6 @@ -# How to get up and running on .NET Core +# Dogfooding nightly builds of .NET -This document provides the steps necessary to consume a nightly build of -.NET runtime and SDK. - -Please note that these steps are likely to change as we're simplifying -this experience. Make sure to consult this document often. +This document provides the steps necessary to consume a nightly build of .NET runtime and SDK. ## Obtaining nightly builds of NuGet packages @@ -17,51 +13,51 @@ dotnet new nugetconfig Next, add the package source to NuGet.Config with the [dotnet nuget add source](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source) command: ``` -dotnet nuget add source -n dotnet5 https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet5/nuget/v3/index.json +dotnet nuget add source -n dotnet6 https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json ``` Then, you will be able to add the latest prerelease version of the desired package to your project. -**Example:** To add version 5.0.0-preview.1.20120.5 of the System.Data.OleDb package, use the [dotnet add package](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-add-package) command: +**Example:** To add version 6.0.0-alpha.1.20468.7 of the System.Data.OleDb package, use the [dotnet add package](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-add-package) command: ``` -dotnet add package System.Data.OleDb -v 5.0.0-preview.1.20120.5 +dotnet add package System.Data.OleDb -v 6.0.0-alpha.1.20468.7 ``` To use nightly builds of the entire runtime, follow the steps given in the rest of this document instead. ## Install prerequisites -1. Acquire the latest nightly .NET SDK by downloading the zip or tarball listed in https://github.com/dotnet/core-sdk#installers-and-binaries (for example, https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.zip ) into a new folder, for instance `C:\dotnet`. +1. Acquire the latest nightly .NET SDK by downloading and extracting a zip/tarball or using an installer from the [installers and binaries table in dotnet/installer](https://github.com/dotnet/installer#installers-and-binaries) (for example, https://aka.ms/dotnet/net6/dev/Sdk/dotnet-sdk-win-x64.zip). -2. By default, the dotnet CLI will use the globally installed SDK if it matches the major/minor version you request and has a higher revision. To force it to use the locally installed SDK, you must set an environment variable `DOTNET_MULTILEVEL_LOOKUP=0` in your shell. You can use `dotnet --info` to verify what version of the Shared Framework it is using. +2. By default, the dotnet CLI will use the globally installed SDK if it matches the major/minor version you request and has a higher revision. To force it to use a locally installed SDK, you must set an environment variable `DOTNET_MULTILEVEL_LOOKUP=0` in your shell. You can use `dotnet --info` to verify what version of the Shared Framework it is using. -3. Reminder: if you are using a local copy of the dotnet CLI, take care that when you type `dotnet` you do not inadvertently pick up a different copy that you may have in your path. On Windows, for example, if you use a Command Prompt, a global copy may be in the path, so use the fully qualified path to your local `dotnet` (e.g. `C:\dotnet\dotnet.exe`). If you receive an error "error NETSDK1045: The current .NET SDK does not support targeting .NET Core 5.0." then you may be executing an older `dotnet`. +3. Reminder: if you are using a local copy of the dotnet CLI, take care that when you type `dotnet` you do not inadvertently pick up a different copy that you may have in your path. On Windows, for example, if you use a Command Prompt, a global copy may be in the path, so use the fully qualified path to your local `dotnet` (e.g. `C:\dotnet\dotnet.exe`). If you receive an error "error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0." then you may be executing an older `dotnet`. After setting up dotnet you can verify you are using the dogfooding version by executing `dotnet --info`. Here is an example output at the time of writing: ``` >dotnet --info -.NET Core SDK (reflecting any global.json): - Version: 5.0.100-preview.1.20167.6 - Commit: 00255dd10b +.NET SDK (reflecting any global.json): + Version: 6.0.100-alpha.1.20514.11 + Commit: 69ee2fdd13 Runtime Environment: OS Name: Windows - OS Version: 10.0.18363 + OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 - Base Path: c:\dotnet\sdk\5.0.100-preview.1.20167.6\ + Base Path: c:\dotnet\sdk\6.0.100-alpha.1.20514.11\ Host (useful for support): - Version: 5.0.0-preview.1.20120.5 - Commit: 3c523a6a7a + Version: 6.0.0-alpha.1.20468.7 + Commit: a820ca1c4f .NET Core SDKs installed: - 5.0.100-preview.1.20167.6 [c:\dotnet\sdk] + 6.0.100-alpha.1.20514.11 [c:\dotnet\sdk] .NET Core runtimes installed: - Microsoft.AspNetCore.App 5.0.0-preview.1.20124.5 [c:\dotnet\shared\Microsoft.AspNetCore.App] - Microsoft.NETCore.App 5.0.0-preview.1.20120.5 [c:\dotnet\shared\Microsoft.NETCore.App] - Microsoft.WindowsDesktop.App 5.0.0-preview.1.20127.5 [c:\dotnet\shared\Microsoft.WindowsDesktop.App] + Microsoft.AspNetCore.App 5.0.0-rc.2.20466.8 [c:\dotnet\shared\Microsoft.AspNetCore.App] + Microsoft.NETCore.App 6.0.0-alpha.1.20468.7 [c:\dotnet\shared\Microsoft.NETCore.App] + Microsoft.WindowsDesktop.App 5.0.0-rc.1.20417.4 [c:\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download @@ -70,10 +66,10 @@ To install additional .NET Core runtimes or SDKs: 4. Our nightly builds are uploaded to dotnet-blob feeds, not NuGet - so ensure the .NET Core blob feed is in your nuget configuration in case you need other packages from .NET Core that aren't included in the download. For example, on Windows you could edit `%userprofile%\appdata\roaming\nuget\nuget.config` or on Linux edit `~/.nuget/NuGet/NuGet.Config` to add these lines: ```xml - + ... - + ``` (Documentation for configuring feeds is [here](https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior).) @@ -110,17 +106,16 @@ this, there are two options you can take. This is the default case for applications - running against an installed .NET runtime. 1. You still need to install the prerequisite .NET SDK from above. -2. Optionally, install the specific .NET runtime you require: - - https://github.com/dotnet/core-sdk#installers-and-binaries +2. Optionally, install the specific .NET runtime you require globally or download get the latest one available from the [nightly build table](#nightly-builds-table) 3. Modify your .csproj to reference the nightly build of Microsoft.NETCore.App ```XML Exe - - net5.0 + + net6.0 - 5.0.0-preview.1.20120.5 + 6.0.0-alpha.1.20468.7 ``` @@ -140,11 +135,11 @@ make it self-contained by adding a RuntimeIdentifier (RID). ```XML Exe - - net5.0 + + net6.0 - - 5.0.0-preview.1.20120.5 + + 6.0.0-alpha.1.20468.7 win-x64 ``` @@ -152,95 +147,219 @@ make it self-contained by adding a RuntimeIdentifier (RID). ``` $ dotnet restore $ dotnet publish -$ bin\Debug\net5.0\win-x64\publish\App.exe -``` - -## More Advanced Scenario - Using your local CoreFx build - -If you built corefx locally with `build -allconfigurations` after building binaries it will build NuGet packages containing them. You can use those in your projects. - -To use your local built corefx packages you will need to be a self-contained application and so you will -need to follow the "Self-contained" steps from above. Once you can successfully restore, build, publish, -and run a self-contained application you need the following steps to consume your local built package. - -#### 1 - Get the Version number of the CoreFx package you built. - -Look for a package named `Microsoft.Private.CoreFx.NETCoreApp..nupkg` under `corefx\artifacts\packages\Debug` (or Release if you built a release version of corefx). - -Once you find the version number (for this example assume it is `4.6.0-dev.18626.1`) you need to add the following line to your project file: - +$ bin\Debug\net6.0\win-x64\publish\App.exe ``` - - - -``` - -Because assets in `Microsoft.Private.CoreFx.NETCoreApp` conflict with the normal `Microsoft.NETCore.App` package, -you need to tell the tooling to use the assets from your local package. To do this, add the following property to your project file: - -```xml - - Microsoft.Private.CoreFx.NETCoreApp;runtime.win-x64.Microsoft.Private.CoreFx.NETCoreApp;$(PackageConflictPreferredPackages) - -``` - -Replacing the RID (`win-x64` in this case) in `runtime.win-x64.Microsoft.Private.CoreFx.NETCoreApp` with the RID of your current build. - -Note these instructions above were only about updates to the binaries that are part of Microsoft.NETCore.App, if you want to test a package for library that ships in its own nuget package you can follow the same steps above but instead add a package reference to that package instead of "Microsoft.Private.CoreFx.NETCoreApp". -#### 2 - Add your bin directory to the Nuget feed list - -By default the dogfooding dotnet SDK will create a Nuget.Config file next to your project, if it doesn't -you can create one. Your config file will need a source for your local corefx package directory as well -as a reference to our nightly dotnet-core blob feed. The Nuget.Config file content should be: - -```xml - - - - - - -``` -Be sure to correct the path to your build output above. - -You also have the alternative of modifying the Nuget.Config -at `%HOMEPATH%\AppData\Roaming\Nuget\Nuget.Config` (Windows) or `~/.nuget/NuGet/NuGet.Config` (Linux) with the new location. -This will allow your new runtime to be used on any 'dotnet restore' run by the current user. -Alternatively you can skip creating this file and pass the path to your package directory using -the -s SOURCE qualifier on the dotnet restore command below. The important part is that somehow -you have told the tools where to find your new package. - -Once have made these modifications you will need to rerun the restore and publish as such. - -``` -dotnet restore -dotnet publish -``` -Now your publication directory should contain your local built CoreFx binaries. - -#### 3 - Consuming subsequent code changes by overwriting the binary (Alternative 1) - -To apply changes you subsequently make in your source tree, it's usually easiest to just overwrite the binary in the publish folder. Build the assembly containing your change as normal, then overwrite the assembly in your publish folder and running the app will pick up that binary. This relies on the fact that all the other binaries still match what is in your bin folder so everything works together. - -#### 3 - Consuming subsequent code changes by rebuilding the package (Alternative 2) - -This is more cumbersome than just overwriting the binaries, but is more correct. - -First note that Nuget assumes that distinct builds have distinct version numbers. -Thus if you modify the source and create a new NuGet package you must give it a new version number and use that in your -application's project. Otherwise the dotnet.exe tool will assume that the existing version is fine and you -won't get the updated bits. This is what the Minor Build number is all about. By default it is 0, but you can -give it a value by setting the BuildNumberMinor environment variable. -```bat - set BuildNumberMinor=3 -``` -before packaging. You should see this number show up in the version number (e.g. 4.6.0-dev.18626.1). - -Alternatively just delete the existing copy of the package from the Nuget cache. For example on -windows (on Linux substitute ~/ for %HOMEPATH%) you could delete -```bat - %HOMEPATH%\.nuget\packages\Microsoft.Private.CoreFx.NETCoreApp\4.6.0-dev.18626.1 - %HOMEPATH%\.nuget\packages\runtime.win-x64.microsoft.private.corefx.netcoreapp\4.6.0-dev.18626.1 -``` -which should make `dotnet restore` now pick up the new copy. +### Nightly builds table + + + + +| Platform | Master | +| --- | :---: | +| **Windows (x64)** | [![][win-x64-badge-6.0.X]][win-x64-version-6.0.X]
[Installer][win-x64-installer-6.0.X] ([Checksum][win-x64-installer-checksum-6.0.X])
[zip][win-x64-zip-6.0.X] ([Checksum][win-x64-zip-checksum-6.0.X])
[NetHost (zip)][win-x64-nethost-zip-6.0.X]
[Symbols (zip)][win-x64-symbols-zip-6.0.X] | +| **Windows (x86)** | [![][win-x86-badge-6.0.X]][win-x86-version-6.0.X]
[Installer][win-x86-installer-6.0.X] ([Checksum][win-x86-installer-checksum-6.0.X])
[zip][win-x86-zip-6.0.X] ([Checksum][win-x86-zip-checksum-6.0.X])
[NetHost (zip)][win-x86-nethost-zip-6.0.X]
[Symbols (zip)][win-x86-symbols-zip-6.0.X] | +| **Windows (arm64)** | [![][win-arm64-badge-6.0.X]][win-arm64-version-6.0.X]
[Installer][win-arm64-installer-6.0.X] ([Checksum][win-arm64-installer-checksum-6.0.X])
[zip][win-arm64-zip-6.0.X] ([Checksum][win-arm64-zip-checksum-6.0.X])
[NetHost (zip)][win-arm64-nethost-zip-6.0.X]
[Symbols (zip)][win-arm64-symbols-zip-6.0.X] | +| **macOS (x64)** | [![][osx-x64-badge-6.0.X]][osx-x64-version-6.0.X]
[Installer][osx-x64-installer-6.0.X] ([Checksum][osx-x64-installer-checksum-6.0.X])
[tar.gz][osx-x64-targz-6.0.X] ([Checksum][osx-x64-targz-checksum-6.0.X])
[NetHost (tar.gz)][osx-x64-nethost-targz-6.0.X]
[Symbols (tar.gz)][osx-x64-symbols-targz-6.0.X] | +| **macOS (arm64)** | [![][osx-arm64-badge-6.0.X]][osx-arm64-version-6.0.X]
[Installer][osx-arm64-installer-6.0.X] ([Checksum][osx-arm64-installer-checksum-6.0.X])
[tar.gz][osx-arm64-targz-6.0.X] ([Checksum][osx-arm64-targz-checksum-6.0.X])
[NetHost (tar.gz)][osx-arm64-nethost-targz-6.0.X]
[Symbols (tar.gz)][osx-arm64-symbols-targz-6.0.X] | +| **Linux (x64)** (for glibc based OS) | [![][linux-x64-badge-6.0.X]][linux-x64-version-6.0.X]
[tar.gz][linux-x64-targz-6.0.X] ([Checksum][linux-x64-targz-checksum-6.0.X])
[NetHost (tar.gz)][linux-x64-nethost-targz-6.0.X]
[Symbols (tar.gz)][linux-x64-symbols-targz-6.0.X] | +| **Linux (armhf)** (for glibc based OS) | [![][linux-arm-badge-6.0.X]][linux-arm-version-6.0.X]
[tar.gz][linux-arm-targz-6.0.X] ([Checksum][linux-arm-targz-checksum-6.0.X])
[NetHost (tar.gz)][linux-arm-nethost-targz-6.0.X]
[Symbols (tar.gz)][linux-arm-symbols-targz-6.0.X] | +| **Linux (arm64)** (for glibc based OS) | [![][linux-arm64-badge-6.0.X]][linux-arm64-version-6.0.X]
[tar.gz][linux-arm64-targz-6.0.X] ([Checksum][linux-arm64-targz-checksum-6.0.X])
[NetHost (tar.gz)][linux-arm64-nethost-targz-6.0.X]
[Symbols (tar.gz)][linux-arm64-symbols-targz-6.0.X] | +| **Linux-musl (x64)** | [![][linux-musl-x64-badge-6.0.X]][linux-musl-x64-version-6.0.X]
[tar.gz][linux-musl-x64-targz-6.0.X] ([Checksum][linux-musl-x64-targz-checksum-6.0.X])
[NetHost (tar.gz)][linux-musl-x64-nethost-targz-6.0.X]
[Symbols (tar.gz)][linux-musl-x64-symbols-targz-6.0.X] | +| **Linux-musl (arm)** | [![][linux-musl-arm-badge-6.0.X]][linux-musl-arm-version-6.0.X]
[tar.gz][linux-musl-arm-targz-6.0.X] ([Checksum][linux-musl-arm-targz-checksum-6.0.X])
[NetHost (tar.gz)][linux-musl-arm-nethost-targz-6.0.X]
[Symbols (tar.gz)][linux-musl-arm-symbols-targz-6.0.X] | +| **Linux-musl (arm64)** | [![][linux-musl-arm64-badge-6.0.X]][linux-musl-arm64-version-6.0.X]
[tar.gz][linux-musl-arm64-targz-6.0.X] ([Checksum][linux-musl-arm64-targz-checksum-6.0.X])
[NetHost (tar.gz)][linux-musl-arm64-nethost-targz-6.0.X]
[Symbols (tar.gz)][linux-musl-arm64-symbols-targz-6.0.X] | +| **Dpkg Based Systems (x64)** | [![][deb-badge-6.0.X]][deb-version-6.0.X]
[Runtime-Deps][deb-runtime-deps-6.0.X] ([Checksum][deb-runtime-deps-checksum-6.0.X])
[Host][deb-host-6.0.X] ([Checksum][deb-host-checksum-6.0.X])
[App Hosts][deb-apphost-pack-6.0.X] ([Checksum][deb-apphost-pack-checksum-6.0.X])
[Host FX Resolver][deb-hostfxr-6.0.X] ([Checksum][deb-hostfxr-checksum-6.0.X])
[Targeting Pack][deb-targeting-pack-6.0.X] ([Checksum][deb-targeting-pack-checksum-6.0.X])
[Shared Framework][deb-sharedfx-6.0.X] ([Checksum][deb-sharedfx-checksum-6.0.X]) | +| **CentOS 7 (x64)** | [![][centos-7-badge-6.0.X]][centos-7-version-6.0.X]
[Runtime-Deps][centos-7-runtime-deps-6.0.X] ([Checksum][centos-7-runtime-deps-checksum-6.0.X])
[Host][centos-7-host-6.0.X] ([Checksum][centos-7-host-checksum-6.0.X])
[App Hosts][centos-7-apphost-pack-6.0.X] ([Checksum][centos-7-apphost-pack-checksum-6.0.X])
[Host FX Resolver][centos-7-hostfxr-6.0.X] ([Checksum][centos-7-hostfxr-checksum-6.0.X])
[Targeting Pack][centos-7-targeting-pack-6.0.X] ([Checksum][centos-7-targeting-pack-checksum-6.0.X])
[Shared Framework][centos-7-sharedfx-6.0.X] ([Checksum][centos-7-sharedfx-checksum-6.0.X]) | +| **RHEL 7.2 (x64)** | [![][rhel7-badge-6.0.X]][rhel7-version-6.0.X]
[Host][rhel7-host-6.0.X] ([Checksum][rhel7-host-checksum-6.0.X])
[App Hosts][rhel7-apphost-pack-6.0.X] ([Checksum][rhel7-apphost-pack-checksum-6.0.X])
[Host FX Resolver][rhel7-hostfxr-6.0.X] ([Checksum][rhel7-hostfxr-checksum-6.0.X])
[Targeting Pack][rhel7-targeting-pack-6.0.X] ([Checksum][rhel7-targeting-pack-checksum-6.0.X])
[Shared Framework][rhel7-sharedfx-6.0.X] ([Checksum][rhel7-sharedfx-checksum-6.0.X]) | +| **Fedora 27 (x64)** | [![][fedora-27-badge-6.0.X]][fedora-27-version-6.0.X]
[Runtime-Deps][fedora-27-runtime-deps-6.0.X] ([Checksum][fedora-27-runtime-deps-checksum-6.0.X])
[Host][fedora-27-host-6.0.X] ([Checksum][fedora-27-host-checksum-6.0.X])
[App Hosts][fedora-27-apphost-pack-6.0.X] ([Checksum][fedora-27-apphost-pack-checksum-6.0.X])
[Host FX Resolver][fedora-27-hostfxr-6.0.X] ([Checksum][fedora-27-hostfxr-checksum-6.0.X])
[Targeting Pack][fedora-27-targeting-pack-6.0.X] ([Checksum][fedora-27-targeting-pack-checksum-6.0.X])
[Shared Framework][fedora-27-sharedfx-6.0.X] ([Checksum][fedora-27-sharedfx-checksum-6.0.X]) | +| **SLES 12 (x64)** | [![][sles-12-badge-6.0.X]][sles-12-version-6.0.X]
[Runtime-Deps][sles-12-runtime-deps-6.0.X] ([Checksum][sles-12-runtime-deps-checksum-6.0.X])
[Host][sles-12-host-6.0.X] ([Checksum][sles-12-host-checksum-6.0.X])
[App Hosts][sles-12-apphost-pack-6.0.X] ([Checksum][sles-12-apphost-pack-checksum-6.0.X])
[Host FX Resolver][sles-12-hostfxr-6.0.X] ([Checksum][sles-12-hostfxr-checksum-6.0.X])
[Targeting Pack][sles-12-targeting-pack-6.0.X] ([Checksum][sles-12-targeting-pack-checksum-6.0.X])
[Shared Framework][sles-12-sharedfx-6.0.X] ([Checksum][sles-12-sharedfx-checksum-6.0.X]) | +| **OpenSUSE 42 (x64)** | [![][OpenSUSE-42-badge-6.0.X]][OpenSUSE-42-version-6.0.X]
[Runtime-Deps][OpenSUSE-42-runtime-deps-6.0.X] ([Checksum][OpenSUSE-42-runtime-deps-checksum-6.0.X])
[Host][OpenSUSE-42-host-6.0.X] ([Checksum][OpenSUSE-42-host-checksum-6.0.X])
[App Hosts][OpenSUSE-42-apphost-pack-6.0.X] ([Checksum][OpenSUSE-42-apphost-pack-checksum-6.0.X])
[Host FX Resolver][OpenSUSE-42-hostfxr-6.0.X] ([Checksum][OpenSUSE-42-hostfxr-checksum-6.0.X])
[Targeting Pack][OpenSUSE-42-targeting-pack-6.0.X] ([Checksum][OpenSUSE-42-targeting-pack-checksum-6.0.X])
[Shared Framework][OpenSUSE-42-sharedfx-6.0.X] ([Checksum][OpenSUSE-42-sharedfx-checksum-6.0.X]) | + + + +*Note: Our Linux packages (.deb and .rpm) are put together slightly differently than the Windows and Mac specific installers. Instead of combining everything, we have separate component packages that depend on each other. If you're installing these directly from the installer files (via dpkg or similar), then you'll need to install them in the order presented above.* + + + +[win-x64-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_win-x64_Release_version_badge.svg?no-cache +[win-x64-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[win-x64-installer-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-x64.exe +[win-x64-installer-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-x64.exe.sha512 +[win-x64-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-x64.zip +[win-x64-zip-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-x64.zip.sha512 +[win-x64-nethost-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-win-x64.zip +[win-x64-symbols-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-win-x64.zip + +[win-x86-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_win-x86_Release_version_badge.svg?no-cache +[win-x86-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[win-x86-installer-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-x86.exe +[win-x86-installer-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-x86.exe.sha512 +[win-x86-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-x86.zip +[win-x86-zip-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-x86.zip.sha512 +[win-x86-nethost-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-win-x86.zip +[win-x86-symbols-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-win-x86.zip + +[win-arm64-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_win-arm64_Release_version_badge.svg?no-cache +[win-arm64-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[win-arm64-installer-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-arm64.exe +[win-arm64-installer-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-arm64.exe.sha512 +[win-arm64-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-arm64.zip +[win-arm64-zip-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-win-arm64.zip.sha512 +[win-arm64-nethost-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-win-arm64.zip +[win-arm64-symbols-zip-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-win-arm64.zip + +[osx-x64-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_osx-x64_Release_version_badge.svg?no-cache +[osx-x64-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[osx-x64-installer-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-osx-x64.pkg +[osx-x64-installer-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-osx-x64.pkg.sha512 +[osx-x64-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-osx-x64.tar.gz +[osx-x64-targz-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-osx-x64.tar.gz.sha512 +[osx-x64-nethost-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-osx-x64.tar.gz +[osx-x64-symbols-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-osx-x64.tar.gz + +[osx-arm64-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_osx-arm64_Release_version_badge.svg?no-cache +[osx-arm64-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[osx-arm64-installer-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-osx-arm64.pkg +[osx-arm64-installer-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-osx-arm64.pkg.sha512 +[osx-arm64-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-osx-arm64.tar.gz +[osx-arm64-targz-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-osx-arm64.tar.gz.sha512 +[osx-arm64-nethost-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-osx-arm64.tar.gz +[osx-arm64-symbols-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-osx-arm64.tar.gz + +[linux-x64-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_linux-x64_Release_version_badge.svg?no-cache +[linux-x64-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[linux-x64-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-x64.tar.gz +[linux-x64-targz-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-x64.tar.gz.sha512 +[linux-x64-nethost-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-linux-x64.tar.gz +[linux-x64-symbols-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-linux-x64.tar.gz + +[linux-arm-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_linux-arm_Release_version_badge.svg?no-cache +[linux-arm-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[linux-arm-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-arm.tar.gz +[linux-arm-targz-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-arm.tar.gz.sha512 +[linux-arm-nethost-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-linux-arm.tar.gz +[linux-arm-symbols-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-linux-arm.tar.gz + +[linux-arm64-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_linux-arm64_Release_version_badge.svg?no-cache +[linux-arm64-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[linux-arm64-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-arm64.tar.gz +[linux-arm64-targz-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-arm64.tar.gz.sha512 +[linux-arm64-nethost-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-linux-arm64.tar.gz +[linux-arm64-symbols-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-linux-arm64.tar.gz + +[deb-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_ubuntu.14.04-x64_Release_version_badge.svg?no-cache +[deb-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[deb-apphost-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.deb +[deb-apphost-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.deb.sha512 +[deb-host-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.deb +[deb-runtime-deps-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-x64.deb +[deb-runtime-deps-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-x64.deb.sha512 +[deb-host-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.deb.sha512 +[deb-hostfxr-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.deb +[deb-hostfxr-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.deb.sha512 +[deb-sharedfx-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.deb +[deb-sharedfx-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.deb.sha512 +[deb-targeting-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.deb +[deb-targeting-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.deb.sha512 + +[rhel7-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_rhel.7-x64_Release_version_badge.svg?no-cache +[rhel7-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[rhel7-runtime-deps-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-centos.7-x64.rpm +[rhel7-runtime-deps-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-centos.7-x64.rpm.sha512 +[rhel7-apphost-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm +[rhel7-apphost-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm.sha512 +[rhel7-host-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm +[rhel7-host-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm.sha512 +[rhel7-hostfxr-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm +[rhel7-hostfxr-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm.sha512 +[rhel7-sharedfx-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm +[rhel7-sharedfx-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm.sha512 +[rhel7-targeting-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm +[rhel7-targeting-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm.sha512 + +[centos-7-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_centos.7-x64_Release_version_badge.svg?no-cache +[centos-7-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[centos-7-runtime-deps-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-centos.7-x64.rpm +[centos-7-runtime-deps-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-centos.7-x64.rpm.sha512 +[centos-7-apphost-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm +[centos-7-apphost-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm.sha512 +[centos-7-host-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm +[centos-7-host-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm.sha512 +[centos-7-hostfxr-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm +[centos-7-hostfxr-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm.sha512 +[centos-7-sharedfx-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm +[centos-7-sharedfx-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm.sha512 +[centos-7-targeting-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm +[centos-7-targeting-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm.sha512 + +[fedora-27-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_fedora.27-x64_Release_version_badge.svg?no-cache +[fedora-27-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[fedora-27-runtime-deps-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-fedora.27-x64.rpm +[fedora-27-runtime-deps-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-fedora.27-x64.rpm.sha512 +[fedora-27-apphost-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm +[fedora-27-apphost-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm.sha512 +[fedora-27-host-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm +[fedora-27-host-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm.sha512 +[fedora-27-hostfxr-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm +[fedora-27-hostfxr-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm.sha512 +[fedora-27-sharedfx-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm +[fedora-27-sharedfx-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm.sha512 +[fedora-27-targeting-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm +[fedora-27-targeting-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm.sha512 + +[sles-12-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_sles.12-x64_Release_version_badge.svg?no-cache +[sles-12-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[sles-12-runtime-deps-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-sles.12-x64.rpm +[sles-12-runtime-deps-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-sles.12-x64.rpm.sha512 +[sles-12-apphost-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm +[sles-12-apphost-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm.sha512 +[sles-12-host-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm +[sles-12-host-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm.sha512 +[sles-12-hostfxr-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm +[sles-12-hostfxr-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm.sha512 +[sles-12-sharedfx-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm +[sles-12-sharedfx-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm.sha512 +[sles-12-targeting-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm +[sles-12-targeting-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm.sha512 + +[OpenSUSE-42-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_opensuse.42-x64_Release_version_badge.svg?no-cache +[OpenSUSE-42-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[OpenSUSE-42-runtime-deps-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-opensuse.42-x64.rpm +[OpenSUSE-42-runtime-deps-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-deps-opensuse.42-x64.rpm.sha512 +[OpenSUSE-42-apphost-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm +[OpenSUSE-42-apphost-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-apphost-pack-x64.rpm.sha512 +[OpenSUSE-42-host-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm +[OpenSUSE-42-host-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-host-x64.rpm.sha512 +[OpenSUSE-42-hostfxr-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm +[OpenSUSE-42-hostfxr-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-hostfxr-x64.rpm.sha512 +[OpenSUSE-42-sharedfx-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm +[OpenSUSE-42-sharedfx-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-x64.rpm.sha512 +[OpenSUSE-42-targeting-pack-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm +[OpenSUSE-42-targeting-pack-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-targeting-pack-x64.rpm.sha512 + +[linux-musl-x64-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_linux-musl-x64_Release_version_badge.svg?no-cache +[linux-musl-x64-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[linux-musl-x64-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-musl-x64.tar.gz +[linux-musl-x64-targz-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-musl-x64.tar.gz.sha512 +[linux-musl-x64-nethost-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-linux-musl-x64.tar.gz +[linux-musl-x64-symbols-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-linux-musl-x64.tar.gz + +[linux-musl-arm-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_linux-musl-arm_Release_version_badge.svg?no-cache +[linux-musl-arm-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[linux-musl-arm-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-musl-arm.tar.gz +[linux-musl-arm-targz-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-musl-arm.tar.gz.sha512 +[linux-musl-arm-nethost-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-linux-musl-arm.tar.gz +[linux-musl-arm-symbols-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-linux-musl-arm.tar.gz + +[linux-musl-arm64-badge-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/sharedfx_linux-musl-arm64_Release_version_badge.svg?no-cache +[linux-musl-arm64-version-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/productVersion.txt +[linux-musl-arm64-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-musl-arm64.tar.gz +[linux-musl-arm64-targz-checksum-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-linux-musl-arm64.tar.gz.sha512 +[linux-musl-arm64-nethost-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-nethost-linux-musl-arm64.tar.gz +[linux-musl-arm64-symbols-targz-6.0.X]: https://aka.ms/dotnet/net6/dev/Runtime/dotnet-runtime-symbols-linux-musl-arm64.tar.gz + + diff --git a/docs/project/glossary.md b/docs/project/glossary.md index f69d3749938b..c1b6b687354b 100644 --- a/docs/project/glossary.md +++ b/docs/project/glossary.md @@ -24,7 +24,7 @@ terminology. | JIT | [Just-in-Time](https://github.com/dotnet/runtime/blob/master/docs/design/coreclr/jit/ryujit-overview.md) compiler. RyuJIT is the code name for the next generation Just-in-Time(aka "JIT") for the .NET runtime. | | LCG | Lightweight Code Generation. An early name for [dynamic methods](https://github.com/dotnet/runtime/blob/master/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs). | | MD | MetaData. | -| MDA | Managed Debugging Assistant - see [details](https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/diagnosing-errors-with-managed-debugging-assistants) (Note: Not in .NET Core, equivalent diagnostic functionality is made available on a case-by-case basis, e.g. [#15465](https://github.com/dotnet/coreclr/issues/15465)) | +| MDA | Managed Debugging Assistant - see [details](https://docs.microsoft.com/en-us/dotnet/framework/debug-trace-profile/diagnosing-errors-with-managed-debugging-assistants) (Note: Not in .NET Core, equivalent diagnostic functionality is made available on a case-by-case basis, e.g. [#9418](https://github.com/dotnet/runtime/issues/9418)) | | NGen | Native Image Generator. | | NYI | Not Yet Implemented. | | PAL | [Platform Adaptation Layer](http://archive.oreilly.com/pub/a/dotnet/2002/03/04/rotor.html). Provides an abstraction layer between the runtime and the operating system. | diff --git a/docs/project/jit-testing.md b/docs/project/jit-testing.md index 6d127bc705cc..01be1b927e37 100644 --- a/docs/project/jit-testing.md +++ b/docs/project/jit-testing.md @@ -69,9 +69,9 @@ moving these. We need to ensure that the CoreCLR repo contains a suitably hookable test script. Core testing is driven by xunit but there's typically a -wrapper around this (runtest.cmd today) to facilitate test execution. +wrapper around this (run.cmd today) to facilitate test execution. -The proposal is to implement platform-neutral variant of runtest.cmd that +The proposal is to implement platform-neutral variant of run.cmd that contains all the existing functionality plus some additional capabilities for JIT testing. Initially this will mean: diff --git a/docs/project/library-servicing.md b/docs/project/library-servicing.md index 29934d1606f1..0347adacc9c2 100644 --- a/docs/project/library-servicing.md +++ b/docs/project/library-servicing.md @@ -1,22 +1,22 @@ -# How to service a library in CoreFx +# How to service a library -This document provides the steps necessary after modifying a CoreFx library in a servicing branch (where "servicing branch" refers to any branch whose name begins with `release/`). +This document provides the steps necessary after modifying a library in a servicing branch (where "servicing branch" refers to any branch whose name begins with `release/`). ## Check for existence of a .pkgproj -Most CoreFx libraries are not packaged by default. Some libraries have their output packaged in `Microsoft.Private.CoreFx.NetCoreApp`, which is always built, while other libraries have their own specific packages, which are only built on-demand. Your first step is to determine whether or not your library has its own package. To do this, go into the root folder for the library you've made changes to. If there is a `pkg` folder there (which should have a `.pkgproj` file inside of it), your library does have its own package. If there is no `pkg` folder there, the library should be built as part of `Microsoft.Private.CoreFx.NetCoreApp` and shipped as part of `Microsoft.NetCore.App`. To confirm this, check for the `IsNETCoreApp` property being set to `true` in the library's `Directory.Build.props` (or dir.props). If it is, then there is nothing that needs to be done. If it's not, contact a member of the servicing team for guidance, as this situation goes against our convention. +Your first step is to determine whether or not your library has its own package. To do this, go into the root folder for the library you've made changes to. If there is a `pkg` folder there (which should have a `.pkgproj` file inside of it), your library does have its own package. If there is no `pkg` folder there, the library is the part of the shared framework. If it is, then there is nothing that needs to be done. -For example, if you made changes to [System.Data.SqlClient](https://github.com/dotnet/runtime/tree/master/src/libraries/Microsoft.Win32.Registry), then you have a .pkgproj, and will have to follow the steps in this document. However, if you made changes to [System.Collections](https://github.com/dotnet/runtime/tree/master/src/libraries/System.Collections), then you don't have a .pkgproj, and you do not need to do any further work for servicing. +For example, if you made changes to [Microsoft.Win32.Primitives](https://github.com/dotnet/runtime/tree/master/src/libraries/Microsoft.Win32.Primitives), then you have a `.pkgproj`, and will have to follow the steps in this document. However, if you made changes to [System.Collections](https://github.com/dotnet/runtime/tree/master/src/libraries/System.Collections), then you don't have a `.pkgproj`, and you do not need to do any further work for servicing. ## Determine PackageVersion -Each package has a property called `PackageVersion`. When you make a change to a library & ship it, the `PackageVersion` must be bumped. This property could either be in one of two places inside your library's source folder: `Directory.Build.Props` (or dir.props), or the `.pkgproj`. It's also possible that the property is in neither of those files, in which case we're using the default version from [Packaging.props](https://github.com/dotnet/runtime/blob/master/eng/packaging.props#L25) (IMPORTANT - make sure to check the default version from the branch that you're making changes to, not from master). You'll need to increment this package version. If the property is already present in your library's source folder, just increment the patch version by 1 (e.g. `4.6.0` -> `4.6.1`). If it's not present, add it to the library's `Directory.Build.props` (or dir.props), where it is equal to the version in `Packaging.props`, with the patch version incremented by 1. +Each package has a property called `PackageVersion`. When you make a change to a library & ship it, the `PackageVersion` must be bumped. This property could either be in one of two places inside your library's source folder: `Directory.Build.Props` (or dir.props), or the `.pkgproj`. It's also possible that the property is in neither of those files, in which case we're using the default version from [Packaging.props](https://github.com/dotnet/runtime/blob/master/eng/packaging.props#L25) (IMPORTANT - make sure to check the default version from the branch that you're making changes to, not from master). You'll need to increment this package version. If the property is already present in your library's source folder, just increment the patch version by 1 (e.g. `4.6.0` -> `4.6.1`). If it's not present, add it to the library's `Directory.Build.props`, where it is equal to the version in `Packaging.props`, with the patch version incremented by 1. Note that it's possible that somebody else has already incremented the package version since our last release. If this is the case, you don't need to increment it yourself. To confirm, check [Nuget.org](https://www.nuget.org/) to see if there is already a published version of your package with the same package version. If so, the `PackageVersion` must be incremented. If not, there's still a possibility that the version should be bumped, in the event that we've already built the package with its current version in an official build, but haven't released it publicly yet. If you see that the `PackageVersion` has been changed in the last 1-2 months, but don't see a matching package in Nuget.org, contact somebody on the servicing team for guidance. ## Determine AssemblyVersion -Each library has a property called `AssemblyVersion` which will be in either the library `.csproj` or in `Directory.Build.Props` (or dir.props). For servcing events you will want to increment the revision by 1 (e.g `4.0.0.0` -> `4.0.0.1`) in the library's `Directory.Build.Props` (or dir.props) if the library ships in its own package and has an asset that is applicable to .NET Framework. To determine if it applies to .NET Framework you should check to see if there are any `netstandard` or `net4x` configurations in the ref and/or src project, if there are then it has assets that apply. +Each library has a property called `AssemblyVersion` which will be in either the library `.csproj` or in `Directory.Build.Props`. For servicing events you will want to increment the revision by 1 (e.g `4.0.0.0` -> `4.0.0.1`) in the library's `Directory.Build.Props` if the library ships in its own package and has an asset that is applicable to .NET Framework. To determine if it applies to .NET Framework you should check to see if there are any `netstandard` or `net4x` configurations in the ref and/or src project, if there are then it has assets that apply. The reason we need to increment the assembly version for things running on .NET Framework is because of the way binding works there. If there are two assemblies with the same assembly version the loader will essentially pick the first one it finds and use that version so applications don't have full control over using the later build with a particular fix included. This is worse if someone puts the older assembly in the GAC as the GAC will always win for matching assembly versions so an application couldn't load the newer one because it has the same assembly version. @@ -47,3 +47,7 @@ All that's left is to ensure that your changes have worked as expected. To do so 3. Try installing the built package in a test application, testing that your changes to the library are present & working as expected. To install your package add your local packages folder as a feed source in VS or your nuget.config and then add a PackageReference to the specific version of the package you built then try using the APIs. + +## Approval Process + +All the servicing change must go through an approval process. Please create your PR using [this template](https://github.com/dotnet/runtime/compare/template?expand=1&template=servicing_pull_request_template.md). You should also add `servicing-consider` label to the pull request and bring it to the attention of the engineering lead responsible for the area. diff --git a/docs/project/linux-performance-tracing.md b/docs/project/linux-performance-tracing.md index 2899d7e683a2..ff70c266acec 100644 --- a/docs/project/linux-performance-tracing.md +++ b/docs/project/linux-performance-tracing.md @@ -1,4 +1,4 @@ -Performance Tracing on Linux +Performance Tracing on Linux ============================ When a performance problem is encountered on Linux, these instructions can be used to gather detailed information about what was happening on the machine at the time of the performance problem. @@ -260,7 +260,7 @@ dotnet tool install --global dotnet-trace ## Collecting a trace ## To see which .NET processes are available for collecting traces on, you can run the following command to get their process IDs (PID): ``` -dotnet-trace list-processes +dotnet-trace ps ``` Once you know the PID of the process you want to collect traces, you can run the following command to start tracing: diff --git a/docs/project/list-of-obsoletions.md b/docs/project/list-of-obsoletions.md index 3b7d6696c62d..0b23c097979f 100644 --- a/docs/project/list-of-obsoletions.md +++ b/docs/project/list-of-obsoletions.md @@ -24,3 +24,4 @@ Currently the identifiers `SYSLIB0001` through `SYSLIB0999` are carved out for o | __`SYSLIB0009`__ | The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException. | | __`SYSLIB0010`__ | This Remoting API is not supported and throws PlatformNotSupportedException. | | __`SYSLIB0011`__ | `BinaryFormatter` serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for recommended alternatives. | +| __`SYSLIB0012`__ | Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead. | diff --git a/docs/project/performance-guidelines.md b/docs/project/performance-guidelines.md index d2cee51456f8..c3fe57a9c865 100644 --- a/docs/project/performance-guidelines.md +++ b/docs/project/performance-guidelines.md @@ -34,30 +34,14 @@ A microbenchmark is an application that executes a specific codepath multiple ti - **DO** run many iterations of the code in question to filter out noise. - **DO** minimize the effects of other applications on the performance of the microbenchmark by closing as many unnecessary applications as possible. +The microbenchmarks used to test the performance of all .NET Runtimes live in [dotnet/performance repository](https://github.com/dotnet/performance/tree/master/src/benchmarks/micro). The benchmarking workflow is described [here](https://github.com/dotnet/performance/blob/master/docs/benchmarking-workflow-dotnet-runtime.md). + # Profiling and Performance Tracing # Measuring performance is an important part of ensuring that changes do not regress the performance of a feature or scenario. Using a profiler allows you to run an existing workload without adding tracing statements or otherwise modifying it, and at the same time, get rich information on how the workload performs. -On the .NET team, we use a tool called **PerfView**, which runs on Windows, and allows for collection of performance data across an entire machine. - -Capturing a trace using PerfView will allow you to: - -- Investigate CPU usage and blocked time. -- Understand the performance of various runtime services (GC, JIT, etc.) -- Compare the performance of a workload by diffing before and after traces. -- Much, much more. - -PerfView is available at the [PerfView repo](https://github.com/microsoft/perfview/releases). The help documentation is quite substantial and can help you get started. Clicking the blue links throughout PerfView's UI will also take you to the appropriate help topic. It is also recommended that you watch the [PerfView Tutorial Videos](http://channel9.msdn.com/Series/PerfView-Tutorial). - -# Running the CoreCLR Performance Tests on Windows # -1. The first step to running the performance tests locally is to do a release build of CoreCLR and all of the performance tests. You can do this with the command `build.cmd x64 Release`, this will of course build the x64 runtime, and you should use x86 if you want to test x86. - -2. After building the runtime you will need to generate a core root that contains all of the binaries we just built along with the required dependencies. This can be done with the command `tests\runtest.cmd Release x64 GenerateLayoutOnly`, with the same caveat that x86 should be used if that is the platform that you are testing. - -3. Now we need to actually run the performance tests. The performance tests live in the [dotnet/performance](https://github.com/dotnet/performance) repo. Instructions for running them are [here](https://github.com/dotnet/performance/blob/master/docs/benchmarking-workflow-dotnet-runtime.md). - -4. Navigate to the `sandbox` directory in the root of your repo. Inside that directory you will find a bunch of files that follow the name Perf-*.md. These will contain the results, formatted as Markdown files, for each test that was run. +The profiling workflow is described [here](https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-dotnet-runtime.md). # Additional Help # If you have questions, run into any issues, or would like help with any performance related topics, please feel free to post a question. Someone from the .NET performance team will be happy to help. diff --git a/docs/project/profiling-api-status.md b/docs/project/profiling-api-status.md index a9279b69d428..5e649414cea8 100644 --- a/docs/project/profiling-api-status.md +++ b/docs/project/profiling-api-status.md @@ -20,7 +20,7 @@ ReJIT feature is only available on x86/x64 for now. ### Profiler Attach/Detach -We only support launch at the moment, see https://github.com/dotnet/coreclr/issues/16796 +We only support launch at the moment, see https://github.com/dotnet/runtime/issues/9886 ### Any issues we missed? diff --git a/docs/project/strong-name-signing.md b/docs/project/strong-name-signing.md index c082df374305..269bb102c4ad 100644 --- a/docs/project/strong-name-signing.md +++ b/docs/project/strong-name-signing.md @@ -10,7 +10,7 @@ All .NET Core assemblies are [strong-named](https://docs.microsoft.com/en-us/dot ## FAQ ### 1. Microsoft strong-names their assemblies, should I? -For the most part, the majority of applications do not need strong-names. Strong-names are left over from previous eras of .NET where [sandboxing](https://en.wikipedia.org/wiki/Sandbox_(computer_security)) needed to differentiate between code that was trusted, versus code that was untrusted. However in recent years, sandboxing via AppDomains, especially to [isolate ASP.NET web applications](https://support.microsoft.com/en-us/help/2698981/asp-net-partial-trust-does-not-guarantee-application-isolation), is no longer guaranteed and is not recommended. +For the most part, the majority of applications do not need strong-names. Strong-names are left over from previous eras of .NET where [sandboxing](https://en.wikipedia.org/wiki/Sandbox_(computer_security)) needed to differentiate between code that was trusted, versus code that was untrusted. However in recent years, sandboxing via AppDomains, especially to [isolate ASP.NET web applications](https://support.microsoft.com/en-us/help/2698981/asp-net-partial-trust-does-not-guarantee-application-isolation), is no longer guaranteed and is not recommended. However, strong-names are still required in applications in some rare situations, most of which are called out on this page: [Strong-Named Assemblies](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/strong-named-assemblies). @@ -21,6 +21,6 @@ There are three major problems that developers run into after strong naming thei 1. _Binding Policy_. When developers talk about strong-names, they are usually conflating it with the strict binding policy of the .NET Framework that kicks in _when_ you strong-name. This binding policy is problematic because it forces, by default, an exact match between reference and version, and requires developers to author complex [binding redirects](https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/bindingredirect-element) when they don't. In recent versions of Visual Studio, however, we've added [Automatic Binding Redirection](https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection) as an attempt to reduce pain of this policy on developers. On top of this, all newer platforms, including _Silverlight_, _WinRT-based platforms_ (Phone and Store), _.NET Native_ and _ASP.NET 5_ this policy has been loosened, allowing later versions of an assembly to satisfy earlier references, thereby completely removing the need to ever write binding redirects on those platforms. -2. _Virality_. Once you've strong-named an assembly, you can only statically reference other strong-named assemblies. +2. _Virality_. Once you've strong-named an assembly, you can only statically reference other strong-named assemblies. 3. _No drop-in replacement_. This is a problem for open source libraries where the strong-name private key is not checked into the repository. This means that developers are unable to build to their own version of the library and then use it as a drop-in replacement without recompiling _all_ consuming libraries up stack to pick up the new identity. This is extremely problematic for libraries, such as Json.NET, which have large incoming dependencies. Firstly, we would recommend that these open source projects check-in their private key (remember, [strong-names are used for identity, and not for security](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/strong-named-assemblies)). Failing that, however, we've introduced a new concept called [Public Signing](public-signing.md) that enables developers to build drop-in replacements without needing access to the strong-name private key. This is the mechanism that .NET Core libraries use by default. diff --git a/docs/project/versioning.md b/docs/project/versioning.md index ab5b027397e2..728195b10845 100644 --- a/docs/project/versioning.md +++ b/docs/project/versioning.md @@ -57,4 +57,4 @@ The version we produce by our calculations is mainly used in two places: - As the [Assembly File Version](https://msdn.microsoft.com/en-us/library/51ket42z(v=vs.110).aspx) - As the packages version number -To get more information on where are we doing the calculations for the versioning, you can [click here](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.Build.Tasks/PackageFiles/versioning.targets) to find the targets file where we create the versioning assets, and [here](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.Build.Tasks/GenerateCurrentVersion.cs) to see the code on where we calculate BuildNumberMajor and BuildNumberMinor. \ No newline at end of file +To get more information on where are we doing the calculations for the versioning, you can [click here](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.Build.Tasks/PackageFiles/versioning.targets) to find the targets file where we create the versioning assets, and [here](https://github.com/dotnet/buildtools/blob/master/src/Microsoft.DotNet.Build.Tasks/GenerateCurrentVersion.cs) to see the code on where we calculate BuildNumberMajor and BuildNumberMinor. diff --git a/docs/project/windows-performance-tracing.md b/docs/project/windows-performance-tracing.md deleted file mode 100644 index 04fab29feca9..000000000000 --- a/docs/project/windows-performance-tracing.md +++ /dev/null @@ -1,14 +0,0 @@ -Performance Tracing on Windows -===================================== - -Performance tracing on Windows is done using the PerfView, which can be downloaded at . - -PerfView has significant documentation built-in, which includes: - -- Getting started help. -- Collection and investigation walk-through videos. -- An extensive users guide. - -To get started, download PerfView and use the links on the main screen to get help. - -If you have specific questions, please post them in an issue here. \ No newline at end of file diff --git a/docs/project/writing-tests.md b/docs/project/writing-tests.md index f2984f020b7b..dd66fc96cd2b 100644 --- a/docs/project/writing-tests.md +++ b/docs/project/writing-tests.md @@ -56,7 +56,7 @@ public async Task Headers_SetAfterRequestSubmitted_ThrowsInvalidOperationExcepti ``` # OuterLoop -This one is fairly simple but often used incorrectly. When running tests which depend on outside influences like e.g. Hardware (Internet, SerialPort, ...) and you can't mitigate these dependencies, you might consider using the `[OuterLoop]` attribute for your test. +This one is fairly simple but often used incorrectly. When running tests which depend on outside influences like e.g. Hardware (Internet, SerialPort, ...) and you can't mitigate these dependencies, you might consider using the `[OuterLoop]` attribute for your test. With this attribute, tests are executed in a dedicated CI loop and won't break the default CI loops which get created when you submit a PR. To run OuterLoop tests locally you need to set the msbuild property "OuterLoop" to true: `/p:OuterLoop=true`. To run OuterLoop tests in CI you need to mention dotnet-bot and identify the tests you want to run. See `@dotnet-bot help` for the exact loop names. diff --git a/docs/workflow/README.md b/docs/workflow/README.md index 7a17fecd50ef..25b9f3f877d9 100644 --- a/docs/workflow/README.md +++ b/docs/workflow/README.md @@ -40,9 +40,13 @@ On Unix like systems, arguments can be passed in with a single `-` or double hyp The repository currently consists of different major parts: the runtimes, the libraries, and the installer. To build just one part you use the root build script (build.cmd/sh), and you add the `-subset` flag. +## Editing and Debugging + +For instructions on how to edit code and debug your changes, see [Editing and Debugging](editing-and-debugging.md). + ## Configurations -You may need to build the tree in a combination of configurations. This section explains why. +You may need to build the tree in a combination of configurations. This section explains why. A quick reminder of some concepts -- see the [glossary](../project/glossary.md) for more on these: @@ -51,7 +55,7 @@ A quick reminder of some concepts -- see the [glossary](../project/glossary.md) * **Release Configuration** -- Optimized code. Asserts are disabled. Runs at the best speed, and suitable for performance profiling. You will have limited debugging experience. When we talk about mixing configurations, we're discussing the following sub-components: - + * **Runtime** is the execution engine for managed code and there are two different implementations available. Both are written in C/C++, therefore, easier to debug when built in a Debug configuration. * CoreCLR is the comprehensive execution engine which if build in Debug Configuration it executes managed code very slowly. For example, it will take a long time to run the managed code unit tests. The code lives under [src/coreclr](../../src/coreclr). * Mono is portable and also slimmer runtime and it's not that sensitive to Debug Configuration for running managed code. You will still need to build it without optimizations to have good runtime debugging experience though. The code lives under [src/mono](../../src/mono). diff --git a/docs/workflow/building/coreclr/README.md b/docs/workflow/building/coreclr/README.md index c00d90a9799a..d74a7ad3b739 100644 --- a/docs/workflow/building/coreclr/README.md +++ b/docs/workflow/building/coreclr/README.md @@ -22,6 +22,15 @@ CoreCLR also supports a 'checked' build type which has asserts enabled like 'deb ./build.sh -subset clr -configuration checked ``` +If you want to use Ninja to drive the native build instead of Visual Studio MSBuild (on Windows) or Make (on non-Windows), you can pass the `-ninja` flag to the build script as follows: +``` +./build.cmd -subset clr -ninja +``` + +We recommend using Ninja for building the project on Windows since it more efficiently uses the build machine's resources for the native runtime build in comparison to Visual Studio's MSBuild. + +To pass extra compiler/linker flags to the coreclr build, set the environment variables `EXTRA_CFLAGS`, `EXTRA_CXXFLAGS` and `EXTRA_LDFLAGS` as needed. Don't set `CFLAGS`/`CXXFLAGS`/`LDFLAGS` directly as that might lead to configure-time tests failing. + This will produce outputs as follows: - Product binaries will be dropped in `artifacts\bin\coreclr\..` folder. diff --git a/docs/workflow/building/coreclr/freebsd-instructions.md b/docs/workflow/building/coreclr/freebsd-instructions.md index 49c29f49deff..ef31a0b4d215 100644 --- a/docs/workflow/building/coreclr/freebsd-instructions.md +++ b/docs/workflow/building/coreclr/freebsd-instructions.md @@ -10,7 +10,7 @@ These instructions are written assuming FreeBSD 10.1-RELEASE, since that's the r These instructions assume you use the binary package tool `pkg` (analog to `apt-get` or `yum` on Linux) to install the environment. Compiling the dependencies from source using the ports tree might work too, but is untested. -Minimum RAM required to build is 1GB. The build is known to fail on 512 MB VMs ([Issue 536](https://github.com/dotnet/coreclr/issues/536)). +Minimum RAM required to build is 1GB. The build is known to fail on 512 MB VMs ([Issue 4069](https://github.com/dotnet/runtime/issues/4069)). Toolchain Setup --------------- @@ -166,7 +166,7 @@ Download NuGet Packages With Mono and NuGet in hand, you can use NuGet to get the required dependencies. -Make a `packages.config` file with the following text. These are the required dependencies of this particular app. Different apps will have different dependencies and require a different `packages.config` - see [Issue #480](https://github.com/dotnet/coreclr/issues/480). +Make a `packages.config` file with the following text. These are the required dependencies of this particular app. Different apps will have different dependencies and require a different `packages.config` - see [Issue #4053](https://github.com/dotnet/runtime/issues/4053). ```xml @@ -198,7 +198,7 @@ And restore your packages.config file: janhenke@freebsd-frankfurt:~/coreclr-demo/packages % mono nuget.exe restore -Source https://www.myget.org/F/dotnet-corefx/ -PackagesDirectory . ``` -NOTE: This assumes you already installed the default CA certs. If you have problems downloading the packages please see [Issue #602](https://github.com/dotnet/coreclr/issues/602#issuecomment-88203778). The command for FreeBSD is: +NOTE: This assumes you already installed the default CA certs. If you have problems downloading the packages please see [Issue #4089](https://github.com/dotnet/runtime/issues/4089#issuecomment-88203778). The command for FreeBSD is: ```sh janhenke@freebsd-frankfurt:~/coreclr-demo/packages % mozroots --import --sync diff --git a/docs/workflow/building/coreclr/linux-instructions.md b/docs/workflow/building/coreclr/linux-instructions.md index 30bfb72f9d71..674465b871e8 100644 --- a/docs/workflow/building/coreclr/linux-instructions.md +++ b/docs/workflow/building/coreclr/linux-instructions.md @@ -53,7 +53,7 @@ This table of images might often become stale as we change our images as our req | Alpine | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.9-WithNode-0fc54a3-20190918214015` | - | -clang9 | | CentOS 7 (build for RHEL 7) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-359e48e-20200313130914` | - | -clang9 | | Ubuntu 16.04 | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-20200413125008-09ec757` | `/crossrootfs/arm` | -clang9 | -| Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-20200413125008-cfdd435` | `/crossrootfs/arm64` | -clang9 | +| Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-20201022204150-b2c2436` | `/crossrootfs/arm64` | -clang9 | | Alpine | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-20200413125008-406629a` | `/crossrootfs/arm64` | -clang5.0 | Environment @@ -91,7 +91,7 @@ The Core_Root folder will contain the built binaries, generated by `build.sh`, a the libraries subset (`-subset libs`) before this command can be run. ``` -./src/coreclr/build-test.sh generatelayoutonly +./src/tests/build.sh generatelayoutonly ``` After the build is complete you will find the output in the `artifacts/tests/coreclr/Linux.x64.Debug/Tests/Core_Root` folder. @@ -99,7 +99,7 @@ After the build is complete you will find the output in the `artifacts/tests/cor Running a single test =================== -After `src/coreclr/build-test.sh` is run, `corerun` from the Core_Root folder is ready to be run. This can be done by using the full absolute path to `corerun`, or by setting an environment variable to the Core_Root folder. +After `src/tests/build.sh` is run, `corerun` from the Core_Root folder is ready to be run. This can be done by using the full absolute path to `corerun`, or by setting an environment variable to the Core_Root folder. ```sh export CORE_ROOT=/runtime/artifacts/tests/coreclr/Linux.x64.Debug/Tests/Core_Root diff --git a/docs/workflow/building/coreclr/osx-instructions.md b/docs/workflow/building/coreclr/osx-instructions.md index 9e363f2fb276..d8bf4fe604fc 100644 --- a/docs/workflow/building/coreclr/osx-instructions.md +++ b/docs/workflow/building/coreclr/osx-instructions.md @@ -66,7 +66,7 @@ Create the Core_Root The Core_Root folder will have the built binaries, from `src/coreclr/build.sh` and it will also include the CoreFX packages required to run tests. ``` -./src/coreclr/build-test.sh generatelayoutonly +./src/tests/build.sh generatelayoutonly ``` After the build is complete you will be able to find the output in the `artifacts/tests/coreclr/OSX.x64.Debug/Tests/Core_Root` folder. @@ -74,7 +74,7 @@ After the build is complete you will be able to find the output in the `artifact Running a single test =================== -After `src/coreclr/build-test.sh` is run, corerun from the Core_Root folder is ready to be run. This can be done by using the full absolute path to corerun, or by setting +After `src/tests/build.sh` is run, corerun from the Core_Root folder is ready to be run. This can be done by using the full absolute path to corerun, or by setting an environment variable to the Core_Root folder. ```sh diff --git a/docs/workflow/building/libraries/README.md b/docs/workflow/building/libraries/README.md index 44eb0eb209ee..de6969f28658 100644 --- a/docs/workflow/building/libraries/README.md +++ b/docs/workflow/building/libraries/README.md @@ -9,11 +9,11 @@ Here is one example of a daily workflow for a developer working mainly on the li git clean -xdf git pull upstream master & git push origin master :: Build Debug libraries on top of Release runtime: -build -subset clr+libs -runtimeConfiguration Release +build.cmd clr+libs -rc Release :: The above you may only perform once in a day, or when you pull down significant new changes. :: If you use Visual Studio, you might open System.Text.RegularExpressions.sln here. -build -vs System.Text.RegularExpressions +build.cmd -vs System.Text.RegularExpressions :: Switch to working on a given library (RegularExpressions in this case) cd src\libraries\System.Text.RegularExpressions @@ -33,7 +33,7 @@ The instructions for Linux and macOS are essentially the same: git clean -xdf git pull upstream master & git push origin master # Build Debug libraries on top of Release runtime: -./build.sh -subset clr+libs -runtimeconfiguration Release +./build.sh clr+libs -rc Release # The above you may only perform once in a day, or when you pull down significant new changes. # Switch to working on a given library (RegularExpressions in this case) @@ -56,12 +56,12 @@ These example commands will build a release CoreCLR (and CoreLib), debug librari For Linux: ```bash -./build.sh -runtimeConfiguration Release +./build.sh -rc Release ``` For Windows: ```bat -./build.cmd -runtimeConfiguration Release +./build.cmd -rc Release ``` Detailed information about building and testing runtimes and the libraries is in the documents linked below. @@ -74,7 +74,7 @@ The libraries build has two logical components, the native build which produces The build settings (BuildTargetFramework, TargetOS, Configuration, Architecture) are generally defaulted based on where you are building (i.e. which OS or which architecture) but we have a few shortcuts for the individual properties that can be passed to the build scripts: -- `-framework|-f` identifies the target framework for the build. Possible values include `net5.0` (currently the latest .NET version) or `net472`. (msbuild property `BuildTargetFramework`) +- `-framework|-f` identifies the target framework for the build. Possible values include `net5.0` (currently the latest .NET version) or `net48` (the latest .NETFramework version). (msbuild property `BuildTargetFramework`) - `-os` identifies the OS for the build. It defaults to the OS you are running on but possible values include `Windows_NT`, `Unix`, `Linux`, or `OSX`. (msbuild property `TargetOS`) - `-configuration|-c Debug|Release` controls the optimization level the compilers use for the build. It defaults to `Debug`. (msbuild property `Configuration`) - `-arch` identifies the architecture for the build. It defaults to `x64` but possible values include `x64`, `x86`, `arm`, or `arm64`. (msbuild property `TargetArchitecture`) @@ -83,26 +83,20 @@ For more details on the build settings see [project-guidelines](../../../coding- If you invoke the `build` script without any actions, the default action chain `-restore -build` is executed. -By default the `build` script only builds the product libraries and none of the tests. If you want to include tests, you want to add the subset `-subset libtests`. If you want to run the tests you want to use the `-test` action instead of the `-build`, e.g. `build.cmd/sh -subset libs.tests -test`. To specify just the libraries, use `-subset libs`. +By default the `build` script only builds the product libraries and none of the tests. If you want to include tests, you want to add the subset `libs.tests`. If you want to run the tests you want to use the `-test` action instead of the `-build`, e.g. `build.cmd/sh libs.tests -test`. To specify just the libraries, use `libs`. **Examples** - Building in release mode for platform x64 (restore and build are implicit here as no actions are passed in) ```bash -./build.sh -subset libs -c Release -arch x64 +./build.sh libs -c Release -arch x64 ``` - Building the src assemblies and build and run tests (running all tests takes a considerable amount of time!) ```bash -./build.sh -subset libs -test +./build.sh libs -test ``` -- Building for different target frameworks (restore and build are implicit again as no action is passed in) -```bash -./build.sh -subset libs -framework net5.0 -./build.sh -subset libs -framework net472 -``` - -- Clean the entire solution +- Clean the entire artifacts folder ```bash ./build.sh -clean ``` @@ -191,7 +185,7 @@ You can iterate on `System.Private.CoreLib` by running: build.cmd clr.corelib+clr.nativecorelib+libs.pretest -rc Release ``` -When this `System.Private.CoreLib` will be built in Release mode, then it will be crossgen'd and we will update the testhost to the latest version of corelib. +When this `System.Private.CoreLib` will be built in Release mode, then it will be crossgen'd and we will update the testhost to the latest version of corelib. You can use the same workflow for mono runtime by using `mono.corelib+libs.pretest` subsets. @@ -199,24 +193,24 @@ You can use the same workflow for mono runtime by using `mono.corelib+libs.prete By default the libraries will attempt to build using the CoreCLR version of `System.Private.CoreLib.dll`. In order to build against the Mono version you need to use the `/p:RuntimeFlavor=Mono` argument. ``` -.\build.cmd -subset libs /p:RuntimeFlavor=Mono +.\build.cmd libs /p:RuntimeFlavor=Mono ``` ### Building all for other OSes By default, building from the root will only build the libraries for the OS you are running on. One can -build for another OS by specifying `./build.sh -subset libs -os [value]`. +build for another OS by specifying `./build.sh libs -os [value]`. Note that you cannot generally build native components for another OS but you can for managed components so if you need to do that you can do it at the individual project level or build all via passing `/p:BuildNative=false`. ### Building in Release or Debug By default, building from the root or within a project will build the libraries in Debug mode. -One can build in Debug or Release mode from the root by doing `./build.sh -subset libs -c Release` or `./build.sh -subset libs -c Debug`. +One can build in Debug or Release mode from the root by doing `./build.sh libs -c Release` or `./build.sh libs`. ### Building other Architectures -One can build 32- or 64-bit binaries or for any architecture by specifying in the root `./build.sh -subset libs -arch [value]` or in a project `/p:TargetArchitecture=[value]` after the `dotnet build` command. +One can build 32- or 64-bit binaries or for any architecture by specifying in the root `./build.sh libs -arch [value]` or in a project `/p:TargetArchitecture=[value]` after the `dotnet build` command. ## Working in Visual Studio @@ -227,3 +221,17 @@ If you are working on Windows, and use Visual Studio, you can open individual li For more details about running tests inside Visual Studio, [go here](../../testing/visualstudio.md). For more about running tests, read the [running tests](../../testing/libraries/testing.md) document. + +## Build packages +To build a library's package, simply invoke `dotnet pack` on the src project after you successfully built the .NETCoreApp vertical from root: + +``` +build libs +dotnet pack src\libraries\System.Text.Json\src\ +``` + +Same as for `dotnet build` or `dotnet publish`, you can specify the desired configuration via the `-c` flag: + +``` +dotnet pack src\libraries\System.Text.Json\src\ -c Release +``` diff --git a/docs/workflow/building/libraries/cross-building.md b/docs/workflow/building/libraries/cross-building.md index c7b0fe1fda42..24393ba5cf73 100644 --- a/docs/workflow/building/libraries/cross-building.md +++ b/docs/workflow/building/libraries/cross-building.md @@ -90,7 +90,7 @@ The output is at `artifacts/bin/[BuildSettings]` where `BuildSettings` looks som Building corefx for Linux ARM Emulator ======================================= -It is possible to build corefx binaries (native and managed) for the Linux ARM Emulator (latest version provided here: [#3805](https://github.com/dotnet/coreclr/issues/3805)). +It is possible to build corefx binaries (native and managed) for the Linux ARM Emulator (latest version provided here: [#5394](https://github.com/dotnet/runtime/issues/5394)). The `scripts/arm32_ci_script.sh` script does this. The following instructions assume that: diff --git a/docs/workflow/building/libraries/freebsd-instructions.md b/docs/workflow/building/libraries/freebsd-instructions.md index 09008a4f49c4..d62686b60839 100644 --- a/docs/workflow/building/libraries/freebsd-instructions.md +++ b/docs/workflow/building/libraries/freebsd-instructions.md @@ -20,18 +20,18 @@ This is certainly undesirable and it should be avoided if possible. ``` mkdir ~/dotnet cd ~/dotnet -curl https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-freebsd-x64.tar.gz | tar xfz - +curl https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-freebsd-x64.tar.gz | tar xfz - ``` -if on 12.x you may also need to set `LD_PRELOAD` to `/usr/lib/libpthread.so` to avoid issue when cli freezes. +if on 12.x you may also need to set `LD_PRELOAD` to `/usr/lib/libpthread.so` to avoid issue when cli freezes. As of summer 2019 this CLI is no longer good enough to build all repos. If that is your case jump to section [Updating CLI](#updating--bootstrap-cli) Binary snapshot can be obtained from https://github.com/wfurt/blob as dotnet-sdk-freebsd-x64-latest.tgz ## Getting sources -master of source-build pulls in source code of specific snapshot instead of tip of master branches. -That is generally OK but in case of FreeBSD it may miss some changes crucial for build. -(or pending un-submitted change) +master of source-build pulls in source code of specific snapshot instead of tip of master branches. +That is generally OK but in case of FreeBSD it may miss some changes crucial for build. +(or pending un-submitted change) ``` git clone https://github.com/dotnet/source-build @@ -44,9 +44,9 @@ git submodule update (cd src/coreclr ; git checkout master) ``` -port change from +port change from ```https://github.com/dotnet/corefx/commit/037859ac403ef17879655bb2f2e821d52e6eb4f3``` -In ideal case we could sync up to **master** but that brings Arcade changes and **breaks** the build. +In ideal case we could sync up to **master** but that brings Arcade changes and **breaks** the build. Bootstrap Arcade ``` @@ -86,8 +86,8 @@ index 81b8c7b..bb26868 100644 $(BuildArguments) -PortableBuild=$(PortableBuild) ``` -Depending of the day and moon phase you may need to get some updates as well. -If build breaks look for pending PRs with FreeBSD tag or label and pull pending changes. +Depending of the day and moon phase you may need to get some updates as well. +If build breaks look for pending PRs with FreeBSD tag or label and pull pending changes. ## Building @@ -106,7 +106,7 @@ export DOTNET_CLI_TELEMETRY_OPTOUT=1 ``` In ideal situation this will build whole sdk. Right now it fails somewhere in cli. -There is problem with rebuild and build will attempt to patch files again and/or make git updates. +There is problem with rebuild and build will attempt to patch files again and/or make git updates. ```export SOURCE_BUILD_SKIP_SUBMODULE_CHECK=1``` @@ -114,23 +114,23 @@ To build single repo again one can do: ```./build.sh /p:RootRepo=corefx /p:SkipRepoReferences=true ``` ## Resolving issues -Rebuild or source-build has issues. -Often running ```clean.sh``` from top helps. Be careful, that may undo any local pending changes. +Rebuild or source-build has issues. +Often running ```clean.sh``` from top helps. Be careful, that may undo any local pending changes. Sometimes it would try to apply patches and it would fail. -You can pass -```/p:SkipPatches=true``` to top level build.sh script. +You can pass +```/p:SkipPatches=true``` to top level build.sh script. ## Running CoreFX tests -Follow steps above to build at least corefx and it's dependencies. +Follow steps above to build at least corefx and it's dependencies. TBD ## Updating bootstrap CLI. -As build changes, previous versions of CLI may not be good enough any more. Changes in runtime or build dependency on 3.0 JSON are some example of braking changes. Following steps outline steps to update published CLI to what build needs. It will require other system where builds is supported. As close similarity and availability Linux will be used in examples bellow but Windows or MacOS should also yield same result. +As build changes, previous versions of CLI may not be good enough any more. Changes in runtime or build dependency on 3.0 JSON are some example of braking changes. Following steps outline steps to update published CLI to what build needs. It will require other system where builds is supported. As close similarity and availability Linux will be used in examples bellow but Windows or MacOS should also yield same result. Often build would ask for slightly different version without actually have real dependency on it (that is part of rolling updates across repos). One can cheat in this case and simply: @@ -138,12 +138,12 @@ One can cheat in this case and simply: ln -s ~/dotnet/sdk/old_version ~/dotnet/sdk/new_version ``` - + ### Finding versions and commit hashes -First we need to find what version are are trying to recreate. That is 'sdk' section in global.json in each repo. As of preview9ih time, this is set to 3.0.100-preview6-012264 and such version will be used in examples. One advantage of using release branches is that it is in coherent state e.g. all repos should need exactly same version. +First we need to find what version are are trying to recreate. That is 'sdk' section in global.json in each repo. As of preview9ih time, this is set to 3.0.100-preview6-012264 and such version will be used in examples. One advantage of using release branches is that it is in coherent state e.g. all repos should need exactly same version. -Let's get SDK for supported OS. Sync code base to same version you are trying to build on FreeBSD. +Let's get SDK for supported OS. Sync code base to same version you are trying to build on FreeBSD. ``` ./eng/common/build.sh --restore Downloading 'https://dot.net/v1/dotnet-install.sh' @@ -186,7 +186,7 @@ cd core-sdk git checkout be3f0c1a03f80492d45396c9f5b855b10a8a0b79 ``` -Set variables and assemble SKD without crossgen. (set DropSuffix=true to strip `preview6` from version). +Set variables and assemble SKD without crossgen. (set DropSuffix=true to strip `preview6` from version). ``` export DISABLE_CROSSGEN=true export CLIBUILD_SKIP_TESTS=true @@ -212,7 +212,7 @@ cd coreclr git checkout 7ec87b0097fdd4400a8632a2eae56612914579ef ``` -and build +and build ``` mkdir -p .dotnet curl https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-freebsd-x64.tar.gz | tar xfz - -C .dotnet @@ -247,7 +247,7 @@ git checkout d47cae744ddfb625db8e391cecb261e4c3d7bb1c ``` #### Building core-setup -As this has very little platform dependency it is unlikely this needs to be touched. +As this has very little platform dependency it is unlikely this needs to be touched. If we want to do this to pick up fix or for consistency than ... TBD ``` diff --git a/docs/workflow/building/libraries/webassembly-instructions.md b/docs/workflow/building/libraries/webassembly-instructions.md index c3195a30665e..d8667ddec1a0 100644 --- a/docs/workflow/building/libraries/webassembly-instructions.md +++ b/docs/workflow/building/libraries/webassembly-instructions.md @@ -4,108 +4,123 @@ If you haven't already done so, please read [this document](../../README.md#Build_Requirements) to understand the build requirements for your operating system. -An installation of the emsdk needs to be installed. Follow the installation guide [here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install). Once installed the EMSDK_PATH needs to be set: +The Emscripten SDK (emsdk) needs to be installed. Follow the installation guide [here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install) or run `make -C src/mono/wasm provision-wasm` to install emsdk into `src/mono/wasm/emsdk`. -On Linux and MacOSX: +Once installed the `EMSDK_PATH` environment variable needs to be set: + +On Linux and macOS: ```bash -export EMSDK_PATH=PATH_TO_SDK_INSTALL/emsdk +export EMSDK_PATH=/emsdk ``` ## Building everything -At this time no other build configurations are necessary to start building for WebAssembly. The CoreLib for WebAssembly build configurations will be built by default using the WebAssembly configuration shown below. +At this time no other build dependencies are necessary to start building for WebAssembly. -This document explains how to work on libraries. In order to work on library projects or run library tests it is necessary to have built the runtime to give the libraries something to run on. If you haven't already done so, please read [this document](../../README.md#Configurations) to understand configurations. +This document explains how to work on the runtime or libraries. If you haven't already done so, please read [this document](../../README.md#Configurations) to understand configurations. +For Linux and macOS: -For Linux and MacOSX: ```bash -./build.sh --arch wasm --os Browser --configuration release +./build.sh -os Browser -configuration Release ``` -Detailed information about building and testing runtimes and the libraries is in the documents linked below. +Artifacts will be placed in `artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/`. When rebuilding with `build.sh` after a code change, you need to ensure that the `mono.wasmruntime` and `libs.pretest` subsets are included even for a Mono-only change or this directory will not be updated (details below). -## How to build native components only +### Note: do not mix runtime and library configurations -The libraries build contains some native code. This includes shims over libc, openssl, gssapi, and zlib. The build system uses CMake to generate Makefiles using clang. The build also uses git for generating some version information. +At this time, it is not possible to specify different configurations for the runtime and libraries. That is mixing a Release `-runtimeConfiguration` with a Debug `-libraryConfiguration` (or `-configuration`), or vice versa will not work. -**Examples** +Please only use the `-configuration` option with `Debug` or `Release`, and do not specify a `-runtimeConfiguration` and `-libraryConfiguration`. + +This is tracked in https://github.com/dotnet/runtime/issues/42553 + + +## Building Mono's System.Private.CoreLib or runtime + +If you are working on core parts of Mono you will probably need to build the Mono runtime and [System.Private.CoreLib](../../../design/coreclr/botr/corelib.md) which can be built with the following: -- Building in debug mode for platform wasm and Browser operating system ```bash -./build.sh --arch wasm --os Browser --subset Libs.Native --configuration Debug +./build.sh mono -os Browser -c Debug|Release ``` -- Building in release mode for platform wasm and Browser operating system +To build just System.Private.CoreLib without the Mono runtime you can use the `Mono.CoreLib` subset: + ```bash -./build.sh --arch wasm --os Browser --subset Libs.Native --configuration Release +./build.sh mono.corelib -os Browser -c Debug|Release ``` -## How to build mono System.Private.CoreLib +To build just the Mono runtime without System.Private.CoreLib use the `Mono.Runtime` subset: -If you are working on core parts of mono libraries you will probably need to build the [System.Private.CoreLib](../../../design/coreclr/botr/corelib.md) which can be built with the following: +```bash +./build.sh mono.runtime -os Browser -c Debug|Release +``` +Building both Mono/System.Private.CoreLib and the managed libraries: ```bash -./build.sh --arch wasm --os Browser --configuration release --subset Mono +./build.sh mono+libs -os Browser -c Debug|Release ``` -To build just SPC without mono you can use the Mono.CoreLib subset. +## Building the WebAssembly runtime files + +The WebAssembly implementation files are built after the libraries source build and made available in the artifacts folder. If you are working on the code base and need to compile just these modules then building the `Mono.WasmRuntime` subset will allow one to do that: ```bash -./build.sh --arch wasm --os Browser --configuration release --subset Mono.CoreLib +./build.sh mono.wasmruntime -os Browser -c Debug|Release ``` +## Updating in-tree runtime pack -Building the managed libraries as well: +If you don't run the full `Libs` subset then you can use the `Libs.PreTest` subset to copy updated runtime/corelib binaries to the runtime pack which is used for running tests: ```bash -./build.sh --arch wasm --os Browser --configuration release --subset Mono+Libs +./build.sh libs.pretest -os Browser -c Debug|Release +``` + +## Building libraries native components only + +The libraries build contains some native code. This includes shims over libc, openssl, gssapi, and zlib. The build system uses CMake to generate Makefiles using clang. The build also uses git for generating some version information. + +```bash +./build.sh libs.native -os Browser -c Debug|Release ``` ## Building individual libraries Individual projects and libraries can be build by specifying the build configuration. -Building individual libraries **Examples** -- Build all projects for a given library (e.g.: System.Net.Http) including running the tests +- Build all projects for a given library (e.g.: System.Net.Http) including the tests ```bash - ./build.sh --arch wasm --os Browser --configuration release --projects src/libraries/System.Net.Http/System.Net.Http.sln +./build.sh -os Browser -c Release --projects /src/libraries/System.Net.Http/System.Net.Http.sln ``` - Build only the source project of a given library (e.g.: System.Net.Http) ```bash - ./build.sh --arch wasm --os Browser --configuration release --projects src/libraries/System.Net.Http/src/System.Net.Http.csproj + ./build.sh -os Browser -c Release --projects /src/libraries/System.Net.Http/src/System.Net.Http.csproj ``` More information and examples can be found in the [libraries](./README.md#building-individual-libraries) document. -## Building the WebAssembly runtime files - -The WebAssembly implementation files are built and made available in the artifacts folder. If you are working on the code base and need to compile just these modules then the following will allow one to do that. - -For Linux and MacOSX: -```bash -./dotnet.sh build /p:Configuration=Debug|Release /p:TargetArchitecture=wasm /p:TargetOS=Browser src/libraries/src.proj /t:NativeBinPlace -``` +## Notes -__Note__: A `Debug` build sets the following environment variables by default. When built from the command line this way the `Configuration` value is case sensitive. +A `Debug` build sets the following environment variables by default: - debugging and logging which will log garbage collection information to the console. ``` - monoeg_g_setenv ("MONO_LOG_LEVEL", "debug", 0); - monoeg_g_setenv ("MONO_LOG_MASK", "gc", 0); +MONO_LOG_LEVEL=debug +MONO_LOG_MASK=gc ``` #### Example: ``` -L: GC_MAJOR_SWEEP: major size: 752K in use: 39K +L: GC_MAJOR_SWEEP: major size: 752K in use: 39K L: GC_MAJOR: (user request) time 3.00ms, stw 3.00ms los size: 0K in use: 0K ``` @@ -126,7 +141,7 @@ First update emscripten version in the [webassembly Dockerfile](https://github.c ENV EMSCRIPTEN_VERSION=1.39.16 ``` -Submit a PR request with the updated version, wait for all checks to pass and for the request to be merged. A [master.json file](https://github.com/dotnet/versions/blob/master/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-master.json#L1126) will be updated with the a new docker image. +Submit a PR request with the updated version, wait for all checks to pass and for the request to be merged. A [master.json file](https://github.com/dotnet/versions/blob/master/build-info/docker/image-info.dotnet-dotnet-buildtools-prereqs-docker-master.json#L1126) will be updated with the a new docker image. ``` { @@ -155,4 +170,4 @@ container: registry: mcr ``` -Open a PR request with the new image. \ No newline at end of file +Open a PR request with the new image. diff --git a/docs/workflow/building/mono/README.md b/docs/workflow/building/mono/README.md index 276ae512ceda..d1f2851ef217 100644 --- a/docs/workflow/building/mono/README.md +++ b/docs/workflow/building/mono/README.md @@ -10,19 +10,19 @@ Before proceeding further, please click on the link above that matches your mach ## Concept -To build the Mono runtime, you must first do a complete runtime build (coreclr, libraries, and then mono). At the repo root, simply execute: +To build a complete runtime environment, you need to build both the Mono runtime and libraries. At the repo root, simply execute: ```bash -./build.sh +./build.sh --subset mono+libs ``` or on Windows, ```bat -build.cmd +build.cmd -subset mono+libs ``` Note that the debug configuration is the default option. It generates a 'debug' output and that includes asserts, fewer code optimizations, and is easier for debugging. If you want to make performance measurements, or just want tests to execute more quickly, you can also build the 'release' version which does not have these checks by adding the flag `-configuration release` (or `-c release`). - -Once you've built the whole runtime and assuming you want to work with just mono, you want to use the following command: + +Once you've built the complete runtime and assuming you want to work with just mono, you want to use the following command: ```bash ./build.sh --subset mono @@ -40,7 +40,7 @@ Here are a list of build arguments that may be of use: `/p:MonoEnableLlvm=true /p:MonoLLVMDir=path/to/llvm` - Builds mono w/ LLVM from a custom path -`/p:MonoEnableLlvm=true /p:MonoLLVMDir=path/to/llvm /p:MonoLLVMUseCxx11Abi=true` - Builds mono w/ LLVM +`/p:MonoEnableLlvm=true /p:MonoLLVMDir=path/to/llvm /p:MonoLLVMUseCxx11Abi=true` - Builds mono w/ LLVM from a custom path (and that LLVM was built with C++11 ABI) For `build.sh` @@ -49,6 +49,18 @@ For `build.sh` The build has a number of options that you can learn about using build -?. +### WebAssembly + +See the instructions for [Building WebAssembly](../../building/libraries/webassembly-instructions.md). + +### Android + +See the instructions for [Testing Android](../../testing/libraries/testing-android.md) + +### iOS + +See the instructions for [Testing iOS](../../testing/libraries/testing-apple.md) + ## Packages To generate nuget packages: @@ -68,7 +80,15 @@ The following packages will be created under `artifacts\packages\ - `transport.Microsoft.NETCore.Runtime.Mono.-dev..1.nupkg` - `transport.runtime..Microsoft.NETCore.Runtime.Mono.-dev..1.nupkg` -## Important Notes +## To get started with "Hello World" + +Try the sample at `src/mono/netcore/sample/HelloWorld`. +To run this sample, from the above folder +```cd ../.. +make run-sample +``` + +## Important Notes Test binaries are not yet available for mono. diff --git a/docs/workflow/ci/coreclr-ci-health.md b/docs/workflow/ci/coreclr-ci-health.md index 5e095b6af444..935b6c9087f4 100644 --- a/docs/workflow/ci/coreclr-ci-health.md +++ b/docs/workflow/ci/coreclr-ci-health.md @@ -1,10 +1,10 @@ # CI Health and Investigation -`dotnet/runtime` runs testing accross many different architectures and operating systems. The breadth of testing that happens lends itself to a complex system which is susceptible to different points of failure. +`dotnet/runtime` runs testing across many different architectures and operating systems. The breadth of testing that happens lends itself to a complex system which is susceptible to different points of failure. Note that this document focuses on coreclr testing in `dotnet/runtime`. -https://github.com/dotnet/coreclr/issues/27231 was opened as a way to simply view in one place all issues that are affecting `dotnet/runtime`'s CI. +https://github.com/dotnet/runtime/issues/702 was opened as a way to simply view in one place all issues that are affecting `dotnet/runtime`'s CI. ## TOC @@ -15,7 +15,7 @@ https://github.com/dotnet/coreclr/issues/27231 was opened as a way to simply vie #### Terminology -In order to follow some of the terminology used, there is an expected familiarity of Azure DevOps required. For an in depth guide with Azure DevOps pipeline definitions, please see: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema. +In order to follow some of the terminology used, there is an expected familiarity of Azure DevOps required. For an in depth guide with Azure DevOps pipeline definitions, please see: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema. The most common terminology and most important are the different containers work happens in. @@ -25,7 +25,7 @@ The most common terminology and most important are the different containers work `Job`: Jobs are the smallest unit of work which happen on a unique machine. Jobs by default run in parallel, but may be set to depend on another job. **Every job executes its work on a unique machine**. -`Steps`: Steps are the smallest unit of work, they generally correspond to one command that will happen in a job. Normally a job contains steps, which execute serially. +`Steps`: Steps are the smallest unit of work, they generally correspond to one command that will happen in a job. Normally a job contains steps, which execute serially. ## CI Overview @@ -103,7 +103,7 @@ In order to view the analytics of the pipeline navigate to [runtime-coreclr](htt **Pipeline Pass Rate** -This is tracking the pipeline pass rate generally over two weeks. This view is not very useful for [runtime-coreclr](https://dev.azure.com/dnceng/public/_build?definitionId=649) as the PR pipeline is expected to break during PR validation. Therefore, it is generally recommended to view [runtime-coreclr outerloop](https://dev.azure.com/dnceng/public/_build?definitionId=655) to get a better idea of what the overall success rate is for [runtime-coreclr](https://dev.azure.com/dnceng/public/_build?definitionId=228). Note that this is not exactly a fair comparison as we run signicantly more tests in [runtime-outerloop](https://dev.azure.com/dnceng/public/_build?definitionId=655) accross more platforms. It is however, a good proxy to see the overall CI health. +This is tracking the pipeline pass rate generally over two weeks. This view is not very useful for [runtime-coreclr](https://dev.azure.com/dnceng/public/_build?definitionId=649) as the PR pipeline is expected to break during PR validation. Therefore, it is generally recommended to view [runtime-coreclr outerloop](https://dev.azure.com/dnceng/public/_build?definitionId=655) to get a better idea of what the overall success rate is for [runtime-coreclr](https://dev.azure.com/dnceng/public/_build?definitionId=228). Note that this is not exactly a fair comparison as we run signicantly more tests in [runtime-outerloop](https://dev.azure.com/dnceng/public/_build?definitionId=655) across more platforms. It is however, a good proxy to see the overall CI health. Opening the [runtime-outerloop Pipeline Pass Rate](https://dev.azure.com/dnceng/public/_pipeline/analytics/stageawareoutcome?definitionId=655&contextType=build) there is a presentation of a line graph of the end to end success rate for the pipeline over time. @@ -157,7 +157,7 @@ This tracks the overall end to end run time of a pipeline. This graph is useful Specifically the query is useful for finding out whether a specific Helix Queue (a group of machines) is overloaded or not. This is useful for diagnosing arm hardware issues, because we have a fixed amount that is easily overloaded. ``` -WorkItems +WorkItems | where QueueName == "ubuntu.1804.armarch.open" | extend DaysAgo = datetime_diff('Day', now(), Queued) | extend QueueTimeInSeconds = datetime_diff('Second', Started, Queued) diff --git a/docs/workflow/debugging/coreclr/debugging.md b/docs/workflow/debugging/coreclr/debugging.md index 41a4b9c5dcaf..580032545d29 100644 --- a/docs/workflow/debugging/coreclr/debugging.md +++ b/docs/workflow/debugging/coreclr/debugging.md @@ -19,10 +19,18 @@ Debugging CoreCLR on Windows 7. Set Command Arguments=`` (e.g. HelloWorld.dll) 8. Set Working Directory=`$(SolutionDir)\..\..\..\bin\coreclr\Windows_NT.$(Platform).$(Configuration)` 1. This points to the folder containing CoreCLR binaries. -9. Press F11 to start debugging at wmain in corerun (or set a breakpoint in source and press F5 to run to it) +9. Set Environment=`CORE_LIBRARIES=$(SolutionDir)\..\..\..\bin\runtime\-Windows_NT-$(Configuration)-$(Platform)`, + where '\' is the target framework of current branch, for example `netcoreapp3.1` `net5.0`. + 1. This points to the folder containing core libraries except `System.Private.CoreLib`. + 2. This step can be skipped if you are debugging CLR tests that references only `System.Private.CoreLib`. + Otherwise, it's required to debug a realworld application that references anything else, including `System.Runtime`. +10. Right-click the INSTALL project and choose 'Build' + 1. This will load necessary information from cmake to Visual Studio. +11. Press F11 to start debugging at wmain in corerun (or set a breakpoint in source and press F5 to run to it) 1. As an example, set a breakpoint for the EEStartup function in ceemain.cpp to break into CoreCLR startup. -Steps 1-8 only need to be done once, and then (9) can be repeated whenever you want to start debugging. The above can be done with Visual Studio 2013. +Steps 1-10 only need to be done once, and then (11) can be repeated whenever you want to start debugging. The above can be done with Visual Studio 2019 as writing. +Keeping with latest version of Visual Studio is recommended. ### Using SOS with windbg or cdb on Windows ### diff --git a/docs/workflow/debugging/libraries/debugging-packages.md b/docs/workflow/debugging/libraries/debugging-packages.md index 5b25a1ffb14f..f72887149b7f 100644 --- a/docs/workflow/debugging/libraries/debugging-packages.md +++ b/docs/workflow/debugging/libraries/debugging-packages.md @@ -14,13 +14,13 @@ Debugging CoreFX build issues (This documentation is work in progress.) -I found the following process to help when investigating some of the build issues caused by incorrect packaging. +I found the following process to help when investigating some of the build issues caused by incorrect packaging. -To quickly validate if a given project compiles on all supported configurations use `dotnet build /t:RebuildAll`. This applies for running tests as well. For more information, see [Building individual libraries](../../building/libraries/README.md#building-individual-libraries) +To quickly validate if a given project compiles on all supported configurations use `dotnet build /t:RebuildAll`. This applies for running tests as well. For more information, see [Building individual libraries](../../building/libraries/README.md#building-individual-libraries) Assuming the current directory is `\src\contractname\`: -1. Build the `\ref` folder: `dotnet build` +1. Build the `\ref` folder: `dotnet build` Check the logs for output such as: @@ -58,7 +58,7 @@ Use the same technique above to ensure that the binaries include the correct imp Ensure that all Build Pivots are actually being built. This should build all .\ref and .\src variations as well as actually creating the NuGet packages. -Verify that the contents of the nuspec as well as the actual package is correct. You can find the packages by searching for the following pattern in the msbuild output: +Verify that the contents of the nuspec as well as the actual package is correct. You can find the packages by searching for the following pattern in the msbuild output: ``` GetPkgProjPackageDependencies: diff --git a/docs/workflow/debugging/libraries/windows-instructions.md b/docs/workflow/debugging/libraries/windows-instructions.md index ec075d8b10bd..46d916e74da8 100644 --- a/docs/workflow/debugging/libraries/windows-instructions.md +++ b/docs/workflow/debugging/libraries/windows-instructions.md @@ -25,16 +25,16 @@ As Administrator: windbg -I ``` -You may need to do this for both x64 and x86 versions. +You may need to do this for both x64 and x86 versions. Any application that crashes should now automatically start a WinDBG session. ## Debugging tests To run a single test from command line: -* Locate the test binary folder based on the CSPROJ name. +* Locate the test binary folder based on the CSPROJ name. For example: `src\System.Net.Sockets\tests\Functional\System.Net.Sockets.Tests.csproj` will build and output binaries at `bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0`. - + * Execute the test Assuming that your repo is at `C:\corefx`: @@ -44,7 +44,7 @@ cd C:\corefx\bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcorea C:\corefx\bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0\CoreRun.exe xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -notrait category=nonwindowstests -notrait category=OuterLoop -notrait category=failing ``` -* If the test crashes or encounters a `Debugger.Launch()` method call, WinDBG will automatically start and attach to the `CoreRun.exe` process +* If the test crashes or encounters a `Debugger.Launch()` method call, WinDBG will automatically start and attach to the `CoreRun.exe` process The following commands will properly configure the debugging extension and fix symbol and source-code references: @@ -129,7 +129,7 @@ Logs are going to be placed in %SYSTEMDRIVE%\sockets.etl. 1. Install [PerfView](https://github.com/Microsoft/perfview/blob/master/documentation/Downloading.md) 2. Run PerfView as Administrator -3. Press Alt+C to collect events +3. Press Alt+C to collect events 4. Disable all other collection parameters 5. Add Additional Providers (see below - Important: keep the "*" wildcard before the names.) @@ -137,7 +137,7 @@ Logs are going to be placed in %SYSTEMDRIVE%\sockets.etl. ### Built-in EventSource tracing -The following EventSources are built-in to CoreFX. The ones that are not marked as [__TestCode__] can be enabled in production scenarios for log collection. +The following EventSources are built-in to CoreFX. The ones that are not marked as [__TestCode__] can be enabled in production scenarios for log collection. #### Global * `*System.Diagnostics.Eventing.FrameworkEventSource {8E9F5090-2D75-4d03-8A81-E5AFBF85DAF1}`: Global EventSource used by multiple namespaces. @@ -169,5 +169,5 @@ Helper scripts are available at https://github.com/dotnet/runtime/tree/master/sr * `*System.Threading.Tasks.Parallel.EventSource`: Provides an event source for tracing TPL information. * `*System.Threading.Tasks.Dataflow.DataflowEventSource {16F53577-E41D-43D4-B47E-C17025BF4025}`: Provides an event source for tracing Dataflow information. -## Notes +## Notes * You can find the test invocation command-line by looking at the logs generated after the `dotnet build /t:test` within the test folder. diff --git a/docs/workflow/editing-and-debugging.md b/docs/workflow/editing-and-debugging.md index e5c142966663..5143ca82b240 100644 --- a/docs/workflow/editing-and-debugging.md +++ b/docs/workflow/editing-and-debugging.md @@ -31,7 +31,7 @@ what are in the repository. In particular Thus opening one of these two solution files (double clicking on them in Explorer) is typically all you need to do most editing. -Notice that the CoreCLR solution is under the 'bin' directory. This is because it is created as part of the build. +Notice that the CoreCLR solution is under the `artifacts` directory. This is because it is created as part of the build. Thus you can only launch this solution after you have built at least once. * See [Debugging CoreCLR](debugging/coreclr/debugging.md) diff --git a/docs/workflow/requirements/freebsd-requirements.md b/docs/workflow/requirements/freebsd-requirements.md index 59b3c64d928f..986425cbe3e8 100644 --- a/docs/workflow/requirements/freebsd-requirements.md +++ b/docs/workflow/requirements/freebsd-requirements.md @@ -21,7 +21,7 @@ with all needed prerequisites to build. As the example bellow may become stale, ```sh TAG=mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-11-20200430154008-a84b0d2 -docker run --rm --volume $(pwd):$(pwd) --workdir $(pwd) --env ROOTFS_DIR=/crossrootfs/x64 -ti $TAG ./build.sh -cross -FreeBSD +docker run --rm --volume $(pwd):$(pwd) --workdir $(pwd) --env ROOTFS_DIR=/crossrootfs/x64 -ti $TAG ./build.sh -cross -os FreeBSD ``` Build using Toolchain Setup @@ -57,11 +57,12 @@ Install the following packages: - lttng-ust - krb5 - openssl (optional) +- ninja (optional, enables building native code with ninja instead of make) The lines to install all the packages above using package manager. ```sh -sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake autoconf automake openssl +sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake autoconf automake openssl ninja ``` Additionally, working dotnet cli with SDK is needed. On other platforms this would be downloaded automatically during build but it is not currently available for FreeBSD. diff --git a/docs/workflow/requirements/linux-requirements.md b/docs/workflow/requirements/linux-requirements.md index 0cdd9cc39978..7563fdf7d7c0 100644 --- a/docs/workflow/requirements/linux-requirements.md +++ b/docs/workflow/requirements/linux-requirements.md @@ -50,13 +50,19 @@ Install the following packages for the toolchain: - libkrb5-dev - libnuma-dev (optional, enables numa support) - zlib1g-dev +- ninja (optional, enables building native code with ninja instead of make) The following dependencies are needed if Mono Runtime is enabled (default behavior): - autoconf - automake -- libtool +- libtool - ~$ sudo apt-get install cmake llvm-9 clang-9 autoconf automake libtool build-essential python curl git lldb-6.0 liblldb-6.0-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libssl-dev libnuma-dev libkrb5-dev zlib1g-dev +``` +sudo apt-get install -y cmake llvm-9 clang-9 autoconf automake \ +libtool build-essential python curl git lldb-6.0 liblldb-6.0-dev \ +libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev \ +libssl-dev libnuma-dev libkrb5-dev zlib1g-dev ninja +``` You now have all the required components. diff --git a/docs/workflow/requirements/macos-requirements.md b/docs/workflow/requirements/macos-requirements.md index 4604b87f60f8..d1ef93078164 100644 --- a/docs/workflow/requirements/macos-requirements.md +++ b/docs/workflow/requirements/macos-requirements.md @@ -28,8 +28,9 @@ Install the following packages: - openssl 1.1 - pkg-config - python3 +- ninja (optional, enables building native code with ninja instead of make) -You can install all the packages above using Homebrew by running this command in the repository root: +You can install all the required packages above using Homebrew by running this command in the repository root: ``` brew bundle --no-lock --file eng/Brewfile diff --git a/docs/workflow/requirements/windows-requirements.md b/docs/workflow/requirements/windows-requirements.md index 35229d2a3ea8..021145865c13 100644 --- a/docs/workflow/requirements/windows-requirements.md +++ b/docs/workflow/requirements/windows-requirements.md @@ -42,7 +42,13 @@ The dotnet/runtime repository requires at least Visual Studio 2019 16.6. - Add its location (e.g. C:\Program Files (x86)\CMake\bin) to the PATH environment variable. The installation script has a check box to do this, but you can do it yourself after the fact following the instructions at [Adding to the Default PATH variable](#adding-to-the-default-path-variable). -The dotnet/runtime repository requires at least CMake 3.15.5. +The dotnet/runtime repository recommends using CMake 3.16.0 or newer, but works with CMake 3.15.5. + +## Ninja (optional) + +- Install Ninja in one of the two following ways + - [Download the executable](https://github.com/ninja-build/ninja/releases) and add its location to [the Default PATH variable](#adding-to-the-default-path-variable). + - [Install via a package manager](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages), which should automatically add it to the PATH environment variable. ## Python diff --git a/docs/workflow/testing/coreclr/running-aspnet-benchmarks-with-crossgen2.md b/docs/workflow/testing/coreclr/running-aspnet-benchmarks-with-crossgen2.md index 55ffc5f7459a..b68e3cebc080 100644 --- a/docs/workflow/testing/coreclr/running-aspnet-benchmarks-with-crossgen2.md +++ b/docs/workflow/testing/coreclr/running-aspnet-benchmarks-with-crossgen2.md @@ -24,16 +24,14 @@ For Windows: ```powershell .\build.cmd -subset clr+libs -c release -cd src\coreclr -.\build-test.cmd Release generatelayoutonly +.\src\tests\build.cmd Release generatelayoutonly ``` For Linux: ```bash ./build.sh -subset clr+libs -c release -cd src/coreclr -./build-test.sh -release -generatelayoutonly +./src/tests/build.sh -release -generatelayoutonly ``` ### Generate a Configuration File for ASP.NET Benchmarking Runs @@ -84,10 +82,10 @@ profiles: cores: 12 jobs: application: - endpoints: + endpoints: - http://asp-perf-win:5001 load: - endpoints: + endpoints: - http://asp-perf-load:5001 aspnet-physical-lin: @@ -96,18 +94,18 @@ profiles: cores: 12 jobs: application: - endpoints: + endpoints: - http://asp-perf-lin:5001 load: - endpoints: + endpoints: - http://asp-perf-load:5001 ``` Now, what does this configuration mean and how is it applied? Let's go over the most important fields to understand its main functionality. -* **Imports**: These are external tools hosted in the Benchmarks repo. -In this case, we only need `wrk`, which is a tool that loads and tests +* **Imports**: These are external tools hosted in the Benchmarks repo. +In this case, we only need `wrk`, which is a tool that loads and tests performance in Web applications. * **Jobs**: Here go the job descriptions. A job in this context is the set of diff --git a/docs/workflow/testing/coreclr/testing.md b/docs/workflow/testing/coreclr/testing.md index 286a425932be..23a7287d6abc 100644 --- a/docs/workflow/testing/coreclr/testing.md +++ b/docs/workflow/testing/coreclr/testing.md @@ -9,9 +9,9 @@ Details on test metadata can be found in [test-configuration.md](test-configurat * [macOS](../../building/coreclr/osx-instructions.md) * [Windows](../../building/coreclr/README.md) 2) [Build the libraries](../../building/libraries/README.md) in Release configuration. Pass the configuration of CoreCLR you just built to the build script (e.g. `-runtimeconfiguration debug`). -3) From the `src/coreclr` directory run the following command: - * Non-Windows - `./build-test.sh` - * Windows - `build-test.cmd` +3) From the root directory run the following command: + * Non-Windows - `src/tests/build.sh` + * Windows - `src\tests\build.cmd` * Supply `-h` for usage flags ### Test priority @@ -21,16 +21,16 @@ The CoreCLR tests have two priorities, 0 and 1. The priority 0 tests run by defa ### Examples * Build all tests priority 1 and higher - * `build-test.cmd -priority=1` - * `build-test.sh -priority1` + * `build.cmd -priority=1` + * `build.sh -priority1` ## Build Individual Test Note: CoreCLR must be built prior to building an individual test. See the first step, above, for building all tests. * Native Test: Build the generated CMake projects - * Projects are auto-generated when the `build-test.sh`/`build-test.cmd` script is run - * It is possible to explicitly run only the native test build with `build-test.sh/cmd skipmanaged` + * Projects are auto-generated when the `build.sh`/`build.cmd` script is run + * It is possible to explicitly run only the native test build with `build.sh/cmd skipmanaged` * Managed Test: Invoke `dotnet build` on the project directly. `dotnet` can be the `dotnet.sh` or `dotnet.cmd` script in the repo root. ``` /dotnet.sh build /src/coreclr/tests/src/JIT/CodegenBringupTests/Array1_d.csproj /p:Configuration=Release diff --git a/docs/workflow/testing/coreclr/unix-test-instructions.md b/docs/workflow/testing/coreclr/unix-test-instructions.md index 6c86c041947e..aae608d27210 100644 --- a/docs/workflow/testing/coreclr/unix-test-instructions.md +++ b/docs/workflow/testing/coreclr/unix-test-instructions.md @@ -15,13 +15,13 @@ Dotnet CLI is required to build the tests. This can be done on any platform then To build the tests on Unix: ```sh -./src/coreclr/build-test.sh +./src/tests/build.sh ``` Please note that this builds the Priority 0 tests. To build priority 1: ```sh -./src/coreclr/build-test.sh -priority1 +./src/tests/build.sh -priority1 ``` ## Building Individual Tests @@ -41,16 +41,16 @@ During development there are many instances where building an individual test is The following instructions assume that on the Unix machine: - The CoreCLR repo is cloned at `/mnt/coreclr` -`src/coreclr/build-test.sh` will have set up the `Core_Root` directory correctly after the test build. +`src/tests/build.sh` will have set up the `Core_Root` directory correctly after the test build. ```sh -./src/coreclr/tests/runtest.sh x64 checked +./src/tests/run.sh x64 checked ``` Please use the following command for help. ```sh -./src/coreclr/tests/runtest.sh -h +./src/tests/run.sh -h ``` ### Unsupported and temporarily disabled tests @@ -65,7 +65,7 @@ the conditional property This property disables building of a test in a default build. It also disables running a test in the bash/batch wrapper scripts. It allows the test to be built on any target in CI when the `allTargets` option is -passed to the `build-test.*` scripts. +passed to the `build.*` scripts. Tests which never should be built or run are marked @@ -82,14 +82,23 @@ PAL tests Build CoreCLR with PAL tests on the Unix machine: ```sh -./src/coreclr/build-runtime.sh -skipgenerateversion -nopgooptimize \ - -cmakeargs -DCLR_CMAKE_BUILD_TESTS=1 +./build.sh clr.paltests ``` Run tests: +To run all tests including disabled tests ```sh -./src/coreclr/src/pal/tests/palsuite/runpaltests.sh $(pwd)/artifacts/obj/coreclr/$(uname).x64.Debug +./src/coreclr/src/pal/tests/palsuite/runpaltests.sh $(pwd)/artifacts/bin/coreclr/$(uname).x64.Debug/paltests +# on macOS, replace $(uname) with OSX +``` +To only run enabled tests for the platform the tests were built for: +```sh +artifacts/bin/coreclr/$(uname).x64.Debug/paltests/runpaltests.sh $(pwd)/artifacts/bin/coreclr/$(uname).x64.Debug/paltests +# on macOS, replace $(uname) with OSX ``` Test results will go into: `/tmp/PalTestOutput/default/pal_tests.xml` + +To disable tests in the CI edit +`src/coreclr/src/pal/tests/palsuite/issues.targets` diff --git a/docs/workflow/testing/coreclr/windows-test-instructions.md b/docs/workflow/testing/coreclr/windows-test-instructions.md index 1dc8551c9514..c581c3529e96 100644 --- a/docs/workflow/testing/coreclr/windows-test-instructions.md +++ b/docs/workflow/testing/coreclr/windows-test-instructions.md @@ -6,13 +6,13 @@ Building and running tests on Windows Building coreclr tests must be done using a specific script as follows: ``` -> src\coreclr\build-test.cmd +> src\tests\build.cmd ``` ## Building Precompiled Tests ``` -> src\coreclr\build-test.cmd crossgen +> src\tests\build.cmd crossgen ``` This will use `crossgen.exe` to precompile test executables before they are executed. @@ -20,7 +20,7 @@ This will use `crossgen.exe` to precompile test executables before they are exec ## Building Specific Priority Tests ``` -> src\coreclr\build-test.cmd -priority=1 +> src\tests\build.cmd -priority=1 ``` The above is an example of requesting that priority '1' and below be built. The default priority value is '0'. If '1' is specified, all tests with `CLRTestPriorty` `0` **and** `1` will be built and run. @@ -30,18 +30,18 @@ The above is an example of requesting that priority '1' and below be built. The To run a priority '0' and '1' and crossgen'd test pass: ``` -> src\coreclr\build-test.cmd crossgen -priority=1 +> src\tests\build.cmd crossgen -priority=1 ``` For additional supported parameters use the following: ``` -> src\coreclr\build-test.cmd -? +> src\tests\build.cmd -? ``` ### Building Individual Tests -**Note:** `build-test.cmd skipmanaged [Any additional flags]` needs to be run at least once if the individual test has native assets. +**Note:** `build.cmd skipmanaged [Any additional flags]` needs to be run at least once if the individual test has native assets. * Native Test: Build the generated Visual Studio solution or makefile corresponding to test cmake file. @@ -52,13 +52,13 @@ For additional supported parameters use the following: Will list supported parameters. ``` -> src\coreclr\tests\runtest.cmd /? +> src\tests\run.cmd /? ``` In order to run all of the tests using your checked build: ``` -> src\coreclr\tests\runtest.cmd checked +> src\tests\run.cmd checked ``` This will generate a report named `TestRun__.html` (e.g. `TestRun_Windows_NT_x64_Checked.html`) in the subdirectory `\artifacts\log`. Any tests that failed will be listed in `TestRunResults_Windows_NT_x64_Checked.err`. @@ -78,7 +78,7 @@ There are 2 files of interest: If you wish to re-run a failed test, follow the following steps: -1) Set an environment variable, `CORE_ROOT`, pointing to the path to product binaries that was passed to runtest.cmd. +1) Set an environment variable, `CORE_ROOT`, pointing to the path to product binaries that was passed to run.cmd. For example using a checked build the location would be: `\artifacts\tests\coreclr\Windows_NT.x64.Checked\Tests\Core_Root` 2) Run the failed test, the command to which is also present in the test report for a failed test. It will be something like `\artifacts\tests\coreclr\Windows_NT.x64.Checked\Exceptions\Finalization\Finalizer.cmd`. diff --git a/docs/workflow/testing/libraries/testing-android.md b/docs/workflow/testing/libraries/testing-android.md index 7ac22f84062f..5ad1b27f7900 100644 --- a/docs/workflow/testing/libraries/testing-android.md +++ b/docs/workflow/testing/libraries/testing-android.md @@ -88,4 +88,4 @@ Or simply open `logcat` window in Android Studio or Visual Stuido. ### Existing Limitations - `-os Android` is not supported for Windows yet (`WSL` can be used instead) - XHarness.CLI is not able to boot emulators yet (so you need to boot via `AVD Manager` or IDE) -- AOT and Interpreter modes are not supported yet \ No newline at end of file +- AOT and Interpreter modes are not supported yet diff --git a/docs/workflow/testing/libraries/testing-wasm.md b/docs/workflow/testing/libraries/testing-wasm.md index 8e067e9f6e49..7e530859bed4 100644 --- a/docs/workflow/testing/libraries/testing-wasm.md +++ b/docs/workflow/testing/libraries/testing-wasm.md @@ -7,14 +7,14 @@ In order to be able to run tests, the following JavaScript engines should be ins They can be installed as a part of [jsvu](https://github.com/GoogleChromeLabs/jsvu). -Please make sure that a JavaScript engine binary is available via command line, +Please make sure that a JavaScript engine binary is available via command line, e.g. for V8: ```bash $ v8 V8 version 8.5.62 ``` -If you use `jsvu`, first add its location to PATH variable +If you use `jsvu`, first add its location to PATH variable e.g. for V8 ```bash @@ -25,24 +25,24 @@ PATH=/Users//.jsvu/:$PATH V8 Now we're ready to build everything for WebAssembly (for more details, please read [this document](../../building/libraries/webassembly-instructions.md#building-everything)): ```bash -./build.sh --arch wasm --os Browser -c release +./build.sh -os Browser -c Release ``` and even run tests one by one for each library: ``` -./build.sh --subset libs.tests -t --arch wasm --os Browser -c release +./build.sh libs.tests -test -os Browser -c Release ``` ### Running individual test suites The following shows how to run tests for a specific library ``` -./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=release +./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release ``` ### Running tests using different JavaScript engines -It's possible to set a JavaScript engine explicitly by adding `/p:JSEngine` property: +It's possible to set a JavaScript engine explicitly by adding `/p:JSEngine` property: ``` -./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=release /p:JSEngine=SpiderMonkey +./dotnet.sh build /t:Test src/libraries/System.AppContext/tests /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=Release /p:JSEngine=SpiderMonkey ``` At the moment supported values are: diff --git a/docs/workflow/testing/mono/testing.md b/docs/workflow/testing/mono/testing.md index e710b77e00b4..1bffa1de3389 100644 --- a/docs/workflow/testing/mono/testing.md +++ b/docs/workflow/testing/mono/testing.md @@ -1,10 +1,10 @@ # Running Tests using Mono Runtime ## Running Runtime Tests -We currently only support running tests against coreclr. There are additional mono runtime tests in mono/mono, but they +We currently only support running tests against coreclr. There are additional mono runtime tests in mono/mono, but they have not been moved over yet. Simply run the following command: -``` +``` dotnet build /t:RunCoreClrTests $(REPO_ROOT)/src/mono/mono.proj ``` @@ -36,8 +36,8 @@ dotnet build /t:Test /p:RuntimeFlavor=mono ``` # Patching Local dotnet (.dotnet-mono) -Another way to test mono out is by 'patching' a local dotnet with our runtime bits. This is a good way to write simple -test programs and get a glimpse of how mono will work with the dotnet tooling. +Another way to test mono out is by 'patching' a local dotnet with our runtime bits. This is a good way to write simple +test programs and get a glimpse of how mono will work with the dotnet tooling. To generate a local .dotnet-mono, execute this command: @@ -51,4 +51,4 @@ You can then, for example, run our HelloWorld sample via: dotnet build -c Release $(REPO_ROOT)/src/mono/netcore/sample/HelloWorld MONO_ENV_OPTIONS="" COMPlus_DebugWriteToStdErr=1 \ $(REPO_ROOT)/.dotnet-mono/dotnet $(REPO_ROOT)/src/mono/netcore/sample/HelloWorld/bin/HelloWorld.dll -``` \ No newline at end of file +``` diff --git a/docs/workflow/testing/using-corerun.md b/docs/workflow/testing/using-corerun.md index 989a44669d6a..01a2aedffa1b 100644 --- a/docs/workflow/testing/using-corerun.md +++ b/docs/workflow/testing/using-corerun.md @@ -61,7 +61,7 @@ your new runtime. ## How CoreCLR Tests use corerun.exe -When you execute 'runtime/src/coreclr/build-test.cmd' one of the things that it does is set up a directory where it +When you execute 'runtime/src/tests/build.cmd' one of the things that it does is set up a directory where it gathers the CoreCLR that has just been built with the pieces of the class library that tests need. It places this runtime in the directory ```bat @@ -70,7 +70,7 @@ It places this runtime in the directory off the CoreCLR Repository. The way the tests are expected to work is that you set the environment variable CORE_ROOT to this directory (you don't have to set CORE_LIBRARIES) and you can run any tests. For example after building the tests -(running build-test at the repository base) and running 'test\runtest') you can do the following +(running src\tests\build from the repository base) and running 'src\tests\run') you can do the following ```bat set PATH=%PATH%;%CoreCLR%\artifacts\Product\Windows_NT.x64.Debug diff --git a/docs/workflow/testing/using-your-build.md b/docs/workflow/testing/using-your-build.md index 31a7f6bc8d3f..33e5ef19e174 100644 --- a/docs/workflow/testing/using-your-build.md +++ b/docs/workflow/testing/using-your-build.md @@ -1,7 +1,7 @@ # Using your .NET Runtime Build -We assume that you have successfully built CoreCLR repository and thus have files of the form +We assume that you have successfully built the repository and thus have files of the form ``` ~/runtime/artifacts/bin/coreclr/../ ``` @@ -11,7 +11,7 @@ a 'host' program that will load the Runtime as well as all the other .NET librar code that your application needs. The easiest way to get all this other stuff is to simply use the standard 'dotnet' host that installs with .NET SDK. -The released version of 'dotnet' tool may not be compatible with the live CoreCLR repository. The following steps +The released version of 'dotnet' tool may not be compatible with the live repository. The following steps assume use of a dogfood build of the .NET SDK. ## Acquire the latest nightly .NET SDK @@ -157,7 +157,7 @@ Assert failure(PID 13452 [0x0000348c], Thread: 10784 [0x2a20]): Consistency chec ## Using .NET SDK to run your .NET Application If you don't like the idea of copying files manually you can follow [these instructions](../using-dotnet-cli.md) to use dotnet cli to do this for you. -However the steps described here are the simplest and most commonly used by CoreCLR developers for ad-hoc testing. +However the steps described here are the simplest and most commonly used by runtime developers for ad-hoc testing. ## Using CoreRun to run your .NET Application diff --git a/docs/workflow/testing/visualstudio.md b/docs/workflow/testing/visualstudio.md index c8c20b9cfc7f..b519aa3a400a 100644 --- a/docs/workflow/testing/visualstudio.md +++ b/docs/workflow/testing/visualstudio.md @@ -1,9 +1,25 @@ -# Visual Studio Test Explorer support -For Visual Studio Test Explorer to work in dotnet/runtime, the following test settings need to be enabled: -- Test parameters (like which `dotnet` host to use) are persisted in an auto-generated .runsettings file. For that to work, make sure that the "Auto detect runsettings Files" (`Options -> Test`) option is enabled. -- Make sure that the "Processor Architecture for AnyCPU project" (`Test Explore pane -> Test Explorer toolbar options --> Settings`) value is set to `auto`. +# Working in dotnet/runtime using Visual Studio + +Visual Studio is a great tool to use when working in the dotnet/runtime repo. + +Almost all its features should work well, but there are a few special considerations to bear in mind: + +## Test Explorer + +You can run tests from the Visual Studio Test Explorer, but there are a few settings you need: +- Enable `Auto detect runsettings Files` (`Test Explorer window -> Settings button -> Options`). Test parameters (like which `dotnet` host to use) are persisted in an auto-generated .runsettings file, and it's important that Visual Studio knows to use it. +- Set `Processor Architecture for AnyCPU project` to `auto` (`Test Explorer window -> Settings button`). +- Consider whether to disable `Discover tests in real time from C# and Visual Basic .NET source files` (`Test explorer window -> Settings button -> Options`). + - You may want it enabled if you're actively writing new tests and want them to show up in Test Explorer without building first. + - You may want it disabled if you're mostly running existing tests, and some of them have conditional attributes. Many of our unit tests have attributes, like `[SkipOnTargetFramework]`, to indicate that they're only valid in certain configurations. Because the real-time discovery feature does not currently recognize these attributes the tests will show up in Test Explorer as well, and fail or possibly hang when you try to run them. +- Consider whether to enable `Run tests in Parallel` (`Test Explorer window -> Settings button`). + - You may want it enabled if some of the unit tests you're working with run slowly or there's many of them. + - You may want it disabled if you want to simplify debugging or viewing debug output. + +If you encounter puzzling behavior while running tests within Visual Studio, first check the settings above, verify they run correctly from the command line, and also make sure you're using the latest Visual Studio. It can be helpful to enable detailed logging of the test runner (`Test explorer window -> Settings button -> Options > Logging Level: Trace`) - it may suggest the problem, or at least provide more information to share. + +## Start with Debugging (F5) -# Visual Studio F5 Debugging support dotnet/runtime uses `dotnet test` ([VSTest](https://github.com/Microsoft/vstest)) which spawns child processes during test execution. Visual Studio by default doesn't automatically debug child processes, therefore preliminary steps need to be done to enable Debugging "F5" support. Note that these steps aren't necessary for Visual Studio Test Explorer support. @@ -14,3 +30,4 @@ Note that these steps aren't necessary for Visual Studio Test Explorer support. ## References - https://github.com/dotnet/project-system/issues/6176 tracks enabling the native code debugging functionality for multiple projects without user interaction. - https://github.com/dotnet/sdk/issues/7419#issuecomment-298261617 explains the necessary steps to install and enable the mentioned extension in more detail. +- https://github.com/microsoft/vstest/ is the repo for issues with the Visual Studio test execution features. diff --git a/docs/workflow/using-dotnet-cli.md b/docs/workflow/using-dotnet-cli.md index 7c9efa28c829..8090f0eddc2c 100644 --- a/docs/workflow/using-dotnet-cli.md +++ b/docs/workflow/using-dotnet-cli.md @@ -1,23 +1,23 @@ # Using your .NET Runtime build with .NET SDK -This walkthrough explains how to run against your local CoreCLR build using .NET SDK only. +This walkthrough explains how to run your own app against your local build using only the .NET SDK. For other walkthroughs see: -- [Using Your Build - Update CoreCLR from raw binary output](./testing/using-your-build.md) +- [Using Your Build - Update from raw build output](./testing/using-your-build.md) - [Using CoreRun To Run .NET Application](./testing/using-corerun.md) - [Dogfooding .NET SDK](https://github.com/dotnet/runtime/blob/master/docs/project/dogfooding.md). ## Prerequisites -1. Successfully built CoreCLR repository and thus have files of the form shown below. From now on we call this folder NuGet package folder. +1. Successfully built this repository and thus have files of the form shown below. From now on we call this folder NuGet package folder. ``` - artifacts\bin\coreclr\..\.nuget\pkg\runtime.-.Microsoft.NETCore.Runtime.CoreCLR..nupkg + artifacts\packages\\Shipping\ ``` -2. Acquired the latest nightly .NET SDK from [here](https://github.com/dotnet/cli/blob/master/README.md#installers-and-binaries) and added it's root folder to your [path](requirements/windows-requirements.md#adding-to-the-default-path-variable) +2. Acquired the latest nightly .NET SDK from [here](https://github.com/dotnet/installer) and added its root folder to your [path](requirements/windows-requirements.md#adding-to-the-default-path-variable) ## First Run @@ -29,13 +29,11 @@ From now on all instructions relate to this folder as "app folder". ### 2. Create NuGet.Config file -The build script creates NuGet packages and puts them to `artifacts\bin\coreclr\..\.nuget\pkg\`. .NET SDK has no idea about its existence and we need to tell it where to search for the packages. +The build script creates NuGet packages and puts them to `artifacts\packages\\Shipping\`. .NET SDK has no idea about its existence and we need to tell it where to search for the packages. Please run `dotnet new nugetconfig` in the app folder and update the created `NuGet.Config` file: -* **set path to local CoreCLR NuGet folder!!** -* add address to dotnet core tools NuGet feed - +* ** adjust path below to point to your in-repo NuGet folder** ```xml @@ -44,11 +42,9 @@ Please run `dotnet new nugetconfig` in the app folder and update the created `Nu - - + - ``` ### 3. Create and update the Project file @@ -60,39 +56,37 @@ Please run `dotnet new console` in the app folder and update the created `.cspro Exe - netcoreapp3.0 + net5.0 win-x64 - 3.0.0-preview1-26210-0 - - + ``` -**You have to set the correct values for `RuntimeIdentifier` (RI), `RuntimeFrameworkVersion` and versions of both packages.** +**You have to set the correct values for `RuntimeIdentifier` (RI) and `RuntimeFrameworkVersion`.** You can generally figure that out by looking at the packages you found in your output. -In our example you will see there is a package with the name `runtime.win-x64.Microsoft.NETCore.Runtime.CoreCLR.3.0.0-preview1-26210-0.nupkg` +In our example you will see there is a package with the name `Microsoft.NETCore.App.Runtime.win-x64.5.0.0-dev.nupkg` ``` -runtime.win-x64.Microsoft.NETCore.Runtime.CoreCLR.3.0.0-preview1-26210-0.nupkg - ^--RI---^ ^--------version-------^ +Microsoft.NETCore.App.Runtime.win-x64.5.0.0-dev.nupkg + ^-RI--^ ^version^ ``` ### 4. Change Program.cs -To make sure that you run against your local coreclr build please change your `Main` method in `Program.cs` file to: +To make sure that you run against your local build of this repo please change your `Main` method in `Program.cs` file to: ```cs static void Main(string[] args) { - var coreAssemblyInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(object).Assembly.Location); - Console.WriteLine($"Hello World from Core {coreAssemblyInfo.ProductVersion}"); - Console.WriteLine($"The location is {typeof(object).Assembly.Location}"); + var coreAssemblyInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(object).Assembly.Location); + Console.WriteLine($"Hello World from .NET {coreAssemblyInfo.ProductVersion}"); + Console.WriteLine($"The location is {typeof(object).Assembly.Location}"); } ``` @@ -108,40 +102,56 @@ dotnet publish Make sure that restoring done by `dotnet publish` installed the explicit version of the Runtime that you have specified: ``` -PS C:\coreclr\helloWorld> dotnet publish - Restoring packages for C:\coreclr\helloWorld\helloWorld.csproj... - Installing runtime.win-x64.Microsoft.NETCore.Runtime.CoreCLR 3.0.0-preview1-26210- +c:\runtime\helloworld>dotnet publish +Microsoft (R) Build Engine version 16.7.0-preview-20360-03+188921e2f for .NET +Copyright (C) Microsoft Corporation. All rights reserved. + + Determining projects to restore... + Restored c:\runtime\helloworld\helloworld.csproj (in 114 ms). + You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview + helloworld -> c:\runtime\helloworld\bin\Debug\net5.0\win-x64\helloworld.dll + helloworld -> c:\runtime\helloworld\bin\Debug\net5.0\win-x64\publish\ ``` If you see something like the message below it means that it has failed to restore your local runtime packages. In such case double check your `NuGet.config` file and paths used in it. ``` -C:\coreclr\helloWorld\helloWorld.csproj : warning NU1603: helloWorld depends on runtime.win-x64.Microsoft.NETCore.Runtime.CoreCLR (>= 3.0.0-preview1-26210-0) but runtime.win-x64.Microsoft.NETCore.Runtime.CoreCLR 3.0.0-preview1-26210-0 was not found. An approximate best match of runtime.win-x64.Microsoft.NETCore.Runtime.CoreCLR 3.0.0-preview2-25501-02 was resolved. +c:\runtime\helloworld>dotnet publish +Microsoft (R) Build Engine version 16.7.0-preview-20360-03+188921e2f for .NET +Copyright (C) Microsoft Corporation. All rights reserved. + + Determining projects to restore... +c:\runtime\helloworld\helloworld.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.win-x64 with version (= 5.0.0-does-not-exist) +c:\runtime\helloworld\helloworld.csproj : error NU1102: - Found 25 version(s) in nuget [ Nearest version: 5.0.0-preview.1.20120.5 ] +c:\runtime\helloworld\helloworld.csproj : error NU1102: - Found 1 version(s) in local runtime [ Nearest version: 5.0.0-dev ] +c:\runtime\helloworld\helloworld.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Host.win-x64 with version (= 5.0.0-does-not-exist) +c:\runtime\helloworld\helloworld.csproj : error NU1102: - Found 27 version(s) in nuget [ Nearest version: 5.0.0-preview.1.20120.5 ] +c:\runtime\helloworld\helloworld.csproj : error NU1102: - Found 1 version(s) in local runtime [ Nearest version: 5.0.0-dev ] + Failed to restore c:\runtime\helloworld\helloworld.csproj (in 519 ms). ``` ### 6. Run the app -After you publish you will find all the binaries needed to run your application under `bin\Debug\netcoreapp3.0\win-x64\publish\`. +After you publish you will find all the binaries needed to run your application under `bin\Debug\net5.0\win-x64\publish\`. To run the application simply run the EXE that is in this publish directory (it is the name of the app, or specified in the project file). ``` -.\bin\Debug\netcoreapp3.0\win-x64\publish\HelloWorld.exe +.\bin\Debug\net5.0\win-x64\publish\HelloWorld.exe ``` -Running the app should tell you the version and which user and machine build the assembly as well as the commit hash of the code -at the time of building: +Running the app should tell you the version and where the location of System.Private.CoreLib in the publish directory: ``` -Hello World from Core 4.6.26210.0 @BuiltBy: adsitnik-MININT-O513E3V @SrcCode: https://github.com/dotnet/runtime/tree/3d6da797d1f7dc47d5934189787a4e8006ab3a04 -The location is C:\coreclr\helloWorld\bin\Debug\netcoreapp3.0\win-x64\publish\System.Private.CoreLib.dll +Hello World from .NET 5.0.0-dev +The location is c:\runtime\helloworld\bin\Debug\net5.0\win-x64\publish\System.Private.CoreLib.dll ``` -**Congratulations! You have just run your first app against local CoreCLR build!** +**Congratulations! You have just run your first app against your local build of this repo** -## Update CoreCLR using runtime nuget package +## Update using runtime nuget package -Updating CoreCLR from raw binary output is easier for quick one-off testing but using the nuget package is better -for referencing your CoreCLR build in your actual application because of it does not require manual copying of files +Updating the runtime from raw binary output is easier for quick one-off testing but using the nuget package is better +for referencing your build in your actual application because of it does not require manual copying of files around each time the application is built and plugs into the rest of the tool chain. This set of instructions will cover the further steps needed to consume the runtime nuget package. diff --git a/eng/Analyzers.props b/eng/Analyzers.props index 2c9b1c8bee44..4405ca11687f 100644 --- a/eng/Analyzers.props +++ b/eng/Analyzers.props @@ -2,11 +2,12 @@ $(MSBuildThisFileDirectory)CodeAnalysis.ruleset - false + false - + - - + + + diff --git a/eng/AvoidRestoreCycleOnSelfReference.targets b/eng/AvoidRestoreCycleOnSelfReference.targets new file mode 100644 index 000000000000..cb665cb070d9 --- /dev/null +++ b/eng/AvoidRestoreCycleOnSelfReference.targets @@ -0,0 +1,14 @@ + + + + <_PackageIdTemp>$(PackageId) + $(PackageId)_temp + + + + + $(_PackageIdTemp) + + + \ No newline at end of file diff --git a/eng/BeforeTargetFrameworkInference.targets b/eng/BeforeTargetFrameworkInference.targets index 92adb5df6353..abef4c8981a2 100644 --- a/eng/BeforeTargetFrameworkInference.targets +++ b/eng/BeforeTargetFrameworkInference.targets @@ -6,10 +6,6 @@ $(TargetFramework.SubString(0, $(TargetFramework.IndexOf('-'))))
- - $([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(TargetFramework)')) - - diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index 42ea385a079d..12e930144ed2 100644 --- a/eng/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset @@ -1,371 +1,496 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/CodeAnalysis.test.ruleset b/eng/CodeAnalysis.test.ruleset new file mode 100644 index 000000000000..f46a2f8157a8 --- /dev/null +++ b/eng/CodeAnalysis.test.ruleset @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/Configurations.props b/eng/Configurations.props index aa8e9add17dd..352e32f6cab0 100644 --- a/eng/Configurations.props +++ b/eng/Configurations.props @@ -21,17 +21,19 @@ TODO: Update to $(MajorVersion).$(MinorVersion) when all sub-repos import Arcade at the beginning (SkipImportArcadeSdkFromRoot=false). --> - 5.0 + 6.0 + 5.0 + 5.0 .NETCoreApp $(NetCoreAppCurrentIdentifier),Version=v$(NetCoreAppCurrentVersion) net$(NetCoreAppCurrentVersion) + net$(AspNetCoreAppCurrentVersion) + net$(NetCoreAppToolCurrentVersion) + $(NetCoreAppCurrentIdentifier),Version=v$(NetCoreAppToolCurrentVersion) $(NetCoreAppCurrent) Microsoft.NETCore.App .NET $(NetCoreAppCurrentVersion) - - net472 - WINDOWS7.0 @@ -71,5 +73,7 @@ true true + + false
diff --git a/eng/DefaultGenApiDocIds.txt b/eng/DefaultGenApiDocIds.txt index 5576d9fad6ae..8b2af83b92d4 100644 --- a/eng/DefaultGenApiDocIds.txt +++ b/eng/DefaultGenApiDocIds.txt @@ -1,11 +1,6 @@ // These attributes should be excluded from reference assemblies. -T:System.ComponentModel.DesignerAttribute -T:System.ComponentModel.Design.Serialization.DesignerSerializerAttribute T:System.ComponentModel.Design.Serialization.RootDesignerSerializerAttribute -T:System.ComponentModel.EditorAttribute -T:System.ComponentModel.ToolboxItemAttribute -T:System.ComponentModel.TypeDescriptionProviderAttribute T:System.Configuration.ConfigurationPropertyAttribute T:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute T:System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute diff --git a/eng/SignCheckExclusionsFile.txt b/eng/SignCheckExclusionsFile.txt index dc77ca3e4603..b45e2daaceb8 100644 --- a/eng/SignCheckExclusionsFile.txt +++ b/eng/SignCheckExclusionsFile.txt @@ -6,10 +6,10 @@ ;; The apphost and comhost are template files, modified by the SDK to produce the executable for FDE ;; and SCD apps. If they are signed, the file that the SDK produces has an invalid signature and ;; can't be signed again. More info at https://github.com/dotnet/core-setup/pull/7549. -*apphost.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 -*singlefilehost.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 -*comhost.dll;;Template, https://github.com/dotnet/core-setup/pull/7549 -*apphosttemplateapphostexe.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 -*comhosttemplatecomhostdll.dll;;Template, https://github.com/dotnet/core-setup/pull/7549 -*staticapphosttemplateapphostexe.exe;;Template, https://github.com/dotnet/core-setup/pull/7549 +*apphost.exe;;Template, DO-NOT-SIGN, https://github.com/dotnet/core-setup/pull/7549 +*singlefilehost.exe;;Template, DO-NOT-SIGN, https://github.com/dotnet/core-setup/pull/7549 +*comhost.dll;;Template, DO-NOT-SIGN, https://github.com/dotnet/core-setup/pull/7549 +*apphosttemplateapphostexe.exe;;Template, DO-NOT-SIGN, https://github.com/dotnet/core-setup/pull/7549 +*comhosttemplatecomhostdll.dll;;Template, DO-NOT-SIGN, https://github.com/dotnet/core-setup/pull/7549 +*staticapphosttemplateapphostexe.exe;;Template, DO-NOT-SIGN, https://github.com/dotnet/core-setup/pull/7549 *dotnet.js;;Workaround, https://github.com/dotnet/core-eng/issues/9933 diff --git a/eng/Signing.props b/eng/Signing.props index 34821db7fc4e..471473fc7d97 100644 --- a/eng/Signing.props +++ b/eng/Signing.props @@ -28,11 +28,18 @@ + + + + + + +
- - - + + + @@ -47,10 +54,15 @@ - + - - + + + + + + + @@ -104,15 +116,15 @@ + + + - - - - - diff --git a/eng/Subsets.props b/eng/Subsets.props index 958389db150f..e2c4d1602f5b 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -54,37 +54,50 @@ - clr.runtime+linuxdac+clr.corelib+clr.nativecorelib+clr.tools+clr.packages + clr.runtime+clr.jit+clr.alljits+linuxdac+clr.corelib+clr.nativecorelib+clr.tools+clr.packages mono.llvm+ - $(DefaultMonoSubsets)mono.runtime+mono.corelib + mono.llvm+ + $(DefaultMonoSubsets)mono.wasmruntime+ + $(DefaultMonoSubsets)mono.runtime+mono.corelib+mono.packages - libs.depprojs+libs.native+libs.ref+libs.src+libs.pretest+libs.packages + libs.native+libs.ref+libs.src+libs.pretest+libs.packages corehost+installer.managed+installer.depprojs+installer.pkgprojs+bundles+installers+installer.tests installer.pkgprojs + corehost+$(DefaultInstallerSubsets) + <_subset>$(_subset.Replace('+clr.paltests+', '+clr.paltests+clr.paltestlist+')) <_subset>$(_subset.Replace('+clr+', '+$(DefaultCoreClrSubsets)+')) <_subset>$(_subset.Replace('+mono+', '+$(DefaultMonoSubsets)+')) <_subset>$(_subset.Replace('+libs+', '+$(DefaultLibrariesSubsets)+')) <_subset>$(_subset.Replace('+installer+', '+$(DefaultInstallerSubsets)+')) + <_subset>$(_subset.Replace('+installer.nocorehost+', '+$(DefaultInstallerSubsets.Replace('corehost+', ''))+')) <_subset>+$(_subset.Trim('+'))+ + + + ClrRuntimeSubset=true;ClrJitSubset=true + + + + + - + @@ -92,10 +105,11 @@ + + - @@ -106,6 +120,7 @@ + @@ -113,6 +128,10 @@ + + + + @@ -130,16 +149,42 @@ - - + + + + + + $(ClrRuntimeBuildSubsets);ClrRuntimeSubset=true;ClrJitSubset=true + + + + $(ClrRuntimeBuildSubsets);ClrJitSubset=true + + + + $(ClrRuntimeBuildSubsets);ClrPalTestsSubset=true + + + + $(ClrRuntimeBuildSubsets);ClrAllJitsSubset=true;ClrJitSubset=true + + + + + + + + - + - - + + @@ -168,6 +213,10 @@ + + + + @@ -177,12 +226,6 @@ - - - Configuration=$(LibrariesConfiguration) - - - @@ -195,6 +238,10 @@ + + + + @@ -222,15 +269,11 @@ - - - - @@ -259,6 +302,11 @@ + + + + + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2940b3c13c76..a769f55ebd2b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,167 +4,171 @@ https://github.com/dotnet/standard cfe95a23647c7de1fe1a349343115bd7720d6949 - + https://github.com/dotnet/icu - 797c523dd8d75096319f3591958f703b8d74d04b + ba48e6f5e60aa200a567f9dadef1046f7bf374ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://github.com/dotnet/arcade - ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915 + 19e7e769f7ca2ece42221f7ff951e7ec705498ec - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - d0bb63d2ec7060714e63ee4082fac48f2e57f3e2 + f69d7fc09c4fdb9e9427741b9a176e867dab577f - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - d0bb63d2ec7060714e63ee4082fac48f2e57f3e2 + f69d7fc09c4fdb9e9427741b9a176e867dab577f - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - d0bb63d2ec7060714e63ee4082fac48f2e57f3e2 + f69d7fc09c4fdb9e9427741b9a176e867dab577f - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - d0bb63d2ec7060714e63ee4082fac48f2e57f3e2 + f69d7fc09c4fdb9e9427741b9a176e867dab577f - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - d0bb63d2ec7060714e63ee4082fac48f2e57f3e2 + f69d7fc09c4fdb9e9427741b9a176e867dab577f - + https://github.com/microsoft/vstest - 069d8bd6357e2dbc260a35016ddbefe5dfec4102 + b195e2589980861425b331e73a859252c3f2b71a - + https://github.com/dotnet/runtime-assets - 5a041ae14a25fe6e5db62666778a7adb59d5a056 + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 - + https://github.com/dotnet/runtime-assets - 5a041ae14a25fe6e5db62666778a7adb59d5a056 + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 - + https://github.com/dotnet/runtime-assets - 5a041ae14a25fe6e5db62666778a7adb59d5a056 + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 - + https://github.com/dotnet/runtime-assets - 5a041ae14a25fe6e5db62666778a7adb59d5a056 + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 - + https://github.com/dotnet/runtime-assets - 5a041ae14a25fe6e5db62666778a7adb59d5a056 + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 - + https://github.com/dotnet/runtime-assets - 5a041ae14a25fe6e5db62666778a7adb59d5a056 + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 - + https://github.com/dotnet/runtime-assets - 5a041ae14a25fe6e5db62666778a7adb59d5a056 + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 - + https://github.com/dotnet/runtime-assets - 5a041ae14a25fe6e5db62666778a7adb59d5a056 + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 - + + https://github.com/dotnet/runtime-assets + edc9df4021be1dff54b8d8be88b4bee7626cb6a5 + + https://github.com/dotnet/llvm-project - 4e6a09468cb4e4e1be38ac25fcf866ca8136638b + 69cf173ab66c68e4282c1da56628b36d4ae2acc2 - + https://github.com/dotnet/llvm-project - 4e6a09468cb4e4e1be38ac25fcf866ca8136638b + 69cf173ab66c68e4282c1da56628b36d4ae2acc2 - + https://github.com/dotnet/llvm-project - 4e6a09468cb4e4e1be38ac25fcf866ca8136638b + 69cf173ab66c68e4282c1da56628b36d4ae2acc2 - + https://github.com/dotnet/llvm-project - 4e6a09468cb4e4e1be38ac25fcf866ca8136638b + 69cf173ab66c68e4282c1da56628b36d4ae2acc2 - + https://github.com/dotnet/llvm-project - 4e6a09468cb4e4e1be38ac25fcf866ca8136638b + 69cf173ab66c68e4282c1da56628b36d4ae2acc2 - + https://github.com/dotnet/llvm-project - 4e6a09468cb4e4e1be38ac25fcf866ca8136638b + 69cf173ab66c68e4282c1da56628b36d4ae2acc2 - + https://github.com/dotnet/llvm-project - 4e6a09468cb4e4e1be38ac25fcf866ca8136638b + 69cf173ab66c68e4282c1da56628b36d4ae2acc2 - + https://github.com/dotnet/llvm-project - 4e6a09468cb4e4e1be38ac25fcf866ca8136638b + 69cf173ab66c68e4282c1da56628b36d4ae2acc2 - + https://github.com/dotnet/runtime - 0375524a91a47ca4db3ee1be548f74bab7e26e76 + 38017c3935de95d0335bac04f4901ddfc2718656 - + https://github.com/dotnet/runtime - 0375524a91a47ca4db3ee1be548f74bab7e26e76 + 2544c744d204c6ae0e20ba78c9cb8832a92091f3 - + https://github.com/dotnet/runtime - 0375524a91a47ca4db3ee1be548f74bab7e26e76 + 2544c744d204c6ae0e20ba78c9cb8832a92091f3 https://github.com/dotnet/runtime @@ -178,21 +182,21 @@ https://github.com/dotnet/runtime bdfbf0cf85878673a80d7822cc11bde5c9fda30c - + https://github.com/dotnet/runtime - 0375524a91a47ca4db3ee1be548f74bab7e26e76 + 38017c3935de95d0335bac04f4901ddfc2718656 - + https://github.com/mono/linker - f7c8a2a9e5aa47718169140db23c42f3439e6660 + 57974c1f5790e6fb33f5fce161707be5cd86c4d3 - + https://github.com/dotnet/xharness - 5c95b40b725e1aa9d596411c453900385cf6f84c + bdad61dfc3d09ae826ba940d92e43a7441ec83b0 - + https://github.com/dotnet/xharness - 5c95b40b725e1aa9d596411c453900385cf6f84c + bdad61dfc3d09ae826ba940d92e43a7441ec83b0 diff --git a/eng/Versions.props b/eng/Versions.props index f398f9af2353..89c9cbf2c774 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,16 +1,18 @@ - 5.0.0 + 6.0.0 - 5 + 6 0 0 JsonCodeGen 1 - $(MajorVersion).$(MinorVersion).0.0 + + 5.0.0.0 false release @@ -18,6 +20,7 @@ true true false + true dotnet $(ContainerName) @@ -45,50 +48,81 @@ - - - + 6.0.0-preview1.20513.4 + 3.8.0-4.20503.2 - 5.0.0-beta.20364.3 - 5.0.0-beta.20364.3 - 5.0.0-beta.20364.3 - 5.0.0-beta.20364.3 - 5.0.0-beta.20364.3 - 5.0.0-beta.20364.3 - 2.5.1-beta.20364.3 - 5.0.0-beta.20364.3 - 5.0.0-beta.20364.3 - 5.0.0-beta.20364.3 + 6.0.0-beta.20529.1 + 6.0.0-beta.20529.1 + 6.0.0-beta.20529.1 + 6.0.0-beta.20529.1 + 6.0.0-beta.20529.1 + 6.0.0-beta.20529.1 + 2.5.1-beta.20529.1 + 6.0.0-beta.20529.1 + 6.0.0-beta.20529.1 + 6.0.0-beta.20529.1 - 5.0.0-preview.4.20202.18 - 5.0.0-preview.4.20202.18 - 5.0.0-preview.4.20202.18 + 5.0.0-rc.1.20451.14 + 6.0.0-alpha.1.20501.4 + 6.0.0-alpha.1.20501.4 3.1.0 5.0.0-preview.8.20359.4 - 5.0.0-preview.4.20202.18 + 1.2.0-beta.205 + 4.5.1 + 4.3.0 + 4.3.0 + 4.7.0 + 4.8.1 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.5.4 + 4.3.4 + 4.3.1 + 4.5.0 + 4.3.0 + 4.3.1 + 4.3.1 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.1 + 4.7.0 + 4.7.0 + 4.7.0 + 5.0.0-rc.1.20451.14 + 4.3.0 + 4.5.4 + 4.5.0 + 1.1.1 + 4.3.0 5.0.0-alpha.1.19563.3 - 5.0.0-beta.20364.1 - 5.0.0-beta.20364.1 - 5.0.0-beta.20364.1 - 5.0.0-beta.20364.1 - 5.0.0-beta.20364.1 - 5.0.0-beta.20364.1 - 5.0.0-beta.20364.1 - 5.0.0-beta.20364.1 + 5.0.0-beta.20527.1 + 5.0.0-beta.20527.1 + 5.0.0-beta.20527.1 + 5.0.0-beta.20527.1 + 5.0.0-beta.20527.1 + 5.0.0-beta.20527.1 + 5.0.0-beta.20527.1 + 5.0.0-beta.20527.1 + 5.0.0-beta.20527.1 2.2.0-prerelease.19564.1 + 2.0.3 - 99.99.99-master-20200228.3 - 99.99.99-master-20200228.3 - 99.99.99-master-20200228.3 - 99.99.99-master-20200228.3 - 99.99.99-master-20200228.3 - + 99.99.99-master-20200806.6 + 99.99.99-master-20200806.6 + 99.99.99-master-20200806.6 + 99.99.99-master-20200806.6 + 99.99.99-master-20200806.6 + 3.6.0-3.20207.2 3.0.0-beta2.final 3.6.0.0 @@ -105,33 +139,32 @@ $(RefOnlyMicrosoftBuildVersion) 4.9.4 4.9.4 - - 4.8.0 - 16.8.0-preview-20200716-03 - 1.0.0-prerelease.20352.3 - 1.0.0-prerelease.20352.3 + 16.8.0-release-20201022-02 + 1.0.0-prerelease.20530.4 + 1.0.0-prerelease.20530.4 2.4.1 2.4.2 1.3.0 2.0.5 12.0.3 4.12.0 + 2.14.3 - 3.0.0-preview-20200715.1 + 5.0.0-preview-20201009.2 - 5.0.0-preview.3.20366.2 + 6.0.0-alpha.1.20527.2 - 5.0.0-preview.8.20370.1 + 6.0.0-alpha.1.20526.1 - 9.0.1-alpha.1.20365.1 - 9.0.1-alpha.1.20365.1 - 9.0.1-alpha.1.20365.1 - 9.0.1-alpha.1.20365.1 - 9.0.1-alpha.1.20365.1 - 9.0.1-alpha.1.20365.1 - 9.0.1-alpha.1.20365.1 - 9.0.1-alpha.1.20365.1 + 9.0.1-alpha.1.20530.2 + 9.0.1-alpha.1.20530.2 + 9.0.1-alpha.1.20530.2 + 9.0.1-alpha.1.20530.2 + 9.0.1-alpha.1.20530.2 + 9.0.1-alpha.1.20530.2 + 9.0.1-alpha.1.20530.2 + 9.0.1-alpha.1.20530.2 @@ -150,7 +183,7 @@ Microsoft.NETCore.Runtime.ICU.Transport $([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', '$(MicrosoftPrivateIntellisensePackage)', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles', 'net')) diff --git a/eng/actions/backport/action.yml b/eng/actions/backport/action.yml new file mode 100644 index 000000000000..c136dd5ff6d4 --- /dev/null +++ b/eng/actions/backport/action.yml @@ -0,0 +1,18 @@ +name: 'PR Backporter' +description: 'Backports a pull request to a branch using the "/backport to " comment' +inputs: + auth_token: + description: 'The token used to authenticate to GitHub.' + pr_title_template: + description: 'The template used for the PR title. Special placeholder tokens that will be replaced with a value: %target_branch%, %source_pr_title%, %source_pr_number%, %cc_users%.' + default: '[%target_branch%] %source_pr_title%' + pr_description_template: + description: 'The template used for the PR description. Special placeholder tokens that will be replaced with a value: %target_branch%, %source_pr_title%, %source_pr_number%, %cc_users%.' + default: | + Backport of #%source_pr_number% to %target_branch% + + /cc %cc_users% + +runs: + using: 'node12' + main: 'index.js' diff --git a/eng/actions/backport/index.js b/eng/actions/backport/index.js new file mode 100644 index 000000000000..076196100f37 --- /dev/null +++ b/eng/actions/backport/index.js @@ -0,0 +1,174 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +function BackportException(message, postToGitHub = true) { + this.message = message; + this.postToGitHub = postToGitHub; +} + +async function run() { + const util = require("util"); + const jsExec = util.promisify(require("child_process").exec); + + console.log("Installing npm dependencies"); + const { stdout, stderr } = await jsExec("npm install @actions/core @actions/github @actions/exec"); + console.log("npm-install stderr:\n\n" + stderr); + console.log("npm-install stdout:\n\n" + stdout); + console.log("Finished installing npm dependencies"); + + const core = require("@actions/core"); + const github = require("@actions/github"); + const exec = require("@actions/exec"); + + if (github.context.eventName !== "issue_comment") throw "Error: This action only works on issue_comment events."; + + const run_id = process.env.GITHUB_RUN_ID; + const repo_owner = github.context.payload.repository.owner.login; + const repo_name = github.context.payload.repository.name; + const pr_number = github.context.payload.issue.number; + const pr_source_ref = process.env.GITHUB_REF; + const comment_user = github.context.payload.comment.user.login; + + let octokit = github.getOctokit(core.getInput("auth_token")); + let target_branch = ""; + + try { + // verify the comment user is a repo collaborator + try { + await octokit.repos.checkCollaborator({ + owner: repo_owner, + repo: repo_name, + username: comment_user + }); + console.log(`Verified ${comment_user} is a repo collaborator.`); + } catch { + throw new BackportException(`Error: @${comment_user} is not a repo collaborator, backporting is not allowed.`); + } + + // extract the target branch name from the trigger phrase containing these characters: a-z, A-Z, digits, forward slash, dot, hyphen, underscore + console.log(`Extracting target branch`); + const regex = /\/backport to ([a-zA-Z\d\/\.\-\_]+)/; + target_branch = regex.exec(github.context.payload.comment.body)[1]; + if (target_branch == null) throw new BackportException("Error: No backport branch found in the trigger phrase."); + try { await exec.exec(`git ls-remote --exit-code --heads origin ${target_branch}`) } catch { throw new BackportException(`Error: The specified backport target branch ${target_branch} wasn't found in the repo.`); } + console.log(`Backport target branch: ${target_branch}`); + + // Post backport started comment to pull request + const backport_start_body = `Started backporting to ${target_branch}: https://github.com/${repo_owner}/${repo_name}/actions/runs/${run_id}`; + await octokit.issues.createComment({ + owner: repo_owner, + repo: repo_name, + issue_number: pr_number, + body: backport_start_body + }); + + console.log("Applying backport patch"); + + await exec.exec(`git -c protocol.version=2 fetch --no-tags --progress --no-recurse-submodules origin ${target_branch} ${pr_source_ref}`); + await exec.exec(`git checkout ${target_branch}`); + await exec.exec(`git clean -xdff`); + + // configure git + await exec.exec(`git config user.name "github-actions"`); + await exec.exec(`git config user.email "github-actions@github.com"`); + + // create temporary backport branch + const temp_branch = `backport/pr-${pr_number}-to-${target_branch}`; + await exec.exec(`git checkout -b ${temp_branch}`); + + // skip opening PR if the branch already exists on the origin remote since that means it was opened + // by an earlier backport and force pushing to the branch updates the existing PR + let should_open_pull_request = true; + try { + await exec.exec(`git ls-remote --exit-code --heads origin ${temp_branch}`); + should_open_pull_request = false; + } catch { } + + // download and apply patch + await exec.exec(`curl -sSL "${github.context.payload.issue.pull_request.patch_url}" --output changes.patch`); + + const git_am_command = "git am --3way --ignore-whitespace --keep-non-patch changes.patch"; + let git_am_output = `$ ${git_am_command}\n\n`; + let git_am_failed = false; + try { + await exec.exec(git_am_command, [], { + listeners: { + stdout: function stdout(data) { git_am_output += data; }, + stderr: function stderr(data) { git_am_output += data; } + } + }); + } catch (error) { + git_am_output += error; + git_am_failed = true; + } + + if (git_am_failed) { + const git_am_failed_body = `@${github.context.payload.comment.user.login} backporting to ${target_branch} failed, the patch most likely resulted in conflicts:\n\n\`\`\`shell\n${git_am_output}\n\`\`\`\n\nPlease backport manually!`; + await octokit.issues.createComment({ + owner: repo_owner, + repo: repo_name, + issue_number: pr_number, + body: git_am_failed_body + }); + throw new BackportException("Error: git am failed, most likely due to a merge conflict.", false); + } + else { + // push the temp branch to the repository + await exec.exec(`git push --force --set-upstream origin HEAD:${temp_branch}`); + } + + if (!should_open_pull_request) { + console.log("Backport temp branch already exists, skipping opening a PR."); + return; + } + + // prepate the GitHub PR details + let backport_pr_title = core.getInput("pr_title_template"); + let backport_pr_description = core.getInput("pr_description_template"); + + // get users to cc (append PR author if different from user who issued the backport command) + let cc_users = `@${comment_user}`; + if (comment_user != github.context.payload.issue.user.login) cc_users += ` @${github.context.payload.issue.user.login}`; + + // replace the special placeholder tokens with values + backport_pr_title = backport_pr_title + .replace(/%target_branch%/g, target_branch) + .replace(/%source_pr_title%/g, github.context.payload.issue.title) + .replace(/%source_pr_number%/g, github.context.payload.issue.number) + .replace(/%cc_users%/g, cc_users); + + backport_pr_description = backport_pr_description + .replace(/%target_branch%/g, target_branch) + .replace(/%source_pr_title%/g, github.context.payload.issue.title) + .replace(/%source_pr_number%/g, github.context.payload.issue.number) + .replace(/%cc_users%/g, cc_users); + + // open the GitHub PR + await octokit.pulls.create({ + owner: repo_owner, + repo: repo_name, + title: backport_pr_title, + body: backport_pr_description, + head: temp_branch, + base: target_branch + }); + + console.log("Successfully opened the GitHub PR."); + } catch (error) { + + core.setFailed(error); + + if (error.postToGitHub === undefined || error.postToGitHub == true) { + // post failure to GitHub comment + const unknown_error_body = `@${comment_user} an error occurred while backporting to ${target_branch}, please check the run log for details!\n\n${error.message}`; + await octokit.issues.createComment({ + owner: repo_owner, + repo: repo_name, + issue_number: pr_number, + body: unknown_error_body + }); + } + } +} + +run(); diff --git a/eng/build.ps1 b/eng/build.ps1 index f8b205bd3930..df1750a87103 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -15,6 +15,8 @@ Param( [Parameter(Position=0)][string][Alias('s')]$subset, [ValidateSet("Debug","Release","Checked")][string][Alias('rc')]$runtimeConfiguration, [ValidateSet("Debug","Release")][string][Alias('lc')]$librariesConfiguration, + [ValidateSet("CoreCLR","Mono")][string][Alias('rf')]$runtimeFlavor, + [switch]$ninja, [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties ) @@ -38,6 +40,8 @@ function Get-Help() { Write-Host " Checked is exclusive to the CLR runtime. It is the same as Debug, except code is" Write-Host " compiled with optimizations enabled." Write-Host " [Default: Debug]" + Write-Host " -runtimeFlavor (-rf) Runtime flavor: CoreCLR or Mono." + Write-Host " [Default: CoreCLR]" Write-Host " -subset (-s) Build a subset, print available subsets with -subset help." Write-Host " '-subset' can be omitted if the subset is given as the first argument." Write-Host " [Default: Builds the entire repo.]" @@ -65,12 +69,15 @@ function Get-Help() { Write-Host "Libraries settings:" Write-Host " -allconfigurations Build packages for all build configurations." Write-Host " -coverage Collect code coverage when testing." - Write-Host " -framework (-f) Build framework: net5.0 or net472." - Write-Host " [Default: net5.0]" + Write-Host " -framework (-f) Build framework: net6.0 or net48." + Write-Host " [Default: net6.0]" Write-Host " -testnobuild Skip building tests when invoking -test." Write-Host " -testscope Scope tests, allowed values: innerloop, outerloop, all." Write-Host "" + Write-Host "Native build settings:" + Write-Host " -ninja Use Ninja instead of MSBuild to run the native build." + Write-Host "Command-line arguments not listed above are passed through to MSBuild." Write-Host "The above arguments can be shortened as much as to be unambiguous." Write-Host "(Example: -con for configuration, -t for test, etc.)." @@ -103,7 +110,7 @@ function Get-Help() { Write-Host "For more information, check out https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md" } -if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) { +if ($help) { Get-Help exit 0 } @@ -114,25 +121,63 @@ if ($subset -eq 'help') { } if ($vs) { - . $PSScriptRoot\common\tools.ps1 - - if (-Not (Test-Path $vs)) { + if ($vs -ieq "coreclr.sln") { + # If someone passes in coreclr.sln (case-insensitive), + # launch the generated CMake solution. + $archToOpen = $arch[0] + $configToOpen = $configuration[0] + if ($runtimeConfiguration) { + $configToOpen = $runtimeConfiguration + } + $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\coreclr" | Join-Path -ChildPath "Windows_NT.$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "CoreCLR.sln" + if (-Not (Test-Path $vs)) { + $repoRoot = Split-Path $PSScriptRoot -Parent + Invoke-Expression "& `"$repoRoot/src/coreclr/build-runtime.cmd`" -configureonly -$archToOpen -$configToOpen" + if ($lastExitCode -ne 0) { + Write-Error "Failed to generate the CoreCLR solution file." + exit 1 + } + if (-Not (Test-Path $vs)) { + Write-Error "Unable to find the CoreCLR solution file at $vs." + } + } + } + elseif (-Not (Test-Path $vs)) { $solution = $vs - # Search for the solution in libraries - $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\libraries" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.sln" + + if ($runtimeFlavor -eq "Mono") { + # Search for the solution in mono + $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\mono\netcore" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.sln" + } else { + # Search for the solution in coreclr + $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\coreclr\src" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.sln" + } + if (-Not (Test-Path $vs)) { $vs = $solution - # Search for the solution in installer - if (-Not ($vs.endswith(".sln"))) { - $vs = "$vs.sln" - } - $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\installer" | Join-Path -ChildPath $vs + + # Search for the solution in libraries + $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\libraries" | Join-Path -ChildPath $vs | Join-Path -ChildPath "$vs.sln" + if (-Not (Test-Path $vs)) { - Write-Error "Passed in solution cannot be resolved." - exit 1 + $vs = $solution + + # Search for the solution in installer + if (-Not ($vs.endswith(".sln"))) { + $vs = "$vs.sln" + } + + $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "src\installer" | Join-Path -ChildPath $vs + + if (-Not (Test-Path $vs)) { + Write-Error "Passed in solution cannot be resolved." + exit 1 + } } } } + + . $PSScriptRoot\common\tools.ps1 # This tells .NET Core to use the bootstrapped runtime $env:DOTNET_ROOT=InitializeDotNetCli -install:$true -createSdkLocationFile:$true @@ -151,7 +196,7 @@ if ($vs) { # Respect the RuntimeConfiguration variable for building inside VS with different runtime configurations $env:RUNTIMECONFIGURATION=$runtimeConfiguration } - + # Restore the solution to workaround https://github.com/dotnet/runtime/issues/32205 Invoke-Expression "& dotnet restore $vs" @@ -177,12 +222,14 @@ foreach ($argument in $PSBoundParameters.Keys) switch($argument) { "runtimeConfiguration" { $arguments += " /p:RuntimeConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" } + "runtimeFlavor" { $arguments += " /p:RuntimeFlavor=$($PSBoundParameters[$argument].ToLowerInvariant())" } "librariesConfiguration" { $arguments += " /p:LibrariesConfiguration=$((Get-Culture).TextInfo.ToTitleCase($($PSBoundParameters[$argument])))" } "framework" { $arguments += " /p:BuildTargetFramework=$($PSBoundParameters[$argument].ToLowerInvariant())" } "os" { $arguments += " /p:TargetOS=$($PSBoundParameters[$argument])" } "allconfigurations" { $arguments += " /p:BuildAllConfigurations=true" } "properties" { $arguments += " " + $properties } "verbosity" { $arguments += " -$argument " + $($PSBoundParameters[$argument]) } + "ninja" { $arguments += " /p:Ninja=$($PSBoundParameters[$argument])" } # configuration and arch can be specified multiple times, so they should be no-ops here "configuration" {} "arch" {} diff --git a/eng/build.sh b/eng/build.sh index eb0cb586ebf3..5904565f9143 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -36,6 +36,8 @@ usage() echo " Checked is exclusive to the CLR runtime. It is the same as Debug, except code is" echo " compiled with optimizations enabled." echo " [Default: Debug]" + echo " -runtimeFlavor (-rf) Runtime flavor: CoreCLR or Mono." + echo " [Default: CoreCLR]" echo " --subset (-s) Build a subset, print available subsets with -subset help." echo " '--subset' can be omitted if the subset is given as the first argument." echo " [Default: Builds the entire repo.]" @@ -60,8 +62,8 @@ usage() echo "Libraries settings:" echo " --allconfigurations Build packages for all build configurations." echo " --coverage Collect code coverage when testing." - echo " --framework (-f) Build framework: net5.0 or net472." - echo " [Default: net5.0]" + echo " --framework (-f) Build framework: net6.0 or net48." + echo " [Default: net6.0]" echo " --testnobuild Skip building tests when invoking -test." echo " --testscope Test scope, allowed values: innerloop, outerloop, all." echo "" @@ -74,6 +76,8 @@ usage() echo " --gcc Optional argument to build using gcc in PATH (default)." echo " --gccx.y Optional argument to build using gcc version x.y." echo " --portablebuild Optional argument: set to false to force a non-portable build." + echo " --keepnativesymbols Optional argument: set to true to keep native symbols/debuginfo in generated binaries." + echo " --ninja Optional argument: set to true to use Ninja instead of Make to run the native build." echo "" echo "Command line arguments starting with '/p:' are passed through to MSBuild." @@ -97,6 +101,9 @@ usage() echo "* Build CoreCLR for Linux x64 on Debug configuration using GCC 8.4." echo "./build.sh clr -gcc8.4" echo "" + echo "* Build CoreCLR for Linux x64 using extra compiler flags (-fstack-clash-protection)." + echo "EXTRA_CFLAGS=-fstack-clash-protection EXTRA_CXXFLAGS=-fstack-clash-protection ./build.sh clr" + echo "" echo "* Cross-compile CoreCLR runtime for Linux ARM64 on Release configuration." echo "./build.sh clr.runtime -arch arm64 -c release -cross" echo "" @@ -127,8 +134,8 @@ initDistroRid() local isCrossBuild="$3" local isPortableBuild="$4" - # Only pass ROOTFS_DIR if __DoCrossArchBuild is specified. - if (( isCrossBuild == 1 )); then + # Only pass ROOTFS_DIR if __DoCrossArchBuild is specified and the current platform is not OSX that doesn't use rootfs + if [[ $isCrossBuild == 1 && "$targetOs" != "OSX" ]]; then passedRootfsDir=${ROOTFS_DIR} fi initDistroRidGlobal ${targetOs} ${buildArch} ${isPortableBuild} ${passedRootfsDir} @@ -147,6 +154,8 @@ portableBuild=1 source $scriptroot/native/init-os-and-arch.sh +hostArch=$arch + # Check if an action is passed in declare -a actions=("b" "build" "r" "restore" "rebuild" "testnobuild" "sign" "publish" "clean") actInt=($(comm -12 <(printf '%s\n' "${actions[@]/#/-}" | sort) <(printf '%s\n' "${@/#--/-}" | sort))) @@ -169,7 +178,7 @@ while [[ $# > 0 ]]; do firstArgumentChecked=1 case "$opt" in - -help|-h) + -help|-h|-\?|/?) usage exit 0 ;; @@ -319,6 +328,26 @@ while [[ $# > 0 ]]; do shift 2 ;; + -runtimeflavor|-rf) + if [ -z ${2+x} ]; then + echo "No runtime flavor supplied. See help (--help) for supported runtime flavors." 1>&2 + exit 1 + fi + passedRuntimeFlav="$(echo "$2" | awk '{print tolower($0)}')" + case "$passedRuntimeFlav" in + coreclr|mono) + val="$(tr '[:lower:]' '[:upper:]' <<< ${passedRuntimeFlav:0:1})${passedRuntimeFlav:1}" + ;; + *) + echo "Unsupported runtime flavor '$2'." + echo "The allowed values are CoreCLR and Mono." + exit 1 + ;; + esac + arguments="$arguments /p:RuntimeFlavor=$val" + shift 2 + ;; + -librariesconfiguration|-lc) if [ -z ${2+x} ]; then echo "No libraries configuration supplied. See help (--help) for supported libraries configurations." 1>&2 @@ -377,6 +406,38 @@ while [[ $# > 0 ]]; do shift 2 ;; + -keepnativesymbols) + if [ -z ${2+x} ]; then + echo "No value for keepNativeSymbols is supplied. See help (--help) for supported values." 1>&2 + exit 1 + fi + passedKeepNativeSymbols="$(echo "$2" | awk '{print tolower($0)}')" + if [ "$passedKeepNativeSymbols" = true ]; then + arguments="$arguments /p:KeepNativeSymbols=true" + fi + shift 2 + ;; + + + -ninja) + if [ -z ${2+x} ]; then + arguments="$arguments /p:Ninja=true" + shift 1 + else + ninja="$(echo "$2" | awk '{print tolower($0)}')" + if [ "$ninja" = true ]; then + arguments="$arguments /p:Ninja=true" + shift 2 + elif [ "$ninja" = false ]; then + arguments="$arguments /p:Ninja=false" + shift 2 + else + arguments="$arguments /p:Ninja=true" + shift 1 + fi + fi + ;; + *) extraargs="$extraargs $1" shift 1 @@ -388,11 +449,16 @@ if [ ${#actInt[@]} -eq 0 ]; then arguments="-restore -build $arguments" fi +if [ "$os" = "Browser" ] && [ "$arch" != "wasm" ]; then + # override default arch for Browser, we only support wasm + arch=wasm +fi + initDistroRid $os $arch $crossBuild $portableBuild # 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}" -arguments="$arguments /p:TargetArchitecture=$arch" +arguments="$arguments /p:TargetArchitecture=$arch /p:BuildArchitecture=$hostArch" arguments="$arguments /p:CMakeArgs=\"$cmakeargs\" $extraargs" "$scriptroot/common/build.sh" $arguments diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1 index dc22178125a6..bb3617133f09 100644 --- a/eng/common/SetupNugetSources.ps1 +++ b/eng/common/SetupNugetSources.ps1 @@ -11,6 +11,8 @@ # See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)` # from the AzureDevOps-Artifact-Feeds-Pats variable group. # +# Any disabledPackageSources entries which start with "darc-int" will be re-enabled as part of this script executing +# # - task: PowerShell@2 # displayName: Setup Private Feeds Credentials # condition: eq(variables['Agent.OS'], 'Windows_NT') @@ -94,6 +96,14 @@ function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $Passw } } +function EnablePrivatePackageSources($DisabledPackageSources) { + $maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") + ForEach ($DisabledPackageSource in $maestroPrivateSources) { + Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled" + $DisabledPackageSource.SetAttribute("value", "false") + } +} + if (!(Test-Path $ConfigFile -PathType Leaf)) { Write-PipelineTelemetryError -Category 'Build' -Message "Eng/common/SetupNugetSources.ps1 returned a non-zero exit code. Couldn't find the NuGet config file: $ConfigFile" ExitWithExitCode 1 @@ -123,6 +133,13 @@ if ($creds -eq $null) { $doc.DocumentElement.AppendChild($creds) | Out-Null } +# Check for disabledPackageSources; we'll enable any darc-int ones we find there +$disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources") +if ($disabledSources -ne $null) { + Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node" + EnablePrivatePackageSources -DisabledPackageSources $disabledSources +} + $userName = "dn-bot" # Insert credential nodes for Maestro's private feeds diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh index f33e37711e72..ef33382954cf 100644 --- a/eng/common/SetupNugetSources.sh +++ b/eng/common/SetupNugetSources.sh @@ -13,6 +13,8 @@ # See example YAML call for this script below. Note the use of the variable `$(dn-bot-dnceng-artifact-feeds-rw)` # from the AzureDevOps-Artifact-Feeds-Pats variable group. # +# Any disabledPackageSources entries which start with "darc-int" will be re-enabled as part of this script executing. +# # - task: Bash@3 # displayName: Setup Private Feeds Credentials # inputs: @@ -63,7 +65,7 @@ if [ "$?" != "0" ]; then ConfigNodeHeader="" PackageSourcesTemplate="${TB}${NL}${TB}" - sed -i.bak "s|$ConfigNodeHeader|$ConfigNodeHeader${NL}$PackageSourcesTemplate|" NuGet.config + sed -i.bak "s|$ConfigNodeHeader|$ConfigNodeHeader${NL}$PackageSourcesTemplate|" $ConfigFile fi # Ensure there is a ... section. @@ -74,7 +76,7 @@ if [ "$?" != "0" ]; then PackageSourcesNodeFooter="" PackageSourceCredentialsTemplate="${TB}${NL}${TB}" - sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" NuGet.config + sed -i.bak "s|$PackageSourcesNodeFooter|$PackageSourcesNodeFooter${NL}$PackageSourceCredentialsTemplate|" $ConfigFile fi PackageSources=() @@ -146,3 +148,20 @@ for FeedName in ${PackageSources[@]} ; do sed -i.bak "s|$PackageSourceCredentialsNodeFooter|$NewCredential${NL}$PackageSourceCredentialsNodeFooter|" $ConfigFile fi done + +# Re-enable any entries in disabledPackageSources where the feed name contains darc-int +grep -i "" $ConfigFile +if [ "$?" == "0" ]; then + DisabledDarcIntSources=() + echo "Re-enabling any disabled \"darc-int\" package sources in $ConfigFile" + DisabledDarcIntSources+=$(grep -oh '"darc-int-[^"]*" value="true"' $ConfigFile | tr -d '"') + for DisabledSourceName in ${DisabledDarcIntSources[@]} ; do + if [[ $DisabledSourceName == darc-int* ]] + then + OldDisableValue="add key=\"$DisabledSourceName\" value=\"true\"" + NewDisableValue="add key=\"$DisabledSourceName\" value=\"false\"" + sed -i.bak "s|$OldDisableValue|$NewDisableValue|" $ConfigFile + echo "Neutralized disablePackageSources entry for '$DisabledSourceName'" + fi + done +fi diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index 67ee6d28d3fa..94a91c0817e8 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -23,6 +23,8 @@ Param( [switch][Alias('nobl')]$excludeCIBinarylog, [switch] $ci, [switch] $prepareMachine, + [string] $runtimeSourceFeed = '', + [string] $runtimeSourceFeedKey = '', [switch] $help, [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties ) diff --git a/eng/common/build.sh b/eng/common/build.sh index 6d7c5a1f69c2..252b63604e6e 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -76,9 +76,10 @@ projects='' configuration='Debug' prepare_machine=false verbosity='minimal' +runtime_source_feed='' +runtime_source_feed_key='' properties='' - while [[ $# > 0 ]]; do opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" case "$opt" in @@ -151,6 +152,14 @@ while [[ $# > 0 ]]; do node_reuse=$2 shift ;; + -runtimesourcefeed) + runtime_source_feed=$2 + shift + ;; + -runtimesourcefeedkey) + runtime_source_feed_key=$2 + shift + ;; *) properties="$properties $1" ;; diff --git a/eng/common/cross/arm64/tizen-build-rootfs.sh b/eng/common/cross/arm64/tizen-build-rootfs.sh old mode 100644 new mode 100755 diff --git a/eng/common/cross/arm64/tizen-fetch.sh b/eng/common/cross/arm64/tizen-fetch.sh old mode 100644 new mode 100755 index 338d1c3bf3c7..a48a6f51c49d --- a/eng/common/cross/arm64/tizen-fetch.sh +++ b/eng/common/cross/arm64/tizen-fetch.sh @@ -161,7 +161,7 @@ fetch_tizen_pkgs aarch64 gcc glibc glibc-devel libicu libicu-devel libatomic lin Inform "fetch coreclr packages" fetch_tizen_pkgs aarch64 lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu Inform "fetch corefx packages" -fetch_tizen_pkgs aarch64 libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl1.1-devel krb5 krb5-devel +fetch_tizen_pkgs aarch64 libcom_err libcom_err-devel zlib zlib-devel libopenssl11 libopenssl1.1-devel krb5 krb5-devel Inform "Initialize standard unified" fetch_tizen_pkgs_init standard unified diff --git a/eng/common/cross/armel/tizen-build-rootfs.sh b/eng/common/cross/armel/tizen-build-rootfs.sh index 25a0efa0bdd6..9a4438af61c2 100755 --- a/eng/common/cross/armel/tizen-build-rootfs.sh +++ b/eng/common/cross/armel/tizen-build-rootfs.sh @@ -30,8 +30,6 @@ rm -rf $TIZEN_TMP_DIR # Configure Tizen rootfs echo ">>Start configuring Tizen rootfs" -rm ./usr/lib/libunwind.so -ln -s libunwind.so.8 ./usr/lib/libunwind.so ln -sfn asm-arm ./usr/include/asm patch -p1 < $__TIZEN_CROSSDIR/tizen.patch echo "< + diff --git a/eng/common/performance/blazor_perf.proj b/eng/common/performance/blazor_perf.proj new file mode 100644 index 000000000000..3b25359c4380 --- /dev/null +++ b/eng/common/performance/blazor_perf.proj @@ -0,0 +1,30 @@ + + + python3 + $(HelixPreCommands);chmod +x $HELIX_WORKITEM_PAYLOAD/SOD/SizeOnDisk + + + + + %(Identity) + + + + + %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\ + $(ScenarioDirectory)blazor\ + + + $HELIX_CORRELATION_PAYLOAD/performance/src/scenarios/ + $(ScenarioDirectory)blazor/ + + + + + $(WorkItemDirectory) + cd $(BlazorDirectory);$(Python) pre.py publish --msbuild %27/p:_TrimmerDumpDependencies=true%27 --msbuild-static AdditionalMonoLinkerOptions=%27"%24(AdditionalMonoLinkerOptions) --dump-dependencies"%27 --binlog %27./traces/blazor_publish.binlog%27 + $(Python) test.py sod --scenario-name "%(Identity)" + $(Python) post.py + + + \ No newline at end of file diff --git a/eng/common/performance/crossgen_perf.proj b/eng/common/performance/crossgen_perf.proj new file mode 100644 index 000000000000..79a5486546ea --- /dev/null +++ b/eng/common/performance/crossgen_perf.proj @@ -0,0 +1,110 @@ + + + + + %(Identity) + + + + + + py -3 + $(HelixPreCommands) + %HELIX_CORRELATION_PAYLOAD%\Core_Root + %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\ + $(ScenarioDirectory)crossgen\ + $(ScenarioDirectory)crossgen2\ + + + python3 + $(HelixPreCommands);chmod +x $HELIX_WORKITEM_PAYLOAD/startup/Startup;chmod +x $HELIX_WORKITEM_PAYLOAD/startup/perfcollect;sudo apt update + $HELIX_CORRELATION_PAYLOAD/Core_Root + $HELIX_CORRELATION_PAYLOAD/performance/src/scenarios/ + $(ScenarioDirectory)crossgen/ + $(ScenarioDirectory)crossgen2/ + + + + + + + + + + + + + + + + + + + + + + + $(WorkItemDirectory) + $(Python) $(CrossgenDirectory)test.py crossgen --core-root $(CoreRoot) --test-name %(Identity) + + + + + + $(WorkItemDirectory) + $(Python) $(Crossgen2Directory)test.py crossgen2 --core-root $(CoreRoot) --single %(Identity) + + + + + + $(WorkItemDirectory) + $(Python) $(Crossgen2Directory)test.py crossgen2 --core-root $(CoreRoot) --single %(Identity) --singlethreaded True + + + + + + $(WorkItemDirectory) + $(Python) pre.py crossgen --core-root $(CoreRoot) --single %(Identity) + $(Python) test.py sod --scenario-name "Crossgen %(Identity) Size" --dirs ./crossgen/ + $(Python) post.py + + + + + + $(WorkItemDirectory) + $(Python) $(Crossgen2Directory)pre.py crossgen2 --core-root $(CoreRoot) --single %(Identity) + $(Python) test.py sod --scenario-name "Crossgen2 %(Identity) Size" --dirs ./crossgen/ + $(Python) post.py + + + + + + + 4:00 + + + + 4:00 + + + 4:00 + + + $(WorkItemDirectory) + $(Python) $(Crossgen2Directory)test.py crossgen2 --core-root $(CoreRoot) --composite $(Crossgen2Directory)framework-r2r.dll.rsp + 1:00 + + + 4:00 + + + 4:00 + + + \ No newline at end of file diff --git a/eng/common/performance/microbenchmarks.proj b/eng/common/performance/microbenchmarks.proj new file mode 100644 index 000000000000..94b6efbc9297 --- /dev/null +++ b/eng/common/performance/microbenchmarks.proj @@ -0,0 +1,144 @@ + + + + %HELIX_CORRELATION_PAYLOAD%\performance\scripts\benchmarks_ci.py --csproj %HELIX_CORRELATION_PAYLOAD%\performance\$(TargetCsproj) + --dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP% + py -3 + %HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe + %HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe + + $(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD% + %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts + %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline + %HELIX_CORRELATION_PAYLOAD%\performance\src\tools\ResultsComparer\ResultsComparer.csproj + %HELIX_CORRELATION_PAYLOAD%\performance\tools\dotnet\$(Architecture)\dotnet.exe + %25%25 + %HELIX_WORKITEM_ROOT%\testResults.xml + + + + $HELIX_CORRELATION_PAYLOAD + $(BaseDirectory)/performance + + + + $HELIX_WORKITEM_PAYLOAD + $(BaseDirectory) + + + + $(PerformanceDirectory)/scripts/benchmarks_ci.py --csproj $(PerformanceDirectory)/$(TargetCsproj) + --dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP + python3 + $(BaseDirectory)/Core_Root/corerun + $(BaseDirectory)/Baseline_Core_Root/corerun + $(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh + $(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts + $(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts_Baseline + $(PerformanceDirectory)/src/tools/ResultsComparer/ResultsComparer.csproj + $(PerformanceDirectory)/tools/dotnet/$(Architecture)/dotnet + %25 + $HELIX_WORKITEM_ROOT/testResults.xml + + + + $(CliArguments) --wasm + + + + --corerun %HELIX_CORRELATION_PAYLOAD%\dotnet-mono\shared\Microsoft.NETCore.App\6.0.0\corerun.exe + + + --corerun $(BaseDirectory)/dotnet-mono/shared/Microsoft.NETCore.App/6.0.0/corerun + + + + --corerun $(CoreRun) + + + + --corerun $(BaselineCoreRun) + + + + $(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments) + + + + $(WorkItemCommand) $(CliArguments) + + + + 2:30 + 0:15 + + + + + %(Identity) + + + + + 30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + $(WorkItemDirectory) + $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" + $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" + $(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand) + $(WorkItemTimeout) + + + + + + $(WorkItemDirectory) + $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument)" + $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)" + $(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults) + 4:00 + + + \ No newline at end of file diff --git a/eng/common/performance/perfhelixpublish.proj b/eng/common/performance/perfhelixpublish.proj deleted file mode 100644 index 272366da95fc..000000000000 --- a/eng/common/performance/perfhelixpublish.proj +++ /dev/null @@ -1,192 +0,0 @@ - - - - %HELIX_CORRELATION_PAYLOAD%\performance\scripts\benchmarks_ci.py --csproj %HELIX_CORRELATION_PAYLOAD%\performance\$(TargetCsproj) - --dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP% - py -3 - %HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe - %HELIX_CORRELATION_PAYLOAD%\Baseline_Core_Root\CoreRun.exe - - $(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD% - %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts - %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts_Baseline - %HELIX_CORRELATION_PAYLOAD%\performance\src\tools\ResultsComparer\ResultsComparer.csproj - %HELIX_CORRELATION_PAYLOAD%\performance\tools\dotnet\$(Architecture)\dotnet.exe - %25%25 - %HELIX_WORKITEM_ROOT%\testResults.xml - - - - $HELIX_CORRELATION_PAYLOAD - $(BaseDirectory)/performance - - - - $HELIX_WORKITEM_PAYLOAD - $(BaseDirectory) - - - - $(PerformanceDirectory)/scripts/benchmarks_ci.py --csproj $(PerformanceDirectory)/$(TargetCsproj) - --dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP - python3 - $(BaseDirectory)/Core_Root/corerun - $(BaseDirectory)/Baseline_Core_Root/corerun - $(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh - $(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts - $(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts_Baseline - $(PerformanceDirectory)/src/tools/ResultsComparer/ResultsComparer.csproj - $(PerformanceDirectory)/tools/dotnet/$(Architecture)/dotnet - %25 - $HELIX_WORKITEM_ROOT/testResults.xml - - - - --corerun %HELIX_CORRELATION_PAYLOAD%\dotnet-mono\shared\Microsoft.NETCore.App\5.0.0\corerun.exe - - - --corerun $(BaseDirectory)/dotnet-mono/shared/Microsoft.NETCore.App/5.0.0/corerun - - - - --corerun $(CoreRun) - - - - --corerun $(BaselineCoreRun) - - - - $(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments) - - - - $(WorkItemCommand) $(CliArguments) - - - - 2:30 - 0:15 - - - - - %(Identity) - - - - - 30 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - $(WorkItemDirectory) - $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" - $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" - $(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults);$(FinalCommand) - $(WorkItemTimeout) - - - - - - $(WorkItemDirectory) - $(WorkItemCommand) --bdn-artifacts $(BaselineArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(BaselineCoreRunArgument)" - $(WorkItemCommand) --bdn-artifacts $(ArtifactsDirectory) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument)" - $(DotnetExe) run -f $(_Framework) -p $(ResultsComparer) --base $(BaselineArtifactsDirectory) --diff $(ArtifactsDirectory) --threshold 2$(Percent) --xml $(XMLResults) - 4:00 - - - - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen\test.py crossgen --test-name System.Private.CoreLib.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single System.Private.Xml.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single System.Linq.Expressions.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single Microsoft.CodeAnalysis.VisualBasic.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single Microsoft.CodeAnalysis.CSharp.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --single System.Private.CoreLib.dll --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - - - $(WorkItemDirectory)\ScenarioCorrelation - $(Python) %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\test.py crossgen2 --composite %HELIX_CORRELATION_PAYLOAD%\performance\src\scenarios\crossgen2\framework-r2r.dll.rsp --core-root %HELIX_CORRELATION_PAYLOAD%\Core_Root - 1:00 - - - - \ No newline at end of file diff --git a/eng/common/performance/performance-setup.sh b/eng/common/performance/performance-setup.sh index c87cbf0fc232..9c0f6c909145 100755 --- a/eng/common/performance/performance-setup.sh +++ b/eng/common/performance/performance-setup.sh @@ -24,6 +24,9 @@ run_from_perf_repo=false use_core_run=true use_baseline_core_run=true using_mono=false +wasm_runtime_loc= +using_wasm=false +use_latest_dotnet=false while (($# > 0)); do lowerI="$(echo $1 | awk '{print tolower($0)}')" @@ -70,7 +73,7 @@ while (($# > 0)); do ;; --kind) kind=$2 - configurations="CompliationMode=$compilation_mode RunKind=$kind" + configurations="CompilationMode=$compilation_mode RunKind=$kind" shift 2 ;; --runcategories) @@ -101,6 +104,10 @@ while (($# > 0)); do mono_dotnet=$2 shift 2 ;; + --wasm) + wasm_runtime_loc=$2 + shift 2 + ;; --compare) compare=true shift 1 @@ -109,7 +116,11 @@ while (($# > 0)); do configurations=$2 shift 2 ;; - --help) + --latestdotnet) + use_latest_dotnet=true + shift 1 + ;; + *) echo "Common settings:" echo " --corerootdirectory Directory where Core_Root exists, if running perf testing with --corerun" echo " --architecture Architecture of the testing being run" @@ -130,6 +141,8 @@ while (($# > 0)); do echo " --runcategories Related to csproj. Categories of benchmarks to run. Defaults to \"coreclr corefx\"" 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 " --latestdotnet --dotnet-versions will not be specified. --dotnet-versions defaults to LKG version in global.json " echo "" exit 0 ;; @@ -141,7 +154,7 @@ if [ "$repository" == "dotnet/performance" ] || [ "$repository" == "dotnet-perfo fi if [ -z "$configurations" ]; then - configurations="CompliationMode=$compilation_mode" + configurations="CompilationMode=$compilation_mode" fi if [ -z "$core_root_directory" ]; then @@ -187,23 +200,31 @@ if [[ "$internal" == true ]]; then fi fi -if [[ "$mono_dotnet" != "" ]]; then +if [[ "$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 + configurations="CompilationMode=wasm RunKind=$kind" + extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --category-exclusion-filter NoInterpreter NoWASM NoMono" fi -if [[ "$monointerpreter" == "true" ]]; then - extra_benchmark_dotnet_arguments="--category-exclusion-filter NoInterpreter" +if [[ "$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 common_setup_arguments="--channel master --queue $queue --build-number $build_number --build-configs $configurations --architecture $architecture" setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments" -# Get the tools section from the global.json. -# This grabs the LKG version number of dotnet and passes it to our scripts -dotnet_version=`cat global.json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["tools"]["dotnet"])'` -setup_arguments="--dotnet-versions $dotnet_version $setup_arguments" - +if [[ "$use_latest_dotnet" = false ]]; then + # Get the tools section from the global.json. + # This grabs the LKG version number of dotnet and passes it to our scripts + dotnet_version=`cat global.json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["tools"]["dotnet"])'` + setup_arguments="--dotnet-versions $dotnet_version $setup_arguments" +fi if [[ "$run_from_perf_repo" = true ]]; then payload_directory= @@ -217,6 +238,13 @@ else mv $docs_directory $workitem_directory fi +if [[ "$wasm_runtime_loc" != "" ]]; then + using_wasm=true + wasm_dotnet_path=$payload_directory/dotnet-wasm + mv $wasm_runtime_loc $wasm_dotnet_path + extra_benchmark_dotnet_arguments="$extra_benchmark_dotnet_arguments --wasmMainJS \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm/runtime-test.js --wasmEngine /home/helixbot/.jsvu/v8 --customRuntimePack \$HELIX_CORRELATION_PAYLOAD/dotnet-wasm" +fi + if [[ "$mono_dotnet" != "" ]]; then using_mono=true mono_dotnet_path=$payload_directory/dotnet-mono @@ -247,7 +275,7 @@ Write-PipelineSetVariable -name "PerformanceDirectory" -value "$performance_dire Write-PipelineSetVariable -name "WorkItemDirectory" -value "$workitem_directory" -is_multi_job_variable false Write-PipelineSetVariable -name "Queue" -value "$queue" -is_multi_job_variable false Write-PipelineSetVariable -name "SetupArguments" -value "$setup_arguments" -is_multi_job_variable false -Write-PipelineSetVariable -name "Python" -value "$python3" -is_multi_job_variable false +Write-PipelineSetVariable -name "Python" -value "python3" -is_multi_job_variable false Write-PipelineSetVariable -name "PerfLabArguments" -value "$perflab_arguments" -is_multi_job_variable false Write-PipelineSetVariable -name "ExtraBenchmarkDotNetArguments" -value "$extra_benchmark_dotnet_arguments" -is_multi_job_variable false Write-PipelineSetVariable -name "BDNCategories" -value "$run_categories" -is_multi_job_variable false @@ -259,3 +287,4 @@ Write-PipelineSetVariable -name "Kind" -value "$kind" -is_multi_job_variable fal Write-PipelineSetVariable -name "_BuildConfig" -value "$architecture.$kind.$framework" -is_multi_job_variable false Write-PipelineSetVariable -name "Compare" -value "$compare" -is_multi_job_variable false Write-PipelineSetVariable -name "MonoDotnet" -value "$using_mono" -is_multi_job_variable false +Write-PipelineSetVariable -name "WasmDotnet" -value "$using_wasm" -is_multi_job_variable false diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index d22eb439c486..650b13b089b2 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -1,20 +1,22 @@ param( [Parameter(Mandatory=$true)][int] $BuildId, + [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, [Parameter(Mandatory=$true)][string] $AzdoToken, [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, - [Parameter(Mandatory=$true)][string] $EnableSourceLinkValidation, - [Parameter(Mandatory=$true)][string] $EnableSigningValidation, - [Parameter(Mandatory=$true)][string] $EnableNugetValidation, - [Parameter(Mandatory=$true)][string] $PublishInstallersAndChecksums, + [Parameter(Mandatory=$false)][string] $EnableSourceLinkValidation, + [Parameter(Mandatory=$false)][string] $EnableSigningValidation, + [Parameter(Mandatory=$false)][string] $EnableNugetValidation, + [Parameter(Mandatory=$false)][string] $PublishInstallersAndChecksums, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, [Parameter(Mandatory=$false)][string] $SigningValidationAdditionalParameters ) try { . $PSScriptRoot\post-build-utils.ps1 - . $PSScriptRoot\..\darc-init.ps1 + # Hard coding darc version till the next arcade-services roll out, cos this version has required API changes for darc add-build-to-channel + $darc = Get-Darc "1.1.0-beta.20418.1" $optionalParams = [System.Collections.ArrayList]::new() @@ -27,7 +29,7 @@ try { $optionalParams.Add("--no-wait") | Out-Null } - if ("true" -eq $PublishInstallersAndChecksums) { + if ("false" -ne $PublishInstallersAndChecksums) { $optionalParams.Add("--publish-installers-and-checksums") | Out-Null } @@ -48,13 +50,14 @@ try { } } - & darc add-build-to-channel ` - --id $buildId ` - --default-channels ` - --source-branch master ` - --azdev-pat $AzdoToken ` - --bar-uri $MaestroApiEndPoint ` - --password $MaestroToken ` + & $darc add-build-to-channel ` + --id $buildId ` + --publishing-infra-version $PublishingInfraVersion ` + --default-channels ` + --source-branch master ` + --azdev-pat $AzdoToken ` + --bar-uri $MaestroApiEndPoint ` + --password $MaestroToken ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/eng/common/post-build/sourcelink-validation.ps1 b/eng/common/post-build/sourcelink-validation.ps1 index cdd1bba4f2d6..1728b742b3b7 100644 --- a/eng/common/post-build/sourcelink-validation.ps1 +++ b/eng/common/post-build/sourcelink-validation.ps1 @@ -144,11 +144,30 @@ $ValidatePackage = { if ($FailedFiles -eq 0) { Write-Host 'Passed.' - return 0 + return [pscustomobject]@{ + result = 0 + packagePath = $PackagePath + } } else { Write-PipelineTelemetryError -Category 'SourceLink' -Message "$PackagePath has broken SourceLink links." - return 1 + return [pscustomobject]@{ + result = 1 + packagePath = $PackagePath + } + } +} + +function CheckJobResult( + $result, + $packagePath, + [ref]$ValidationFailures, + [switch]$logErrors) { + if ($result -ne '0') { + if ($logError) { + Write-PipelineTelemetryError -Category 'SourceLink' -Message "$packagePath has broken SourceLink links." + } + $ValidationFailures.Value++ } } @@ -211,19 +230,15 @@ function ValidateSourceLinkLinks { } foreach ($Job in @(Get-Job -State 'Completed')) { - $jobResult = Receive-Job -Id $Job.Id - if ($jobResult -ne '0') { - $ValidationFailures++ - } + $jobResult = Wait-Job -Id $Job.Id | Receive-Job + CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) -LogErrors Remove-Job -Id $Job.Id } } foreach ($Job in @(Get-Job)) { $jobResult = Wait-Job -Id $Job.Id | Receive-Job - if ($jobResult -ne '0') { - $ValidationFailures++ - } + CheckJobResult $jobResult.result $jobResult.packagePath ([ref]$ValidationFailures) Remove-Job -Id $Job.Id } if ($ValidationFailures -gt 0) { diff --git a/eng/common/post-build/symbols-validation.ps1 b/eng/common/post-build/symbols-validation.ps1 index a36fa6f26bcd..99bf28cd5c1b 100644 --- a/eng/common/post-build/symbols-validation.ps1 +++ b/eng/common/post-build/symbols-validation.ps1 @@ -9,9 +9,16 @@ param( # Maximum number of jobs to run in parallel $MaxParallelJobs = 6 +# Max number of retries +$MaxRetry = 5 + # Wait time between check for system load $SecondsBetweenLoadChecks = 10 +# Set error codes +Set-Variable -Name "ERROR_BADEXTRACT" -Option Constant -Value -1 +Set-Variable -Name "ERROR_FILEDOESNOTEXIST" -Option Constant -Value -2 + $CountMissingSymbols = { param( [string] $PackagePath # Path to a NuGet package @@ -21,10 +28,15 @@ $CountMissingSymbols = { Add-Type -AssemblyName System.IO.Compression.FileSystem + Write-Host "Validating $PackagePath " + # Ensure input file exist if (!(Test-Path $PackagePath)) { Write-PipelineTaskError "Input file does not exist: $PackagePath" - return -2 + return [pscustomobject]@{ + result = $using:ERROR_FILEDOESNOTEXIST + packagePath = $PackagePath + } } # Extensions for which we'll look for symbols @@ -45,7 +57,7 @@ $CountMissingSymbols = { Write-Host "Something went wrong extracting $PackagePath" Write-Host $_ return [pscustomobject]@{ - result = -1 + result = $using:ERROR_BADEXTRACT packagePath = $PackagePath } } @@ -91,26 +103,37 @@ $CountMissingSymbols = { $dotnetSymbolExe = "$env:USERPROFILE\.dotnet\tools" $dotnetSymbolExe = Resolve-Path "$dotnetSymbolExe\dotnet-symbol.exe" - & $dotnetSymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null + $totalRetries = 0 - if (Test-Path $PdbPath) { - return 'PDB' - } - elseif (Test-Path $NGenPdb) { - return 'NGen PDB' - } - elseif (Test-Path $SODbg) { - return 'DBG for SO' - } - elseif (Test-Path $DylibDwarf) { - return 'Dwarf for Dylib' - } - elseif (Test-Path $SymbolPath) { - return 'Module' - } - else { - return $null + while ($totalRetries -lt $using:MaxRetry) { + # Save the output and get diagnostic output + $output = & $dotnetSymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath --diagnostics | Out-String + + if (Test-Path $PdbPath) { + return 'PDB' + } + elseif (Test-Path $NGenPdb) { + return 'NGen PDB' + } + elseif (Test-Path $SODbg) { + return 'DBG for SO' + } + elseif (Test-Path $DylibDwarf) { + return 'Dwarf for Dylib' + } + elseif (Test-Path $SymbolPath) { + return 'Module' + } + elseif ($output.Contains("503 Service Unavailable")) { + # If we got a 503 error, we should retry. + $totalRetries++ + } + else { + return $null + } } + + return $null } $SymbolsOnMSDL = & $FirstMatchingSymbolDescriptionOrDefault $FileName '--microsoft-symbol-server' $SymbolsPath @@ -141,11 +164,6 @@ $CountMissingSymbols = { if ($using:Clean) { Remove-Item $ExtractPath -Recurse -Force } - - if ($MissingSymbols -ne 0) - { - Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $MissingSymbols modules in the package $PackagePath" - } Pop-Location @@ -160,13 +178,21 @@ function CheckJobResult( $packagePath, [ref]$DupedSymbols, [ref]$TotalFailures) { - if ($result -eq '-1') { + if ($result -eq $ERROR_BADEXTRACT) { Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath has duplicated symbol files" $DupedSymbols.Value++ } - elseif ($jobResult.result -ne '0') { + elseif ($result -eq $ERROR_FILEDOESNOTEXIST) { + Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "$packagePath does not exist" + $TotalFailures.Value++ + } + elseif ($result -gt '0') { + Write-PipelineTelemetryError -Category 'CheckSymbols' -Message "Missing symbols for $result modules in the package $packagePath" $TotalFailures.Value++ } + else { + Write-Host "All symbols verified for package $packagePath" + } } function CheckSymbolsAvailable { @@ -196,12 +222,9 @@ function CheckSymbolsAvailable { return } - Write-Host "Validating $FileName " - Start-Job -ScriptBlock $CountMissingSymbols -ArgumentList $FullName | Out-Null $NumJobs = @(Get-Job -State 'Running').Count - Write-Host $NumJobs while ($NumJobs -ge $MaxParallelJobs) { Write-Host "There are $NumJobs validation jobs running right now. Waiting $SecondsBetweenLoadChecks seconds to check again." diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index 32ad5c7e91cb..f55c43c6f478 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -42,6 +42,7 @@ function Build([string]$target) { /p:Configuration=$configuration ` /p:RepoRoot=$RepoRoot ` /p:BaseIntermediateOutputPath=$outputPath ` + /v:$verbosity ` @properties } @@ -63,7 +64,7 @@ try { $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty } if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { - $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "16.5.0-alpha" -MemberType NoteProperty + $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "16.8.0-preview3" -MemberType NoteProperty } if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") { $xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index e78ed9a1c6ec..06048c27907b 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -27,6 +27,7 @@ parameters: useBuildManifest: false mergeTestResults: false testRunTitle: '' + testResultsFormat: '' name: '' preSteps: [] runAsPublic: false @@ -131,8 +132,8 @@ jobs: - task: RichCodeNavIndexer@0 displayName: RichCodeNav Upload inputs: - languages: 'csharp' - environment: ${{ coalesce(parameters.richCodeNavigationEnvironment, 'prod') }} + languages: ${{ coalesce(parameters.richCodeNavigationLanguage, 'csharp') }} + environment: ${{ coalesce(parameters.richCodeNavigationEnvironment, 'production') }} richNavLogOutputDirectory: $(Build.SourcesDirectory)/artifacts/bin continueOnError: true @@ -202,9 +203,9 @@ jobs: continueOnError: true condition: always() - - ${{ if eq(parameters.enablePublishTestResults, 'true') }}: + - ${{ if or(and(eq(parameters.enablePublishTestResults, 'true'), eq(parameters.testResultsFormat, '')), eq(parameters.testResultsFormat, 'xunit')) }}: - task: PublishTestResults@2 - displayName: Publish Test Results + displayName: Publish XUnit Test Results inputs: testResultsFormat: 'xUnit' testResultsFiles: '*.xml' @@ -213,6 +214,17 @@ jobs: mergeTestResults: ${{ parameters.mergeTestResults }} continueOnError: true condition: always() + - ${{ if or(and(eq(parameters.enablePublishTestResults, 'true'), eq(parameters.testResultsFormat, '')), eq(parameters.testResultsFormat, 'vstest')) }}: + - task: PublishTestResults@2 + displayName: Publish TRX Test Results + inputs: + testResultsFormat: 'VSTest' + testResultsFiles: '*.trx' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' + testRunTitle: ${{ coalesce(parameters.testRunTitle, parameters.name, '$(System.JobName)') }}-trx + mergeTestResults: ${{ parameters.mergeTestResults }} + continueOnError: true + condition: always() - ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: CopyFiles@2 diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 055304ad89bf..d0c3cc2b3ba5 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -67,6 +67,7 @@ jobs: /p:MaestroApiEndpoint=https://maestro-prod.westus2.cloudapp.azure.com /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:Configuration=$(_BuildConfig) + /p:OfficialBuildId=$(Build.BuildNumber) condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} @@ -87,11 +88,6 @@ jobs: ArtifactName: ReleaseConfigs - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - - task: PublishBuildArtifacts@1 - displayName: Publish Logs to VSTS - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)' - PublishLocation: Container - ArtifactName: $(Agent.Os)_PublishBuildAssets - continueOnError: true - condition: always() + - template: /eng/common/templates/steps/publish-logs.yml + parameters: + JobLabel: 'Publish_Artifacts_Logs' diff --git a/eng/common/templates/job/source-build.yml b/eng/common/templates/job/source-build.yml new file mode 100644 index 000000000000..9332f5ecc38a --- /dev/null +++ b/eng/common/templates/job/source-build.yml @@ -0,0 +1,49 @@ +parameters: + # This template adds arcade-powered source-build to CI. The template produces a server job with a + # default ID 'Source_Build_Complete' to put in a dependency list if necessary. + + # Specifies the prefix for source-build jobs added to pipeline. Use this if disambiguation needed. + jobNamePrefix: 'Source_Build' + + # Defines the platform on which to run the job. By default, a linux-x64 machine, suitable for + # managed-only repositories. This is an object with these properties: + # + # name: '' + # The name of the job. This is included in the job ID. + # targetRID: '' + # The name of the target RID to use, instead of the one auto-detected by Arcade. + # nonPortable: false + # Enables non-portable mode. This means a more specific RID (e.g. fedora.32-x64 rather than + # linux-x64), and compiling against distro-provided packages rather than portable ones. + # container: '' + # A container to use. Runs in docker. + # pool: {} + # A pool to use. Runs directly on an agent. + # buildScript: '' + # Specifies the build script to invoke to perform the build in the repo. The default + # './build.sh' should work for typical Arcade repositories, but this is customizable for + # difficult situations. + # jobProperties: {} + # A list of job properties to inject at the top level, for potential extensibility beyond + # container and pool. + platform: {} + +jobs: +- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }} + displayName: Source-Build (${{ parameters.platform.name }}) + + ${{ each property in parameters.platform.jobProperties }}: + ${{ property.key }}: ${{ property.value }} + + ${{ if ne(parameters.platform.container, '') }}: + container: ${{ parameters.platform.container }} + ${{ if ne(parameters.platform.pool, '') }}: + pool: ${{ parameters.platform.pool }} + + workspace: + clean: all + + steps: + - template: /eng/common/templates/steps/source-build.yml + parameters: + platform: ${{ parameters.platform }} diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml index c08225a9a975..08845950f441 100644 --- a/eng/common/templates/jobs/jobs.yml +++ b/eng/common/templates/jobs/jobs.yml @@ -24,6 +24,13 @@ parameters: # if 'true', the build won't run any of the internal only steps, even if it is running in non-public projects. runAsPublic: false + # Optional: Enable running the source-build jobs to build repo from source + runSourceBuild: false + + # Optional: Parameters for source-build template. + # See /eng/common/templates/jobs/source-build.yml for options + sourceBuildParameters: [] + # Internal resources (telemetry, microbuild) can only be accessed from non-public projects, # and some (Microbuild) should only be applied to non-PR cases for internal builds. @@ -43,6 +50,13 @@ jobs: name: ${{ job.job }} +- ${{ if eq(parameters.runSourceBuild, true) }}: + - template: /eng/common/templates/jobs/source-build.yml + parameters: + allCompletedJobId: Source_Build_Complete + ${{ each parameter in parameters.sourceBuildParameters }}: + ${{ parameter.key }}: ${{ parameter.value }} + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - ${{ if or(eq(parameters.enablePublishBuildAssets, true), eq(parameters.artifacts.publish.manifests, 'true'), ne(parameters.artifacts.publish.manifests, '')) }}: - template: ../job/publish-build-assets.yml @@ -55,6 +69,8 @@ jobs: - ${{ if eq(parameters.publishBuildAssetsDependsOn, '') }}: - ${{ each job in parameters.jobs }}: - ${{ job.job }} + - ${{ if eq(parameters.runSourceBuild, true) }}: + - Source_Build_Complete pool: vmImage: vs2017-win2016 runAsPublic: ${{ parameters.runAsPublic }} diff --git a/eng/common/templates/jobs/source-build.yml b/eng/common/templates/jobs/source-build.yml new file mode 100644 index 000000000000..f463011e7931 --- /dev/null +++ b/eng/common/templates/jobs/source-build.yml @@ -0,0 +1,48 @@ +parameters: + # This template adds arcade-powered source-build to CI. A job is created for each platform, as + # well as an optional server job that completes when all platform jobs complete. + + # The name of the "join" job for all source-build platforms. If set to empty string, the job is + # not included. Existing repo pipelines can use this job depend on all source-build jobs + # completing without maintaining a separate list of every single job ID: just depend on this one + # server job. By default, not included. Recommended name if used: 'Source_Build_Complete'. + allCompletedJobId: '' + + # See /eng/common/templates/job/source-build.yml + jobNamePrefix: 'Source_Build' + + # If changed to true, causes this template to include the default platform for a managed-only + # repo. The exact Docker image used for this build will be provided by Arcade. This has some risk, + # but since the repo is supposed to be managed-only, the risk should be very low. + includeDefaultManagedPlatform: false + defaultManagedPlatform: + name: 'Managed' + container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343' + + # Defines the platforms on which to run build jobs. One job is created for each platform, and the + # object in this array is sent to the job template as 'platform'. + platforms: [] + +jobs: + +- ${{ if ne(parameters.allCompletedJobId, '') }}: + - job: ${{ parameters.allCompletedJobId }} + displayName: Source-Build Complete + pool: server + dependsOn: + - ${{ each platform in parameters.platforms }}: + - ${{ parameters.jobNamePrefix }}_${{ platform.name }} + - ${{ if eq(parameters.includeDefaultManagedPlatform, true) }}: + - ${{ parameters.jobNamePrefix }}_${{ parameters.defaultManagedPlatform.name }} + +- ${{ each platform in parameters.platforms }}: + - template: /eng/common/templates/job/source-build.yml + parameters: + jobNamePrefix: ${{ parameters.jobNamePrefix }} + platform: ${{ platform }} + +- ${{ if eq(parameters.includeDefaultManagedPlatform, true) }}: + - template: /eng/common/templates/job/source-build.yml + parameters: + jobNamePrefix: ${{ parameters.jobNamePrefix }} + platform: ${{ parameters.defaultManagedPlatform }} diff --git a/eng/common/templates/post-build/channels/generic-internal-channel.yml b/eng/common/templates/post-build/channels/generic-internal-channel.yml index 12db36ebe74f..7ae5255921aa 100644 --- a/eng/common/templates/post-build/channels/generic-internal-channel.yml +++ b/eng/common/templates/post-build/channels/generic-internal-channel.yml @@ -1,8 +1,10 @@ parameters: + BARBuildId: '' + PromoteToChannelIds: '' artifactsPublishingAdditionalParameters: '' dependsOn: - Validate - publishInstallersAndChecksums: false + publishInstallersAndChecksums: true symbolPublishingAdditionalParameters: '' stageName: '' channelName: '' @@ -19,6 +21,9 @@ stages: displayName: ${{ parameters.channelName }} Publishing jobs: - template: ../setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - job: publish_symbols displayName: Symbol Publishing @@ -138,6 +143,7 @@ stages: inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:PublishingInfraVersion=2 /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) @@ -152,7 +158,7 @@ stages: /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' /p:Configuration=Release - /p:PublishInstallersAndChecksums=true + /p:PublishInstallersAndChecksums=${{ parameters.publishInstallersAndChecksums }} /p:ChecksumsTargetStaticFeed=$(InternalChecksumsBlobFeedUrl) /p:ChecksumsAzureAccountKey=$(InternalChecksumsBlobFeedKey) /p:InstallersTargetStaticFeed=$(InternalInstallersBlobFeedUrl) diff --git a/eng/common/templates/post-build/channels/generic-public-channel.yml b/eng/common/templates/post-build/channels/generic-public-channel.yml index bf98d990e88e..6cf39dbb2907 100644 --- a/eng/common/templates/post-build/channels/generic-public-channel.yml +++ b/eng/common/templates/post-build/channels/generic-public-channel.yml @@ -1,8 +1,10 @@ parameters: + BARBuildId: '' + PromoteToChannelIds: '' artifactsPublishingAdditionalParameters: '' dependsOn: - Validate - publishInstallersAndChecksums: false + publishInstallersAndChecksums: true symbolPublishingAdditionalParameters: '' stageName: '' channelName: '' @@ -21,6 +23,9 @@ stages: displayName: ${{ parameters.channelName }} Publishing jobs: - template: ../setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - job: publish_symbols displayName: Symbol Publishing @@ -137,6 +142,7 @@ stages: inputs: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:PublishingInfraVersion=2 /p:ArtifactsCategory=$(ArtifactsCategory) /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 0e79a546b553..761fb1a29c35 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -1,18 +1,25 @@ parameters: + # Which publishing infra should be used. THIS SHOULD MATCH THE VERSION ON THE BUILD MANIFEST. + # Publishing V2 accepts optionally outlining the publishing stages - default is inline. + # Publishing V3 DOES NOT accept inlining the publishing stages. + publishingInfraVersion: 2 # When set to true the publishing templates from the repo will be used # otherwise Darc add-build-to-channel will be used to trigger the promotion pipeline inline: true # Only used if inline==false. When set to true will stall the current build until - # the Promotion Pipeline build finishes. Otherwise, the current build continue + # the Promotion Pipeline build finishes. Otherwise, the current build will continue # execution concurrently with the promotion build. waitPublishingFinish: true + BARBuildId: '' + PromoteToChannelIds: '' + enableSourceLinkValidation: false enableSigningValidation: true enableSymbolValidation: false enableNugetValidation: true - publishInstallersAndChecksums: false + publishInstallersAndChecksums: true SDLValidationParameters: enable: false continueOnError: false @@ -39,6 +46,7 @@ parameters: NetEngLatestChannelId: 2 NetEngValidationChannelId: 9 NetDev5ChannelId: 131 + NetDev6ChannelId: 1296 GeneralTestingChannelId: 529 NETCoreToolingDevChannelId: 548 NETCoreToolingReleaseChannelId: 549 @@ -46,9 +54,9 @@ parameters: NETCoreExperimentalChannelId: 562 NetEngServicesIntChannelId: 678 NetEngServicesProdChannelId: 679 - Net5Preview7ChannelId: 1065 Net5Preview8ChannelId: 1155 Net5RC1ChannelId: 1157 + Net5RC2ChannelId: 1329 NetCoreSDK313xxChannelId: 759 NetCoreSDK313xxInternalChannelId: 760 NetCoreSDK314xxChannelId: 921 @@ -59,40 +67,7 @@ parameters: VSMasterChannelId: 1012 stages: -- ${{ if ne(parameters.inline, 'true') }}: - - stage: publish_using_darc - dependsOn: ${{ parameters.validateDependsOn }} - displayName: Publish using Darc - variables: - - template: common-variables.yml - jobs: - - template: setup-maestro-vars.yml - - - job: - displayName: Publish Using Darc - dependsOn: setupMaestroVars - variables: - - name: BARBuildId - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - pool: - vmImage: 'windows-2019' - steps: - - task: PowerShell@2 - displayName: Publish Using Darc - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' - -WaitPublishingFinish ${{ parameters.waitPublishingFinish }} - -EnableSourceLinkValidation ${{ parameters.enableSourceLinkValidation }} - -EnableSigningValidation ${{ parameters.enableSourceLinkValidation }} - -EnableNugetValidation ${{ parameters.enableSourceLinkValidation }} - -PublishInstallersAndChecksums ${{ parameters.publishInstallersAndChecksums }} - -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' - -SigningValidationAdditionalParameters '${{ parameters.signingValidationAdditionalParameters }}' - -- ${{ if eq(parameters.inline, 'true') }}: +- ${{ if or(and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')), eq( parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: - stage: Validate dependsOn: ${{ parameters.validateDependsOn }} displayName: Validate Build Assets @@ -100,22 +75,26 @@ stages: - template: common-variables.yml jobs: - template: setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} - - job: - displayName: Post-build Checks - dependsOn: setupMaestroVars - variables: - - name: TargetChannels - value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'] ] - pool: - vmImage: 'windows-2019' - steps: - - task: PowerShell@2 - displayName: Maestro Channels Consistency - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1 - arguments: -PromoteToChannels "$(TargetChannels)" - -AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.Net5Preview7ChannelId}},${{parameters.Net5Preview8ChannelId}},${{parameters.Net5RC1ChannelId}},${{parameters.NetCoreSDK313xxChannelId}},${{parameters.NetCoreSDK313xxInternalChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}},${{parameters.VS166ChannelId}},${{parameters.VS167ChannelId}},${{parameters.VS168ChannelId}},${{parameters.VSMasterChannelId}} + - ${{ if and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')) }}: + - job: + displayName: Post-build Checks + dependsOn: setupMaestroVars + variables: + - name: TargetChannels + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.TargetChannels'] ] + pool: + vmImage: 'windows-2019' + steps: + - task: PowerShell@2 + displayName: Maestro Channels Consistency + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1 + arguments: -PromoteToChannels "$(TargetChannels)" + -AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.NetDev6ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.Net5Preview8ChannelId}},${{parameters.Net5RC1ChannelId}},${{parameters.Net5RC2ChannelId}},${{parameters.NetCoreSDK313xxChannelId}},${{parameters.NetCoreSDK313xxInternalChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}},${{parameters.VS166ChannelId}},${{parameters.VS167ChannelId}},${{parameters.VS168ChannelId}},${{parameters.VSMasterChannelId}} - job: displayName: NuGet Validation @@ -256,8 +235,46 @@ stages: artifactNames: ${{ parameters.SDLValidationParameters.artifactNames }} downloadArtifacts: ${{ parameters.SDLValidationParameters.downloadArtifacts }} +- ${{ if or(ge(parameters.publishingInfraVersion, 3), eq(parameters.inline, 'false')) }}: + - stage: publish_using_darc + ${{ if or(eq(parameters.enableNugetValidation, 'true'), eq(parameters.enableSigningValidation, 'true'), eq(parameters.enableSourceLinkValidation, 'true'), eq(parameters.SDLValidationParameters.enable, 'true')) }}: + dependsOn: Validate + ${{ if and(ne(parameters.enableNugetValidation, 'true'), ne(parameters.enableSigningValidation, 'true'), ne(parameters.enableSourceLinkValidation, 'true'), ne(parameters.SDLValidationParameters.enable, 'true')) }}: + dependsOn: ${{ parameters.validateDependsOn }} + displayName: Publish using Darc + variables: + - template: common-variables.yml + jobs: + - template: setup-maestro-vars.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} + + - job: + displayName: Publish Using Darc + dependsOn: setupMaestroVars + variables: + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + pool: + vmImage: 'windows-2019' + steps: + - task: PowerShell@2 + displayName: Publish Using Darc + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: -BuildId $(BARBuildId) + -PublishingInfraVersion ${{ parameters.PublishingInfraVersion }} + -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' + -MaestroToken '$(MaestroApiAccessToken)' + -WaitPublishingFinish ${{ parameters.waitPublishingFinish }} + -PublishInstallersAndChecksums ${{ parameters.publishInstallersAndChecksums }} + +- ${{ if and(le(parameters.publishingInfraVersion, 2), eq(parameters.inline, 'true')) }}: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -272,20 +289,24 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} - stageName: 'Net5_Preview7_Publish' - channelName: '.NET 5 Preview 7' - akaMSChannelName: 'net5/preview7' - channelId: ${{ parameters.Net5Preview7ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' + stageName: 'NetCore_Dev6_Publish' + channelName: '.NET 6 Dev' + akaMSChannelName: 'net6/dev' + channelId: ${{ parameters.NetDev6ChannelId }} + transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json' + shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json' + symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -298,8 +319,10 @@ stages: shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal/nuget/v3/index.json' symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-symbols/nuget/v3/index.json' - - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml + - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -308,12 +331,30 @@ stages: channelName: '.NET 5 RC 1' akaMSChannelName: 'net5/rc1' channelId: ${{ parameters.Net5RC1ChannelId }} - transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-transport/nuget/v3/index.json' - shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal/nuget/v3/index.json' - symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-symbols/nuget/v3/index.json' + transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' + shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' + symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' + + - template: \eng\common\templates\post-build\channels\generic-public-channel.yml + parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} + artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} + dependsOn: ${{ parameters.publishDependsOn }} + publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} + symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }} + stageName: 'Net5_RC2_Publish' + channelName: '.NET 5 RC 2' + akaMSChannelName: 'net5/rc2' + channelId: ${{ parameters.Net5RC2ChannelId }} + transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json' + shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json' + symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json' - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -328,6 +369,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -342,6 +385,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -356,6 +401,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -369,6 +416,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -382,6 +431,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -395,6 +446,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -408,6 +461,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -421,6 +476,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -434,6 +491,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -447,6 +506,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -460,6 +521,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -473,6 +536,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-internal-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -486,6 +551,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -499,6 +566,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -512,6 +581,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} @@ -525,6 +596,8 @@ stages: - template: \eng\common\templates\post-build\channels\generic-public-channel.yml parameters: + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }} dependsOn: ${{ parameters.publishDependsOn }} publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }} diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index b3d29d4498e3..d0cbfb6c6ffd 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -1,25 +1,23 @@ +parameters: + BARBuildId: '' + PromoteToChannelIds: '' + jobs: - job: setupMaestroVars displayName: Setup Maestro Vars variables: - template: common-variables.yml - - name: BuildId - value: $[ coalesce(variables.BARBuildId, 0) ] - - name: PromoteToMaestroChannels - value: $[ coalesce(variables.PromoteToChannelIds, 0) ] - - name: PromoteToMaestroChannel - value: $[ coalesce(variables.PromoteToMaestroChannelId, 0) ] pool: vmImage: 'windows-2019' steps: - checkout: none - - task: DownloadBuildArtifacts@0 - displayName: Download Release Configs - condition: and(eq(variables.PromoteToMaestroChannels, 0), eq(variables.PromoteToMaestroChannel, 0)) - inputs: - buildType: current - artifactName: ReleaseConfigs + - ${{ if eq(coalesce(parameters.PromoteToChannelIds, 0), 0) }}: + - task: DownloadBuildArtifacts@0 + displayName: Download Release Configs + inputs: + buildType: current + artifactName: ReleaseConfigs - task: PowerShell@2 name: setReleaseVars @@ -28,7 +26,7 @@ jobs: targetType: inline script: | try { - if ($Env:PromoteToMaestroChannels -eq 0 -and $Env:PromoteToMaestroChannel -eq 0) { + if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt $BarId = $Content | Select -Index 0 @@ -51,7 +49,7 @@ jobs: $BarId = $Env:BARBuildId $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" - $Channels = "[$Channels][$Env:PromoteToMaestroChannel]" + $Channels = "[$Channels]" $IsStableBuild = $buildInfo.stable $AzureDevOpsProject = $buildInfo.azureDevOpsProject @@ -75,3 +73,5 @@ jobs: } env: MAESTRO_API_TOKEN: $(MaestroApiAccessToken) + BARBuildId: ${{ parameters.BARBuildId }} + PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/eng/common/templates/steps/perf-send-to-helix.yml b/eng/common/templates/steps/perf-send-to-helix.yml index b3ea9acf1f16..a468e92ce44d 100644 --- a/eng/common/templates/steps/perf-send-to-helix.yml +++ b/eng/common/templates/steps/perf-send-to-helix.yml @@ -1,5 +1,6 @@ # Please remember to update the documentation if you make changes to these parameters! parameters: + ProjectFile: '' # required -- project file that specifies the helix workitems HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number @@ -10,7 +11,7 @@ parameters: WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion - DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + DotNetCliPackageType: '' # optional -- either 'sdk', 'runtime' or 'aspnetcore-runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." @@ -18,33 +19,18 @@ parameters: DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false + osGroup: '' # required -- operating system for the job + steps: - - powershell: $(Build.SourcesDirectory)\eng\common\msbuild.ps1 $(Build.SourcesDirectory)\eng\common\performance\perfhelixpublish.proj /restore /t:Test /bl:$(Build.SourcesDirectory)\artifacts\log\$env:BuildConfig\SendToHelix.binlog - displayName: ${{ parameters.DisplayNamePrefix }} (Windows) - env: - BuildConfig: $(_BuildConfig) - HelixSource: ${{ parameters.HelixSource }} - HelixType: ${{ parameters.HelixType }} - HelixBuild: ${{ parameters.HelixBuild }} - HelixTargetQueues: ${{ parameters.HelixTargetQueues }} - HelixAccessToken: ${{ parameters.HelixAccessToken }} - HelixPreCommands: ${{ parameters.HelixPreCommands }} - HelixPostCommands: ${{ parameters.HelixPostCommands }} - WorkItemDirectory: ${{ parameters.WorkItemDirectory }} - CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} - IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} - DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} - DotNetCliVersion: ${{ parameters.DotNetCliVersion }} - EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} - WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} - Creator: ${{ parameters.Creator }} - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) +- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml + parameters: + osGroup: ${{ parameters.osGroup }} + sendParams: $(Build.SourcesDirectory)/eng/common/performance/${{ parameters.ProjectFile }} /restore /t:Test /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog + displayName: ${{ parameters.DisplayNamePrefix }} + condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} - - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/performance/perfhelixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog - displayName: ${{ parameters.DisplayNamePrefix }} (Unix) - env: + environment: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} HelixType: ${{ parameters.HelixType }} @@ -62,5 +48,3 @@ steps: WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} Creator: ${{ parameters.Creator }} SYSTEM_ACCESSTOKEN: $(System.AccessToken) - condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) - continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/templates/steps/publish-logs.yml b/eng/common/templates/steps/publish-logs.yml index f91751fe78e1..88f238f36bfd 100644 --- a/eng/common/templates/steps/publish-logs.yml +++ b/eng/common/templates/steps/publish-logs.yml @@ -12,7 +12,7 @@ steps: Move-Item -Path $(Build.SourcesDirectory)/artifacts/log/Debug/* $(Build.SourcesDirectory)/PostBuildLogs/${{parameters.StageLabel}}/${{parameters.JobLabel}}/ continueOnError: true condition: always() - + - task: PublishBuildArtifacts@1 displayName: Publish Logs inputs: diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index 5eceb48725dc..bb5f1a929389 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -18,7 +18,7 @@ parameters: XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion - DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json + DotNetCliPackageType: '' # optional -- either 'sdk', 'runtime' or 'aspnetcore-runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." diff --git a/eng/common/templates/steps/source-build.yml b/eng/common/templates/steps/source-build.yml new file mode 100644 index 000000000000..8e336b7d16b3 --- /dev/null +++ b/eng/common/templates/steps/source-build.yml @@ -0,0 +1,66 @@ +parameters: + # This template adds arcade-powered source-build to CI. + + # This is a 'steps' template, and is intended for advanced scenarios where the existing build + # infra has a careful build methodology that must be followed. For example, a repo + # (dotnet/runtime) might choose to clone the GitHub repo only once and store it as a pipeline + # artifact for all subsequent jobs to use, to reduce dependence on a strong network connection to + # GitHub. Using this steps template leaves room for that infra to be included. + + # Defines the platform on which to run the steps. See 'eng/common/templates/job/source-build.yml' + # for details. The entire object is described in the 'job' template for simplicity, even though + # the usage of the properties on this object is split between the 'job' and 'steps' templates. + platform: {} + +steps: +# Build. Keep it self-contained for simple reusability. (No source-build-specific job variables.) +- script: | + set -x + df -h + + buildConfig=Release + # Check if AzDO substitutes in a build config from a variable, and use it if so. + if [ '$(_BuildConfig)' != '$''(_BuildConfig)' ]; then + buildConfig='$(_BuildConfig)' + fi + + officialBuildArgs= + if [ '${{ and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}' = 'True' ]; then + officialBuildArgs='/p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER)' + fi + + targetRidArgs= + if [ '${{ parameters.platform.targetRID }}' != '' ]; then + targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' + fi + + ${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \ + --configuration $buildConfig \ + --restore --build --pack --publish \ + $officialBuildArgs \ + $targetRidArgs \ + /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ + /p:ArcadeBuildFromSource=true + displayName: Build + +# Upload build logs for diagnosis. +- task: CopyFiles@2 + displayName: Prepare BuildLogs staging directory + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + **/*.log + **/*.binlog + artifacts/source-build/self/prebuilt-report/** + TargetFolder: '$(Build.StagingDirectory)/BuildLogs' + CleanTargetFolder: true + continueOnError: true + condition: succeededOrFailed() + +- task: PublishPipelineArtifact@1 + displayName: Publish BuildLogs + inputs: + targetPath: '$(Build.StagingDirectory)/BuildLogs' + artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt) + continueOnError: true + condition: succeededOrFailed() diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 6f8bc41116b7..fc09059ffe43 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -57,6 +57,11 @@ set-strictmode -version 2.0 $ErrorActionPreference = 'Stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +# If specifies, provides an alternate path for getting .NET Core SDKs and Runtimes. This script will still try public sources first. +[string]$runtimeSourceFeed = if (Test-Path variable:runtimeSourceFeed) { $runtimeSourceFeed } else { $null } +# Base-64 encoded SAS token that has permission to storage container described by $runtimeSourceFeed +[string]$runtimeSourceFeedKey = if (Test-Path variable:runtimeSourceFeedKey) { $runtimeSourceFeedKey } else { $null } + function Create-Directory ([string[]] $path) { New-Item -Path $path -Force -ItemType 'Directory' | Out-Null } @@ -222,8 +227,8 @@ function GetDotNetInstallScript([string] $dotnetRoot) { return $installScript } -function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = '') { - InstallDotNet $dotnetRoot $version $architecture +function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = '', [switch] $noPath) { + InstallDotNet $dotnetRoot $version $architecture '' $false $runtimeSourceFeed $runtimeSourceFeedKey -noPath:$noPath } function InstallDotNet([string] $dotnetRoot, @@ -232,7 +237,8 @@ function InstallDotNet([string] $dotnetRoot, [string] $runtime = '', [bool] $skipNonVersionedFiles = $false, [string] $runtimeSourceFeed = '', - [string] $runtimeSourceFeedKey = '') { + [string] $runtimeSourceFeedKey = '', + [switch] $noPath) { $installScript = GetDotNetInstallScript $dotnetRoot $installParameters = @{ @@ -243,15 +249,14 @@ function InstallDotNet([string] $dotnetRoot, if ($architecture) { $installParameters.Architecture = $architecture } if ($runtime) { $installParameters.Runtime = $runtime } if ($skipNonVersionedFiles) { $installParameters.SkipNonVersionedFiles = $skipNonVersionedFiles } + if ($noPath) { $installParameters.NoPath = $True } try { & $installScript @installParameters } catch { - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet runtime '$runtime' from public location." - - # Only the runtime can be installed from a custom [private] location. - if ($runtime -and ($runtimeSourceFeed -or $runtimeSourceFeedKey)) { + if ($runtimeSourceFeed -or $runtimeSourceFeedKey) { + Write-Host "Failed to install dotnet from public location. Trying from '$runtimeSourceFeed'" if ($runtimeSourceFeed) { $installParameters.AzureFeed = $runtimeSourceFeed } if ($runtimeSourceFeedKey) { @@ -264,10 +269,11 @@ function InstallDotNet([string] $dotnetRoot, & $installScript @installParameters } catch { - Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet runtime '$runtime' from custom location '$runtimeSourceFeed'." + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet from custom location '$runtimeSourceFeed'." ExitWithExitCode 1 } } else { + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Failed to install dotnet from public location." ExitWithExitCode 1 } } @@ -293,9 +299,15 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = return $global:_MSBuildExe } - $vsMinVersionReqdStr = '16.5' + # Minimum VS version to require. + $vsMinVersionReqdStr = '16.8' $vsMinVersionReqd = [Version]::new($vsMinVersionReqdStr) + # If the version of msbuild is going to be xcopied, + # use this version. Version matches a package here: + # https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=16.8.0-preview3&view=overview + $defaultXCopyMSBuildVersion = '16.8.0-preview3' + if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs } $vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { $vsMinVersionReqdStr } $vsMinVersion = [Version]::new($vsMinVersionStr) @@ -330,23 +342,28 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = $xcopyMSBuildVersion = $GlobalJson.tools.'xcopy-msbuild' $vsMajorVersion = $xcopyMSBuildVersion.Split('.')[0] } else { - #if vs version provided in global.json is incompatible then use the default version for xcopy msbuild download + #if vs version provided in global.json is incompatible (too low) then use the default version for xcopy msbuild download if($vsMinVersion -lt $vsMinVersionReqd){ - Write-Host "Using xcopy-msbuild version of $vsMinVersionReqdStr.0-alpha since VS version $vsMinVersionStr provided in global.json is not compatible" - $vsMajorVersion = $vsMinVersionReqd.Major - $vsMinorVersion = $vsMinVersionReqd.Minor + Write-Host "Using xcopy-msbuild version of $defaultXCopyMSBuildVersion since VS version $vsMinVersionStr provided in global.json is not compatible" + $xcopyMSBuildVersion = $defaultXCopyMSBuildVersion } else{ + # If the VS version IS compatible, look for an xcopy msbuild package + # with a version matching VS. + # Note: If this version does not exist, then an explicit version of xcopy msbuild + # can be specified in global.json. This will be required for pre-release versions of msbuild. $vsMajorVersion = $vsMinVersion.Major $vsMinorVersion = $vsMinVersion.Minor + $xcopyMSBuildVersion = "$vsMajorVersion.$vsMinorVersion.0" } - - $xcopyMSBuildVersion = "$vsMajorVersion.$vsMinorVersion.0-alpha" } $vsInstallDir = $null if ($xcopyMSBuildVersion.Trim() -ine "none") { $vsInstallDir = InitializeXCopyMSBuild $xcopyMSBuildVersion $install + if ($vsInstallDir -eq $null) { + throw "Could not xcopy msbuild. Please check that package 'RoslynTools.MSBuild @ $xcopyMSBuildVersion' exists on feed 'dotnet-eng'." + } } if ($vsInstallDir -eq $null) { throw 'Unable to find Visual Studio that has required version and components installed' @@ -510,13 +527,15 @@ function GetDefaultMSBuildEngine() { function GetNuGetPackageCachePath() { if ($env:NUGET_PACKAGES -eq $null) { - # Use local cache on CI to ensure deterministic build, + # Use local cache on CI to ensure deterministic build. + # Avoid using the http cache as workaround for https://github.com/NuGet/Home/issues/3116 # use global cache in dev builds to avoid cost of downloading packages. # For directory normalization, see also: https://github.com/NuGet/Home/issues/7968 if ($useGlobalNuGetCache) { $env:NUGET_PACKAGES = Join-Path $env:UserProfile '.nuget\packages\' } else { $env:NUGET_PACKAGES = Join-Path $RepoRoot '.packages\' + $env:RESTORENOCACHE = $true } } @@ -602,11 +621,7 @@ function MSBuild() { if ($pipelinesLog) { $buildTool = InitializeBuildTool - # Work around issues with Azure Artifacts credential provider - # https://github.com/dotnet/arcade/issues/3932 if ($ci -and $buildTool.Tool -eq 'dotnet') { - dotnet nuget locals http-cache -c - $env:NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS = 20 $env:NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS = 20 Write-PipelineSetVariable -Name 'NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS' -Value '20' @@ -703,6 +718,16 @@ function IsWindowsPlatform() { return [environment]::OSVersion.Platform -eq [PlatformID]::Win32NT } +function Get-Darc($version) { + $darcPath = "$TempDir\darc\$(New-Guid)" + if ($version -ne $null) { + & $PSScriptRoot\darc-init.ps1 -toolpath $darcPath -darcVersion $version | Out-Host + } else { + & $PSScriptRoot\darc-init.ps1 -toolpath $darcPath | Out-Host + } + return "$darcPath\darc.exe" +} + . $PSScriptRoot\pipeline-logging-functions.ps1 $RepoRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..') diff --git a/eng/common/tools.sh b/eng/common/tools.sh index e94fce22ec37..98186e784965 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -64,6 +64,10 @@ else use_global_nuget_cache=${use_global_nuget_cache:-true} fi +# Used when restoring .NET SDK from alternative feeds +runtime_source_feed=${runtime_source_feed:-''} +runtime_source_feed_key=${runtime_source_feed_key:-''} + # Resolve any symlinks in the given path. function ResolvePath { local path=$1 @@ -170,11 +174,11 @@ function InitializeDotNetCli { function InstallDotNetSdk { local root=$1 local version=$2 - local architecture="" - if [[ $# == 3 ]]; then + local architecture="unset" + if [[ $# -ge 3 ]]; then architecture=$3 fi - InstallDotNet "$root" "$version" $architecture + InstallDotNet "$root" "$version" $architecture 'sdk' 'false' $runtime_source_feed $runtime_source_feed_key } function InstallDotNet { @@ -185,50 +189,50 @@ function InstallDotNet { local install_script=$_GetDotNetInstallScript local archArg='' - if [[ -n "${3:-}" ]]; then + if [[ -n "${3:-}" ]] && [ "$3" != 'unset' ]; then archArg="--architecture $3" fi local runtimeArg='' - if [[ -n "${4:-}" ]]; then + if [[ -n "${4:-}" ]] && [ "$4" != 'sdk' ]; then runtimeArg="--runtime $4" fi - local skipNonVersionedFilesArg="" - if [[ "$#" -ge "5" ]]; then + if [[ "$#" -ge "5" ]] && [[ "$5" != 'false' ]]; then skipNonVersionedFilesArg="--skip-non-versioned-files" fi bash "$install_script" --version $version --install-dir "$root" $archArg $runtimeArg $skipNonVersionedFilesArg || { local exit_code=$? - Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to install dotnet SDK from public location (exit code '$exit_code')." + echo "Failed to install dotnet SDK from public location (exit code '$exit_code')." - if [[ -n "$runtimeArg" ]]; then - local runtimeSourceFeed='' - if [[ -n "${6:-}" ]]; then - runtimeSourceFeed="--azure-feed $6" - fi + local runtimeSourceFeed='' + if [[ -n "${6:-}" ]]; then + runtimeSourceFeed="--azure-feed $6" + fi - local runtimeSourceFeedKey='' - 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 - # accordingly. - decodeArg="--decode" - if base64 --help 2>&1 | grep -q "BusyBox"; then - decodeArg="-d" - fi - decodedFeedKey=`echo $7 | base64 $decodeArg` - runtimeSourceFeedKey="--feed-credential $decodedFeedKey" + local runtimeSourceFeedKey='' + 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 + # accordingly. + decodeArg="--decode" + if base64 --help 2>&1 | grep -q "BusyBox"; then + decodeArg="-d" fi + decodedFeedKey=`echo $7 | base64 $decodeArg` + runtimeSourceFeedKey="--feed-credential $decodedFeedKey" + 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 [[ -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 fi } } @@ -297,12 +301,14 @@ function InitializeBuildTool { _InitializeBuildToolFramework="netcoreapp2.1" } +# Set RestoreNoCache as a workaround for https://github.com/NuGet/Home/issues/3116 function GetNuGetPackageCachePath { if [[ -z ${NUGET_PACKAGES:-} ]]; then if [[ "$use_global_nuget_cache" == true ]]; then export NUGET_PACKAGES="$HOME/.nuget/packages" else export NUGET_PACKAGES="$repo_root/.packages" + export RESTORENOCACHE=true fi fi @@ -391,11 +397,7 @@ function MSBuild { InitializeBuildTool InitializeToolset - # Work around issues with Azure Artifacts credential provider - # https://github.com/dotnet/arcade/issues/3932 if [[ "$ci" == true ]]; then - "$_InitializeBuildTool" nuget locals http-cache -c - export NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS=20 export NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS=20 Write-PipelineSetVariable -name "NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS" -value "20" diff --git a/eng/depProj.common.targets b/eng/depProj.common.targets deleted file mode 100644 index b6d73606c388..000000000000 --- a/eng/depProj.common.targets +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/eng/depProj.targets b/eng/depProj.targets deleted file mode 100644 index 7cb63b0fca25..000000000000 --- a/eng/depProj.targets +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - true - - false - - false - false - - - - ReferenceCopyLocalPaths - - - false - - - None - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - %(NuGetDeploy.SubFolder)%(FileName)%(Extension) - - - - - - - - - - - - - - - - - - - - - - - - - - <_nuGetDeploy Include="@($(NuGetDeploySourceItem))"/> - <_nuGetDeployByFileName Include="@(_nuGetDeploy->'%(FileName)')"> - %(Identity) - - - <_nuGetDeployByFileNameToRemove Include="@(_nuGetDeployByFileName)" Exclude="@(FileToInclude)" Condition="'@(FileToInclude)' != ''" /> - <_filteredNuGetDeployByFileName Include="@(_nuGetDeployByFileName)" Exclude="@(_nuGetDeployByFileNameToRemove);@(FileToExclude)" /> - - <_nuGetDeployByPackageId Include="@(_filteredNuGetDeployByFileName->'%(NuGetPackageId)')" /> - - <_nuGetDeployByPackageIdToRemove Include="@(_nuGetDeployByPackageId)" Exclude="@(PackageToInclude)" Condition="'@(PackageToInclude)' != ''" /> - <_filteredNuGetDeployByPackageId Include="@(_nuGetDeployByPackageId)" Exclude="@(_nuGetDeployByPackageIdToRemove);@(PackageToExclude)" /> - - - - - - - - - - - - diff --git a/eng/docker/Readme.md b/eng/docker/Readme.md index 0f73be1740e7..d2482bb08bf0 100644 --- a/eng/docker/Readme.md +++ b/eng/docker/Readme.md @@ -5,7 +5,7 @@ Provides reusable docker build infrastructure for the dotnet/runtime repo. ## libraries-sdk Dockerfiles The `libraries-sdk` Dockerfiles can be used to build dotnet sdk docker images -that contain the current libraries built from source. +that contain the current libraries built from source. These images can be used to build dockerized dotnet services that target the current libraries. Currently, debian and windows nanoserver sdk's are supported. diff --git a/eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile b/eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile index 04974370ebac..08adb4359e05 100644 --- a/eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile +++ b/eng/docker/libraries-sdk-aspnetcore.linux.Dockerfile @@ -14,16 +14,16 @@ RUN ./src/coreclr/build.sh -release -skiptests -clang9 && \ FROM $SDK_BASE_IMAGE as target ARG TESTHOST_LOCATION=/repo/artifacts/bin/testhost -ARG TFM=net5.0 +ARG TFM=net6.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=5.0.0 +ARG SOURCE_COREFX_VERSION=6.0.0 ARG TARGET_SHARED_FRAMEWORK=/usr/share/dotnet/shared -ARG TARGET_COREFX_VERSION=3.0.0 +ARG TARGET_COREFX_VERSION=$DOTNET_VERSION COPY --from=corefxbuild \ $TESTHOST_LOCATION/$TFM-$OS-$CONFIGURATION-$ARCH/shared/$COREFX_SHARED_FRAMEWORK_NAME/$SOURCE_COREFX_VERSION/* \ diff --git a/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile b/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile index 32f91f5d8595..584c1e838e66 100644 --- a/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile +++ b/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile @@ -4,16 +4,16 @@ ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-nanoserver-1809 FROM $SDK_BASE_IMAGE as target ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost" -ARG TFM=net5.0 +ARG TFM=net6.0 ARG OS=Windows_NT 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=5.0.0 +ARG SOURCE_COREFX_VERSION=6.0.0 ARG TARGET_SHARED_FRAMEWORK="C:\\Program Files\\dotnet\\shared" -ARG TARGET_COREFX_VERSION=3.0.0 +ARG TARGET_COREFX_VERSION=$DOTNET_VERSION COPY ` $TESTHOST_LOCATION\$TFM-$OS-$CONFIGURATION-$ARCH\shared\$COREFX_SHARED_FRAMEWORK_NAME\$SOURCE_COREFX_VERSION\ ` diff --git a/eng/docker/libraries-sdk.linux.Dockerfile b/eng/docker/libraries-sdk.linux.Dockerfile index 2cc979dba6a0..1d704ecbc42b 100644 --- a/eng/docker/libraries-sdk.linux.Dockerfile +++ b/eng/docker/libraries-sdk.linux.Dockerfile @@ -13,15 +13,15 @@ RUN ./build.sh -ci -subset clr+libs -runtimeconfiguration release -c $CONFIGURAT FROM $SDK_BASE_IMAGE as target ARG TESTHOST_LOCATION=/repo/artifacts/bin/testhost -ARG TFM=net5.0 +ARG TFM=net6.0 ARG OS=Linux ARG ARCH=x64 ARG CONFIGURATION=Release ARG COREFX_SHARED_FRAMEWORK_NAME=Microsoft.NETCore.App -ARG SOURCE_COREFX_VERSION=5.0.0 +ARG SOURCE_COREFX_VERSION=6.0.0 ARG TARGET_SHARED_FRAMEWORK=/usr/share/dotnet/shared -ARG TARGET_COREFX_VERSION=3.0.0 +ARG TARGET_COREFX_VERSION=$DOTNET_VERSION COPY --from=corefxbuild \ $TESTHOST_LOCATION/$TFM-$OS-$CONFIGURATION-$ARCH/shared/$COREFX_SHARED_FRAMEWORK_NAME/$SOURCE_COREFX_VERSION/* \ diff --git a/eng/docker/libraries-sdk.windows.Dockerfile b/eng/docker/libraries-sdk.windows.Dockerfile index 50c3f357c9b7..adbf17302fef 100644 --- a/eng/docker/libraries-sdk.windows.Dockerfile +++ b/eng/docker/libraries-sdk.windows.Dockerfile @@ -4,15 +4,15 @@ ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:5.0-nanoserver-1809 FROM $SDK_BASE_IMAGE as target ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost" -ARG TFM=net5.0 +ARG TFM=net6.0 ARG OS=Windows_NT ARG ARCH=x64 ARG CONFIGURATION=Release ARG COREFX_SHARED_FRAMEWORK_NAME=Microsoft.NETCore.App -ARG SOURCE_COREFX_VERSION=5.0.0 +ARG SOURCE_COREFX_VERSION=6.0.0 ARG TARGET_SHARED_FRAMEWORK="C:\\Program Files\\dotnet\\shared" -ARG TARGET_COREFX_VERSION=3.0.0 +ARG TARGET_COREFX_VERSION=$DOTNET_VERSION COPY ` $TESTHOST_LOCATION\$TFM-$OS-$CONFIGURATION-$ARCH\shared\$COREFX_SHARED_FRAMEWORK_NAME\$SOURCE_COREFX_VERSION\ ` diff --git a/eng/illink.targets b/eng/illink.targets index 601b0b798fbc..e5814573953d 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -25,9 +25,10 @@ + $(MSBuildProjectDirectory)\ILLink\ $([MSBuild]::NormalizeDirectory('$(PkgMicrosoft_NET_ILLink_Tasks)', 'tools')) - $(ILLinkTasksDir)netcoreapp3.0/ILLink.Tasks.dll - $(ILLinkTasksDir)$(NetFrameworkCurrent)/ILLink.Tasks.dll + $(ILLinkTasksDir)net5.0/ILLink.Tasks.dll + $(ILLinkTasksDir)net472/ILLink.Tasks.dll $(IntermediateOutputPath)$(TargetName)$(TargetExt) $(IntermediateOutputPath)$(TargetName).pdb $(IntermediateOutputPath)PreTrim/ @@ -35,14 +36,20 @@ $(ILLinkTrimInputPath)$(TargetName).pdb $(IntermediateOutputPath) - $(MSBuildProjectDirectory)/ILLinkTrim.xml + $(ILLinkDirectory)ILLinkTrim.xml - $(MSBuildProjectDirectory)/ILLinkTrim_LibraryBuild.xml + $(ILLinkDirectory)ILLinkTrim_LibraryBuild.xml $(IntermediateOutputPath)ILLink.Descriptors.xml $(IntermediateOutputPath)ILLink.Substitutions.xml $(IntermediateOutputPath)ILLink.LinkAttributes.xml + $(ILLinkDirectory)ILLink.Suppressions + $(ILLinkSuppressionsXmlFilePrefix).xml + $(ILLinkSuppressionsXmlFilePrefix).$(Configuration).xml + $(ILLinkSuppressionsXmlFilePrefix).$(TargetOS).xml + $(ILLinkSuppressionsXmlFilePrefix).NonWindows.xml + true @@ -52,24 +59,52 @@ + + $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'ILLinkTrimAssembly', '$(BuildSettings)')) + $(ILLinkTrimAssemblyArtifactsRootDir)suppressions-xmls\ + + - $(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildSettings)/trimmed + $(ILLinkTrimAssemblyArtifactsRootDir)trimmed TrimmedItem - $(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildSettings)/reports + $(ILLinkTrimAssemblyArtifactsRootDir)reports TrimmingReport - $(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildSettings)/pretrimmed + $(ILLinkTrimAssemblyArtifactsRootDir)pretrimmed PreTrimmedItem + + + + + + + + + + + $(ILLinkTrimAssemblySuppressionsXmlsDir) + ILLinkSuppressionsXmls + + + $(ILLinkTrimAssemblySuppressionsXmlsDir) + ILLinkSuppressionsXmls + + + @@ -184,22 +219,37 @@ + + + + + $(ILLinkArgs) -t + + + $(ILLinkArgs) --strip-link-attributes false --ignore-link-attributes true + + $(ILLinkArgs) --skip-unresolved true + + $(ILLinkArgs) --disable-opt unusedinterfaces + + + - + - $(ILLinkArgs)-r $(TargetName) + $(ILLinkArgs) -r $(TargetName) $(ILLinkArgs) -c skip $(ILLinkArgs) -u skip $(ILLinkArgs) -p link $(TargetName) - - $(ILLinkArgs) -t $(ILLinkArgs) -b true $(ILLinkArgs) --strip-descriptors false @@ -207,15 +257,26 @@ $(ILLinkArgs) -x "$(ILLinkTrimXmlLibraryBuild)" $(ILLinkArgs) --strip-substitutions false - - - $(ILLinkArgs) --strip-link-attributes false --ignore-link-attributes true - - $(ILLinkArgs) --skip-unresolved true - - $(ILLinkArgs) --disable-opt unusedinterfaces $(ILLinkArgs) --keep-dep-attributes true + + IL2008;IL2009;IL2012;IL2025;IL2026;IL2035;IL2050 + + $(LinkerNoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061 + + $(LinkerNoWarn);IL2062;IL2063;IL2064;IL2065;IL2066 + + $(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) @@ -255,9 +316,9 @@ + <_DotNetHostDirectory>$(NetCoreRoot) - <_DotNetHostFileName>dotnet - <_DotNetHostFileName Condition=" '$(OS)' == 'Windows_NT' ">dotnet.exe + <_DotNetHostFileName>$([System.IO.Path]::GetFileName('$(DotNetTool)')) azDO +# +# For developer use it is not recommended to include the azDO final argument as that +# makes installation and configuration setting only required for azDO +# +# So simple developer usage would currently be +# +# ./install-native-dependencies.sh + +if [ "$1" = "OSX" ] && [ "$2" = "arm64" ] && [ "$3" = "azDO" ]; then + # On AzDO macOS-10.15 build agents the Xcode currently defaults to Xcode 11.7 + # Cross compilation for osx-arm64 requires xcode 12.2 or greater + sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer +fi + if [ "$1" = "Linux" ]; then sudo apt update if [ "$?" != "0" ]; then @@ -11,12 +30,24 @@ if [ "$1" = "Linux" ]; then fi elif [ "$1" = "OSX" ] || [ "$1" = "tvOS" ] || [ "$1" = "iOS" ]; then engdir=$(dirname "${BASH_SOURCE[0]}") - brew bundle --no-lock --file "${engdir}/Brewfile" + brew update --preinstall + brew bundle --no-upgrade --no-lock --file "${engdir}/Brewfile" if [ "$?" != "0" ]; then exit 1; fi +elif [ "$1" = "Android" ]; then + if [ -z "${ANDROID_OPENSSL_AAR}" ]; then + echo "The ANDROID_OPENSSL_AAR variable must be set!" + exit 1; + fi + if [ -d "${ANDROID_OPENSSL_AAR}" ]; then + exit 0; + fi + OPENSSL_VER=1.1.1g-alpha-1 + curl https://maven.google.com/com/android/ndk/thirdparty/openssl/${OPENSSL_VER}/openssl-${OPENSSL_VER}.aar -L --output /tmp/openssl.zip + unzip /tmp/openssl.zip -d "${ANDROID_OPENSSL_AAR}" && rm -rf /tmp/openssl.zip else - echo "Must pass \"Linux\", \"tvOS\", \"iOS\" or \"OSX\" as first argument." + echo "Must pass \"Linux\", \"Android\", \"tvOS\", \"iOS\" or \"OSX\" as first argument." exit 1 fi diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index e7cd12b6a4ea..5135de072544 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -86,11 +86,13 @@ $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)','PDB')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)','sharedFramework')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRSharedFrameworkDir)','PDB')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)','$(CoreCLRCrossTargetComponentDirName)','sharedFramework')) @@ -112,18 +114,19 @@ + $(CoreCLRSharedFrameworkPdbDir)*.pdb; + $(CoreCLRSharedFrameworkPdbDir)*.dbg; + $(CoreCLRSharedFrameworkPdbDir)*.dwarf" /> - + Include="$(CoreCLRArtifactsPdbDir)System.Private.CoreLib.pdb" /> + + + $(CoreCLRSharedFrameworkPdbDir)*.pdb; + $(CoreCLRSharedFrameworkPdbDir)*.dbg; + $(CoreCLRSharedFrameworkPdbDir)*.dwarf" /> runtime/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native @@ -192,7 +195,7 @@ $(LibrariesNativeArtifactsPath)dotnet.js; $(LibrariesNativeArtifactsPath)dotnet.wasm; $(LibrariesNativeArtifactsPath)dotnet.timezones.blat; - $(LibrariesNativeArtifactsPath)icudt.dat;" + $(LibrariesNativeArtifactsPath)*.dat;" IsNative="true" /> diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index b976f5fdc6cf..bf2863e15c1d 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -6,8 +6,8 @@ initTargetDistroRid() local passedRootfsDir="" - # Only pass ROOTFS_DIR if cross is specified. - if [[ "$__CrossBuild" == 1 ]]; then + # Only pass ROOTFS_DIR if cross is specified and the target platform is not Darwin that doesn't use rootfs + if [[ "$__CrossBuild" == 1 && "$platform" != "Darwin" ]]; then passedRootfsDir="$ROOTFS_DIR" fi @@ -48,11 +48,6 @@ check_prereqs() { echo "Checking prerequisites..." - if ! cmake --help 2>&1 | grep -q \\-B; then - echo "Please install cmake v3.14.5 or newer from https://www.cmake.org/download/." - exit 1 - fi - if [[ "$__HostOS" == "OSX" ]]; then # Check presence of pkg-config on the path command -v pkg-config 2>/dev/null || { echo >&2 "Please install pkg-config before running this script, see https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/macos-requirements.md"; exit 1; } @@ -60,7 +55,7 @@ check_prereqs() if ! pkg-config openssl ; then # We export the proper PKG_CONFIG_PATH where openssl was installed by Homebrew # It's important to _export_ it since build-commons.sh is sourced by other scripts such as build-native.sh - export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig + export PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/openssl/lib/pkgconfig # We try again with the PKG_CONFIG_PATH in place, if pkg-config still can't find OpenSSL, exit with an error, cmake won't find OpenSSL either pkg-config openssl || { echo >&2 "Please install openssl before running this script, see https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/macos-requirements.md"; exit 1; } fi @@ -73,15 +68,28 @@ check_prereqs() build_native() { - platformArch="$1" - cmakeDir="$2" - tryrunDir="$3" - intermediatesDir="$4" - message="$5" + targetOS="$1" + platformArch="$2" + cmakeDir="$3" + tryrunDir="$4" + intermediatesDir="$5" + cmakeArgs="$6" + message="$7" # All set to commence the build echo "Commencing build of \"$message\" for $__TargetOS.$__BuildArch.$__BuildType in $intermediatesDir" + if [[ "$targetOS" == OSX ]]; then + if [[ "$platformArch" == x64 ]]; then + cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs" + elif [[ "$platformArch" == arm64 ]]; then + cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs" + else + echo "Error: Unknown OSX architecture $platformArch." + exit 1 + fi + fi + if [[ "$__UseNinja" == 1 ]]; then generator="ninja" buildTool="$(command -v ninja || command -v ninja-build)" @@ -139,8 +147,8 @@ EOF fi engNativeDir="$__RepoRootDir/eng/native" - __CMakeArgs="-DCLR_ENG_NATIVE_DIR=\"$engNativeDir\" $__CMakeArgs" - nextCommand="\"$engNativeDir/gen-buildsys.sh\" \"$cmakeDir\" \"$tryrunDir\" \"$intermediatesDir\" $platformArch $__Compiler \"$__CompilerMajorVersion\" \"$__CompilerMinorVersion\" $__BuildType \"$generator\" $scan_build $__CMakeArgs" + cmakeArgs="-DCLR_ENG_NATIVE_DIR=\"$engNativeDir\" $cmakeArgs" + nextCommand="\"$engNativeDir/gen-buildsys.sh\" \"$cmakeDir\" \"$tryrunDir\" \"$intermediatesDir\" $platformArch $__Compiler \"$__CompilerMajorVersion\" \"$__CompilerMinorVersion\" $__BuildType \"$generator\" $scan_build $cmakeArgs" echo "Invoking $nextCommand" eval $nextCommand @@ -163,12 +171,25 @@ EOF return fi + SAVED_CFLAGS="${CFLAGS}" + SAVED_CXXFLAGS="${CXXFLAGS}" + SAVED_LDFLAGS="${LDFLAGS}" + + # Let users provide additional compiler/linker flags via EXTRA_CFLAGS/EXTRA_CXXFLAGS/EXTRA_LDFLAGS. + # If users directly override CFLAG/CXXFLAGS/LDFLAGS, that may lead to some configure tests working incorrectly. + # See https://github.com/dotnet/runtime/issues/35727 for more information. + export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}" + export CXXFLAGS="${CXXFLAGS} ${EXTRA_CXXFLAGS}" + export LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}" + + local exit_code if [[ "$__StaticAnalyzer" == 1 ]]; then pushd "$intermediatesDir" buildTool="$SCAN_BUILD_COMMAND -o $__BinDir/scan-build-log $buildTool" echo "Executing $buildTool install -j $__NumProc" "$buildTool" install -j "$__NumProc" + exit_code="$?" popd else @@ -177,11 +198,15 @@ EOF cmake_command="emcmake $cmake_command" fi - echo "Executing $cmake_command --build \"$intermediatesDir\" --target install -j $__NumProc" - $cmake_command --build "$intermediatesDir" --target install -j "$__NumProc" + echo "Executing $cmake_command --build \"$intermediatesDir\" --target install -- -j $__NumProc" + $cmake_command --build "$intermediatesDir" --target install -- -j "$__NumProc" + exit_code="$?" fi - local exit_code="$?" + CFLAGS="${SAVED_CFLAGS}" + CXXFLAGS="${SAVED_CXXFLAGS}" + LDFLAGS="${SAVED_LDFLAGS}" + if [[ "$exit_code" != 0 ]]; then echo "${__ErrMsgPrefix}Failed to build \"$message\"." exit "$exit_code" @@ -213,6 +238,7 @@ usage() echo "-portablebuild: pass -portablebuild=false to force a non-portable build." echo "-skipconfigure: skip build configuration." echo "-skipgenerateversion: disable version generation even if MSBuild is supported." + echo "-keepnativesymbols: keep native/unmanaged debug symbols." echo "-verbose: optional argument to enable verbose build output." echo "" echo "Additional Options:" @@ -234,6 +260,20 @@ __BuildOS=$os __msbuildonunsupportedplatform=0 +# Get the number of processors available to the scheduler +# Other techniques such as `nproc` only get the number of +# processors available to a single process. +platform="$(uname)" +if [[ "$platform" == "FreeBSD" ]]; then + __NumProc=$(sysctl hw.ncpu | awk '{ print $2+1 }') +elif [[ "$platform" == "NetBSD" || "$platform" == "SunOS" ]]; then + __NumProc=$(($(getconf NPROCESSORS_ONLN)+1)) +elif [[ "$platform" == "Darwin" ]]; then + __NumProc=$(($(getconf _NPROCESSORS_ONLN)+1)) +else + __NumProc=$(nproc --all) +fi + while :; do if [[ "$#" -le 0 ]]; then break @@ -328,6 +368,10 @@ while :; do __CompilerMinorVersion="${parts[1]}" ;; + keepnativesymbols|-keepnativesymbols) + __CMakeArgs="$__CMakeArgs -DCLR_CMAKE_KEEP_NATIVE_SYMBOLS=true" + ;; + msbuildonunsupportedplatform|-msbuildonunsupportedplatform) __msbuildonunsupportedplatform=1 ;; @@ -400,20 +444,6 @@ while :; do shift done -# Get the number of processors available to the scheduler -# Other techniques such as `nproc` only get the number of -# processors available to a single process. -platform="$(uname)" -if [[ "$platform" == "FreeBSD" ]]; then - __NumProc=$(sysctl hw.ncpu | awk '{ print $2+1 }') -elif [[ "$platform" == "NetBSD" || "$platform" == "SunOS" ]]; then - __NumProc=$(($(getconf NPROCESSORS_ONLN)+1)) -elif [[ "$platform" == "Darwin" ]]; then - __NumProc=$(($(getconf _NPROCESSORS_ONLN)+1)) -else - __NumProc=$(nproc --all) -fi - __CommonMSBuildArgs="/p:TargetArchitecture=$__BuildArch /p:Configuration=$__BuildType /p:TargetOS=$__TargetOS /nodeReuse:false $__OfficialBuildIdArg $__SignTypeArg $__SkipRestoreArg" # Configure environment if we are doing a verbose build @@ -431,7 +461,8 @@ fi if [[ "$__CrossBuild" == 1 ]]; then CROSSCOMPILE=1 export CROSSCOMPILE - if [[ ! -n "$ROOTFS_DIR" ]]; then + # Darwin that doesn't use rootfs + if [[ ! -n "$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 9d1b88f08011..7adc24d6acb6 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -8,8 +8,6 @@ set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -cmake_policy(SET CMP0083 NEW) - include(CheckCXXCompilerFlag) # "configureoptimization.cmake" must be included after CLR_CMAKE_HOST_UNIX has been set. @@ -19,9 +17,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/configureoptimization.cmake) # Initialize Cmake compiler flags and other variables #----------------------------------------------------- -if(MSVC) - add_compile_options(/Zi /FC /Zc:strictStrings) -elseif (CLR_CMAKE_HOST_UNIX) +if (CLR_CMAKE_HOST_UNIX) add_compile_options(-g) add_compile_options(-Wall) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -40,11 +36,18 @@ set(CMAKE_CXX_FLAGS_CHECKED "") set(CMAKE_EXE_LINKER_FLAGS_CHECKED "") set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "") +set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "") +set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "") +set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "") +set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "") + add_compile_definitions("$<$,$>:DEBUG;_DEBUG;_DBG;URTBLDENV_FRIENDLY=Checked;BUILDENV_CHECKED=1>") add_compile_definitions("$<$,$>:NDEBUG;URTBLDENV_FRIENDLY=Retail>") if (MSVC) - add_link_options(/GUARD:CF) + add_linker_flag(/GUARD:CF) # Linker flags # @@ -57,48 +60,51 @@ if (MSVC) endif () #Do not create Side-by-Side Assembly Manifest - add_link_options($<$,SHARED_LIBRARY>:/MANIFEST:NO>) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") # can handle addresses larger than 2 gigabytes - add_link_options($<$,SHARED_LIBRARY>:/LARGEADDRESSAWARE>) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE") #Compatible with Data Execution Prevention - add_link_options($<$,SHARED_LIBRARY>:/NXCOMPAT>) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NXCOMPAT") #Use address space layout randomization - add_link_options($<$,SHARED_LIBRARY>:/DYNAMICBASE>) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DYNAMICBASE") #shrink pdb size - add_link_options($<$,SHARED_LIBRARY>:/PDBCOMPRESS>) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /PDBCOMPRESS") - add_link_options($<$,SHARED_LIBRARY>:/DEBUG>) - add_link_options($<$,SHARED_LIBRARY>:/IGNORE:4197,4013,4254,4070,4221>) - add_link_options($<$,SHARED_LIBRARY>:/SUBSYSTEM:WINDOWS,${WINDOWS_SUBSYSTEM_VERSION}>) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /IGNORE:4197,4013,4254,4070,4221") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS,${WINDOWS_SUBSYSTEM_VERSION}") set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221") - add_link_options($<$,EXECUTABLE>:/DEBUG>) - add_link_options($<$,EXECUTABLE>:/PDBCOMPRESS>) - add_link_options($<$,EXECUTABLE>:/STACK:1572864>) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /PDBCOMPRESS") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864") # Debug build specific flags - add_link_options($<$,$>,$,SHARED_LIBRARY>>:/NOVCFEATURE>) + set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /NOVCFEATURE") + set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "${CMAKE_SHARED_LINKER_FLAGS_CHECKED} /NOVCFEATURE") # Checked build specific flags - add_link_options($<$:/INCREMENTAL:NO>) # prevent "warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification" - add_link_options($<$:/OPT:REF>) - add_link_options($<$:/OPT:NOICF>) + add_linker_flag(/INCREMENTAL:NO CHECKED) # prevent "warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification" + add_linker_flag(/OPT:REF CHECKED) + add_linker_flag(/OPT:NOICF CHECKED) # Release build specific flags - add_link_options($<$:/LTCG>) - add_link_options($<$:/OPT:REF>) - add_link_options($<$:/OPT:ICF>) + add_linker_flag(/LTCG RELEASE) + add_linker_flag(/OPT:REF RELEASE) + add_linker_flag(/OPT:ICF RELEASE) + add_linker_flag(/INCREMENTAL:NO RELEASE) set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG") # ReleaseWithDebugInfo build specific flags - add_link_options($<$:/LTCG>) - add_link_options($<$:/OPT:REF>) - add_link_options($<$:/OPT:ICF>) + add_linker_flag(/LTCG RELWITHDEBINFO) + add_linker_flag(/OPT:REF RELWITHDEBINFO) + add_linker_flag(/OPT:ICF RELWITHDEBINFO) set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /LTCG") # Force uCRT to be dynamically linked for Release build - add_link_options("$<$:/NODEFAULTLIB:libucrt.lib;/DEFAULTLIB:ucrt.lib>") + add_linker_flag(/NODEFAULTLIB:libucrt.lib RELEASE) + add_linker_flag(/DEFAULTLIB:ucrt.lib RELEASE) elseif (CLR_CMAKE_HOST_UNIX) # Set the values to display when interactively configuring CMAKE_BUILD_TYPE @@ -157,11 +163,10 @@ elseif (CLR_CMAKE_HOST_UNIX) # -fdata-sections -ffunction-sections: each function has own section instead of one per .o file (needed for --gc-sections) # -O1: optimization level used instead of -O0 to avoid compile error "invalid operand for inline asm constraint" - add_compile_definitions("$<$,$>:${CLR_SANITIZE_CXX_OPTIONS};-fdata-sections;--ffunction-sections;-O1>") - add_link_options($<$,$>,$,EXECUTABLE>>:${CLR_SANITIZE_LINK_OPTIONS}>) - + add_compile_options("$<$,$>:${CLR_SANITIZE_CXX_OPTIONS};-fdata-sections;--ffunction-sections;-O1>") + add_linker_flag("${CLR_SANITIZE_LINK_OPTIONS}" DEBUG CHECKED) # -Wl and --gc-sections: drop unused sections\functions (similar to Windows /Gy function-level-linking) - add_link_options("$<$,$>,$,SHARED_LIBRARY>>:${CLR_SANITIZE_LINK_OPTIONS};-Wl,--gc-sections>") + add_linker_flag("-Wl,--gc-sections" DEBUG CHECKED) endif () endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED) endif(MSVC) @@ -173,15 +178,18 @@ endif(MSVC) # ./build-native.sh cmakeargs "-DCLR_ADDITIONAL_COMPILER_OPTIONS=<...>" cmakeargs "-DCLR_ADDITIONAL_LINKER_FLAGS=<...>" # if(CLR_CMAKE_HOST_UNIX) - add_link_options(${CLR_ADDITIONAL_LINKER_FLAGS}) + foreach(ADDTL_LINKER_FLAG ${CLR_ADDITIONAL_LINKER_FLAGS}) + add_linker_flag(${ADDTL_LINKER_FLAG}) + endforeach() endif(CLR_CMAKE_HOST_UNIX) if(CLR_CMAKE_HOST_LINUX) add_compile_options($<$:-Wa,--noexecstack>) - add_link_options(-Wl,--build-id=sha1 -Wl,-z,relro,-z,now) + add_linker_flag(-Wl,--build-id=sha1) + add_linker_flag(-Wl,-z,relro,-z,now) elseif(CLR_CMAKE_HOST_FREEBSD) add_compile_options($<$:-Wa,--noexecstack>) - add_link_options(LINKER:--build-id=sha1) + add_linker_flag("-Wl,--build-id=sha1") elseif(CLR_CMAKE_HOST_SUNOS) add_compile_options($<$:-Wa,--noexecstack>) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector") @@ -193,13 +201,21 @@ endif() # Definitions (for platform) #----------------------------------- if (CLR_CMAKE_HOST_ARCH_AMD64) + set(ARCH_HOST_NAME x64) add_definitions(-DHOST_AMD64) add_definitions(-DHOST_64BIT) elseif (CLR_CMAKE_HOST_ARCH_I386) + set(ARCH_HOST_NAME x86) add_definitions(-DHOST_X86) elseif (CLR_CMAKE_HOST_ARCH_ARM) + if (ARM_SOFTFP) + set(ARCH_HOST_NAME armel) + else () + set(ARCH_HOST_NAME arm) + endif () add_definitions(-DHOST_ARM) elseif (CLR_CMAKE_HOST_ARCH_ARM64) + set(ARCH_HOST_NAME arm64) add_definitions(-DHOST_ARM64) add_definitions(-DHOST_64BIT) else () @@ -226,6 +242,7 @@ if (CLR_CMAKE_HOST_UNIX) add_definitions(-DHOST_UNIX) if(CLR_CMAKE_HOST_OSX) + add_definitions(-DHOST_OSX) if(CLR_CMAKE_HOST_UNIX_AMD64) message("Detected OSX x86_64") elseif(CLR_CMAKE_HOST_UNIX_ARM64) @@ -254,18 +271,22 @@ endif(CLR_CMAKE_HOST_WIN32) # Architecture specific files folder name if (CLR_CMAKE_TARGET_ARCH_AMD64) set(ARCH_SOURCES_DIR amd64) - add_definitions(-DTARGET_AMD64) - add_definitions(-DTARGET_64BIT) + set(ARCH_TARGET_NAME x64) + add_compile_definitions($<$>>:TARGET_AMD64>) + add_compile_definitions($<$>>:TARGET_64BIT>) elseif (CLR_CMAKE_TARGET_ARCH_ARM64) set(ARCH_SOURCES_DIR arm64) - add_definitions(-DTARGET_ARM64) - add_definitions(-DTARGET_64BIT) + set(ARCH_TARGET_NAME arm64) + add_compile_definitions($<$>>:TARGET_ARM64>) + add_compile_definitions($<$>>:TARGET_64BIT>) elseif (CLR_CMAKE_TARGET_ARCH_ARM) set(ARCH_SOURCES_DIR arm) - add_definitions(-DTARGET_ARM) + set(ARCH_TARGET_NAME arm) + add_compile_definitions($<$>>:TARGET_ARM>) elseif (CLR_CMAKE_TARGET_ARCH_I386) + set(ARCH_TARGET_NAME x86) set(ARCH_SOURCES_DIR i386) - add_definitions(-DTARGET_X86) + add_compile_definitions($<$>>:TARGET_X86>) else () clr_unknown_arch() endif () @@ -305,6 +326,12 @@ if (CLR_CMAKE_HOST_UNIX) add_compile_options(-Wno-unused-variable) add_compile_options(-Wno-unused-value) add_compile_options(-Wno-unused-function) + add_compile_options(-Wno-tautological-compare) + + check_cxx_compiler_flag(-Wimplicit-fallthrough COMPILER_SUPPORTS_W_IMPLICIT_FALLTHROUGH) + if (COMPILER_SUPPORTS_W_IMPLICIT_FALLTHROUGH) + add_compile_options(-Wimplicit-fallthrough) + endif() #These seem to indicate real issues add_compile_options($<$:-Wno-invalid-offsetof>) @@ -318,8 +345,6 @@ if (CLR_CMAKE_HOST_UNIX) add_compile_options(-Wno-unused-private-field) # Explicit constructor calls are not supported by clang (this->ClassName::ClassName()) add_compile_options(-Wno-microsoft) - # This warning is caused by comparing 'this' to NULL - add_compile_options(-Wno-tautological-compare) # There are constants of type BOOL used in a condition. But BOOL is defined as int # and so the compiler thinks that there is a mistake. add_compile_options(-Wno-constant-logical-operand) @@ -351,7 +376,7 @@ if (CLR_CMAKE_HOST_UNIX) endif() # Some architectures (e.g., ARM) assume char type is unsigned while CoreCLR assumes char is signed - # as x64 does. It has been causing issues in ARM (https://github.com/dotnet/coreclr/issues/4746) + # as x64 does. It has been causing issues in ARM (https://github.com/dotnet/runtime/issues/5778) add_compile_options(-fsigned-char) # We mark the function which needs exporting with DLLEXPORT @@ -359,31 +384,40 @@ if (CLR_CMAKE_HOST_UNIX) # Specify the minimum supported version of macOS if(CLR_CMAKE_HOST_OSX) - set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.12) + if(CLR_CMAKE_HOST_ARCH_ARM64) + # 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer + set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=11.0) + add_compile_options(-arch arm64) + elseif(CLR_CMAKE_HOST_ARCH_AMD64) + set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.13) + add_compile_options(-arch x86_64) + else() + clr_unknown_arch() + endif() add_compile_options(${MACOS_VERSION_MIN_FLAGS}) - add_link_options(${MACOS_VERSION_MIN_FLAGS}) + add_linker_flag(${MACOS_VERSION_MIN_FLAGS}) endif(CLR_CMAKE_HOST_OSX) endif(CLR_CMAKE_HOST_UNIX) if(CLR_CMAKE_TARGET_UNIX) - add_definitions(-DTARGET_UNIX) + add_compile_definitions($<$>>:TARGET_UNIX>) # Contracts are disabled on UNIX. add_definitions(-DDISABLE_CONTRACTS) if(CLR_CMAKE_TARGET_OSX) - add_definitions(-DTARGET_OSX) + add_compile_definitions($<$>>:TARGET_OSX>) elseif(CLR_CMAKE_TARGET_FREEBSD) - add_definitions(-DTARGET_FREEBSD) + add_compile_definitions($<$>>:TARGET_FREEBSD>) elseif(CLR_CMAKE_TARGET_LINUX) - add_definitions(-DTARGET_LINUX) + add_compile_definitions($<$>>:TARGET_LINUX>) elseif(CLR_CMAKE_TARGET_NETBSD) - add_definitions(-DTARGET_NETBSD) + add_compile_definitions($<$>>:TARGET_NETBSD>) elseif(CLR_CMAKE_TARGET_SUNOS) - add_definitions(-DTARGET_SUNOS) + add_compile_definitions($<$>>:TARGET_SUNOS>) elseif(CLR_CMAKE_TARGET_ANDROID) - add_definitions(-DTARGET_ANDROID) + add_compile_definitions($<$>>:TARGET_ANDROID>) endif() else(CLR_CMAKE_TARGET_UNIX) - add_definitions(-DTARGET_WINDOWS) + add_compile_definitions($<$>>:TARGET_WINDOWS>) endif(CLR_CMAKE_TARGET_UNIX) if(CLR_CMAKE_HOST_UNIX_ARM) @@ -417,31 +451,48 @@ endif(CLR_CMAKE_HOST_UNIX) if (MSVC) # Compile options for targeting windows - # The following options are set by the razzle build - add_compile_options(/TP) # compile all files as C++ - add_compile_options(/nologo) # Suppress Startup Banner - add_compile_options(/W3) # set warning level to 3 - add_compile_options(/WX) # treat warnings as errors - 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 - add_compile_options(/Zp8) # pack structs on 8-byte boundary - add_compile_options(/Gy) # separate functions for linker - add_compile_options(/Zc:wchar_t-) # C++ language conformance: wchar_t is NOT the native type, but a typedef - add_compile_options(/Zc:forScope) # C++ language conformance: enforce Standard C++ for scoping rules - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /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(/wd4960 /wd4961 /wd4603 /wd4627 /wd4838 /wd4456 /wd4457 /wd4458 /wd4459 /wd4091 /we4640) + add_compile_options($<$:/TP>) # compile all files as C++ + add_compile_options($<$:/nologo>) # Suppress Startup Banner + add_compile_options($<$:/W3>) # set warning level to 3 + add_compile_options($<$:/WX>) # treat warnings as errors + 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($<$:/Gm->) # disable minimal rebuild + add_compile_options($<$:/Zp8>) # pack structs on 8-byte boundary + add_compile_options($<$:/Gy>) # separate functions for linker + add_compile_options($<$:/GS>) # Explicitly enable the buffer security checks + add_compile_options($<$:/fp:precise>) # Enable precise floating point + + # disable C++ RTTI + # /GR is added by default by CMake, so remove it manually. + 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 + add_compile_options($<$:/MP>) # Build with Multiple Processes (number of processes equal to the number of processors) + add_compile_options($<$:/Zm200>) # Specify Precompiled Header Memory Allocation Limit of 150MB + add_compile_options($<$:/Zc:strictStrings>) # Disable string-literal to char* or wchar_t* conversion + add_compile_options($<$:/Zc:wchar_t>) # wchar_t is a built-in type. + add_compile_options($<$:/Zc:inline>) # All inline functions must have their definition available in the current translation unit. + add_compile_options($<$:/Zc:forScope>) # Enforce standards-compliant for scope. + + add_compile_options($<$:/wd4960>) + add_compile_options($<$:/wd4961>) + add_compile_options($<$:/wd4603>) + add_compile_options($<$:/wd4627>) + add_compile_options($<$:/wd4838>) + add_compile_options($<$:/wd4456>) + add_compile_options($<$:/wd4457>) + add_compile_options($<$:/wd4458>) + add_compile_options($<$:/wd4459>) + add_compile_options($<$:/wd4091>) + add_compile_options($<$:/we4640>) # Disable Warnings: # 4291: Delete not defined for new, c++ exception may cause leak. - add_compile_options(/wd4291) + # 5105: Windows SDK headers use 'defined' operator in some macros + add_compile_options($<$:/wd4291>) + add_compile_options($<$:/wd5105>) # Treat Warnings as Errors: # 4007: 'main' : must be __cdecl. @@ -450,7 +501,12 @@ if (MSVC) # 4551: Function call missing argument list. # 4700: Local used w/o being initialized. # 4806: Unsafe operation involving type 'bool'. - add_compile_options(/we4007 /we4013 /we4102 /we4551 /we4700 /we4806) + add_compile_options($<$:/we4007>) + add_compile_options($<$:/we4013>) + add_compile_options($<$:/we4102>) + add_compile_options($<$:/we4551>) + add_compile_options($<$:/we4700>) + add_compile_options($<$:/we4806>) # Set Warning Level 3: # 4092: Sizeof returns 'unsigned long'. @@ -461,26 +517,32 @@ if (MSVC) # 4212: Function declaration used ellipsis. # 4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX. # 35038: data member 'member1' will be initialized after data member 'member2'. - add_compile_options(/w34092 /w34121 /w34125 /w34130 /w34132 /w34212 /w34530 /w35038) + add_compile_options($<$:/w34092>) + add_compile_options($<$:/w34121>) + add_compile_options($<$:/w34125>) + add_compile_options($<$:/w34130>) + add_compile_options($<$:/w34132>) + add_compile_options($<$:/w34212>) + add_compile_options($<$:/w34530>) + add_compile_options($<$:/w35038>) # Set Warning Level 4: # 4177: Pragma data_seg s/b at global scope. - add_compile_options(/w44177) + add_compile_options($<$:/w44177>) - add_compile_options(/Zi) # enable debugging information - add_compile_options(/ZH:SHA_256) # use SHA256 for generating hashes of compiler processed source files. - add_compile_options(/source-charset:utf-8) # Force MSVC to compile source as UTF-8. + add_compile_options($<$:/Zi>) # enable debugging information + add_compile_options($<$:/ZH:SHA_256>) # use SHA256 for generating hashes of compiler processed source files. + add_compile_options($<$:/source-charset:utf-8>) # Force MSVC to compile source as UTF-8. if (CLR_CMAKE_HOST_ARCH_I386) - add_compile_options(/Gz) + add_compile_options($<$:/Gz>) endif (CLR_CMAKE_HOST_ARCH_I386) - add_compile_options($<$,$>:/GL>) - add_compile_options($<$,$>,$>:/O1>) + add_compile_options($<$,$,$>>:/GL>) if (CLR_CMAKE_HOST_ARCH_AMD64) - # The generator expression in the following command means that the /homeparams option is added only for debug builds - add_compile_options($<$:/homeparams>) # Force parameters passed in registers to be written to the stack + # The generator expression in the following command means that the /homeparams option is added only for debug builds for C and C++ source files + add_compile_options($<$,$>:/homeparams>) # Force parameters passed in registers to be written to the stack endif (CLR_CMAKE_HOST_ARCH_AMD64) # enable control-flow-guard support for native components for non-Arm64 builds @@ -494,9 +556,7 @@ if (MSVC) # For Release builds, we shall dynamically link into uCRT [ucrtbase.dll] (which is pushed down as a Windows Update on downlevel OS) but # wont do the same for debug/checked builds since ucrtbased.dll is not redistributable and Debug/Checked builds are not # production-time scenarios. - - add_compile_options($<$,$>,$>>:/MT>) - add_compile_options($<$,$>,$>>>:/MTd>) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$,$>,$>>>:Debug>) add_compile_options($<$:/ZH:SHA_256>) @@ -505,6 +565,8 @@ if (MSVC) add_definitions(-DDISABLE_CONTRACTS) endif (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64) + # Don't display the output header when building RC files. + add_compile_options($<$:/nologo>) endif (MSVC) if(CLR_CMAKE_ENABLE_CODE_COVERAGE) @@ -517,28 +579,21 @@ if(CLR_CMAKE_ENABLE_CODE_COVERAGE) add_compile_options(-fprofile-arcs) add_compile_options(-ftest-coverage) - add_link_options(--coverage) + add_linker_flag(--coverage) else() message(FATAL_ERROR "Code coverage builds not supported on current platform") endif(CLR_CMAKE_HOST_UNIX) endif(CLR_CMAKE_ENABLE_CODE_COVERAGE) -if (CMAKE_BUILD_TOOL STREQUAL nmake) +if (CMAKE_GENERATOR MATCHES "(Makefile|Ninja)") set(CMAKE_RC_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}") -endif(CMAKE_BUILD_TOOL STREQUAL nmake) +endif() # Ensure other tools are present if (CLR_CMAKE_HOST_WIN32) if(CLR_CMAKE_HOST_ARCH_ARM) - # Confirm that Windows SDK is present - if(NOT DEFINED CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION OR CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION STREQUAL "" ) - message(FATAL_ERROR "Windows SDK is required for the Arm32 build.") - else() - message("Using Windows SDK version ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") - endif() - # Explicitly specify the assembler to be used for Arm32 compile file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm\\armasm.exe" CMAKE_ASM_COMPILER) @@ -548,14 +603,13 @@ if (CLR_CMAKE_HOST_WIN32) # Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly # use ml[64].exe as the assembler. enable_language(ASM) - elseif(CLR_CMAKE_HOST_ARCH_ARM64) + set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "") + set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "") + set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "") + set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "") + set(CMAKE_ASM_COMPILE_OBJECT " -g -o ") - # Confirm that Windows SDK is present - if(NOT DEFINED CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION OR CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION STREQUAL "" ) - message(FATAL_ERROR "Windows SDK is required for the ARM64 build.") - else() - message("Using Windows SDK version ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") - endif() + elseif(CLR_CMAKE_HOST_ARCH_ARM64) # Explicitly specify the assembler to be used for Arm64 compile file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm64\\armasm64.exe" CMAKE_ASM_COMPILER) @@ -566,8 +620,17 @@ if (CLR_CMAKE_HOST_WIN32) # Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly # use ml[64].exe as the assembler. enable_language(ASM) + set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "") + set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "") + set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "") + set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "") + set(CMAKE_ASM_COMPILE_OBJECT " -g -o ") else() enable_language(ASM_MASM) + set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "") + set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "") + set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "") + set(CMAKE_ASM_MASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "") endif() # Ensure that MC is present diff --git a/eng/native/configureoptimization.cmake b/eng/native/configureoptimization.cmake index 548a8585b11f..dcb7d4d8c3ee 100644 --- a/eng/native/configureoptimization.cmake +++ b/eng/native/configureoptimization.cmake @@ -1,8 +1,8 @@ if(CLR_CMAKE_HOST_WIN32) - add_compile_options($<$:/Od>) - add_compile_options($<$:/O1>) - add_compile_options($<$:/Ox>) - add_compile_options($<$:/O2>) + add_compile_options($<$,$>:/Od>) + add_compile_options($<$,$>:/O1>) + add_compile_options($<$,$>:/Ox>) + add_compile_options($<$,$>:/O2>) elseif(CLR_CMAKE_HOST_UNIX) add_compile_options($<$:-O0>) add_compile_options($<$:-O2>) diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index c65274141dd4..0d4ee0dae6de 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -1,4 +1,3 @@ -include(CheckPIESupported) include(${CMAKE_CURRENT_LIST_DIR}/functions.cmake) # If set, indicates that this is not an officially supported release @@ -79,9 +78,9 @@ endif(CLR_CMAKE_HOST_OS STREQUAL Linux) if(CLR_CMAKE_HOST_OS STREQUAL Darwin) set(CLR_CMAKE_HOST_UNIX 1) set(CLR_CMAKE_HOST_OSX 1) - if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64) + if(CMAKE_OSX_ARCHITECTURES STREQUAL x86_64) set(CLR_CMAKE_HOST_UNIX_AMD64 1) - elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) + elseif(CMAKE_OSX_ARCHITECTURES STREQUAL arm64) set(CLR_CMAKE_HOST_UNIX_ARM64 1) else() clr_unknown_arch() @@ -365,8 +364,8 @@ endif(CLR_CMAKE_TARGET_UNIX) # check if host & target os/arch combination are valid if (CLR_CMAKE_TARGET_OS STREQUAL CLR_CMAKE_HOST_OS) if(NOT(CLR_CMAKE_TARGET_ARCH STREQUAL CLR_CMAKE_HOST_ARCH)) - if(NOT((CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM64) OR (CLR_CMAKE_HOST_ARCH_I386 AND CLR_CMAKE_TARGET_ARCH_ARM) OR (CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM))) - message(FATAL_ERROR "Invalid platform and target arch combination") + if(NOT((CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM64) OR (CLR_CMAKE_HOST_ARCH_I386 AND CLR_CMAKE_TARGET_ARCH_ARM) OR (CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM) OR (CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_I386))) + message(FATAL_ERROR "Invalid platform and target arch combination TARGET_ARCH=${CLR_CMAKE_TARGET_ARCH} HOST_ARCH=${CLR_CMAKE_HOST_ARCH}") endif() endif() else() @@ -382,24 +381,11 @@ else() endif() if(NOT CLR_CMAKE_TARGET_BROWSER) - # Skip check_pie_supported call on Android as ld from llvm toolchain with NDK API level 21 - # complains about missing linker flag `-no-pie` (while level 28's ld does support this flag, - # but since we know that PIE is supported, we can safely skip this redundant check). - # # The default linker on Solaris also does not support PIE. - if(NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_SUNOS) - # All code we build should be compiled as position independent - get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES) - if("CXX" IN_LIST languages) - set(CLR_PIE_LANGUAGE CXX) - else() - set(CLR_PIE_LANGUAGE C) - endif() - check_pie_supported(OUTPUT_VARIABLE PIE_SUPPORT_OUTPUT LANGUAGES ${CLR_PIE_LANGUAGE}) - if(NOT MSVC AND NOT CMAKE_${CLR_PIE_LANGUAGE}_LINK_PIE_SUPPORTED) - message(WARNING "PIE is not supported at link time: ${PIE_SUPPORT_OUTPUT}.\n" - "PIE link options will not be passed to linker.") - endif() + if(NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_SUNOS AND NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_HOST_TVOS AND NOT CLR_CMAKE_HOST_IOS AND NOT MSVC) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") + add_compile_options($<$,EXECUTABLE>:-fPIE>) + add_compile_options($<$,SHARED_LIBRARY>:-fPIC>) endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/eng/native/configuretools.cmake b/eng/native/configuretools.cmake index 0edbe2ee6d02..85e6bac96c7d 100644 --- a/eng/native/configuretools.cmake +++ b/eng/native/configuretools.cmake @@ -41,10 +41,9 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER) locate_toolchain_exec(ar CMAKE_AR) locate_toolchain_exec(nm CMAKE_NM) + locate_toolchain_exec(ranlib CMAKE_RANLIB) - if(CMAKE_C_COMPILER_ID MATCHES "GNU") - locate_toolchain_exec(ranlib CMAKE_RANLIB) - else() + if(CMAKE_C_COMPILER_ID MATCHES "Clang") locate_toolchain_exec(link CMAKE_LINKER) endif() diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index 8b73581ed142..e8f4a6f24186 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -126,7 +126,7 @@ function(preprocess_file inputFilename outputFilename) if (MSVC) add_custom_command( OUTPUT ${outputFilename} - COMMAND ${CMAKE_CXX_COMPILER} ${PREPROCESS_INCLUDE_DIRECTORIES} /P /EP /TC ${PREPROCESS_DEFINITIONS} /Fi${outputFilename} ${inputFilename} + COMMAND ${CMAKE_CXX_COMPILER} ${PREPROCESS_INCLUDE_DIRECTORIES} /P /EP /TC ${PREPROCESS_DEFINITIONS} /Fi${outputFilename} ${inputFilename} /nologo DEPENDS ${inputFilename} COMMENT "Preprocessing ${inputFilename}. Outputting to ${outputFilename}" ) @@ -143,32 +143,58 @@ function(preprocess_file inputFilename outputFilename) PROPERTIES GENERATED TRUE) endfunction() -# preprocess_compile_asm(TARGET target ASM_FILES file1 [file2 ...] OUTPUT_OBJECTS [variableName]) -function(preprocess_compile_asm) +# preprocess_files(PreprocessedFilesList [fileToPreprocess1 [fileToPreprocess2 ...]]) +function(preprocess_files PreprocessedFilesList) + set(FilesToPreprocess ${ARGN}) + foreach(ASM_FILE IN LISTS FilesToPreprocess) + # Inserts a custom command in CMake build to preprocess each asm source file + get_filename_component(name ${ASM_FILE} NAME_WE) + file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${name}.asm" ASM_PREPROCESSED_FILE) + preprocess_file(${ASM_FILE} ${ASM_PREPROCESSED_FILE}) + list(APPEND PreprocessedFiles ${ASM_PREPROCESSED_FILE}) + endforeach() + set(${PreprocessedFilesList} ${PreprocessedFiles} PARENT_SCOPE) +endfunction() + +function(set_exports_linker_option exports_filename) + if(LD_GNU OR LD_SOLARIS) + # Add linker exports file option + if(LD_SOLARIS) + set(EXPORTS_LINKER_OPTION -Wl,-M,${exports_filename} PARENT_SCOPE) + else() + set(EXPORTS_LINKER_OPTION -Wl,--version-script=${exports_filename} PARENT_SCOPE) + endif() + elseif(LD_OSX) + # Add linker exports file option + set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${exports_filename} PARENT_SCOPE) + endif() +endfunction() + +# compile_asm(TARGET target ASM_FILES file1 [file2 ...] OUTPUT_OBJECTS [variableName]) +# CMake does not support the ARM or ARM64 assemblers on Windows when using the +# MSBuild generator. When the MSBuild generator is in use, we manually compile the assembly files +# using this function. +function(compile_asm) set(options "") set(oneValueArgs TARGET OUTPUT_OBJECTS) set(multiValueArgs ASM_FILES) - cmake_parse_arguments(PARSE_ARGV 0 COMPILE_ASM "${options}" "${oneValueArgs}" "${multiValueArgs}") + cmake_parse_arguments(COMPILE_ASM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGV}) get_include_directories_asm(ASM_INCLUDE_DIRECTORIES) set (ASSEMBLED_OBJECTS "") foreach(ASM_FILE ${COMPILE_ASM_ASM_FILES}) - # Inserts a custom command in CMake build to preprocess each asm source file get_filename_component(name ${ASM_FILE} NAME_WE) - file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${name}.asm" ASM_PREPROCESSED_FILE) - preprocess_file(${ASM_FILE} ${ASM_PREPROCESSED_FILE}) - # Produce object file where CMake would store .obj files for an OBJECT library. # ex: artifacts\obj\coreclr\Windows_NT.arm64.Debug\src\vm\wks\cee_wks.dir\Debug\AsmHelpers.obj set (OBJ_FILE "${CMAKE_CURRENT_BINARY_DIR}/${COMPILE_ASM_TARGET}.dir/${CMAKE_CFG_INTDIR}/${name}.obj") # Need to compile asm file using custom command as include directories are not provided to asm compiler add_custom_command(OUTPUT ${OBJ_FILE} - COMMAND "${CMAKE_ASM_MASM_COMPILER}" -g ${ASM_INCLUDE_DIRECTORIES} -o ${OBJ_FILE} ${ASM_PREPROCESSED_FILE} - DEPENDS ${ASM_PREPROCESSED_FILE} - COMMENT "Assembling ${ASM_PREPROCESSED_FILE} ---> \"${CMAKE_ASM_MASM_COMPILER}\" -g ${ASM_INCLUDE_DIRECTORIES} -o ${OBJ_FILE} ${ASM_PREPROCESSED_FILE}") + COMMAND "${CMAKE_ASM_COMPILER}" -g ${ASM_INCLUDE_DIRECTORIES} -o ${OBJ_FILE} ${ASM_FILE} + DEPENDS ${ASM_FILE} + COMMENT "Assembling ${ASM_FILE} ---> \"${CMAKE_ASM_COMPILER}\" -g ${ASM_INCLUDE_DIRECTORIES} -o ${OBJ_FILE} ${ASM_FILE}") # mark obj as source that does not require compile set_source_files_properties(${OBJ_FILE} PROPERTIES EXTERNAL_OBJECT TRUE) @@ -180,20 +206,6 @@ function(preprocess_compile_asm) set(${COMPILE_ASM_OUTPUT_OBJECTS} ${ASSEMBLED_OBJECTS} PARENT_SCOPE) endfunction() -function(set_exports_linker_option exports_filename) - if(LD_GNU OR LD_SOLARIS) - # Add linker exports file option - if(LD_SOLARIS) - set(EXPORTS_LINKER_OPTION -Wl,-M,${exports_filename} PARENT_SCOPE) - else() - set(EXPORTS_LINKER_OPTION -Wl,--version-script=${exports_filename} PARENT_SCOPE) - endif() - elseif(LD_OSX) - # Add linker exports file option - set(EXPORTS_LINKER_OPTION -Wl,-exported_symbols_list,${exports_filename} PARENT_SCOPE) - endif() -endfunction() - function(generate_exports_file) set(INPUT_LIST ${ARGN}) list(GET INPUT_LIST -1 outputFilename) @@ -236,52 +248,6 @@ function(generate_exports_file_prefix inputFilename outputFilename prefix) PROPERTIES GENERATED TRUE) endfunction() -# target_precompile_header(TARGET targetName HEADER headerName [ADDITIONAL_INCLUDE_DIRECTORIES includeDirs]) -function(target_precompile_header) - set(options "") - set(oneValueArgs TARGET HEADER) - set(multiValueArgs ADDITIONAL_INCLUDE_DIRECTORIES) - cmake_parse_arguments(PARSE_ARGV 0 PRECOMPILE_HEADERS "${options}" "${oneValueArgs}" "${multiValueArgs}") - - if ("${PRECOMPILE_HEADERS_TARGET}" STREQUAL "") - message(SEND_ERROR "No target supplied to target_precompile_header.") - endif() - if ("${PRECOMPILE_HEADERS_HEADER}" STREQUAL "") - message(SEND_ERROR "No header supplied to target_precompile_header.") - endif() - - if(MSVC) - get_filename_component(PCH_NAME ${PRECOMPILE_HEADERS_HEADER} NAME_WE) - # We need to use the $ generator here instead of the ${targetName} variable since - # CMake evaluates source file properties once per directory. If we just use ${targetName}, we end up sharing - # the same PCH between targets, which doesn't work. - set(precompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${PCH_NAME}.$.pch") - set(pchSourceFile "${CMAKE_CURRENT_BINARY_DIR}/${PCH_NAME}.${PRECOMPILE_HEADERS_TARGET}.cpp") - - file(GENERATE OUTPUT ${pchSourceFile} CONTENT "#include \"${PRECOMPILE_HEADERS_HEADER}\"") - - set(PCH_SOURCE_FILE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} ${PRECOMPILE_HEADERS_ADDITIONAL_INCLUDE_DIRECTORIES}) - - set_source_files_properties(${pchSourceFile} - PROPERTIES COMPILE_FLAGS "/Yc\"${PRECOMPILE_HEADERS_HEADER}\" /Fp\"${precompiledBinary}\"" - OBJECT_OUTPUTS "${precompiledBinary}" - INCLUDE_DIRECTORIES "${PCH_SOURCE_FILE_INCLUDE_DIRECTORIES}") - get_target_property(TARGET_SOURCES ${PRECOMPILE_HEADERS_TARGET} SOURCES) - - foreach (SOURCE ${TARGET_SOURCES}) - get_source_file_property(SOURCE_LANG ${SOURCE} LANGUAGE) - if (("${SOURCE_LANG}" STREQUAL "C") OR ("${SOURCE_LANG}" STREQUAL "CXX")) - set_source_files_properties(${SOURCE} - PROPERTIES COMPILE_FLAGS "/Yu\"${PRECOMPILE_HEADERS_HEADER}\" /Fp\"${precompiledBinary}\"" - OBJECT_DEPENDS "${precompiledBinary}") - endif() - endforeach() - - # Add pchSourceFile to PRECOMPILE_HEADERS_TARGET target - target_sources(${PRECOMPILE_HEADERS_TARGET} PRIVATE ${pchSourceFile}) - endif(MSVC) -endfunction() - function(strip_symbols targetName outputFilename) if (CLR_CMAKE_HOST_UNIX) set(strip_source_file $) @@ -323,7 +289,7 @@ function(strip_symbols targetName outputFilename) POST_BUILD VERBATIM COMMAND ${CMAKE_OBJCOPY} --only-keep-debug ${strip_source_file} ${strip_destination_file} - COMMAND ${CMAKE_OBJCOPY} --strip-debug ${strip_source_file} + COMMAND ${CMAKE_OBJCOPY} --strip-unneeded ${strip_source_file} COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=${strip_destination_file} ${strip_source_file} COMMENT "Stripping symbols from ${strip_source_file} into file ${strip_destination_file}" ) @@ -331,13 +297,24 @@ function(strip_symbols targetName outputFilename) set(${outputFilename} ${strip_destination_file} PARENT_SCOPE) else(CLR_CMAKE_HOST_UNIX) - set(${outputFilename} ${CMAKE_CURRENT_BINARY_DIR}/$/${targetName}.pdb PARENT_SCOPE) + get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(is_multi_config) + # We can't use the $ generator expression here since + # the generator expression isn't supported on resource DLLs. + set(${outputFilename} ${CMAKE_CURRENT_BINARY_DIR}/$/${targetName}.pdb PARENT_SCOPE) + else() + # We can't use the $ generator expression here since + # the generator expression isn't supported on resource DLLs. + set(${outputFilename} ${CMAKE_CURRENT_BINARY_DIR}/${targetName}.pdb PARENT_SCOPE) + endif() endif(CLR_CMAKE_HOST_UNIX) endfunction() function(install_with_stripped_symbols targetName kind destination) - strip_symbols(${targetName} symbol_file) - install_symbols(${symbol_file} ${destination}) + if(NOT CLR_CMAKE_KEEP_NATIVE_SYMBOLS) + strip_symbols(${targetName} symbol_file) + install_symbols(${symbol_file} ${destination}) + endif() if ("${kind}" STREQUAL "TARGETS") set(install_source ${targetName}) elseif("${kind}" STREQUAL "PROGRAMS") @@ -356,11 +333,10 @@ function(install_symbols symbol_file destination_path) endif() endfunction() -# install_clr(TARGETS TARGETS targetName [targetName2 ...] [ADDITIONAL_DESTINATION destination]) +# install_clr(TARGETS TARGETS targetName [targetName2 ...] [ADDITIONAL_DESTINATIONS destination]) function(install_clr) - set(oneValueArgs ADDITIONAL_DESTINATION) - set(multiValueArgs TARGETS) - cmake_parse_arguments(PARSE_ARGV 0 INSTALL_CLR "${options}" "${oneValueArgs}" "${multiValueArgs}") + set(multiValueArgs TARGETS ADDITIONAL_DESTINATIONS) + cmake_parse_arguments(INSTALL_CLR "" "" "${multiValueArgs}" ${ARGV}) if ("${INSTALL_CLR_TARGETS}" STREQUAL "") message(FATAL_ERROR "At least one target must be passed to install_clr(TARGETS )") @@ -368,25 +344,34 @@ function(install_clr) set(destinations ".") - if (NOT "${INSTALL_CLR_ADDITIONAL_DESTINATION}" STREQUAL "") - list(APPEND destinations ${INSTALL_CLR_ADDITIONAL_DESTINATION}) + if (NOT "${INSTALL_CLR_ADDITIONAL_DESTINATIONS}" STREQUAL "") + list(APPEND destinations ${INSTALL_CLR_ADDITIONAL_DESTINATIONS}) endif() foreach(targetName ${INSTALL_CLR_TARGETS}) list(FIND CLR_CROSS_COMPONENTS_LIST ${targetName} INDEX) if (NOT DEFINED CLR_CROSS_COMPONENTS_LIST OR NOT ${INDEX} EQUAL -1) - strip_symbols(${targetName} symbol_file) + if (NOT CLR_CMAKE_KEEP_NATIVE_SYMBOLS) + strip_symbols(${targetName} symbol_file) + endif() foreach(destination ${destinations}) # We don't need to install the export libraries for our DLLs # since they won't be directly linked against. install(PROGRAMS $ DESTINATION ${destination}) - install_symbols(${symbol_file} ${destination}) + if (NOT CLR_CMAKE_KEEP_NATIVE_SYMBOLS) + install_symbols(${symbol_file} ${destination}) + endif() if(CLR_CMAKE_PGO_INSTRUMENT) - if(WIN32) + if(WIN32) + get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(is_multi_config) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$/${targetName}.pgd DESTINATION ${destination}/PGD OPTIONAL) + else() + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${targetName}.pgd DESTINATION ${destination}/PGD OPTIONAL) endif() + endif() endif() endforeach() endif() @@ -416,6 +401,21 @@ function(disable_pax_mprotect targetName) endif() endfunction() +if (CMAKE_VERSION VERSION_LESS "3.12") + # Polyfill add_compile_definitions when it is unavailable + function(add_compile_definitions) + get_directory_property(DIR_COMPILE_DEFINITIONS COMPILE_DEFINITIONS) + list(APPEND DIR_COMPILE_DEFINITIONS ${ARGV}) + set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "${DIR_COMPILE_DEFINITIONS}") + endfunction() +endif() + +if (CMAKE_VERSION VERSION_LESS "3.16") + # Provide a no-op polyfill for precompiled headers on old CMake versions + function(target_precompile_headers) + endfunction() +endif() + function(_add_executable) if(NOT WIN32) add_executable(${ARGV} ${VERSION_FILE_PATH}) @@ -430,11 +430,11 @@ function(_add_executable) endfunction() function(_add_library) - if(NOT WIN32) + if(NOT WIN32 AND "${ARGV1}" STREQUAL "SHARED") add_library(${ARGV} ${VERSION_FILE_PATH}) else() add_library(${ARGV}) - endif(NOT WIN32) + endif(NOT WIN32 AND "${ARGV1}" STREQUAL "SHARED") list(FIND CLR_CROSS_COMPONENTS_LIST ${ARGV0} INDEX) if (DEFINED CLR_CROSS_COMPONENTS_LIST AND ${INDEX} EQUAL -1) set_target_properties(${ARGV0} PROPERTIES EXCLUDE_FROM_ALL 1) @@ -479,3 +479,16 @@ function(generate_module_index Target ModuleIndexFile) DEPENDS ${ModuleIndexFile} ) endfunction(generate_module_index) + +# add_linker_flag(Flag [Config1 Config2 ...]) +function(add_linker_flag Flag) + if (ARGN STREQUAL "") + set("CMAKE_EXE_LINKER_FLAGS" "${CMAKE_EXE_LINKER_FLAGS} ${Flag}" PARENT_SCOPE) + set("CMAKE_SHARED_LINKER_FLAGS" "${CMAKE_SHARED_LINKER_FLAGS} ${Flag}" PARENT_SCOPE) + else() + foreach(Config ${ARGN}) + set("CMAKE_EXE_LINKER_FLAGS_${Config}" "${CMAKE_EXE_LINKER_FLAGS_${Config}} ${Flag}" PARENT_SCOPE) + set("CMAKE_SHARED_LINKER_FLAGS_${Config}" "${CMAKE_SHARED_LINKER_FLAGS_${Config}} ${Flag}" PARENT_SCOPE) + endforeach() + endif() +endfunction() diff --git a/eng/native/gen-buildsys.cmd b/eng/native/gen-buildsys.cmd new file mode 100644 index 000000000000..c340ec2f9fad --- /dev/null +++ b/eng/native/gen-buildsys.cmd @@ -0,0 +1,79 @@ +@if not defined _echo @echo off +rem +rem This file invokes cmake and generates the build system for windows. + +setlocal + +set argC=0 +for %%x in (%*) do Set /A argC+=1 + +if %argC% lss 4 GOTO :USAGE +if %1=="/?" GOTO :USAGE + +setlocal +set basePath=%~dp0 +:: remove quotes +set "basePath=%basePath:"=%" +:: remove trailing slash +if %basePath:~-1%==\ set "basePath=%basePath:~0,-1%" + +set __SourceDir=%1 +set __IntermediatesDir=%2 +set __VSVersion=%3 +set __Arch=%4 +set __CmakeGenerator=Visual Studio +set __UseEmcmake=0 +if /i "%__Ninja%" == "1" ( + set __CmakeGenerator=Ninja +) else ( + if /i NOT "%__Arch%" == "wasm" ( + if /i "%__VSVersion%" == "vs2019" (set __CmakeGenerator=%__CmakeGenerator% 16 2019) + if /i "%__VSVersion%" == "vs2017" (set __CmakeGenerator=%__CmakeGenerator% 15 2017) + + if /i "%__Arch%" == "x64" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A x64) + if /i "%__Arch%" == "arm" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A ARM) + if /i "%__Arch%" == "arm64" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A ARM64) + if /i "%__Arch%" == "x86" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A Win32) + ) else ( + set __CmakeGenerator=NMake Makefiles + ) +) + +if /i "%__Arch%" == "wasm" ( + if "%EMSDK_PATH%" == "" ( + echo Error: Should set EMSDK_PATH environment variable pointing to emsdk root. + exit /B 1 + ) + + if "%EMSCRIPTEN_ROOT%" == "" ( + set EMSCRIPTEN_ROOT="%EMSDK_PATH/upstream/emscripten%" + ) + set __ExtraCmakeParams=%__ExtraCmakeParams% "-DEMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES=1" "-DCMAKE_TOOLCHAIN_FILE=%EMSCRIPTEN%/cmake/Modules/Platform/Emscripten.cmake" + set __UseEmcmake=1 +) else ( + set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_SYSTEM_VERSION=10.0" +) + +:loop +if [%5] == [] goto end_loop +set __ExtraCmakeParams=%__ExtraCmakeParams% %5 +shift +goto loop +:end_loop + +set __ExtraCmakeParams="-DCMAKE_INSTALL_PREFIX=%__CMakeBinDir%" "-DCLR_CMAKE_HOST_ARCH=%__Arch%" %__ExtraCmakeParams% + +if /i "%__UseEmcmake%" == "1" ( + emcmake "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir% +) else ( + "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir% +) +endlocal +exit /B %errorlevel% + +:USAGE + echo "Usage..." + echo "gen-buildsys.cmd " + echo "Specify the path to the top level CMake file - /src/NDP" + echo "Specify the VSVersion to be used - VS2017 or VS2019" + EXIT /B 1 diff --git a/eng/native/gen-buildsys.sh b/eng/native/gen-buildsys.sh index f27bb33e3577..6ecc2d8954cd 100755 --- a/eng/native/gen-buildsys.sh +++ b/eng/native/gen-buildsys.sh @@ -63,7 +63,9 @@ done cmake_extra_defines= if [[ "$CROSSCOMPILE" == "1" ]]; then - if ! [[ -n "$ROOTFS_DIR" ]]; then + platform="$(uname)" + # OSX doesn't use rootfs + if ! [[ -n "$ROOTFS_DIR" || "$platform" == "Darwin" ]]; then echo "ROOTFS_DIR not set for crosscompile" exit 1 fi @@ -74,7 +76,12 @@ if [[ "$CROSSCOMPILE" == "1" ]]; then if [[ -n "$tryrun_dir" ]]; then cmake_extra_defines="$cmake_extra_defines -C $tryrun_dir/tryrun.cmake" fi - cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$scriptroot/../common/cross/toolchain.cmake" + + if [[ "$platform" == "Darwin" ]]; then + cmake_extra_defines="$cmake_extra_defines -DCMAKE_SYSTEM_NAME=Darwin" + else + cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$scriptroot/../common/cross/toolchain.cmake" + fi fi if [[ "$build_arch" == "armel" ]]; then @@ -91,12 +98,17 @@ if [[ "$build_arch" == "wasm" ]]; then cmake_command="emcmake $cmake_command" fi +# We have to be able to build with CMake 3.6.2, so we can't use the -S or -B options +pushd "$3" + # Include CMAKE_USER_MAKE_RULES_OVERRIDE as uninitialized since it will hold its value in the CMake cache otherwise can cause issues when branch switching $cmake_command \ + --no-warn-unused-cli \ -G "$generator" \ "-DCMAKE_BUILD_TYPE=$buildtype" \ "-DCMAKE_INSTALL_PREFIX=$__CMakeBinDir" \ $cmake_extra_defines \ $__UnprocessedCMakeArgs \ - -S "$1" \ - -B "$3" + "$1" + +popd diff --git a/eng/native/init-compiler.sh b/eng/native/init-compiler.sh index ff0f69c6a004..3821d76bd025 100755 --- a/eng/native/init-compiler.sh +++ b/eng/native/init-compiler.sh @@ -45,8 +45,8 @@ if [[ -z "$CLR_CC" ]]; then # Set default versions if [[ -z "$majorVersion" ]]; then # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. - if [[ "$compiler" == "clang" ]]; then versions=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) - elif [[ "$compiler" == "gcc" ]]; then versions=( 9 8 7 6 5 4.9 ); fi + if [[ "$compiler" == "clang" ]]; then versions=( 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) + elif [[ "$compiler" == "gcc" ]]; then versions=( 10 9 8 7 6 5 4.9 ); fi for version in "${versions[@]}"; do parts=(${version//./ }) diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh index b6921a903469..f5d14f2f7cd5 100644 --- a/eng/native/init-distro-rid.sh +++ b/eng/native/init-distro-rid.sh @@ -146,13 +146,6 @@ initDistroRidGlobal() fi fi - if [ "$buildArch" = "armel" ]; then - # Armel cross build is Tizen specific and does not support Portable RID build - __PortableBuild=0 - export __PortableBuild - isPortable=0 - fi - initNonPortableDistroRid "${targetOs}" "${buildArch}" "${isPortable}" "${rootfsDir}" if [ "$buildArch" = "wasm" ]; then diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh index 0a6018386575..7bda16f77a27 100644 --- a/eng/native/init-os-and-arch.sh +++ b/eng/native/init-os-and-arch.sh @@ -27,6 +27,17 @@ if [ "$os" = "SunOS" ]; then os="Solaris" fi CPUName=$(isainfo -n) +elif [ "$os" = "OSX" ]; then + # On OSX universal binaries make uname -m unreliable. The uname -m response changes + # based on what hardware is being emulated. + # Use sysctl instead + if [ "$(sysctl -q -n hw.optional.arm64)" = "1" ]; then + CPUName=arm64 + elif [ "$(sysctl -q -n hw.optional.x86_64)" = "1" ]; then + CPUName=x86_64 + else + CPUName=$(uname -m) + fi else # For rest of the operating systems, use uname(1) to determine what the CPU is. CPUName=$(uname -m) diff --git a/src/coreclr/src/pal/tools/set-cmake-path.ps1 b/eng/native/set-cmake-path.ps1 similarity index 81% rename from src/coreclr/src/pal/tools/set-cmake-path.ps1 rename to eng/native/set-cmake-path.ps1 index 689c8c5596a5..a08d501f40bb 100644 --- a/src/coreclr/src/pal/tools/set-cmake-path.ps1 +++ b/eng/native/set-cmake-path.ps1 @@ -64,7 +64,10 @@ try { $version = [Version]$(& $cmakePath --version | Select-String -Pattern '\d+\.\d+\.\d+' | %{$_.Matches.Value}) if ($version -lt [Version]"3.14.0") { - Throw "This repository requires CMake 3.14. The newest version of CMake installed is $version. Please install CMake 3.14 or newer from https://cmake.org/download/ and ensure it is on your path." + Throw "This repository requires CMake 3.14 and recommends CMake 3.16. The newest version of CMake installed is $version. Please install CMake 3.16 or newer from https://cmake.org/download/ and ensure it is on your path." + } + elseif ($version -lt [Version]"3.16.0") { + [System.Console]::Error.WriteLine("CMake 3.16 or newer is recommended for building this repository. The newest version of CMake installed is $version. Please install CMake 3.16 or newer from https://cmake.org/download/ and ensure it is on your path.") } [System.Console]::WriteLine("set CMakePath=" + $cmakePath) diff --git a/eng/notSupported.SourceBuild.targets b/eng/notSupported.SourceBuild.targets deleted file mode 100644 index 743c4a3ace00..000000000000 --- a/eng/notSupported.SourceBuild.targets +++ /dev/null @@ -1,29 +0,0 @@ - - - - - $(IntermediateOutputPath) - - - - - - <_notSupportedSourceDirectory>$([MSBuild]::NormalizeDirectory('$(DotNetSourceBuildIntermediatePath)', '$(MSBuildProjectName)', '$(TargetFramework)-$(TargetOS)')) - $(_notSupportedSourceDirectory)$(TargetName).notsupported.cs - - - - - - - - - - - - \ No newline at end of file diff --git a/eng/packaging.props b/eng/packaging.props index 9db71c397b49..06c250ee1b99 100644 --- a/eng/packaging.props +++ b/eng/packaging.props @@ -20,7 +20,7 @@ true - 5.0.0 + 6.0.0 $(ProductVersion) @@ -72,5 +72,8 @@ Include="$(PkgDir)useSharedDesignerContext.txt"> true + + + diff --git a/eng/packaging.targets b/eng/packaging.targets index e0f7edaeac7f..47484ae1f4e8 100644 --- a/eng/packaging.targets +++ b/eng/packaging.targets @@ -2,9 +2,9 @@ + - https://github.com/dotnet/runtime/issues/27470 -> Why reference assets were removed from the package + - https://github.com/dotnet/aspnetcore/issues/11206 -> Why ASP.NET required a ref to be added back for netcoreapp + - https://github.com/dotnet/runtime/issues/29966 -> Issue tracking to work of readding a ref to netcoreapp --> @@ -26,4 +26,16 @@ '$(_excludeCompile)' == 'true' and '%(Dependency.Identity)' != '_._'" /> - \ No newline at end of file + + + $(MSBuildProjectDirectory)\..\pkg\$(MSBuildProjectName).pkgproj + + _BuildPkgProj + + + + + + diff --git a/eng/pipelines/common/build-coreclr-and-libraries-job.yml b/eng/pipelines/common/build-coreclr-and-libraries-job.yml index 439d97038f84..59457be7ab56 100644 --- a/eng/pipelines/common/build-coreclr-and-libraries-job.yml +++ b/eng/pipelines/common/build-coreclr-and-libraries-job.yml @@ -3,8 +3,10 @@ parameters: archType: '' osGroup: '' osSubgroup: '' + targetRid: '' container: '' testGroup: '' + crossBuild: false crossrootfsDir: '' timeoutInMinutes: '' signBinaries: false @@ -21,8 +23,10 @@ jobs: archType: ${{ parameters.archType }} osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} + targetRid: ${{ parameters.targetRid }} container: ${{ parameters.container }} testGroup: ${{ parameters.testGroup }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossrootfsDir }} timeoutInminutes: ${{ parameters.timeoutInMinutes }} signBinaries: ${{ parameters.signBinaries }} @@ -41,6 +45,7 @@ jobs: osSubgroup: ${{ parameters.osSubgroup }} container: ${{ parameters.container }} testGroup: ${{ parameters.testGroup }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossrootfsDir }} timeoutInminutes: ${{ parameters.timeoutInMinutes }} variables: ${{ parameters.variables }} diff --git a/eng/pipelines/common/createdump-entitlements.plist b/eng/pipelines/common/createdump-entitlements.plist new file mode 100644 index 000000000000..1f2d3798ee2f --- /dev/null +++ b/eng/pipelines/common/createdump-entitlements.plist @@ -0,0 +1,12 @@ + + + + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.disable-library-validation + + com.apple.security.cs.debugger + + + diff --git a/eng/pipelines/common/entitlements.plist b/eng/pipelines/common/entitlements.plist new file mode 100644 index 000000000000..f4ea418fb45a --- /dev/null +++ b/eng/pipelines/common/entitlements.plist @@ -0,0 +1,18 @@ + + + + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.disable-library-validation + + com.apple.security.cs.debugger + + com.apple.security.get-task-allow + + + diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index dcbba9fb3654..6d6ca9397ab4 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -6,10 +6,13 @@ parameters: osGroup: '' osSubgroup: '' container: '' + crossBuild: false crossrootfsDir: '' variables: [] + targetRid: '' timeoutInMinutes: '' pool: '' + platform: '' condition: true isOfficialBuild: false runtimeFlavor: 'coreclr' @@ -25,8 +28,8 @@ jobs: dependsOn: checkout pool: ${{ parameters.pool }} container: ${{ parameters.container }} - timeoutInMinutes: ${{ parameters.timeoutInMinutes }} condition: and(succeeded(), ${{ parameters.condition }}) + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} workspace: clean: all @@ -40,7 +43,7 @@ jobs: # Do not rename as it clashes with MSBuild property in libraries/build-native.proj - name: _crossBuildPropertyArg - value: /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }} + value: /p:CrossBuild=${{ parameters.crossBuild }} - name: _cxx11Parameter ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.archType, 'arm64')) }}: @@ -54,6 +57,10 @@ jobs: ${{ if ne(parameters.isOfficialBuild, true) }}: value: '' + - ${{ if eq(parameters.osGroup, 'Android') }}: + - name: ANDROID_OPENSSL_AAR + value: /tmp/openssl-android + - ${{ each variable in parameters.variables }}: - ${{ variable }} @@ -63,8 +70,8 @@ jobs: - ${{ if eq(parameters.isOfficialBuild, true) }}: - template: /eng/pipelines/common/restore-internal-tools.yml - - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} + - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'Android') }}: + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO displayName: Install Build Dependencies - script: | @@ -76,7 +83,7 @@ jobs: - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) displayName: Build product - - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: + - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'Android') }}: - script: | du -sh $(Build.SourcesDirectory)/* df -h @@ -92,6 +99,9 @@ jobs: buildConfig: ${{ parameters.buildConfig }} runtimeFlavor: ${{ parameters.runtimeFlavor }} helixQueues: ${{ parameters.helixQueues }} + targetRid: ${{ parameters.targetRid }} + nameSuffix: ${{ parameters.nameSuffix }} + platform: ${{ parameters.platform }} ${{ insert }}: ${{ parameters.extraStepsParameters }} - task: PublishBuildArtifacts@1 diff --git a/eng/pipelines/common/macos-sign-with-entitlements.yml b/eng/pipelines/common/macos-sign-with-entitlements.yml new file mode 100644 index 000000000000..6c65193845d7 --- /dev/null +++ b/eng/pipelines/common/macos-sign-with-entitlements.yml @@ -0,0 +1,65 @@ +parameters: + filesToSign: [] + +steps: + - task: UseDotNet@2 + displayName: 'Use .NET Core SDK 2.1.808' + inputs: + packageType: sdk + version: 2.1.808 + + - ${{ each file in parameters.filesToSign }}: + - script: codesign -s - -f --entitlements ${{ file.entitlementsFile }} ${{ file.path }}/${{ file.name }} + displayName: 'Add entitlements to ${{ file.name }}' + + - task: CopyFiles@2 + displayName: 'Copy entitled file ${{ file.name }}' + inputs: + contents: '${{ file.path }}/${{ file.name }}' + targetFolder: '$(Build.ArtifactStagingDirectory)/mac_entitled' + overWrite: true + + - task: ArchiveFiles@2 + displayName: 'Zip MacOS files for signing' + inputs: + rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/mac_entitled' + archiveFile: '$(Build.ArtifactStagingDirectory)/mac_entitled_to_sign.zip' + archiveType: zip + includeRootFolder: true + replaceExistingArchive: true + + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + displayName: 'ESRP CodeSigning' + inputs: + ConnectedServiceName: 'ESRP CodeSigning' + FolderPath: '$(Build.ArtifactStagingDirectory)/' + Pattern: 'mac_entitled_to_sign.zip' + UseMinimatch: true + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "keyCode": "CP-401337-Apple", + "operationCode": "MacAppDeveloperSign", + "parameters" : { + "hardening": "Enable" + }, + "toolName": "sign", + "toolVersion": "1.0" + } + ] + + - task: ExtractFiles@1 + displayName: 'Extract MacOS after signing' + inputs: + archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/mac_entitled_to_sign.zip' + destinationFolder: '$(Build.ArtifactStagingDirectory)/mac_entitled_signed' + + - ${{ each file in parameters.filesToSign }}: + - task: CopyFiles@2 + displayName: 'Copy ${{ file.name }} to destination' + inputs: + contents: ${{ file.name }} + sourceFolder: '$(Build.ArtifactStagingDirectory)/mac_entitled_signed' + targetFolder: '${{ file.path }}' + overWrite: true diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index b4f802024006..dc77a165d8d6 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -35,6 +35,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Linux archType: arm + targetRid: linux-arm platform: Linux_arm container: image: ubuntu-16.04-cross-20200413125008-09ec757 @@ -46,6 +47,7 @@ jobs: ${{ if eq(parameters.passPlatforms, true) }}: platforms: ${{ parameters.platforms }} helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true crossrootfsDir: '/crossrootfs/arm' ${{ insert }}: ${{ parameters.jobParameters }} @@ -59,9 +61,10 @@ jobs: variables: ${{ parameters.variables }} osGroup: Linux archType: arm64 + targetRid: linux-arm64 platform: Linux_arm64 container: - image: ubuntu-16.04-cross-arm64-20200413125008-cfdd435 + image: ubuntu-16.04-cross-arm64-20201022204150-b2c2436 registry: mcr jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -70,6 +73,7 @@ jobs: ${{ if eq(parameters.passPlatforms, true) }}: platforms: ${{ parameters.platforms }} helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true crossrootfsDir: '/crossrootfs/arm64' ${{ insert }}: ${{ parameters.jobParameters }} @@ -84,13 +88,10 @@ jobs: osGroup: Linux osSubgroup: _musl archType: x64 + targetRid: linux-musl-x64 platform: Linux_musl_x64 container: - # alpine coreclr cmake errors on newer builds - ${{ if eq(parameters.runtimeFlavor, 'mono') }}: - image: alpine-3.9-WithNode-0fc54a3-20200131134036 - ${{ if eq(parameters.runtimeFlavor, 'coreclr') }}: - image: alpine-3.9-WithNode-0fc54a3-20190918214015 + image: alpine-3.9-WithNode-20200602002639-0fc54a3 registry: mcr jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -101,6 +102,33 @@ jobs: helixQueueGroup: ${{ parameters.helixQueueGroup }} ${{ insert }}: ${{ parameters.jobParameters }} +# Linux musl arm + +- ${{ if or(containsValue(parameters.platforms, 'Linux_musl_arm'), eq(parameters.platformGroup, 'all')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: Linux + osSubgroup: _musl + archType: arm + targetRid: linux-musl-arm + platform: Linux_musl_arm + container: + image: ubuntu-18.04-cross-arm-alpine-20200818211451-14441ae + registry: mcr + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + stagedBuild: ${{ parameters.stagedBuild }} + buildConfig: ${{ parameters.buildConfig }} + ${{ if eq(parameters.passPlatforms, true) }}: + platforms: ${{ parameters.platforms }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + crossrootfsDir: '/crossrootfs/arm' + ${{ insert }}: ${{ parameters.jobParameters }} + # Linux musl arm64 - ${{ if or(containsValue(parameters.platforms, 'Linux_musl_arm64'), eq(parameters.platformGroup, 'all')) }}: @@ -112,6 +140,7 @@ jobs: osGroup: Linux osSubgroup: _musl archType: arm64 + targetRid: linux-musl-arm64 platform: Linux_musl_arm64 container: image: ubuntu-16.04-cross-arm64-alpine-20200413125008-406629a @@ -123,12 +152,13 @@ jobs: ${{ if eq(parameters.passPlatforms, true) }}: platforms: ${{ parameters.platforms }} helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true crossrootfsDir: '/crossrootfs/arm64' ${{ insert }}: ${{ parameters.jobParameters }} # Linux x64 -- ${{ if or(containsValue(parameters.platforms, 'Linux_x64'), in(parameters.platformGroup, 'all', 'gcstress')) }}: +- ${{ if or(containsValue(parameters.platforms, 'Linux_x64'), containsValue(parameters.platforms, 'CoreClrTestBuildHost'), in(parameters.platformGroup, 'all', 'gcstress')) }}: - template: xplat-setup.yml parameters: jobTemplate: ${{ parameters.jobTemplate }} @@ -136,6 +166,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Linux archType: x64 + targetRid: linux-x64 platform: Linux_x64 container: image: centos-7-359e48e-20200313130914 @@ -159,9 +190,10 @@ jobs: variables: ${{ parameters.variables }} osGroup: Browser archType: wasm + targetRid: browser-wasm platform: Browser_wasm container: - image: ubuntu-18.04-webassembly-20200529220811-6a6da63 + image: ubuntu-18.04-webassembly-20201024150726-a0359ae registry: mcr jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -180,6 +212,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: FreeBSD archType: x64 + targetRid: freebsd-x64 platform: FreeBSD_x64 container: image: ubuntu-18.04-cross-freebsd-11-20200407092345-a84b0d2 @@ -188,6 +221,7 @@ jobs: runtimeFlavor: ${{ parameters.runtimeFlavor }} buildConfig: ${{ parameters.buildConfig }} helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true crossrootfsDir: '/crossrootfs/x64' ${{ if eq(parameters.passPlatforms, true) }}: platforms: ${{ parameters.platforms }} @@ -203,6 +237,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Android archType: x64 + targetRid: android-x64 platform: Android_x64 container: image: ubuntu-18.04-android-20200422191843-e2c3f83 @@ -226,6 +261,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Android archType: x86 + targetRid: android-x86 platform: Android_x86 container: image: ubuntu-18.04-android-20200422191843-e2c3f83 @@ -249,6 +285,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Android archType: arm + targetRid: android-arm platform: Android_arm container: image: ubuntu-18.04-android-20200422191843-e2c3f83 @@ -272,6 +309,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Android archType: arm64 + targetRid: android-arm64 platform: Android_arm64 container: image: ubuntu-18.04-android-20200422191843-e2c3f83 @@ -295,6 +333,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: tvOS archType: x64 + targetRid: tvos-x64 platform: tvOS_x64 jobParameters: runtimeFlavor: mono @@ -315,6 +354,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: tvOS archType: arm64 + targetRid: tvos-arm64 platform: tvOS_arm64 jobParameters: runtimeFlavor: mono @@ -335,6 +375,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: iOS archType: x64 + targetRid: ios-x64 platform: iOS_x64 jobParameters: runtimeFlavor: mono @@ -355,6 +396,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: iOS archType: x86 + targetRid: ios-x86 platform: iOS_x86 jobParameters: runtimeFlavor: mono @@ -376,6 +418,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: iOS archType: arm + targetRid: ios-arm platform: iOS_arm jobParameters: runtimeFlavor: mono @@ -396,6 +439,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: iOS archType: arm64 + targetRid: ios-arm64 platform: iOS_arm64 jobParameters: runtimeFlavor: mono @@ -406,9 +450,31 @@ jobs: helixQueueGroup: ${{ parameters.helixQueueGroup }} ${{ insert }}: ${{ parameters.jobParameters }} +# macOS arm64 + +- ${{ if or(containsValue(parameters.platforms, 'OSX_arm64'), eq(parameters.platformGroup, 'all')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: OSX + archType: arm64 + targetRid: osx-arm64 + platform: OSX_arm64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + stagedBuild: ${{ parameters.stagedBuild }} + buildConfig: ${{ parameters.buildConfig }} + ${{ if eq(parameters.passPlatforms, true) }}: + platforms: ${{ parameters.platforms }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + # macOS x64 -- ${{ if or(containsValue(parameters.platforms, 'OSX_x64'), containsValue(parameters.platforms, 'CoreClrTestBuildHost'), eq(parameters.platformGroup, 'all')) }}: +- ${{ if or(containsValue(parameters.platforms, 'OSX_x64'), eq(parameters.platformGroup, 'all')) }}: - template: xplat-setup.yml parameters: jobTemplate: ${{ parameters.jobTemplate }} @@ -416,6 +482,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: OSX archType: x64 + targetRid: osx-x64 platform: OSX_x64 jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -436,6 +503,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Windows_NT archType: x64 + targetRid: win-x64 platform: Windows_NT_x64 jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -456,6 +524,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Windows_NT archType: x86 + targetRid: win-x86 platform: Windows_NT_x86 jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -475,6 +544,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Windows_NT archType: arm + targetRid: win-arm platform: Windows_NT_arm jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} @@ -495,6 +565,7 @@ jobs: variables: ${{ parameters.variables }} osGroup: Windows_NT archType: arm64 + targetRid: win-arm64 platform: Windows_NT_arm64 jobParameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} diff --git a/eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml b/eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml new file mode 100644 index 000000000000..606a4418b27a --- /dev/null +++ b/eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml @@ -0,0 +1,68 @@ +parameters: + buildConfig: '' + archType: 'x64' + osGroup: 'Android' + osSubgroup: '' + container: '' + testGroup: '' + crossrootfsDir: '' + liveLibrariesBuildConfig: '' + helixQueues: '' + stagedBuild: false + displayNameArgs: '' + runtimeVariant: '' + variables: {} + pool: '' + runtimeFlavorDisplayName: 'Mono' + dependsOn: [] + #arcade-specific parameters + condition: always() + continueOnError: false + displayName: '' + timeoutInMinutes: '' + enableMicrobuild: '' + gatherAssetManifests: false + + +steps: + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) /p:LibrariesConfiguration=${{ parameters.buildConfig }} -ci -skipstressdependencies -excludemonofailures os Android x64 $(buildConfigUpper) + displayName: Build Tests + + # Send tests to Helix + - template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml + parameters: + displayName: Send tests to Helix + buildConfig: $(buildConfigUpper) + archType: ${{ parameters.archType }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup}} + coreClrRepoRoot: $(Build.SourcesDirectory)/src/coreclr + runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }} + + ${{ if eq(variables['System.TeamProject'], 'public') }}: + creator: $(Build.DefinitionName) + + helixBuild: $(Build.BuildNumber) + helixSource: $(_HelixSource) + + helixType: 'test/functional/cli/' + + helixQueues: ${{ parameters.helixQueues }} + + # This tests whether an array is empty + ${{ if eq(join('', parameters.helixQueues), '') }}: + condition: false + + publishTestResults: true + + timeoutPerTestInMinutes: $(timeoutPerTestInMinutes) + timeoutPerTestCollectionInMinutes: $(timeoutPerTestCollectionInMinutes) + + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + # Access token variable for internal project from the + # DotNet-HelixApi-Access variable group + helixAccessToken: $(HelixApiAccessToken) + + helixProjectArguments: '$(Build.SourcesDirectory)/src/tests/Common/helixpublishwitharcade.proj' + + scenarios: normal \ No newline at end of file diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 56fa8dffddc1..a658bba42fa9 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -87,7 +87,7 @@ jobs: # Install test build dependencies - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install correct cmake version @@ -120,7 +120,7 @@ jobs: displayName: Disk Usage before Build # Build managed test components - - script: $(coreClrRepoRootDir)build-test$(scriptExt) allTargets skipstressdependencies skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) allTargets skipstressdependencies skipnative skipgeneratelayout skiptestwrappers $(buildConfig) $(archType) $(crossArg) $(priorityArg) ci $(librariesOverrideArg) displayName: Build managed test components - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index 4d93701584fe..e469612cbd34 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -5,6 +5,7 @@ parameters: osSubgroup: '' container: '' testGroup: '' + crossBuild: false crossrootfsDir: '' readyToRun: false liveLibrariesBuildConfig: '' @@ -36,6 +37,7 @@ jobs: osSubgroup: ${{ parameters.osSubgroup }} container: ${{ parameters.container }} testGroup: ${{ parameters.testGroup }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossrootfsDir }} stagedBuild: ${{ parameters.stagedBuild }} liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} @@ -97,6 +99,8 @@ jobs: - ${{ if eq(parameters.compositeBuildMode, true) }}: - name: crossgenArg value: 'composite' + - name: LogNamePrefix + value: TestRunLogs_R2R_CG2_Composite # Set job timeouts # @@ -219,7 +223,6 @@ jobs: artifactName: '$(coreClrProductArtifactName)' displayName: 'CoreCLR product download for Mono' - # Download and unzip the Microsoft.NET.Sdk.IL package needed for traversing # ilproj test projects during copynativeonly. - template: /eng/pipelines/common/download-artifact-step.yml @@ -244,25 +247,35 @@ jobs: # and directly unzip them there after download). Unfortunately the logic to copy # the native artifacts to the final test folders is dependent on availability of the # managed test artifacts. - - script: $(coreClrRepoRootDir)build-test$(scriptExt) skipstressdependencies copynativeonly $(crossgenArg) $(buildConfig) $(archType) $(priorityArg) $(librariesOverrideArg) + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) skipstressdependencies copynativeonly $(crossgenArg) $(buildConfig) $(archType) $(priorityArg) $(librariesOverrideArg) displayName: Copy native test components to test output folder # Generate test wrappers. This is the step that examines issues.targets to exclude tests. - - script: $(coreClrRepoRootDir)build-test$(scriptExt) buildtestwrappersonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) buildtestwrappersonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) displayName: Generate test wrappers # Compose the Core_Root folder containing all artifacts needed for running - # CoreCLR tests. - - script: $(coreClrRepoRootDir)build-test$(scriptExt) generatelayoutonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) + # CoreCLR tests. This step also compiles the framework using Crossgen / Crossgen2 + # in ReadyToRun jobs. + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) generatelayoutonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) displayName: Generate CORE_ROOT + # Build a Mono LLVM AOT cross-compiler for non-amd64 targets (in this case, just arm64) + - ${{ if and(eq(parameters.runtimeFlavor, 'mono'), eq(parameters.runtimeVariant, 'llvmaot')) }}: + - ${{ if eq(parameters.archType, 'arm64') }}: + - script: ./build.sh + -subset mono + -c $(buildConfigUpper) + -arch $(archType) + /p:BuildMonoAotCrossCompiler=true + /p:BuildMonoAotCrossCompilerOnly=true + /p:MonoLibClang="/usr/lib/llvm-9/lib/libclang-9.so.1" + /p:MonoAOTEnableLLVM=true + /p:MonoAOTLLVMUseCxx11Abi=true + displayName: "Build Mono LLVM AOT cross compiler" - # Crossgen framework assemblies prior to triggering readyToRun execution runs. - - ${{ if eq(parameters.readyToRun, true) }}: - - script: $(coreClrRepoRootDir)build-test$(scriptExt) crossgenframeworkonly $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) - displayName: Crossgen framework assemblies # Overwrite coreclr runtime binaries with mono ones - ${{ if eq(parameters.runtimeFlavor, 'mono') }}: @@ -274,8 +287,14 @@ jobs: displayName: "Patch dotnet with mono" - ${{ if and(eq(parameters.runtimeFlavor, 'mono'), eq(parameters.runtimeVariant, 'llvmaot')) }}: - - script: $(coreClrRepoRootDir)build-test$(scriptExt) mono_aot $(buildConfig) - displayName: "LLVM AOT compile CoreCLR tests" + - ${{ if eq(parameters.archType, 'x64') }}: + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) mono_aot $(buildConfig) $(archType) + displayName: "LLVM AOT compile CoreCLR tests" + - ${{ if eq(parameters.archType, 'arm64') }}: + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) mono_aot $(buildConfig) $(archType) cross + displayName: "LLVM AOT cross-compile CoreCLR tests" + env: + __MonoToolPrefix: aarch64-linux-gnu- # Send tests to Helix - template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml @@ -285,7 +304,6 @@ jobs: archType: ${{ parameters.archType }} osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup}} - coreClrRepoRoot: $(coreClrRepoRoot) runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }} ${{ if eq(variables['System.TeamProject'], 'public') }}: @@ -314,6 +332,9 @@ jobs: runCrossGen: ${{ and(eq(parameters.readyToRun, true), ne(parameters.crossgen2, true)) }} runCrossGen2: ${{ and(eq(parameters.readyToRun, true), eq(parameters.crossgen2, true)) }} + ${{ if and(ne(parameters.testGroup, 'innerloop'), eq(parameters.runtimeFlavor, 'coreclr')) }}: + runPALTestsDir: '$(coreClrProductRootFolderPath)/paltests' + compositeBuildMode: ${{ parameters.compositeBuildMode }} runInUnloadableContext: ${{ parameters.runInUnloadableContext }} @@ -322,7 +343,7 @@ jobs: # DotNet-HelixApi-Access variable group helixAccessToken: $(HelixApiAccessToken) - helixProjectArguments: '$(coreClrRepoRoot)/tests/helixpublishwitharcade.proj' + helixProjectArguments: '$(Build.SourcesDirectory)/src/tests/Common/helixpublishwitharcade.proj' ${{ if in(parameters.testGroup, 'innerloop', 'outerloop') }}: scenarios: @@ -411,6 +432,7 @@ jobs: - gcstress0xc_zapdisable_heapverify1 - gcstress0xc_jitstress1 - gcstress0xc_jitstress2 + - gcstress0xc_tailcallstress - gcstress0xc_jitminopts_heapverify1 ${{ if in(parameters.testGroup, 'r2r-extra') }}: scenarios: diff --git a/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml b/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml new file mode 100644 index 000000000000..647778511370 --- /dev/null +++ b/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml @@ -0,0 +1,34 @@ +parameters: + osGroup: '' + restoreParams: '' + sendParams: '' + condition: '' + displayName: '' + environment: {} + +steps: +- ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + # TODO: Remove and consolidate this when we move to arcade via init-tools.cmd. + - powershell: $(Build.SourcesDirectory)\eng\common\build.ps1 -ci ${{ parameters.restoreParams }} + displayName: Restore blob feed tasks (Windows) + condition: ${{ and(ne(parameters.condition, false), ne(parameters.restoreParams, '')) }} + + - powershell: $(Build.SourcesDirectory)\eng\common\msbuild.ps1 -ci ${{ parameters.sendParams }} + displayName: ${{ parameters.displayName }} (Windows) + condition: ${{ and(ne(parameters.condition, false), ne(parameters.sendParams, '')) }} + env: ${{ parameters.environment }} + +- ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + # TODO: Remove and consolidate this when we move to arcade via init-tools.sh. + - script: $(Build.SourcesDirectory)/eng/common/build.sh --ci ${{ parameters.restoreParams }} + displayName: Restore blob feed tasks (Unix) + condition: ${{ and(ne(parameters.condition, false), ne(parameters.restoreParams, '')) }} + ${{ if eq(parameters.osGroup, 'FreeBSD') }}: + env: + # Arcade uses this SDK instead of trying to restore one. + DotNetCoreSdkDir: /usr/local/dotnet + + - script: $(Build.SourcesDirectory)/eng/common/msbuild.sh --ci ${{ parameters.sendParams }} + displayName: ${{ parameters.displayName }} (Unix) + condition: ${{ and(ne(parameters.condition, false), ne(parameters.sendParams, '')) }} + env: ${{ parameters.environment }} diff --git a/eng/pipelines/common/templates/runtimes/send-to-helix-step.yml b/eng/pipelines/common/templates/runtimes/send-to-helix-step.yml index 3602929653dc..febcfa4016db 100644 --- a/eng/pipelines/common/templates/runtimes/send-to-helix-step.yml +++ b/eng/pipelines/common/templates/runtimes/send-to-helix-step.yml @@ -1,6 +1,6 @@ parameters: displayName: '' - condition: '' + condition: true archType: '' osGroup: '' osSubgroup: '' @@ -17,73 +17,24 @@ parameters: timeoutPerTestInMinutes: '' runCrossGen: '' runCrossGen2: '' + runPALTestsDir: '' compositeBuildMode: false helixProjectArguments: '' runInUnloadableContext: '' longRunningGcTests: '' gcSimulatorTests: '' - coreClrRepoRoot: '' runtimeFlavorDisplayName: 'CoreCLR' runtimeVariant: '' steps: -- ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - # TODO: Remove and consolidate this when we move to arcade via init-tools.cmd. - - powershell: $(Build.SourcesDirectory)\eng\common\build.ps1 /p:DotNetPublishToBlobFeed=true -ci -restore -projects $(Build.SourcesDirectory)\eng\empty.csproj - displayName: Restore blob feed tasks - ${{ if ne(parameters.condition, '') }}: - condition: ${{ parameters.condition }} - - - powershell: eng\common\msbuild.ps1 -ci ${{ parameters.helixProjectArguments }} /maxcpucount /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog - displayName: ${{ parameters.displayName }} - ${{ if ne(parameters.condition, '') }}: - condition: ${{ parameters.condition }} - env: - __BuildArch: ${{ parameters.archType }} - __TargetOS: ${{ parameters.osGroup }}${{ parameters.osSubgroup }} - __BuildType: ${{ parameters.buildConfig }} - _Creator: ${{ parameters.creator }} - _PublishTestResults: ${{ parameters.publishTestResults }} - _HelixAccessToken: ${{ parameters.helixAccessToken }} - _HelixBuild: ${{ parameters.helixBuild }} - _HelixSource: ${{ parameters.helixSource }} - _HelixTargetQueues: ${{ join(',', parameters.helixQueues) }} - _HelixType: ${{ parameters.helixType }} - _RunCrossGen: ${{ parameters.runCrossGen }} - _RunCrossGen2: ${{ parameters.runCrossGen2 }} - _CompositeBuildMode: ${{ parameters.compositeBuildMode }} - _RunInUnloadableContext: ${{ parameters.runInUnloadableContext }} - _LongRunningGcTests: ${{ parameters.longRunningGcTests }} - _GcSimulatorTests: ${{ parameters.gcSimulatorTests }} - _Scenarios: ${{ join(',', parameters.scenarios) }} - _TimeoutPerTestCollectionInMinutes: ${{ parameters.timeoutPerTestCollectionInMinutes }} - _TimeoutPerTestInMinutes: ${{ parameters.timeoutPerTestInMinutes }} - runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }} - _RuntimeVariant: ${{ parameters.runtimeVariant }} - ${{ if eq(parameters.publishTestResults, 'true') }}: - SYSTEM_ACCESSTOKEN: $(System.AccessToken) - # TODO: remove NUGET_PACKAGES once https://github.com/dotnet/arcade/issues/1578 is fixed - NUGET_PACKAGES: $(Build.SourcesDirectory)\.packages - -- ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - # TODO: Remove and consolidate this when we move to arcade via init-tools.sh. - - script: $(Build.SourcesDirectory)/eng/common/build.sh /p:DotNetPublishToBlobFeed=true --ci --restore --projects $(Build.SourcesDirectory)/eng/empty.csproj - displayName: Restore blob feed tasks - ${{ if ne(parameters.condition, '') }}: - condition: ${{ parameters.condition }} - ${{ if eq(parameters.osGroup, 'FreeBSD') }}: - env: - # Arcade uses this SDK instead of trying to restore one. - DotNetCoreSdkDir: /usr/local/dotnet - - - script: $(Build.SourcesDirectory)/eng/common/msbuild.sh --ci ${{ parameters.helixProjectArguments }} /maxcpucount /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog +- template: send-to-helix-inner-step.yml + parameters: + osGroup: ${{ parameters.osGroup }} + restoreParams: /p:DotNetPublishToBlobFeed=true -restore -projects $(Build.SourcesDirectory)$(dir)eng$(dir)empty.csproj + sendParams: ${{ parameters.helixProjectArguments }} /maxcpucount /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog /p:TargetArchitecture=${{ parameters.archType }} /p:TargetOS=${{ parameters.osGroup }} /p:TargetOSSubgroup=${{ parameters.osSubgroup }} /p:Configuration=${{ parameters.buildConfig }} + condition: and(succeeded(), ${{ parameters.condition }}) displayName: ${{ parameters.displayName }} - ${{ if ne(parameters.condition, '') }}: - condition: ${{ parameters.condition }} - env: - __BuildArch: ${{ parameters.archType }} - __TargetOS: ${{ parameters.osGroup }}${{ parameters.osSubgroup }} - __BuildType: ${{ parameters.buildConfig }} + environment: _Creator: ${{ parameters.creator }} _PublishTestResults: ${{ parameters.publishTestResults }} _HelixAccessToken: ${{ parameters.helixAccessToken }} @@ -98,6 +49,7 @@ steps: _LongRunningGcTests: ${{ parameters.longRunningGcTests }} _GcSimulatorTests: ${{ parameters.gcSimulatorTests }} _Scenarios: ${{ join(',', parameters.scenarios) }} + _PALTestsDir: ${{ parameters.runPALTestsDir }} _TimeoutPerTestCollectionInMinutes: ${{ parameters.timeoutPerTestCollectionInMinutes }} _TimeoutPerTestInMinutes: ${{ parameters.timeoutPerTestInMinutes }} runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }} @@ -105,4 +57,4 @@ steps: ${{ if eq(parameters.publishTestResults, 'true') }}: SYSTEM_ACCESSTOKEN: $(System.AccessToken) # TODO: remove NUGET_PACKAGES once https://github.com/dotnet/arcade/issues/1578 is fixed - NUGET_PACKAGES: $(Build.SourcesDirectory)/.packages + NUGET_PACKAGES: $(Build.SourcesDirectory)$(dir).packages diff --git a/eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml b/eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml new file mode 100644 index 000000000000..79db36072669 --- /dev/null +++ b/eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml @@ -0,0 +1,80 @@ +parameters: + buildConfig: '' + archType: 'wasm' + osGroup: 'Browser' + osSubgroup: '' + container: '' + testGroup: '' + crossBuild: false + crossrootfsDir: '' + readyToRun: false + liveLibrariesBuildConfig: '' + crossgen2: false + compositeBuildMode: false + helixQueues: '' + stagedBuild: false + displayNameArgs: '' + runInUnloadableContext: false + runtimeVariant: '' + variables: {} + pool: '' + runtimeFlavor: 'mono' + runtimeFlavorDisplayName: 'Mono' + dependsOn: [] + #arcade-specific parameters + condition: always() + continueOnError: false + displayName: '' + timeoutInMinutes: '' + enableMicrobuild: '' + gatherAssetManifests: false + + +steps: + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) /p:LibrariesConfiguration=${{ parameters.buildConfig }} -ci -skipstressdependencies -excludemonofailures os Browser wasm $(buildConfigUpper) + displayName: Build Tests + + # Send tests to Helix + - template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml + parameters: + displayName: Send tests to Helix + buildConfig: $(buildConfigUpper) + archType: ${{ parameters.archType }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup}} + coreClrRepoRoot: $(Build.SourcesDirectory)/src/coreclr + runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }} + + ${{ if eq(variables['System.TeamProject'], 'public') }}: + creator: $(Build.DefinitionName) + + helixBuild: $(Build.BuildNumber) + helixSource: $(_HelixSource) + + ${{ if ne(parameters.readyToRun, true) }}: + helixType: 'test/functional/cli/' + + helixQueues: ${{ parameters.helixQueues }} + + # This tests whether an array is empty + ${{ if eq(join('', parameters.helixQueues), '') }}: + condition: false + + publishTestResults: true + + timeoutPerTestInMinutes: $(timeoutPerTestInMinutes) + timeoutPerTestCollectionInMinutes: $(timeoutPerTestCollectionInMinutes) + + runCrossGen: ${{ and(eq(parameters.readyToRun, true), ne(parameters.crossgen2, true)) }} + runCrossGen2: ${{ and(eq(parameters.readyToRun, true), eq(parameters.crossgen2, true)) }} + compositeBuildMode: ${{ parameters.compositeBuildMode }} + runInUnloadableContext: ${{ parameters.runInUnloadableContext }} + + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + # Access token variable for internal project from the + # DotNet-HelixApi-Access variable group + helixAccessToken: $(HelixApiAccessToken) + + helixProjectArguments: '$(Build.SourcesDirectory)/src/tests/Common/helixpublishwitharcade.proj' + + scenarios: normal diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml index f6a5ee11f4ec..c449f3f14e64 100644 --- a/eng/pipelines/common/xplat-setup.yml +++ b/eng/pipelines/common/xplat-setup.yml @@ -6,6 +6,7 @@ parameters: container: '' helixQueuesTemplate: '' platform: '' + targetRid: '' jobParameters: {} variables: [] @@ -92,6 +93,7 @@ jobs: osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} archType: ${{ parameters.archType }} + targetRid: ${{ parameters.targetRid }} platform: ${{ parameters.platform }} ${{ if ne(parameters.container, '') }}: @@ -103,26 +105,18 @@ jobs: ${{ if eq(parameters.jobParameters.pool, '') }}: pool: # Public Linux Build Pool - ${{ if and(in(parameters.osGroup, 'Linux', 'FreeBSD'), eq(variables['System.TeamProject'], 'public')) }}: + ${{ if and(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Browser', 'Android'), eq(variables['System.TeamProject'], 'public')) }}: name: NetCorePublic-Pool queue: BuildPool.Ubuntu.1604.Amd64.Open # Official Build Linux Pool - ${{ if and(in(parameters.osGroup, 'Linux', 'FreeBSD'), ne(variables['System.TeamProject'], 'public')) }}: + ${{ if and(in(parameters.osGroup, 'Linux', 'FreeBSD', 'Browser', 'Android'), ne(variables['System.TeamProject'], 'public')) }}: name: NetCoreInternal-Pool queue: BuildPool.Ubuntu.1604.Amd64 - # Public OSX Build Pool - ${{ if eq(parameters.osGroup, 'OSX') }}: - vmImage: 'macOS-10.14' - - # Public OSX Build Pool - ${{ if eq(parameters.osGroup, 'iOS') }}: - vmImage: 'macOS-10.14' - - # Public OSX Build Pool - ${{ if eq(parameters.osGroup, 'tvOS') }}: - vmImage: 'macOS-10.14' + # OSX Build Pool (we don't have on-prem OSX BuildPool + ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: + vmImage: 'macOS-10.15' # Official Build Windows Pool ${{ if and(eq(parameters.osGroup, 'Windows_NT'), ne(variables['System.TeamProject'], 'public')) }}: @@ -136,6 +130,9 @@ jobs: ${{ if eq(parameters.helixQueuesTemplate, '') }}: + # macOS hosted pool machines are slower so we need to give a greater timeout than the 60 mins default. + ${{ if and(eq(parameters.jobParameters.timeoutInMinutes, ''), in(parameters.osGroup, 'OSX', 'iOS', 'tvOS')) }}: + timeoutInMinutes: 120 ${{ insert }}: ${{ parameters.jobParameters }} ${{ if ne(parameters.helixQueuesTemplate, '') }}: jobTemplate: ${{ parameters.jobTemplate }} diff --git a/eng/pipelines/coreclr/ci.yml b/eng/pipelines/coreclr/ci.yml index 7e72c87e16b8..2c0cba802d91 100644 --- a/eng/pipelines/coreclr/ci.yml +++ b/eng/pipelines/coreclr/ci.yml @@ -3,6 +3,7 @@ trigger: branches: include: - master + - release/*.* paths: include: - '*' @@ -23,10 +24,8 @@ trigger: - eng/pipelines/libraries/* - eng/pipelines/runtime.yml - -pr: none - jobs: + # # Checkout repository # @@ -45,6 +44,7 @@ jobs: - Linux_musl_arm64 - Linux_musl_x64 - Linux_x64 + - OSX_arm64 - OSX_x64 - Windows_NT_arm - Windows_NT_arm64 @@ -73,6 +73,7 @@ jobs: - Linux_arm - Linux_musl_arm64 - Linux_x64 + - OSX_arm64 - OSX_x64 - Windows_NT_x86 jobParameters: @@ -164,4 +165,5 @@ jobs: jobTemplate: /eng/pipelines/coreclr/templates/format-job.yml platforms: - Linux_x64 - - Windows_NT_x64 + # Issue: https://github.com/dotnet/runtime/issues/40034 + #- Windows_NT_x64 diff --git a/eng/pipelines/coreclr/crossgen2-composite.yml b/eng/pipelines/coreclr/crossgen2-composite.yml index 629e96606be7..49dd16efcf62 100644 --- a/eng/pipelines/coreclr/crossgen2-composite.yml +++ b/eng/pipelines/coreclr/crossgen2-composite.yml @@ -1,7 +1,5 @@ trigger: none -pr: none - schedules: - cron: "0 6 * * *" displayName: Mon through Sun at 10:00 PM (UTC-8:00) @@ -21,9 +19,11 @@ jobs: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml buildConfig: checked platforms: + - Linux_arm - Linux_x64 - Linux_arm64 - OSX_x64 + - Windows_NT_x86 - Windows_NT_x64 - Windows_NT_arm64 - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 @@ -46,9 +46,11 @@ jobs: helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml buildConfig: checked platforms: + - Linux_arm - Linux_x64 - Linux_arm64 - OSX_x64 + - Windows_NT_x86 - Windows_NT_x64 - Windows_NT_arm64 jobParameters: diff --git a/eng/pipelines/coreclr/crossgen2-gcstress.yml b/eng/pipelines/coreclr/crossgen2-gcstress.yml new file mode 100644 index 000000000000..f1b4fd23bf89 --- /dev/null +++ b/eng/pipelines/coreclr/crossgen2-gcstress.yml @@ -0,0 +1,58 @@ +trigger: none + +schedules: +- cron: "0 6 * * 0,1" + displayName: Sat and Sun at 10:00 PM (UTC-8:00) + branches: + include: + - master + always: true + +jobs: +# +# Checkout repository +# +- template: /eng/pipelines/common/checkout-job.yml + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml + buildConfig: checked + platforms: + - Linux_x64 + - Linux_arm64 + - OSX_x64 + - Windows_NT_x64 + - Windows_NT_arm64 + - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 + jobParameters: + testGroup: gcstress-extra + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml + buildConfig: checked + platforms: + - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 + jobParameters: + testGroup: gcstress-extra + liveLibrariesBuildConfig: Release + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + buildConfig: checked + platforms: + - Linux_x64 + - Linux_arm64 + - OSX_x64 + - Windows_NT_x64 + - Windows_NT_arm64 + jobParameters: + testGroup: gcstress-extra + readyToRun: true + crossgen2: true + compositeBuildMode: true + displayNameArgs: Composite + liveLibrariesBuildConfig: Release diff --git a/eng/pipelines/coreclr/crossgen2-outerloop.yml b/eng/pipelines/coreclr/crossgen2-outerloop.yml index 505e3ecc2d1d..e5b55caca997 100644 --- a/eng/pipelines/coreclr/crossgen2-outerloop.yml +++ b/eng/pipelines/coreclr/crossgen2-outerloop.yml @@ -1,7 +1,5 @@ trigger: none -pr: none - schedules: - cron: "0 7 * * 0,2,4" displayName: Sun, Tue, Thu at 11:00 PM (UTC-8:00) @@ -18,7 +16,7 @@ jobs: - template: /eng/pipelines/common/platform-matrix.yml parameters: - jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml + jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml buildConfig: checked platforms: - Linux_x64 @@ -30,6 +28,36 @@ jobs: jobParameters: testGroup: outerloop +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml + buildConfig: Release + platforms: + - Linux_arm + - Linux_arm64 + - Linux_x64 + - Windows_NT_x86 + - Windows_NT_x64 + jobParameters: + testGroup: outerloop + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/libraries/build-job.yml + buildConfig: Release + platforms: + - Linux_arm + - Linux_arm64 + - Linux_x64 + - OSX_x64 + - Windows_NT_x86 + - Windows_NT_x64 + - Windows_NT_arm64 + - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 + jobParameters: + isOfficialBuild: false + liveRuntimeBuildConfig: Release + - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -74,3 +102,102 @@ jobs: crossgen2: true displayNameArgs: R2R_CG2 liveLibrariesBuildConfig: Release + +# Build Crossgen2 baselines +# These are the various crossgen2 targets that are supported, and cover all major +# significantly different code generators +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/crossgen2-comparison-build-job.yml + buildConfig: Release + platforms: + - Linux_arm + - Linux_arm64 + - Linux_x64 + - Windows_NT_x86 + - Windows_NT_x64 + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + +# test crossgen target Windows X86 +# This job verifies that 32-bit and 64 bit crossgen2 produces the same binaries, +# and that cross-os targetting works +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml + buildConfig: Release + platforms: + - Linux_x64 + - Windows_NT_x86 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + targetos: Windows_NT + targetarch: x86 + +# test target Linux X64 +# verify that cross OS targetting works +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml + buildConfig: Release + platforms: + - Windows_NT_x64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + targetos: Linux + targetarch: x64 + +# test target Windows X64 +# verify that cross OS targetting works +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml + buildConfig: Release + platforms: + - Linux_x64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + targetos: Windows_NT + targetarch: x64 + +# test target Linux arm +# verify that cross architecture targetting works +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml + buildConfig: Release + platforms: + - Linux_arm + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + targetos: Linux + targetarch: arm + +# test target Linux arm64 +# verify that cross architecture targetting works +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml + buildConfig: Release + platforms: + - Linux_arm64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + targetos: Linux + targetarch: arm64 diff --git a/eng/pipelines/coreclr/crossgen2.yml b/eng/pipelines/coreclr/crossgen2.yml index 6ecdb931150a..e2623babf1e3 100644 --- a/eng/pipelines/coreclr/crossgen2.yml +++ b/eng/pipelines/coreclr/crossgen2.yml @@ -1,7 +1,5 @@ trigger: none -pr: none - schedules: - cron: "0 6 * * *" displayName: Mon through Sun at 10:00 PM (UTC-8:00) diff --git a/eng/pipelines/coreclr/ilasm.yml b/eng/pipelines/coreclr/ilasm.yml index ffdd75e38838..130f36938e47 100644 --- a/eng/pipelines/coreclr/ilasm.yml +++ b/eng/pipelines/coreclr/ilasm.yml @@ -1,6 +1,13 @@ trigger: none -pr: none +pr: + branches: + include: + - master + paths: + include: + - src/coreclr/src/ilasm/* + - src/coreclr/src/ildasm/* schedules: - cron: "0 19 * * 6" @@ -20,8 +27,15 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml buildConfig: checked - platformGroup: all platforms: + # Linux tests are built on the OSX machines. + - OSX_x64 + - Linux_arm + - Linux_arm64 + - Linux_x64 + - Windows_NT_x64 + - Windows_NT_x86 + - Windows_NT_arm64 - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: testGroup: ilasm @@ -40,7 +54,15 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml buildConfig: checked - platformGroup: all + platforms: + # Linux tests are built on the OSX machines. + - OSX_x64 + - Linux_arm + - Linux_arm64 + - Linux_x64 + - Windows_NT_x64 + - Windows_NT_x86 + - Windows_NT_arm64 helixQueueGroup: ci helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml jobParameters: diff --git a/eng/pipelines/coreclr/jit-experimental.yml b/eng/pipelines/coreclr/jit-experimental.yml index 1c74b665bb05..70790dddb9e2 100644 --- a/eng/pipelines/coreclr/jit-experimental.yml +++ b/eng/pipelines/coreclr/jit-experimental.yml @@ -1,7 +1,5 @@ trigger: none -pr: none - schedules: - cron: "0 22 * * 0,6" displayName: Sun at 2:00 PM (UTC-8:00) diff --git a/eng/pipelines/coreclr/jitrollingbuild.yml b/eng/pipelines/coreclr/jitrollingbuild.yml new file mode 100644 index 000000000000..68be50e4e2a9 --- /dev/null +++ b/eng/pipelines/coreclr/jitrollingbuild.yml @@ -0,0 +1,32 @@ +trigger: + batch: false + branches: + include: + - master + paths: + include: + - src/coreclr/src/jit/* + +pr: none + +jobs: +# +# Checkout repository +# +- template: /eng/pipelines/common/checkout-job.yml + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/build-jit-job.yml + buildConfig: checked + platforms: + - OSX_x64 + # Currently, Linux arm/arm64 machines don't have the Python 'pip3' tool, nor the azure-storage-blob package that + # is required to do the JIT upload to Azure Storage. Thus, these platforms are disabled. If we can figure out how + # to get Python properly configured, then re-enable them. + # - Linux_arm + # - Linux_arm64 + - Linux_x64 + - Windows_NT_x64 + - Windows_NT_x86 + - Windows_NT_arm64 diff --git a/eng/pipelines/coreclr/jitstress.yml b/eng/pipelines/coreclr/jitstress.yml index 5bd57f564e4c..a78aaa620f0f 100644 --- a/eng/pipelines/coreclr/jitstress.yml +++ b/eng/pipelines/coreclr/jitstress.yml @@ -3,12 +3,18 @@ trigger: none pr: none schedules: -- cron: "0 4 * * *" - displayName: Mon through Sun at 8:00 PM (UTC-8:00) +- cron: "0 4 * * 1,3,5" + displayName: Mon, Wed, Fri at 8:00 PM (UTC-8:00) branches: include: - master always: true +- cron: "0 4 * * 0,2,4,6" + displayName: Sun, Tue, Thu, Sat at 8:00 PM (UTC-8:00) + branches: + include: + - release/*.* + always: true jobs: # @@ -28,7 +34,6 @@ jobs: - Linux_x64 - Windows_NT_x64 - Windows_NT_x86 - - Windows_NT_arm - Windows_NT_arm64 - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: @@ -56,7 +61,6 @@ jobs: - Linux_x64 - Windows_NT_x64 - Windows_NT_x86 - - Windows_NT_arm - Windows_NT_arm64 helixQueueGroup: ci helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml diff --git a/eng/pipelines/coreclr/jitstress2-jitstressregs.yml b/eng/pipelines/coreclr/jitstress2-jitstressregs.yml index b163671960a1..743e071e08e8 100644 --- a/eng/pipelines/coreclr/jitstress2-jitstressregs.yml +++ b/eng/pipelines/coreclr/jitstress2-jitstressregs.yml @@ -28,7 +28,6 @@ jobs: - Linux_x64 - Windows_NT_x64 - Windows_NT_x86 - - Windows_NT_arm - Windows_NT_arm64 - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: @@ -56,7 +55,6 @@ jobs: - Linux_x64 - Windows_NT_x64 - Windows_NT_x86 - - Windows_NT_arm - Windows_NT_arm64 helixQueueGroup: ci helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml diff --git a/eng/pipelines/coreclr/jitstressregs.yml b/eng/pipelines/coreclr/jitstressregs.yml index 6df9790231a9..12c8fc515887 100644 --- a/eng/pipelines/coreclr/jitstressregs.yml +++ b/eng/pipelines/coreclr/jitstressregs.yml @@ -28,7 +28,6 @@ jobs: - Linux_x64 - Windows_NT_x64 - Windows_NT_x86 - - Windows_NT_arm - Windows_NT_arm64 - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 jobParameters: @@ -56,7 +55,6 @@ jobs: - Linux_x64 - Windows_NT_x64 - Windows_NT_x86 - - Windows_NT_arm - Windows_NT_arm64 helixQueueGroup: ci helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml diff --git a/eng/pipelines/coreclr/libraries-jitstress.yml b/eng/pipelines/coreclr/libraries-jitstress.yml index 7128ab1414c0..91fae482d447 100644 --- a/eng/pipelines/coreclr/libraries-jitstress.yml +++ b/eng/pipelines/coreclr/libraries-jitstress.yml @@ -3,12 +3,18 @@ trigger: none pr: none schedules: -- cron: "0 7 * * *" - displayName: Mon through Sun at 11:00 PM (UTC-8:00) +- cron: "0 7 * * 0,2,4,6" + displayName: Sun, Tue, Thu, Sat at 11:00 PM (UTC-8:00) branches: include: - master always: true +- cron: "0 7 * * 1,3,5" + displayName: Mon, Wed, Fri at 11:00 PM (UTC-8:00) + branches: + include: + - release/*.* + always: true jobs: # diff --git a/eng/pipelines/coreclr/perf.yml b/eng/pipelines/coreclr/perf.yml index 149eb1aed6fb..8b12dae2dd1d 100644 --- a/eng/pipelines/coreclr/perf.yml +++ b/eng/pipelines/coreclr/perf.yml @@ -3,6 +3,7 @@ trigger: branches: include: - master + - release/* paths: include: - '*' @@ -17,25 +18,8 @@ trigger: - README.md - SECURITY.md - THIRD-PARTY-NOTICES.TXT - - -pr: - branches: - include: - - master - paths: - include: - - '*' - - src/libraries/System.Private.CoreLib/* - exclude: - - docs/* - - CODE-OF-CONDUCT.md - - CONTRIBUTING.md - - LICENSE.TXT - - PATENTS.TXT - - README.md - - SECURITY.md - - THIRD-PARTY-NOTICES.TXT + +pr: none jobs: # @@ -43,6 +27,7 @@ jobs: # - template: /eng/pipelines/common/checkout-job.yml +# build coreclr and libraries - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml @@ -54,6 +39,28 @@ jobs: jobParameters: testGroup: perf +# build mono on wasm +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - Browser_wasm + jobParameters: + buildArgs: -s mono+libs+installer -c $(_BuildConfig) + nameSuffix: wasm + isOfficialBuild: ${{ variables.isOfficialBuild }} + extraStepsTemplate: /eng/pipelines/common/upload-artifact-step.yml + extraStepsParameters: + rootFolder: '$(Build.SourcesDirectory)/artifacts/' + includeRootFolder: true + displayName: Browser Wasm Artifacts + artifactName: BrowserWasm + archiveType: zip + archiveExtension: .zip + +# build mono - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/mono/templates/build-job.yml @@ -62,6 +69,23 @@ jobs: platforms: - Linux_x64 +# run mono microbenchmarks perf job +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml + buildConfig: release + runtimeFlavor: mono + platforms: + - Linux_x64 + jobParameters: + testGroup: perf + liveLibrariesBuildConfig: Release + runtimeType: mono + projectFile: microbenchmarks.proj + runKind: micro_mono + runJobTemplate: /eng/pipelines/coreclr/templates/run-performance-job.yml + +# run mono interpreter perf job - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml @@ -73,21 +97,30 @@ jobs: testGroup: perf liveLibrariesBuildConfig: Release runtimeType: mono + codeGenType: 'Interpreter' + projectFile: microbenchmarks.proj + runKind: micro_mono + runJobTemplate: /eng/pipelines/coreclr/templates/run-performance-job.yml + +# run mono wasm microbenchmarks perf job +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml # NOTE: should we move this file out of coreclr tempelates because it contains mono jobs? + buildConfig: release + runtimeFlavor: wasm + platforms: + - Linux_x64 + jobParameters: + testGroup: perf + liveLibrariesBuildConfig: Release + runtimeType: wasm + codeGenType: 'wasm' + projectFile: microbenchmarks.proj + runKind: micro + runJobTemplate: /eng/pipelines/coreclr/templates/run-performance-job.yml -- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml - buildConfig: release - runtimeFlavor: mono - platforms: - - Linux_x64 - jobParameters: - testGroup: perf - liveLibrariesBuildConfig: Release - runtimeType: mono - codeGenType: 'Interpreter' +# run coreclr microbenchmarks perf job - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml @@ -100,3 +133,41 @@ jobs: jobParameters: testGroup: perf liveLibrariesBuildConfig: Release + projectFile: microbenchmarks.proj + runKind: micro + runJobTemplate: /eng/pipelines/coreclr/templates/run-performance-job.yml + +# run coreclr crossgen perf job +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml + buildConfig: release + runtimeFlavor: coreclr + platforms: + - Linux_x64 + - Windows_NT_x64 + - Windows_NT_x86 + jobParameters: + testGroup: perf + liveLibrariesBuildConfig: Release + projectFile: crossgen_perf.proj + runKind: crossgen_scenarios + runJobTemplate: /eng/pipelines/coreclr/templates/run-scenarios-job.yml + +# run mono wasm blazor perf job +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/perf-job.yml + buildConfig: release + runtimeFlavor: wasm + platforms: + - Linux_x64 + jobParameters: + testGroup: perf + liveLibrariesBuildConfig: Release + runtimeType: wasm + projectFile: blazor_perf.proj + runKind: blazor_scenarios + runJobTemplate: /eng/pipelines/coreclr/templates/run-scenarios-job.yml + additionalSetupParameters: '--latestdotnet' + diff --git a/eng/pipelines/coreclr/r2r-extra.yml b/eng/pipelines/coreclr/r2r-extra.yml index 97a80cdffbbf..68bef96eeb52 100644 --- a/eng/pipelines/coreclr/r2r-extra.yml +++ b/eng/pipelines/coreclr/r2r-extra.yml @@ -1,7 +1,5 @@ trigger: none -pr: none - schedules: - cron: "0 2 * * 0,1" displayName: Sat and Sun at 6:00 PM (UTC-8:00) diff --git a/eng/pipelines/coreclr/r2r.yml b/eng/pipelines/coreclr/r2r.yml index 55bbcd4bdfe5..a3b76e9d8e3f 100644 --- a/eng/pipelines/coreclr/r2r.yml +++ b/eng/pipelines/coreclr/r2r.yml @@ -1,7 +1,5 @@ trigger: none -pr: none - schedules: - cron: "0 5 * * *" displayName: Mon through Sun at 9:00 PM (UTC-8:00) diff --git a/eng/pipelines/coreclr/readme.md b/eng/pipelines/coreclr/readme.md index 71c391dcc908..0969c41af214 100644 --- a/eng/pipelines/coreclr/readme.md +++ b/eng/pipelines/coreclr/readme.md @@ -56,4 +56,4 @@ internal.yml -> platform-matrix.yml -------> build-job.yml -------> xplat-job.ym | (passed-in jobTemplate) | (arcade) \------> test-job.yml ------/ \------> format-job.yml ----/ -``` \ No newline at end of file +``` diff --git a/eng/pipelines/coreclr/runincontext.yml b/eng/pipelines/coreclr/runincontext.yml index 91fb9189a6d1..64e6fe6205a3 100644 --- a/eng/pipelines/coreclr/runincontext.yml +++ b/eng/pipelines/coreclr/runincontext.yml @@ -1,7 +1,5 @@ trigger: none -pr: none - schedules: - cron: "0 13 * * 6,0" displayName: Sat and Sun at 5:00 AM (UTC-8:00) diff --git a/eng/pipelines/coreclr/superpmi.yml b/eng/pipelines/coreclr/superpmi.yml new file mode 100644 index 000000000000..5fb435365182 --- /dev/null +++ b/eng/pipelines/coreclr/superpmi.yml @@ -0,0 +1,87 @@ +trigger: none + +pr: none + +schedules: +- cron: "0 17 * * 0" + displayName: Sun at 9:00 AM (UTC-8:00) + branches: + include: + - master + always: true + +jobs: +# +# Checkout repository +# + +- template: /eng/pipelines/common/checkout-job.yml + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml + buildConfig: checked + platforms: + # Linux tests are built on the OSX machines. + # - OSX_x64 + - Linux_arm + - Linux_arm64 + - Linux_x64 + - Windows_NT_x64 + - Windows_NT_x86 + - Windows_NT_arm64 + - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 + jobParameters: + testGroup: outerloop + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml + buildConfig: checked + platforms: + - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-job.yml + buildConfig: checked + platforms: + # Linux tests are built on the OSX machines. + # - OSX_x64 + - Linux_arm + - Linux_arm64 + - Linux_x64 + - Windows_NT_x64 + - Windows_NT_x86 + - Windows_NT_arm64 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + collectionName: libraries + +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/superpmi-job.yml + buildConfig: checked + platforms: + # Linux tests are built on the OSX machines. + # - OSX_x64 + - Linux_arm + - Linux_arm64 + - Linux_x64 + - Windows_NT_x64 + - Windows_NT_x86 + - Windows_NT_arm64 + - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 + helixQueueGroup: ci + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: outerloop + liveLibrariesBuildConfig: Release + collectionName: tests + diff --git a/eng/pipelines/coreclr/templates/build-jit-job.yml b/eng/pipelines/coreclr/templates/build-jit-job.yml new file mode 100644 index 000000000000..a5f31d4d3b55 --- /dev/null +++ b/eng/pipelines/coreclr/templates/build-jit-job.yml @@ -0,0 +1,123 @@ +parameters: + archType: '' + buildConfig: '' + container: '' + crossBuild: false + crossrootfsDir: '' + osGroup: '' + osSubgroup: '' + pool: '' + stagedBuild: false + timeoutInMinutes: '' + variables: {} + +### Product build +jobs: +- template: xplat-pipeline-job.yml + parameters: + buildConfig: ${{ parameters.buildConfig }} + archType: ${{ parameters.archType }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + helixType: 'build/product/' + enableMicrobuild: true + stagedBuild: ${{ parameters.stagedBuild }} + pool: ${{ parameters.pool }} + + # Compute job name from template parameters + name: ${{ format('coreclr_jit_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + displayName: ${{ format('CoreCLR JIT Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + + # Run all steps in the container. + # Note that the containers are defined in platform-matrix.yml + container: ${{ parameters.container }} + + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + + crossBuild: ${{ parameters.crossBuild }} + crossrootfsDir: ${{ parameters.crossrootfsDir }} + + gatherAssetManifests: true + + variables: + - name: osGroup + value: ${{ parameters.osGroup }} + - name: osSubgroup + value: ${{ parameters.osSubgroup }} + + - name: publishLogsArtifactPrefix + value: 'BuildLogs_CoreCLR_JIT' + + - name: compilerArg + value: '' + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - name: compilerArg + value: '-clang9' + # Building for x64 MUSL happens on Alpine Linux and we need to use the stable version available there + - ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubgroup, '_musl'), eq(parameters.archType, 'x64')) }}: + - name: compilerArg + value: '' + # AppleClang has different version scheme, so we let complier introspection pick up the available clang from PATH + - ${{ if eq(parameters.osGroup, 'OSX') }}: + - name: compilerArg + value: '' + + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - name: PythonScript + value: 'py -3' + - name: PipScript + value: 'py -3 -m pip' + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - name: PythonScript + value: 'python3' + - name: PipScript + value: 'pip3' + + - ${{ parameters.variables }} + + steps: + + # Install native dependencies + # Linux builds use docker images with dependencies preinstalled, + # and FreeBSD builds use a build agent with dependencies + # preinstalled, so we only need this step for OSX and Windows. + - ${{ if eq(parameters.osGroup, 'OSX') }}: + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO + displayName: Install native dependencies + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + # Necessary to install python + - script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force + displayName: Install native dependencies + + # Install internal tools on official builds + # Since our internal tools are behind an authenticated feed, + # we need to use the DotNetCli AzDO task to restore from the feed using a service connection. + # We can't do this from within the build, so we need to do this as a separate step. + - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - template: /eng/pipelines/common/restore-internal-tools.yml + + # Build CoreCLR JIT + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) -ci $(compilerArg) -skipruntime -nopgooptimize + displayName: Build CoreCLR JIT + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -skipruntime -nopgooptimize -skiprestoreoptdata + displayName: Build CoreCLR JIT + + # Ensure the Python azure-storage-blob package is installed before doing the upload. + - script: $(PipScript) install --user azure.storage.blob==12.5.0 --force-reinstall + displayName: Install azure-storage-blob Python package + + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/jitrollingbuild.py upload -build_type $(buildConfig) -arch $(archType) -host_os $(osGroup) -git_hash $(Build.SourceVersion) + displayName: Upload JIT to Azure Storage + env: + CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline + + # Publish Logs + - task: PublishPipelineArtifact@1 + displayName: Publish Logs + inputs: + targetPath: $(Build.SourcesDirectory)/artifacts/log + artifactName: '$(publishLogsArtifactPrefix)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)' + continueOnError: true + condition: always() diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index f2b45e8072cc..de501480b767 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -6,6 +6,7 @@ parameters: compilerName: '' condition: true container: '' + crossBuild: false crossrootfsDir: '' isOfficialBuild: false osGroup: '' @@ -52,6 +53,7 @@ jobs: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossrootfsDir }} gatherAssetManifests: true @@ -109,6 +111,18 @@ jobs: - ${{ if eq(parameters.testGroup, 'clrinterpreter') }}: - name: clrInterpreterBuildArg value: '-cmakeargs "-DFEATURE_INTERPRETER=1"' + + - name: clrBuildPALTestsBuildArg + value: '' + - ${{ if ne(parameters.testGroup, 'innerloop') }}: + - name: clrBuildPALTestsBuildArg + value: '-paltests ' + + - name: ninjaArg + value: '' + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - name: ninjaArg + value: '-ninja' - ${{ parameters.variables }} @@ -119,7 +133,7 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if eq(parameters.osGroup, 'OSX') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python @@ -139,12 +153,17 @@ jobs: df -h displayName: Disk Usage before Build + # Build DacTableGen (Windows-only) + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.dactools $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(officialBuildIdArg) -ci /bl:$(Build.SourcesDirectory)artifacts/logs/$(buildConfig)/DacTools.binlog + displayName: Build managed product components and packages + # Build CoreCLR Runtime - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - - script: $(coreClrRepoRootDir)build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) + - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(clrBuildPALTestsBuildArg) $(ninjaArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) displayName: Build CoreCLR Runtime - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - - script: set __TestIntermediateDir=int&&$(coreClrRepoRootDir)build-runtime$(scriptExt) $(buildConfig) $(archType) -ci $(enforcePgoArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) + - script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci $(ninjaArg) $(enforcePgoArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) displayName: Build CoreCLR Runtime - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: @@ -154,7 +173,7 @@ jobs: displayName: Disk Usage after Build # Build CoreCLR Managed Components - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib+clr.nativecorelib+clr.tools+clr.packages $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(officialBuildIdArg) -ci + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib+clr.nativecorelib+clr.tools+clr.packages+clr.paltestlist $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(officialBuildIdArg) -ci displayName: Build managed product components and packages # Run CoreCLR Tools unit tests @@ -164,9 +183,31 @@ jobs: # Build native test components - ${{ if ne(parameters.isOfficialBuild, true) }}: - - script: $(coreClrRepoRootDir)build-test$(scriptExt) skipstressdependencies skipmanaged skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(osArg) $(priorityArg) $(compilerArg) + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) skipstressdependencies skipmanaged skipgeneratelayout $(buildConfig) $(archType) $(crossArg) $(osArg) $(priorityArg) $(compilerArg) displayName: Build native test components + # 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') }}: + + - template: /eng/pipelines/common/macos-sign-with-entitlements.yml + parameters: + filesToSign: + - name: createdump + path: $(buildProductRootFolderPath) + entitlementsFile: $(Build.SourcesDirectory)/eng/pipelines/common/createdump-entitlements.plist + - name: corerun + path: $(buildProductRootFolderPath) + entitlementsFile: $(Build.SourcesDirectory)/eng/pipelines/common/entitlements.plist + + - task: CopyFiles@2 + displayName: 'Copy signed createdump to sharedFramework' + inputs: + contents: createdump + sourceFolder: $(buildProductRootFolderPath) + targetFolder: $(buildProductRootFolderPath)/sharedFramework + overWrite: true + # Sign on Windows - ${{ if and(eq(parameters.osGroup, 'Windows_NT'), eq(parameters.signBinaries, 'true'), ne(parameters.testGroup, 'clrTools')) }}: - powershell: eng\common\build.ps1 -ci -sign -restore -configuration:$(buildConfig) -warnaserror:0 /p:ArcadeBuild=true /p:OfficialBuild=true /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) /p:Configuration=$(_BuildConfig) /p:DotNetSignType=$env:_SignType -projects $(Build.SourcesDirectory)\eng\empty.csproj @@ -193,7 +234,7 @@ jobs: artifactName: $(buildProductArtifactName) displayName: 'product build' - - ${{ if and(ne(parameters.osGroup, 'OSX'), ne(parameters.archType, 'x86'), ne(parameters.compilerName, 'gcc'), ne(parameters.testGroup, 'clrTools')) }}: + - ${{ if and(in(parameters.osGroup, 'Windows_NT', 'Linux'), ne(parameters.archType, 'x86'), ne(parameters.compilerName, 'gcc'), ne(parameters.testGroup, 'clrTools')) }}: - template: /eng/pipelines/coreclr/templates/crossdac-build.yml parameters: archType: ${{ parameters.archType }} diff --git a/eng/pipelines/coreclr/templates/crossdac-build.yml b/eng/pipelines/coreclr/templates/crossdac-build.yml index b17b72af8325..44fd80157f96 100644 --- a/eng/pipelines/coreclr/templates/crossdac-build.yml +++ b/eng/pipelines/coreclr/templates/crossdac-build.yml @@ -4,50 +4,48 @@ parameters: osSubgroup: '' steps: - # Always build the crossdac, that way we know in CI/PR if things break to build. - - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - - ${{ if notin(parameters.archType, 'x86') }}: - - script: set __TestIntermediateDir=int&&$(coreClrRepoRootDir)build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -linuxdac $(officialBuildIdArg) - displayName: Build Cross OS Linux DAC for Windows + # Always build the crossdac, that way we know in CI/PR if things break to build. + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - ${{ if notin(parameters.archType, 'x86') }}: + - script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -linuxdac $(officialBuildIdArg) + displayName: Build Cross OS Linux DAC for Windows - # Make the assets available in a single container for the packaging job. - - ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: - - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: - - ${{ if notin(parameters.archType, 'x86', 'arm') }}: - - script: set __TestIntermediateDir=int&&$(coreClrRepoRootDir)build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -alpinedac $(officialBuildIdArg) - displayName: Build Cross OS Linux-musl DAC for Windows + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - ${{ if notin(parameters.archType, 'x86') }}: + - script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -alpinedac $(officialBuildIdArg) + displayName: Build Cross OS Linux-musl DAC for Windows - - task: CopyFiles@2 - displayName: Gather CrossDac Artifacts (Linux) - inputs: - SourceFolder: $(buildLinuxDacRootFolderPath) - Contents: | - **/* - !**/sharedFramework/**/* - TargetFolder: $(buildLinuxDacStagingPath) + - task: CopyFiles@2 + displayName: Gather CrossDac Artifacts (Linux) + inputs: + SourceFolder: $(buildLinuxDacRootFolderPath) + Contents: | + **/* + !**/sharedFramework/**/* + TargetFolder: $(buildLinuxDacStagingPath) - - ${{ if ne(parameters.archType, 'arm') }}: - - task: CopyFiles@2 - displayName: Gather CrossDac Artifacts (Linux_musl) - inputs: - SourceFolder: $(buildMuslDacRootFolderPath) - Contents: | - **/* - !**/sharedFramework/**/* - TargetFolder: '$(buildMuslDacStagingPath)' + - task: CopyFiles@2 + displayName: Gather CrossDac Artifacts (Linux_musl) + inputs: + SourceFolder: $(buildMuslDacRootFolderPath) + Contents: | + **/* + !**/sharedFramework/**/* + TargetFolder: '$(buildMuslDacStagingPath)' - - ${{ if eq(parameters.osGroup, 'Linux') }}: - - task: CopyFiles@2 - displayName: Gather runtime for CrossDac - inputs: - SourceFolder: $(coreClrProductRootFolderPath) - Contents: libcoreclr.so - TargetFolder: '$(crossDacArtifactPath)/${{ parameters.osGroup }}${{ parameters.osSubgroup }}.$(archType).$(buildConfigUpper)/$(crossDacHostArch)' + - ${{ if eq(parameters.osGroup, 'Linux') }}: + - task: CopyFiles@2 + displayName: Gather runtime for CrossDac + inputs: + SourceFolder: $(coreClrProductRootFolderPath) + Contents: libcoreclr.so + TargetFolder: '$(crossDacArtifactPath)/${{ parameters.osGroup }}${{ parameters.osSubgroup }}.$(archType).$(buildConfigUpper)/$(crossDacHostArch)' - - task: PublishBuildArtifacts@1 - displayName: Publish runtime for CrossDac - inputs: - pathtoPublish: $(crossDacArtifactPath) - PublishLocation: Container - artifactName: $(buildCrossDacArtifactName) + # Make the assets available in a single container for the packaging job. + - task: PublishBuildArtifacts@1 + displayName: Publish runtime for CrossDac + inputs: + pathtoPublish: $(crossDacArtifactPath) + PublishLocation: Container + artifactName: $(buildCrossDacArtifactName) diff --git a/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml b/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml index 0e537cb6c7e1..3faae1209c10 100644 --- a/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml +++ b/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml @@ -6,6 +6,7 @@ parameters: container: '' helixQueues: '' runtimeVariant: '' + crossBuild: false crossrootfsDir: '' stagedBuild: false variables: {} @@ -40,6 +41,7 @@ jobs: name: ${{ format('test_crossgen_comparison_{0}{1}_{1}_{2}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} displayName: ${{ format('Test crossgen-comparison {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossrootfsDir }} variables: @@ -104,7 +106,7 @@ jobs: displayName: 'live-built libraries' # Populate Core_Root - - script: $(coreClrRepoRootDir)build-test$(scriptExt) $(buildConfig) $(archType) $(crossArg) generatelayoutonly + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(buildConfig) $(archType) $(crossArg) generatelayoutonly displayName: Populate Core_Root # Create directories and ensure crossgen is executable @@ -123,7 +125,7 @@ jobs: displayName: Create cross-platform crossgen baseline inputs: scriptSource: 'filePath' - scriptPath: $(coreClrRepoRoot)/tests/scripts/crossgen_comparison.py + scriptPath: $(Build.SourcesDirectory)/src/tests/Common/scripts/crossgen_comparison.py pythonInterpreter: /usr/bin/python3 ${{ if ne(parameters.osGroup, 'Windows_NT') }}: arguments: @@ -164,7 +166,7 @@ jobs: Creator: $(Creator) WorkItemTimeout: 3:00 # 3 hours WorkItemDirectory: '$(workItemDirectory)' - CorrelationPayloadDirectory: '$(coreClrRepoRoot)/tests/scripts' + CorrelationPayloadDirectory: '$(Build.SourcesDirectory)/src/tests/Common/scripts' ${{ if ne(parameters.osName, 'Windows_NT') }}: WorkItemCommand: chmod +x $HELIX_WORKITEM_PAYLOAD/crossgen; diff --git a/eng/pipelines/coreclr/templates/crossgen2-comparison-build-job.yml b/eng/pipelines/coreclr/templates/crossgen2-comparison-build-job.yml new file mode 100644 index 000000000000..9bcd11057ed3 --- /dev/null +++ b/eng/pipelines/coreclr/templates/crossgen2-comparison-build-job.yml @@ -0,0 +1,173 @@ +parameters: + buildConfig: '' + archType: '' + osGroup: '' + osSubgroup: '' + container: '' + helixQueues: '' + runtimeVariant: '' + crossBuild: false + crossrootfsDir: '' + stagedBuild: false + variables: {} + pool: '' + + # When set to a non-empty value (Debug / Release), it determines libraries + # build 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: '' + +### Crossgen-comparison build job +### +### Ensure that the output of cross-architecture, e.g. x64-hosted-arm-targeting, +### crossgen matches that of native, e.g. arm-hosted-arm-targeting, crossgen. + +jobs: +- template: xplat-pipeline-job.yml + parameters: + buildConfig: ${{ parameters.buildConfig }} + archType: ${{ parameters.archType }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + stagedBuild: ${{ parameters.stagedBuild }} + runtimeVariant: ${{ parameters.runtimeVariant }} + liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} + helixType: 'test/crossgen-comparison/' + pool: ${{ parameters.pool }} + + # Compute job name from template parameters + name: ${{ format('test_crossgen2_comparison_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + displayName: ${{ format('Test crossgen2-comparison build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + + crossBuild: ${{ parameters.crossBuild }} + crossrootfsDir: ${{ parameters.crossrootfsDir }} + + variables: + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - group: DotNet-HelixApi-Access + - name: hostArchType + value: x64 + - name: targetFlavor + value: $(osGroup).$(archType).$(buildConfigUpper) + - name: crossFlavor + value: $(osGroup).$(hostArchType)_$(archType).$(buildConfigUpper) + - name: artifactsDirectory + value: $(Build.SourcesDirectory)$(dir)artifacts + - name: binDirectory + value: $(artifactsDirectory)$(dir)bin + - name: productDirectory + value: $(binDirectory)$(dir)coreclr + - name: workItemDirectory + value: $(artifactsDirectory)$(dir)tests$(dir)coreclr$(dir)$(targetFlavor)$(dir)Tests$(dir)CrossCompileRoot + - name: crossgencompare_build_artifact + value: crossgen_comparison_build_$(osGroup)$(osSubgroup)_$(archType) + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - name: target_crossgen2_os + value: windows + - ${{ if eq(parameters.osGroup, 'Linux') }}: + - name: target_crossgen2_os + value: linux + - ${{ if eq(parameters.osGroup, 'OSX') }}: + - name: target_crossgen2_os + value: osx + - name: crossgen2location + value: $(productDirectory)$(dir)$(targetFlavor)$(dir)crossgen2$(dir)crossgen2.dll + - ${{ if ne(parameters.archType, 'x64') }}: + - name: crossgen2location + value: $(productDirectory)$(dir)$(targetFlavor)$(dir)x64$(dir)crossgen2$(dir)crossgen2.dll + - name: librariesProductDllDir + value: $(Build.SourcesDirectory)$(dir)artifacts$(dir)bin$(dir)runtime$(dir)net6.0-$(osGroup)$(osSubgroup)-$(buildConfig)-$(archType) + + - ${{ parameters.variables }} + + # Test job depends on the corresponding build job + dependsOn: + - ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }} + + # Run all steps in the container. + # Note that the containers are defined in platform-matrix.yml + container: ${{ parameters.container }} + timeoutInMinutes: 180 # 3 hrs + + steps: + + # Download product build + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(buildProductRootFolderPath) + artifactFileName: '$(buildProductArtifactName)$(archiveExtension)' + artifactName: '$(buildProductArtifactName)' + displayName: 'product build' + + # Optionally download live-built libraries + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(librariesDownloadDir) + cleanUnpackFolder: false + artifactFileName: '$(librariesBuildArtifactName)$(archiveExtension)' + artifactName: '$(librariesBuildArtifactName)' + displayName: 'live-built libraries' + + # Populate Core_Root + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(buildConfig) $(archType) $(crossArg) generatelayoutonly + displayName: Populate Core_Root + + # Create work item directory and populate with assemblies + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - script: | + mkdir -p $(workItemDirectory) + mkdir -p $(workItemDirectory)/log + mkdir -p $(workItemDirectory)/dlls + cp $(librariesProductDllDir)/* $(workItemDirectory)/dlls + cp $(productDirectory)/$(targetFlavor)/IL/System.Private.CoreLib.dll $(workItemDirectory)/dlls + displayName: Create directories + failOnStderr: true + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - script: | + md $(workItemDirectory)\log + md $(workItemDirectory)\dlls + echo copy $(librariesProductDllDir)\* $(workItemDirectory)\dlls + copy $(librariesProductDllDir)\* $(workItemDirectory)\dlls + echo copy $(productDirectory)\$(targetFlavor)\IL\System.Private.CoreLib.dll $(workItemDirectory)\dlls + copy $(productDirectory)\$(targetFlavor)\IL\System.Private.CoreLib.dll $(workItemDirectory)\dlls + displayName: Create directories + failOnStderr: true + + # Create baseline output on the host (x64) machine + - task: PythonScript@0 + displayName: Create cross-platform crossgen baseline + inputs: + scriptSource: 'filePath' + scriptPath: $(Build.SourcesDirectory)/src/tests/Common/scripts/crossgen2_comparison.py + ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + pythonInterpreter: /usr/bin/python3 + arguments: + crossgen_framework + --crossgen $(crossgen2location) + --dotnet $(Build.SourcesDirectory)/dotnet.sh + --core_root $(workItemDirectory)/dlls + --result_dir $(workItemDirectory)/log + --target_os $(target_crossgen2_os) + --target_arch $(archType) + ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + arguments: + crossgen_framework + --crossgen $(crossgen2location) + --dotnet $(Build.SourcesDirectory)\dotnet.cmd + --core_root $(workItemDirectory)\dlls + --result_dir $(workItemDirectory)\log + --target_os $(target_crossgen2_os) + --target_arch $(archType) + + - task: PublishPipelineArtifact@1 + displayName: Publish cross compiled component + inputs: + targetPath: $(workItemDirectory) + artifactName: $(crossgencompare_build_artifact) + continueOnError: true + condition: always() diff --git a/eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml b/eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml new file mode 100644 index 000000000000..7d825e93f541 --- /dev/null +++ b/eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml @@ -0,0 +1,178 @@ +parameters: + buildConfig: '' + archType: '' + osGroup: '' + osSubgroup: '' + container: '' + helixQueues: '' + runtimeVariant: '' + crossBuild: false + crossrootfsDir: '' + stagedBuild: false + variables: {} + pool: '' + targetarch: '' + targetos: '' + + # When set to a non-empty value (Debug / Release), it determines libraries + # build 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: '' + +### Crossgen-comparison job +### +### Ensure that the output of cross-architecture, e.g. x64-hosted-arm-targeting, +### crossgen matches that of native, e.g. arm-hosted-arm-targeting, crossgen. + +jobs: +- template: xplat-pipeline-job.yml + parameters: + buildConfig: ${{ parameters.buildConfig }} + archType: ${{ parameters.archType }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + stagedBuild: ${{ parameters.stagedBuild }} + runtimeVariant: ${{ parameters.runtimeVariant }} + liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} + helixType: 'test/crossgen-comparison/' + pool: ${{ parameters.pool }} + targetos: ${{ parameters.targetos }} + targetarch: ${{ parameters.targetarch }} + + # Compute job name from template parameters + name: ${{ format('test_crossgen2_comparison_{0}{1}_{2}_{3}_{4}_{5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.targetarch, parameters.targetos) }} + displayName: ${{ format('Test crossgen2-comparison {0}{1} {2} {3} to {4} {5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.targetarch, parameters.targetos) }} + + crossBuild: ${{ parameters.crossBuild }} + crossrootfsDir: ${{ parameters.crossrootfsDir }} + + variables: + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - group: DotNet-HelixApi-Access + - name: hostArchType + value: x64 + - name: targetFlavor + value: $(osGroup).$(archType).$(buildConfigUpper) + - name: artifactsDirectory + value: $(Build.SourcesDirectory)$(dir)artifacts + - name: binDirectory + value: $(artifactsDirectory)$(dir)bin + - name: productDirectory + value: $(binDirectory)$(dir)coreclr + - name: workItemDirectory + value: $(artifactsDirectory)$(dir)tests$(dir)coreclr$(dir)$(targetFlavor)$(dir)Tests$(dir)Core_Root + - name: targetarch + value: ${{ parameters.targetarch }} + - name: crossgencompare_build_artifact + value: crossgen_comparison_build_${{ parameters.targetos }}_${{ parameters.targetarch }} + - ${{ if eq(parameters.targetos, 'Windows_NT') }}: + - name: target_crossgen2_os + value: windows + - ${{ if eq(parameters.targetos, 'Linux') }}: + - name: target_crossgen2_os + value: linux + - ${{ if eq(parameters.targetos, 'OSX') }}: + - name: target_crossgen2_os + value: osx + + - ${{ parameters.variables }} + + # Test job depends on the corresponding build job + dependsOn: + - ${{ format('test_crossgen2_comparison_build_{0}_{1}_Release', parameters.targetos, parameters.targetarch)}} + - ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }} + + # Run all steps in the container. + # Note that the containers are defined in platform-matrix.yml + container: ${{ parameters.container }} + timeoutInMinutes: 180 # 3 hrs + + steps: + + # Download product build + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(buildProductRootFolderPath) + artifactFileName: '$(buildProductArtifactName)$(archiveExtension)' + artifactName: '$(buildProductArtifactName)' + displayName: 'product build' + + # Optionally download live-built libraries + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(librariesDownloadDir) + cleanUnpackFolder: false + artifactFileName: '$(librariesBuildArtifactName)$(archiveExtension)' + artifactName: '$(librariesBuildArtifactName)' + displayName: 'live-built libraries' + + # Populate Core_Root + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(buildConfig) $(archType) $(crossArg) generatelayoutonly + displayName: Populate Core_Root + + - task: DownloadPipelineArtifact@2 + displayName: Download Preprepared crossgen inputs and expected values + inputs: + artifact: '$(crossgencompare_build_artifact)' + path: '$(workItemDirectory)$(dir)prebuiltWork' + + # Send payload to Helix where the native output is generated and compared to the baseline + - template: /eng/common/templates/steps/send-to-helix.yml + parameters: + DisplayNamePrefix: Run native crossgen and compare output to baseline + osGroup: ${{ parameters.osGroup }} + HelixSource: $(_HelixSource) + HelixType: 'test/crossgen-comparison/' + ${{ if eq(variables['System.TeamProject'], 'internal') }}: + HelixAccessToken: $(HelixApiAccessToken) + HelixTargetQueues: ${{ join(' ', parameters.helixQueues) }} + ${{ if ne(variables['System.TeamProject'], 'internal') }}: + Creator: $(Creator) + WorkItemTimeout: 3:00 # 3 hours + WorkItemDirectory: '$(workItemDirectory)' + CorrelationPayloadDirectory: '$(Build.SourcesDirectory)/src/tests/Common/scripts' + ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + WorkItemCommand: + echo Targeting $(targetFlavor) ; + chmod +x $HELIX_WORKITEM_PAYLOAD/corerun; + mkdir -p $HELIX_WORKITEM_PAYLOAD/log; + export CORE_ROOT=$HELIX_CORRELATION_PAYLOAD; + python3 -u $HELIX_CORRELATION_PAYLOAD/crossgen2_comparison.py crossgen_framework + --crossgen $HELIX_WORKITEM_PAYLOAD/crossgen2/crossgen2.dll + --dotnet $HELIX_WORKITEM_PAYLOAD/corerun + --core_root $HELIX_WORKITEM_PAYLOAD/prebuiltWork/dlls + --result_dir $HELIX_WORKITEM_PAYLOAD/log + --target_os $(target_crossgen2_os) + --target_arch $(targetarch); + python3 -u $HELIX_CORRELATION_PAYLOAD/crossgen2_comparison.py compare + --base_dir $HELIX_WORKITEM_PAYLOAD/prebuiltWork/log + --diff_dir $HELIX_WORKITEM_PAYLOAD/log + ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + WorkItemCommand: + echo Targeting $(targetFlavor) & + md %HELIX_WORKITEM_PAYLOAD%\log & + set CORE_ROOT=%HELIX_CORRELATION_PAYLOAD% & + python -u %HELIX_CORRELATION_PAYLOAD%\crossgen2_comparison.py crossgen_framework + --crossgen %HELIX_WORKITEM_PAYLOAD%\crossgen2\crossgen2.dll + --dotnet %HELIX_WORKITEM_PAYLOAD%\corerun.exe + --core_root %HELIX_WORKITEM_PAYLOAD%\prebuiltWork\dlls + --result_dir %HELIX_WORKITEM_PAYLOAD%\log + --target_os $(target_crossgen2_os) + --target_arch $(targetarch) & + python -u %HELIX_CORRELATION_PAYLOAD%\crossgen2_comparison.py compare + --base_dir %HELIX_WORKITEM_PAYLOAD%\prebuiltWork\log + --diff_dir %HELIX_WORKITEM_PAYLOAD%\log + + # Publish log + - task: PublishPipelineArtifact@1 + displayName: Publish log + inputs: + targetPath: $(Build.SourcesDirectory)/artifacts/log + artifactName: ${{ format('Testlog_crossgen2_comparison_{0}{1}_{2}_{3}_{4}_{5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.targetarch, parameters.targetos) }} + continueOnError: true + condition: always() diff --git a/eng/pipelines/coreclr/templates/format-job.yml b/eng/pipelines/coreclr/templates/format-job.yml index 7e0921823b1d..18aaf6ea34d7 100644 --- a/eng/pipelines/coreclr/templates/format-job.yml +++ b/eng/pipelines/coreclr/templates/format-job.yml @@ -4,6 +4,7 @@ parameters: osGroup: '' osSubgroup: '' container: '' + crossBuild: false crossrootfsDir: '' timeoutInMinutes: '' stagedBuild: false @@ -20,6 +21,7 @@ jobs: osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} container: ${{ parameters.container }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossrootfsDir }} stagedBuild: ${{ parameters.stagedBuild }} timeoutInMinutes: ${{ parameters.timeoutInMinutes }} @@ -52,12 +54,12 @@ jobs: displayName: Run tests/scripts/format.py inputs: scriptSource: 'filePath' - scriptPath: $(coreClrRepoRoot)/tests/scripts/format.py - arguments: '-c $(coreClrRepoRoot) -o $(osGroup) -a $(archType)' + scriptPath: $(Build.SourcesDirectory)/src/tests/Common/scripts/format.py + arguments: '-c $(Build.SourcesDirectory)/src/coreclr -o $(osGroup) -a $(archType)' - task: PublishBuildArtifacts@1 displayName: Publish format.patch inputs: - PathtoPublish: '$(coreClrRepoRoot)/format.patch' + PathtoPublish: '$(Build.SourcesDirectory)/src/coreclr/format.patch' ArtifactName: format.$(osGroup).$(archType).patch continueOnError: true condition: failed() diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml index c7c62451b779..6bcef8752c2e 100644 --- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml +++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml @@ -22,6 +22,14 @@ jobs: runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }} helixQueues: + # Android x64 + - ${{ if in(parameters.platform, 'Android_x64') }}: + - Ubuntu.1804.Amd64.Android.Open + + # Browser wasm + - ${{ if eq(parameters.platform, 'Browser_wasm') }}: + - Ubuntu.1804.Amd64.Open + # Linux arm - ${{ if eq(parameters.platform, 'Linux_arm') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: @@ -47,6 +55,13 @@ jobs: - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - (Alpine.312.Amd64)ubuntu.1604.amd64@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.12-helix-20200602002622-e06dc59 + # Linux musl arm32 + - ${{ if eq(parameters.platform, 'Linux_musl_arm') }}: + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - (Alpine.312.Arm32.Open)Ubuntu.1804.ArmArch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.12-helix-arm32v7-20200908125213-5bece88 + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - (Alpine.312.Arm32)Ubuntu.1804.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.12-helix-arm32v7-20200908125213-5bece88 + # Linux musl arm64 - ${{ if eq(parameters.platform, 'Linux_musl_arm64') }}: - ${{ if eq(variables['System.TeamProject'], 'public') }}: @@ -124,7 +139,7 @@ jobs: # Windows_NT arm64 - ${{ if eq(parameters.platform, 'Windows_NT_arm64') }}: - ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}: - - Windows.10.Arm64.Open + - Windows.10.Arm64v8.Open - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - Windows.10.Arm64 diff --git a/eng/pipelines/coreclr/templates/perf-job.yml b/eng/pipelines/coreclr/templates/perf-job.yml index 4284a79368f9..b6101f39dc19 100644 --- a/eng/pipelines/coreclr/templates/perf-job.yml +++ b/eng/pipelines/coreclr/templates/perf-job.yml @@ -5,12 +5,16 @@ parameters: osSubgroup: '' container: '' runtimeVariant: '' - framework: net5.0 # Specify the appropriate framework when running release branches (ie netcoreapp3.0 for release/3.0) + framework: net6.0 # Specify the appropriate framework when running release branches (ie netcoreapp3.0 for release/3.0) liveLibrariesBuildConfig: '' variables: {} runtimeType: 'coreclr' pool: '' codeGenType: 'JIT' + projetFile: '' + runKind: '' + runJobTemplate: '/eng/pipelines/coreclr/templates/run-performance-job.yml' + additionalSetupParameters: '' ### Perf job @@ -18,11 +22,11 @@ parameters: ### buildConfig and archType. jobs: -- template: run-performance-job.yml +- template: ${{ parameters.runJobTemplate }} parameters: # Compute job name from template parameters - jobName: ${{ format('perfbuild_{0}{1}_{2}_{3}_{4}_{5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.runtimeType, parameters.codeGenType) }} - displayName: ${{ format('Performance {0}{1} {2} {3} {4} {5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.runtimeType, parameters.codeGenType) }} + jobName: ${{ format('perfbuild_{0}{1}_{2}_{3}_{4}_{5}_{6}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.runtimeType, parameters.codeGenType, parameters.runKind) }} + displayName: ${{ format('Performance {0}{1} {2} {3} {4} {5} {6}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.runtimeType, parameters.codeGenType, parameters.runKind) }} pool: ${{ parameters.pool }} buildConfig: ${{ parameters.buildConfig }} archType: ${{ parameters.archType }} @@ -32,6 +36,9 @@ jobs: liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} runtimeType: ${{ parameters.runtimeType }} codeGenType: ${{ parameters.codeGenType }} + projectFile: ${{ parameters.projectFile }} + runKind: ${{ parameters.runKind }} + additionalSetupParameters: ${{ parameters.additionalSetupParameters }} # Test job depends on the corresponding build job dependsOn: - ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} @@ -39,18 +46,22 @@ jobs: - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }} - ${{ if eq(parameters.runtimeType, 'mono') }}: - ${{ format('mono_{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + - ${{ if eq(parameters.runtimeType, 'wasm') }}: + - ${{ format('build_{0}{1}_{2}_{3}_{4}', 'Browser', '', 'wasm', parameters.buildConfig, parameters.runtimeType) }} ${{ if eq(parameters.osGroup, 'Windows_NT') }}: ${{ if eq(parameters.runtimeType, 'mono') }}: - extraSetupParameters: -Architecture ${{ parameters.archType }} -MonoDotnet $(Build.SourcesDirectory)\.dotnet-mono -Kind micro_mono - ${{ if ne(parameters.runtimeType, 'mono') }}: + extraSetupParameters: -Architecture ${{ parameters.archType }} -MonoDotnet $(Build.SourcesDirectory)\.dotnet-mono + ${{ if eq(parameters.runtimeType, 'coreclr') }}: extraSetupParameters: -CoreRootDirectory $(Build.SourcesDirectory)\artifacts\tests\coreclr\${{ parameters.osGroup }}.${{ parameters.archType }}.Release\Tests\Core_Root -Architecture ${{ parameters.archType }} ${{ if ne(parameters.osGroup, 'Windows_NT') }}: ${{ if eq(parameters.runtimeType, 'mono') }}: - extraSetupParameters: --architecture ${{ parameters.archType }} --monodotnet $(Build.SourcesDirectory)/.dotnet-mono --kind micro_mono - ${{ if ne(parameters.runtimeType, 'mono') }}: + extraSetupParameters: --architecture ${{ parameters.archType }} --monodotnet $(Build.SourcesDirectory)/.dotnet-mono + ${{ if eq(parameters.runtimeType, 'wasm') }}: + extraSetupParameters: --architecture ${{ parameters.archType }} --wasm $(librariesDownloadDir)/bin/wasm + ${{ if eq(parameters.runtimeType, 'coreclr') }}: extraSetupParameters: --corerootdirectory $(Build.SourcesDirectory)/artifacts/tests/coreclr/${{ parameters.osGroup }}.${{ parameters.archType }}.Release/Tests/Core_Root --architecture ${{ parameters.archType }} - + variables: ${{ parameters.variables }} frameworks: @@ -68,15 +79,15 @@ jobs: artifactName: '$(librariesBuildArtifactName)' displayName: 'live-built libraries' - - # Download product binaries directory + # Download coreclr - template: /eng/pipelines/common/download-artifact-step.yml parameters: unpackFolder: $(buildProductRootFolderPath) artifactFileName: '$(buildProductArtifactName)$(archiveExtension)' artifactName: '$(buildProductArtifactName)' - displayName: 'product build' + displayName: 'Coreclr product build' + # Download mono - ${{ if eq(parameters.runtimeType, 'mono') }}: - template: /eng/pipelines/common/download-artifact-step.yml parameters: @@ -86,15 +97,28 @@ jobs: artifactName: 'MonoProduct_${{ parameters.runtimeVariant }}_$(osGroup)_$(archType)_$(buildConfig)' displayName: 'Mono runtime' + # Download wasm + - ${{ if eq(parameters.runtimeType, 'wasm') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(librariesDownloadDir)/BrowserWasm + artifactFileName: BrowserWasm.zip + artifactName: BrowserWasm + displayName: BrowserWasm + + - script: "mkdir $(librariesDownloadDir)/bin/wasm;unzip -o $(librariesDownloadDir)/BrowserWasm/artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.browser-wasm.6.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 {} \\;" + displayName: "Create wasm directory (Linux)" + # Create Core_Root - - script: $(coreClrRepoRootDir)build-test$(scriptExt) $(buildConfig) $(archType) generatelayoutonly $(librariesOverrideArg) + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(buildConfig) $(archType) generatelayoutonly $(librariesOverrideArg) displayName: Create Core_Root condition: and(succeeded(), ne(variables.runtimeFlavorName, 'Mono')) - - script: "build.cmd -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)\\bin\\mono\\$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;xcopy $(Build.SourcesDirectory)\\artifacts\\bin\\testhost\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\* $(Build.SourcesDirectory)\\.dotnet-mono /E /I /Y;copy $(Build.SourcesDirectory)\\artifacts\\bin\\coreclr\\$(osGroup).$(archType).$(buildConfigUpper)\\corerun.exe $(Build.SourcesDirectory)\\.dotnet-mono\\shared\\Microsoft.NETCore.App\\5.0.0\\corerun.exe" + # Copy the runtime directory into the testhost folder to include OOBs. + - script: "build.cmd -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)\\bin\\mono\\$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;xcopy $(Build.SourcesDirectory)\\artifacts\\bin\\runtime\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\* $(Build.SourcesDirectory)\\artifacts\\bin\\testhost\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\shared\\Microsoft.NETCore.App\\6.0.0 /E /I /Y;xcopy $(Build.SourcesDirectory)\\artifacts\\bin\\testhost\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\* $(Build.SourcesDirectory)\\.dotnet-mono /E /I /Y;copy $(Build.SourcesDirectory)\\artifacts\\bin\\coreclr\\$(osGroup).$(archType).$(buildConfigUpper)\\corerun.exe $(Build.SourcesDirectory)\\.dotnet-mono\\shared\\Microsoft.NETCore.App\\6.0.0\\corerun.exe" displayName: "Create mono dotnet (Windows)" condition: and(and(succeeded(), eq(variables.runtimeFlavorName, 'Mono')), eq(variables.osGroup, 'Windows_NT')) - - script: "mkdir $(Build.SourcesDirectory)/.dotnet-mono;./build.sh -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)/bin/mono/$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;cp $(Build.SourcesDirectory)/artifacts/bin/testhost/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/* $(Build.SourcesDirectory)/.dotnet-mono -r;cp $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(buildConfigUpper)/corerun $(Build.SourcesDirectory)/.dotnet-mono/shared/Microsoft.NETCore.App/5.0.0/corerun" + - script: "mkdir $(Build.SourcesDirectory)/.dotnet-mono;./build.sh -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)/bin/mono/$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;cp $(Build.SourcesDirectory)/artifacts/bin/runtime/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/* $(Build.SourcesDirectory)/artifacts/bin/testhost/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/shared/Microsoft.NETCore.App/6.0.0 -rf;cp $(Build.SourcesDirectory)/artifacts/bin/testhost/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/* $(Build.SourcesDirectory)/.dotnet-mono -r;cp $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(buildConfigUpper)/corerun $(Build.SourcesDirectory)/.dotnet-mono/shared/Microsoft.NETCore.App/6.0.0/corerun" displayName: "Create mono dotnet (Linux)" condition: and(and(succeeded(), eq(variables.runtimeFlavorName, 'Mono')), ne(variables.osGroup, 'Windows_NT')) diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml index 7dadb9bd5eee..7cbead38035f 100644 --- a/eng/pipelines/coreclr/templates/run-performance-job.yml +++ b/eng/pipelines/coreclr/templates/run-performance-job.yml @@ -18,6 +18,8 @@ parameters: liveLibrariesBuildConfig: '' # optional -- live-live libraries configuration to use for the run runtimeType: 'coreclr' # optional -- Sets the runtime as coreclr or mono codeGenType: 'JIT' # optional -- Decides on the codegen technology if running on mono + projectFile: 'microbenchmarks.proj' # optional -- project file to build helix workitems + runKind: '' # required -- test category jobs: - template: xplat-pipeline-job.yml @@ -51,7 +53,7 @@ jobs: - IsInternal: '' - HelixApiAccessToken: '' - HelixPreCommandStemWindows: 'py -3 -m venv %HELIX_WORKITEM_PAYLOAD%\.venv;call %HELIX_WORKITEM_PAYLOAD%\.venv\Scripts\activate.bat;set PYTHONPATH=;py -3 -m pip install --user azure.storage.blob==12.0.0 --force-reinstall;py -3 -m pip install --user azure.storage.queue==12.0.0 --force-reinstall;set "PERFLAB_UPLOAD_TOKEN=$(PerfCommandUploadToken)"' - - HelixPreCommandStemLinux: 'sudo apt-get -y install python3-venv;python3 -m venv $HELIX_WORKITEM_PAYLOAD/.venv;source $HELIX_WORKITEM_PAYLOAD/.venv/Scripts/activate;export PYTHONPATH=;pip3 install --user azure.storage.blob==12.0.0 --force-reinstall;pip3 install --user azure.storage.queue==12.0.0 --force-reinstall;export PERFLAB_UPLOAD_TOKEN="$(PerfCommandUploadTokenLinux)"' + - HelixPreCommandStemLinux: 'sudo apt-get -y install python3-venv;python3 -m venv $HELIX_WORKITEM_PAYLOAD/.venv;source $HELIX_WORKITEM_PAYLOAD/.venv/Scripts/activate;export PYTHONPATH=;pip3 install --user azure.storage.blob==12.0.0 --force-reinstall;pip3 install --user azure.storage.queue==12.0.0 --force-reinstall;sudo apt-get update;sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates;curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -;sudo apt-get -y install nodejs;sudo apt-get -y install npm;npm install --prefix $HELIX_WORKITEM_PAYLOAD jsvu -g;$HELIX_WORKITEM_PAYLOAD/bin/jsvu --os=linux64 --engines=v8;export PERFLAB_UPLOAD_TOKEN="$(PerfCommandUploadTokenLinux)"' - ExtraMSBuildLogsWindows: 'set MSBUILDDEBUGCOMM=1;set "MSBUILDDEBUGPATH=%HELIX_WORKITEM_UPLOAD_ROOT%"' - ExtraMSBuildLogsLinux: 'export MSBUILDDEBUGCOMM=1;export "MSBUILDDEBUGPATH=$HELIX_WORKITEM_UPLOAD_ROOT"' - HelixPreCommand: '' @@ -71,7 +73,7 @@ jobs: - ${{ if eq( parameters.osGroup, 'Windows_NT') }}: - HelixPreCommand: $(ExtraMSBuildLogsWindows) - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: - - HelixPreCommand: $(ExtraMSBuildLogsLinux) + - HelixPreCommand: $(ExtraMSBuildLogsLinux);npm install --prefix $HELIX_WORKITEM_PAYLOAD jsvu -g;$HELIX_WORKITEM_PAYLOAD/bin/jsvu --os=linux64 --engines=v8 - ${{ if and(eq(parameters.codeGenType, 'Interpreter'), eq(parameters.runtimeType, 'mono')) }}: @@ -90,6 +92,7 @@ jobs: - HelixPreCommand: 'export MONO_ENV_OPTIONS="--interpreter";$(ExtraMSBuildLogsLinux)' - Interpreter: ' --monointerpreter' + workspace: clean: all pool: @@ -102,24 +105,16 @@ jobs: _Framework: ${{ framework }} steps: - ${{ parameters.steps }} - - powershell: $(Build.SourcesDirectory)\eng\common\performance\performance-setup.ps1 $(IsInternal)$(Interpreter) -Framework $(_Framework) ${{ parameters.extraSetupParameters }} + - powershell: $(Build.SourcesDirectory)\eng\common\performance\performance-setup.ps1 $(IsInternal)$(Interpreter) -Framework $(_Framework) -Kind ${{ parameters.runKind }} ${{ parameters.extraSetupParameters }} displayName: Performance Setup (Windows) condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - - script: $(Build.SourcesDirectory)/eng/common/performance/performance-setup.sh $(IsInternal)$(Interpreter) --framework $(_Framework) ${{ parameters.extraSetupParameters }} + - script: $(Build.SourcesDirectory)/eng/common/performance/performance-setup.sh $(IsInternal)$(Interpreter) --framework $(_Framework) --kind ${{ parameters.runKind }} ${{ parameters.extraSetupParameters }} displayName: Performance Setup (Unix) condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - script: $(Python) $(PerformanceDirectory)/scripts/ci_setup.py $(SetupArguments) displayName: Run ci setup script - - script: xcopy $(PerformanceDirectory)\scripts $(WorkItemDirectory)\ScenarioCorrelation\scripts\/e && xcopy $(PerformanceDirectory)\src\scenarios\shared $(WorkItemDirectory)\ScenarioCorrelation\shared\/e && xcopy $(PerformanceDirectory)\src\scenarios\staticdeps $(WorkItemDirectory)\ScenarioCorrelation\staticdeps\/e - displayName: Copy scenario support files - condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) - - script: $(PerformanceDirectory)\tools\dotnet\$(Architecture)\dotnet publish -c Release -o $(WorkItemDirectory)\ScenarioCorrelation\Startup -f netcoreapp3.1 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\Startup\Startup.csproj - displayName: Build scenario tools - env: - PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1 - condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) # Run perf testing in helix - template: /eng/common/templates/steps/perf-send-to-helix.yml parameters: @@ -132,10 +127,12 @@ jobs: WorkItemTimeout: 4:00 # 4 hours WorkItemDirectory: '$(WorkItemDirectory)' # WorkItemDirectory can not be empty, so we send it some docs to keep it happy CorrelationPayloadDirectory: '$(PayloadDirectory)' # it gets checked out to a folder with shorter path than WorkItemDirectory so we can avoid file name too long exceptions + ProjectFile: ${{ parameters.projectFile }} + osGroup: ${{ parameters.osGroup }} - task: PublishPipelineArtifact@1 displayName: Publish Logs inputs: targetPath: $(Build.SourcesDirectory)/artifacts/log - artifactName: 'Performance_Run_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.runtimeType }}_${{ parameters.codeGenType }}' + artifactName: 'Performance_Run_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.runtimeType }}_${{ parameters.codeGenType }}_${{ parameters.runKind }}' continueOnError: true condition: always() diff --git a/eng/pipelines/coreclr/templates/run-scenarios-job.yml b/eng/pipelines/coreclr/templates/run-scenarios-job.yml new file mode 100644 index 000000000000..84451af18576 --- /dev/null +++ b/eng/pipelines/coreclr/templates/run-scenarios-job.yml @@ -0,0 +1,163 @@ +parameters: + steps: [] # optional -- any additional steps that need to happen before pulling down the performance repo and sending the performance benchmarks 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 + extraSetupParameters: '' # optional -- extra arguments to pass to the setup script + frameworks: ['netcoreapp3.0'] # optional -- list of frameworks to run against + continueOnError: 'false' # optional -- determines whether to continue the build if the step errors + dependsOn: '' # optional -- dependencies of the job + timeoutInMinutes: 320 # optional -- timeout for the job + enableTelemetry: false # optional -- enable for telemetry + liveLibrariesBuildConfig: '' # optional -- live-live libraries configuration to use for the run + runtimeType: 'coreclr' # optional -- Sets the runtime as coreclr or mono + codeGenType: 'JIT' # optional -- Decides on the codegen technology if running on mono + projectFile: '' # required -- project file to build helix workitems + runKind: '' # required -- test category + additionalSetupParameters: '' # optional -- additional setup parameters that are job-specific + +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 }} + + ${{ if ne(parameters.displayName, '') }}: + displayName: '${{ parameters.displayName }}' + ${{ if eq(parameters.displayName, '') }}: + displayName: '${{ parameters.jobName }}' + + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + + variables: + - ${{ each variable in parameters.variables }}: + - ${{ if ne(variable.name, '') }}: + - name: ${{ variable.name }} + value: ${{ variable.value }} + - ${{ if ne(variable.group, '') }}: + - group: ${{ variable.group }} + + - IsInternal: '' + - HelixApiAccessToken: '' + - SharedHelixPreCommands: '' + - AdditionalHelixPreCommands: '' + # run machine-setup and set PYTHONPATH for both public and private jobs + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - SharedHelixPreCommands: 'call %HELIX_WORKITEM_PAYLOAD%\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD%' + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - SharedHelixPreCommands: 'chmod +x $HELIX_WORKITEM_PAYLOAD/machine-setup.sh;. $HELIX_WORKITEM_PAYLOAD/machine-setup.sh;export PYTHONPATH=$HELIX_WORKITEM_PAYLOAD/scripts:$HELIX_WORKITEM_PAYLOAD' + + # extra private job settings + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - AdditionalHelixPreCommands: 'py -3 -m venv %HELIX_WORKITEM_PAYLOAD%\.venv;call %HELIX_WORKITEM_PAYLOAD%\.venv\Scripts\activate.bat;set PYTHONPATH=;py -3 -m pip install --user azure.storage.blob==12.0.0 --force-reinstall;py -3 -m pip install --user azure.storage.queue==12.0.0 --force-reinstall;set "PERFLAB_UPLOAD_TOKEN=$(PerfCommandUploadToken)"' + - IsInternal: -Internal + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - AdditionalHelixPreCommands: 'sudo apt-get -y install python3-venv;python3 -m venv $HELIX_WORKITEM_PAYLOAD/.venv;source $HELIX_WORKITEM_PAYLOAD/.venv/Scripts/activate;export PYTHONPATH=;pip3 install --user azure.storage.blob==12.0.0 --force-reinstall;pip3 install --user azure.storage.queue==12.0.0 --force-reinstall;export PERFLAB_UPLOAD_TOKEN="$(PerfCommandUploadTokenLinux)"' + - IsInternal: --internal + - group: DotNet-HelixApi-Access + - group: dotnet-benchview + + workspace: + clean: all + pool: + ${{ parameters.pool }} + container: ${{ parameters.container }} + strategy: + matrix: + ${{ each framework in parameters.frameworks }}: + ${{ framework }}: + _Framework: ${{ framework }} + steps: + - ${{ parameters.steps }} + # run performance-setup + - powershell: $(Build.SourcesDirectory)\eng\common\performance\performance-setup.ps1 $(IsInternal) -Framework $(_Framework) -Kind ${{ parameters.runKind }} ${{ parameters.extraSetupParameters }} ${{ parameters.additionalSetupParameters }} + displayName: Performance Setup (Windows) + condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $(Build.SourcesDirectory)/eng/common/performance/performance-setup.sh $(IsInternal) --framework $(_Framework) --kind ${{ parameters.runKind }} ${{ parameters.extraSetupParameters }} ${{ parameters.additionalSetupParameters }} + displayName: Performance Setup (Linux) + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + # parse Version.props to get the latest stable sdk version on master + - script: $(Python) scripts/parse_props.py --branch-name master # defaults to master branch of sdk so we can get the latest + displayName: Parse Version.props + workingDirectory: $(PerformanceDirectory) + continueOnError: ${{ parameters.continueOnError }} + # run ci-setup + - script: $(Python) $(PerformanceDirectory)\scripts\ci_setup.py $(DotnetVersion) $(SetupArguments) --install-dir $(PayloadDirectory)\dotnet --output-file $(WorkItemDirectory)\machine-setup.cmd + displayName: Run ci setup script (Windows) + condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) + - script: $(Python) $(PerformanceDirectory)/scripts/ci_setup.py $(DotnetVersion) $(SetupArguments) --install-dir $(PayloadDirectory)/dotnet --output-file $(WorkItemDirectory)/machine-setup.sh + displayName: Run ci setup script (Linux) + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) + # copy wasm packs if running on wasm + - script: cp -r $(librariesDownloadDir)/BrowserWasm/artifacts/bin/microsoft.netcore.app.runtime.browser-wasm $(PayloadDirectory);cp -r $(librariesDownloadDir)/BrowserWasm/artifacts/bin/microsoft.netcore.app.ref $(PayloadDirectory) + displayName: Copy browserwasm and runtime ref packs + condition: and(succeeded(), eq('${{ parameters.runtimeType }}', 'wasm')) + # copy scenario support files + - script: xcopy $(PerformanceDirectory)\scripts $(WorkItemDirectory)\scripts\/e && xcopy $(PerformanceDirectory)\src\scenarios\shared $(WorkItemDirectory)\shared\/e && xcopy $(PerformanceDirectory)\src\scenarios\staticdeps $(WorkItemDirectory)\staticdeps\/e + displayName: Copy scenario support files (Windows) + condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) + - script: cp -r $(PerformanceDirectory)/scripts $(WorkItemDirectory)/scripts/ && cp -r $(PerformanceDirectory)/src/scenarios/shared $(WorkItemDirectory)/shared/ && cp -r $(PerformanceDirectory)/src/scenarios/staticdeps/ $(WorkItemDirectory)/staticdeps/ + displayName: Copy scenario support files (Linux) + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) + # build Startup + - script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)\Startup -f netcoreapp3.1 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\Startup\Startup.csproj + displayName: Build Startup tool (Windows) + env: + PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1 + condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) + - script: $(PayloadDirectory)/dotnet/dotnet publish -c Release -o $(WorkItemDirectory)/startup -f netcoreapp3.1 -r linux-$(Architecture) $(PerformanceDirectory)/src/tools/ScenarioMeasurement/Startup/Startup.csproj + displayName: Build Startup tool (Linux) + env: + PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1 + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) + # build SizeOnDisk + - script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)SOD -f netcoreapp3.1 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\SizeOnDisk\SizeOnDisk.csproj + displayName: Build SizeOnDisk tool (Windows) + env: + PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1 + condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) + - script: $(PayloadDirectory)/dotnet/dotnet publish -c Release -o $(WorkItemDirectory)/SOD -f netcoreapp3.1 -r linux-$(Architecture) $(PerformanceDirectory)/src/tools/ScenarioMeasurement/SizeOnDisk/SizeOnDisk.csproj + displayName: Build SizeOnDisk tool (Linux) + env: + PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1 + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) + + # run perf testing in helix + - template: /eng/common/templates/steps/perf-send-to-helix.yml + parameters: + HelixSource: '$(HelixSourcePrefix)/$(Build.Repository.Name)/$(Build.SourceBranch)' # sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'test/performance/$(Kind)/$(_Framework)/$(Architecture)' + HelixAccessToken: $(HelixApiAccessToken) + HelixTargetQueues: $(Queue) + HelixPreCommands: '$(AdditionalHelixPreCommands);$(SharedHelixPreCommands)' # $(HelixPreCommands) should follow $(AdditionalHelixPreCommands) because PYTHONPATH is cleared by the former + Creator: $(Creator) + WorkItemTimeout: 4:00 # 4 hours + WorkItemDirectory: '$(WorkItemDirectory)' # contains scenario tools, shared python scripts, dotnet tool + CorrelationPayloadDirectory: '$(PayloadDirectory)' # contains performance repo and built product + ProjectFile: ${{ parameters.projectFile }} + osGroup: ${{ parameters.osGroup }} + + # publish logs + - task: PublishPipelineArtifact@1 + displayName: Publish Logs + inputs: + targetPath: $(Build.SourcesDirectory)/artifacts/log + artifactName: 'Performance_Run_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.runtimeType }}_${{ parameters.codeGenType }}_${{ parameters.runKind }}' + continueOnError: true + condition: always() diff --git a/eng/pipelines/coreclr/templates/run-superpmi-job.yml b/eng/pipelines/coreclr/templates/run-superpmi-job.yml new file mode 100644 index 000000000000..9f835a16b486 --- /dev/null +++ b/eng/pipelines/coreclr/templates/run-superpmi-job.yml @@ -0,0 +1,150 @@ +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 + extraSetupParameters: '' # optional -- extra arguments to pass to the setup script + frameworks: ['netcoreapp3.0'] # optional -- list of frameworks to run against + continueOnError: 'false' # optional -- determines whether to continue the build if the step errors + dependsOn: '' # optional -- dependencies of the job + timeoutInMinutes: 320 # optional -- timeout for the job + enableTelemetry: false # optional -- enable for telemetry + liveLibrariesBuildConfig: '' # optional -- live-live libraries configuration to use for the run + runtimeType: 'coreclr' # optional -- Sets the runtime as coreclr or mono + codeGenType: 'JIT' # optional -- Decides on the codegen technology if running on mono + projectFile: 'superpmi.proj' # optional -- project file to build helix workitems + runKind: '' # required -- test category + collectionName: '' + +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 }} + collectionName: ${{ parameters.collectionName }} + + ${{ if ne(parameters.displayName, '') }}: + displayName: '${{ parameters.displayName }}' + ${{ if eq(parameters.displayName, '') }}: + displayName: '${{ parameters.jobName }}' + + # tests collection takes longer so increase timeout to 8 hours + ${{ if eq(parameters.collectionName, 'tests') }}: + timeoutInMinutes: 480 + ${{ if ne(parameters.collectionName, 'tests') }}: + timeoutInminutes: ${{ parameters.timeoutInMinutes }} + + variables: + + - ${{ each variable in parameters.variables }}: + - ${{ if ne(variable.name, '') }}: + - name: ${{ variable.name }} + value: ${{ variable.value }} + - ${{ if ne(variable.group, '') }}: + - group: ${{ variable.group }} + + - HelixApiAccessToken: '' + - HelixPreCommand: '' + - MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}' + - CollectionName: ${{ parameters.collectionName }} + + - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: + - name: PythonScript + value: 'py -3' + - name: PipScript + value: 'py -3 -m pip' + - name: Core_Root_Dir + value: '$(Build.SourcesDirectory)\artifacts\tests\coreclr\${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}\Tests\Core_Root' + - name: MchFilesLocation + value: '$(Build.SourcesDirectory)\artifacts\helixresults\' + - ${{ if ne(parameters.osGroup, 'Windows_NT') }}: + - name: PythonScript + value: 'python3' + - name: PipScript + value: 'pip3' + - name: Core_Root_Dir + value: '$(Build.SourcesDirectory)/artifacts/tests/coreclr/${{ parameters.osGroup }}.${{ parameters.archType }}.$(buildConfigUpper)/Tests/Core_Root' + - name: MchFilesLocation + value: '$(Build.SourcesDirectory)/artifacts/helixresults/' + - ${{ if eq(parameters.collectionName, 'libraries') }}: + - name: InputDirectory + value: '$(Core_Root_Dir)' + - ${{ if eq(parameters.collectionName, 'tests') }}: + - name: InputDirectory + value: '$(managedTestArtifactRootFolderPath)' + workspace: + clean: all + pool: + ${{ parameters.pool }} + container: ${{ parameters.container }} + strategy: + matrix: + ${{ each framework in parameters.frameworks }}: + ${{ framework }}: + _Framework: ${{ framework }} + steps: + - ${{ parameters.steps }} + + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi-setup.py -source_directory $(Build.SourcesDirectory) -core_root_directory $(Core_Root_Dir) -arch $(archType) -mch_file_tag $(MchFileTag) -input_directory $(InputDirectory) -collection_name $(CollectionName) -max_size 50 # size in MB + displayName: ${{ format('SuperPMI setup ({0})', parameters.osGroup) }} + + # Run superpmi collection in helix + - template: /eng/pipelines/coreclr/templates/superpmi-send-to-helix.yml + parameters: + HelixSource: '$(HelixSourcePrefix)/$(Build.Repository.Name)/$(Build.SourceBranch)' # sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'test/superpmi/$(Kind)/$(_Framework)/$(Architecture)' + HelixAccessToken: $(HelixApiAccessToken) + HelixTargetQueues: $(Queue) + HelixPreCommands: $(HelixPreCommand) + Creator: $(Creator) + WorkItemTimeout: 4:00 # 4 hours + WorkItemDirectory: '$(WorkItemDirectory)' + CorrelationPayloadDirectory: '$(CorrelationPayloadDirectory)' + ProjectFile: ${{ parameters.projectFile }} + BuildConfig: ${{ parameters.buildConfig }} + osGroup: ${{ parameters.osGroup }} + InputArtifacts: '$(InputArtifacts)' + CollectionName: '$(CollectionName)' + + - task: PublishPipelineArtifact@1 + displayName: Publish SuperPMI collection + inputs: + targetPath: $(Build.SourcesDirectory)/artifacts/helixresults + artifactName: 'SuperPMI_Result_$(CollectionName)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.runtimeType }}_${{ parameters.codeGenType }}' + continueOnError: true + condition: always() + + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py merge-mch -pattern $(MchFilesLocation)$(CollectionName).pmi*.mch -output_mch_path $(MchFilesLocation)$(CollectionName).pmi.$(MchFileTag).mch + displayName: ${{ format('Merge {0} SuperPMI collections', parameters.collectionName) }} + continueOnError: true + condition: always() + + # For now, we won't upload merged collection as an artifact. + + - script: $(PythonScript) $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.py upload -arch $(archType) -build_type $(buildConfig) -mch_files $(MchFilesLocation)$(CollectionName).pmi.$(MchFileTag).mch -core_root $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper) + displayName: ${{ format('Upload SuperPMI {0} collection to Azure Storage', parameters.collectionName) }} + env: + CLRJIT_AZ_KEY: $(clrjit_key1) # secret key stored as variable in pipeline + continueOnError: true + condition: always() + + - task: PublishPipelineArtifact@1 + displayName: Publish Logs + inputs: + targetPath: $(Build.SourcesDirectory)/artifacts/log + artifactName: 'SuperPMI_Logs_$(CollectionName)_$(osGroup)$(osSubgroup)_$(archType)_$(buildConfig)_${{ parameters.runtimeType }}_${{ parameters.codeGenType }}_${{ parameters.runKind }}' + continueOnError: true + condition: always() \ No newline at end of file diff --git a/eng/pipelines/coreclr/templates/superpmi-job.yml b/eng/pipelines/coreclr/templates/superpmi-job.yml new file mode 100644 index 000000000000..7bdd114647fc --- /dev/null +++ b/eng/pipelines/coreclr/templates/superpmi-job.yml @@ -0,0 +1,103 @@ +parameters: + buildConfig: '' + archType: '' + osGroup: '' + osSubgroup: '' + container: '' + runtimeVariant: '' + testGroup: '' + framework: net5.0 # Specify the appropriate framework when running release branches (ie netcoreapp3.0 for release/3.0) + liveLibrariesBuildConfig: '' + variables: {} + runtimeType: 'coreclr' + pool: '' + codeGenType: 'JIT' + projetFile: '' + runKind: '' + runJobTemplate: '/eng/pipelines/coreclr/templates/run-superpmi-job.yml' + additionalSetupParameters: '' + collectionName: '' + +### SuperPMI job + +### Each superpmi job depends on a corresponding build job with the same +### buildConfig and archType. + +jobs: +- template: ${{ parameters.runJobTemplate }} + parameters: + # Compute job name from template parameters + jobName: ${{ format('superpmibuild_{0}{1}_{2}_{3}_{4}_{5}_{6}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.runtimeType, parameters.codeGenType, parameters.runKind) }} + displayName: ${{ format('SuperPMI {7} {0}{1} {2} {3} {4} {5} {6}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.runtimeType, parameters.codeGenType, parameters.runKind, parameters.collectionName) }} + pool: ${{ parameters.pool }} + buildConfig: ${{ parameters.buildConfig }} + archType: ${{ parameters.archType }} + osGroup: ${{ parameters.osGroup }} + osSubgroup: ${{ parameters.osSubgroup }} + runtimeVariant: ${{ parameters.runtimeVariant }} + liveLibrariesBuildConfig: ${{ parameters.liveLibrariesBuildConfig }} + runtimeType: ${{ parameters.runtimeType }} + codeGenType: ${{ parameters.codeGenType }} + projectFile: ${{ parameters.projectFile }} + runKind: ${{ parameters.runKind }} + testGroup: ${{ parameters.testGroup }} + collectionName: ${{ parameters.collectionName }} + additionalSetupParameters: ${{ parameters.additionalSetupParameters }} + # Test job depends on the corresponding build job + dependsOn: + - ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} + # Depend on coreclr x64 so we can download it and use mcs.exe from it while publishing non-x64 arch SPMI collection + - ${{ if ne(parameters.archType, 'x64') }}: + - ${{ format('coreclr_{0}_product_build_{1}{2}_x64_{3}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.buildConfig) }} + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveLibrariesBuildConfig) }} + - ${{ if eq(parameters.collectionName, 'tests') }}: + - '${{ parameters.runtimeType }}_common_test_build_p1_AnyOS_AnyCPU_${{parameters.buildConfig }}' + + variables: ${{ parameters.variables }} + + frameworks: + - ${{ parameters.framework }} + steps: + # Extra steps that will be passed to the superpmi template and run before sending the job to helix (all of which is done in the template) + + # Optionally download live-built libraries + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(librariesDownloadDir) + cleanUnpackFolder: false + artifactFileName: '$(librariesBuildArtifactName)$(archiveExtension)' + artifactName: '$(librariesBuildArtifactName)' + displayName: 'live-built libraries' + + # Download coreclr + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: $(buildProductRootFolderPath) + artifactFileName: '$(buildProductArtifactName)$(archiveExtension)' + artifactName: '$(buildProductArtifactName)' + displayName: 'Coreclr product build' + + # Download x64 coreclr if running on non-x64 configuration + - ${{ if ne(parameters.archType, 'x64') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: '$(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).x64.$(buildConfigUpper)' + artifactFileName: 'CoreCLRProduct_${{ parameters.runtimeVariant }}_$(osGroup)$(osSubgroup)_x64_$(buildConfig)$(archiveExtension)' + artifactName: 'CoreCLRProduct_${{ parameters.runtimeVariant }}_$(osGroup)$(osSubgroup)_x64_$(buildConfig)' + displayName: 'Coreclr product build (x64)' + + # # Download and unzip managed test artifacts + - ${{ if eq(parameters.collectionName, 'tests') }}: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + unpackFolder: '$(managedTestArtifactRootFolderPath)' + artifactFileName: '$(managedGenericTestArtifactName).tar.gz' + artifactName: '$(managedGenericTestArtifactName)' + displayName: 'generic managed test artifacts' + + # Create Core_Root + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(buildConfig) $(archType) generatelayoutonly $(librariesOverrideArg) + displayName: Create Core_Root + condition: succeeded() diff --git a/eng/pipelines/coreclr/templates/superpmi-send-to-helix.yml b/eng/pipelines/coreclr/templates/superpmi-send-to-helix.yml new file mode 100644 index 000000000000..5fad5f723f6e --- /dev/null +++ b/eng/pipelines/coreclr/templates/superpmi-send-to-helix.yml @@ -0,0 +1,53 @@ +# Please remember to update the documentation if you make changes to these parameters! +parameters: + HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' + HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number + HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues + HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group + HelixPreCommands: '' # optional -- commands to run before Helix work item execution + HelixPostCommands: '' # optional -- commands to run after Helix work item execution + WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects + CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload + IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion + DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control + WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." + Creator: '' # optional -- if the build is external, use this to specify who is sending the job + DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO + condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() + continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false + BuildConfig: 'checked' # optional -- Mostly, superpmi will be run on checked builds + InputArtifacts: '' + CollectionName: '' + +steps: +- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml + parameters: + osGroup: ${{ parameters.osGroup }} + sendParams: $(Build.SourcesDirectory)/src/coreclr/scripts/superpmi.proj /restore /t:Test /bl:$(Build.SourcesDirectory)/artifacts/log/$(BuildConfig)/SendToHelix.binlog + displayName: ${{ parameters.DisplayNamePrefix }} + condition: ${{ parameters.condition }} + continueOnError: ${{ parameters.continueOnError }} + environment: + MchFileTag: $(MchFileTag) + BuildConfig: ${{ parameters.BuildConfig }} + InputArtifacts: ${{ parameters.InputArtifacts }} + CollectionName: ${{ parameters.CollectionName }} + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) \ No newline at end of file diff --git a/eng/pipelines/coreclr/templates/xplat-job.yml b/eng/pipelines/coreclr/templates/xplat-job.yml index 7f03b78d162f..7dde73e23b25 100644 --- a/eng/pipelines/coreclr/templates/xplat-job.yml +++ b/eng/pipelines/coreclr/templates/xplat-job.yml @@ -6,6 +6,7 @@ parameters: name: '' helixType: '(unspecified)' container: '' + crossBuild: false crossrootfsDir: '' stagedBuild: false strategy: '' @@ -91,12 +92,11 @@ jobs: - name: _HelixSource value: ci/dotnet/runtime/$(Build.SourceBranch) - - ${{ if ne(parameters.crossrootfsDir, '') }}: + - name: crossArg + value: '' + - ${{ if eq(parameters.crossBuild, true) }}: - name: crossArg value: '-cross' - - ${{ if eq(parameters.crossrootfsDir, '') }}: - - name: crossArg - value: '' - ${{ each variable in parameters.variables }}: - ${{insert}}: ${{ variable }} diff --git a/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml b/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml index 0e789b84e919..ad5088d8999b 100644 --- a/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml +++ b/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml @@ -7,6 +7,7 @@ parameters: helixType: '(unspecified)' container: '' testGroup: '' + crossBuild: false crossrootfsDir: '' liveLibrariesBuildConfig: '' stagedBuild: false @@ -34,6 +35,7 @@ jobs: name: ${{ parameters.name }} helixType: ${{ parameters.helixType }} container: ${{ parameters.container }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossrootfsDir }} stagedBuild: ${{ parameters.stagedBuild }} strategy: ${{ parameters.strategy }} @@ -57,12 +59,6 @@ jobs: - name: testArtifactRootName value: ${{ parameters.Group }}${{ parameters.Subgroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }} - - name: coreClrRepoRoot - value: '$(Build.SourcesDirectory)/src/coreclr' - - - name: coreClrRepoRootDir - value: '$(coreClrRepoRoot)$(dir)' - - name: binTestsPath value: '$(Build.SourcesDirectory)/artifacts/tests/coreclr' diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index b74bf18fb60c..a769413019d6 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -4,12 +4,15 @@ parameters: archType: '' osSubgroup: '' platform: '' + crossBuild: false crossrootfsDir: '' timeoutInMinutes: 120 condition: true container: '' buildSteps: [] dependsOn: [] + dependsOnGlobalBuild: false + globalBuildSuffix: '' variables: [] name: '' displayName: '' @@ -65,7 +68,7 @@ jobs: not(in(parameters.archType, 'x64', 'x86')), eq(parameters.runtimeFlavor, 'mono'), eq(parameters.isOfficialBuild, true), - ne(parameters.crossrootfsDir, '')) }} + eq(parameters.crossBuild, true)) }} - name: BuildAction value: -test @@ -128,13 +131,16 @@ jobs: /p:PortableBuild=true /p:SkipTests=$(SkipTests) /p:RuntimeFlavor=${{ parameters.runtimeFlavor }} + /p:TargetArchitecture=${{ parameters.archType }} + /p:CrossBuild=${{ parameters.crossBuild }} $(llvmParameter) - name: BaseJobBuildCommand value: >- - $(Build.SourcesDirectory)/build.sh -subset installer -ci + $(Build.SourcesDirectory)/build.sh -ci $(BuildAction) -configuration $(_BuildConfig) + -arch ${{ parameters.archType }} $(LiveOverridePathArgs) $(CommonMSBuildArgs) $(OfficialBuildArg) @@ -213,7 +219,7 @@ jobs: value: >- -subset installer -ci $(BuildAction) - /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }} + /p:CrossBuild=${{ parameters.crossBuild }} /p:PortableBuild=$(_PortableBuild) /p:SkipTests=$(SkipTests) $(LiveOverridePathArgs) @@ -332,26 +338,38 @@ jobs: dependsOn: - checkout - ${{ parameters.dependsOn }} - - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', - parameters.runtimeFlavor, - parameters.runtimeVariant, - parameters.osGroup, - parameters.osSubgroup, - parameters.archType, - parameters.liveRuntimeBuildConfig) }} - - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: - - libraries_build_${{ format('{0}{1}_{2}_{3}', - parameters.osGroup, - parameters.osSubgroup, - parameters.archType, - parameters.liveLibrariesBuildConfig) }} - - ${{ if eq(parameters.useOfficialAllConfigurations, true) }}: - - libraries_build_allconfigurations_Windows_NT_x64_Release - - ${{ if eq(parameters.buildFullPlatformManifest, true) }}: - - ${{ each platform in parameters.platforms }}: - - ${{ parameters.runtimeFlavor }}_${{ parameters.runtimeVariant }}_product_build_${{ platform }}_${{ parameters.liveRuntimeBuildConfig }} - - libraries_build_${{ platform }}_${{ parameters.liveLibrariesBuildConfig }} + - ${{ if eq(parameters.dependsOnGlobalBuild, false) }}: + - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: + - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', + parameters.runtimeFlavor, + parameters.runtimeVariant, + parameters.osGroup, + parameters.osSubgroup, + parameters.archType, + parameters.liveRuntimeBuildConfig) }} + - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: + - libraries_build_${{ format('{0}{1}_{2}_{3}', + parameters.osGroup, + parameters.osSubgroup, + parameters.archType, + parameters.liveLibrariesBuildConfig) }} + - ${{ if eq(parameters.useOfficialAllConfigurations, true) }}: + - libraries_build_allconfigurations_Windows_NT_x64_Release + - ${{ if eq(parameters.buildFullPlatformManifest, true) }}: + - ${{ each platform in parameters.platforms }}: + - ${{ parameters.runtimeFlavor }}_${{ parameters.runtimeVariant }}_product_build_${{ platform }}_${{ parameters.liveRuntimeBuildConfig }} + - libraries_build_${{ platform }}_${{ parameters.liveLibrariesBuildConfig }} + + - ${{ if eq(parameters.dependsOnGlobalBuild, true) }}: + - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: + - ${{ format('build_{0}{1}_{2}_{3}_{4}', + parameters.osGroup, + parameters.osSubgroup, + parameters.archType, + parameters.liveRuntimeBuildConfig, + parameters.globalBuildSuffix) }} + - ${{ if eq(parameters.useOfficialAllConfigurations, true) }}: + - build_Windows_NT_x64_${{ parameters.liveLibrariesBuildConfig }}_AllConfigurations steps: @@ -409,14 +427,14 @@ jobs: displayName: 'Unzip $(runtimeFlavorName) artifacts: ${{ platform }}' inputs: archiveFilePatterns: | - $(Build.SourcesDirectory)/__download__/AllPlatforms/$(runtimeFlavorName)Product_${{ platform }}_${{ parameters.liveRuntimeBuildConfig }}.* + $(Build.SourcesDirectory)/__download__/AllPlatforms/**/$(runtimeFlavorName)Product_${{ platform }}_${{ parameters.liveRuntimeBuildConfig }}.* destinationFolder: $(AllArtifactsDownloadPath)/$(runtimeFlavorName)Product_${{ platform }}_${{ parameters.liveRuntimeBuildConfig }}/ cleanUnpackFolder: false - task: ExtractFiles@1 displayName: 'Unzip Libraries artifacts: ${{ platform }}' inputs: archiveFilePatterns: | - $(Build.SourcesDirectory)/__download__/AllPlatforms/libraries_bin_${{ platform }}_${{ parameters.liveLibrariesBuildConfig }}.* + $(Build.SourcesDirectory)/__download__/AllPlatforms/**/libraries_bin_${{ platform }}_${{ parameters.liveLibrariesBuildConfig }}.* destinationFolder: $(AllArtifactsDownloadPath)/libraries_bin_${{ platform }}_${{ parameters.liveLibrariesBuildConfig }}/ cleanUnpackFolder: false @@ -448,7 +466,7 @@ jobs: cleanUnpackFolder: false - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO displayName: Install Build Dependencies - script: | @@ -456,8 +474,29 @@ jobs: df -h displayName: Disk Usage before Build - - script: $(BaseJobBuildCommand) - displayName: Build + # Build the default subset non-MacOS platforms + - ${{ if ne(parameters.osGroup, 'OSX') }}: + - script: $(BaseJobBuildCommand) + displayName: Build + + # Build corehost, sign and add entitlements to MacOS binaries + - ${{ if eq(parameters.osGroup, 'OSX') }}: + - script: $(BaseJobBuildCommand) -subset corehost + displayName: Build CoreHost + + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - template: /eng/pipelines/common/macos-sign-with-entitlements.yml + parameters: + filesToSign: + - name: dotnet + path: $(Build.SourcesDirectory)/artifacts/bin/osx-${{ parameters.archType }}.$(_BuildConfig)/corehost + entitlementsFile: $(Build.SourcesDirectory)/eng/pipelines/common/entitlements.plist + - name: apphost + path: $(Build.SourcesDirectory)/artifacts/bin/osx-${{ parameters.archType }}.$(_BuildConfig)/corehost + entitlementsFile: $(Build.SourcesDirectory)/eng/pipelines/common/entitlements.plist + + - script: $(BaseJobBuildCommand) -subset installer.nocorehost + displayName: Build and Package - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: - script: | diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml index bf5a9a2321fd..7a034f5ee4a2 100644 --- a/eng/pipelines/libraries/base-job.yml +++ b/eng/pipelines/libraries/base-job.yml @@ -3,8 +3,9 @@ parameters: osGroup: '' archType: '' osSubgroup: '' + crossBuild: false crossrootfsDir: '' - framework: '' + framework: 'net6.0' isOfficialAllConfigurations: false isSourceBuild: false liveRuntimeBuildConfig: '' @@ -25,10 +26,10 @@ parameters: jobs: - template: /eng/common/templates/job/job.yml parameters: - ${{ if notIn(parameters.framework, 'allConfigurations', 'net472') }}: + ${{ if notIn(parameters.framework, 'allConfigurations', 'net48') }}: displayName: ${{ format('Libraries {0} {1}{2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} name: ${{ format('libraries_{0}_{1}{2}_{3}_{4}', parameters.name, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} - ${{ if in(parameters.framework, 'allConfigurations', 'net472') }}: + ${{ if in(parameters.framework, 'allConfigurations', 'net48') }}: displayName: ${{ format('Libraries {0} {1} {2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }} name: ${{ format('libraries_{0}_{1}_{2}{3}_{4}_{5}', parameters.name, parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} @@ -56,8 +57,8 @@ jobs: - ${{ if ne(parameters.testScope, '') }}: - _testScopeArg: -testscope ${{ parameters.testScope }} - - ${{ if in(parameters.osGroup, 'Linux', 'FreeBSD') }}: - - _crossBuildPropertyArg: /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }} + - ${{ if eq(parameters.crossBuild, true) }}: + - _crossBuildPropertyArg: /p:CrossBuild=true - ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, '_musl')) }}: - _runtimeOSArg: /p:RuntimeOS=linux-musl diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index f4b02cf06215..d21a511d148a 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -3,8 +3,10 @@ parameters: osGroup: '' osSubgroup: '' archType: '' + targetRid: '' + crossBuild: false crossrootfsDir: '' - framework: '' + framework: 'net6.0' isOfficialBuild: false isOfficialAllConfigurations: false runtimeVariant: '' @@ -35,6 +37,7 @@ jobs: osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} archType: ${{ parameters.archType }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossrootfsDir }} framework: ${{ parameters.framework }} isOfficialBuild: ${{ parameters.isOfficialBuild }} @@ -62,10 +65,8 @@ jobs: - _subset: libs - _additionalBuildArguments: '' - ${{ parameters.variables }} - - ${{ if eq(parameters.osGroup, 'Browser') }}: - - EMSDK_PATH: /usr/local/emscripten - # Tests only run for 'allConfiguration' and 'net472' build-jobs + # Tests only run for 'allConfiguration' and 'net48' build-jobs # If platform is in testBuildPlatforms we build tests as well. - ${{ if or(eq(parameters.runTests, true), containsValue(parameters.testBuildPlatforms, parameters.platform)) }}: - _subset: libs+libs.tests @@ -78,7 +79,7 @@ jobs: - template: /eng/pipelines/common/restore-internal-tools.yml - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO displayName: Install Build Dependencies - script: | @@ -136,6 +137,7 @@ jobs: - template: /eng/pipelines/libraries/helix.yml parameters: osGroup: ${{ parameters.osGroup }} + targetRid: ${{ parameters.targetRid }} archType: ${{ parameters.archType }} buildConfig: ${{ parameters.buildConfig }} helixQueues: ${{ parameters.helixQueues }} diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 58d1f89fe3c0..c0e13a2ca68e 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -49,26 +49,34 @@ jobs: # Linux x64 - ${{ if eq(parameters.platform, 'Linux_x64') }}: - ${{ if eq(parameters.jobParameters.interpreter, '') }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: + - ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - Centos.7.Amd64.Open - RedHat.7.Amd64.Open - - Debian.9.Amd64.Open - - Ubuntu.1604.Amd64.Open - - Ubuntu.1804.Amd64.Open - - SLES.12.Amd64.Open - SLES.15.Amd64.Open - - (Fedora.30.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-30-helix-20200512010621-4f8cef7 - (Fedora.32.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-32-helix-20200512010618-efb9f14 - (Ubuntu.1910.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-19.10-helix-amd64-cfcfd50-20191030180623 - (Debian.10.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-bfcd90a-20200121150006 - - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: - - Centos.7.Amd64.Open - - RedHat.7.Amd64.Open - - Debian.9.Amd64.Open - - Ubuntu.1604.Amd64.Open - - Ubuntu.1804.Amd64.Open - - SLES.15.Amd64.Open - - (Fedora.30.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-30-helix-20200512010621-4f8cef7 + - ${{ if or(ne(parameters.jobParameters.testScope, 'outerloop'), ne(parameters.jobParameters.runtimeFlavor, 'mono')) }}: + - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: + - Centos.7.Amd64.Open + - RedHat.7.Amd64.Open + - Debian.9.Amd64.Open + - Ubuntu.1604.Amd64.Open + - Ubuntu.1804.Amd64.Open + - SLES.12.Amd64.Open + - SLES.15.Amd64.Open + - (Fedora.30.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-30-helix-20200512010621-4f8cef7 + - (Fedora.32.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-32-helix-20200512010618-efb9f14 + - (Ubuntu.1910.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-19.10-helix-amd64-cfcfd50-20191030180623 + - (Debian.10.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-bfcd90a-20200121150006 + - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: + - Centos.7.Amd64.Open + - RedHat.7.Amd64.Open + - (Debian.10.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-10-helix-amd64-bfcd90a-20200121150006 + - Ubuntu.1604.Amd64.Open + - Ubuntu.1804.Amd64.Open + - SLES.15.Amd64.Open + - (Fedora.30.Amd64.Open)ubuntu.1604.amd64.open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-30-helix-20200512010621-4f8cef7 - ${{ if eq(parameters.jobParameters.interpreter, 'true') }}: # Limiting interp runs as we don't need as much coverage. - Debian.9.Amd64.Open @@ -78,31 +86,44 @@ jobs: - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: - OSX.1013.Amd64.Open - OSX.1014.Amd64.Open - # The 10.15 machines aren't in the same configuration, see - # https://github.com/dotnet/runtime/issues/24736 - #- OSX.1015.Amd64.Open + - OSX.1015.Amd64.Open - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: - - OSX.1013.Amd64.Open - OSX.1014.Amd64.Open + - OSX.1015.Amd64.Open + + # Android + - ${{ if in(parameters.platform, 'Android_x86', 'Android_x64') }}: + - Ubuntu.1804.Amd64.Android.Open + - ${{ if in(parameters.platform, 'Android_arm', 'Android_arm64') }}: + - Windows.10.Amd64.Android.Open + + # iOS x64/x86 + - ${{ if in(parameters.platform, 'iOS_x64', 'iOS_x86') }}: + - OSX.1015.Amd64.Open # Windows_NT x64 - ${{ if eq(parameters.platform, 'Windows_NT_x64') }}: # netcoreapp - - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net472') }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: + - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net48') }}: + - ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - Windows.81.Amd64.Open - - Windows.10.Amd64.ServerRS5.Open - Windows.10.Amd64.Server19H1.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 - - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: - - Windows.81.Amd64.Open - - Windows.10.Amd64.Server19H1.ES.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 + - ${{ if or(ne(parameters.jobParameters.testScope, 'outerloop'), ne(parameters.jobParameters.runtimeFlavor, 'mono')) }}: + - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: + - Windows.81.Amd64.Open + - Windows.10.Amd64.ServerRS5.Open + - Windows.10.Amd64.Server19H1.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 + - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: + - Windows.81.Amd64.Open + - Windows.10.Amd64.Server19H1.ES.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 - # NET472 - - ${{ if eq(parameters.jobParameters.framework, 'net472') }}: + # .NETFramework + - ${{ if eq(parameters.jobParameters.framework, 'net48') }}: - Windows.10.Amd64.Client19H1.Open # AllConfigurations @@ -112,20 +133,24 @@ jobs: # Windows_NT x86 - ${{ if eq(parameters.platform, 'Windows_NT_x86') }}: # netcoreapp - - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net472') }}: - - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: + - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net48') }}: + - ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}: - Windows.7.Amd64.Open - Windows.10.Amd64.ServerRS5.Open - - Windows.10.Amd64.Server19H1.Open - - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: - - ${{ if eq(parameters.jobParameters.buildConfig, 'Release') }}: - - Windows.10.Amd64.Server19H1.ES.Open - - ${{ if eq(parameters.jobParameters.buildConfig, 'Debug') }}: + - ${{ if or(ne(parameters.jobParameters.testScope, 'outerloop'), ne(parameters.jobParameters.runtimeFlavor, 'mono')) }}: + - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}: - Windows.7.Amd64.Open + - Windows.10.Amd64.ServerRS5.Open - Windows.10.Amd64.Server19H1.Open + - ${{ if eq(parameters.jobParameters.isFullMatrix, false) }}: + - ${{ if eq(parameters.jobParameters.buildConfig, 'Release') }}: + - Windows.10.Amd64.Server19H1.ES.Open + - ${{ if eq(parameters.jobParameters.buildConfig, 'Debug') }}: + - Windows.7.Amd64.Open + - Windows.10.Amd64.Server19H1.Open - # NET472 - - ${{ if eq(parameters.jobParameters.framework, 'net472') }}: + # .NETFramework + - ${{ if eq(parameters.jobParameters.framework, 'net48') }}: - Windows.10.Amd64.Client19H1.Open # Windows_NT arm diff --git a/eng/pipelines/libraries/helix.yml b/eng/pipelines/libraries/helix.yml index c0c5873d297d..02f2086a1a47 100644 --- a/eng/pipelines/libraries/helix.yml +++ b/eng/pipelines/libraries/helix.yml @@ -5,6 +5,7 @@ parameters: creator: '' helixQueues: '' osGroup: '' + targetRid: '' testRunNamePrefixSuffix: '' testScope: 'innerloop' # innerloop | outerloop | all interpreter: '' @@ -17,6 +18,7 @@ steps: $(Build.SourcesDirectory)/src/libraries/sendtohelix.proj /p:RuntimeFlavor=${{ parameters.runtimeFlavor }} /p:TargetArchitecture=${{ parameters.archType }} + /p:TargetRuntimeIdentifier=${{ parameters.targetRid }} /p:Configuration=${{ parameters.buildConfig }} /p:TargetOS=${{ parameters.osGroup }} /p:MonoEnableInterpreter=${{ parameters.interpreter }} diff --git a/eng/pipelines/libraries/outerloop-mono.yml b/eng/pipelines/libraries/outerloop-mono.yml new file mode 100644 index 000000000000..a7eb7dfe3afd --- /dev/null +++ b/eng/pipelines/libraries/outerloop-mono.yml @@ -0,0 +1,69 @@ +trigger: none + +# Disabled until we get the build clean +# schedules: +# - cron: "0 8 * * *" # 8 AM UTC => 12 AM PST +# displayName: Outerloop scheduled build +# branches: +# include: +# - master +# - release/*.* + +variables: + - template: variables.yml + +jobs: + - template: /eng/pipelines/common/checkout-job.yml + + - 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_NT_x86 + - Browser_wasm + - ${{ if eq(variables['isFullMatrix'], true) }}: + - Windows_NT_x64 + - Linux_x64 + - Linux_arm + - Linux_musl_x64 + - OSX_x64 + jobParameters: + testScope: outerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true + timeoutInMinutes: 120 + isFullMatrix: ${{ variables['isFullMatrix'] }} + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + testScope: outerloop + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + + - ${{ if eq(variables['isFullMatrix'], false) }}: + - 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: Debug + runtimeFlavor: mono + platforms: + - Windows_NT_x64 + - Linux_x64 + - Linux_musl_x64 + - OSX_x64 + jobParameters: + testScope: outerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true + timeoutInMinutes: 120 + isFullMatrix: ${{ variables['isFullMatrix'] }} + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + testScope: outerloop + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) diff --git a/eng/pipelines/libraries/outerloop.yml b/eng/pipelines/libraries/outerloop.yml index 9afbf206e5f3..1718d174bf85 100644 --- a/eng/pipelines/libraries/outerloop.yml +++ b/eng/pipelines/libraries/outerloop.yml @@ -99,6 +99,6 @@ jobs: jobParameters: isOfficialBuild: ${{ variables['isOfficialBuild'] }} isFullMatrix: ${{ variables['isFullMatrix'] }} - framework: net472 + framework: net48 runTests: true - testScope: outerloop \ No newline at end of file + testScope: outerloop diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml index 6c5e397d4dd0..e0f0e1e91196 100644 --- a/eng/pipelines/libraries/run-test-job.yml +++ b/eng/pipelines/libraries/run-test-job.yml @@ -3,7 +3,8 @@ parameters: osGroup: '' osSubgroup: '' archType: '' - framework: '' + targetRid: '' + framework: 'net6.0' isOfficialBuild: false liveRuntimeBuildConfig: '' runtimeFlavor: 'coreclr' @@ -55,7 +56,7 @@ jobs: - ${{ if ne(parameters.dependsOn[0], '') }}: - ${{ parameters.dependsOn }} - ${{ if eq(parameters.dependsOn[0], '') }}: - - ${{ if notIn(parameters.framework, 'allConfigurations', 'net472') }}: + - ${{ if notIn(parameters.framework, 'allConfigurations', 'net48') }}: - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} # tests are built as part of product build - ${{ if or(ne(parameters.archType, parameters.dependsOnTestArchitecture), ne(parameters.buildConfig, parameters.dependsOnTestBuildConfiguration)) }}: @@ -113,6 +114,7 @@ jobs: parameters: runtimeFlavor: ${{ parameters.runtimeFlavor }} osGroup: ${{ parameters.osGroup }} + targetRid: ${{ parameters.targetRid }} archType: ${{ parameters.archType }} buildConfig: ${{ parameters.buildConfig }} helixQueues: ${{ parameters.helixQueues }} @@ -127,7 +129,7 @@ jobs: # for clarity), and should remain in sync. This is only a subset; only the testGroups that are # used to test the libraries have been added here. More could be added if we decided to test the # libraries with more stress modes. The scenario tags are interpreted by - # src\coreclr\tests\testenvironment.proj. + # src\tests\Common\testenvironment.proj. # # The one difference here compared to eng/pipelines/common/templates/runtimes/run-test-job.yml is # that 'jitstress' contains 'no_tiered_compilation'. The 'normal' (default) test mode @@ -143,10 +145,7 @@ jobs: - jitstress2 - jitstress2_tiered - zapdisable - # tailcallstress currently has hundreds of failures on Linux/arm32, so disable it. - # Tracked by https://github.com/dotnet/runtime/issues/38892. - - ${{ if or(eq(parameters.osGroup, 'Windows_NT'), ne(parameters.archType, 'arm')) }}: - - tailcallstress + - tailcallstress ${{ if in(parameters.coreclrTestGroup, 'jitstressregs' ) }}: scenarios: - jitstressregs1 diff --git a/eng/pipelines/libraries/stress/http.yml b/eng/pipelines/libraries/stress/http.yml index ddf8a5667903..429e7b5d2ed0 100644 --- a/eng/pipelines/libraries/stress/http.yml +++ b/eng/pipelines/libraries/stress/http.yml @@ -25,7 +25,7 @@ variables: jobs: - job: linux displayName: Docker Linux - timeoutInMinutes: 120 + timeoutInMinutes: 150 pool: name: NetCorePublic-Pool queue: BuildPool.Ubuntu.1604.Amd64.Open @@ -34,23 +34,38 @@ jobs: - checkout: self clean: true fetchDepth: 5 - + - bash: | $(dockerfilesFolder)/build-docker-sdk.sh -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION) + echo "##vso[task.setvariable variable=succeeded;isOutput=true]true" + name: buildRuntime displayName: Build CLR and Libraries - + - bash: | $(httpStressProject)/run-docker-compose.sh -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage) + echo "##vso[task.setvariable variable=succeeded;isOutput=true]true" + name: buildStress displayName: Build HttpStress - + + - bash: | + cd '$(httpStressProject)' + export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 2.0" + export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 2.0" + docker-compose up --abort-on-container-exit --no-color + displayName: Run HttpStress - HTTP 2.0 + condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true')) + - bash: | cd '$(httpStressProject)' + export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 1.1" + export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 1.1" docker-compose up --abort-on-container-exit --no-color - displayName: Run HttpStress + displayName: Run HttpStress - HTTP 1.1 + condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true')) - job: windows displayName: Docker NanoServer - timeoutInMinutes: 120 + timeoutInMinutes: 150 pool: name: NetCorePublic-Pool queue: BuildPool.Server.Amd64.VS2019.Open @@ -60,16 +75,31 @@ jobs: clean: true fetchDepth: 5 lfs: false - + - powershell: | $(dockerfilesFolder)/build-docker-sdk.ps1 -w -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION) + echo "##vso[task.setvariable variable=succeeded;isOutput=true]true" + name: buildRuntime displayName: Build CLR and Libraries - + - powershell: | $(httpStressProject)/run-docker-compose.ps1 -w -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage) + echo "##vso[task.setvariable variable=succeeded;isOutput=true]true" + name: buildStress displayName: Build HttpStress - + + - powershell: | + cd '$(httpStressProject)' + $env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 2.0" + $env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 2.0" + docker-compose up --abort-on-container-exit --no-color + displayName: Run HttpStress - HTTP 2.0 + condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true')) + - powershell: | cd '$(httpStressProject)' + $env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 1.1" + $env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 1.1" docker-compose up --abort-on-container-exit --no-color - displayName: Run HttpStress + displayName: Run HttpStress - HTTP 1.1 + condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true')) \ No newline at end of file diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index 901bab9a0f66..a6f149d093af 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -11,6 +11,7 @@ parameters: condition: true runtimeVariant: '' isOfficialBuild: false + crossBuild: false crossrootfsDir: '' ### Product build @@ -25,6 +26,7 @@ jobs: enableMicrobuild: true pool: ${{ parameters.pool }} runtimeVariant: ${{ parameters.runtimeVariant }} + crossBuild: ${{ parameters.crossBuild }} crossrootfsDir: ${{ parameters.crossroofsDir }} condition: ${{ parameters.condition }} @@ -68,18 +70,19 @@ jobs: - name: osOverride value: -os Android - ${{ if eq(parameters.osGroup, 'Browser') }}: - - name: EMSDK_PATH - value: /usr/local/emscripten - name: archType value: wasm - name: osOverride value: '-os Browser' + - ${{ if and(eq(parameters.osGroup, 'Linux'), not(eq(parameters.archType, 'x64'))) }}: + name: llvmCxxAbi + value: /p:MonoLLVMUseCxx11Abi=true - ${{ if eq(parameters.runtimeVariant, 'llvmjit') }}: - name: llvmParameter - value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=false + value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=false $(llvmCxxAbi) - ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}: - name: llvmParameter - value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true + value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true $(llvmCxxAbi) - ${{ parameters.variables }} steps: @@ -89,14 +92,14 @@ jobs: # and FreeBSD builds use a build agent with dependencies # preinstalled, so we only need this step for OSX and Windows. - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) + - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO displayName: Install native dependencies - ${{ if eq(parameters.osGroup, 'Windows_NT') }}: # Necessary to install python - script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force displayName: Install native dependencies - - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: + - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: - script: | du -sh $(Build.SourcesDirectory)/* df -h @@ -110,7 +113,7 @@ jobs: - script: build$(scriptExt) -subset mono -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(llvmParameter) displayName: Build product - - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: + - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}: - script: | du -sh $(Build.SourcesDirectory)/* df -h diff --git a/eng/pipelines/mono/templates/xplat-job.yml b/eng/pipelines/mono/templates/xplat-job.yml index 28971ca101ba..01d12d859f9a 100644 --- a/eng/pipelines/mono/templates/xplat-job.yml +++ b/eng/pipelines/mono/templates/xplat-job.yml @@ -6,6 +6,7 @@ parameters: name: '' helixType: '(unspecified)' container: '' + crossBuild: false crossrootfsDir: '' strategy: '' pool: '' @@ -79,12 +80,6 @@ jobs: - name: osSubgroup value: ${{ parameters.osSubgroup }} - - name: coreClrRepoRoot - value: '$(Build.SourcesDirectory)/src/coreclr' - - - name: coreClrRepoRootDir - value: '$(coreClrRepoRoot)$(dir)' - - ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: - name: _HelixSource value: official/dotnet/runtime/$(Build.SourceBranch) diff --git a/eng/pipelines/official/stages/publish.yml b/eng/pipelines/official/stages/publish.yml index 4f719d6e4a31..fc453209702a 100644 --- a/eng/pipelines/official/stages/publish.yml +++ b/eng/pipelines/official/stages/publish.yml @@ -1,5 +1,6 @@ parameters: PublishRidAgnosticPackagesFromPlatform: Windows_NT_x64 + publishingInfraVersion: 3 stages: @@ -23,6 +24,7 @@ stages: # Stages-based publishing entry point - template: /eng/common/templates/post-build/post-build.yml parameters: + publishingInfraVersion: ${{ parameters.publishingInfraVersion }} validateDependsOn: - PrepareForPublish # The following checks are run after the build in the validation and release pipelines @@ -47,6 +49,6 @@ stages: -TsaRepositoryName "$(TsaRepositoryName)" -TsaCodebaseName "$(TsaCodebaseName)" -TsaPublish $True - + # Publish to blob storage. publishInstallersAndChecksums: true diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml index ceffb1e237e7..bb51f3c0c736 100644 --- a/eng/pipelines/runtime-linker-tests.yml +++ b/eng/pipelines/runtime-linker-tests.yml @@ -64,6 +64,7 @@ jobs: - Linux_x64 jobParameters: testGroup: innerloop + timeoutInMinutes: 120 nameSuffix: Runtime_Release buildArgs: -s clr+libs -c $(_BuildConfig) extraStepsTemplate: /eng/pipelines/libraries/execute-trimming-tests-steps.yml diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index e1a3f8e7eefb..80141273f93c 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -49,11 +49,13 @@ stages: jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml buildConfig: release platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm - Linux_arm64 - Linux_musl_x64 + - Linux_musl_arm - Linux_musl_arm64 - Windows_NT_x86 - Windows_NT_x64 @@ -75,6 +77,7 @@ stages: - Linux_arm - Linux_arm64 - Linux_musl_x64 + - Linux_musl_arm - Linux_musl_arm64 - Windows_NT_x64 - Windows_NT_arm @@ -104,6 +107,7 @@ stages: - Linux_arm64 - Linux_musl_x64 - Browser_wasm + # - Linux_musl_arm # - Linux_musl_arm64 # - Windows_NT_x64 enable once coreclr.dll has a version header: https://github.com/dotnet/runtime/issues/37503 # - Windows_NT_x86 @@ -139,7 +143,8 @@ stages: buildConfig: release runtimeFlavor: mono jobParameters: - buildArgs: -s mono+libs+installer -c $(_BuildConfig) /p:MonoEnableLLVM=true + buildArgs: -s mono+libs+installer -c $(_BuildConfig) + /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=false nameSuffix: AllSubsets_Mono_LLVMJIT runtimeVariant: LLVMJIT isOfficialBuild: ${{ variables.isOfficialBuild }} @@ -168,11 +173,13 @@ stages: jobTemplate: /eng/pipelines/libraries/build-job.yml buildConfig: Release platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm - Linux_arm64 - Linux_musl_x64 + - Linux_musl_arm - Linux_musl_arm64 - Windows_NT_x86 - Windows_NT_x64 @@ -209,11 +216,13 @@ stages: useOfficialAllConfigurations: true buildFullPlatformManifest: true platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm - Linux_arm64 - Linux_musl_x64 + - Linux_musl_arm - Linux_musl_arm64 - Windows_NT_x86 - Windows_NT_x64 diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index e52318b38081..e28c814872ba 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -111,8 +111,6 @@ jobs: include: - src/tests/* - src/coreclr/tests/* - - src/coreclr/build-test.cmd - - src/coreclr/build-test.sh - subset: installer include: - docs/manpages/* @@ -142,8 +140,10 @@ jobs: - Linux_x64 - Linux_arm - Linux_arm64 + - Linux_musl_arm - Linux_musl_arm64 - Linux_musl_x64 + - OSX_arm64 - Windows_NT_x86 - Windows_NT_x64 - Windows_NT_arm @@ -202,11 +202,13 @@ jobs: jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml buildConfig: release platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm - Linux_arm64 - Linux_musl_x64 + - Linux_musl_arm - Linux_musl_arm64 - Windows_NT_x64 - Windows_NT_x86 @@ -226,7 +228,8 @@ jobs: jobTemplate: /eng/pipelines/coreclr/templates/format-job.yml platforms: - Linux_x64 - - Windows_NT_x64 + # Issue: https://github.com/dotnet/runtime/issues/40034 + #- Windows_NT_x64 jobParameters: condition: >- and( @@ -261,7 +264,6 @@ jobs: runtimeFlavor: mono platforms: - Android_x86 - - Android_arm64 - tvOS_x64 - iOS_arm64 - iOS_x86 @@ -283,11 +285,9 @@ jobs: buildConfig: Release runtimeFlavor: mono platforms: - - Android_x64 - Android_arm - tvOS_arm64 - iOS_arm - - iOS_x64 - Linux_musl_x64 jobParameters: testGroup: innerloop @@ -301,7 +301,7 @@ jobs: eq(variables['isFullMatrix'], true)) # -# Build the whole product using Mono and run tests +# Build the whole product using Mono and run libraries tests, multi-scenario # - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -311,6 +311,51 @@ jobs: runtimeFlavor: mono platforms: - Browser_wasm + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.checkout.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.checkout.outputs['SetPathVars_mono.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono + buildArgs: -s mono+libs+installer+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true + timeoutInMinutes: 120 + condition: >- + or( + eq(dependencies.checkout.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.checkout.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + scenarios: + - normal + - wasmtestonbrowser + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isFullMatrix'], 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_arm64 + - Android_x64 + - iOS_x64 variables: # map dependencies variables to local variables - name: librariesContainsChange @@ -339,6 +384,82 @@ jobs: eq(variables['monoContainsChange'], true), eq(variables['isFullMatrix'], true)) +# +# 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 + condition: >- + or( + eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), + eq(variables['isFullMatrix'], true)) + # 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: 300 + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_Mono_RuntimeTests + buildArgs: -s mono+libs -c $(_BuildConfig) + timeoutInMinutes: 300 + condition: >- + or( + eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true), + eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true), + 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 Mono and Installer on LLVMJIT mode # @@ -502,6 +623,7 @@ jobs: buildConfig: release platforms: - Linux_x64 + - Linux_arm64 jobParameters: runtimeVariant: llvmaot condition: >- @@ -522,6 +644,7 @@ jobs: buildConfig: Release platforms: - Linux_arm + - Linux_musl_arm - Linux_musl_arm64 - Windows_NT_arm - Windows_NT_arm64 @@ -537,6 +660,7 @@ jobs: - Linux_arm64 - Linux_musl_x64 - Linux_x64 + - OSX_arm64 - OSX_x64 - Windows_NT_x64 - FreeBSD_x64 @@ -576,7 +700,7 @@ jobs: helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: isFullMatrix: ${{ variables.isFullMatrix }} - framework: net472 + framework: net48 runTests: true testScope: innerloop condition: >- @@ -610,6 +734,7 @@ jobs: buildConfig: ${{ variables.debugOnPrReleaseOnRolling }} platforms: - Linux_arm + - Linux_musl_arm - Linux_musl_arm64 - Windows_NT_x86 - Windows_NT_arm @@ -622,6 +747,7 @@ jobs: parameters: buildConfig: Release platforms: + - OSX_arm64 - OSX_x64 - Linux_x64 - Linux_arm64 @@ -681,7 +807,6 @@ jobs: platforms: - Linux_arm - Windows_NT_x86 - - Windows_NT_arm - Windows_NT_arm64 helixQueueGroup: pr helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml @@ -767,6 +892,7 @@ jobs: runtimeFlavor: mono platforms: - Linux_x64 + - Linux_arm64 helixQueueGroup: pr helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml jobParameters: @@ -849,7 +975,6 @@ jobs: platforms: - Windows_NT_x86 - ${{ if eq(variables['isFullMatrix'], true) }}: - - Windows_NT_arm - Windows_NT_arm64 helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml jobParameters: @@ -905,6 +1030,7 @@ jobs: platforms: # - Windows_NT_arm return this when https://github.com/dotnet/runtime/issues/1097 is fixed. - Linux_arm + - Linux_musl_arm - Linux_musl_arm64 - Windows_NT_x86 helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml index 0dddac0c63a4..57e2edf25af2 100644 --- a/eng/pipelines/runtimelab.yml +++ b/eng/pipelines/runtimelab.yml @@ -45,141 +45,182 @@ pr: variables: - template: /eng/pipelines/common/variables.yml + - ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: + - name: TeamName + value: dotnet-core -jobs: -# -# Checkout repository -# -- template: /eng/pipelines/common/checkout-job.yml +stages: +- stage: Build + jobs: + # + # Checkout repository + # + - template: /eng/pipelines/common/checkout-job.yml -# -# Build with Debug config and Checked runtimeConfiguration -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - buildConfig: Checked - platforms: - - Linux_x64 - - Windows_NT_x64 - jobParameters: - testGroup: innerloop - buildArgs: -s clr+libs+installer -c debug -runtimeConfiguration Checked - extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml + # + # Build with Debug config and Checked runtimeConfiguration + # + - ${{ if ne(variables.isOfficialBuild, true) }}: + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: Checked + platforms: + - Linux_x64 + - Windows_NT_x64 + jobParameters: + timeoutInMinutes: 100 + testGroup: innerloop + buildArgs: -s clr+libs+installer -c debug -runtimeConfiguration Checked + extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml + extraStepsParameters: + uploadRuntimeTests: true -# -# Build with Release config and Release runtimeConfiguration -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - buildConfig: Release - platforms: - - Linux_x64 - - Windows_NT_x64 - jobParameters: - testGroup: innerloop - buildArgs: -s clr+libs+libs.tests+installer -c $(_BuildConfig) /p:ArchiveTests=true - extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml - extraStepsParameters: - uploadTests: true + # + # Build with Release config and Release runtimeConfiguration + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: Release + platforms: + - Linux_x64 + - Windows_NT_x64 + jobParameters: + isOfficialBuild: ${{ variables.isOfficialBuild }} + testGroup: innerloop + extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml + extraStepsParameters: + uploadLibrariesTests: ${{ eq(variables.isOfficialBuild, false) }} + uploadUnsignedArtifacts: false + ${{ if eq(variables.isOfficialBuild, false) }}: + buildArgs: -s clr+libs+libs.tests+installer -c $(_BuildConfig) /p:ArchiveTests=true + ${{ if eq(variables.isOfficialBuild, true) }}: + buildArgs: -s clr+libs -c $(_BuildConfig) -# -# Build with Release allConfigurations to produce packages -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/global-build-job.yml - buildConfig: release - platforms: - - Windows_NT_x64 - jobParameters: - testGroup: innerloop - nameSuffix: All_Configurations - buildArgs: -s libs -c $(_BuildConfig) -allConfigurations + # + # Build with Release allConfigurations to produce packages + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: Release + platforms: + - Windows_NT_x64 + jobParameters: + isOfficialBuild: ${{ variables.isOfficialBuild }} + testGroup: innerloop + nameSuffix: AllConfigurations + buildArgs: -s libs -c $(_BuildConfig) -allConfigurations + ${{ if eq(variables.isOfficialBuild, true) }}: + extraStepsTemplate: /eng/pipelines/runtimelab/runtimelab-post-build-steps.yml + extraStepsParameters: + uploadUnsignedArtifacts: true + isOfficialBuild: true + librariesBinArtifactName: libraries_bin_official_allconfigurations -# -# CoreCLR Test builds using live libraries release build -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml - buildConfig: Checked - platforms: - - Linux_x64 - jobParameters: - testGroup: innerloop - liveLibrariesBuildConfig: Release - dependsOn: - - build_Linux_x64_Checked_ - - build_Linux_x64_Release_ + # Installer official builds need to build installers and need the libraries all configurations build + - ${{ if eq(variables.isOfficialBuild, true) }}: + - template: /eng/pipelines/installer/installer-matrix.yml + parameters: + jobParameters: + liveRuntimeBuildConfig: Release + liveLibrariesBuildConfig: Release + isOfficialBuild: ${{ variables.isOfficialBuild }} + useOfficialAllConfigurations: true + dependsOnGlobalBuild: true + platforms: + - Linux_x64 + - Windows_NT_x64 -# -# CoreCLR Test executions using live libraries -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml - buildConfig: Checked - platforms: - - Linux_x64 - helixQueueGroup: pr - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: innerloop - liveLibrariesBuildConfig: Release - dependsOn: - - coreclr_common_test_build_p0_AnyOS_AnyCPU_Checked + - ${{ if ne(variables.isOfficialBuild, true) }}: + # + # CoreCLR Test builds using live libraries release build + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml + buildConfig: Checked + platforms: + - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64 + jobParameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + dependsOn: + - build_Linux_x64_Checked_ + - build_Linux_x64_Release_ -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml - buildConfig: Checked - platforms: - - Windows_NT_x64 - helixQueueGroup: pr - helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml - jobParameters: - testGroup: innerloop - liveLibrariesBuildConfig: Release - dependsOn: - - coreclr_common_test_build_p0_AnyOS_AnyCPU_Checked - - build_Windows_NT_x64_Checked_ - - build_Windows_NT_x64_Release_ + # + # CoreCLR Test executions using live libraries + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml + buildConfig: Checked + platforms: + - Linux_x64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + dependsOn: + - coreclr_common_test_build_p0_AnyOS_AnyCPU_Checked -# -# Libraries Release Test Execution against a release coreclr runtime -# -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/run-test-job.yml - buildConfig: Release - platforms: - - Linux_x64 - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - jobParameters: - isFullMatrix: false - isOfficialBuild: false - testScope: innerloop - liveRuntimeBuildConfig: Release - dependsOnTestBuildConfiguration: Release - dependsOnTestArchitecture: x64 - dependsOn: - - build_Linux_x64_Release_ + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml + buildConfig: Checked + platforms: + - Windows_NT_x64 + helixQueueGroup: pr + helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml + jobParameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + dependsOn: + - coreclr_common_test_build_p0_AnyOS_AnyCPU_Checked + - build_Windows_NT_x64_Checked_ + - build_Windows_NT_x64_Release_ -- template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/libraries/run-test-job.yml - buildConfig: Release - platforms: - - Windows_NT_x64 - helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - jobParameters: - isFullMatrix: false - isOfficialBuild: false - testScope: innerloop - liveRuntimeBuildConfig: Release - dependsOnTestBuildConfiguration: Release - dependsOnTestArchitecture: x64 - dependsOn: - - build_Windows_NT_x64_Release_ + # + # Libraries Release Test Execution against a release coreclr runtime + # + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/libraries/run-test-job.yml + buildConfig: Release + platforms: + - Linux_x64 + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + jobParameters: + isFullMatrix: false + isOfficialBuild: false + testScope: innerloop + liveRuntimeBuildConfig: Release + dependsOnTestBuildConfiguration: Release + dependsOnTestArchitecture: x64 + dependsOn: + - build_Linux_x64_Release_ + + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/libraries/run-test-job.yml + buildConfig: Release + platforms: + - Windows_NT_x64 + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + jobParameters: + isFullMatrix: false + isOfficialBuild: false + testScope: innerloop + liveRuntimeBuildConfig: Release + dependsOnTestBuildConfiguration: Release + dependsOnTestArchitecture: x64 + dependsOn: + - build_Windows_NT_x64_Release_ + +- ${{ if eq(variables.isOfficialBuild, true) }}: + - template: /eng/pipelines/official/stages/publish.yml + parameters: + isOfficialBuild: ${{ variables.isOfficialBuild }} diff --git a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml index e5fbcba7bc95..124b38f0819e 100644 --- a/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml +++ b/eng/pipelines/runtimelab/runtimelab-post-build-steps.yml @@ -3,15 +3,24 @@ parameters: archType: '' osGroup: '' osSubgroup: '' - uploadTests: false + nameSuffix: '' + platform: '' + librariesBinArtifactName: '' + isOfficialBuild: false + uploadLibrariesTests: false + uploadRuntimeTests: false + uploadUnsignedArtifacts: false steps: # Build coreclr native test output - - script: $(Build.SourcesDirectory)/src/coreclr/build-test$(scriptExt) skipstressdependencies skipmanaged skipgeneratelayout $(buildConfigUpper) ${{ parameters.archType }} - displayName: Build native test components + - ${{ if eq(parameters.uploadRuntimeTests, true) }}: + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) skipstressdependencies skipmanaged skipgeneratelayout $(buildConfigUpper) ${{ parameters.archType }} + displayName: Build native test components # Copy all build output into artifacts staging directory - template: /eng/pipelines/libraries/prepare-for-bin-publish.yml + parameters: + isOfficialBuild: ${{ parameters.isOfficialBuild }} # Zip CoreCLR Build Output - template: /eng/pipelines/common/upload-artifact-step.yml @@ -25,7 +34,7 @@ steps: displayName: 'CoreCLR product build' # Zip Test Build - - ${{ if eq(parameters.uploadTests, true) }}: + - ${{ if eq(parameters.uploadLibrariesTests, true) }}: - template: /eng/pipelines/common/upload-artifact-step.yml parameters: rootFolder: $(Build.SourcesDirectory)/artifacts/helix @@ -36,16 +45,17 @@ steps: artifactName: libraries_test_assets_${{ parameters.osGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }} displayName: Test Assets - # Zip product native assets for use by Tests - - template: /eng/pipelines/common/upload-artifact-step.yml - parameters: - rootFolder: $(Build.SourcesDirectory)/artifacts/tests/coreclr/obj/${{ parameters.osGroup }}.${{ parameters.archType }}.$(buildConfigUpper) - includeRootFolder: false - archiveType: $(archiveType) - tarCompression: $(tarCompression) - archiveExtension: $(archiveExtension) - artifactName: CoreCLRNativeTestArtifacts_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }} - displayName: 'native test components' + # Zip runtime native assets for use by Tests + - ${{ if eq(parameters.uploadRuntimeTests, true) }}: + - template: /eng/pipelines/common/upload-artifact-step.yml + parameters: + rootFolder: $(Build.SourcesDirectory)/artifacts/tests/coreclr/obj/${{ parameters.osGroup }}.${{ parameters.archType }}.$(buildConfigUpper) + includeRootFolder: false + archiveType: $(archiveType) + tarCompression: $(tarCompression) + archiveExtension: $(archiveExtension) + artifactName: CoreCLRNativeTestArtifacts_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }} + displayName: 'native test components' # Zip Libraries Build Output - template: /eng/pipelines/common/upload-artifact-step.yml @@ -55,5 +65,11 @@ steps: tarCompression: $(tarCompression) includeRootFolder: false archiveExtension: $(archiveExtension) - artifactName: libraries_bin_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }} + artifactName: ${{ coalesce(parameters.librariesBinArtifactName, format('libraries_bin_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig)) }} displayName: Build Assets + + # Upload unsigned artifacts + - ${{ if eq(parameters.uploadUnsignedArtifacts, true) }}: + - template: /eng/pipelines/common/upload-unsigned-artifacts-step.yml + parameters: + name: ${{ parameters.platform }}${{ parameters.nameSuffix }} diff --git a/eng/referenceAssemblies.props b/eng/referenceAssemblies.props index a5e0e553f12f..4bdcf75ef319 100644 --- a/eng/referenceAssemblies.props +++ b/eng/referenceAssemblies.props @@ -1,9 +1,12 @@ - $(AdditionalBuildTargetFrameworks);netstandard2.0 - $(AdditionalBuildTargetFrameworks);netstandard2.1 + !$(BuildTargetFramework.StartsWith('netstandard')) and + !$(BuildTargetFramework.StartsWith('net4'))"> + $(AdditionalBuildTargetFrameworks);netstandard2.0 + $(AdditionalBuildTargetFrameworks);netstandard2.1 + + + false diff --git a/eng/referenceFromRuntime.targets b/eng/referenceFromRuntime.targets deleted file mode 100644 index 34d0eb49199c..000000000000 --- a/eng/referenceFromRuntime.targets +++ /dev/null @@ -1,124 +0,0 @@ - - - - AddRuntimeProjectReference; - $(PrepareProjectReferencesDependsOn); - - - AddRuntimeProjectReference; - $(ResolveReferencesDependsOn); - - - AddRuntimeProjectReference; - $(CleanDependsOn) - - - - - $([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'restore', 'runtime', 'runtime.depproj')) - - - - - - - - false - _referencePathFromRestoredRuntime - - - - - - - - - - - - - - - - - - - - - - - - - <_referencePathFromRuntime Include="@(RuntimeFiles)" Private="false" /> - <_referencePathFromRuntime Include="@(_referencePathFromRestoredRuntime)" Private="false" /> - - <_referencePathFromRuntime Include="@(ReferenceFromRuntime->'$(RuntimePath)%(Identity).dll')" Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true'" /> - - <_referencePathFromRuntimeByFileName Include="@(_referencePathFromRuntime->'%(FileName)')" Condition="'%(_referencePathFromRuntime.Extension)' == '.dll'" > - %(Identity) - - - - - - - - - - - <_filteredReferencePathFromRuntimeByFileName Include="@(_referencePathFromRuntimeByFileNameFiltered)" - Condition="'@(_referencePathFromRuntimeByFileNameFiltered)' == '@(ReferenceFromRuntime)' and '%(Identity)' != ''"> - @(ReferenceFromRuntime->'%(Aliases)') - - - <_remainingReferenceFromRuntime Include="@(ReferenceFromRuntime)" Exclude="@(_filteredReferencePathFromRuntimeByFileName)" /> - - - <_remainingReferenceFromRuntimeWithNI Include="@(_remainingReferenceFromRuntime->'%(Identity).ni')"> - %(Identity) - - - <_filteredReferencePathFromRuntimeByFileName Include="@(_referencePathFromRuntimeByFileNameFiltered)" - Condition="'@(_referencePathFromRuntimeByFileNameFiltered)' == '@(_remainingReferenceFromRuntimeWithNI)' and '%(Identity)' != ''"> - @(_remainingReferenceFromRuntimeWithNI->'%(Aliases)') - - - <_missingReferenceFromRuntime Include="@(_remainingReferenceFromRuntimeWithNI)" Exclude="@(_filteredReferencePathFromRuntimeByFileName)" /> - - - - - - - - <_aliasedReferencePathFromRuntime Include="@(_filteredReferencePathFromRuntimeByFileName->'%(ReferencePath)')" Condition="'%(_filteredReferencePathFromRuntimeByFileName.Aliases)' != ''" /> - - - - - - - - - - - - - - diff --git a/eng/references.targets b/eng/references.targets index efcac7d05152..42763624c5ed 100644 --- a/eng/references.targets +++ b/eng/references.targets @@ -1,67 +1,59 @@ - - $(RefPath) - $(RefPath) - $(AssemblySearchPaths);$(RefPath);{RawFileName} - - <_FindDependencies>false + - <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) - <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) - - - true - true + Disable RAR from transitively discovering dependencies for references. This is required as we don't copy + dependencies over into the output directory which means RAR can't resolve them. + --> + <_FindDependencies>false - - - - - - - - - - - - - - false - - - + + + + - - - - - - - + + + + - - %(DefaultReferenceDirs.Identity) - - <_defaultReferenceExclusionsFullPath Include="%(DefaultReferenceExclusions.RefDir)%(DefaultReferenceExclusions.Identity).dll" /> + + + + false + + - - + + + + <_transitiveProjectReferenceWithExclusion Include="@(ProjectReference)"> + %(DefaultReferenceExclusion.Identity) + + - + + - + - - \ No newline at end of file + diff --git a/eng/resolveContract.targets b/eng/resolveContract.targets index 2f59f5d9a517..6f4bb0e253ee 100644 --- a/eng/resolveContract.targets +++ b/eng/resolveContract.targets @@ -1,8 +1,18 @@ + + $(MicrosoftNetCoreAppRefPackRefDir) + + $(ContractDependencyPaths);@(ReferencePath->'%(RelativeDir)'->Distinct()) + + - $(LibrariesProjectRoot)$(MSBuildProjectName)/ref/$(MSBuildProjectName).csproj + $(LibrariesProjectRoot)$(MSBuildProjectName)\ref\$(MSBuildProjectName).csproj true - $(RefPath)/$(MSBuildProjectName).dll + $(NetCoreAppCurrentRefPath)$(TargetFileName) + $([MSBuild]::NormalizePath('$(BaseOutputPath)', 'ref', '$(TargetFramework)-$(Configuration)', '$(TargetFileName)')) false @@ -10,8 +20,43 @@ + + + false + ResolvedMatchingContract + + + + + + + + + + + + + false + + + + <_resolvedP2PFiltered Include="@(ProjectReference)"> + $([System.IO.Path]::GetFullPath('%(ProjectReference.Identity)')) + %(ProjectReference.SkipUseReferenceAssembly) + + <_ResolvedProjectReferencePaths Update="@(_resolvedProjectReferenceFiltred)" + Condition="'%(_resolvedP2PFiltered.ProjectReferenceItemSpec)' == '%(_resolvedP2PFiltered.MSBuildSourceProjectFile)' and + '%(_resolvedP2PFiltered.SkipUseReferenceAssembly)' == 'true'" + ReferenceAssembly="" /> + + \ No newline at end of file diff --git a/eng/restore/optimizationData.targets b/eng/restore/optimizationData.targets index a4bbe9645b66..a8466b7cd0c7 100644 --- a/eng/restore/optimizationData.targets +++ b/eng/restore/optimizationData.targets @@ -1,11 +1,11 @@  - - - - - + + + + + @@ -25,6 +25,8 @@ <_optimizationDataSourceFile Include="%(IBCPackage.PackagePath)\**\*.dll;%(IBCPackage.PackagePath)\**\*.ibc" SubdirectoryName="%(IBCPackage.SubdirectoryName)" /> + + + $(RepoRoot)artifacts\toolset\Common\ false unused diff --git a/eng/restore/repoRestore.targets b/eng/restore/repoRestore.targets index a430b67fee1f..d350ef534c1c 100644 --- a/eng/restore/repoRestore.targets +++ b/eng/restore/repoRestore.targets @@ -1,7 +1,7 @@ - Unknown + Unknown @@ -21,12 +21,9 @@ Hack workaround for not restoring each project. Instead, we turn off all the targets that require a `project.assets.json`, since ours will be empty anyway. --> - - + - + - diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets new file mode 100644 index 000000000000..cf8549862e9b --- /dev/null +++ b/eng/targetingpacks.targets @@ -0,0 +1,108 @@ + + + <_UseLocalTargetingRuntimePack>true + false + + + + + + + $(PkgMicrosoft_NETCore_App)\ref\netcoreapp$(TargetFrameworkVersion.TrimStart('v'))\ + + + + + + + + + + + false + + + + + + + <_NetCoreAppTargetFrameworkIdentifier Condition="$([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '5.0'))">netcoreapp + <_NetCoreAppTargetFrameworkIdentifier Condition="$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '5.0'))">net + %(ResolvedFrameworkReference.TargetingPackPath)\ref\$(_NetCoreAppTargetFrameworkIdentifier)$(TargetFrameworkVersion.TrimStart('v'))\ + + + + + + + + + + $(AssemblySearchPaths);$(MicrosoftNetCoreAppRefPackRefDir.TrimEnd('/\')) + $(DesignTimeAssemblySearchPaths);$(MicrosoftNetCoreAppRefPackRefDir.TrimEnd('/\')) + + + + + + + + + + + + + + + + + + + + + + + <_targetingPackReferenceExclusion Include="$(TargetName)" /> + <_targetingPackReferenceExclusion Include="@(_ResolvedProjectReferencePaths->'%(Filename)')" /> + <_targetingPackReferenceExclusion Include="@(DefaultReferenceExclusion)" /> + + + + <_targetingPackReferenceWithExclusion Include="@(Reference)"> + %(_targetingPackReferenceExclusion.Identity) + + + + + \ No newline at end of file diff --git a/eng/testing/.runsettings b/eng/testing/.runsettings index fabc0310a7aa..1dfbe23e6501 100644 --- a/eng/testing/.runsettings +++ b/eng/testing/.runsettings @@ -10,7 +10,7 @@ $$MAXCPUCOUNT$$ - $$TARGETPLATFORM$$ + $$TARGETPLATFORM$$ $$DISABLEPARALLELIZATION$$ @@ -18,10 +18,6 @@ $$TESTCASEFILTER$$ $$DOTNETHOSTPATH$$ - - - $$DEVPATH$$ - @@ -50,4 +46,4 @@ - \ No newline at end of file + diff --git a/eng/testing/AndroidRunnerTemplate.sh b/eng/testing/AndroidRunnerTemplate.sh index e703db4be241..a1e89f0e7ea0 100644 --- a/eng/testing/AndroidRunnerTemplate.sh +++ b/eng/testing/AndroidRunnerTemplate.sh @@ -1,10 +1,8 @@ -#!/usr/bin/env bash +#!/usr/bin/env bash EXECUTION_DIR=$(dirname $0) -TEST_NAME=$1 -TARGET_ARCH=$2 -APK=$EXECUTION_DIR/bin/$TEST_NAME.apk +cd $EXECUTION_DIR # it doesn't support parallel execution yet, so, here is a hand-made semaphore: LOCKDIR=/tmp/androidtests.lock @@ -20,12 +18,19 @@ done XHARNESS_OUT="$EXECUTION_DIR/xharness-output" -dotnet xharness android test --instrumentation="net.dot.MonoRunner" \ - --package-name="net.dot.$TEST_NAME" \ - --app=$APK --output-directory=$XHARNESS_OUT -v +if [ ! -z "$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" +else + HARNESS_RUNNER="dotnet xharness" +fi + +# RunCommands defined in tests.mobile.targets +[[RunCommands]] _exitCode=$? -echo "Xharness artifacts: $XHARNESS_OUT" +echo "XHarness artifacts: $XHARNESS_OUT" exit $_exitCode diff --git a/eng/testing/AppleRunnerTemplate.sh b/eng/testing/AppleRunnerTemplate.sh index c146f7e0364b..b78bff38d867 100644 --- a/eng/testing/AppleRunnerTemplate.sh +++ b/eng/testing/AppleRunnerTemplate.sh @@ -1,11 +1,9 @@ #!/usr/bin/env bash EXECUTION_DIR=$(dirname $0) -TEST_NAME=$1 -TARGET_ARCH=$2 -TARGET= -SCHEME_SDK= +[[RunCommands]] +# "Release" in SCHEME_SDK is what xcode produces (see "bool Optimized" property in AppleAppBuilderTask) if [ "$TARGET_ARCH" == "arm" ]; then TARGET=ios-device SCHEME_SDK=Release-iphoneos @@ -23,8 +21,6 @@ else exit 1 fi -# "Release" in SCHEME_SDK is what xcode produces (see "bool Optimized" property in AppleAppBuilderTask) - APP_BUNDLE=$EXECUTION_DIR/$TEST_NAME/$SCHEME_SDK/$TEST_NAME.app # it doesn't support parallel execution yet, so, here is a hand-made semaphore: @@ -39,14 +35,17 @@ while true; do fi done -XHARNESS_OUT="$EXECUTION_DIR/xharness-output" +XCODE_PATH="`xcode-select -p`/../.." +export XHARNESS_OUT="$EXECUTION_DIR/xharness-output" -dotnet xharness ios test --app="$APP_BUNDLE" \ - --targets=$TARGET \ +dotnet xharness ios test \ + --targets="$TARGET" \ + --app="$APP_BUNDLE" \ + --xcode="$XCODE_PATH" \ --output-directory=$XHARNESS_OUT _exitCode=$? -echo "Xharness artifacts: $XHARNESS_OUT" +echo "XHarness artifacts: $XHARNESS_OUT" exit $_exitCode diff --git a/eng/testing/RunnerTemplate.cmd b/eng/testing/RunnerTemplate.cmd index fe28e9157a6e..10737eabe709 100644 --- a/eng/testing/RunnerTemplate.cmd +++ b/eng/testing/RunnerTemplate.cmd @@ -41,12 +41,6 @@ set EXECUTION_DIR=%~dp0 :argparser_end -if not defined RUNTIME_PATH ( - echo error: -r^|--runtime-path argument is required. - call :usage - exit /b -1 -) - :: Don't use a globally installed SDK. set DOTNET_MULTILEVEL_LOOKUP=0 diff --git a/eng/testing/WasmRunnerTemplate.sh b/eng/testing/WasmRunnerTemplate.sh index c9272caf8f18..e2e3996cab58 100644 --- a/eng/testing/WasmRunnerTemplate.sh +++ b/eng/testing/WasmRunnerTemplate.sh @@ -14,6 +14,10 @@ else HARNESS_RUNNER="dotnet xharness" fi +if [ -z "$XHARNESS_COMMAND" ]; then + XHARNESS_COMMAND="test" +fi + # RunCommands defined in tests.mobile.targets [[RunCommands]] diff --git a/eng/testing/linker/SupportFiles/Directory.Build.targets b/eng/testing/linker/SupportFiles/Directory.Build.targets index 49422a33b9be..3318b0f4010f 100644 --- a/eng/testing/linker/SupportFiles/Directory.Build.targets +++ b/eng/testing/linker/SupportFiles/Directory.Build.targets @@ -20,14 +20,36 @@ + BeforeTargets="PrepareForILLink"> link + + + + + + + + + diff --git a/eng/testing/linker/project.csproj.template b/eng/testing/linker/project.csproj.template index ef63096e8019..d335783fc44f 100644 --- a/eng/testing/linker/project.csproj.template +++ b/eng/testing/linker/project.csproj.template @@ -6,15 +6,31 @@ {RuntimeIdentifier} {RuntimePackDir} {TargetingPackDir} - <_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs) + {NetCoreAppMaximumVersion} + + + IL2026 + + $(LinkerNoWarn);IL2032;IL2055;IL2057;IL2058;IL2059;IL2060;IL2061 + + $(LinkerNoWarn);IL2062;IL2063;IL2064;IL2065;IL2066 + + $(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 + + $(LinkerNoWarn);IL2008;IL2009;IL2037 + <_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs) --nowarn $(LinkerNoWarn) + + {AdditionalProjectReferences} + + <_ILLinkTasksDirectoryRoot>$(PkgMicrosoft_NET_ILLink_Tasks)\tools\ - <_ILLinkTasksTFM>netcoreapp3.0 + <_ILLinkTasksTFM>net5.0 <_ILLinkTasksDirectory>$(_ILLinkTasksDirectoryRoot)$(_ILLinkTasksTFM)\ $(_ILLinkTasksDirectory)ILLink.Tasks.dll @@ -28,4 +44,4 @@ GeneratePathProperty="true" /> - \ No newline at end of file + diff --git a/eng/testing/linker/trimmingTests.targets b/eng/testing/linker/trimmingTests.targets index 3729bd306bca..4a9152fbd5f9 100644 --- a/eng/testing/linker/trimmingTests.targets +++ b/eng/testing/linker/trimmingTests.targets @@ -57,6 +57,15 @@ <_projectSourceFile>%(TestConsoleApps.ProjectCompileItems) + + <_additionalProjectReferenceTemp Include="$(AdditionalProjectReferences)" /> + <_additionalProjectReference Include="<ProjectReference Include="$(LibrariesProjectRoot)%(_additionalProjectReferenceTemp.Identity)\src\%(_additionalProjectReferenceTemp.Identity).csproj" SkipUseReferenceAssembly="true" />" /> + + + + <_additionalProjectReferencesString>@(_additionalProjectReference, '%0a') + + <_additionalProjectSourceFiles Include="%(TestConsoleApps.AdditionalSourceFiles)" /> @@ -65,11 +74,13 @@ diff --git a/eng/testing/netfx.exe.config b/eng/testing/netfx.exe.config index ed7d7d082438..e131497fc761 100644 --- a/eng/testing/netfx.exe.config +++ b/eng/testing/netfx.exe.config @@ -1,7 +1,6 @@ - \ No newline at end of file diff --git a/eng/testing/outerBuild.targets b/eng/testing/outerBuild.targets index 4623b0e54d25..c071944c21d9 100644 --- a/eng/testing/outerBuild.targets +++ b/eng/testing/outerBuild.targets @@ -1,8 +1,12 @@ + Targets="Test"> + + + + \ No newline at end of file diff --git a/eng/testing/runsettings.targets b/eng/testing/runsettings.targets index 10496127b8a9..2fa1901e0489 100644 --- a/eng/testing/runsettings.targets +++ b/eng/testing/runsettings.targets @@ -28,15 +28,16 @@ $([System.IO.File]::ReadAllText('$(RunSettingsInputFilePath)')) $(RunSettingsFileContent.Replace('$$MAXCPUCOUNT$$', '1')) $(RunSettingsFileContent.Replace('$$MAXCPUCOUNT$$', '0')) + + $(RunSettingsFileContent.Replace('$$TARGETPLATFORM$$', '$(TargetArchitecture)')) + $(RunSettingsFileContent.Replace('$$TARGETPLATFORM$$', '')) $(RunSettingsFileContent.Replace('$$COVERAGE_INCLUDE$$', '$(CoverageIncludeFilter)') .Replace('$$COVERAGE_EXCLUDEBYFILE$$', '$(CoverageExcludeByFileFilter)') .Replace('$$COVERAGE_INCLUDEDIRECTORY$$', '$(CoverageIncludeDirectoryFilter)') .Replace('$$COVERAGE_ENABLED$$', '$([MSBuild]::ValueOrDefault('$(Coverage)', 'false'))') - .Replace('$$TARGETPLATFORM$$', '$(TargetArchitecture)') .Replace('$$DISABLEPARALLELIZATION$$', '$([MSBuild]::ValueOrDefault('$(TestDisableParallelization)', 'false'))') .Replace('$$DISABLEAPPDOMAIN$$', '$([MSBuild]::ValueOrDefault('$(TestDisableAppDomain)', 'false'))') .Replace('$$TESTCASEFILTER$$', '$(_testFilter)') - .Replace('$$DEVPATH$$', '$(TestHostRootPath)') .Replace('$$DOTNETHOSTPATH$$', '$(TestHostRootPath)$([System.IO.Path]::GetFileName('$(DotNetTool)'))')) diff --git a/eng/testing/runtimeConfiguration.targets b/eng/testing/runtimeConfiguration.targets index f687adfad40f..d69182992c7b 100644 --- a/eng/testing/runtimeConfiguration.targets +++ b/eng/testing/runtimeConfiguration.targets @@ -1,45 +1,31 @@ - - $(MSBuildThisFileDirectory)netfx.exe.config - - true + true + true + true + $(MSBuildThisFileDirectory)netfx.exe.config + + $(TargetPath).config - - + - - - - - - - \ No newline at end of file diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 5622b19e249b..97096ea948ae 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -8,21 +8,28 @@ $(JSEngineArgs) --engine-arg=--stack-trace-limit=1000 - - - - - $HARNESS_RUNNER wasm test --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js -v --output-directory=$XHARNESS_OUT -- --run WasmTestRunner.dll $(AssemblyName).dll + $HARNESS_RUNNER wasm $XHARNESS_COMMAND --app=. --engine=$(JSEngine) $(JSEngineArgs) --js-file=runtime.js --output-directory=$XHARNESS_OUT -- $(RunTestsJSArguments) --run WasmTestRunner.dll $(AssemblyName).dll + + $HARNESS_RUNNER android test --instrumentation="net.dot.MonoRunner" --package-name="net.dot.$(AssemblyName)" --app=$EXECUTION_DIR/bin/$(TestProjectName).apk --output-directory=$XHARNESS_OUT -v -- + + + + + + + + + arm64-v8a armeabi-v7a @@ -30,9 +37,6 @@ x86 - - - @@ -44,7 +48,7 @@ + + + @@ -72,6 +82,7 @@ + @@ -114,7 +125,16 @@ - + + + <_appFiles Include="$(AppBundlePath)/../**/*" /> + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - + AssemblySearchPaths="@(AssemblySearchPaths)" /> - - - - - - - - - - - - + DependsOnTargets="Publish;BundleTestAppleApp;BundleTestAndroidApp;BundleTestWasmApp;ArchiveTests" /> diff --git a/eng/testing/tests.props b/eng/testing/tests.props index bf2f93fcceb3..65664f7f7499 100644 --- a/eng/testing/tests.props +++ b/eng/testing/tests.props @@ -29,8 +29,6 @@ $(PackageRID) true - false - diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 1534c3aa0dad..2fe669a10ba0 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -19,11 +19,6 @@ $(RunScriptHostDir)dotnet - - - - - PrepareForRun @@ -41,7 +36,6 @@ - $([MSBuild]::NormalizeDirectory('$(OutDir)', 'AppBundle')) <_ZipSourceDirectory>$(OutDir) <_ZipSourceDirectory Condition="'$(TargetOS)' == 'Browser'">$(BundleDir) @@ -50,6 +44,8 @@ + + @@ -95,7 +91,10 @@ - "$(RunScriptOutputPath)" --runtime-path "$(TestHostRootPath.TrimEnd('\/'))" + "$(RunScriptOutputPath)" + + $(RunTestsCommand) --runtime-path "$(TestHostRootPath.TrimEnd('\/'))" $(RunTestsCommand) --rsp-file "$(TestRspFile)" "$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture) "$(RunScriptOutputPath)" $(JSEngine) $(AssemblyName).dll $(_withoutCategories.Replace(';', ' -notrait category=')) diff --git a/eng/testing/xunit/xunit.console.targets b/eng/testing/xunit/xunit.console.targets index 837b432a99eb..5b71327e9645 100644 --- a/eng/testing/xunit/xunit.console.targets +++ b/eng/testing/xunit/xunit.console.targets @@ -37,24 +37,23 @@ Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" /> - - <_testRunnerConfigSourceFile Include="$(TargetDir)$(TargetName).exe.config" /> <_testRunnerConfigDestFile Include="$(TargetDir)xunit.console.exe.config" /> - - @@ -62,7 +61,9 @@ @@ -74,5 +75,13 @@ CopyToOutputDirectory="PreserveNewest" Visible="false" /> + + + + + + + + diff --git a/eng/testing/xunit/xunit.props b/eng/testing/xunit/xunit.props index 8b21cecac618..69355a452a48 100644 --- a/eng/testing/xunit/xunit.props +++ b/eng/testing/xunit/xunit.props @@ -16,7 +16,7 @@ - + + + + $(OutDir) diff --git a/eng/versioning.targets b/eng/versioning.targets index 1eba158bb6be..61789747403d 100644 --- a/eng/versioning.targets +++ b/eng/versioning.targets @@ -22,13 +22,25 @@ - - - - <_Parameter1>$(MinimiumSupportedWindowsPlatform) + + + + <_Parameter1>windows + + <_unsupportedOSPlatforms Include="$(UnsupportedOSPlatforms)" /> + + + + + + <_Parameter1>%(_unsupportedOSPlatforms.Identity) + + + + diff --git a/global.json b/global.json index 64916dd7429c..712486f620a0 100644 --- a/global.json +++ b/global.json @@ -1,24 +1,24 @@ { "sdk": { - "version": "5.0.100-preview.8.20362.3", + "version": "5.0.100-preview.8.20417.9", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "5.0.100-preview.8.20362.3" + "dotnet": "5.0.100-rc.2.20479.15" }, "native-tools": { - "cmake": "3.14.5", + "cmake": "3.16.4", "python3": "3.7.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20364.3", - "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20364.3", - "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20364.3", - "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20364.3", + "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.20529.1", + "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.20529.1", + "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "6.0.0-beta.20529.1", + "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.20529.1", "Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "5.0.0-preview.8.20359.4", - "Microsoft.Build.NoTargets": "1.0.53", - "Microsoft.Build.Traversal": "2.0.52" + "Microsoft.Build.NoTargets": "2.0.1", + "Microsoft.Build.Traversal": "2.1.1" } } diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 0d60cf16fc10..e6495e025087 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -1,19 +1,18 @@ -cmake_minimum_required(VERSION 3.14.5) +cmake_minimum_required(VERSION 3.6.2) cmake_policy(SET CMP0042 NEW) +if (CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15) + cmake_policy(SET CMP0091 NEW) +endif() # Set the project name project(CoreCLR) include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) -if (CLR_CMAKE_HOST_WIN32) - message(STATUS "VS_PLATFORM_TOOLSET is ${CMAKE_VS_PLATFORM_TOOLSET}") - message(STATUS "VS_PLATFORM_NAME is ${CMAKE_VS_PLATFORM_NAME}") -endif (CLR_CMAKE_HOST_WIN32) - if(MSVC) - add_compile_options(/EHa) # enable C++ EH (w/ SEH exceptions) + string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + add_compile_options($<$:/EHa>) # enable C++ EH (w/ SEH exceptions) set(CMAKE_CXX_STANDARD_LIBRARIES "") # do not link against standard win32 libs i.e. kernel32, uuid, user32, etc. endif (MSVC) @@ -51,9 +50,9 @@ include(pgosupport.cmake) #------------------------------- # Include libraries native shims #------------------------------- -if(NOT CLR_CROSS_COMPONENTS_BUILD) +if(NOT CLR_CROSS_COMPONENTS_BUILD AND CLR_CMAKE_BUILD_SUBSET_RUNTIME) add_subdirectory(src/libraries-native) -endif(NOT CLR_CROSS_COMPONENTS_BUILD) +endif(NOT CLR_CROSS_COMPONENTS_BUILD AND CLR_CMAKE_BUILD_SUBSET_RUNTIME) #----------------------------------------- # Add Projects @@ -86,7 +85,7 @@ add_subdirectory(src/pal/prebuilt/inc) add_subdirectory(src/debug/debug-pal) -if(CLR_CMAKE_TARGET_WIN32) +if(CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_BUILD_SUBSET_RUNTIME) add_subdirectory(src/gc/sample) endif() @@ -96,7 +95,7 @@ add_subdirectory(src/tools/aot/jitinterface) # All of the compiler options are specified in file compileoptions.cmake # Do not add any new options here. They should be added in compileoptions.cmake if(CLR_CMAKE_HOST_WIN32) - add_compile_options(/Zl) # omit default library name in .OBJ + add_compile_options($<$:/Zl>) # omit default library name in .OBJ endif(CLR_CMAKE_HOST_WIN32) #-------------------------------- @@ -115,7 +114,9 @@ include_directories("../../artifacts/obj/coreclr") if(FEATURE_STANDALONE_GC) add_definitions(-DFEATURE_STANDALONE_GC) - add_subdirectory(src/gc) + if (CLR_CMAKE_BUILD_SUBSET_RUNTIME) + add_subdirectory(src/gc) + endif (CLR_CMAKE_BUILD_SUBSET_RUNTIME) endif(FEATURE_STANDALONE_GC) if (CLR_CMAKE_HOST_UNIX) diff --git a/src/coreclr/build-runtime.cmd b/src/coreclr/build-runtime.cmd index aa9573d790cb..730e8d0f94fa 100644 --- a/src/coreclr/build-runtime.cmd +++ b/src/coreclr/build-runtime.cmd @@ -10,7 +10,7 @@ echo %__MsgPrefix%Starting Build at %TIME% set __ThisScriptFull="%~f0" set __ThisScriptDir="%~dp0" -call "%__ThisScriptDir%"\setup_vs_tools.cmd +call %__ThisScriptDir%\setup_vs_tools.cmd if NOT '%ERRORLEVEL%' == '0' goto ExitWithError if defined VS160COMNTOOLS ( @@ -67,6 +67,7 @@ set __PgoInstrument=0 set __PgoOptimize=1 set __EnforcePgo=0 set __IbcTuning= +set __ConsoleLoggingParameters=/clp:ForceNoAlign;Summary REM __PassThroughArgs is a set of things that will be passed through to nested calls to build.cmd REM when using "all". @@ -83,9 +84,16 @@ set __BuildCrossArchNative=0 set __SkipCrossArchNative=0 set __SkipGenerateVersion=0 set __RestoreOptData=1 +set __BuildJit=1 +set __BuildPALTests=0 +set __BuildAllJits=1 +set __BuildRuntime=1 set __CrossArch= +set __CrossArch2= +set __CrossOS=0 set __PgoOptDataPath= set __CMakeArgs= +set __Ninja=0 @REM CMD has a nasty habit of eating "=" on the argument list, so passing: @REM -priority=1 @@ -149,8 +157,8 @@ if [!__PassThroughArgs!]==[] ( set __PassThroughArgs=%__PassThroughArgs% %1 ) -if /i "%1" == "-alpinedac" (set __BuildNative=0&set __BuildCrossArchNative=1&set __CrossArch=x64&set __TargetOS=alpine&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "-linuxdac" (set __BuildNative=0&set __BuildCrossArchNative=1&set __CrossArch=x64&set __TargetOS=Linux&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "-alpinedac" (set __BuildNative=0&set __BuildCrossArchNative=1&set __CrossArch=x64&set __CrossOS=1&set __TargetOS=alpine&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "-linuxdac" (set __BuildNative=0&set __BuildCrossArchNative=1&set __CrossArch=x64&set __CrossOS=1&set __TargetOS=Linux&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "-cmakeargs" (set __CMakeArgs=%2 %__CMakeArgs%&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) if /i "%1" == "-configureonly" (set __ConfigureOnly=1&set __BuildNative=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) @@ -159,10 +167,13 @@ if /i "%1" == "-skipnative" (set __BuildNative=0&set processedArgs=!pro if /i "%1" == "-skipcrossarchnative" (set __SkipCrossArchNative=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "-skipgenerateversion" (set __SkipGenerateVersion=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "-skiprestoreoptdata" (set __RestoreOptData=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "-usenmakemakefiles" (set __NMakeMakefiles=1&set __ConfigureOnly=1&set __BuildNative=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "-ninja" (set __Ninja=1&set __BuildNative=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "-pgoinstrument" (set __PgoInstrument=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "-enforcepgo" (set __EnforcePgo=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "-nopgooptimize" (set __PgoOptimize=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "-skipjit" (set __BuildJit=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "-skipalljits" (set __BuildAllJits=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "-skipruntime" (set __BuildRuntime=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) REM TODO these are deprecated remove them eventually REM don't add more, use the - syntax instead @@ -172,7 +183,8 @@ if /i "%1" == "skipnative" (set __BuildNative=0&set processedArgs=!proc if /i "%1" == "skipcrossarchnative" (set __SkipCrossArchNative=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "skipgenerateversion" (set __SkipGenerateVersion=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "skiprestoreoptdata" (set __RestoreOptData=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "usenmakemakefiles" (set __NMakeMakefiles=1&set __ConfigureOnly=1&set __BuildNative=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +REM Keep around usenmakemakefiles for usage by the jit-format tool +if /i "%1" == "usenmakemakefiles" (set __Ninja=1&set __BuildNative=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "pgoinstrument" (set __PgoInstrument=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "nopgooptimize" (set __PgoOptimize=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "enforcepgo" (set __EnforcePgo=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) @@ -208,10 +220,14 @@ if %__TotalSpecifiedBuildArch% GTR 1 ( ) if %__BuildArchX64%==1 set __BuildArch=x64 -if %__BuildArchX86%==1 set __BuildArch=x86 +if %__BuildArchX86%==1 ( + set __BuildArch=x86 + if /i "%__CrossOS%" NEQ "1" set __CrossArch=x64 +) if %__BuildArchArm%==1 ( set __BuildArch=arm set __CrossArch=x86 + if /i "%__CrossOS%" NEQ "1" set __CrossArch2=x64 ) if %__BuildArchArm64%==1 ( set __BuildArch=arm64 @@ -251,6 +267,9 @@ if %__SkipCrossArchNative% EQU 0 ( if /i "%__BuildArch%"=="arm" ( set __BuildCrossArchNative=1 ) + if /i "%__BuildArch%"=="x86" ( + set __BuildCrossArchNative=1 + ) ) ) @@ -265,13 +284,15 @@ set "__IntermediatesDir=%__RootBinDir%\obj\coreclr\%__TargetOS%.%__BuildArch%.%_ set "__LogsDir=%__RootBinDir%\log\!__BuildType!" set "__MsbuildDebugLogsDir=%__LogsDir%\MsbuildDebugLogs" set "__ArtifactsIntermediatesDir=%__RepoRootDir%\artifacts\obj\coreclr\" -if "%__NMakeMakefiles%"=="1" (set "__IntermediatesDir=%__RootBinDir%\nmakeobj\%__TargetOS%.%__BuildArch%.%__BuildType%") +if "%__Ninja%"=="1" (set "__IntermediatesDir=%__RootBinDir%\nmakeobj\%__TargetOS%.%__BuildArch%.%__BuildType%") set "__PackagesBinDir=%__BinDir%\.nuget" set "__CrossComponentBinDir=%__BinDir%" set "__CrossCompIntermediatesDir=%__IntermediatesDir%\crossgen" +set "__CrossComp2IntermediatesDir=%__IntermediatesDir%\crossgen_2" if NOT "%__CrossArch%" == "" set __CrossComponentBinDir=%__CrossComponentBinDir%\%__CrossArch% +if NOT "%__CrossArch2%" == "" set __CrossComponent2BinDir=%__BinDir%\%__CrossArch2% REM Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash set "__CMakeBinDir=%__BinDir%" @@ -282,8 +303,8 @@ if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%" if not exist "%__LogsDir%" md "%__LogsDir%" if not exist "%__MsbuildDebugLogsDir%" md "%__MsbuildDebugLogsDir%" -if not exist "%__RootBinDir%\Directory.Build.props" copy %__ProjectDir%\EmptyProps.props %__RootBinDir%\Directory.Build.props -if not exist "%__RootBinDir%\Directory.Build.targets" copy %__ProjectDir%\EmptyProps.props %__RootBinDir%\Directory.Build.targets +if not exist "%__RootBinDir%\Directory.Build.props" copy "%__ProjectDir%\EmptyProps.props" "%__RootBinDir%\Directory.Build.props" +if not exist "%__RootBinDir%\Directory.Build.targets" copy "%__ProjectDir%\EmptyProps.props" "%__RootBinDir%\Directory.Build.targets" REM Set up the directory for MSBuild debug logs. set MSBUILDDEBUGPATH=%__MsbuildDebugLogsDir% @@ -298,7 +319,7 @@ set __CMakeNeeded=1 if %__BuildNative%==0 if %__BuildCrossArchNative%==0 set __CMakeNeeded=0 if %__CMakeNeeded%==1 ( REM Eval the output from set-cmake-path.ps1 - for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\set-cmake-path.ps1"""') do %%a + for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__RepoRootDir%\eng\native\set-cmake-path.ps1"""') do %%a echo %__MsgPrefix%Using CMake from !CMakePath! ) @@ -324,9 +345,9 @@ REM ============================================================================ if %__SkipGenerateVersion% EQU 0 ( echo %__MsgPrefix%Generating native version headers - set "__BinLog=%__LogsDir%\GenerateVersionHeaders_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__BinLog=\"%__LogsDir%\GenerateVersionHeaders_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog\"" powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" /clp:nosummary %__ArcadeScriptArgs%^ - %__RepoRootDir%\eng\empty.csproj /t:GenerateRuntimeVersionFile /restore^ + "%__RepoRootDir%\eng\empty.csproj" /t:GenerateRuntimeVersionFile /restore^ /p:NativeVersionFile="%__RootBinDir%\obj\coreclr\_version.h"^ /p:RuntimeVersionFile="%__RootBinDir%\obj\coreclr\runtime_version.h"^ %__CommonMSBuildArgs% %__UnprocessedBuildArgs% /bl:!__BinLog! @@ -346,9 +367,9 @@ REM ============================================================================ set OptDataProjectFilePath=%__ProjectDir%\src\.nuget\optdata\optdata.csproj if %__RestoreOptData% EQU 1 ( echo %__MsgPrefix%Restoring the OptimizationData Package - set "__BinLog=%__LogsDir%\OptRestore_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__BinLog=\"%__LogsDir%\OptRestore_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog\"" powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" /clp:nosummary %__ArcadeScriptArgs%^ - %OptDataProjectFilePath% /t:Restore^ + "%OptDataProjectFilePath%" /t:Restore^ %__CommonMSBuildArgs% %__UnprocessedBuildArgs%^ /nodereuse:false /bl:!__BinLog! if not !errorlevel! == 0 ( @@ -359,8 +380,8 @@ if %__RestoreOptData% EQU 1 ( ) set __PgoOptDataPath= if %__PgoOptimize% EQU 1 ( - set PgoDataPackagePathOutputFile="%__IntermediatesDir%\optdatapath.txt" - set "__BinLog=%__LogsDir%\PgoVersionRead_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set PgoDataPackagePathOutputFile=%__IntermediatesDir%\optdatapath.txt + set "__BinLog=\"%__LogsDir%\PgoVersionRead_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog\"" REM Parse the optdata package versions out of msbuild so that we can pass them on to CMake powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" /clp:nosummary %__ArcadeScriptArgs%^ @@ -396,10 +417,12 @@ set _C= set /p PYTHON=<%TEMP%\pythonlocation.txt if NOT DEFINED PYTHON ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: Could not find a python installation + echo %__ErrMsgPrefix%%__MsgPrefix%Error: Could not find a Python installation. goto ExitWithError ) +set __CMakeClrBuildSubsetArgs="-DCLR_CMAKE_BUILD_SUBSET_JIT=%__BuildJit%" "-DCLR_CMAKE_BUILD_SUBSET_ALLJITS=%__BuildAllJits%" "-DCLR_CMAKE_BUILD_SUBSET_RUNTIME=%__BuildRuntime%" + REM ========================================================================================= REM === REM === Build Cross-Architecture Native Components (if applicable) @@ -425,36 +448,49 @@ if %__BuildCrossArchNative% EQU 1 ( set __CMakeBinDir=%__CrossComponentBinDir% set "__CMakeBinDir=!__CMakeBinDir:\=/!" - set __ExtraCmakeArgs="-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_TARGET_OS=%__TargetOS%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native" "-DCLR_REPO_ROOT_DIR=%__RepoRootDir%" %__CMakeArgs% - call "%__SourceDir%\pal\tools\gen-buildsys.cmd" "%__ProjectDir%" "%__CrossCompIntermediatesDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs! + + if %__Ninja% EQU 1 ( + set __ExtraCmakeArgs="-DCMAKE_BUILD_TYPE=!__BuildType!" + ) + + set __ExtraCmakeArgs=!__ExtraCmakeArgs! %__CMakeClrBuildSubsetArgs% "-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_TARGET_OS=%__TargetOS%" "-DCLR_CMAKE_PGO_INSTRUMENT=0" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native" "-DCLR_REPO_ROOT_DIR=%__RepoRootDir%" %__CMakeArgs% + call "%__RepoRootDir%\eng\native\gen-buildsys.cmd" "%__ProjectDir%" "%__CrossCompIntermediatesDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs! if not !errorlevel! == 0 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: failed to generate cross architecture native component build project! + echo %__ErrMsgPrefix%%__MsgPrefix%Error: failed to generate cross architecture native component build project %__CrossArch%! goto ExitWithError ) @if defined _echo @echo on :SkipConfigureCrossBuild if not exist "%__CrossCompIntermediatesDir%\CMakeCache.txt" ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: unable to find generated cross architecture native component build project! + echo %__ErrMsgPrefix%%__MsgPrefix%Error: unable to find generated cross architecture native component build project %__CrossArch%! goto ExitWithError ) if defined __ConfigureOnly goto SkipCrossCompBuild set __BuildLogRootName=Cross - set "__BuildLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log" - set "__BuildWrn=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn" - set "__BuildErr=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err" - set "__BinLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__BuildLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log"" + set "__BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn"" + set "__BuildErr="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err"" + set "__BinLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog"" set "__MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!" set "__MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!" set "__MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!" set "__MsbuildBinLog=/bl:!__BinLog!" - set "__Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! !__MsbuildBinLog!" + set "__Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! !__MsbuildBinLog! !__ConsoleLoggingParameters!" + + set __CmakeBuildToolArgs= - REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. - "%CMakePath%" --build %__CrossCompIntermediatesDir% --target install --config %__BuildType% -- /nologo /m !__Logging! + if %__Ninja% EQU 1 ( + set __CmakeBuildToolArgs= + ) else ( + REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. + set __CmakeBuildToolArgs=/nologo /m !__Logging! + ) + + "%CMakePath%" --build %__CrossCompIntermediatesDir% --target install --config %__BuildType% -- !__CmakeBuildToolArgs! if not !errorlevel! == 0 ( set __exitCode=!errorlevel! @@ -464,10 +500,85 @@ if %__BuildCrossArchNative% EQU 1 ( echo !__BuildErr! goto ExitWithCode ) - :SkipCrossCompBuild REM } Scope environment changes end endlocal + + if NOT "%__CrossArch2%" == "" ( + REM Scope environment changes start { + setlocal + + echo %__MsgPrefix%Commencing build of cross architecture native components for %__TargetOS%.%__BuildArch%.%__BuildType% hosted on %__CrossArch2% + + if /i "%__CrossArch2%" == "x86" ( set __VCBuildArch=x86 ) + if /i "%__CrossArch2%" == "x64" ( set __VCBuildArch=x86_amd64 ) + + echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch! + call "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch! + @if defined _echo @echo on + + if not exist "%__CrossComp2IntermediatesDir%" md "%__CrossComp2IntermediatesDir%" + if defined __SkipConfigure goto SkipConfigureCrossBuild2 + + set __CMakeBinDir="%__CrossComponent2BinDir%" + set "__CMakeBinDir=!__CMakeBinDir:\=/!" + + if %__Ninja% EQU 1 ( + set __ExtraCmakeArgs="-DCMAKE_BUILD_TYPE=!__BuildType!" + ) + + set __ExtraCmakeArgs=!__ExtraCmakeArgs! %__CMakeClrBuildSubsetArgs% "-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_TARGET_OS=%__TargetOS%" "-DCLR_CMAKE_PGO_INSTRUMENT=0" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=0" "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native" "-DCLR_REPO_ROOT_DIR=%__RepoRootDir%" %__CMakeArgs% + call "%__RepoRootDir%\eng\native\gen-buildsys.cmd" "%__ProjectDir%" "%__CrossComp2IntermediatesDir%" %__VSVersion% %__CrossArch2% !__ExtraCmakeArgs! + + if not !errorlevel! == 0 ( + echo %__ErrMsgPrefix%%__MsgPrefix%Error: failed to generate cross architecture native component build project %__CrossArch2%! + goto ExitWithError + ) + + set __VCBuildArch=x86_amd64 + if /i "%__CrossArch%" == "x86" ( set __VCBuildArch=x86 ) + @if defined _echo @echo on + + if not exist "%__CrossComp2IntermediatesDir%\CMakeCache.txt" ( + echo %__ErrMsgPrefix%%__MsgPrefix%Error: unable to find generated cross architecture native component build project %__CrossArch2%! + goto ExitWithError + ) + +:SkipConfigureCrossBuild2 + set __BuildLogRootName=Cross2 + set "__BuildLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log" + set "__BuildWrn=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn" + set "__BuildErr=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err" + set "__BinLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!" + set "__MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!" + set "__MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!" + set "__MsbuildBinLog=/bl:!__BinLog!" + set "__Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! !__MsbuildBinLog! !__ConsoleLoggingParameters!" + + set __CmakeBuildToolArgs= + + if %__Ninja% EQU 1 ( + set __CmakeBuildToolArgs= + ) else ( + REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. + set __CmakeBuildToolArgs=/nologo /m !__Logging! + ) + + "%CMakePath%" --build %__CrossComp2IntermediatesDir% --target install --config %__BuildType% -- !__CmakeBuildToolArgs! + + if not !errorlevel! == 0 ( + set __exitCode=!errorlevel! + echo %__ErrMsgPrefix%%__MsgPrefix%Error: cross-arch components build failed. Refer to the build log files for details. + echo !__BuildLog! + echo !__BuildWrn! + echo !__BuildErr! + goto ExitWithCode + ) +:SkipCrossCompBuild2 + REM } Scope environment changes end + endlocal + ) ) REM ========================================================================================= @@ -508,8 +619,12 @@ if %__BuildNative% EQU 1 ( echo %__MsgPrefix%Regenerating the Visual Studio solution - set __ExtraCmakeArgs="-DCMAKE_SYSTEM_VERSION=10.0" !___CrossBuildDefine! "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native" "-DCLR_REPO_ROOT_DIR=%__RepoRootDir%" %__CMakeArgs% - call "%__SourceDir%\pal\tools\gen-buildsys.cmd" "%__ProjectDir%" "%__IntermediatesDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs! + if %__Ninja% EQU 1 ( + set __ExtraCmakeArgs="-DCMAKE_BUILD_TYPE=!__BuildType!" + ) + + set __ExtraCmakeArgs=!__ExtraCmakeArgs! !___CrossBuildDefine! %__CMakeClrBuildSubsetArgs% "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native" "-DCLR_REPO_ROOT_DIR=%__RepoRootDir%" %__CMakeArgs% + call "%__RepoRootDir%\eng\native\gen-buildsys.cmd" "%__ProjectDir%" "%__IntermediatesDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs! if not !errorlevel! == 0 ( echo %__ErrMsgPrefix%%__MsgPrefix%Error: failed to generate native component build project! goto ExitWithError @@ -526,18 +641,25 @@ if %__BuildNative% EQU 1 ( if defined __ConfigureOnly goto SkipNativeBuild set __BuildLogRootName=CoreCLR - set "__BuildLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log" - set "__BuildWrn=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn" - set "__BuildErr=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err" - set "__BinLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__BuildLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log"" + set "__BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn"" + set "__BuildErr="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err"" + set "__BinLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog"" set "__MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!" set "__MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!" set "__MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!" set "__MsbuildBinLog=/bl:!__BinLog!" - set "__Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! !__MsbuildBinLog!" + set "__Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! !__MsbuildBinLog! !__ConsoleLoggingParameters!" - REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. - "%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- /nologo /m !__Logging! + set __CmakeBuildToolArgs= + if %__Ninja% EQU 1 ( + set __CmakeBuildToolArgs= + ) else ( + REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. + set __CmakeBuildToolArgs=/nologo /m !__Logging! + ) + + "%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- !__CmakeBuildToolArgs! if not !errorlevel! == 0 ( set __exitCode=!errorlevel! @@ -550,17 +672,17 @@ if %__BuildNative% EQU 1 ( if /i "%__BuildArch%" == "arm64" goto SkipCopyUcrt - set "__UCRTDir=%UniversalCRTSDKDIR%Redist\ucrxxxt\DLLs\%__BuildArch%\" - if not exist "!__UCRTDir!" set "__UCRTDir=%UniversalCRTSDKDIR%Redist\%UCRTVersion%\ucrt\DLLs\%__BuildArch%\" - if not exist "!__UCRTDir!" ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: Please install the Redistributable Universal C Runtime. + if not defined UCRTVersion ( + echo %__ErrMsgPrefix%%__MsgPrefix%Error: Please install Windows 10 SDK. goto ExitWithError ) + set "__UCRTDir=%UniversalCRTSdkDir%Redist\%UCRTVersion%\ucrt\DLLs\%__BuildArch%\" + xcopy /Y/I/E/D/F "!__UCRTDir!*.dll" "%__BinDir%\Redist\ucrt\DLLs\%__BuildArch%" if not !errorlevel! == 0 ( set __exitCode=!errorlevel! - echo %__ErrMsgPrefix%%__MsgPrefix%Error: Failed to copy the CRT to the output. + echo %__ErrMsgPrefix%%__MsgPrefix%Error: Failed to copy the Universal CRT to the artifacts directory. goto ExitWithCode ) diff --git a/src/coreclr/build-runtime.sh b/src/coreclr/build-runtime.sh index 24bb0067380b..a2e7313f4f3d 100755 --- a/src/coreclr/build-runtime.sh +++ b/src/coreclr/build-runtime.sh @@ -22,6 +22,10 @@ usage_list+=("-nopgooptimize: do not use profile guided optimizations.") usage_list+=("-pgoinstrument: generate instrumented code for profile guided optimization enabled binaries.") usage_list+=("-skipcrossarchnative: Skip building cross-architecture native binaries.") usage_list+=("-staticanalyzer: skip native image generation.") +usage_list+=("-skipjit: skip building jit.") +usage_list+=("-skipalljits: skip building crosstargetting jits.") +usage_list+=("-skipruntime: skip building runtime.") +usage_list+=("-paltests: build the pal tests.") setup_dirs_local() { @@ -95,7 +99,7 @@ build_cross_architecture_components() export __CMakeBinDir CROSSCOMPILE __CMakeArgs="-DCLR_CMAKE_TARGET_ARCH=$__BuildArch -DCLR_CROSS_COMPONENTS_BUILD=1 $__CMakeArgs" - build_native "$__CrossArch" "$__ProjectRoot" "$__ProjectRoot" "$intermediatesForBuild" "cross-architecture components" + build_native "$__TargetOS" "$__CrossArch" "$__ProjectRoot" "$__ProjectRoot" "$intermediatesForBuild" "$__CMakeArgs" "cross-architecture components" CROSSCOMPILE=1 export CROSSCOMPILE @@ -121,6 +125,21 @@ handle_arguments_local() { __StaticAnalyzer=1 ;; + skipjit|-skipjit) + __BuildJit=0 + ;; + + skipalljits|-skipalljits) + __BuildAllJits=0 + ;; + + skipruntime|-skipruntime) + __BuildRuntime=0 + ;; + + paltests|-paltests) + __BuildPALTests=1 + ;; *) __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1" ;; @@ -173,13 +192,12 @@ __UseNinja=0 __VerboseBuild=0 __ValidateCrossArg=1 __CMakeArgs="" +__BuildPALTests=0 +__BuildAllJits=1 +__BuildRuntime=1 source "$__ProjectRoot"/_build-commons.sh -if [[ "${__BuildArch}" != "${__HostArch}" ]]; then - __CrossBuild=1 -fi - # Set dependent variables # Set the remaining variables based upon the determined build configuration @@ -229,6 +247,8 @@ restore_optdata # Build the coreclr (native) components. __CMakeArgs="-DCLR_CMAKE_PGO_INSTRUMENT=$__PgoInstrument -DCLR_CMAKE_OPTDATA_PATH=$__PgoOptDataPath -DCLR_CMAKE_PGO_OPTIMIZE=$__PgoOptimize -DCLR_REPO_ROOT_DIR=\"$__RepoRootDir\" $__CMakeArgs" +__CMakeArgs="-DCLR_CMAKE_BUILD_SUBSET_JIT=$__BuildJit -DCLR_CMAKE_BUILD_SUBSET_ALLJITS=$__BuildAllJits -DCLR_CMAKE_BUILD_SUBSET_RUNTIME=$__BuildRuntime $__CMakeArgs" +__CMakeArgs="-DCLR_CMAKE_BUILD_TESTS=$__BuildPALTests $__CMakeArgs" if [[ "$__SkipConfigure" == 0 && "$__CodeCoverage" == 1 ]]; then __CMakeArgs="-DCLR_CMAKE_ENABLE_CODE_COVERAGE=1 $__CMakeArgs" @@ -237,7 +257,7 @@ fi if [[ "$__SkipNative" == 1 ]]; then echo "Skipping CoreCLR component build." else - build_native "$__BuildArch" "$__ProjectRoot" "$__ProjectRoot" "$__IntermediatesDir" "CoreCLR component" + build_native "$__TargetOS" "$__BuildArch" "$__ProjectRoot" "$__ProjectRoot" "$__IntermediatesDir" "$__CMakeArgs" "CoreCLR component" # Build cross-architecture components if [[ "$__SkipCrossArchNative" != 1 ]]; then diff --git a/src/coreclr/build-test.cmd b/src/coreclr/build-test.cmd deleted file mode 100644 index d0d1a3331967..000000000000 --- a/src/coreclr/build-test.cmd +++ /dev/null @@ -1,746 +0,0 @@ -@if not defined _echo @echo off -setlocal EnableDelayedExpansion EnableExtensions - -:: Define a prefix for most output progress messages that come from this script. That makes -:: it easier to see where these are coming from. Note that there is a trailing space here. -set "__MsgPrefix=BUILDTEST: " - -echo %__MsgPrefix%Starting Build at %TIME% - - -set __ThisScriptDir="%~dp0" - -call "%__ThisScriptDir%"\setup_vs_tools.cmd -if NOT '%ERRORLEVEL%' == '0' exit /b 1 - -if defined VS160COMNTOOLS ( - set "__VSToolsRoot=%VS160COMNTOOLS%" - set "__VCToolsRoot=%VS160COMNTOOLS%\..\..\VC\Auxiliary\Build" - set __VSVersion=vs2019 -) else if defined VS150COMNTOOLS ( - set "__VSToolsRoot=%VS150COMNTOOLS%" - set "__VCToolsRoot=%VS150COMNTOOLS%\..\..\VC\Auxiliary\Build" - set __VSVersion=vs2017 -) - -:: Set the default arguments for build -set __BuildArch=x64 -set __BuildType=Debug -set __TargetOS=Windows_NT - -set "__ProjectDir=%~dp0" -:: remove trailing slash -if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%" -set "__RepoRootDir=%__ProjectDir%\..\.." -for %%i in ("%__RepoRootDir%") do SET "__RepoRootDir=%%~fi" - -set "__TestDir=%__RepoRootDir%\src\tests" -set "__ProjectFilesDir=%__TestDir%" -set "__SourceDir=%__ProjectDir%\src" -set "__RootBinDir=%__RepoRootDir%\artifacts" -set "__LogsDir=%__RootBinDir%\log" -set "__MsbuildDebugLogsDir=%__LogsDir%\MsbuildDebugLogs" - -:: Default __Exclude to issues.targets -set __Exclude=%__ProjectDir%\tests\issues.targets - -REM __UnprocessedBuildArgs are args that we pass to msbuild (e.g. /p:TargetArchitecture=x64) -set "__args= %*" -set processedArgs= -set __UnprocessedBuildArgs= -set __CommonMSBuildArgs= - -set __SkipRestorePackages= -set __SkipStressDependencies= -set __SkipManaged= -set __SkipTestWrappers= -set __BuildTestWrappersOnly= -set __SkipNative= -set __RuntimeId= -set __TargetsWindows=1 -set __DoCrossgen= -set __DoCrossgen2= -set __CompositeBuildMode= -set __CopyNativeTestBinaries=0 -set __CopyNativeProjectsAfterCombinedTestBuild=true -set __SkipGenerateLayout=0 -set __LocalCoreFXConfig=%__BuildType% -set __SkipFXRestoreArg= -set __GenerateLayoutOnly=0 - -@REM CMD has a nasty habit of eating "=" on the argument list, so passing: -@REM -priority=1 -@REM appears to CMD parsing as "-priority 1". Handle -priority specially to avoid problems, -@REM and allow the "-priority=1" syntax. -set __Priority=0 -set __PriorityArg= - -set __BuildNeedTargetArg= - -:Arg_Loop -if "%1" == "" goto ArgsDone - -if /i "%1" == "/?" goto Usage -if /i "%1" == "-?" goto Usage -if /i "%1" == "/h" goto Usage -if /i "%1" == "-h" goto Usage -if /i "%1" == "/help" goto Usage -if /i "%1" == "-help" goto Usage -if /i "%1" == "--help" goto Usage - -if /i "%1" == "x64" (set __BuildArch=x64&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "x86" (set __BuildArch=x86&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "arm" (set __BuildArch=arm&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "arm64" (set __BuildArch=arm64&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) - -if /i "%1" == "debug" (set __BuildType=Debug&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "release" (set __BuildType=Release&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "checked" (set __BuildType=Checked&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) - -if /i "%1" == "ci" (set __ArcadeScriptArgs="-ci"&set __ErrMsgPrefix=##vso[task.logissue type=error]&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) - -if /i "%1" == "skipstressdependencies" (set __SkipStressDependencies=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "skiprestorepackages" (set __SkipRestorePackages=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "skipmanaged" (set __SkipManaged=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "skipnative" (set __SkipNative=1&set __CopyNativeProjectsAfterCombinedTestBuild=false&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "skiptestwrappers" (set __SkipTestWrappers=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "skipgeneratelayout" (set __SkipGenerateLayout=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) - -if /i "%1" == "copynativeonly" (set __CopyNativeTestBinaries=1&set __SkipStressDependencies=1&set __SkipNative=1&set __CopyNativeProjectsAfterCombinedTestBuild=false&set __SkipGenerateLayout=1&set __SkipCrossgenFramework=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "generatelayoutonly" (set __SkipManaged=1&set __SkipNative=1&set __CopyNativeProjectsAfterCombinedTestBuild=false&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "buildtestwrappersonly" (set __SkipNative=1&set __SkipManaged=1&set __BuildTestWrappersOnly=1&set __SkipGenerateLayout=1&set __SkipStressDependencies=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "crossgenframeworkonly" (set __SkipRestorePackages=1&set __SkipStressDependencies=1&set __SkipNative=1&set __SkipManaged=1&set __SkipGenerateLayout=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) - -if /i "%1" == "buildagainstpackages" (echo error: Remove /BuildAgainstPackages switch&&exit /b1) -if /i "%1" == "crossgen" (set __DoCrossgen=1&set __TestBuildMode=crossgen&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -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" == "runtimeid" (set __RuntimeId=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) -if /i "%1" == "targetsNonWindows" (set __TargetsWindows=0&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) -if /i "%1" == "-priority" (set __Priority=%2&shift&set processedArgs=!processedArgs! %1=%2&shift&goto Arg_Loop) -if /i "%1" == "allTargets" (set "__BuildNeedTargetArg=/p:CLRTestBuildAllTargets=%1"&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) -if /i "%1" == "-excludemonofailures" (set __Mono=1&set processedArgs=!processedArgs!&shift&goto Arg_Loop) -if /i "%1" == "--" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) - -if [!processedArgs!]==[] ( - set __UnprocessedBuildArgs=%__args% -) else ( - set __UnprocessedBuildArgs=%__args% - for %%t in (!processedArgs!) do ( - set __UnprocessedBuildArgs=!__UnprocessedBuildArgs:*%%t=! - ) -) - -:ArgsDone - -@REM Special handling for -priority=N argument. -if %__Priority% GTR 0 ( - set "__PriorityArg=/p:CLRTestPriorityToBuild=%__Priority%" -) - -set TargetsWindowsArg= -set TargetsWindowsMsbuildArg= -if "%__TargetsWindows%"=="1" ( - set TargetsWindowsArg=-TargetsWindows=true - set TargetsWindowsMsbuildArg=/p:TargetsWindows=true -) else if "%__TargetsWindows%"=="0" ( - set TargetsWindowsArg=-TargetsWindows=false - set TargetsWindowsMsbuildArg=/p:TargetsWindows=false -) - -@if defined _echo @echo on - -set __CommonMSBuildArgs=/p:TargetOS=%__TargetOS% /p:Configuration=%__BuildType% /p:TargetArchitecture=%__BuildArch% -set __msbuildArgs=/p:TargetOS=%__TargetOS% /p:Configuration=%__BuildType% /p:TargetArchitecture=%__BuildArch% /nologo /verbosity:minimal /clp:Summary /maxcpucount - -echo %__MsgPrefix%Commencing CoreCLR test build - -set "__BinDir=%__RootBinDir%\bin\coreclr\%__TargetOS%.%__BuildArch%.%__BuildType%" -set "__TestRootDir=%__RootBinDir%\tests\coreclr" -set "__TestBinDir=%__TestRootDir%\%__TargetOS%.%__BuildArch%.%__BuildType%" - -if not defined XunitTestBinBase set XunitTestBinBase=%__TestBinDir%\ -set "CORE_ROOT=%XunitTestBinBase%\Tests\Core_Root" - -REM We have different managed and native intermediate dirs because the managed bits will include -REM the configuration information deeper in the intermediates path. -REM These variables are used by the msbuild project files. - -if not defined __TestIntermediateDir ( - set "__TestIntermediateDir=tests\coreclr\obj\%__TargetOS%.%__BuildArch%.%__BuildType%" -) -set "__NativeTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDir%\Native" -set "__ManagedTestIntermediatesDir=%__RootBinDir%\%__TestIntermediateDir%\Managed" - -REM Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash -set "__CMakeBinDir=%__TestBinDir%" -set "__CMakeBinDir=%__CMakeBinDir:\=/%" - -if not exist "%__TestBinDir%" md "%__TestBinDir%" -if not exist "%__NativeTestIntermediatesDir%" md "%__NativeTestIntermediatesDir%" -if not exist "%__ManagedTestIntermediatesDir%" md "%__ManagedTestIntermediatesDir%" -if not exist "%__LogsDir%" md "%__LogsDir%" -if not exist "%__MsbuildDebugLogsDir%" md "%__MsbuildDebugLogsDir%" - -REM Set up the directory for MSBuild debug logs. -set MSBUILDDEBUGPATH=%__MsbuildDebugLogsDir% - -REM ========================================================================================= -REM === -REM === Restore Build Tools -REM === -REM ========================================================================================= - -@if defined _echo @echo on - -set "__ToolsDir=%__ProjectDir%\Tools" - -REM ========================================================================================= -REM === -REM === Resolve runtime dependences -REM === -REM ========================================================================================= - -if defined __SkipStressDependencies goto skipstressdependencies - -call "%__ProjectDir%\tests\setup-stress-dependencies.cmd" /arch %__BuildArch% /outputdir %__BinDir% -if errorlevel 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: setup-stress-dependencies failed. - goto :Exit_Failure -) - -:skipstressdependencies -@if defined _echo @echo on - -REM ========================================================================================= -REM === -REM === Native test build section -REM === -REM ========================================================================================= - -if defined __SkipNative goto skipnative - -echo %__MsgPrefix%Commencing build of native test components for %__BuildArch%/%__BuildType% - -REM Set the environment for the native build - -REM Eval the output from set-cmake-path.ps1 -for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& ""%__SourceDir%\pal\tools\set-cmake-path.ps1"""') do %%a -echo %__MsgPrefix%Using CMake from !CMakePath! - -REM NumberOfCores is an WMI property providing number of physical cores on machine -REM processor(s). It is used to set optimal level of CL parallelism during native build step -if not defined NumberOfCores ( - REM Determine number of physical processor cores available on machine - set TotalNumberOfCores=0 - for /f "tokens=*" %%I in ( - 'wmic cpu get NumberOfCores /value ^| find "=" 2^>NUL' - ) do set %%I & set /a TotalNumberOfCores=TotalNumberOfCores+NumberOfCores - set NumberOfCores=!TotalNumberOfCores! -) -echo %__MsgPrefix%Number of processor cores %NumberOfCores% - -set __VCBuildArch=x86_amd64 -if /i "%__BuildArch%" == "x86" ( set __VCBuildArch=x86 ) -if /i "%__BuildArch%" == "arm" ( set __VCBuildArch=x86_arm ) -if /i "%__BuildArch%" == "arm64" ( set __VCBuildArch=x86_arm64 ) - -echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" %__VCBuildArch% -call "%__VCToolsRoot%\vcvarsall.bat" %__VCBuildArch% -@if defined _echo @echo on - -if not defined VSINSTALLDIR ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: VSINSTALLDIR variable not defined. - exit /b 1 -) -if not exist "%VSINSTALLDIR%DIA SDK" goto NoDIA - -set __ExtraCmakeArgs="-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native" -call "%__SourceDir%\pal\tools\gen-buildsys.cmd" "%__ProjectFilesDir%" "%__NativeTestIntermediatesDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs! - -if not !errorlevel! == 0 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: failed to generate native component build project! - exit /b 1 -) - -@if defined _echo @echo on - -if not exist "%__NativeTestIntermediatesDir%\CMakeCache.txt" ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: unable to find generated native component build project! - exit /b 1 -) - -echo Environment setup - -set __BuildLogRootName=Tests_Native -set __BuildLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log" -set __BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn" -set __BuildErr="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err" -set __MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog! -set __MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn! -set __MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr! -set __Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! - -REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. -"%CMakePath%" --build %__NativeTestIntermediatesDir% --target install --config %__BuildType% -- /nologo /m !__Logging! - -if errorlevel 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: native test build failed. - exit /b 1 -) - -:skipnative - -REM ========================================================================================= -REM === -REM === Restore product binaries from packages -REM === -REM ========================================================================================= - -if "%__SkipRestorePackages%" == "1" goto SkipRestoreProduct - -echo %__MsgPrefix%Restoring CoreCLR product from packages - -set __BuildLogRootName=Restore_Product -set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.log -set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn -set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.err -set __MsbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%" -set __MsbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%" -set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%" -set __Logging='!__MsbuildLog!' '!__MsbuildWrn!' '!__MsbuildErr!' - -powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -Command "%__RepoRootDir%\eng\common\msbuild.ps1" %__ArcadeScriptArgs%^ - %__ProjectDir%\tests\build.proj -warnAsError:0 /t:BatchRestorePackages /nodeReuse:false^ - /p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^ - /p:UsePartialNGENOptimization=false /maxcpucount^ - %__SkipFXRestoreArg%^ - !__Logging! %__CommonMSBuildArgs% %__PriorityArg% %__BuildNeedTargetArg% %__UnprocessedBuildArgs% - -if errorlevel 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: Package restoration failed. Refer to the build log files for details: - echo %__BuildLog% - echo %__BuildWrn% - echo %__BuildErr% - exit /b 1 -) - -:SkipRestoreProduct - -REM ========================================================================================= -REM === -REM === Managed test build section -REM === -REM ========================================================================================= - -if defined __SkipManaged goto SkipManagedBuild - -echo %__MsgPrefix%Starting the Managed Tests Build - -if not defined VSINSTALLDIR ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: build-test.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/runtime/tree/master/docs/workflow for build instructions. - exit /b 1 -) -set __AppendToLog=false -set __BuildLogRootName=Tests_Managed -set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.log -set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn -set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.err - -REM Execute msbuild test build in stages - workaround for excessive data retention in MSBuild ConfigCache -REM See https://github.com/Microsoft/msbuild/issues/2993 - -set __SkipPackageRestore=false -set __SkipTargetingPackBuild=false -set __NumberOfTestGroups=3 - -if %__Priority% GTR 0 (set __NumberOfTestGroups=10) -echo %__MsgPrefix%Building tests divided into %__NumberOfTestGroups% test groups - -set __CommonMSBuildCmdPrefix=powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -Command "!__RepoRootDir!\eng\common\msbuild.ps1" !__ArcadeScriptArgs! - -for /l %%G in (1, 1, %__NumberOfTestGroups%) do ( - - set __MsbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%";Append=!__AppendToLog! - set __MsbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%";Append=!__AppendToLog! - set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%";Append=!__AppendToLog! - set __Logging='!__MsbuildLog!' '!__MsbuildWrn!' '!__MsbuildErr!' - - set __TestGroupToBuild=%%G - - if not "%__CopyNativeTestBinaries%" == "1" ( - set __MSBuildBuildArgs=!__ProjectDir!\tests\build.proj - set __MSBuildBuildArgs=!__MSBuildBuildArgs! -warnAsError:0 - set __MSBuildBuildArgs=!__MSBuildBuildArgs! /nodeReuse:false - set __MSBuildBuildArgs=!__MSBuildBuildArgs! !__Logging! - set __MSBuildBuildArgs=!__MSBuildBuildArgs! !TargetsWindowsMsbuildArg! - set __MSBuildBuildArgs=!__MSBuildBuildArgs! !__msbuildArgs! - set __MSBuildBuildArgs=!__MSBuildBuildArgs! !__PriorityArg! !__BuildNeedTargetArg! - set __MSBuildBuildArgs=!__MSBuildBuildArgs! !__UnprocessedBuildArgs! - set __MSBuildBuildArgs=!__MSBuildBuildArgs! /p:CopyNativeProjectBinaries=!__CopyNativeProjectsAfterCombinedTestBuild! - set __MSBuildBuildArgs=!__MSBuildBuildArgs! /p:__SkipPackageRestore=true - set __MSBuildBuildArgs=!__MSBuildBuildArgs! !__SkipFXRestoreArg! - echo Running: msbuild !__MSBuildBuildArgs! - !__CommonMSBuildCmdPrefix! !__MSBuildBuildArgs! - - if errorlevel 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: managed test build failed. Refer to the build log files for details: - echo %__BuildLog% - echo %__BuildWrn% - echo %__BuildErr% - REM This is necessary because of a(n apparent) bug in the FOR /L command. Under certain circumstances, - REM such as when this script is invoke with CMD /C "build-test.cmd", a non-zero exit directly from - REM within the loop body will not propagate to the caller. For some reason, goto works around it. - goto :Exit_Failure - ) - ) else ( - set __MSBuildBuildArgs=!__ProjectDir!\tests\build.proj -warnAsError:0 /nodeReuse:false !__Logging! !TargetsWindowsMsbuildArg! !__msbuildArgs! !__PriorityArg! !__BuildNeedTargetArg! !__SkipFXRestoreArg! !__UnprocessedBuildArgs! "/t:CopyAllNativeProjectReferenceBinaries" - echo Running: msbuild !__MSBuildBuildArgs! - !__CommonMSBuildCmdPrefix! !__MSBuildBuildArgs! - - if errorlevel 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: copying native test binaries failed. Refer to the build log files for details: - echo %__BuildLog% - echo %__BuildWrn% - echo %__BuildErr% - REM This is necessary because of a(n apparent) bug in the FOR /L command. Under certain circumstances, - REM such as when this script is invoke with CMD /C "build-test.cmd", a non-zero exit directly from - REM within the loop body will not propagate to the caller. For some reason, goto works around it. - goto :Exit_Failure - ) - ) - - set __SkipPackageRestore=true - set __SkipTargetingPackBuild=true - set __AppendToLog=true -) - -if "%__CopyNativeTestBinaries%" == "1" goto :SkipManagedBuild - -REM Check that we've built about as many tests as we expect. This is primarily intended to prevent accidental changes that cause us to build -REM drastically fewer Pri-1 tests than expected. -echo %__MsgPrefix%Check the managed tests build -echo Running: dotnet msbuild %__ProjectDir%\tests\src\runtest.proj /t:CheckTestBuild /nodeReuse:false /p:CLRTestPriorityToBuild=%__Priority% %__SkipFXRestoreArg% %__msbuildArgs% %__unprocessedBuildArgs% -powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" %__ArcadeScriptArgs%^ - %__ProjectDir%\tests\src\runtest.proj /t:CheckTestBuild /nodeReuse:false /p:CLRTestPriorityToBuild=%__Priority% %__msbuildArgs% %__unprocessedBuildArgs% -if errorlevel 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: Check Test Build failed. - exit /b 1 -) - -:SkipManagedBuild - -if "%__SkipGenerateLayout%" == "1" goto SkipGenerateLayout - -REM ========================================================================================= -REM === -REM === Prepare the test drop -REM === -REM ========================================================================================= - -echo %__MsgPrefix%Removing 'ni' files and 'lock' folders from %__TestBinDir% -REM Remove any NI from previous runs. -powershell -NoProfile "Get-ChildItem -path %__TestBinDir% -Include '*.ni.*' -Recurse -Force | Remove-Item -force" -REM Remove any lock folder used for synchronization from previous runs. -powershell -NoProfile "Get-ChildItem -path %__TestBinDir% -Include 'lock' -Recurse -Force | where {$_.Attributes -eq 'Directory'}| Remove-Item -force -Recurse" - -set CORE_ROOT=%__TestBinDir%\Tests\Core_Root -if exist "%CORE_ROOT%" rd /s /q "%CORE_ROOT%" -md "%CORE_ROOT%" - -REM ========================================================================================= -REM === -REM === Create the test overlay -REM === -REM ========================================================================================= - -echo %__MsgPrefix%Creating test overlay - -set RuntimeIdArg= -if defined __RuntimeId ( - set RuntimeIdArg=/p:RuntimeId="%__RuntimeId%" -) - -set __BuildLogRootName=Tests_Overlay_Managed -set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.log -set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn -set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.err -set __MsbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%" -set __MsbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%" -set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%" -set __Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! - -powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" %__ArcadeScriptArgs%^ - %__ProjectDir%\tests\src\runtest.proj /t:CreateTestOverlay /nodeReuse:false^ - /p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^ - /p:UsePartialNGENOptimization=false /maxcpucount^ - %__SkipFXRestoreArg%^ - !__Logging! %__CommonMSBuildArgs% %RuntimeIdArg% %__PriorityArg% %__BuildNeedTargetArg% %__UnprocessedBuildArgs% -if errorlevel 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: Create Test Overlay failed. Refer to the build log files for details: - echo %__BuildLog% - echo %__BuildWrn% - echo %__BuildErr% - exit /b 1 -) - -:SkipGenerateLayout - -REM ========================================================================================= -REM === -REM === Create test wrappers. -REM === -REM ========================================================================================= - -if defined __BuildTestWrappersOnly goto BuildTestWrappers - -if defined __SkipManaged goto SkipBuildingWrappers -if defined __SkipTestWrappers goto SkipBuildingWrappers - -:BuildTestWrappers -echo %__MsgPrefix%Creating test wrappers - -set __BuildLogRootName=Tests_XunitWrapper -set __BuildLog=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.log -set __BuildWrn=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn -set __BuildErr=%__LogsDir%\%__BuildLogRootName%_%__TargetOS%__%__BuildArch%__%__BuildType%.err -set __MsbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%" -set __MsbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%" -set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%" -set __Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! - -if %%__Mono%%==1 ( - set RuntimeFlavor="mono" -) else ( - set RuntimeFlavor="coreclr" -) - -REM Build wrappers using the local SDK's msbuild. As we move to arcade, the other builds should be moved away from run.exe as well. -call "%__RepoRootDir%\dotnet.cmd" msbuild %__ProjectDir%\tests\src\runtest.proj /nodereuse:false /p:BuildWrappers=true /p:TestBuildMode=%__TestBuildMode% !__Logging! %__msbuildArgs% %TargetsWindowsMsbuildArg% %__SkipFXRestoreArg% %__UnprocessedBuildArgs% /p:RuntimeFlavor=%RuntimeFlavor% -if errorlevel 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: XUnit wrapper build failed. Refer to the build log files for details: - echo %__BuildLog% - echo %__BuildWrn% - echo %__BuildErr% - exit /b 1 -) - -echo { "build_os": "%__TargetOS%", "build_arch": "%__BuildArch%", "build_type": "%__BuildType%" } > "%__TestBinDir%/build_info.json" - -:SkipBuildingWrappers - -REM ========================================================================================= -REM === -REM === Crossgen assemblies if needed. -REM === -REM ========================================================================================= - -if defined __SkipCrossgenFramework goto SkipCrossgen -if defined __BuildTestWrappersOnly goto SkipCrossgen - -set __CrossgenArg = "" -if defined __DoCrossgen ( - set __CrossgenArg="/p:Crossgen=true" - if "%__TargetsWindows%" == "1" ( - echo %__MsgPrefix%Running crossgen on framework assemblies in CORE_ROOT: %CORE_ROOT% - call :PrecompileFX - if ERRORLEVEL 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: crossgen precompilation of framework assemblies failed - exit /b 1 - ) - ) else ( - echo "%__MsgPrefix%Crossgen only supported on Windows, for now" - ) -) - -if defined __DoCrossgen2 ( - set __CrossgenArg="/p:Crossgen2=true" - echo %__MsgPrefix%Running crossgen2 on framework assemblies in CORE_ROOT: %CORE_ROOT% - call :PrecompileFX - if ERRORLEVEL 1 ( - echo %__ErrMsgPrefix%%__MsgPrefix%Error: crossgen2 precompilation of framework assemblies failed - exit /b 1 - ) -) - -:SkipCrossgen - -REM ========================================================================================= -REM === -REM === All builds complete! -REM === -REM ========================================================================================= -:TestBuildDone - -echo %__MsgPrefix%Test build succeeded. Finished at %TIME% -echo %__MsgPrefix%Test binaries are available at !__TestBinDir! -exit /b 0 - -:Usage -echo. -echo Build the CoreCLR tests. -echo. -echo Usage: -echo %0 [option1] [option2] ... -echo All arguments are optional. Options are case-insensitive. The options are: -echo. -echo.-? -h -help --help: view this message. -echo Build architecture: one of x64, x86, arm, arm64 ^(default: x64^). -echo Build type: one of Debug, Checked, Release ^(default: Debug^). -echo skipmanaged: skip the managed tests build -echo skipnative: skip the native tests build -echo skiprestorepackages: skip package restore -echo runtimeid ^: Builds a test overlay for the specified OS ^(Only supported when building against packages^). Supported IDs are: -echo alpine.3.4.3-x64: Builds overlay for Alpine 3.4.3 -echo debian.8-x64: Builds overlay for Debian 8 -echo fedora.24-x64: Builds overlay for Fedora 24 -echo linux-x64: Builds overlay for portable linux -echo opensuse.42.1-x64: Builds overlay for OpenSUSE 42.1 -echo osx.10.12-x64: Builds overlay for OSX 10.12 -echo osx-x64: Builds overlay for portable OSX -echo rhel.7-x64: Builds overlay for RHEL 7 or CentOS -echo ubuntu.14.04-x64: Builds overlay for Ubuntu 14.04 -echo ubuntu.16.04-x64: Builds overlay for Ubuntu 16.04 -echo ubuntu.16.10-x64: Builds overlay for Ubuntu 16.10 -echo win-x64: Builds overlay for portable Windows -echo win7-x64: Builds overlay for Windows 7 -echo crossgen: Precompiles the framework managed assemblies -echo copynativeonly: Only copy the native test binaries to the managed output. Do not build the native or managed tests. -echo skipgeneratelayout: Do not generate the Core_Root layout -echo generatelayoutonly: Generate the Core_Root layout without building managed or native test components -echo targetsNonWindows: -echo Exclude- Optional parameter - specify location of default exclusion file ^(defaults to tests\issues.targets if not specified^) -echo Set to "" to disable default exclusion file. -echo -- ... : all arguments following this tag will be passed directly to msbuild. -echo -priority=^ : specify a set of tests that will be built and run, with priority N. -echo 0: Build only priority 0 cases as essential testcases (default) -echo 1: Build all tests with priority 0 and 1 -echo 666: Build all tests with priority 0, 1 ... 666 -echo allTargets: Build managed tests for all target platforms. -echo -verbose: enables detailed file logging for the msbuild tasks into the msbuild log file. -exit /b 1 - -:NoDIA -echo Error: DIA SDK is missing at "%VSINSTALLDIR%DIA SDK". ^ -Did you install all the requirements for building on Windows, including the "Desktop Development with C++" workload? ^ -Please see https://github.com/dotnet/runtime/blob/master/docs/workflow/requirements/windows-requirements.md ^ -Another possibility is that you have a parallel installation of Visual Studio and the DIA SDK is there. In this case it ^ -may help to copy its "DIA SDK" folder into "%VSINSTALLDIR%" manually, then try again. -exit /b 1 - -:PrecompileFX -set __TotalPrecompiled=0 -set __FailedToPrecompile=0 -set __FailedAssemblies= -set __CompositeOutputDir=%CORE_ROOT%\composite.out -set __CompositeResponseFile=%__CompositeOutputDir%\framework-r2r.dll.rsp - -set __CrossgenDir=%__BinDir% -if /i "%__BuildArch%" == "arm" (set __CrossgenDir=!__CrossgenDir!\x86) -if /i "%__BuildArch%" == "arm64" (set __CrossgenDir=!__CrossgenDir!\x64) - -set __CrossgenExe="%__CrossgenDir%\crossgen.exe" -set __Crossgen2Dll="%__RepoRootDir%\dotnet.cmd" "%__CrossgenDir%\crossgen2\crossgen2.dll" - -if defined __CompositeBuildMode ( - mkdir !__CompositeOutputDir! - del /Q !__CompositeResponseFile! - echo --composite>>!__CompositeResponseFile! - echo -O>>!__CompositeResponseFile! - echo --targetarch:%__BuildArch%>>!__CompositeResponseFile! - echo --out^:%__CompositeOutputDir%\framework-r2r.dll>>!__CompositeResponseFile! -) - -for %%F in ("%CORE_ROOT%\System.*.dll";"%CORE_ROOT%\Microsoft.*.dll";%CORE_ROOT%\netstandard.dll;%CORE_ROOT%\mscorlib.dll) do ( - if not "%%~nxF"=="System.Runtime.WindowsRuntime.dll" ( - if defined __CompositeBuildMode ( - echo %%F>>!__CompositeResponseFile! - ) else ( - call :PrecompileAssembly %%F %%~nxF __TotalPrecompiled __FailedToPrecompile __FailedAssemblies - echo Processed: !__TotalPrecompiled!, failed !__FailedToPrecompile! - ) - )) -) - -if defined __CompositeBuildMode ( - echo Composite response line^: %__CompositeResponseFile% - type "%__CompositeResponseFile%" -) - -if defined __CompositeBuildMode ( - set __CompositeCommandLine=%__Crossgen2Dll% - set __CompositeCommandLine=!__CompositeCommandLine! "@%__CompositeResponseFile%" - echo Building composite R2R framework^: !__CompositeCommandLine! - call !__CompositeCommandLine! - set __FailedToPrecompile=!ERRORLEVEL! - copy /Y "!__CompositeOutputDir!\*.*" "!CORE_ROOT!\" -) - -if !__FailedToPrecompile! NEQ 0 ( - @echo Failed assemblies: - FOR %%G IN (!__FailedAssemblies!) do echo %%G -) - -exit /b !__FailedToPrecompile! - -REM Compile the managed assemblies in Core_ROOT before running the tests -:PrecompileAssembly - -set AssemblyPath=%1 -set AssemblyName=%2 - -REM Intentionally avoid using the .dll extension to prevent -REM subsequent compilations from picking it up as a reference -set __CrossgenOutputFile=%CORE_ROOT%\temp.ni._dll -set __CrossgenResponseFile="%CORE_ROOT%\%AssemblyName%.rsp -set __CrossgenCmd= - -del /Q %__CrossgenResponseFile% - -if defined __DoCrossgen ( - set __CrossgenCmd=!__CrossgenExe! @!__CrossgenResponseFile! - echo /Platform_Assemblies_Paths "!CORE_ROOT!">>!__CrossgenResponseFile! - echo /in !AssemblyPath!>>!__CrossgenResponseFile! - echo /out !__CrossgenOutputFile!>>!__CrossgenResponseFile! -) else ( - set __CrossgenCmd=!__Crossgen2Dll! @!__CrossgenResponseFile! - echo -r:!CORE_ROOT!\System.*.dll>>!__CrossgenResponseFile! - echo -r:!CORE_ROOT!\Microsoft.*.dll>>!__CrossgenResponseFile! - echo -r:!CORE_ROOT!\mscorlib.dll>>!__CrossgenResponseFile! - echo -r:!CORE_ROOT!\netstandard.dll>>!__CrossgenResponseFile! - echo -O>>!__CrossgenResponseFile! - echo --inputbubble>>!__CrossgenResponseFile! - echo --out:!__CrossgenOutputFile!>>!__CrossgenResponseFile! - echo !AssemblyPath!>>!__CrossgenResponseFile! - echo --targetarch:!__BuildArch!>>!__CrossgenResponseFile! -) - -echo !__CrossgenCmd! -call !__CrossgenCmd! - -set /a __exitCode = !errorlevel! - -set /a "%~3+=1" - -if "%__exitCode%" == "-2146230517" ( - echo %AssemblyPath% is not a managed assembly. - exit /b 0 -) - -if %__exitCode% neq 0 ( - echo Unable to precompile %AssemblyPath%, exit code is %__exitCode% - set /a "%~4+=1" - set "%~5=!%~5!,!AssemblyName!" - exit /b 0 -) - -REM Delete original .dll & replace it with the Crossgened .dll -del %AssemblyPath% -ren "%__CrossgenOutputFile%" %AssemblyName% - -echo Successfully precompiled %AssemblyPath% -exit /b 0 - -:Exit_Failure -exit /b 1 diff --git a/src/coreclr/build-test.sh b/src/coreclr/build-test.sh deleted file mode 100755 index b67fbef45f92..000000000000 --- a/src/coreclr/build-test.sh +++ /dev/null @@ -1,779 +0,0 @@ -#!/usr/bin/env bash - -build_test_wrappers() -{ - if [[ "$__BuildTestWrappers" -ne -0 ]]; then - echo "${__MsgPrefix}Creating test wrappers..." - - if [[ $__Mono -eq 1 ]]; then - __RuntimeFlavor="mono" - else - __RuntimeFlavor="coreclr" - fi - - __Exclude="${__ProjectDir}/tests/issues.targets" - __BuildLogRootName="Tests_XunitWrapper" - - export __Exclude __BuildLogRootName - - buildVerbosity="Summary" - - if [[ "$__VerboseBuild" == 1 ]]; then - buildVerbosity="Diag" - fi - - # Set up directories and file names - __BuildLogRootName="$subDirectoryName" - __BuildLog="$__LogsDir/${__BuildLogRootName}.${__TargetOS}.${__BuildArch}.${__BuildType}.log" - __BuildWrn="$__LogsDir/${__BuildLogRootName}.${__TargetOS}.${__BuildArch}.${__BuildType}.wrn" - __BuildErr="$__LogsDir/${__BuildLogRootName}.${__TargetOS}.${__BuildArch}.${__BuildType}.err" - __MsbuildLog="/fileloggerparameters:\"Verbosity=normal;LogFile=${__BuildLog}\"" - __MsbuildWrn="/fileloggerparameters1:\"WarningsOnly;LogFile=${__BuildWrn}\"" - __MsbuildErr="/fileloggerparameters2:\"ErrorsOnly;LogFile=${__BuildErr}\"" - __Logging="$__MsbuildLog $__MsbuildWrn $__MsbuildErr /consoleloggerparameters:$buildVerbosity" - - nextCommand="\"${__DotNetCli}\" msbuild \"${__ProjectDir}/tests/src/runtest.proj\" /nodereuse:false /p:BuildWrappers=true /p:TestBuildMode=$__TestBuildMode /p:TargetsWindows=false $__Logging /p:TargetOS=$__TargetOS /p:Configuration=$__BuildType /p:TargetArchitecture=$__BuildArch /p:RuntimeFlavor=$__RuntimeFlavor \"/bl:${__RepoRootDir}/artifacts/log/${__BuildType}/build_test_wrappers_${__RuntimeFlavor}.binlog\" ${__UnprocessedBuildArgs[@]}" - eval $nextCommand - - local exitCode="$?" - if [[ "$exitCode" -ne 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Error: XUnit wrapper build failed. Refer to the build log files for details (above)" - exit "$exitCode" - else - echo "XUnit Wrappers have been built." - echo { "\"build_os\"": "\"${__TargetOS}\"", "\"build_arch\"": "\"${__BuildArch}\"", "\"build_type\"": "\"${__BuildType}\"" } > "${__TestWorkingDir}/build_info.json" - - fi - fi -} - -build_mono_aot() -{ - __RuntimeFlavor="mono" - __MonoBinDir="$__RootBinDir/bin/mono/$__TargetOS.$__BuildArch.$__BuildType" - __Exclude="${__ProjectDir}/tests/issues.targets" - __TestBinDir="$__TestWorkingDir" - CORE_ROOT="$__TestBinDir"/Tests/Core_Root - export __Exclude - export CORE_ROOT - build_MSBuild_projects "Tests_MonoAot" "$__ProjectDir/tests/src/runtest.proj" "Mono AOT compile tests" "/t:MonoAotCompileTests" "/p:RuntimeFlavor=$__RuntimeFlavor" "/p:MonoLlvmPath=$__MonoBinDir" -} - -generate_layout() -{ - echo "${__MsgPrefix}Creating test overlay..." - - __ProjectFilesDir="$__TestDir" - __TestBinDir="$__TestWorkingDir" - - if [[ "$__RebuildTests" -ne 0 ]]; then - if [[ -d "${__TestBinDir}" ]]; then - echo "Removing tests build dir: ${__TestBinDir}" - rm -rf "$__TestBinDir" - fi - fi - - __CMakeBinDir="${__TestBinDir}" - - if [[ -z "$__TestIntermediateDir" ]]; then - __TestIntermediateDir="tests/obj/${__TargetOS}.${__BuildArch}.${__BuildType}" - fi - - echo "__TargetOS: ${__TargetOS}" - echo "__BuildArch: ${__BuildArch}" - echo "__BuildType: ${__BuildType}" - echo "__TestIntermediateDir: ${__TestIntermediateDir}" - - if [[ ! -f "$__TestBinDir" ]]; then - echo "Creating TestBinDir: ${__TestBinDir}" - mkdir -p "$__TestBinDir" - fi - if [[ ! -f "$__LogsDir" ]]; then - echo "Creating LogsDir: ${__LogsDir}" - mkdir -p "$__LogsDir" - fi - if [[ ! -f "$__MsbuildDebugLogsDir" ]]; then - echo "Creating MsbuildDebugLogsDir: ${__MsbuildDebugLogsDir}" - mkdir -p "$__MsbuildDebugLogsDir" - fi - - # Set up the directory for MSBuild debug logs. - MSBUILDDEBUGPATH="${__MsbuildDebugLogsDir}" - export MSBUILDDEBUGPATH - - __BuildProperties="-p:TargetOS=${__TargetOS} -p:TargetArchitecture=${__BuildArch} -p:Configuration=${__BuildType}" - - # ========================================================================================= - # === - # === Restore product binaries from packages - # === - # ========================================================================================= - - build_MSBuild_projects "Restore_Packages" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "/t:BatchRestorePackages" - - if [[ -n "$__UpdateInvalidPackagesArg" ]]; then - __up="/t:UpdateInvalidPackageVersions" - fi - - echo "${__MsgPrefix}Creating test overlay..." - - if [[ -z "$xUnitTestBinBase" ]]; then - xUnitTestBinBase="$__TestWorkingDir" - fi - - CORE_ROOT="$xUnitTestBinBase"/Tests/Core_Root - export CORE_ROOT - - if [[ -d "${CORE_ROOT}" ]]; then - rm -rf "$CORE_ROOT" - fi - - mkdir -p "$CORE_ROOT" - - chmod +x "$__BinDir"/corerun - - build_MSBuild_projects "Tests_Overlay_Managed" "${__ProjectDir}/tests/src/runtest.proj" "Creating test overlay" "/t:CreateTestOverlay" - - if [[ "$__TargetOS" != "OSX" && "$__SkipStressDependencies" == 0 ]]; then - nextCommand="\"${__RepoRootDir}/src/coreclr/tests/setup-stress-dependencies.sh\" --arch=$__BuildArch --outputDir=$CORE_ROOT" - echo "Resolve runtime dependences via $nextCommand" - eval $nextCommand - - local exitCode="$?" - if [[ "$exitCode" != 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Error: setup-stress-dependencies failed." - exit "$exitCode" - fi - fi - - # Precompile framework assemblies with crossgen if required - if [[ "$__DoCrossgen" != 0 || "$__DoCrossgen2" != 0 ]]; then - chmod +x "$__CrossgenExe" - if [[ "$__SkipCrossgenFramework" == 0 ]]; then - precompile_coreroot_fx - fi - fi -} - -precompile_coreroot_fx() -{ - local overlayDir="$CORE_ROOT" - local compilerName=Crossgen - - # Read the exclusion file for this platform - skipCrossGenFiles=($(grep -v '^#' "$(dirname "$0")/tests/skipCrossGenFiles.${__BuildArch}.txt" 2> /dev/null)) - skipCrossGenFiles+=('System.Runtime.WindowsRuntime.dll') - - # Temporary output folder for Crossgen2-compiled assemblies - local outputDir="$overlayDir"/out - - # Delete previously crossgened assemblies - rm "$overlayDir"/*.ni.dll 2>/dev/null - - if [[ "$__DoCrossgen2" != 0 ]]; then - compilerName=Crossgen2 - - mkdir "$outputDir" - fi - - echo "${__MsgPrefix}Running ${compilerName} on framework assemblies in CORE_ROOT: '${CORE_ROOT}'" - - local totalPrecompiled=0 - local failedToPrecompile=0 - local compositeOutputFile=$outputDir/framework-r2r.dll - local compositeResponseFile=$compositeOutputFile.rsp - local compositeCommandLine="${__DotNetCli} $__Crossgen2Dll @$compositeResponseFile" - - if [[ "$__CompositeBuildMode" != 0 ]]; then - rm $compositeResponseFile 2>/dev/null - echo --composite>>$compositeResponseFile - echo -O>>$compositeResponseFile - echo --out:$compositeOutputFile>>$compositeResponseFile - echo --targetarch:${__BuildArch}>>$compositeResponseFile - fi - - declare -a failedAssemblies - - filesToPrecompile=$(find -L "$overlayDir" -maxdepth 1 -iname Microsoft.\*.dll -o -iname System.\*.dll -o -iname netstandard.dll -o -iname mscorlib.dll -type f) - for fileToPrecompile in ${filesToPrecompile}; do - local filename="$fileToPrecompile" - if is_skip_crossgen_test "$(basename $filename)"; then - continue - fi - - if [[ "$__CompositeBuildMode" != 0 ]]; then - echo $filename>>$compositeResponseFile - continue - fi - - local commandLine="" - local responseFile="$overlayDir/$(basename $filename).rsp" - - rm $responseFile 2>/dev/null - - if [[ "$__DoCrossgen" != 0 ]]; then - commandLine="$__CrossgenExe @$responseFile" - echo /Platform_Assemblies_Paths>>$responseFile - echo $overlayDir>>$responseFile - echo $filename>>$responseFile - fi - - if [[ "$__DoCrossgen2" != 0 ]]; then - commandLine="${__DotNetCli} $__Crossgen2Dll @$responseFile" - echo -O>>$responseFile - echo --inputbubble>>$responseFile - echo --out:$outputDir/$(basename $filename)>>$responseFile - echo --targetarch:${__BuildArch}>>$responseFile - echo $filename>>$responseFile - for reference in $overlayDir/*.dll; do - echo -r:$reference>>$responseFile - done - fi - - echo Precompiling "$filename" - $commandLine 1> "$filename".stdout 2> "$filename".stderr - local exitCode="$?" - if [[ "$exitCode" != 0 ]]; then - if grep -q -e '0x80131018' "$filename".stderr; then - printf "\n\t$filename is not a managed assembly.\n\n" - else - echo Unable to precompile "$filename", exit code is "$exitCode". - echo Command-line: "$commandLine" - cat "$filename".stdout - cat "$filename".stderr - failedAssemblies+=($(basename -- "$filename")) - failedToPrecompile=$((failedToPrecompile+1)) - fi - else - rm "$filename".{stdout,stderr} - fi - - totalPrecompiled=$((totalPrecompiled+1)) - echo "Processed: $totalPrecompiled, failed $failedToPrecompile" - done - - if [[ "$__CompositeBuildMode" != 0 ]]; then - # Compile the entire framework in composite build mode - echo "Response file: $compositeResponseFile" - cat $compositeResponseFile - echo "Compiling composite R2R framework: $compositeCommandLine" - $compositeCommandLine - local exitCode="$?" - if [[ "$exitCode" != 0 ]]; then - echo Unable to precompile composite framework, exit code is "$exitCode". - exit 1 - fi - fi - - if [[ "$__DoCrossgen2" != 0 ]]; then - # Copy the Crossgen-compiled assemblies back to CORE_ROOT - mv -f "$outputDir"/* "$overlayDir"/ - rm -r "$outputDir" - fi - - if [[ "$failedToPrecompile" != 0 ]]; then - echo Failed assemblies: - for assembly in "${failedAssemblies[@]}"; do - echo " $assembly" - done - - exit 1 - fi -} - -declare -a skipCrossGenFiles - -function is_skip_crossgen_test { - for skip in "${skipCrossGenFiles[@]}"; do - if [[ "$1" == "$skip" ]]; then - return 0 - fi - done - return 1 -} - -build_Tests() -{ - echo "${__MsgPrefix}Building Tests..." - - __ProjectFilesDir="$__TestDir" - __TestBinDir="$__TestWorkingDir" - - if [[ -f "${__TestWorkingDir}/build_info.json" ]]; then - rm "${__TestWorkingDir}/build_info.json" - fi - - if [[ "$__RebuildTests" -ne 0 ]]; then - if [[ -d "$__TestBinDir" ]]; then - echo "Removing tests build dir: ${__TestBinDir}" - rm -rf "$__TestBinDir" - fi - fi - - __CMakeBinDir="$__TestBinDir" - export __CMakeBinDir - - if [[ ! -d "$__TestIntermediatesDir" ]]; then - mkdir -p "$__TestIntermediatesDir" - fi - - __NativeTestIntermediatesDir="${__TestIntermediatesDir}/Native" - if [[ ! -d "${__NativeTestIntermediatesDir}" ]]; then - mkdir -p "${__NativeTestIntermediatesDir}" - fi - - __ManagedTestIntermediatesDir="${__TestIntermediatesDir}/Managed" - if [[ ! -d "${__ManagedTestIntermediatesDir}" ]]; then - mkdir -p "${__ManagedTestIntermediatesDir}" - fi - - echo "__TargetOS: ${__TargetOS}" - echo "__BuildArch: ${__BuildArch}" - echo "__BuildType: ${__BuildType}" - echo "__TestIntermediatesDir: ${__TestIntermediatesDir}" - echo "__NativeTestIntermediatesDir: ${__NativeTestIntermediatesDir}" - echo "__ManagedTestIntermediatesDir: ${__ManagedTestIntermediatesDir}" - - if [[ ! -f "$__TestBinDir" ]]; then - echo "Creating TestBinDir: ${__TestBinDir}" - mkdir -p "$__TestBinDir" - fi - if [[ ! -f "$__LogsDir" ]]; then - echo "Creating LogsDir: ${__LogsDir}" - mkdir -p "$__LogsDir" - fi - if [[ ! -f "$__MsbuildDebugLogsDir" ]]; then - echo "Creating MsbuildDebugLogsDir: ${__MsbuildDebugLogsDir}" - mkdir -p "$__MsbuildDebugLogsDir" - fi - - # Set up the directory for MSBuild debug logs. - MSBUILDDEBUGPATH="${__MsbuildDebugLogsDir}" - export MSBUILDDEBUGPATH - - __BuildProperties="-p:TargetOS=${__TargetOS} -p:TargetArchitecture=${__BuildArch} -p:Configuration=${__BuildType}" - - # ========================================================================================= - # === - # === Restore product binaries from packages - # === - # ========================================================================================= - - if [[ "${__SkipRestorePackages}" != 1 ]]; then - build_MSBuild_projects "Restore_Product" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "/t:BatchRestorePackages" - - if [[ "$?" -ne 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Error: package restoration failed. Refer to the build log files for details (above)" - exit 1 - fi - fi - - if [[ "$__SkipNative" != 1 ]]; then - build_native "$__BuildArch" "$__TestDir" "$__ProjectRoot" "$__NativeTestIntermediatesDir" "CoreCLR test component" - - if [[ "$?" -ne 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Error: native test build failed. Refer to the build log files for details (above)" - exit 1 - fi - fi - - if [[ "$__SkipManaged" != 1 ]]; then - echo "Starting the Managed Tests Build..." - - build_MSBuild_projects "Tests_Managed" "$__ProjectDir/tests/build.proj" "Managed tests build (build tests)" "$__up" - - if [[ "$?" -ne 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Error: managed test build failed. Refer to the build log files for details (above)" - exit 1 - else - echo "Checking the Managed Tests Build..." - - build_MSBuild_projects "Check_Test_Build" "${__ProjectDir}/tests/src/runtest.proj" "Check Test Build" "/t:CheckTestBuild" - - if [[ "$?" -ne 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Error: Check Test Build failed." - exit 1 - fi - fi - - echo "Managed tests build success!" - - build_test_wrappers - fi - - if [[ "$__CopyNativeTestBinaries" == 1 ]]; then - echo "Copying native test binaries to output..." - - build_MSBuild_projects "Tests_Managed" "$__ProjectDir/tests/build.proj" "Managed tests build (build tests)" "/t:CopyAllNativeProjectReferenceBinaries" - - if [[ "$?" -ne 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Error: copying native test binaries failed. Refer to the build log files for details (above)" - exit 1 - fi - fi - - if [[ -n "$__UpdateInvalidPackagesArg" ]]; then - __up="/t:UpdateInvalidPackageVersions" - fi - - if [[ "$__SkipGenerateLayout" != 1 ]]; then - generate_layout - fi -} - -build_MSBuild_projects() -{ - subDirectoryName="$1" - shift - projectName="$1" - shift - stepName="$1" - shift - extraBuildParameters=("$@") - - # Set up directories and file names - __BuildLogRootName="$subDirectoryName" - __BuildLog="$__LogsDir/${__BuildLogRootName}.${__TargetOS}.${__BuildArch}.${__BuildType}.log" - __BuildWrn="$__LogsDir/${__BuildLogRootName}.${__TargetOS}.${__BuildArch}.${__BuildType}.wrn" - __BuildErr="$__LogsDir/${__BuildLogRootName}.${__TargetOS}.${__BuildArch}.${__BuildType}.err" - - if [[ "$subDirectoryName" == "Tests_Managed" ]]; then - # Execute msbuild managed test build in stages - workaround for excessive data retention in MSBuild ConfigCache - # See https://github.com/Microsoft/msbuild/issues/2993 - - # __SkipPackageRestore and __SkipTargetingPackBuild used to control build by tests/src/dirs.proj - __SkipPackageRestore=false - __SkipTargetingPackBuild=false - __NumberOfTestGroups=3 - - __AppendToLog=false - - if [[ -n "$__priority1" ]]; then - __NumberOfTestGroups=10 - fi - - export __SkipPackageRestore __SkipTargetingPackBuild __NumberOfTestGroups - - for (( testGroupToBuild=1 ; testGroupToBuild <= __NumberOfTestGroups; testGroupToBuild = testGroupToBuild + 1 )) - do - __msbuildLog="\"/flp:Verbosity=normal;LogFile=${__BuildLog};Append=${__AppendToLog}\"" - __msbuildWrn="\"/flp1:WarningsOnly;LogFile=${__BuildWrn};Append=${__AppendToLog}\"" - __msbuildErr="\"/flp2:ErrorsOnly;LogFile=${__BuildErr};Append=${__AppendToLog}\"" - - __TestGroupToBuild="$testGroupToBuild" - export __TestGroupToBuild - - # Generate build command - buildArgs=("$projectName") - buildArgs+=("/p:RestoreDefaultOptimizationDataPackage=false" "/p:PortableBuild=true") - buildArgs+=("/p:UsePartialNGENOptimization=false" "/maxcpucount") - - buildArgs+=("${__msbuildLog}" "${__msbuildWrn}" "${__msbuildErr}") - buildArgs+=("${extraBuildParameters[@]}") - buildArgs+=("${__CommonMSBuildArgs}") - buildArgs+=("${__UnprocessedBuildArgs[@]}") - buildArgs+=("\"/p:CopyNativeProjectBinaries=${__CopyNativeProjectsAfterCombinedTestBuild}\""); - buildArgs+=("/p:__SkipPackageRestore=true"); - - # Disable warnAsError - coreclr issue 19922 - nextCommand="\"$__RepoRootDir/eng/common/msbuild.sh\" $__ArcadeScriptArgs --warnAsError false ${buildArgs[@]}" - echo "Building step '$stepName' testGroupToBuild=$testGroupToBuild via $nextCommand" - eval $nextCommand - - # Make sure everything is OK - if [[ "$?" -ne 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Failed to build $stepName. See the build logs:" - echo " $__BuildLog" - echo " $__BuildWrn" - echo " $__BuildErr" - exit 1 - fi - - __SkipPackageRestore=true - __SkipTargetingPackBuild=true - export __SkipPackageRestore __SkipTargetingPackBuild - - __AppendToLog=true - done - else - __msbuildLog="\"/flp:Verbosity=normal;LogFile=${__BuildLog}\"" - __msbuildWrn="\"/flp1:WarningsOnly;LogFile=${__BuildWrn}\"" - __msbuildErr="\"/flp2:ErrorsOnly;LogFile=${__BuildErr}\"" - - # Generate build command - buildArgs=("$projectName") - buildArgs+=("/p:RestoreDefaultOptimizationDataPackage=false" "/p:PortableBuild=true") - buildArgs+=("/p:UsePartialNGENOptimization=false" "/maxcpucount") - - buildArgs+=("${__msbuildLog}" "${__msbuildWrn}" "${__msbuildErr}") - buildArgs+=("${extraBuildParameters[@]}") - buildArgs+=("${__CommonMSBuildArgs}") - buildArgs+=("${__UnprocessedBuildArgs[@]}") - - # Disable warnAsError - coreclr issue 19922 - nextCommand="\"$__RepoRootDir/eng/common/msbuild.sh\" $__ArcadeScriptArgs --warnAsError false ${buildArgs[@]}" - echo "Building step '$stepName' via $nextCommand" - eval $nextCommand - - # Make sure everything is OK - if [[ "$?" -ne 0 ]]; then - echo "${__ErrMsgPrefix}${__MsgPrefix}Failed to build $stepName. See the build logs:" - echo " $__BuildLog" - echo " $__BuildWrn" - echo " $__BuildErr" - exit 1 - fi - fi -} - -usage_list=() - -usage_list+=("-skiprestorepackages: skip package restore.") -usage_list+=("-skipstressdependencies: Don't install stress dependencies.") -usage_list+=("-skipgeneratelayout: Do not generate the Core_Root layout.") -usage_list+=("-skiptestwrappers: Don't generate test wrappers.") - -usage_list+=("-buildtestwrappersonly: only build the test wrappers.") -usage_list+=("-copynativeonly: Only copy the native test binaries to the managed output. Do not build the native or managed tests.") -usage_list+=("-generatelayoutonly: only pull down dependencies and build coreroot.") -usage_list+=("-crossgenframeworkonly: only compile the framework in CORE_ROOT with Crossgen / Crossgen2.") - -usage_list+=("-crossgen: Precompiles the framework managed assemblies in coreroot.") -usage_list+=("-crossgen2: Precompiles the framework managed assemblies in coreroot using the Crossgen2 compiler.") -usage_list+=("-priority1: include priority=1 tests in the build.") -usage_list+=("-allTargets: Build managed tests for all target platforms.") - -usage_list+=("-rebuild: if tests have already been built - rebuild them.") -usage_list+=("-runtests: run tests after building them.") -usage_list+=("-excludemonofailures: Mark the build as running on Mono runtime so that mono-specific issues are honored.") - -# Obtain the location of the bash script to figure out where the root of the repo is. -__ProjectRoot="$(cd "$(dirname "$0")"; pwd -P)" -__RepoRootDir="$(cd "$__ProjectRoot"/../..; pwd -P)" -__BuildArch= - -handle_arguments_local() { - case "$1" in - buildtestwrappersonly|-buildtestwrappersonly) - __BuildTestWrappersOnly=1 - ;; - - skiptestwrappers|-skiptestwrappers) - __BuildTestWrappers=0 - ;; - - copynativeonly|-copynativeonly) - __SkipStressDependencies=1 - __SkipNative=1 - __SkipManaged=1 - __CopyNativeTestBinaries=1 - __CopyNativeProjectsAfterCombinedTestBuild=true - __SkipGenerateLayout=1 - __SkipCrossgenFramework=1 - ;; - - crossgenframeworkonly|-crossgenframeworkonly) - __SkipStressDependencies=1 - __SkipNative=1 - __SkipManaged=1 - __SkipGenerateLayout=1 - ;; - - crossgen|-crossgen) - __DoCrossgen=1 - __TestBuildMode=crossgen - ;; - - crossgen2|-crossgen2) - __DoCrossgen2=1 - __TestBuildMode=crossgen2 - ;; - - composite|-composite) - __CompositeBuildMode=1 - __DoCrossgen2=1 - __TestBuildMode=crossgen2 - ;; - - generatelayoutonly|-generatelayoutonly) - __GenerateLayoutOnly=1 - ;; - - priority1|-priority1) - __priority1=1 - __UnprocessedBuildArgs+=("/p:CLRTestPriorityToBuild=1") - ;; - - allTargets|-allTargets) - __UnprocessedBuildArgs+=("/p:CLRTestBuildAllTargets=allTargets") - ;; - - rebuild|-rebuild) - __RebuildTests=1 - ;; - - runtests|-runtests) - __RunTests=1 - ;; - - skiprestorepackages|-skiprestorepackages) - __SkipRestorePackages=1 - ;; - - skipstressdependencies|-skipstressdependencies) - __SkipStressDependencies=1 - ;; - - skipgeneratelayout|-skipgeneratelayout) - __SkipGenerateLayout=1 - ;; - - excludemonofailures|-excludemonofailures) - __Mono=1 - ;; - - mono_aot|-mono_aot) - __Mono=1 - __MonoAot=1 - ;; - - *) - __UnprocessedBuildArgs+=("$1") - ;; - esac -} - -__BuildType=Debug -__CodeCoverage= -__IncludeTests=INCLUDE_TESTS - -# Set the various build properties here so that CMake and MSBuild can pick them up -__ProjectDir="$__ProjectRoot" -export __ProjectDir - -__BuildTestWrappers=1 -__BuildTestWrappersOnly= -__Compiler=clang -__CompilerMajorVersion= -__CompilerMinorVersion= -__CommonMSBuildArgs= -__ConfigureOnly=0 -__CopyNativeProjectsAfterCombinedTestBuild=true -__CopyNativeTestBinaries=0 -__CrossBuild=0 -__DistroRid="" -__DoCrossgen=0 -__DoCrossgen2=0 -__CompositeBuildMode=0 -__DotNetCli="$__RepoRootDir/dotnet.sh" -__GenerateLayoutOnly= -__IsMSBuildOnNETCoreSupported=0 -__MSBCleanBuildArgs= -__NativeTestIntermediatesDir= -__PortableBuild=1 -__RebuildTests=0 -__RootBinDir="$__RepoRootDir/artifacts" -__RunTests=0 -__SkipConfigure=0 -__SkipGenerateLayout=0 -__SkipGenerateVersion=0 -__SkipManaged=0 -__SkipNative=0 -__SkipRestore="" -__SkipRestorePackages=0 -__SkipStressDependencies=0 -__SkipCrossgenFramework=0 -__SourceDir="$__ProjectDir/src" -__UnprocessedBuildArgs= -__LocalCoreFXConfig=${__BuildType} -__UseNinja=0 -__VerboseBuild=0 -__CMakeArgs="" -__priority1= -__Mono=0 -__MonoAot=0 -CORE_ROOT= - -source "$__ProjectRoot"/_build-commons.sh - -if [[ "${__BuildArch}" != "${__HostArch}" ]]; then - __CrossBuild=1 -fi - -# Set dependent variables -__LogsDir="$__RootBinDir/log" -__MsbuildDebugLogsDir="$__LogsDir/MsbuildDebugLogs" - -# Set the remaining variables based upon the determined build configuration -__BinDir="$__RootBinDir/bin/coreclr/$__TargetOS.$__BuildArch.$__BuildType" -__PackagesBinDir="$__BinDir/.nuget" -__TestDir="${__RepoRootDir}/src/tests" -__TestWorkingDir="$__RootBinDir/tests/coreclr/$__TargetOS.$__BuildArch.$__BuildType" -__IntermediatesDir="$__RootBinDir/obj/coreclr/$__TargetOS.$__BuildArch.$__BuildType" -__TestIntermediatesDir="$__RootBinDir/tests/coreclr/obj/$__TargetOS.$__BuildArch.$__BuildType" -__CrossComponentBinDir="$__BinDir" -__CrossCompIntermediatesDir="$__IntermediatesDir/crossgen" - -__CrossArch="$__HostArch" -if [[ "$__CrossBuild" == 1 ]]; then - __CrossComponentBinDir="$__CrossComponentBinDir/$__CrossArch" -fi -__CrossgenCoreLibLog="$__LogsDir/CrossgenCoreLib_$__TargetOS.$BuildArch.$__BuildType.log" -__CrossgenExe="$__CrossComponentBinDir/crossgen" -__Crossgen2Dll="$__CrossComponentBinDir/crossgen2/crossgen2.dll" - -# CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to it. -# This is needed by CLI to function. -if [[ -z "$HOME" ]]; then - if [[ ! -d "$__ProjectDir/temp_home" ]]; then - mkdir temp_home - fi - - HOME="$__ProjectDir"/temp_home - export HOME - echo "HOME not defined; setting it to $HOME" -fi - -if [[ (-z "$__GenerateLayoutOnly") && (-z "$__BuildTestWrappersOnly") && ("$__MonoAot" -eq 0) ]]; then - build_Tests -elif [[ ! -z "$__BuildTestWrappersOnly" ]]; then - build_test_wrappers -elif [[ "$__MonoAot" -eq 1 ]]; then - build_mono_aot -else - generate_layout -fi - -if [[ "$?" -ne 0 ]]; then - echo "Failed to build tests" - exit 1 -fi - -echo "${__MsgPrefix}Test build successful." -echo "${__MsgPrefix}Test binaries are available at ${__TestBinDir}" - -__testNativeBinDir="$__IntermediatesDir"/tests - -if [[ "$__RunTests" -ne 0 ]]; then - - echo "Run Tests..." - - nextCommand="$__TestDir/runtest.sh --testRootDir=$__TestBinDir --coreClrBinDir=$__BinDir --coreFxBinDir=$CORE_ROOT --testNativeBinDir=$__testNativeBinDir" - echo "$nextCommand" - eval $nextCommand - - echo "Tests run successful." -else - echo "To run all tests use 'tests/runtests.sh' where:" - echo " testRootDir = $__TestBinDir" - echo " coreClrBinDir = $__BinDir" - echo " coreFxBinDir = $CORE_ROOT" - echo " testNativeBinDir = $__testNativeBinDir" - echo " -------------------------------------------------- " - echo " Example runtest.sh command" - echo "" - echo " ./tests/runtest.sh --coreOverlayDir=$CORE_ROOT --testNativeBinDir=$__testNativeBinDir --testRootDir=$__TestBinDir --copyNativeTestBin $__BuildType" - echo " -------------------------------------------------- " - echo "To run single test use the following command:" - echo " bash ${__TestBinDir}/__TEST_PATH__/__TEST_NAME__.sh -coreroot=${CORE_ROOT}" -fi diff --git a/src/coreclr/clr.featuredefines.props b/src/coreclr/clr.featuredefines.props index b5979c8d2390..6c4c13243e12 100644 --- a/src/coreclr/clr.featuredefines.props +++ b/src/coreclr/clr.featuredefines.props @@ -9,7 +9,6 @@ true true true - true true @@ -58,7 +57,6 @@ $(DefineConstants);FEATURE_PERFTRACING $(DefineConstants);FEATURE_EVENTSOURCE_XPLAT $(DefineConstants);FEATURE_WIN32_REGISTRY - $(DefineConstants);FEATURE_DEFAULT_INTERFACES $(DefineConstants);FEATURE_TYPEEQUIVALENCE $(DefineConstants);FEATURE_BASICFREEZE $(DefineConstants);FEATURE_PORTABLE_SHUFFLE_THUNKS @@ -66,9 +64,5 @@ $(DefineConstants);PROFILING_SUPPORTED $(DefineConstants);FEATURE_PROFAPI_ATTACH_DETACH - - $(DefineConstants);TARGET_UNIX - $(DefineConstants);TARGET_WINDOWS - $(DefineConstants);TARGET_OSX diff --git a/src/coreclr/clrdefinitions.cmake b/src/coreclr/clrdefinitions.cmake index 7be0a6915051..eafe212786d8 100644 --- a/src/coreclr/clrdefinitions.cmake +++ b/src/coreclr/clrdefinitions.cmake @@ -16,7 +16,7 @@ if (CLR_CMAKE_TARGET_ARCH_ARM64) if (CLR_CMAKE_TARGET_UNIX) add_definitions(-DFEATURE_EMULATE_SINGLESTEP) endif() - add_definitions(-DFEATURE_MULTIREG_RETURN) + add_compile_definitions($<$>>:FEATURE_MULTIREG_RETURN>) elseif (CLR_CMAKE_TARGET_ARCH_ARM) if (CLR_CMAKE_HOST_WIN32 AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD) # Set this to ensure we can use Arm SDK for Desktop binary linkage when doing native (Arm32) build @@ -30,15 +30,15 @@ if (CLR_CMAKE_TARGET_UNIX) if(CLR_CMAKE_TARGET_OSX) add_definitions(-D_XOPEN_SOURCE) - add_definitions(-DFEATURE_DATATARGET4) endif(CLR_CMAKE_TARGET_OSX) if (CLR_CMAKE_TARGET_ARCH_AMD64) - add_definitions(-DUNIX_AMD64_ABI) + add_compile_definitions($<$>>:UNIX_AMD64_ABI>) + add_compile_definitions($<$>>:FEATURE_MULTIREG_RETURN>) elseif (CLR_CMAKE_TARGET_ARCH_ARM) - add_definitions(-DUNIX_ARM_ABI) + add_compile_definitions($<$>>:UNIX_ARM_ABI>) elseif (CLR_CMAKE_TARGET_ARCH_I386) - add_definitions(-DUNIX_X86_ABI) + add_compile_definitions($<$>>:UNIX_X86_ABI>) endif() endif(CLR_CMAKE_TARGET_UNIX) @@ -146,7 +146,7 @@ endif(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_WIN32) add_definitions(-DFEATURE_MANAGED_ETW_CHANNELS) if(FEATURE_MERGE_JIT_AND_ENGINE) - add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE) + add_compile_definitions($<$>>:FEATURE_MERGE_JIT_AND_ENGINE>) endif(FEATURE_MERGE_JIT_AND_ENGINE) add_compile_definitions($<$>>:FEATURE_MULTICOREJIT>) if(CLR_CMAKE_TARGET_UNIX) @@ -173,9 +173,9 @@ set(FEATURE_READYTORUN 1) add_compile_definitions($<$>>:FEATURE_REJIT>) -if (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX AND NOT CLR_CMAKE_TARGET_OSX) +if (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX) add_definitions(-DFEATURE_REMOTE_PROC_MEM) -endif (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX AND NOT CLR_CMAKE_TARGET_OSX) +endif (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX) if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64) add_definitions(-DFEATURE_STUBS_AS_IL) @@ -200,12 +200,6 @@ if (CLR_CMAKE_TARGET_ARCH_AMD64) # Enable the AMD64 Unix struct passing JIT-EE interface for all AMD64 platforms, to enable altjit. add_definitions(-DUNIX_AMD64_ABI_ITF) endif (CLR_CMAKE_TARGET_ARCH_AMD64) -if(CLR_CMAKE_TARGET_UNIX_AMD64) - add_definitions(-DFEATURE_MULTIREG_RETURN) -endif (CLR_CMAKE_TARGET_UNIX_AMD64) -if(CLR_CMAKE_TARGET_UNIX AND CLR_CMAKE_TARGET_ARCH_AMD64) - add_definitions(-DUNIX_AMD64_ABI) -endif(CLR_CMAKE_TARGET_UNIX AND CLR_CMAKE_TARGET_ARCH_AMD64) add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS) if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64) add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP) @@ -232,5 +226,49 @@ if(CLR_CMAKE_TARGET_OSX) endif(CLR_CMAKE_TARGET_OSX) if (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32) - add_definitions(-DFEATURE_EH_FUNCLETS) + add_compile_definitions($<$>>:FEATURE_EH_FUNCLETS>) endif (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32) + + +# Use this function to enable building with a specific target OS and architecture set of defines +# This is known to work for the set of defines used by the JIT and gcinfo, it is not likely correct for +# other components of the runtime +function(set_target_definitions_to_custom_os_and_arch) + set(oneValueArgs TARGET OS ARCH) + cmake_parse_arguments(TARGETDETAILS "" "${oneValueArgs}" "" ${ARGN}) + + set_target_properties(${TARGETDETAILS_TARGET} PROPERTIES IGNORE_DEFAULT_TARGET_ARCH TRUE) + set_target_properties(${TARGETDETAILS_TARGET} PROPERTIES IGNORE_DEFAULT_TARGET_OS TRUE) + + if ((TARGETDETAILS_OS STREQUAL "unix")) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_UNIX) + if (TARGETDETAILS_ARCH STREQUAL "x64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_AMD64_ABI) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) + elseif (TARGETDETAILS_ARCH STREQUAL "arm") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_ARM_ABI) + elseif (TARGETDETAILS_ARCH STREQUAL "x86") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_X86_ABI) + elseif (TARGETDETAILS_ARCH STREQUAL "arm64") + endif() + else() + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_WINDOWS) + endif((TARGETDETAILS_OS STREQUAL "unix")) + + if (TARGETDETAILS_ARCH STREQUAL "x86") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_X86) + elseif(TARGETDETAILS_ARCH STREQUAL "x64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_AMD64) + elseif(TARGETDETAILS_ARCH STREQUAL "arm64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM64) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) + elseif(TARGETDETAILS_ARCH STREQUAL "arm") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM) + endif() + + if (NOT (TARGETDETAILS_ARCH STREQUAL "x86") OR (TARGETDETAILS_OS STREQUAL "unix")) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_EH_FUNCLETS) + endif (NOT (TARGETDETAILS_ARCH STREQUAL "x86") OR (TARGETDETAILS_OS STREQUAL "unix")) +endfunction() diff --git a/src/coreclr/crosscomponents.cmake b/src/coreclr/crosscomponents.cmake index 5bb0b5bef5c7..c66531887daa 100644 --- a/src/coreclr/crosscomponents.cmake +++ b/src/coreclr/crosscomponents.cmake @@ -1,18 +1,29 @@ add_definitions(-DCROSS_COMPILE) -if(CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM) +if(CLR_CMAKE_HOST_ARCH_AMD64 AND (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_I386)) set(FEATURE_CROSSBITNESS 1) -endif(CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_ARCH_ARM) +endif(CLR_CMAKE_HOST_ARCH_AMD64 AND (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_I386)) if (CLR_CMAKE_HOST_OS STREQUAL CLR_CMAKE_TARGET_OS) set (CLR_CROSS_COMPONENTS_LIST - crossgen clrjit - jitinterface + jitinterface_${ARCH_HOST_NAME} ) + + if(CLR_CMAKE_HOST_LINUX OR NOT FEATURE_CROSSBITNESS) + list (APPEND CLR_CROSS_COMPONENTS_LIST + crossgen + ) + endif() + + if (CLR_CMAKE_TARGET_UNIX) + list (APPEND CLR_CROSS_COMPONENTS_LIST + clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} + ) + endif(CLR_CMAKE_TARGET_UNIX) endif() -if(NOT CLR_CMAKE_HOST_LINUX AND NOT FEATURE_CROSSBITNESS) +if(NOT CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_OSX AND NOT FEATURE_CROSSBITNESS) list (APPEND CLR_CROSS_COMPONENTS_LIST mscordaccore mscordbi diff --git a/src/coreclr/crossgen-corelib.cmd b/src/coreclr/crossgen-corelib.cmd index f47aa1799093..c153745ea91c 100644 --- a/src/coreclr/crossgen-corelib.cmd +++ b/src/coreclr/crossgen-corelib.cmd @@ -8,7 +8,7 @@ set "__MsgPrefix=CROSSGEN-CORELIB: " echo %__MsgPrefix%Starting Build at %TIME% set __ThisScriptFull="%~f0" -set __ThisScriptDir="%~dp0" +set __ThisScriptDir=%~dp0 :: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set: :: __BuildArch -- default: x64 @@ -182,7 +182,7 @@ if %__PgoInstrument% EQU 1 ( goto ExitWithError ) - REM HACK: Workaround for [dotnet/coreclr#13970](https://github.com/dotnet/coreclr/issues/13970) + REM HACK: Workaround for [dotnet/runtime#8929](https://github.com/dotnet/runtime/issues/8929) set __PgoRtPath= for /f "tokens=*" %%f in ('where pgort*.dll') do ( if not defined __PgoRtPath set "__PgoRtPath=%%~f" diff --git a/src/coreclr/dir.common.props b/src/coreclr/dir.common.props index f45eb84e8f27..b4494a50ac17 100644 --- a/src/coreclr/dir.common.props +++ b/src/coreclr/dir.common.props @@ -33,17 +33,17 @@ $(RepoRoot)artifacts\obj\coreclr\$(MSBuildProjectName)\ $(ProjectDir)src\ - $(ArtifactsDir)bin\coreclr\$(PlatformConfigPathPart)\ + $(ArtifactsDir)bin\coreclr\$(PlatformConfigPathPart)\ - $(BinDir).nuget\ + $(RuntimeBinDir).nuget\ - 5.0.0 + 6.0.0 false @@ -64,11 +64,6 @@ $(__DistroRid) - - - x64 - x86 - x64 diff --git a/src/coreclr/pgosupport.cmake b/src/coreclr/pgosupport.cmake index 4b1198090171..1e2be5dadb0e 100644 --- a/src/coreclr/pgosupport.cmake +++ b/src/coreclr/pgosupport.cmake @@ -1,5 +1,18 @@ -include(CheckIPOSupported) -check_ipo_supported(RESULT HAVE_LTO) +include(CheckCXXSourceCompiles) +include(CheckCXXCompilerFlag) + +# VC++ guarantees support for LTCG (LTO's equivalent) +if(NOT WIN32) + # Function required to give CMAKE_REQUIRED_* local scope + function(check_have_lto) + set(CMAKE_REQUIRED_FLAGS -flto) + set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=gold) + check_cxx_source_compiles("int main() { return 0; }" HAVE_LTO) + endfunction(check_have_lto) + check_have_lto() + + check_cxx_compiler_flag(-faligned-new COMPILER_SUPPORTS_F_ALIGNED_NEW) +endif(NOT WIN32) # Adds Profile Guided Optimization (PGO) flags to the current target function(add_pgo TargetName) @@ -34,16 +47,16 @@ function(add_pgo TargetName) set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /LTCG /USEPROFILE:PGD=\"${ProfilePath}\"") else(CLR_CMAKE_HOST_WIN32) if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO) - if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6) + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6)) if(HAVE_LTO) target_compile_options(${TargetName} PRIVATE -flto -fprofile-instr-use=${ProfilePath} -Wno-profile-instr-out-of-date -Wno-profile-instr-unprofiled) set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS " -flto -fuse-ld=gold -fprofile-instr-use=${ProfilePath}") else(HAVE_LTO) message(WARNING "LTO is not supported, skipping profile guided optimizations") endif(HAVE_LTO) - else(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6) + else((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6)) message(WARNING "PGO is not supported; Clang 3.6 or later is required for profile guided optimizations") - endif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6) + endif((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6)) endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO) endif(CLR_CMAKE_HOST_WIN32) endif(NOT EXISTS ${ProfilePath}) diff --git a/src/coreclr/runtime.proj b/src/coreclr/runtime.proj index f0da8c09cd0d..fcd408b6cba4 100644 --- a/src/coreclr/runtime.proj +++ b/src/coreclr/runtime.proj @@ -11,6 +11,7 @@ <_CoreClrBuildArg Condition="'$(ContinuousIntegrationBuild)' == 'true'" Include="-ci" /> <_CoreClrBuildArg Condition="'$(CrossBuild)' == 'true'" Include="-cross" /> <_CoreClrBuildArg Condition="'$(PortableBuild)' != 'true'" Include="-portablebuild=false" /> + <_CoreClrBuildArg Condition="'$(KeepNativeSymbols)' != 'false'" Include="-keepnativesymbols" /> <_CoreClrBuildArg Condition="!$([MSBuild]::IsOsPlatform(Windows))" Include="-os $(TargetOS)" /> <_CoreClrBuildArg Condition="$([MSBuild]::IsOsPlatform(Windows)) and @@ -19,8 +20,13 @@ '$(NoPgoOptimize)' != 'true'" Include="-enforcepgo" /> <_CoreClrBuildArg Condition="$([MSBuild]::IsOsPlatform(Windows)) and '$(CrossDac)' != ''" Include="-$(CrossDac)dac" /> - <_CoreClrBuildArg Condition="'$(OfficialBuildId)' != ''" Include="/p:OfficialBuildId=$(OfficialBuildId)" /> + <_CoreClrBuildArg Condition="'$(Ninja)' == 'true'" Include="-ninja" /> + <_CoreClrBuildArg Condition="'$(ClrRuntimeSubset)' != 'true'" Include="-skipruntime" /> + <_CoreClrBuildArg Condition="'$(ClrJitSubset)' != 'true'" Include="-skipjit" /> + <_CoreClrBuildArg Condition="'$(ClrPalTestsSubset)' == 'true'" Include="-paltests" /> + <_CoreClrBuildArg Condition="'$(ClrAllJitsSubset)' != 'true'" Include="-skipalljits" /> <_CoreClrBuildArg Condition="'$(NoPgoOptimize)' == 'true'" Include="-nopgooptimize" /> + <_CoreClrBuildArg Condition="'$(OfficialBuildId)' != ''" Include="/p:OfficialBuildId=$(OfficialBuildId)" /> diff --git a/src/coreclr/scripts/.pylintrc b/src/coreclr/scripts/.pylintrc new file mode 100644 index 000000000000..a4b28930a18f --- /dev/null +++ b/src/coreclr/scripts/.pylintrc @@ -0,0 +1,31 @@ +# Settings for pylint + +[MESSAGES CONTROL] + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=invalid-name, + no-member, + bare-except, + missing-module-docstring, + broad-except, + wildcard-import, + unused-wildcard-import, + raise-missing-from, + import-outside-toplevel, + redefined-outer-name + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=300 + +# Maximum number of lines in a module. +max-module-lines=5000 \ No newline at end of file diff --git a/src/coreclr/scripts/coreclr_arguments.py b/src/coreclr/scripts/coreclr_arguments.py index 6806446128c9..441c44790302 100644 --- a/src/coreclr/scripts/coreclr_arguments.py +++ b/src/coreclr/scripts/coreclr_arguments.py @@ -15,26 +15,18 @@ ################################################################################ import argparse -import datetime -import json import os import platform -import shutil import subprocess import sys -import tempfile -import time -import re -import string - -import xml.etree.ElementTree - -from collections import defaultdict ################################################################################ ################################################################################ + class CoreclrArguments: + """ Class to process arguments for CoreCLR specific Python code. + """ ############################################################################ # ctor @@ -71,9 +63,9 @@ def __init__(self, self.require_built_core_root = require_built_core_root self.require_built_test_dir = require_built_test_dir - self.valid_arches = ["x64", "x86", "arm", "arm64"] + self.valid_arches = ["x64", "x86", "arm", "arm64", "wasm"] self.valid_build_types = ["Debug", "Checked", "Release"] - self.valid_host_os = ["Windows_NT", "OSX", "Linux", "illumos", "Solaris"] + self.valid_host_os = ["Windows_NT", "OSX", "Linux", "illumos", "Solaris", "Browser", "Android"] self.__initialize__(args) @@ -82,9 +74,14 @@ def __init__(self, ############################################################################ def check_build_type(self, build_type): - if build_type == None: + """ Process the `build_type` argument. + + If unset, provide a default. Otherwise, check that it is valid. + """ + + if build_type is None: build_type = self.default_build_type - assert(build_type in self.valid_build_types) + assert build_type in self.valid_build_types return build_type if len(build_type) > 0: @@ -146,7 +143,7 @@ def verify(self, else: arg_value = args - if modify_arg != None and not modify_after_validation: + if modify_arg is not None and not modify_after_validation: arg_value = modify_arg(arg_value) try: @@ -154,17 +151,17 @@ def verify(self, except: pass - if verified == False and isinstance(failure_str, str): + if verified is False and isinstance(failure_str, str): print(failure_str) sys.exit(1) - elif verified == False: + elif verified is False: print(failure_str(arg_value)) sys.exit(1) - if modify_arg != None and modify_after_validation: + if modify_arg is not None and modify_after_validation: arg_value = modify_arg(arg_value) - if verified != True and arg_value is None: + if verified is not True and arg_value is None: arg_value = verified # Add a new member variable based on the verified arg @@ -176,6 +173,11 @@ def verify(self, @staticmethod def provide_default_host_os(): + """ Return a string representing the current host operating system. + + Returns one of: Linux, OSX, Windows_NT, illumos, Solaris + """ + if sys.platform == "linux" or sys.platform == "linux2": return "Linux" elif sys.platform == "darwin": @@ -191,6 +193,11 @@ def provide_default_host_os(): @staticmethod def provide_default_arch(): + """ Return a string representing the current processor architecture. + + Returns one of: x64, x86, arm, armel, arm64. + """ + platform_machine = platform.machine().lower() if platform_machine == "x86_64" or platform_machine == "amd64": return "x64" diff --git a/src/coreclr/scripts/jitrollingbuild.py b/src/coreclr/scripts/jitrollingbuild.py new file mode 100644 index 000000000000..d947c7a5d2fd --- /dev/null +++ b/src/coreclr/scripts/jitrollingbuild.py @@ -0,0 +1,606 @@ +#!/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 : jitrollingbuild.py +# +# Notes: +# +# Script to upload and manage rolling build clrjit and the rolling build storage location +# +################################################################################ +################################################################################ + +import argparse +import locale +import os +import shutil +import sys +import tempfile +import urllib.request +import zipfile +import re + +from coreclr_arguments import * + +locale.setlocale(locale.LC_ALL, '') # Use '' for auto, or force e.g. to 'en_US.UTF-8' + +################################################################################ +# Azure Storage information +################################################################################ + +az_account_name = "clrjit2" +az_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 + +################################################################################ +# Argument Parser +################################################################################ + +description = """\ +Script to upload and manage rolling build clrjit +""" + +upload_description = """\ +Upload clrjit to SuperPMI Azure storage. +""" + +download_description = """\ +Download clrjit from SuperPMI Azure storage. +""" + +list_description = """\ +List clrjit in SuperPMI Azure storage. +""" + +host_os_help = "OS (Windows_NT, 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." + +git_hash_help = "git hash" + +target_dir_help = "Directory to put the downloaded JIT." + +skip_cleanup_help = "Skip intermediate file removal." + +# Start of parser object creation. + +parser = argparse.ArgumentParser(description=description) + +subparsers = parser.add_subparsers(dest='mode', help="Command to invoke") + +# Common parser for git_hash/arch/build_type/host_os arguments + +common_parser = argparse.ArgumentParser(add_help=False) + +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) + +# subparser for upload +upload_parser = subparsers.add_parser("upload", description=upload_description, parents=[common_parser]) + +upload_parser.add_argument("-git_hash", required=True, help=git_hash_help) +upload_parser.add_argument("-az_storage_key", help="Key for the clrjit Azure Storage location. Default: use the value of the CLRJIT_AZ_KEY environment variable.") +upload_parser.add_argument("--skip_cleanup", action="store_true", help=skip_cleanup_help) + +# 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("--skip_cleanup", action="store_true", help=skip_cleanup_help) + +# subparser for list +list_parser = subparsers.add_parser("list", description=list_description, parents=[common_parser]) + +list_parser.add_argument("-git_hash", help=git_hash_help) +list_parser.add_argument("--all", action="store_true", help="Show all JITs, not just those for the specified (or default) git hash, OS, architecture, and flavor") + +################################################################################ +# 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 args.skip_cleanup is False). + """ + + def __init__(self, path=None): + self.mydir = tempfile.mkdtemp() if path is None else path + self.cwd = None + + 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) + # Note: we are using the global `args`, not coreclr_args. This works because + # the `skip_cleanup` argument is not processed by CoreclrArguments, but is + # just copied there. + if not args.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) + + +def determine_jit_name(coreclr_args): + """ Determine the jit based on the OS. If "-altjit" is specified, then use the specified altjit, + or an appropriate altjit based on target. + + Args: + coreclr_args (CoreclrArguments): parsed args + + Return: + jit_name(str) : name of the jit for this os + """ + + jit_base_name = "clrjit" + if coreclr_args.host_os == "OSX": + return "lib" + jit_base_name + ".dylib" + elif coreclr_args.host_os == "Linux": + return "lib" + jit_base_name + ".so" + elif coreclr_args.host_os == "Windows_NT": + return jit_base_name + ".dll" + else: + raise RuntimeError("Unknown OS.") + + +def list_az_jits(filter_func=lambda unused: True): + """ List the JITs in Azure Storage using REST api + + Args: + filter_func (lambda: string -> bool): filter to apply to the list. The filter takes a URL and returns True if this URL is acceptable. + + Returns: + urls (list): set of URLs in Azure Storage that match the filter. + + Notes: + This method does not require installing the Azure Storage python package. + """ + + # This URI will return *all* the blobs, for all git_hash/OS/architecture/build_type combinations. + # pass "prefix=foo/bar/..." to only show a subset. Or, we can filter later using string search. + list_az_container_uri = az_blob_storage_container_uri + "?restype=container&comp=list&prefix=" + az_builds_root_folder + "/" + + try: + contents = urllib.request.urlopen(list_az_container_uri).read().decode('utf-8') + except Exception as exception: + print("Didn't find any collections using {}".format(list_az_container_uri)) + print(" Error: {}".format(exception)) + return None + + # Contents is an XML file with contents like: + # + # builds/ + # + # + # builds/755f01659f03196487ec41225de8956911f8049b/Linux/x64/Checked/libclrjit.so + # https://clrjit2.blob.core.windows.net/jitrollingbuild/builds/755f01659f03196487ec41225de8956911f8049b/Linux/x64/Checked/libclrjit.so + # + # ... + # + # + # + # builds/755f01659f03196487ec41225de8956911f8049b/OSX/x64/Checked/libclrjit.dylib + # https://clrjit2.blob.core.windows.net/jitrollingbuild/builds/755f01659f03196487ec41225de8956911f8049b/OSX/x64/Checked/libclrjit.dylib + # + # ... + # + # + # ... etc. ... + # + # + # + # We just want to extract the entries. We could probably use an XML parsing package, but we just + # use regular expressions. + + urls_split = contents.split("")[1:] + urls = [] + for item in urls_split: + url = item.split("")[0].strip() + if filter_func(url): + urls.append(url) + + return urls + + +def upload_command(coreclr_args): + """ Upload the JIT + + Args: + coreclr_args (CoreclrArguments): parsed 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) + + # Check if the blob already exists, and delete it if it does, before uploading / replacing it. + try: + blob_client.get_blob_properties() + # If no exception, then the blob already exists. Delete it! + print("Warning: replacing existing blob!") + blob_client.delete_blob() + except Exception: + # Blob doesn't exist already; that's good + pass + + with open(file, "rb") as data: + blob_client.upload_blob(data) + + # 1. Find all the JIT builds in the product directory + # 2. Upload them + # + # We could also upload debug info, but it's not clear it's needed for most purposes, and it is very big: + # it increases the upload size from about 190MB to over 900MB for each roll. + # + # For reference, the JIT debug info is found: + # a. For Windows, in the PDB subdirectory, e.g. PDB\clrjit.pdb + # b. For Linux .dbg files, and Mac .dwarf files, in the same directory as the jit, e.g., libcoreclr.so.dbg + + # Target directory: /git-hash/OS/architecture/build-flavor/ + # Note that build-flavor will probably always be Checked. + + files = [] + + # First, find the primary JIT that we expect to find. + jit_name = determine_jit_name(coreclr_args) + jit_path = os.path.join(coreclr_args.product_location, jit_name) + if not os.path.isfile(jit_path): + print("Error: Couldn't find JIT at {}".format(jit_path)) + raise RuntimeError("Missing JIT") + + files.append(jit_path) + + # Next, look for any and all cross-compilation JITs. These are named, e.g.: + # clrjit_unix_x64_x64.dll + # clrjit_win_arm_x64.dll + # clrjit_win_arm64_x64.dll + # and so on, and live in the same product directory as the primary JIT. + # + # Note that the expression below explicitly filters out the primary JIT since we added that above. + # We handle the primary JIT specially so we can error if it is missing. For the cross-compilation + # JITs, we don't bother trying to ensure that all the ones we might expect are actually there. + # + # We don't do a recursive walk because the JIT is also copied to the "sharedFramework" subdirectory, + # so we don't want to pick that up. + + if coreclr_args.host_os == "OSX": + allowed_extensions = [ ".dylib" ] + # Add .dwarf for debug info + elif coreclr_args.host_os == "Linux": + allowed_extensions = [ ".so" ] + # Add .dbg for debug info + elif coreclr_args.host_os == "Windows_NT": + allowed_extensions = [ ".dll" ] + else: + raise RuntimeError("Unknown OS.") + + cross_jit_paths = [os.path.join(coreclr_args.product_location, item) + for item in os.listdir(coreclr_args.product_location) + if re.match(r'.*clrjit.*', item) and item != jit_name and any(item.endswith(extension) for extension in allowed_extensions)] + files += cross_jit_paths + + # On Windows, grab the PDB files from a sub-directory. + # if coreclr_args.host_os == "Windows_NT": + # pdb_dir = os.path.join(coreclr_args.product_location, "PDB") + # if os.path.isdir(pdb_dir): + # pdb_paths = [os.path.join(pdb_dir, item) for item in os.listdir(pdb_dir) if re.match(r'.*clrjit.*', item)] + # files += pdb_paths + + print("Uploading:") + for item in files: + print(" {}".format(item)) + + try: + from azure.storage.blob import BlobServiceClient + + except: + print("Please install:") + print(" pip install azure-storage-blob") + print("See also https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python") + raise RuntimeError("Missing azure storage package.") + + blob_service_client = BlobServiceClient(account_url=az_blob_storage_account_uri, credential=coreclr_args.az_storage_key) + blob_folder_name = "{}/{}/{}/{}/{}".format(az_builds_root_folder, coreclr_args.git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type) + + total_bytes_uploaded = 0 + + # Should we compress the JIT on upload? It would save space, but it makes it slightly more complicated to use + # because you can't just "wget" or otherwise download the file and use it immediately -- you need to unzip first. + # So for now, don't compress it. + compress_jit = False + + with TempDir() as temp_location: + for file in files: + if compress_jit: + # Zip compress the file we will upload + zip_name = os.path.basename(file) + ".zip" + zip_path = os.path.join(temp_location, zip_name) + print("Compress {} -> {}".format(file, zip_path)) + with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zip_file: + zip_file.write(file, os.path.basename(file)) + + file_stat_result = os.stat(file) + zip_stat_result = os.stat(zip_path) + print("Compressed {:n} to {:n} bytes".format(file_stat_result.st_size, zip_stat_result.st_size)) + 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)) + 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)) + upload_blob(file, blob_name) + + print("Uploaded {:n} bytes".format(total_bytes_uploaded)) + print("Finished JIT upload") + + +def download_urls(urls, target_dir): + """ Download a set of files, specified as URLs, to a target directory. + If the URLs are to .ZIP files, then uncompress them and copy all contents + to the target directory. + + Args: + urls (list): the URLs to download + target_dir (str): target directory where files are copied. Directory must exist + + Returns: + list of local filenames of downloaded files + """ + + print("Downloading:") + for url in urls: + print(" {}".format(url)) + + local_files = [] + + # In case we'll need a temp directory for ZIP file processing, create it first. + with TempDir() as temp_location: + for url in urls: + item_name = url.split("/")[-1] + + if url.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) + + print("Download: {} -> {}".format(url, download_path)) + urllib.request.urlretrieve(url, download_path) + + print("Uncompress {}".format(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)) + print("Copy {} -> {}".format(item, target_path)) + shutil.copy2(item, target_dir) + local_files.append(target_path) + else: + # Not a zip file; download directory to target directory + download_path = os.path.join(target_dir, item_name) + + print("Download: {} -> {}".format(url, download_path)) + urllib.request.urlretrieve(url, download_path) + + local_files.append(download_path) + + return local_files + + +def get_jit_urls(coreclr_args, find_all=False): + """ Helper method: collect a list of URLs for all the JIT files to download or list. + + Args: + coreclr_args (CoreclrArguments): parsed args + find_all (bool): True to show all, or False to filter based on coreclr_args + """ + + 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() + + # 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 + # Filter to just the current git_hash, OS, architecture, and build_flavor. + # If "find_all" is True, then no filtering happens: everything is returned. + def filter_jits(url): + url = url.lower() + return find_all or url.startswith(blob_prefix_filter) + + return list_az_jits(filter_jits) + + +def download_command(coreclr_args): + """ Download the JIT + + Args: + coreclr_args (CoreclrArguments): parsed args + """ + + urls = get_jit_urls(coreclr_args, find_all=False) + if urls is None: + return + + download_urls(urls, coreclr_args.target_dir) + + +def list_command(coreclr_args): + """ List the JITs in Azure Storage + + Args: + coreclr_args (CoreclrArguments) : parsed args + """ + + urls = get_jit_urls(coreclr_args, find_all=coreclr_args.all) + if urls is None: + return + + count = len(urls) + + if coreclr_args.all: + print("{} JIT files".format(count)) + else: + blob_filter_string = "{}/{}/{}/{}".format(coreclr_args.git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type) + print("{} JIT files for {}".format(count, blob_filter_string)) + print("") + + for url in urls: + print("{}".format(url)) + + print("") + + +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, + "mode", # "mode" is from the `parser.add_subparsers(dest='mode')` call + lambda unused: True, + "Unable to set mode") + + if coreclr_args.mode == "upload": + + coreclr_args.verify(args, + "git_hash", + lambda unused: True, + "Unable to set git_hash") + + coreclr_args.verify(args, + "az_storage_key", + lambda item: item is not None, + "Specify az_storage_key or set environment variable CLRJIT_AZ_KEY to the key to use.", + modify_arg=lambda arg: os.environ["CLRJIT_AZ_KEY"] if arg is None and "CLRJIT_AZ_KEY" in os.environ else arg) + + coreclr_args.verify(args, + "skip_cleanup", + lambda unused: True, + "Unable to set skip_cleanup") + + if not os.path.isdir(coreclr_args.product_location): + print("Built product location could not be determined") + raise RuntimeError("Error") + + elif coreclr_args.mode == "download": + + coreclr_args.verify(args, + "git_hash", + lambda unused: True, + "Unable to set git_hash") + + coreclr_args.verify(args, + "target_dir", + lambda unused: True, + "Unable to set target_dir") + + coreclr_args.verify(args, + "skip_cleanup", + lambda unused: True, + "Unable to set skip_cleanup") + + if not os.path.isdir(coreclr_args.target_dir): + print("--target_dir directory does not exist") + raise RuntimeError("Error") + + elif coreclr_args.mode == "list": + + coreclr_args.verify(args, + "git_hash", + lambda unused: True, + "Unable to set git_hash") + + coreclr_args.verify(args, + "all", + lambda unused: True, + "Unable to set all") + + return coreclr_args + +################################################################################ +# main +################################################################################ + + +def main(args): + """ Main method + """ + + if sys.version_info.major < 3: + print("Please install python 3 or greater") + return 1 + + coreclr_args = setup_args(args) + success = True + + if coreclr_args.mode == "upload": + upload_command(coreclr_args) + + elif coreclr_args.mode == "download": + download_command(coreclr_args) + + elif coreclr_args.mode == "list": + list_command(coreclr_args) + + else: + raise NotImplementedError(coreclr_args.mode) + + return 0 if success else 1 + +################################################################################ +# __main__ +################################################################################ + + +if __name__ == "__main__": + args = parser.parse_args() + sys.exit(main(args)) diff --git a/src/coreclr/scripts/setup.cfg b/src/coreclr/scripts/setup.cfg new file mode 100644 index 000000000000..ac255d84052e --- /dev/null +++ b/src/coreclr/scripts/setup.cfg @@ -0,0 +1,10 @@ +# Configuration options for pycodestyle + +[pycodestyle] +count = False +# E722: do not use bare 'except' +# E127: continuation line over-indented for visual indent +# W503: line break before binary operator +ignore = E127,E201,E202,E266,E501,E722,W503 +max-line-length = 160 +statistics = False diff --git a/src/coreclr/scripts/superpmi-setup.py b/src/coreclr/scripts/superpmi-setup.py new file mode 100644 index 000000000000..48e72d5de774 --- /dev/null +++ b/src/coreclr/scripts/superpmi-setup.py @@ -0,0 +1,408 @@ +#!/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-setup.py +# +# Notes: +# +# Script to setup directory structure required to perform SuperPMI collection in CI. +# It does the following steps: +# 1. It creates `correlation_payload_directory` that contains files from CORE_ROOT, src\coreclr\scripts. +# This directory is the one that is sent to all the helix machines that performs SPMI collection. +# 2. It clones dotnet/jitutils, builds it and then copies the `pmi.dll` to `correlation_payload_directory` folder. +# This file is needed to do pmi SPMI runs. +# 3. The script takes `input_artifacts` parameter which contains managed .dlls and .exes on +# which SPMI needs to be run. This script will partition these folders into equal buckets of approximately `max_size` +# bytes and stores them under `payload` directory. Each sub-folder inside `payload` directory is sent to individual +# helix machine to do SPMI collection on. E.g. for `input_artifacts` to be run on libraries, the parameter would be path to +# `CORE_ROOT` folder and this script will copy `max_size` bytes of those files under `payload/libraries/0/binaries`, +# `payload/libraries/1/binaries` and so forth. +# 4. Lastly, it sets the pipeline variables. + +# Below are the helix queues it sets depending on the OS/architecture: +# | Arch | Windows_NT | Linux | +# |-------|------------------|--------------------------------------------------------------------------------------------------------------------------------------| +# | x86 | Windows.10.Amd64 | - | +# | x64 | Windows.10.Amd64 | Ubuntu.1804.Amd64 | +# | arm | - | (Ubuntu.1804.Arm32)Ubuntu.1804.Armarch@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm32v7-bfcd90a-20200121150440 | +# | arm64 | Windows.10.Arm64 | (Ubuntu.1804.Arm64)Ubuntu.1804.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-a45aeeb-20190620155855 | +################################################################################ +################################################################################ + + +import argparse +import shutil +import subprocess +import tempfile + +from os import listdir, path, walk +from os.path import isfile, join, getsize +from coreclr_arguments import * + +# Start of parser object creation. + +parser = argparse.ArgumentParser(description="description") + +parser.add_argument("-source_directory", help="path to source directory") +parser.add_argument("-core_root_directory", help="path to core_root directory") +parser.add_argument("-arch", help="Architecture") +parser.add_argument("-mch_file_tag", help="Tag to be used to mch files") +parser.add_argument("-collection_name", help="Name of the SPMI collection to be done") +parser.add_argument("-input_directory", help="directory containing assemblies for which superpmi collection to " + "be done") +parser.add_argument("-max_size", help="Max size of each partition in MB") +is_windows = platform.system() == "Windows" +native_binaries_to_ignore = [ + "clrcompression.dll", + "clretwrc.dll", + "clrgc.dll", + "clrjit.dll", + "clrjit_unix_arm_x64.dll", + "clrjit_unix_arm64_x64.dll", + "clrjit_unix_x64_x64.dll", + "clrjit_win_arm_x64.dll", + "clrjit_win_arm64_x64.dll", + "clrjit_win_x64_x64.dll", + "clrjit_win_x86_x64.dll", + "coreclr.dll", + "CoreConsole.exe", + "coredistools.dll", + "CoreRun.exe", + "CoreShim.dll", + "createdump.exe", + "crossgen.exe", + "dbgshim.dll", + "ilasm.exe", + "ildasm.exe", + "jitinterface_x64.dll", + "linuxnonjit.dll", + "mcs.exe", + "mscordaccore.dll", + "mscordbi.dll", + "mscorrc.dll", + "protononjit.dll", + "superpmi.exe", + "superpmi-shim-collector.dll", + "superpmi-shim-counter.dll", + "superpmi-shim-simple.dll", +] + + +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, + "source_directory", + lambda source_directory: os.path.isdir(source_directory), + "source_directory doesn't exist") + + coreclr_args.verify(args, + "core_root_directory", + lambda core_root_directory: os.path.isdir(core_root_directory), + "core_root_directory doesn't exist") + + coreclr_args.verify(args, + "arch", + lambda unused: True, + "Unable to set arch") + + coreclr_args.verify(args, + "mch_file_tag", + lambda unused: True, + "Unable to set mch_file_tag") + + coreclr_args.verify(args, + "collection_name", + lambda unused: True, + "Unable to set collection_name") + + coreclr_args.verify(args, + "input_directory", + lambda input_directory: os.path.isdir(input_directory), + "input_directory doesn't exist") + + coreclr_args.verify(args, + "max_size", + lambda max_size: max_size > 0, + "Please enter valid positive numeric max_size", + modify_arg=lambda max_size: int( + max_size) * 1000 * 1000 if max_size is not None and max_size.isnumeric() else 0 + # Convert to MB + ) + return coreclr_args + + +def get_files_sorted_by_size(src_directory, exclude_directories, exclude_files): + """ For a given src_directory, returns all the .dll files sorted by size. + + Args: + src_directory (string): Path of directory to enumerate. + exclude_directories ([string]): Directory names to exclude. + exclude_files ([string]): File names to exclude. + """ + + def sorter_by_size(pair): + """ Sorts the pair (file_name, file_size) tuple in descending order of file_size + + Args: + pair ([(string, int)]): List of tuple of file_name, file_size + """ + pair.sort(key=lambda x: x[1], reverse=True) + return pair + + filename_with_size = [] + + for file_path, dirs, files in walk(src_directory, topdown=True): + # Credit: https://stackoverflow.com/a/19859907 + dirs[:] = [d for d in dirs if d not in exclude_directories] + for name in files: + if name in exclude_files: + continue + curr_file_path = path.join(file_path, name) + + if not isfile(curr_file_path): + continue + if not name.endswith(".dll") and not name.endswith(".exe"): + continue + + size = getsize(curr_file_path) + filename_with_size.append((curr_file_path, size)) + + return sorter_by_size(filename_with_size) + + +def first_fit(sorted_by_size, max_size): + """ Given a list of file names along with size in descending order, divides the files + in number of buckets such that each bucket doesn't exceed max_size. Since this is a first-fit + approach, it doesn't guarantee to find the bucket with tighest spot available. + + Args: + sorted_by_size ((string, int)): (file_name, file_size) tuple + max_size (int): Maximum size (in bytes) of each bucket. + + Returns: + [{int, [string]}]: Returns a dictionary of partition-index to list of file names following in that bucket. + """ + partitions = {} + for curr_file in sorted_by_size: + _, file_size = curr_file + + # Find the right bucket + found_bucket = False + + if file_size < max_size: + for p_index in partitions: + total_in_curr_par = sum(n for _, n in partitions[p_index]) + if (total_in_curr_par + file_size) < max_size: + partitions[p_index].append(curr_file) + found_bucket = True + break + + if not found_bucket: + partitions[len(partitions)] = [curr_file] + + total_size = 0 + for p_index in partitions: + partition_size = sum(n for _, n in partitions[p_index]) + print("Partition {0}: {1} bytes.".format(p_index, partition_size)) + total_size += partition_size + print("Total {0} partitions with {1} bytes.".format(str(len(partitions)), total_size)) + + return partitions + + +def run_command(command_to_run, _cwd=None): + """ Runs the command. + + Args: + command_to_run ([string]): Command to run along with arguments. + _cmd (string): Current working directory. + """ + print("Running: " + " ".join(command_to_run)) + with subprocess.Popen(command_to_run, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=_cwd) as proc: + stdout, stderr = proc.communicate() + if len(stdout) > 0: + print(stdout.decode("utf-8")) + if len(stderr) > 0: + print(stderr.decode("utf-8")) + + +def copy_directory(src_path, dst_path): + """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. + + It only copied *.dll, *.exe and *.py files. + + Args: + src_path (string): Path of source directory that need to be copied. + dst_path (string): Path where directory should be 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) + else: + should_copy_file = dst_item.endswith('.dll') or dst_item.endswith('.py') + if is_windows: + should_copy_file = should_copy_file or dst_item.endswith('.exe') + else: + should_copy_file = should_copy_file or dst_item.endswith('.so') or item.find(".") == -1 + if not should_copy_file: + continue + shutil.copy2(src_item, dst_item) + + +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 to {0}:'.format(dst_path)) + print('') + print(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 = path.dirname(dst_path_of_file) + if not os.path.exists(dst_directory): + os.makedirs(dst_directory) + shutil.copy2(f, dst_path_of_file) + + +def partition_files(src_directory, dst_directory, max_size, exclude_directories=[], exclude_files=native_binaries_to_ignore): + """ Copy bucketized files based on size to destination folder. + + Args: + src_directory (string): Source folder containing files to be copied. + dst_directory (string): Destination folder where files should be copied. + max_size (int): Maximum partition size in bytes + exclude_directories ([string]): List of folder names to be excluded. + exclude_files ([string]): List of files names to be excluded. + """ + + sorted_by_size = get_files_sorted_by_size(src_directory, exclude_directories, exclude_files) + partitions = first_fit(sorted_by_size, max_size) + + index = 0 + for p_index in partitions: + file_names = [curr_file[0] for curr_file in partitions[p_index]] + curr_dst_path = path.join(dst_directory, str(index), "binaries") + copy_files(src_directory, curr_dst_path, file_names) + index += 1 + + +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 + + +def main(main_args): + """ Main entrypoint + + Args: + main_args ([type]): Arguments to the script + """ + coreclr_args = setup_args(main_args) + source_directory = coreclr_args.source_directory + + # CorrelationPayload directories + correlation_payload_directory = path.join(coreclr_args.source_directory, "payload") + superpmi_src_directory = path.join(source_directory, 'src', 'coreclr', 'scripts') + superpmi_dst_directory = path.join(correlation_payload_directory, "superpmi") + arch = coreclr_args.arch + helix_source_prefix = "official" + creator = "" + ci = True + if is_windows: + helix_queue = "Windows.10.Arm64" if arch == "arm64" else "Windows.10.Amd64" + else: + if arch == "arm": + helix_queue = "(Ubuntu.1804.Arm32)Ubuntu.1804.Armarch@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm32v7-bfcd90a-20200121150440" + elif arch == "arm64": + helix_queue = "(Ubuntu.1804.Arm64)Ubuntu.1804.ArmArch@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-a45aeeb-20190620155855" + else: + helix_queue = "Ubuntu.1804.Amd64" + + # create superpmi directory + print('Copying {} -> {}'.format(superpmi_src_directory, superpmi_dst_directory)) + copy_directory(superpmi_src_directory, superpmi_dst_directory) + print('Copying {} -> {}'.format(coreclr_args.core_root_directory, superpmi_dst_directory)) + copy_directory(coreclr_args.core_root_directory, superpmi_dst_directory) + + # Clone and build jitutils + try: + with tempfile.TemporaryDirectory() as jitutils_directory: + run_command( + ["git", "clone", "--quiet", "--depth", "1", "https://github.com/dotnet/jitutils", jitutils_directory]) + # Set dotnet path to run bootstrap + os.environ["PATH"] = path.join(source_directory, ".dotnet") + os.pathsep + os.environ["PATH"] + bootstrap_file = "bootstrap.cmd" if is_windows else "bootstrap.sh" + run_command([path.join(jitutils_directory, bootstrap_file)], jitutils_directory) + + copy_files(path.join(jitutils_directory, "bin"), superpmi_dst_directory, [path.join(jitutils_directory, "bin", "pmi.dll")]) + except PermissionError as pe_error: + # Details: https://bugs.python.org/issue26660 + print('Ignoring PermissionError: {0}'.format(pe_error)) + + # Workitem directories + workitem_directory = path.join(source_directory, "workitem") + pmiassemblies_directory = path.join(workitem_directory, "pmiAssembliesDirectory") + + # payload + input_artifacts = path.join(pmiassemblies_directory, coreclr_args.collection_name) + partition_files(coreclr_args.input_directory, input_artifacts, coreclr_args.max_size) + + # Set variables + print('Setting pipeline variables:') + set_pipeline_variable("CorrelationPayloadDirectory", correlation_payload_directory) + set_pipeline_variable("WorkItemDirectory", workitem_directory) + set_pipeline_variable("InputArtifacts", input_artifacts) + if is_windows: + set_pipeline_variable("Python", "py -3") + else: + set_pipeline_variable("Python", "python3") + set_pipeline_variable("Architecture", arch) + set_pipeline_variable("Creator", creator) + set_pipeline_variable("Queue", helix_queue) + set_pipeline_variable("HelixSourcePrefix", helix_source_prefix) + set_pipeline_variable("MchFileTag", coreclr_args.mch_file_tag) + + +################################################################################ +# __main__ +################################################################################ + +if __name__ == "__main__": + args = parser.parse_args() + sys.exit(main(args)) diff --git a/src/coreclr/scripts/superpmi.md b/src/coreclr/scripts/superpmi.md index 397df71099a6..a72ee2f06a95 100644 --- a/src/coreclr/scripts/superpmi.md +++ b/src/coreclr/scripts/superpmi.md @@ -1,34 +1,40 @@ -# An overview of using superpmi.py +# Documentation for the superpmi.py tool +SuperPMI is a tool for developing and testing the JIT compiler. General information on SuperPMI can be found [here](../src/ToolBox/superpmi/readme.md) ## Overview -Although SuperPMI has many uses, setup and use of SuperPMI is not always trivial. -superpmi.py is a tool to help automate the use of SuperPMI, augmenting its usefulness. +superpmi.py is a tool to simplify the use of SuperPMI. The tool has three primary modes: collect, replay, and asmdiffs. Below you will find more specific information on each of the different modes. +superpmi.py lives in the dotnet/runtime GitHub repo, src\coreclr\scripts directory. + ## General usage From the usage message: ``` -usage: superpmi.py [-h] {collect,replay,asmdiffs,upload,list-collections} ... +usage: superpmi.py [-h] + {collect,replay,asmdiffs,upload,download,list-collections} + ... Script to run SuperPMI replay, ASM diffs, and collections. The script also -manages the Azure store of precreated SuperPMI collection files. Help for each -individual command can be shown by asking for help on the individual command, -for example `superpmi.py collect --help`. +manages the Azure store of pre-created SuperPMI collection files. Help for +each individual command can be shown by asking for help on the individual +command, for example `superpmi.py collect --help`. positional arguments: - {collect,replay,asmdiffs,upload,list-collections} + {collect,replay,asmdiffs,upload,download,list-collections} Command to invoke optional arguments: -h, --help show this help message and exit ``` +## Replay + The simplest usage is to replay using: ``` @@ -41,92 +47,74 @@ In this case, everything needed is found using defaults: - The build type is assumed to be Checked. - Core_Root is found by assuming superpmi.py is in the normal location in the clone of the repo, and using the processor architecture, build type, and current -OS, to find it. +OS, to find it in the default `artifacts` directory location. Note that you must +have performed a product build for this platform / build type combination, and +created the appropriate Core_Root directory as well. - The SuperPMI tool and JIT to use for replay is found in Core_Root. -- The collection to use for replay is the default that is found in the -precomputed collections that are stored in Azure. +- The SuperPMI collections to use for replay are found in the Azure store of +precomputed collections for this JIT-EE interface GUID, OS, and processor architecture. -If you want to use a specific MCH file collection, use: +If you want to use a specific MCH file collection, use the `-mch_files` argument to specify +one or more MCH files on your machine: ``` -python f:\gh\runtime\src\coreclr\scripts\superpmi.py replay -mch_file f:\spmi\collections\tests.pmi.Windows_NT.x64.Release.mch +python f:\gh\runtime\src\coreclr\scripts\superpmi.py replay -mch_files f:\spmi\collections\tests.pmi.Windows_NT.x64.Release.mch ``` -To generate ASM diffs, use the `asmdiffs` command. In this case, you must specify -the path to a baseline JIT compiler, e.g.: +The `-mch_files` argument takes a list of one or more directories or files to use. For +each directory, all the MCH files in that directory are used. + +If you want to use just a subset of the collections, either default collections or collections +specified by `-mch_files`, use the `-filter` argument to restrict the MCH files used, e.g.: ``` -python f:\gh\runtime\src\coreclr\scripts\superpmi.py asmdiffs f:\jits\baseline_clrjit.dll +python f:\gh\runtime\src\coreclr\scripts\superpmi.py replay -filter tests ``` -ASM diffs requires the coredistools library. The script attempts to either find -or download an appropriate version that can be used. +## ASM diffs -## Collections +To generate ASM diffs, use the `asmdiffs` command. In this case, you must specify +the path to a baseline JIT compiler using the `-base_jit_path` argument, e.g.: -SuperPMI requires a collection to enable replay. You can do a collection -yourself, but it is more convenient to use existing precomputed collections. -Superpmi.py can automatically download existing collections +``` +python f:\gh\runtime\src\coreclr\scripts\superpmi.py asmdiffs -base_jit_path f:\jits\baseline_clrjit.dll +``` -Note that SuperPMI collections are sensitive to JIT/EE interface changes. If -there has been an interface change, the new JIT will not load and SuperPMI -will fail. +ASM diffs requires the coredistools library. The script attempts to find +or download an appropriate version that can be used. -**At the time of writing, collections are done manually. See below for a -full list of supported platforms and where the .mch collection exists.** +As for the "replay" case, the set of collections used defaults to the set available +in Azure, or can be specified using the `mch_files` argument. In either case, the +`-filter` argument can restrict the set used. -## Supported Platforms +## Collections -| OS | Arch | Replay | AsmDiffs | MCH location | -| --- | --- | --- | --- | --- | -| OSX | x64 |
  • - [x]
|
  • - [x]
| | -| Windows | x64 |
  • - [x]
|
  • - [x]
| | -| Windows | x86 |
  • - [x]
|
  • - [x]
| | -| Windows | arm |
  • - [ ]
|
  • - [ ]
| N/A | -| Windows | arm64 |
  • - [ ]
|
  • - [ ]
| N/A | -| Ubuntu | x64 |
  • - [x]
|
  • - [x]
| | -| Ubuntu | arm32 |
  • - [ ]
|
  • - [ ]
| N/A | -| Ubuntu | arm64 |
  • - [ ]
|
  • - [ ]
| N/A | +SuperPMI requires a collection to enable replay. You can do a collection +yourself using the superpmi.py `collect` command, but it is more convenient +to use existing precomputed collections stored in Azure. -## Default Collections +You can see which collections are available for your current settings using +the `list-collections` command. You can also see all the available collections +using the `list-collections --all` command. Finally, you can see which Azure stored +collections have been locally cached on your machine in the default cache location +by using `list-collections --local`. -See the table above for locations of default collections that exist. If there -is an MCH file that exists, then SuperPMI will automatically download and -use the MCH from that location. Please note that it is possible that the -collection is out of date, or there is a jitinterface change which makes the -collection invalid. If this is the case, then in order to use the tool a -collection will have to be done manually. In order to reproduce the default -collections, please see below for what command the default collections are -done with. +(Note that when collections are downloaded, they are cached locally. If there are +any cached collections, then no download attempt is made. To force re-download, +use the `--force_download` argument to the `replay`, `asmdiffs`, or `download` command.) -## Collect +### Creating a collection -Example commands to create a collection: +Example commands to create a collection (on Linux, by running the tests): ``` -/Users/jashoo/runtime/src/coreclr/build.sh x64 checked -/Users/jashoo/runtime/src/coreclr/build-test.sh x64 checked -priority1 +# First, build the product, possibly the tests, and create a Core_Root directory. /Users/jashoo/runtime/src/coreclr/scripts/superpmi.py collect bash "/Users/jashoo/runtime/src/coreclr/tests/runtest.sh x64 checked" ``` -Given a specific command, collect over all of the managed code called by the +The above command collects over all of the managed code called by the child process. Note that this allows many different invocations of any -managed code. Although it does specifically require that any managed code run -by the child process to handle the COMPlus variables set by SuperPMI and -defer them to the latter. These are below: - -``` -SuperPMIShimLogPath= -SuperPMIShimPath= -COMPlus_AltJit=* -COMPlus_AltJitName=superpmi-shim-collector.dll -``` - -If these variables are set and a managed exe is run, using for example the -dotnet CLI, the altjit settings will crash the process. - -To avoid this, the easiest way is to unset the variables in the beginning to -the root process, and then set them right before calling `$CORE_ROOT/corerun`. +managed code. You can also collect using PMI instead of running code. Do with with the `--pmi` and `-pmi_assemblies` arguments. E.g.: @@ -136,37 +124,15 @@ python f:\gh\runtime\src\coreclr\scripts\superpmi.py collect --pmi -pmi_assembli ``` Note that collection generates gigabytes of data. Most of this data will -be removed when the collection is finished. That being said, it is worth -mentioning that this process will use 3x the size of the unclean MCH file, -which to give an example of the size, a collection of the coreclr -`priority=1` tests uses roughly `200gb` of disk space. Most of this space -will be used in a temp directory, which on Windows will default to -`C:\Users\blah\AppData\Temp\...`. It is recommended to set the temp variable -to a different location before running collect to avoid running out of disk -space. This can be done by simply running `set TEMP=D:\TEMP`. +be removed when the collection is finished. It is recommended to set the TEMP variable +to a location with adequate space, and preferably on a fast SSD to improve performance, +before running `collect` to avoid running out of disk space. -## Replay +### Azure Storage collections + +As stated above, you can use the `list-collections` command to see which collections +are available in Azure. -SuperPMI replay supports faster assertion checking over a collection than -running the tests individually. This is useful if the collection includes a -larger corpus of data that can reasonably be run against by executing the -actual code, or if it is difficult to invoke the JIT across all the code in -the collection. Note that this is similar to the PMI tool, with the same -limitation, that runtime issues will not be caught by SuperPMI replay only -assertions. - -## Asm Diffs - -SuperPMI will take two different JITs, a baseline and diff JIT and run the -compiler accross all the methods in the MCH file. It uses coredistools to do -a binary difference of the two different outputs. Note that sometimes the -binary will differ, and SuperPMI will be run once again dumping the asm that -was output in text format. Then the text will be diffed, if there are -differences, you should look for text differences. If there are some then it -is worth investigating the asm differences. - -superpmi.py can also be asked to generate JitDump differences in addition -to the ASM diff differences generated by default. - -It is worth noting as well that SuperPMI gives more stable instructions -retired counters for the JIT. +There is also a `download` command to download one or more Azure stored collection +to the local cache, as well as an `upload` command to populate the Azure collection +set. diff --git a/src/coreclr/scripts/superpmi.proj b/src/coreclr/scripts/superpmi.proj new file mode 100644 index 000000000000..7524245f4c71 --- /dev/null +++ b/src/coreclr/scripts/superpmi.proj @@ -0,0 +1,96 @@ + + + + \ + + + / + + + + + %HELIX_PYTHONPATH% + $(WorkItemDirectory)\pmiAssembliesDirectory + %HELIX_WORKITEM_PAYLOAD%\binaries + %HELIX_CORRELATION_PAYLOAD%\superpmi + %HELIX_WORKITEM_UPLOAD_ROOT% + + $(BUILD_SOURCESDIRECTORY)\artifacts\helixresults + $(SuperPMIDirectory)\superpmi.py collect --pmi -pmi_location $(SuperPMIDirectory)\pmi.dll + + + $HELIX_PYTHONPATH + $(WorkItemDirectory)/pmiAssembliesDirectory + $HELIX_WORKITEM_PAYLOAD/binaries + $HELIX_CORRELATION_PAYLOAD/superpmi + $HELIX_WORKITEM_UPLOAD_ROOT + + $(BUILD_SOURCESDIRECTORY)/artifacts/helixresults + $(SuperPMIDirectory)/superpmi.py collect --pmi -pmi_location $(SuperPMIDirectory)/pmi.dll + + + + $(Python) $(WorkItemCommand) -pmi_assemblies $(PmiAssembliesDirectory) -arch $(Architecture) -build_type $(BuildConfig) -core_root $(SuperPMIDirectory) + + + + false + false + 5:00 + + + + + %(Identity) + + + + + + + + + + + $(CollectionName).pmi.%(HelixWorkItem.PartitionId).$(MchFileTag) + $(PmiAssembliesPayload)$(FileSeparatorChar)$(CollectionName)$(FileSeparatorChar)%(HelixWorkItem.PmiAssemblies) + $(WorkItemCommand) -output_mch_path $(OutputMchPath)$(FileSeparatorChar)%(OutputFileName).mch -log_file $(OutputMchPath)$(FileSeparatorChar)%(OutputFileName).log + $(WorkItemTimeout) + %(OutputFileName).mch;%(OutputFileName).mch.mct;%(OutputFileName).log + + + + + + + \ No newline at end of file diff --git a/src/coreclr/scripts/superpmi.py b/src/coreclr/scripts/superpmi.py index fa0f3e2f165d..85bdcb974c9a 100755 --- a/src/coreclr/scripts/superpmi.py +++ b/src/coreclr/scripts/superpmi.py @@ -8,10 +8,10 @@ # # Notes: # -# Script to handle running SuperPMI Collections, and replays. In addition, this -# script provides support for SuperPMI ASM diffs. Note that some of the options -# provided by this script are also provided in our SuperPMI collect test. The -# test can be found here: https://github.com/dotnet/coreclr/blob/master/tests/src/JIT/superpmi/superpmicollect.cs. +# Script to orchestrate SuperPMI collections, replays, asm diffs, and SuperPMI +# data management. Note that some of the options provided by this script are +# also provided in our SuperPMI collect test. The test can be found here: +# https://github.com/dotnet/runtime/blob/master/src/tests/JIT/superpmi/superpmicollect.cs. # ################################################################################ ################################################################################ @@ -19,8 +19,8 @@ import argparse import asyncio import datetime -import json -import math +import locale +import logging import os import multiprocessing import platform @@ -28,19 +28,39 @@ import subprocess import sys import tempfile -import time +import queue import re -import string import urllib import urllib.request import zipfile -import xml.etree.ElementTree +from coreclr_arguments import * -from collections import defaultdict -from sys import platform as _platform +locale.setlocale(locale.LC_ALL, '') # Use '' for auto, or force e.g. to 'en_US.UTF-8' -from coreclr_arguments import * +################################################################################ +# Azure Storage information +################################################################################ + +# We store several things in Azure Blob Storage: +# 1. SuperPMI collections +# 2. A copy of PMI.dll, as a fallback in case we need it but can't find it locally, +# so we don't need to download dotnet/jitutils and build it ourselves. +# (Note: if PMI is ever published as a package, we could just download that instead.) +# 3. A copy of coredistools. If, when doing asm diffs, a copy of the coredistools +# library is not found in the Core_Root directory, we download a cached copy. +# Note: it would be better to download and use the official coredistools +# NuGet packages (like the setup-stress-dependencies scripts do). + +az_account_name = "clrjit2" +az_superpmi_container_name = "superpmi" +az_collections_root_folder = "collections" +az_blob_storage_account_uri = "https://" + az_account_name + ".blob.core.windows.net/" +az_blob_storage_superpmi_container_uri = az_blob_storage_account_uri + az_superpmi_container_name + +az_jitrollingbuild_container_name = "jitrollingbuild" +az_builds_root_folder = "builds" +az_blob_storage_jitrollingbuild_container_uri = az_blob_storage_account_uri + az_jitrollingbuild_container_name ################################################################################ # Argument Parser @@ -48,7 +68,7 @@ description = """\ Script to run SuperPMI replay, ASM diffs, and collections. -The script also manages the Azure store of precreated SuperPMI collection files. +The script also manages the Azure store of pre-created SuperPMI collection files. Help for each individual command can be shown by asking for help on the individual command, for example `superpmi.py collect --help`. """ @@ -69,13 +89,30 @@ Upload a collection to SuperPMI Azure storage. """ +download_description = """\ +Download collections from SuperPMI Azure storage. +Normally, collections are automatically downloaded to a local cache +as part of doing a 'replay' operation. This command allows you to +download without doing a 'replay'. +""" + list_collections_description = """\ List the existing collections in the SuperPMI Azure storage. """ -collection_help = "Which collection type to use for replays. Default is to run everything. Use 'superpmi.py list-collections' to find available collections." +merge_mch_description = """\ +Utility command to merge MCH files. This is a thin wrapper around +'mcs -merge -recursive -dedup -thin' followed by 'mcs -toc'. +""" + +spmi_log_file_help = "Write SuperPMI tool output to a log file. Requires --sequential." -log_file_help = "Write output to a log file. Requires --sequential." +jit_ee_version_help = """\ +JIT/EE interface version (the JITEEVersionIdentifier GUID from corinfo.h in the format +'a5eec3a4-4176-43a7-8c2b-a05b551d4f49'). Default: if the mcs tool is found, assume it +was built with the same JIT/EE version as the JIT we are using, and run "mcs -printJITEEVersion" +to get that version. Otherwise, use "unknown-jit-ee-version". +""" host_os_help = "OS (Windows_NT, OSX, Linux). Default: current OS." @@ -85,10 +122,20 @@ core_root_help = "Core_Root location. Optional; it will be deduced if possible from runtime repo root." +log_level_help = """\ +Console log level (output verbosity level). +One of: critical, error, warning, info, debug. +Output from this level and higher is output to the console. +All output is always written to the log file. +Default: warning. +""" + +log_file_help = "Output log file path. If not specified, a default location is chosen." + product_location_help = "Built Product directory location. Optional; it will be deduced if possible from runtime repo root." spmi_location_help = """\ -Directory in which to put SuperPMI files, such as downloaded MCH files, asm diffs, and repro .MC file. +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. """ @@ -97,9 +144,22 @@ invoked inside this command, as they will fail due to the shim altjit being set. """ -mch_file_help = """\ -Location of the MCH file to use for replay. Note that this may either be a path on disk or a URI to a MCH file to download. -Use this MCH file instead of a named collection set from the cloud MCH file store. +replay_mch_files_help = """\ +MCH files, or directories containing MCH files, to use for replay. For each directory passed, +all recursively found MCH files in that directory root will be used. Files may either be a path +on disk or a URI to a MCH file to download. Use these MCH files instead of a collection from +the Azure Storage MCH file store. UNC paths will be downloaded and cached locally. +""" + +filter_help = """\ +Specify one or more filters to restrict the set of MCH files to download or use from the local cache. +A filter is a simple case-insensitive substring search against the MCH file path. If multiple filter +strings are specified, any maching path is accepted (it is "or", not "and"). +""" + +upload_mch_files_help = """\ +MCH files, or directories containing MCH files, to upload. For each directory passed, +all recursively found MCH files in that directory root will be uploaded. MCT files are also uploaded. """ skip_cleanup_help = "Skip intermediate file removal." @@ -108,30 +168,59 @@ break_on_error_help = "Enable break on error during SuperPMI replay." -force_download_help = "If downloading an MCH file, always download it. Don't use an existing file in the download location." +force_download_help = """\ +If downloading an MCH file, always download it. Don't use an existing file in the download location. +Normally, we don't download if the target directory exists. This forces download even if the +target directory already exists. +""" + +merge_mch_pattern_help = """\ +A pattern to describing files to merge, passed through directly to `mcs -merge`. +Acceptable patterns include `*.mch`, `file*.mch`, and `c:\\my\\directory\\*.mch`. +Only the final component can contain a `*` wildcard; the directory path cannot. +""" # Start of parser object creation. parser = argparse.ArgumentParser(description=description) subparsers = parser.add_subparsers(dest='mode', help="Command to invoke") +subparsers.required = True + +# Create a parser for core_root. It can be specified directly, +# or computed from the script location and host OS, architecture, and build type: +# +# script location implies repo root, +# implies artifacts location, +# implies test location from host OS, architecture, build type, +# implies Core_Root path +# +# You normally use the default host OS, but for Azure Storage upload and other +# operations, it can be useful to allow it to be specified. + +core_root_parser = argparse.ArgumentParser(add_help=False) + +core_root_parser.add_argument("-arch", help=arch_help) +core_root_parser.add_argument("-build_type", default="Checked", help=build_type_help) +core_root_parser.add_argument("-host_os", help=host_os_help) +core_root_parser.add_argument("-core_root", help=core_root_help) +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) # Create a set of argument common to all commands that run SuperPMI. superpmi_common_parser = argparse.ArgumentParser(add_help=False) -superpmi_common_parser.add_argument("-arch", default=CoreclrArguments.provide_default_arch(), help=arch_help) -superpmi_common_parser.add_argument("-build_type", default="Checked", help=build_type_help) -superpmi_common_parser.add_argument("-core_root", help=core_root_help) -superpmi_common_parser.add_argument("-spmi_location", help=spmi_location_help) superpmi_common_parser.add_argument("--break_on_assert", action="store_true", help=break_on_assert_help) superpmi_common_parser.add_argument("--break_on_error", action="store_true", help=break_on_error_help) superpmi_common_parser.add_argument("--skip_cleanup", action="store_true", help=skip_cleanup_help) -superpmi_common_parser.add_argument("--sequential", action="store_true", help="Run SuperPMI in sequential mode.") -superpmi_common_parser.add_argument("-log_file", help=log_file_help) +superpmi_common_parser.add_argument("--sequential", action="store_true", help="Run SuperPMI in sequential mode. Default is to run in parallel for faster runs.") +superpmi_common_parser.add_argument("-spmi_log_file", help=spmi_log_file_help) +superpmi_common_parser.add_argument("-altjit", help="Replay with an altjit. Specify the filename of the altjit to use, e.g., 'clrjit_win_arm64_x64.dll'.") # subparser for collect -collect_parser = subparsers.add_parser("collect", description=collect_description, parents=[superpmi_common_parser]) +collect_parser = subparsers.add_parser("collect", description=collect_description, parents=[core_root_parser, superpmi_common_parser]) # Add required arguments collect_parser.add_argument("collection_command", nargs='?', help=superpmi_collect_help) @@ -139,17 +228,17 @@ collect_parser.add_argument("--pmi", action="store_true", help="Run PMI on a set of directories or assemblies.") collect_parser.add_argument("-pmi_assemblies", dest="pmi_assemblies", nargs="+", default=[], help="Pass a sequence of managed dlls or directories to recursively run PMI over while collecting. Required if --pmi is specified.") -collect_parser.add_argument("-pmi_location", help="Path to pmi.dll to use during PMI run. Optional; pmi.dll will be downloaded from Azure storage if necessary.") -collect_parser.add_argument("-output_mch_path", help="Location to place the final MCH file. By default it will be placed at artifacts/mch/$(os).$(arch).$(build_type)/$(os).$(arch).$(build_type).mch") +collect_parser.add_argument("-pmi_location", help="Path to pmi.dll to use during PMI run. Optional; pmi.dll will be downloaded from Azure Storage if necessary.") +collect_parser.add_argument("-output_mch_path", help="Location to place the final MCH file.") collect_parser.add_argument("--merge_mch_files", action="store_true", help="Merge multiple MCH files. Use the -mch_files flag to pass a list of MCH files to merge.") -collect_parser.add_argument("-mch_files", nargs='+', help="Pass a sequence of MCH files which will be merged. Required by --merge_mch_files.") -collect_parser.add_argument("--use_zapdisable", action="store_true", help="Sets COMPlus_ZapDisable=1 when doing collection to cause NGEN/ReadyToRun images to not be used, and thus causes JIT compilation and SuperPMI collection of these methods.") +collect_parser.add_argument("-mch_files", metavar="MCH_FILE", nargs='+', help="Pass a sequence of MCH files which will be merged. Required by --merge_mch_files.") +collect_parser.add_argument("--use_zapdisable", action="store_true", help="Sets COMPlus_ZapDisable=1 and COMPlus_ReadyToRun=0 when doing collection to cause NGEN/ReadyToRun images to not be used, and thus causes JIT compilation and SuperPMI collection of these methods.") # Allow for continuing a collection in progress -collect_parser.add_argument("-existing_temp_dir", help="Specify an existing temporary directory to use. Useful if continuing an ongoing collection process, or forcing a temporary directory to a particular hard drive. Optional; default is to create a temporary directory in the usual TEMP location.") -collect_parser.add_argument("--has_run_collection_command", action="store_true", help="Do not run the collection step.") -collect_parser.add_argument("--has_merged_mch", action="store_true", help="Do not run the merge step.") -collect_parser.add_argument("--has_verified_clean_mch", action="store_true", help="Do not run the collection cleaning step.") +collect_parser.add_argument("-temp_dir", help="Specify an existing temporary directory to use. Useful if continuing an ongoing collection process, or forcing a temporary directory to a particular hard drive. Optional; default is to create a temporary directory in the usual TEMP location.") +collect_parser.add_argument("--skip_collection_step", action="store_true", help="Do not run the collection step.") +collect_parser.add_argument("--skip_merge_step", action="store_true", help="Do not run the merge step.") +collect_parser.add_argument("--skip_clean_and_verify_step", action="store_true", help="Do not run the collection cleaning, TOC creation, and verifying step.") collect_parser.add_argument("--skip_collect_mc_files", action="store_true", help="Do not collect .MC files") # Create a set of argument common to all SuperPMI replay commands, namely basic replay and ASM diffs. @@ -158,53 +247,70 @@ replay_common_parser = argparse.ArgumentParser(add_help=False) -replay_common_parser.add_argument("-mch_file", help=mch_file_help) +replay_common_parser.add_argument("-mch_files", metavar="MCH_FILE", nargs='+', help=replay_mch_files_help) +replay_common_parser.add_argument("-filter", nargs='+', help=filter_help) replay_common_parser.add_argument("-product_location", help=product_location_help) replay_common_parser.add_argument("--force_download", action="store_true", help=force_download_help) -replay_common_parser.add_argument("-altjit", nargs='?', const=True, help="Replay with an altjit. If an argument is specified, it is used as the name of the altjit (e.g., 'protojit.dll'). Otherwise, the default altjit name is used.") +replay_common_parser.add_argument("-jit_ee_version", help=jit_ee_version_help) # subparser for replay -replay_parser = subparsers.add_parser("replay", description=replay_description, parents=[superpmi_common_parser, replay_common_parser]) +replay_parser = subparsers.add_parser("replay", description=replay_description, parents=[core_root_parser, superpmi_common_parser, replay_common_parser]) # Add required arguments -replay_parser.add_argument("collection", nargs='?', default="default", help=collection_help) - replay_parser.add_argument("-jit_path", help="Path to clrjit. Defaults to Core_Root JIT.") # subparser for asmDiffs -asm_diff_parser = subparsers.add_parser("asmdiffs", description=asm_diff_description, parents=[superpmi_common_parser, replay_common_parser]) +asm_diff_parser = subparsers.add_parser("asmdiffs", description=asm_diff_description, parents=[core_root_parser, superpmi_common_parser, replay_common_parser]) # Add required arguments -asm_diff_parser.add_argument("base_jit_path", help="Path to baseline clrjit.") -asm_diff_parser.add_argument("diff_jit_path", nargs='?', help="Path to diff clrjit. Defaults to Core_Root JIT.") +asm_diff_parser.add_argument("-base_jit_path", help="Path to baseline clrjit. Defaults to baseline JIT from rolling build, by computing baseline git hash.") +asm_diff_parser.add_argument("-diff_jit_path", help="Path to diff clrjit. Defaults to Core_Root JIT.") +asm_diff_parser.add_argument("-git_hash", help="Use this git hash as the current to 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("collection", nargs='?', default="default", help=collection_help) asm_diff_parser.add_argument("--diff_with_code", action="store_true", help="Invoke Visual Studio Code to view any diffs.") asm_diff_parser.add_argument("--diff_with_code_only", action="store_true", help="Invoke Visual Studio Code to view any diffs. Only run the diff command, do not run SuperPMI to regenerate diffs.") 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("--diff_jit_dump_only", action="store_true", help="Only diff JitDump output, not asm.") -asm_diff_parser.add_argument("-previous_temp_location", help="Specify a temporary directory used for a previous ASM diffs run (for which --skip_cleanup was used) to view the results.") +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.") # subparser for upload -upload_parser = subparsers.add_parser("upload", description=upload_description) -upload_parser.add_argument("az_storage_key", nargs='?', help="Key for the clrjit Azure Storage location. Default: use the value of the CLRJIT_AZ_KEY environment variable.") -upload_parser.add_argument("-mch_files", nargs='+', help="MCH files to pass") +upload_parser = subparsers.add_parser("upload", description=upload_description, parents=[core_root_parser]) + +upload_parser.add_argument("-mch_files", metavar="MCH_FILE", required=True, nargs='+', help=upload_mch_files_help) +upload_parser.add_argument("-az_storage_key", help="Key for the clrjit Azure Storage location. Default: use the value of the CLRJIT_AZ_KEY environment variable.") upload_parser.add_argument("-jit_location", help="Location for the base clrjit. If not passed this will be assumed to be from the Core_Root.") -upload_parser.add_argument("-arch", default=CoreclrArguments.provide_default_arch(), help=arch_help) -upload_parser.add_argument("-build_type", default="Checked", help=build_type_help) +upload_parser.add_argument("-jit_ee_version", help=jit_ee_version_help) upload_parser.add_argument("--skip_cleanup", action="store_true", help=skip_cleanup_help) +# subparser for download +download_parser = subparsers.add_parser("download", description=download_description, parents=[core_root_parser]) + +download_parser.add_argument("-filter", nargs='+', help=filter_help) +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("-mch_files", metavar="MCH_FILE", nargs='+', help=replay_mch_files_help) + # subparser for list-collections -list_collections_parser = subparsers.add_parser("list-collections", description=list_collections_description) +list_collections_parser = subparsers.add_parser("list-collections", description=list_collections_description, parents=[core_root_parser]) + +list_collections_parser.add_argument("-jit_ee_version", help=jit_ee_version_help) +list_collections_parser.add_argument("--all", action="store_true", help="Show all MCH files, not just those for the specified (or default) JIT-EE version, OS, and architecture") +list_collections_parser.add_argument("--local", action="store_true", help="Show the local MCH download cache") + +# subparser for merge-mch + +merge_mch_parser = subparsers.add_parser("merge-mch", description=merge_mch_description, parents=[core_root_parser]) -list_collections_parser.add_argument("-host_os", default=CoreclrArguments.provide_default_host_os(), help=host_os_help) -list_collections_parser.add_argument("-arch", default=CoreclrArguments.provide_default_arch(), help=arch_help) -list_collections_parser.add_argument("-build_type", default="Checked", help=build_type_help) +merge_mch_parser.add_argument("-output_mch_path", required=True, help="Location to place the final MCH file.") +merge_mch_parser.add_argument("-pattern", required=True, help=merge_mch_pattern_help) ################################################################################ # Helper functions ################################################################################ + def is_zero_length_file(fpath): """ Determine if a file system path refers to an existing file that is zero length @@ -216,6 +322,7 @@ def is_zero_length_file(fpath): """ 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 @@ -227,6 +334,7 @@ def is_nonzero_length_file(fpath): """ 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. @@ -243,49 +351,56 @@ def safe_char(c): return "_" return "".join(safe_char(c) for c in s) -def find_in_path(name, pathlist, matchFunc=os.path.isfile): + +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 semicolon-separated `pathlist` (e.g., PATH environment variable). + 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 (str) : semicolon-separated string of directory names to search - matchFunc (str -> bool) : determines if the name is a match + 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 matchFunc(candidate): + 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 semicolon-separated `pathlist` (e.g., PATH environment variable). + 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 (str) : semicolon-separated string of directory names to search + 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 semicolon-separated `pathlist` (e.g., PATH environment variable). + 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 (str) : semicolon-separated string of directory names to search + 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, matchFunc=os.path.isdir) + 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`. @@ -312,19 +427,76 @@ def create_unique_directory_name(root_directory, base_name): os.makedirs(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 + + Args: + command (list) : Command to run + log_level (int) : log level to use for logging output (but not the "Invoking" text) + + Returns: + Process return code + """ + + logging.debug("Invoking: %s", " ".join(command)) + proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout_output, _ = proc.communicate() + for line in stdout_output.decode('utf-8').splitlines(): # There won't be any stderr output since it was piped to stdout + logging.log(log_level, line) + return proc.returncode + ################################################################################ # 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 args.skip_cleanup is False). + """ + def __init__(self, path=None): - self.dir = tempfile.mkdtemp() if path is None else path + self.mydir = tempfile.mkdtemp() if path is None else path self.cwd = None def __enter__(self): self.cwd = os.getcwd() - os.chdir(self.dir) - return self.dir + os.chdir(self.mydir) + return self.mydir def __exit__(self, exc_type, exc_val, exc_tb): os.chdir(self.cwd) @@ -332,86 +504,80 @@ def __exit__(self, exc_type, exc_val, exc_tb): # the `skip_cleanup` argument is not processed by CoreclrArguments, but is # just copied there. if not args.skip_cleanup: - shutil.rmtree(self.dir) + shutil.rmtree(self.mydir) + class ChangeDir: - def __init__(self, dir): - self.dir = dir + """ 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.dir) + os.chdir(self.mydir) def __exit__(self, exc_type, exc_val, exc_tb): os.chdir(self.cwd) + class AsyncSubprocessHelper: - def __init__(self, items, subproc_count=multiprocessing.cpu_count(), verbose=False): - item_queue = asyncio.Queue() - for item in items: - item_queue.put_nowait(item) + """ Class to help with async multiprocessing tasks. + """ + def __init__(self, items, subproc_count=multiprocessing.cpu_count(), verbose=False): self.items = items self.subproc_count = subproc_count self.verbose = verbose + self.subproc_count_queue = None if 'win32' in sys.platform: # Windows specific event-loop policy & cmd - asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy()) + asyncio.set_event_loop(asyncio.ProactorEventLoop()) async def __get_item__(self, item, index, size, async_callback, *extra_args): """ Wrapper to the async callback which will schedule based on the queue """ - # Wait for the queue to become free. Then start - # running the sub process. + # Wait for the subproc_id queue to become free, meaning we have an available + # processor to run a task (specifically, we are below our maximum allowed + # parallelism). Then start running the sub process. subproc_id = await self.subproc_count_queue.get() print_prefix = "" - if self.verbose: print_prefix = "[{}:{}]: ".format(index, size) await async_callback(print_prefix, item, *extra_args) - # Add back to the queue, incase another process wants to run. + # Add back to the queue, in case another process wants to run. self.subproc_count_queue.put_nowait(subproc_id) async def __run_to_completion__(self, async_callback, *extra_args): """ async wrapper for run_to_completion """ + # Create a queue with one entry for each of the threads we're + # going to allow. By default, this will be one entry per cpu. + # using subproc_count_queue.get() will block when we're running + # a task on every CPU. chunk_size = self.subproc_count - - # Create a queue with a chunk size of the cpu count - # - # Each run_pmi invocation will remove an item from the - # queue before running a potentially long running pmi run. - # - # When the queue is drained, we will wait queue.get which - # will wait for when a run_pmi instance has added back to the - subproc_count_queue = asyncio.Queue(chunk_size) - diff_queue = asyncio.Queue() - - for item in self.items: - diff_queue.put_nowait(item) - + self.subproc_count_queue = asyncio.Queue(chunk_size) for item in range(chunk_size): - subproc_count_queue.put_nowait(item) - - self.subproc_count_queue = subproc_count_queue - tasks = [] - size = diff_queue.qsize() + self.subproc_count_queue.put_nowait(item) + # Create a 'tasks' list of async function calls, one for each item. + # When all these calls complete, we're done. + size = len(self.items) count = 1 - item = diff_queue.get_nowait() if not diff_queue.empty() else None - while item is not None: + tasks = [] + for item in self.items: tasks.append(self.__get_item__(item, count, size, async_callback, *extra_args)) count += 1 - item = diff_queue.get_nowait() if not diff_queue.empty() else None - + # Inovke all the calls to __get_item__ concurrently and wait for them all to finish. await asyncio.gather(*tasks) def run_to_completion(self, async_callback, *extra_args): @@ -428,13 +594,15 @@ def run_to_completion(self, async_callback, *extra_args): """ reset_env = os.environ.copy() - asyncio.run(self.__run_to_completion__(async_callback, *extra_args)) + loop = asyncio.get_event_loop() + loop.run_until_complete(self.__run_to_completion__(async_callback, *extra_args)) os.environ.update(reset_env) ################################################################################ # SuperPMI Collect ################################################################################ + class SuperPMICollect: """ SuperPMI Collect class @@ -453,22 +621,19 @@ def __init__(self, coreclr_args): if coreclr_args.host_os == "OSX": self.collection_shim_name = "libsuperpmi-shim-collector.dylib" - self.mcs_tool_name = "mcs" self.corerun_tool_name = "corerun" elif coreclr_args.host_os == "Linux": self.collection_shim_name = "libsuperpmi-shim-collector.so" - self.mcs_tool_name = "mcs" self.corerun_tool_name = "corerun" elif coreclr_args.host_os == "Windows_NT": self.collection_shim_name = "superpmi-shim-collector.dll" - self.mcs_tool_name = "mcs.exe" self.corerun_tool_name = "corerun.exe" else: raise RuntimeError("Unsupported OS.") self.jit_path = os.path.join(coreclr_args.core_root, determine_jit_name(coreclr_args)) - self.superpmi_path = os.path.join(coreclr_args.core_root, determine_superpmi_tool_name(coreclr_args)) - self.mcs_path = os.path.join(coreclr_args.core_root, self.mcs_tool_name) + self.superpmi_path = determine_superpmi_tool_path(coreclr_args) + self.mcs_path = determine_mcs_tool_path(coreclr_args) self.core_root = coreclr_args.core_root @@ -482,14 +647,6 @@ def __init__(self, coreclr_args): self.coreclr_args = coreclr_args - ############################################################################ - # Instance Methods - ############################################################################ - - def collect(self): - """ Do the SuperPMI Collection. - """ - # Pathname for a temporary .MCL file used for noticing SuperPMI replay failures against base MCH. self.base_fail_mcl_file = None @@ -502,7 +659,15 @@ def collect(self): # The .TOC file path for the clean thin unique .MCH file self.toc_file = None - self.save_the_final_mch_file = False + self.temp_location = None + + ############################################################################ + # Instance Methods + ############################################################################ + + def collect(self): + """ Do the SuperPMI Collection. + """ # Do a basic SuperPMI collect and validation: # 1. Collect MC files by running a set of sample apps. @@ -519,7 +684,7 @@ def collect(self): passed = False try: - with TempDir(self.coreclr_args.existing_temp_dir) as temp_location: + with TempDir(self.coreclr_args.temp_dir) as temp_location: # Setup all of the temp locations self.base_fail_mcl_file = os.path.join(temp_location, "basefail.mcl") self.base_mch_file = os.path.join(temp_location, "base.mch") @@ -537,26 +702,25 @@ def collect(self): os.makedirs(default_coreclr_bin_mch_location) self.final_mch_file = os.path.abspath(os.path.join(default_coreclr_bin_mch_location, "{}.{}.{}.mch".format(self.coreclr_args.host_os, self.coreclr_args.arch, self.coreclr_args.build_type))) - self.save_the_final_mch_file = True self.toc_file = "{}.mct".format(self.final_mch_file) - # If we have passed existing_temp_dir, then we have a few flags we need + # If we have passed temp_dir, then we have a few flags we need # to check to see where we are in the collection process. Note that this # functionality exists to help not lose progress during a SuperPMI collection. # It is not unreasonable for the SuperPMI collection to take many hours # therefore allow re-use of a collection in progress - if not self.coreclr_args.has_run_collection_command: + if not self.coreclr_args.skip_collection_step: self.__collect_mc_files__() - if not self.coreclr_args.has_merged_mch: + if not self.coreclr_args.skip_merge_step: if not self.coreclr_args.merge_mch_files: self.__merge_mc_files__() else: self.__merge_mch_files__() - if not self.coreclr_args.has_verified_clean_mch: + if not self.coreclr_args.skip_clean_and_verify_step: self.__create_clean_mch_file__() self.__create_toc__() self.__verify_final_mch__() @@ -564,7 +728,7 @@ def collect(self): passed = True except Exception as exception: - print(exception) + logging.critical(exception) return passed @@ -590,88 +754,81 @@ def __collect_mc_files__(self): env_copy["COMPlus_AltJitNgen"] = "*" env_copy["COMPlus_AltJitName"] = self.collection_shim_name env_copy["COMPlus_EnableExtraSuperPmiQueries"] = "1" + env_copy["COMPlus_TieredCompilation"] = "0" if self.coreclr_args.use_zapdisable: env_copy["COMPlus_ZapDisable"] = "1" + env_copy["COMPlus_ReadyToRun"] = "0" + + logging.debug("Starting collection.") + logging.debug("") + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "SuperPMIShimLogPath", self.temp_location) + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "SuperPMIShimPath", self.jit_path) + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "COMPlus_AltJit", "*") + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "COMPlus_AltJitNgen", "*") + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "COMPlus_AltJitName", self.collection_shim_name) + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "COMPlus_EnableExtraSuperPmiQueries", "1") + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "COMPlus_TieredCompilation", "0") + if self.coreclr_args.use_zapdisable: + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "COMPlus_ZapDisable", "1") + print_platform_specific_environment_vars(logging.DEBUG, self.coreclr_args, "COMPlus_ReadyToRun", "0") + logging.debug("") - print("Starting collection.") - print("") - print_platform_specific_environment_vars(self.coreclr_args, "SuperPMIShimLogPath", self.temp_location) - print_platform_specific_environment_vars(self.coreclr_args, "SuperPMIShimPath", self.jit_path) - print_platform_specific_environment_vars(self.coreclr_args, "COMPlus_AltJit", "*") - print_platform_specific_environment_vars(self.coreclr_args, "COMPlus_AltJitName", self.collection_shim_name) - print_platform_specific_environment_vars(self.coreclr_args, "COMPlus_AltJitNgen", "*") - print("") - - if self.collection_command != None: - print("%s %s" % (self.collection_command, " ".join(self.collection_args))) + if self.collection_command is not None: + logging.info("Collecting using command:") + logging.info(" %s %s", self.collection_command, " ".join(self.collection_args)) assert isinstance(self.collection_command, str) assert isinstance(self.collection_args, list) - self.command = [self.collection_command,] + self.collection_args - proc = subprocess.Popen(self.command, env=env_copy) - proc.communicate() - return_code = proc.returncode + command = [self.collection_command, ] + self.collection_args + proc = subprocess.Popen(command, env=env_copy, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout_output, _ = proc.communicate() + for line in stdout_output.decode('utf-8').splitlines(): # There won't be any stderr output since it was piped to stdout + logging.debug(line) if self.coreclr_args.pmi is True: - def get_all_assemblies(location, root=True): - """ Return all potential managed assemblies in a directory - """ - - assert os.path.isdir(location) or os.path.isfile(location) - - valid_extensions = [".dll", ".exe"] - - assemblies = [] - - if os.path.isdir(location): - for item in os.listdir(location): - assemblies += get_all_assemblies(os.path.join(location, item), False) - else: - for item in valid_extensions: - if location.endswith(item): - assemblies.append(location) - - return assemblies - async def run_pmi(print_prefix, assembly, self): """ Run pmi over all dlls """ command = [self.corerun, self.pmi_location, "DRIVEALL", assembly] command_string = " ".join(command) - print("{}{}".format(print_prefix, command_string)) + logging.debug("%s%s", print_prefix, command_string) # Save the stdout and stderr to files, so we can see if PMI wrote any interesting messages. # Use the name of the assembly as the basename of the file. mkstemp() will ensure the file # is unique. root_output_filename = make_safe_filename("pmi_" + assembly + "_") - stdout_file_handle, stdout_filepath = tempfile.mkstemp(suffix=".stdout", prefix=root_output_filename, dir=self.temp_location) - stderr_file_handle, stderr_filepath = tempfile.mkstemp(suffix=".stderr", prefix=root_output_filename, dir=self.temp_location) + try: + stdout_file_handle, stdout_filepath = tempfile.mkstemp(suffix=".stdout", prefix=root_output_filename, dir=self.temp_location) + stderr_file_handle, stderr_filepath = tempfile.mkstemp(suffix=".stderr", prefix=root_output_filename, dir=self.temp_location) - proc = await asyncio.create_subprocess_shell( - command_string, - stdout=stdout_file_handle, - stderr=stderr_file_handle) + proc = await asyncio.create_subprocess_shell( + command_string, + stdout=stdout_file_handle, + stderr=stderr_file_handle) - await proc.communicate() + await proc.communicate() - os.close(stdout_file_handle) - os.close(stderr_file_handle) + os.close(stdout_file_handle) + os.close(stderr_file_handle) # No need to keep zero-length files - if is_zero_length_file(stdout_filepath): - os.remove(stdout_filepath) - if is_zero_length_file(stderr_filepath): - os.remove(stderr_filepath) + if is_zero_length_file(stdout_filepath): + os.remove(stdout_filepath) + if is_zero_length_file(stderr_filepath): + os.remove(stderr_filepath) + except OSError as ose: + if "[WinError 32] The process cannot access the file because it is being used by another " \ + "process:" in format(ose): + logging.warning("Skipping file %s. Got error: %s".format(root_output_filename, format(ose))) + else: + raise ose assemblies = [] for item in self.pmi_assemblies: - if os.path.isdir(item): - assemblies += get_all_assemblies(item) - else: - assemblies.append(item) + assemblies += get_files_from_path(item, match_func=lambda file: any(file.endswith(extension) for extension in [".dll", ".exe"])) # Set environment variables. old_env = os.environ.copy() @@ -690,16 +847,16 @@ def __merge_mc_files__(self): """ Merge the mc files that were generated Notes: - mcs -merge \*.mc -recursive -dedup -thin + mcs -merge \\*.mc -recursive -dedup -thin """ + logging.info("Merging MC files") + pattern = os.path.join(self.temp_location, "*.mc") command = [self.mcs_path, "-merge", self.base_mch_file, pattern, "-recursive", "-dedup", "-thin"] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - proc.communicate() + run_and_log(command) if not os.path.isfile(self.base_mch_file): raise RuntimeError("MCH file failed to be generated at: %s" % self.base_mch_file) @@ -712,18 +869,18 @@ def __merge_mc_files__(self): os.remove(item) def __merge_mch_files__(self): - """ Merge the MCH files that were passed + """ Merge MCH files in the mch_files list. This is only used with the `--merge_mch_files` argument. Notes: mcs -concat [self.coreclr_args.mch_files] """ + logging.info("Merging MCH files") + for item in self.coreclr_args.mch_files: command = [self.mcs_path, "-concat", self.base_mch_file, item] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - proc.communicate() + run_and_log(command) if not os.path.isfile(self.base_mch_file): raise RuntimeError("MCH file failed to be generated at: %s" % self.base_mch_file) @@ -741,16 +898,14 @@ def __create_clean_mch_file__(self): del """ + logging.info("Cleaning MCH file") + command = [self.superpmi_path, "-p", "-f", self.base_fail_mcl_file, self.base_mch_file, self.jit_path] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - proc.communicate() + run_and_log(command) if is_nonzero_length_file(self.base_fail_mcl_file): command = [self.mcs_path, "-strip", self.base_fail_mcl_file, self.base_mch_file, self.final_mch_file] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - proc.communicate() + run_and_log(command) else: # Ideally we could just rename this file instead of copying it. shutil.copy2(self.base_mch_file, self.final_mch_file) @@ -773,10 +928,10 @@ def __create_toc__(self): -toc """ + logging.info("Creating TOC file") + command = [self.mcs_path, "-toc", self.final_mch_file] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - proc.communicate() + run_and_log(command) if not os.path.isfile(self.toc_file): raise RuntimeError("Error, toc file not created correctly at: %s" % self.toc_file) @@ -788,38 +943,107 @@ def __verify_final_mch__(self): -p -f """ - spmi_replay = SuperPMIReplay(self.coreclr_args, self.final_mch_file, self.jit_path) + logging.info("Verifying MCH file") + + mch_files = [ self.final_mch_file ] + spmi_replay = SuperPMIReplay(self.coreclr_args, mch_files, self.jit_path) passed = spmi_replay.replay() if not passed: raise RuntimeError("Error, unclean replay.") +################################################################################ +# SuperPMI Replay helpers +################################################################################ + + +def print_superpmi_failure_code(return_code, coreclr_args): + """ 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 + unsigned integers, so compare against both signed and unsigned numbers for + those return codes. + """ + if return_code == 0: + # Don't print anything if the code is zero, which is success. + pass + elif return_code == -1 or return_code == 4294967295: + logging.error("General fatal error") + elif return_code == -2 or return_code == 4294967294: + logging.error("JIT failed to initialize") + elif return_code == 1: + logging.warning("Compilation failures") + elif return_code == 2: + logging.warning("Asm diffs found") + elif return_code == 139 and coreclr_args.host_os != "Windows_NT": + logging.error("Fatal error, SuperPMI has returned SIGSEGV (segmentation fault)") + else: + logging.error("Unknown error code %s", return_code) + + +def print_fail_mcl_file_method_numbers(fail_mcl_file): + """ Given a SuperPMI ".mcl" file (containing a list of failure indices), print out the method numbers. + """ + with open(fail_mcl_file) as file_handle: + mcl_lines = file_handle.readlines() + mcl_lines = [item.strip() for item in mcl_lines] + logging.debug("Method numbers with compilation failures:") + for line in mcl_lines: + logging.debug(line) + + +def save_repro_mc_files(temp_location, coreclr_args, repro_base_command_line): + """ For commands that use the superpmi "-r" option to create "repro" .mc files, copy these to a + location where they are saved (and not in a "temp" directory) for easy use by the user. + """ + # If there are any .mc files, drop them into artifacts/repro/../*.mc + mc_files = [os.path.join(temp_location, item) for item in os.listdir(temp_location) if item.endswith(".mc")] + if len(mc_files) > 0: + repro_location = create_unique_directory_name(coreclr_args.spmi_location, "repro.{}.{}.{}".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type)) + + repro_files = [] + for item in mc_files: + repro_files.append(os.path.join(repro_location, os.path.basename(item))) + logging.debug("Copying %s -> %s", item, repro_location) + shutil.copy2(item, repro_location) + + logging.info("") + logging.info("Repro .mc files created for failures:") + for item in repro_files: + logging.info(item) + + logging.info("") + logging.info("To run a specific failure (replace JIT path and .mc filename as needed):") + logging.info("") + logging.info("%s %s%sxxxxx.mc", repro_base_command_line, repro_location, os.path.sep) + logging.info("") + ################################################################################ # SuperPMI Replay ################################################################################ + class SuperPMIReplay: """ SuperPMI Replay class Notes: - The object is responsible for replaying the MCH file given to the + The object is responsible for replaying the MCH files given to the instance of the class """ - def __init__(self, coreclr_args, mch_file, jit_path): + def __init__(self, coreclr_args, mch_files, jit_path): """ Constructor Args: coreclr_args (CoreclrArguments) : parsed args - mch_file (str) : MCH file to replay - jit_path (str) : path to clrjit/libclrjit. + mch_files (list) : list of MCH files to replay + jit_path (str) : path to clrjit """ self.jit_path = jit_path - self.mch_file = mch_file - self.superpmi_path = os.path.join(coreclr_args.core_root, determine_superpmi_tool_name(coreclr_args)) - + self.mch_files = mch_files + self.superpmi_path = determine_superpmi_tool_path(coreclr_args) self.coreclr_args = coreclr_args ############################################################################ @@ -830,10 +1054,10 @@ def replay(self): """ Replay the given SuperPMI collection Returns: - sucessful_replay (bool) + (bool) True on success; False otherwise """ - return_code = False + result = True # Assume success # Possible return codes from SuperPMI # @@ -844,123 +1068,99 @@ def replay(self): # 2 : there were assembly diffs with TempDir() as temp_location: - print("") - print("Temp Location: {}".format(temp_location)) - print("") - - self.fail_mcl_file = os.path.join(temp_location, "fail.mcl") + logging.debug("") + logging.debug("Temp Location: %s", temp_location) + logging.debug("") flags = [ - "-f", # Failing mc List - self.fail_mcl_file, - "-r", # Repro name, create .mc repro files - os.path.join(temp_location, "repro") + "-v", "ew", # only display errors and warnings + "-r", os.path.join(temp_location, "repro") # Repro name, create .mc repro files ] altjit_string = "*" if self.coreclr_args.altjit else "" - altjit_flags = [ + altjit_replay_flags = [ "-jitoption", "force", "AltJit=" + altjit_string, - "-jitoption", "force", "AltJitNgen=" + altjit_string + "-jitoption", "force", "AltJitNgen=" + altjit_string, + "-jitoption", "force", "EnableExtraSuperPmiQueries=0" ] - flags += altjit_flags + flags += altjit_replay_flags if not self.coreclr_args.sequential: - flags += [ - "-p" # parallel - ] + flags += [ "-p" ] if self.coreclr_args.break_on_assert: - flags += [ - "-boa" # break on assert - ] + flags += [ "-boa" ] if self.coreclr_args.break_on_error: - flags += [ - "-boe" # break on error - ] - - if self.coreclr_args.log_file != None: - flags += [ - "-w", - self.coreclr_args.log_file - ] - - command = [self.superpmi_path] + flags + [self.jit_path, self.mch_file] - - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - proc.communicate() + flags += [ "-boe" ] - return_code = proc.returncode - - if return_code == 0: - print("Clean SuperPMI replay") - return_code = True - - if is_nonzero_length_file(self.fail_mcl_file): - # Unclean replay. - # - # Save the contents of the fail.mcl file to dig into failures. - - assert(return_code != 0) - - if return_code == -1: - print("General fatal error.") - elif return_code == -2: - print("Jit failed to initialize.") - elif return_code == 1: - print("Compilation failures.") - elif return_code == 139 and self.coreclr_args != "Windows_NT": - print("Fatal error, SuperPMI has returned SIG_SEV (segmentation fault).") - else: - print("Unknown error code.") + if self.coreclr_args.spmi_log_file is not None: + flags += [ "-w", self.coreclr_args.spmi_log_file ] - self.fail_mcl_contents = None - mcl_lines = [] - with open(self.fail_mcl_file) as file_handle: - mcl_lines = file_handle.readlines() - mcl_lines = [item.strip() for item in mcl_lines] - self.fail_mcl_contents = os.linesep.join(mcl_lines) - print("Method numbers with compilation failures:") - print(self.fail_mcl_contents) + if self.coreclr_args.altjit: + if self.coreclr_args.arch == "arm": + flags += [ "-target", "arm" ] + elif self.coreclr_args.arch == "arm64": + flags += [ "-target", "arm64" ] - # If there are any .mc files, drop them into artifacts/repro/../*.mc - mc_files = [os.path.join(temp_location, item) for item in os.listdir(temp_location) if item.endswith(".mc")] + # For each MCH file that we are going to replay, do the replay and replay post-processing. + # + # Consider: currently, we loop over all the steps for each MCH file, including (1) invoke + # SuperPMI, (2) process results. It might be better to do (1) for each MCH file, then + # process all the results at once. Currently, the results for some processing can be + # obscured by the normal run output for subsequent MCH files. - if len(mc_files) > 0: - repro_location = create_unique_directory_name(self.coreclr_args.spmi_location, "repro.{}.{}.{}".format(self.coreclr_args.host_os, self.coreclr_args.arch, self.coreclr_args.build_type)) + # Keep track of any MCH file replay failures + files_with_replay_failures = [] - repro_files = [] - for item in mc_files: - repro_files.append(os.path.join(repro_location, os.path.basename(item))) - print("Copying {} -> {}".format(item, repro_location)) - shutil.copy2(item, repro_location) + for mch_file in self.mch_files: - print("") - print("Repro .mc files:") - print("") + logging.info("Running SuperPMI replay of %s", mch_file) - for item in repro_files: - print(item) - - print("") - - print("To run a specific failure (replace .mc filename as needed):") - print("") - print("{} {} {} {}{}xxxxx.mc".format(self.superpmi_path, " ".join(altjit_flags), self.jit_path, os.path.sep, repro_location)) - print("") + fail_mcl_file = os.path.join(temp_location, os.path.basename(mch_file) + "_fail.mcl") + flags += [ + "-f", fail_mcl_file, # Failing mc List + ] - if not self.coreclr_args.skip_cleanup: - if os.path.isfile(self.fail_mcl_file): - os.remove(self.fail_mcl_file) - self.fail_mcl_file = None + 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: + files_with_replay_failures.append(mch_file) + result = False + + 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_replay_flags), self.jit_path) + save_repro_mc_files(temp_location, self.coreclr_args, repro_base_command_line) + + if not self.coreclr_args.skip_cleanup: + if os.path.isfile(fail_mcl_file): + os.remove(fail_mcl_file) + fail_mcl_file = None + ################################################################################################ end of for mch_file in self.mch_files + + logging.info("Replay summary:") + + if len(files_with_replay_failures) == 0: + logging.info(" All replays clean") + else: + logging.info(" Replay failures in %s MCH files:", len(files_with_replay_failures)) + for file in files_with_replay_failures: + logging.info(" %s", file) - return return_code + return result ################################################################################ # SuperPMI Replay/AsmDiffs ################################################################################ + class SuperPMIReplayAsmDiffs: """ SuperPMI Replay AsmDiffs class @@ -969,36 +1169,36 @@ class SuperPMIReplayAsmDiffs: instance of the class and doing diffs using the two passed jits. """ - def __init__(self, coreclr_args, mch_file, base_jit_path, diff_jit_path): + def __init__(self, coreclr_args, mch_files, base_jit_path, diff_jit_path): """ Constructor Args: coreclr_args (CoreclrArguments) : parsed args - mch_file (str) : MCH file to replay - base_jit_path (str) : path to baselin clrjit/libclrjit - diff_jit_path (str) : path to diff clrjit/libclrjit + mch_files (list) : list of MCH files to replay + base_jit_path (str) : path to baseline clrjit + diff_jit_path (str) : path to diff clrjit """ self.base_jit_path = base_jit_path self.diff_jit_path = diff_jit_path - self.mch_file = mch_file - self.superpmi_path = os.path.join(coreclr_args.core_root, determine_superpmi_tool_name(coreclr_args)) - + self.mch_files = mch_files + self.superpmi_path = determine_superpmi_tool_path(coreclr_args) self.coreclr_args = coreclr_args + self.diff_mcl_contents = None ############################################################################ # Instance Methods ############################################################################ def replay_with_asm_diffs(self): - """ Replay the given SuperPMI collection + """ Replay the given SuperPMI collection, generating asm diffs Returns: - sucessful_replay (bool) + (bool) True on success; False otherwise """ - return_code = False + result = True # Assume success # Possible return codes from SuperPMI # @@ -1008,504 +1208,414 @@ def replay_with_asm_diffs(self): # 1 : there were compilation failures # 2 : there were assembly diffs - with TempDir(self.coreclr_args.previous_temp_location) as temp_location: - print("") - print("Temp Location: {}".format(temp_location)) - print("") - - self.fail_mcl_file = os.path.join(temp_location, "fail.mcl") - self.diff_mcl_file = os.path.join(temp_location, "diff.mcl") - - if self.coreclr_args.previous_temp_location is None: - - flags = [ - "-a", # Asm diffs - "-f", # Failing mc List - self.fail_mcl_file, - "-diffMCList", # Create all of the diffs in an mcl file - self.diff_mcl_file, - "-r", # Repro name, create .mc repro files - os.path.join(temp_location, "repro") - ] - - altjit_string = "*" if self.coreclr_args.altjit else "" - altjit_flags = [ - "-jitoption", "force", "AltJit=" + altjit_string, - "-jitoption", "force", "AltJitNgen=" + altjit_string, - "-jit2option", "force", "AltJit=" + altjit_string, - "-jit2option", "force", "AltJitNgen=" + altjit_string - ] - flags += altjit_flags - - if not self.coreclr_args.sequential: - flags += [ - "-p" # parallel - ] - - if self.coreclr_args.break_on_assert: - flags += [ - "-boa" # break on assert - ] - - if self.coreclr_args.break_on_error: - flags += [ - "-boe" # break on error - ] - - if self.coreclr_args.log_file != None: - flags += [ - "-w", - self.coreclr_args.log_file - ] - - if not self.coreclr_args.diff_with_code_only: - # 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) as dir: - command = [self.superpmi_path] + flags + [self.base_jit_path, self.diff_jit_path, self.mch_file] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - proc.communicate() - return_code = proc.returncode - if return_code == 0: - print("Clean SuperPMI replay") - else: - return_code = 2 - else: - return_code = 1; - - if is_nonzero_length_file(self.fail_mcl_file): - # Unclean replay. - # - # Save the contents of the fail.mcl file to dig into failures. - - assert(return_code != 0) - - if return_code == -1: - print("General fatal error.") - elif return_code == -2: - print("Jit failed to initialize.") - elif return_code == 1: - print("Compilation failures.") - elif return_code == 139 and self.coreclr_args != "Windows_NT": - print("Fatal error, SuperPMI has returned SIG_SEV (segmentation fault).") - else: - print("Unknown error code.") - - self.fail_mcl_contents = None - mcl_lines = [] - with open(self.fail_mcl_file) as file_handle: - mcl_lines = file_handle.readlines() - mcl_lines = [item.strip() for item in mcl_lines] - self.fail_mcl_contents = os.linesep.join(mcl_lines) - print("Method numbers with compilation failures:") - print(self.fail_mcl_contents) - - # If there are any .mc files, drop them into artifacts/repro/../*.mc - mc_files = [os.path.join(temp_location, item) for item in os.listdir(temp_location) if item.endswith(".mc")] - - if len(mc_files) > 0: - repro_location = create_unique_directory_name(self.coreclr_args.spmi_location, "repro.{}.{}.{}".format(self.coreclr_args.host_os, self.coreclr_args.arch, self.coreclr_args.build_type)) - - repro_files = [] - for item in mc_files: - repro_files.append(os.path.join(repro_location, os.path.basename(item))) - print("Copying {} -> {}".format(item, repro_location)) - shutil.copy2(item, repro_location) - - print("") - print("Repro .mc files:") - print("") - - for item in repro_files: - print(item) - - print("") - - print("To run a specific failure (replace JIT path and .mc filename as needed):") - print("") - print("{} {} {} {}{}xxxxx.mc".format(self.superpmi_path, " ".join(altjit_flags), self.diff_jit_path, os.path.sep, repro_location)) - print("") - - # There were diffs. Go through each method that created diffs and - # create a base/diff asm file with diffable asm. In addition, create - # a standalone .mc for easy iteration. - if is_nonzero_length_file(self.diff_mcl_file) or self.coreclr_args.diff_with_code_only: - # AsmDiffs. - # - # Save the contents of the fail.mcl file to dig into failures. - - assert(return_code != 0) - - if return_code == -1: - print("General fatal error.") - elif return_code == -2: - print("Jit failed to initialize.") - elif return_code == 1: - print("Compilation failures.") - elif return_code == 139 and self.coreclr_args != "Windows_NT": - print("Fatal error, SuperPMI has returned SIG_SEV (segmentation fault).") - elif return_code == 2: - print("Asm diffs found.") + # Set up some settings we'll use below. + + asm_complus_vars = { + "COMPlus_JitDisasm": "*", + "COMPlus_JitUnwindDump": "*", + "COMPlus_JitEHDump": "*", + "COMPlus_NgenDisasm": "*", + "COMPlus_NgenUnwindDump": "*", + "COMPlus_NgenEHDump": "*", + "COMPlus_JitDiffableDasm": "1", + "COMPlus_JitEnableNoWayAssert": "1", + "COMPlus_JitNoForceFallback": "1", + "COMPlus_JitRequired": "1", + "COMPlus_TieredCompilation": "0" } + + jit_dump_complus_vars = { + "COMPlus_JitDisasm": "*", + "COMPlus_JitUnwindDump": "*", + "COMPlus_JitEHDump": "*", + "COMPlus_NgenDisasm": "*", + "COMPlus_NgenUnwindDump": "*", + "COMPlus_NgenEHDump": "*", + "COMPlus_JitDiffableDasm": "1", + "COMPlus_JitEnableNoWayAssert": "1", + "COMPlus_JitNoForceFallback": "1", + "COMPlus_JitRequired": "1", + "COMPlus_TieredCompilation": "0", + "COMPlus_JitDump": "*", + "COMPlus_NgenDump": "*" } + + altjit_string = "*" if self.coreclr_args.altjit else "" + + altjit_asm_diffs_flags = [ + "-jitoption", "force", "AltJit=" + altjit_string, + "-jitoption", "force", "AltJitNgen=" + altjit_string, + "-jitoption", "force", "EnableExtraSuperPmiQueries=0", + "-jit2option", "force", "AltJit=" + altjit_string, + "-jit2option", "force", "AltJitNgen=" + altjit_string, + "-jit2option", "force", "EnableExtraSuperPmiQueries=0" + ] + + altjit_replay_flags = [ + "-jitoption", "force", "AltJit=" + altjit_string, + "-jitoption", "force", "AltJitNgen=" + altjit_string, + "-jitoption", "force", "EnableExtraSuperPmiQueries=0" + ] + + # Keep track if any MCH file replay had asm diffs + files_with_asm_diffs = [] + files_with_replay_failures = [] + + with TempDir(self.coreclr_args.temp_dir) as temp_location: + logging.debug("") + logging.debug("Temp Location: %s", temp_location) + logging.debug("") + + # For each MCH file that we are going to replay, do the replay and replay post-processing. + # + # Consider: currently, we loop over all the steps for each MCH file, including (1) invoke + # SuperPMI, (2) process results. It might be better to do (1) for each MCH file, then + # process all the results at once. Currently, the results for some processing can be + # obscured by the normal run output for subsequent MCH files. + + for mch_file in self.mch_files: + + logging.info("Running asm diffs of %s", mch_file) + + fail_mcl_file = os.path.join(temp_location, os.path.basename(mch_file) + "_fail.mcl") + diff_mcl_file = os.path.join(temp_location, os.path.basename(mch_file) + "_diff.mcl") + + # If the user passed -temp_dir or --diff_with_code_only, 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 or self.coreclr_args.diff_with_code_only: + return_code = 1 else: - print("Unknown error code.") - - if not self.coreclr_args.diff_with_code_only: - self.diff_mcl_contents = None - with open(self.diff_mcl_file) as file_handle: - mcl_lines = file_handle.readlines() - mcl_lines = [item.strip() for item in mcl_lines] - self.diff_mcl_contents = mcl_lines - - bin_asm_location = create_unique_directory_name(self.coreclr_args.spmi_location, "asm.{}.{}.{}".format(self.coreclr_args.host_os, self.coreclr_args.arch, self.coreclr_args.build_type)) - base_asm_location = os.path.join(bin_asm_location, "base") - diff_asm_location = os.path.join(bin_asm_location, "diff") - - if not self.coreclr_args.diff_with_code_only: - # Create a diff and baseline directory - assert(not os.path.isdir(base_asm_location)) - assert(not os.path.isdir(diff_asm_location)) - - os.makedirs(base_asm_location) - os.makedirs(diff_asm_location) - - if self.coreclr_args.diff_jit_dump: - # Create a diff and baseline directory for jit_dumps - bin_dump_location = create_unique_directory_name(self.coreclr_args.spmi_location, "jitdump.{}.{}.{}".format(self.coreclr_args.host_os, self.coreclr_args.arch, self.coreclr_args.build_type)) - base_dump_location = os.path.join(bin_dump_location, "base") - diff_dump_location = os.path.join(bin_dump_location, "diff") - - assert(not os.path.isdir(base_dump_location)) - assert(not os.path.isdir(diff_dump_location)) - - os.makedirs(base_dump_location) - os.makedirs(diff_dump_location) - - text_differences = asyncio.Queue() - jit_dump_differences = asyncio.Queue() - - asm_complus_vars = { - "COMPlus_JitDisasm": "*", - "COMPlus_JitUnwindDump": "*", - "COMPlus_JitEHDump": "*", - "COMPlus_JitDiffableDasm": "1", - "COMPlus_NgenDisasm": "*", - "COMPlus_NgenDump": "*", - "COMPlus_NgenUnwindDump": "*", - "COMPlus_NgenEHDump": "*", - "COMPlus_JitEnableNoWayAssert": "1", - "COMPlus_JitNoForceFallback": "1", - "COMPlus_JitRequired": "1", - "COMPlus_TieredCompilation": "0" } - - jit_dump_complus_vars = { - "COMPlus_JitEnableNoWayAssert": "1", - "COMPlus_JitNoForceFallback": "1", - "COMPlus_JitRequired": "1", - "COMPlus_JitDump": "*" } - - altjit_string = "*" if self.coreclr_args.altjit else "" - altjit_flags = [ - "-jitoption", "force", "AltJit=" + altjit_string, - "-jitoption", "force", "AltJitNgen=" + altjit_string - ] - - async def create_asm(print_prefix, item, self, text_differences, base_asm_location, diff_asm_location): - """ Run superpmi over an mc to create dasm for the method. - """ - # Setup to call SuperPMI for both the diff jit and the base jit - flags = [ - "-c", - item, - "-v", - "q" # only log from the jit. + "-a", # Asm diffs + "-v", "ew", # only display errors and warnings + "-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 ] + flags += altjit_asm_diffs_flags - flags += altjit_flags - - # Add in all the COMPlus variables we need to generate asm. - os.environ.update(asm_complus_vars) - - # Change the working directory to the core root we will call SuperPMI from. - # This is done to allow libcorcedistools to be loaded correctly on unix - # as the loadlibrary path will be relative to the current directory. - with ChangeDir(self.coreclr_args.core_root) as dir: - # Generate diff and base asm - base_txt = None - diff_txt = None - - command = [self.superpmi_path] + flags + [self.base_jit_path, self.mch_file] - - with open(os.path.join(base_asm_location, "{}.dasm".format(item)), 'w') as file_handle: - print("{}Invoking: {}".format(print_prefix, " ".join(command))) - proc = await asyncio.create_subprocess_shell(" ".join(command), stdout=file_handle, stderr=asyncio.subprocess.PIPE) - await proc.communicate() - - with open(os.path.join(base_asm_location, "{}.dasm".format(item)), 'r') as file_handle: - base_txt = file_handle.read() - - command = [self.superpmi_path] + flags + [self.diff_jit_path, self.mch_file] - - with open(os.path.join(diff_asm_location, "{}.dasm".format(item)), 'w') as file_handle: - print("Invoking: ".format(print_prefix) + " ".join(command)) - proc = await asyncio.create_subprocess_shell(" ".join(command), stdout=file_handle, stderr=asyncio.subprocess.PIPE) - await proc.communicate() - - with open(os.path.join(diff_asm_location, "{}.dasm".format(item)), 'r') as file_handle: - diff_txt = file_handle.read() - - # Sanity checks - assert base_txt != "" - assert base_txt is not None + if not self.coreclr_args.sequential: + flags += [ "-p" ] - assert diff_txt != "" - assert diff_txt is not None + if self.coreclr_args.break_on_assert: + flags += [ "-boa" ] - if base_txt != diff_txt: - text_differences.put_nowait(item) + if self.coreclr_args.break_on_error: + flags += [ "-boe" ] - print("{}Finished. ------------------------------------------------------------------".format(print_prefix)) + if self.coreclr_args.spmi_log_file is not None: + flags += [ "-w", self.coreclr_args.spmi_log_file ] - async def create_jit_dump(print_prefix, item, self, jit_dump_differences, base_dump_location, diff_dump_location): - """ Run superpmi over an mc to create dasm for the method. - """ - # Setup to call SuperPMI for both the diff jit and the base jit - - flags = [ - "-c", - item, - "-v", - "q" # only log from the jit. - ] + if self.coreclr_args.altjit: + if self.coreclr_args.arch == "arm": + flags += [ "-target", "arm" ] + elif self.coreclr_args.arch == "arm64": + flags += [ "-target", "arm64" ] - flags += altjit_flags - - # Add in all the COMPlus variables we need to generate JitDump. - os.environ.update(jit_dump_complus_vars) - - # Generate jit dumps - base_txt = None - diff_txt = None - - # Change the working directory to the core root we will call SuperPMI from. + # 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) as dir: - - command = [self.superpmi_path] + flags + [self.base_jit_path, self.mch_file] - - with open(os.path.join(base_dump_location, "{}.txt".format(item)), 'w') as file_handle: - print("{}Invoking: ".format(print_prefix) + " ".join(command)) - proc = await asyncio.create_subprocess_shell(" ".join(command), stdout=file_handle, stderr=asyncio.subprocess.PIPE) - await proc.communicate() - - with open(os.path.join(base_dump_location, "{}.txt".format(item)), 'r') as file_handle: - base_txt = file_handle.read() - - command = [self.superpmi_path] + flags + [self.diff_jit_path, self.mch_file] - - with open(os.path.join(diff_dump_location, "{}.txt".format(item)), 'w') as file_handle: - print("{}Invoking: ".format(print_prefix) + " ".join(command)) - proc = await asyncio.create_subprocess_shell(" ".join(command), stdout=file_handle, stderr=asyncio.subprocess.PIPE) - await proc.communicate() - - with open(os.path.join(diff_dump_location, "{}.txt".format(item)), 'r') as file_handle: - diff_txt = file_handle.read() - - # Sanity checks - assert base_txt != "" - assert base_txt is not None - - assert diff_txt != "" - assert diff_txt is not None - - if base_txt != diff_txt: - jit_dump_differences.put_nowait(item) - - if not self.coreclr_args.diff_with_code_only: - diff_items = [] - - for item in self.diff_mcl_contents: - diff_items.append(item) - - print("Creating asm files") - subproc_helper = AsyncSubprocessHelper(diff_items, verbose=True) - subproc_helper.run_to_completion(create_asm, self, text_differences, base_asm_location, diff_asm_location) - - if self.coreclr_args.diff_jit_dump: - print("Creating JitDump files") - subproc_helper.run_to_completion(create_jit_dump, self, jit_dump_differences, base_dump_location, diff_dump_location) - - else: - # We have already generated asm under /asm/base and /asm/diff - for item in os.listdir(base_asm_location): - base_asm_file = os.path.join(base_asm_location, item) - diff_asm_file = os.path.join(diff_asm_location, item) - - base_txt = None - diff_txt = None - - # Every file should have a diff asm file. - assert os.path.isfile(diff_asm_file) - - with open(base_asm_file) as file_handle: - base_txt = file_handle.read() - - with open(diff_asm_file) as file_handle: - diff_txt = file_handle.read() + 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 replay") + else: + files_with_replay_failures.append(mch_file) + result = False + + 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, 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 + # a standalone .mc for easy iteration. + if is_nonzero_length_file(diff_mcl_file) or self.coreclr_args.diff_with_code_only: + # AsmDiffs. Save 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") + + # This file had asm diffs; keep track of that. + files_with_asm_diffs.append(mch_file) + + if not self.coreclr_args.diff_with_code_only: + self.diff_mcl_contents = None + with open(diff_mcl_file) as file_handle: + mcl_lines = file_handle.readlines() + mcl_lines = [item.strip() for item in mcl_lines] + self.diff_mcl_contents = mcl_lines + + asm_root_dir = create_unique_directory_name(self.coreclr_args.spmi_location, "asm.{}.{}.{}".format(self.coreclr_args.host_os, self.coreclr_args.arch, self.coreclr_args.build_type)) + base_asm_location = os.path.join(asm_root_dir, "base") + diff_asm_location = os.path.join(asm_root_dir, "diff") + + if not self.coreclr_args.diff_with_code_only: + # Create a diff and baseline directory + assert not os.path.isdir(base_asm_location) + assert not os.path.isdir(diff_asm_location) + + os.makedirs(base_asm_location) + os.makedirs(diff_asm_location) + + if self.coreclr_args.diff_jit_dump: + # If JIT dumps are requested, create a diff and baseline directory for JIT dumps + jitdump_root_dir = create_unique_directory_name(self.coreclr_args.spmi_location, "jitdump.{}.{}.{}".format(self.coreclr_args.host_os, self.coreclr_args.arch, self.coreclr_args.build_type)) + base_dump_location = os.path.join(jitdump_root_dir, "base") + diff_dump_location = os.path.join(jitdump_root_dir, "diff") + + assert not os.path.isdir(base_dump_location) + assert not os.path.isdir(diff_dump_location) + + os.makedirs(base_dump_location) + os.makedirs(diff_dump_location) + + text_differences = queue.Queue() + jit_dump_differences = queue.Queue() + + async def create_replay_artifacts(print_prefix, item, self, mch_file, env_vars, jit_differences_queue, base_location, diff_location, extension): + """ Run superpmi over an MC to create JIT asm or JIT dumps for the method. + """ + # Setup flags to call SuperPMI for both the diff jit and the base jit + + flags = [ + "-c", item, + "-v", "q" # only log from the jit. + ] + flags += altjit_replay_flags + + # Add in all the COMPlus variables we need + os.environ.update(env_vars) + + # 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): + + async def create_one_artifact(jit_path: str, location: str) -> str: + command = [self.superpmi_path] + flags + [jit_path, mch_file] + item_path = os.path.join(location, "{}{}".format(item, extension)) + with open(item_path, 'w') as file_handle: + logging.debug("%sGenerating %s", print_prefix, item_path) + logging.debug("%sInvoking: %s", print_prefix, " ".join(command)) + proc = await asyncio.create_subprocess_shell(" ".join(command), stdout=file_handle, stderr=asyncio.subprocess.PIPE) + await proc.communicate() + with open(item_path, 'r') as file_handle: + generated_txt = file_handle.read() + return generated_txt + + # Generate diff and base JIT dumps + base_txt = await create_one_artifact(self.base_jit_path, base_location) + diff_txt = await create_one_artifact(self.diff_jit_path, diff_location) - if base_txt != diff_txt: - text_differences.append(item[:-4]) + if base_txt != diff_txt: + jit_differences_queue.put_nowait(item) + ################################################################################################ end of create_replay_artifacts() + + if not self.coreclr_args.diff_with_code_only: + diff_items = [] + for item in self.diff_mcl_contents: + diff_items.append(item) + + logging.info("Creating dasm files") + subproc_helper = AsyncSubprocessHelper(diff_items, verbose=True) + subproc_helper.run_to_completion(create_replay_artifacts, self, mch_file, asm_complus_vars, text_differences, base_asm_location, diff_asm_location, ".dasm") + + if self.coreclr_args.diff_jit_dump: + logging.info("Creating JitDump files") + subproc_helper.run_to_completion(create_replay_artifacts, self, mch_file, jit_dump_complus_vars, jit_dump_differences, base_dump_location, diff_dump_location, ".txt") + + logging.info("Differences found. To replay SuperPMI use:") + logging.info("") + for var, value in asm_complus_vars.items(): + print_platform_specific_environment_vars(logging.INFO, self.coreclr_args, var, value) + logging.info("%s %s -c ### %s %s", self.superpmi_path, " ".join(altjit_replay_flags), self.diff_jit_path, mch_file) + logging.info("") + + if self.coreclr_args.diff_jit_dump: + logging.info("To generate JitDump with SuperPMI use:") + logging.info("") + for var, value in jit_dump_complus_vars.items(): + print_platform_specific_environment_vars(logging.INFO, self.coreclr_args, var, value) + logging.info("%s %s -c ### %s %s", self.superpmi_path, " ".join(altjit_replay_flags), self.diff_jit_path, mch_file) + logging.info("") + + logging.debug("Method numbers with binary differences:") + for item in self.diff_mcl_contents: + logging.debug(item) + logging.debug("") - if self.coreclr_args.diff_jit_dump: - for item in os.listdir(base_dump_location): - base_dump_file = os.path.join(base_dump_location, item) - diff_dump_file = os.path.join(diff_dump_location, item) + else: + # This is the `--diff_with_code_only` path. + # We have already generated asm under /asm/base and /asm/diff + for item in os.listdir(base_asm_location): + base_asm_file = os.path.join(base_asm_location, item) + diff_asm_file = os.path.join(diff_asm_location, item) base_txt = None diff_txt = None # Every file should have a diff asm file. - assert os.path.isfile(diff_dump_file) + assert os.path.isfile(diff_asm_file) - with open(base_dump_file) as file_handle: + with open(base_asm_file) as file_handle: base_txt = file_handle.read() - with open(diff_dump_file) as file_handle: + with open(diff_asm_file) as file_handle: diff_txt = file_handle.read() if base_txt != diff_txt: - jit_dump_differences.append(item[:-4]) - - if not self.coreclr_args.diff_with_code_only: - print("Differences found. To replay SuperPMI use:") - print("") - for var, value in asm_complus_vars.items(): - print_platform_specific_environment_vars(self.coreclr_args, var, value) - print("{} {} -c ### {} {}".format(self.superpmi_path, " ".join(altjit_flags), self.diff_jit_path, self.mch_file)) - print("") - if self.coreclr_args.diff_jit_dump: - print("To generate JitDump with SuperPMI use:") - print("") - for var, value in jit_dump_complus_vars.items(): - print_platform_specific_environment_vars(self.coreclr_args, var, value) - print("{} {} -c ### {} {}".format(self.superpmi_path, " ".join(altjit_flags), self.diff_jit_path, self.mch_file)) - print("") - print("Method numbers with binary differences:") - print(self.diff_mcl_contents) - print("") - - try: - current_text_diff = text_differences.get_nowait() - except: - current_text_diff = None - - if current_text_diff is not None: - print("Textual differences found. Asm is located under %s %s" % (base_asm_location, diff_asm_location)) - print("Generate a diff analysis report by building jit-analyze from https://github.com/dotnet/jitutils and running:") - print(" jit-analyze -r --base %s --diff %s" % (base_asm_location, diff_asm_location)) - - # Find jit-analyze.bat/sh on PATH, if it exists, then invoke it. - search_path = os.environ.get("PATH") - if search_path is not None: - search_path = search_path.split(";") - jit_analyze_file = "jit-analyze.bat" if platform.system() == "Windows" else "jit-analyze.sh" - jit_analyze_path = find_file(jit_analyze_file, search_path) - if jit_analyze_path is not None: - # It appears we have a built jit-analyze on the path, so try to run it. - command = [ jit_analyze_path, "-r", "--base", base_asm_location, "--diff", diff_asm_location ] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - proc.communicate() - - # Open VS Code on the diffs. - - if self.coreclr_args.diff_with_code and not self.coreclr_args.diff_jit_dump_only: - batch_command = ["cmd", "/c"] if platform.system() == "Windows" else [] - index = 0 - while current_text_diff is not None: - command = batch_command + [ - "code", - "-d", - os.path.join(base_asm_location, "{}.asm".format(item)), - os.path.join(diff_asm_location, "{}.asm".format(item)) - ] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - - if index > 5: - break - - try: - current_text_diff = text_differences.get_nowait() - except: - current_text_diff = None - index += 1 - - print("") - else: - print("No textual differences. Is this an issue with libcoredistools?") - - try: - current_jit_dump_diff = jit_dump_differences.get_nowait() - except: - current_jit_dump_diff = None - - if current_jit_dump_diff is not None: - print("Textual differences found in JitDump. JitDump is located under %s %s" % (base_dump_location, diff_dump_location)) - - if self.coreclr_args.diff_with_code: - batch_command = ["cmd", "/c"] if platform.system() == "Windows" else [] - - index = 0 - while current_jit_dump_diff is not None: - command = batch_command + [ - "code", - "-d", - os.path.join(base_dump_location, "{}.txt".format(item)), - os.path.join(diff_dump_location, "{}.txt".format(item)) - ] - print("Invoking: " + " ".join(command)) - proc = subprocess.Popen(command) - - if index > 5: - break - - try: - current_jit_dump_diff = jit_dump_differences.get_nowait() - except: - current_jit_dump_diff = None - - index += 1 - - print("") - - if not self.coreclr_args.skip_cleanup: - if os.path.isfile(self.fail_mcl_file): - os.remove(self.fail_mcl_file) - self.fail_mcl_file = None + text_differences.put_nowait(item[:-4]) + + if self.coreclr_args.diff_jit_dump: + for item in os.listdir(base_dump_location): + base_dump_file = os.path.join(base_dump_location, item) + diff_dump_file = os.path.join(diff_dump_location, item) + + base_txt = None + diff_txt = None + + # Every file should have a diff asm file. + assert os.path.isfile(diff_dump_file) + + with open(base_dump_file) as file_handle: + base_txt = file_handle.read() + + with open(diff_dump_file) as file_handle: + diff_txt = file_handle.read() + + if base_txt != diff_txt: + jit_dump_differences.put_nowait(item[:-4]) + + # Limit the number of diffs we'll show in VS Code. + max_vscode_diff_file_display = 3 + + try: + current_text_diff = text_differences.get_nowait() + except: + current_text_diff = None + + if current_text_diff is not None: + logging.info("Textual differences found. Asm is located under %s %s", base_asm_location, diff_asm_location) + logging.info("Generate a diff analysis report by building jit-analyze from https://github.com/dotnet/jitutils and running:") + logging.info(" jit-analyze -r --base %s --diff %s", base_asm_location, diff_asm_location) + + # Find jit-analyze.bat/sh on PATH, if it exists, then invoke it. + 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_path = find_file(jit_analyze_file, path_var.split(";")) + if jit_analyze_path is not None: + # It appears we have a built jit-analyze on the path, so try to run it. + command = [ jit_analyze_path, "-r", "--base", base_asm_location, "--diff", diff_asm_location ] + run_and_log(command, logging.INFO) + + if self.coreclr_args.diff_with_code and not self.coreclr_args.diff_jit_dump_only: + # Open VS Code on the diffs. + batch_command = ["cmd", "/c"] if platform.system() == "Windows" else [] + index = 1 + while current_text_diff is not None: + command = batch_command + [ + "code", + "-d", + os.path.join(base_asm_location, "{}.dasm".format(current_text_diff)), + os.path.join(diff_asm_location, "{}.dasm".format(current_text_diff)) + ] + run_and_log(command) + + if index >= max_vscode_diff_file_display: + break + + try: + current_text_diff = text_differences.get_nowait() + except: + current_text_diff = None + index += 1 + else: + logging.warning("No textual differences. Is this an issue with coredistools?") + + try: + current_jit_dump_diff = jit_dump_differences.get_nowait() + except: + current_jit_dump_diff = None + + if current_jit_dump_diff is not None: + logging.info("Textual differences found in JitDump. JitDump is located under %s %s", base_dump_location, diff_dump_location) + + if self.coreclr_args.diff_with_code: + # Open VS Code on the diffs. Only do this for the first 6. + batch_command = ["cmd", "/c"] if platform.system() == "Windows" else [] + index = 1 + while current_jit_dump_diff is not None: + command = batch_command + [ + "code", + "-d", + os.path.join(base_dump_location, "{}.txt".format(current_jit_dump_diff)), + os.path.join(diff_dump_location, "{}.txt".format(current_jit_dump_diff)) + ] + run_and_log(command) + + if index >= max_vscode_diff_file_display: + break + + try: + current_jit_dump_diff = jit_dump_differences.get_nowait() + except: + current_jit_dump_diff = None + index += 1 + ################################################################################################ end of processing asm diffs (if is_nonzero_length_file(diff_mcl_file)... + + if not self.coreclr_args.skip_cleanup: + if os.path.isfile(fail_mcl_file): + os.remove(fail_mcl_file) + fail_mcl_file = None + + ################################################################################################ end of for mch_file in self.mch_files + + logging.info("Asm diffs summary:") + + if len(files_with_replay_failures) != 0: + logging.info(" Replay failures in %s MCH files:", len(files_with_replay_failures)) + for file in files_with_replay_failures: + logging.info(" %s", file) + + if len(files_with_asm_diffs) == 0: + logging.info(" No asm diffs") + else: + logging.info(" Asm diffs in %s MCH files:", len(files_with_asm_diffs)) + for file in files_with_asm_diffs: + logging.info(" %s", file) - return return_code + return result + ################################################################################################ end of replay_with_asm_diffs() ################################################################################ -# Helper Methods +# Argument handling helpers ################################################################################ + def determine_coredis_tools(coreclr_args): - """ Determine the coredistools location + """ Determine the coredistools location. First, look in Core_Root. It will be there if + the setup-stress-dependencies.cmd/sh script has been run, which is typically only + if tests have been run. If unable to find coredistools, download it from a cached + copy in the CLRJIT Azure Storage. (Ideally, we would instead download the NuGet + package and extract it using the same mechanism as setup-stress-dependencies + instead of having our own copy in Azure Storage). Args: coreclr_args (CoreclrArguments) : parsed args Returns: - coredistools_location (str) : path of libcoredistools.dylib|so|dll - - Notes: - If unable to find libcoredis tools, download it from azure storage. + coredistools_location (str) : path of [lib]coredistools.dylib|so|dll """ + if not hasattr(coreclr_args, "core_root") or coreclr_args.core_root is None: + raise RuntimeError("Core_Root not set properly") + coredistools_dll_name = None if coreclr_args.host_os.lower() == "osx": coredistools_dll_name = "libcoredistools.dylib" @@ -1514,83 +1624,81 @@ def determine_coredis_tools(coreclr_args): elif coreclr_args.host_os.lower() == "windows_nt": coredistools_dll_name = "coredistools.dll" else: - raise RuntimeError("Unknown host os: {}").format(coreclr_args.host_os) - - coredistools_uri = "https://clrjit.blob.core.windows.net/superpmi/libcoredistools/{}-{}/{}".format(coreclr_args.host_os.lower(), coreclr_args.arch.lower(), coredistools_dll_name) + raise RuntimeError("Unknown host os: {}".format(coreclr_args.host_os)) coredistools_location = os.path.join(coreclr_args.core_root, coredistools_dll_name) if os.path.isfile(coredistools_location): - print("Using coredistools found at {}".format(coredistools_location)) + logging.info("Using coredistools found at %s", coredistools_location) else: - print("Download: {} -> {}".format(coredistools_uri, coredistools_location)) + # Often, Core_Root will already exist. However, you can do a product build without + # creating a Core_Root, and successfully run replay or asm diffs, if we just create Core_Root + # and copy coredistools there. Note that our replays all depend on Core_Root existing, as we + # set the current directory to Core_Root before running superpmi. + if not os.path.isdir(coreclr_args.core_root): + 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) + logging.info("Download: %s -> %s", coredistools_uri, coredistools_location) urllib.request.urlretrieve(coredistools_uri, coredistools_location) assert os.path.isfile(coredistools_location) return coredistools_location + def determine_pmi_location(coreclr_args): - """ Determine pmi location + """ Determine pmi.dll location, using the following steps: + First, use the `-pmi_location` argument, if set. + Else, look for pmi.dll on the PATH. This will be true if you build jitutils yourself + and put the built `bin` directory on your PATH. + Else, look for pmi.dll in Core_Root. This is where we cache it if downloaded from Azure Storage + Otherwise, download a cached copy from CLRJIT Azure Storage and cache it in Core_Root. Args: coreclr_args (CoreclrArguments) : parsed args Returns: pmi_location (str) : path of pmi.dll - - Notes: - If unable to find pmi.dll, download it from Azure storage. - - TODO: look for pmi.dll on PATH? """ if coreclr_args.pmi_location is not None: pmi_location = os.path.abspath(coreclr_args.pmi_location) if not os.path.isfile(pmi_location): raise RuntimeError("PMI not found at {}".format(pmi_location)) - print("Using PMI at {}".format(pmi_location)) + logging.info("Using PMI at %s", pmi_location) else: - pmi_dll_name = "pmi.dll" - pmi_uri = "https://clrjit.blob.core.windows.net/superpmi/pmi/pmi.dll" - pmi_location = os.path.join(coreclr_args.core_root, pmi_dll_name) - if os.path.isfile(pmi_location): - print("Using PMI found at {}".format(pmi_location)) + path_var = os.environ.get("PATH") + pmi_location = find_file("pmi.dll", path_var.split(";")) if path_var is not None else None + if pmi_location is not None: + logging.info("Using PMI found on PATH at %s", pmi_location) else: - print("Download: {} -> {}".format(pmi_uri, pmi_location)) - urllib.request.urlretrieve(pmi_uri, pmi_location) + pmi_location = os.path.join(coreclr_args.core_root, "pmi.dll") + if os.path.isfile(pmi_location): + logging.info("Using PMI found at %s", pmi_location) + else: + pmi_uri = az_blob_storage_superpmi_container_uri + "/pmi/pmi.dll" + logging.info("Download: %s -> %s", pmi_uri, pmi_location) + urllib.request.urlretrieve(pmi_uri, pmi_location) assert os.path.isfile(pmi_location) return pmi_location -def determine_remote_mch_location(coreclr_args): - """ Determine where the azure storage location for the mch files is - - Args: - coreclr_args (CoreclrArguments): parsed_args - - Returns: - mch_remote_uri (str): uri for the mch files - - """ - - location = "https://clrjit.blob.core.windows.net/superpmi/{}/{}/{}/".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type) - - return location def determine_jit_name(coreclr_args): - """ Determine the jit based on the os + """ Determine the jit based on the OS. If "-altjit" is specified, then use the specified altjit. + This function is called for cases where the "-altjit" flag is not used, so be careful not + to depend on the "altjit" attribute existing. Args: coreclr_args (CoreclrArguments): parsed args Return: - jit_name(str) : name of the jit for this os + jit_name(str) : name of the jit for this OS """ - jit_base_name = "clrjit" - if isinstance(coreclr_args.altjit, str): - jit_base_name = coreclr_args.altjit - elif coreclr_args.altjit == True: - jit_base_name = "protononjit" + # If `-altjit` is used, it must be given a full filename, not just a "base name", so use it without additional processing. + if hasattr(coreclr_args, "altjit") and coreclr_args.altjit is not None: + return coreclr_args.altjit + jit_base_name = "clrjit" if coreclr_args.host_os == "OSX": return "lib" + jit_base_name + ".dylib" elif coreclr_args.host_os == "Linux": @@ -1600,6 +1708,48 @@ def determine_jit_name(coreclr_args): else: raise RuntimeError("Unknown OS.") + +def find_tool(coreclr_args, tool_name, search_core_root=True, search_product_location=True, search_path=True): + """ Find a tool or any specified file (e.g., clrjit.dll) and return the full path to that tool if found. + + Args: + coreclr_args (CoreclrArguments): parsed args + tool_name (str): tool to find, e.g., "superpmi.exe" + search_core_root (bool): True to search the Core_Root folder + search_product_location: True to search the build product folder + search_path: True to search along the PATH + + Return: + (str) Full path of the tool, or None if not found. + """ + + # First, look in Core_Root, if there is one. + if search_core_root and hasattr(coreclr_args, "core_root") and coreclr_args.core_root is not None and os.path.isdir(coreclr_args.core_root): + tool_path = os.path.join(coreclr_args.core_root, tool_name) + if os.path.isfile(tool_path): + logging.debug("Using %s from Core_Root: %s", tool_name, tool_path) + return tool_path + + # Next, look in the built product directory, if it exists. We can use superpmi/mcs directly from the + # product build directory instead from Core_Root because they don't depend on managed code libraries. + if search_product_location and hasattr(coreclr_args, "product_location") and coreclr_args.product_location is not None and os.path.isdir(coreclr_args.product_location): + tool_path = os.path.join(coreclr_args.product_location, tool_name) + if os.path.isfile(tool_path): + logging.debug("Using %s from product build location: %s", tool_name, tool_path) + return tool_path + + # Finally, look on the PATH + if search_path: + path_var = os.environ.get("PATH") + if path_var is not None: + tool_path = find_file(tool_name, path_var.split(";")) + if tool_path is not None: + logging.debug("Using %s from PATH: %s", tool_name, tool_path) + return tool_path + + raise RuntimeError("Tool " + tool_name + " not found. Have you built the runtime repo and created a Core_Root, or put it on your PATH?") + + def determine_superpmi_tool_name(coreclr_args): """ Determine the superpmi tool name based on the OS @@ -1607,19 +1757,124 @@ def determine_superpmi_tool_name(coreclr_args): coreclr_args (CoreclrArguments): parsed args Return: - superpmi_tool_name(str) : name of the jit for this OS + (str) Name of the superpmi tool to use """ - if coreclr_args.host_os == "OSX": - return "superpmi" - elif coreclr_args.host_os == "Linux": + if coreclr_args.host_os == "OSX" or coreclr_args.host_os == "Linux": return "superpmi" elif coreclr_args.host_os == "Windows_NT": return "superpmi.exe" else: raise RuntimeError("Unknown OS.") -def print_platform_specific_environment_vars(coreclr_args, var, value): + +def determine_superpmi_tool_path(coreclr_args): + """ Determine the superpmi tool full path + + Args: + coreclr_args (CoreclrArguments): parsed args + + Return: + (str) Path of the superpmi tool to use + """ + + superpmi_tool_name = determine_superpmi_tool_name(coreclr_args) + return find_tool(coreclr_args, superpmi_tool_name) + + +def determine_mcs_tool_name(coreclr_args): + """ Determine the mcs tool name based on the OS + + Args: + coreclr_args (CoreclrArguments): parsed args + + Return: + (str) Name of the mcs tool to use + """ + + if coreclr_args.host_os == "OSX" or coreclr_args.host_os == "Linux": + return "mcs" + elif coreclr_args.host_os == "Windows_NT": + return "mcs.exe" + else: + raise RuntimeError("Unsupported OS.") + + +def determine_mcs_tool_path(coreclr_args): + """ Determine the mcs tool full path + + Args: + coreclr_args (CoreclrArguments): parsed args + + Return: + (str) Path of the mcs tool to use + """ + + mcs_tool_name = determine_mcs_tool_name(coreclr_args) + return find_tool(coreclr_args, mcs_tool_name) + + +def determine_jit_ee_version(coreclr_args): + """ Determine the JIT-EE version to use. + + The JIT-EE version is used for determining which MCH files to download and use. It is determined as follows: + 1. Try to parse it out of the source code. If we can find src\\coreclr\\src\\inc\\corinfo.h in the source + tree (and we're already assuming we can find the repo root from the relative path of this script), + then the JIT-EE version lives in corinfo.h as follows: + + constexpr GUID JITEEVersionIdentifier = { /* a5eec3a4-4176-43a7-8c2b-a05b551d4f49 */ + 0xa5eec3a4, + 0x4176, + 0x43a7, + {0x8c, 0x2b, 0xa0, 0x5b, 0x55, 0x1d, 0x4f, 0x49} + }; + + We want the string between the /* */ comments. + 2. Find the mcs tool and run "mcs -printJITEEVersion". + 3. Otherwise, just use "unknown-jit-ee-version", which will probably cause downstream failures. + + NOTE: When using mcs, we need to run the tool. So we need a version that will run. If a user specifies + an "-arch" argument that creates a Core_Root path that won't run, like an arm32 Core_Root on an + x64 machine, this won't work. This could happen if doing "upload" or "list-collections" on + collections from a machine that didn't create the native collections. We should create a "native" + Core_Root and use that in case there are "cross-arch" scenarios. + + Args: + coreclr_args (CoreclrArguments): parsed args + + Return: + (str) The JIT-EE version to use + """ + + corinfo_h_path = os.path.join(coreclr_args.coreclr_dir, "src", "inc", "corinfo.h") + if os.path.isfile(corinfo_h_path): + # The string is near the beginning of the somewhat large file, so just read a line at a time when searching. + with open(corinfo_h_path, 'r') as file_handle: + for line in file_handle: + match_obj = re.search(r'JITEEVersionIdentifier *= *{ */\* *([^ ]*) *\*/', line) + if match_obj is not None: + corinfo_h_jit_ee_version = match_obj.group(1) + logging.info("Using JIT/EE Version from corinfo.h: %s", corinfo_h_jit_ee_version) + return corinfo_h_jit_ee_version + logging.warning("Warning: couldn't find JITEEVersionIdentifier in %s; is the file corrupt?", corinfo_h_path) + + mcs_path = determine_mcs_tool_path(coreclr_args) + command = [mcs_path, "-printJITEEVersion"] + proc = subprocess.Popen(command, stdout=subprocess.PIPE) + stdout_jit_ee_version, _ = proc.communicate() + return_code = proc.returncode + if return_code == 0: + mcs_jit_ee_version = stdout_jit_ee_version.decode('utf-8').strip() + logging.info("Using JIT/EE Version from mcs: %s", mcs_jit_ee_version) + return mcs_jit_ee_version + + # Otherwise, use the default "unknown" version. + default_jit_ee_version = "unknown-jit-ee-version" + logging.info("Using default JIT/EE Version: %s", default_jit_ee_version) + return default_jit_ee_version + + +def print_platform_specific_environment_vars(loglevel, coreclr_args, var, value): """ Print environment variables as set {}={} or export {}={} Args: @@ -1629,195 +1884,648 @@ def print_platform_specific_environment_vars(coreclr_args, var, value): """ if coreclr_args.host_os == "Windows_NT": - print("set {}={}".format(var, value)) + logging.log(loglevel, "set %s=%s", var, value) else: - print("export {}={}".format(var, value)) + logging.log(loglevel, "export %s=%s", var, value) -def list_superpmi_container_via_rest_api(coreclr_args, filter=lambda unused: True): - """ List the superpmi using the azure storage rest api + +def list_superpmi_collections_container_via_rest_api(url_filter=lambda unused: True): + """ List the superpmi collections using the Azure Storage REST api Args: - filter (lambda: string): filter to apply to the list + url_filter (lambda: string -> bool): filter to apply to the list. The filter takes a URL and returns True if this URL is acceptable. + + Returns: + urls (list): set of collection URLs in Azure Storage that match the filter. Notes: - This method does not require installing the azure storage python - package. + This method does not require installing the Azure Storage python package. """ - list_superpmi_container_uri = "https://clrjit.blob.core.windows.net/superpmi?restype=container&comp=list" + # This URI will return *all* the blobs, for all jit-ee-version/OS/architecture combinations. + # pass "prefix=foo/bar/..." to only show a subset. Or, we can filter later using string search. + list_superpmi_container_uri = az_blob_storage_superpmi_container_uri + "?restype=container&comp=list&prefix=" + az_collections_root_folder + "/" + + try: + contents = urllib.request.urlopen(list_superpmi_container_uri).read().decode('utf-8') + except Exception as exception: + logging.error("Didn't find any collections using %s", list_superpmi_container_uri) + logging.error(" Error: %s", exception) + return None + + # Contents is an XML file with contents like: + # + # + # + # + # jit-ee-guid/Linux/x64/Linux.x64.Checked.frameworks.mch.zip + # https://clrjit.blob.core.windows.net/superpmi/jit-ee-guid/Linux/x64/Linux.x64.Checked.frameworks.mch.zip + # + # ... + # + # + # + # jit-ee-guid/Linux/x64/Linux.x64.Checked.mch.zip + # https://clrjit.blob.core.windows.net/superpmi/jit-ee-guid/Linux/x64/Linux.x64.Checked.mch.zip + # ... etc. ... + # + # + # + # We just want to extract the entries. We could probably use an XML parsing package, but we just + # use regular expressions. - contents = urllib.request.urlopen(list_superpmi_container_uri).read().decode('utf-8') urls_split = contents.split("")[1:] urls = [] for item in urls_split: url = item.split("")[0].strip() - - if "{}/{}/{}".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type) in url and filter(url): + if url_filter(url): urls.append(url) return urls -def download_index(coreclr_args): - """ Download the index.json for the collection. + +def process_mch_files_arg(coreclr_args): + """ Process the -mch_files argument. If the argument is empty, then download files from Azure Storage. + If the argument is non-empty, check it for UNC paths and download/cache those files, replacing + them with a reference to the newly cached local paths (this is on Windows only). Args: coreclr_args (CoreclrArguments): parsed args - Notes: - The index.json file includes a dictionary of all of the different - collections that were done. - - The index.json file is a simply a dictionary mapping the a name of a - collection to the file name that will be stored on disk. + Returns: + nothing - Example: + coreclr_args.mch_files is updated - { - "frameworks": "Windows_NT.x64.Checked.frameworks.mch", - "default": "Windows_NT.x64.Checked.mch", - "tests": "Windows_NT.x64.Checked.tests.mch" - } """ - urls = list_superpmi_container_via_rest_api(coreclr_args, lambda url: "index.json" in url) + if coreclr_args.mch_files is None: + coreclr_args.mch_files = download_mch(coreclr_args, include_baseline_jit=True) + return - if len(urls) == 0: - print("Didn't find any index.json for the specified configuration.") - sys.exit(1) - elif len(urls) > 1: - print("Error: found {} index.json files (expected 1).".format(len(urls))) - sys.exit(1) + # Create the cache location. Note that we'll create it even if we end up not copying anything. + default_mch_root_dir = os.path.join(coreclr_args.spmi_location, "mch") + default_mch_dir = os.path.join(default_mch_root_dir, "{}.{}.{}".format(coreclr_args.jit_ee_version, coreclr_args.host_os, coreclr_args.arch)) + if not os.path.isdir(default_mch_dir): + os.makedirs(default_mch_dir) - json_string = urllib.request.urlopen(urls[0]).read().decode('utf-8') + # Process the mch_files list. Download and cache UNC and HTTP files. + urls = [] + local_mch_files = [] + for item in coreclr_args.mch_files: + # On Windows only, see if any of the mch_files are UNC paths (i.e., "\\server\share\..."). + # If so, download and cache all the files found there to our usual local cache location, to avoid future network access. + if coreclr_args.host_os == "Windows_NT" and item.startswith("\\\\"): + # Special case: if the user specifies a .mch file, we'll also look for and cache a .mch.mct file next to it, if one exists. + # This happens naturally if a directory is passed and we search for all .mch and .mct files in that directory. + mch_file = os.path.abspath(item) + if os.path.isfile(mch_file) and mch_file.endswith(".mch"): + files = [ mch_file ] + mct_file = mch_file + ".mct" + if os.path.isfile(mct_file): + files.append(mct_file) + else: + files = get_files_from_path(mch_file, match_func=lambda path: any(path.endswith(extension) for extension in [".mch", ".mct"])) + + for file in files: + # Download file to cache, and report that as the file to use. + cache_file = os.path.join(default_mch_dir, os.path.basename(file)) + logging.info("Cache %s => %s", file, cache_file) + local_mch_file = shutil.copy2(file, cache_file) + local_mch_files.append(local_mch_file) + elif item.lower().startswith("http:") or item.lower().startswith("https:"): # probably could use urllib.parse to be more precise + urls.append(item) + else: + # Doesn't appear to be a UNC path (on Windows) or a URL, so just use it as-is. + local_mch_files.append(item) - json_obj = json.loads(json_string) - return json_obj + # Download all the urls at once, and add the local cache filenames to our accumulated list of local file names. + if len(urls) != 0: + local_mch_files += download_urls(urls, default_mch_dir) -def download_mch(coreclr_args, specific_mch=None, include_baseline_jit=False): - """ Download the mch files + # Special case: walk the URLs list 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). + mct_urls = [] + for url in urls: + if url.endswith(".mch") or url.endswith(".mch.zip"): + mct_url = url.replace(".mch", ".mch.mct") + if mct_url not in urls: + mct_urls.append(mct_url) + if len(mct_urls) != 0: + local_mch_files += download_urls(mct_urls, default_mch_dir, fail_if_not_found=False) + + coreclr_args.mch_files = local_mch_files + + +def download_mch(coreclr_args, include_baseline_jit=False): + """ Download the mch files. This can be called to re-download files and + overwrite them in the target location. Args: coreclr_args (CoreclrArguments): parsed args - specific_mch (str): Download a specific mch file - include_baseline_jit (bool): include downloading the baseline jit + include_baseline_jit (bool): If True, also download the baseline jit Returns: - index (defaultdict(lambda: None)): collection type -> name + list containing the directory to which the files were downloaded """ - urls = list_superpmi_container_via_rest_api(coreclr_args) - default_mch_dir = os.path.join(coreclr_args.spmi_location, "mch", "{}.{}.{}".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type)) + default_mch_root_dir = os.path.join(coreclr_args.spmi_location, "mch") + default_mch_dir = os.path.join(default_mch_root_dir, "{}.{}.{}".format(coreclr_args.jit_ee_version, coreclr_args.host_os, coreclr_args.arch)) + + if os.path.isdir(default_mch_dir) and not coreclr_args.force_download: + # The cache directory is already there, and "--force_download" was passed, so just + # assume it's got what we want. + # NOTE: a different solution might be to verify that everything we would download is + # already in the cache, and simply not download if it is. However, that would + # require hitting the network, and currently once you've cached these, you + # don't need to do that. + logging.info("Found download cache directory \"%s\" and --force_download not set; skipping download", default_mch_dir) + return [ default_mch_dir ] + + blob_filter_string = "{}/{}/{}".format(coreclr_args.jit_ee_version, coreclr_args.host_os, coreclr_args.arch) + blob_prefix_filter = "{}/{}/{}".format(az_blob_storage_superpmi_container_uri, az_collections_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/superpmi/jit-ee-guid/Linux/x64/Linux.x64.Checked.frameworks.mch.zip + # Filter to just the current jit-ee-guid, OS, and architecture. + # Include both MCH and MCT files as well as the CLR JIT dll (processed below). + # If there are filters, only download those matching files. + def filter_superpmi_collections(url): + url = url.lower() + if "clrjit" in url and not include_baseline_jit: + return False + return url.startswith(blob_prefix_filter) and ((coreclr_args.filter is None) or any((filter_item.lower() in url) for filter_item in coreclr_args.filter)) + + urls = list_superpmi_collections_container_via_rest_api(filter_superpmi_collections) + if urls is None: + return [] + + download_urls(urls, default_mch_dir) + return [ default_mch_dir ] + + +def download_urls(urls, target_dir, verbose=True, fail_if_not_found=True): + """ Download a set of files, specified as URLs, to a target directory. + If the URLs are to .ZIP files, then uncompress them and copy all contents + to the target directory. - if not os.path.isdir(default_mch_dir): - os.makedirs(default_mch_dir) + Args: + urls (list): the URLs to download + target_dir (str): target directory where files are copied. Directory must exist + fail_if_not_found (bool): if True, fail if a download fails due to file not found (HTTP error 404). + Otherwise, ignore the failure. - with TempDir() as temp_location: + Returns: + list of local filenames of downloaded files + """ + + if verbose: + logging.info("Downloading:") for url in urls: - 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) + logging.info(" %s", url) - if "clrjit" in url and not include_baseline_jit: - continue + local_files = [] - if "index.json" in url: - continue + # In case we'll need a temp directory for ZIP file processing, create it first. + with TempDir() as temp_location: + for url in urls: + item_name = url.split("/")[-1] - if specific_mch is not None: - if specific_mch not in url: - continue + if url.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) - item_name = url.split("/")[-1] - download_path = os.path.join(temp_location, item_name) + download_path = os.path.join(temp_location, item_name) - print("Download: {} -> {}".format(url, download_path)) - urllib.request.urlretrieve(url, download_path) + try: + if verbose: + logging.info("Download: %s -> %s", url, download_path) + urllib.request.urlretrieve(url, download_path) + except urllib.error.HTTPError as httperror: + if (httperror == 404) and fail_if_not_found: + raise httperror + # Otherwise, swallow the error and continue to next file. + continue - if url.endswith(".zip"): - print ("unzip {}".format(download_path)) + if verbose: + logging.info("Uncompress %s", download_path) with zipfile.ZipFile(download_path, "r") as file_handle: file_handle.extractall(temp_location) - print("") + # Copy everything that was extracted to the target directory. + if not os.path.isdir(target_dir): + os.makedirs(target_dir) + 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_files.append(target_path) + else: + # Not a zip file; download directory to target directory + if not os.path.isdir(target_dir): + os.makedirs(target_dir) + download_path = os.path.join(target_dir, item_name) - items = [os.path.join(temp_location, item) for item in os.listdir(temp_location) if not item.endswith(".zip")] + try: + if verbose: + logging.info("Download: %s -> %s", url, download_path) + urllib.request.urlretrieve(url, download_path) + local_files.append(download_path) + except urllib.error.HTTPError as httperror: + if (httperror == 404) and fail_if_not_found: + raise httperror + # Otherwise, swallow the error and continue to next file. + continue - for item in items: - print("Copying: {} -> {}".format(item, default_mch_dir)) - shutil.copy2(item, default_mch_dir) + return local_files def upload_mch(coreclr_args): - """ Upload the mch files + """ Upload a set of MCH files. Each MCH file is first ZIP compressed to save data space and upload/download time. + + TODO: Upload baseline altjits or cross-compile JITs? Args: coreclr_args (CoreclrArguments): parsed args """ + def upload_blob(file, blob_name): + blob_client = blob_service_client.get_blob_client(container=az_superpmi_container_name, blob=blob_name) + + # Check if the blob already exists, and delete it if it does, before uploading / replacing it. + try: + blob_client.get_blob_properties() + # If no exception, then the blob already exists. Delete it! + logging.warning("Warning: replacing existing blob!") + blob_client.delete_blob() + except Exception: + # Blob doesn't exist already; that's good + pass + + with open(file, "rb") as data: + blob_client.upload_blob(data) + + files = [] + for item in coreclr_args.mch_files: + files += get_files_from_path(item, match_func=lambda path: any(path.endswith(extension) for extension in [".mch", ".mct"])) + + # Special case: walk the files list and for every ".mch" file, check to see that either the associated ".mct" file is already + # in the list, or add it if the ".mct" file exists. + for file in files.copy(): + if file.endswith(".mch"): + mct_file = file + ".mct" + if mct_file not in files: + if os.path.isfile(mct_file): + files.append(mct_file) + + logging.info("Uploading:") + for item in files: + logging.info(" %s", item) + try: - from azure.storage.blob import BlockBlobService, PublicAccess + from azure.storage.blob import BlobServiceClient except: - print("Please install:") - print("pip install azure-storage-blob") - print("pip install cffi") - + logging.error("Please install:") + logging.error(" pip install azure-storage-blob") + logging.error("See also https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-python") raise RuntimeError("Missing azure storage package.") - block_blob_service = BlockBlobService(account_name="clrjit", account_key=coreclr_args.az_storage_key) + blob_service_client = BlobServiceClient(account_url=az_blob_storage_account_uri, credential=coreclr_args.az_storage_key) + blob_folder_name = "{}/{}/{}/{}".format(az_collections_root_folder, coreclr_args.jit_ee_version, coreclr_args.host_os, coreclr_args.arch) - container_name = "superpmi" - json_item = defaultdict(lambda: None) + total_bytes_uploaded = 0 with TempDir() as temp_location: - for item in coreclr_args.mch_files: - item_name = "{}/{}/{}/{}.zip".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type, os.path.basename(item)) - zip_name = os.path.join(temp_location, os.path.basename(item) + ".zip") + for file in files: + # Zip compress the file we will upload + zip_name = os.path.basename(file) + ".zip" + zip_path = os.path.join(temp_location, zip_name) + logging.info("Compress %s -> %s", file, zip_path) + with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zip_file: + zip_file.write(file, os.path.basename(file)) + + original_stat_result = os.stat(file) + zip_stat_result = os.stat(zip_path) + logging.info("Compressed {:n} to {:n} bytes".format(original_stat_result.st_size, zip_stat_result.st_size)) + total_bytes_uploaded += zip_stat_result.st_size + + blob_name = "{}/{}".format(blob_folder_name, zip_name) + logging.info("Uploading: %s (%s) -> %s", file, zip_path, az_blob_storage_superpmi_container_uri + "/" + blob_name) + upload_blob(zip_path, blob_name) + + # Upload a JIT matching the MCH files just collected. + # Consider: rename uploaded JIT to include build_type - print ("zip {} {}".format(zip_name, item)) + jit_location = coreclr_args.jit_location + if jit_location is None: + jit_name = determine_jit_name(coreclr_args) + jit_location = os.path.join(coreclr_args.core_root, jit_name) - # Zip the file we will upload - with zipfile.ZipFile(zip_name, 'w', zipfile.ZIP_DEFLATED) as zip_file: - zip_file.write(item, os.path.basename(item)) + assert os.path.isfile(jit_location) - print("") - print("Uploading: {} -> {}".format(item, "https://clrjit.blob.core.windows.net/superpmi/" + item_name)) - block_blob_service.create_blob_from_path(container_name, item_name, zip_name) - print("") + jit_name = os.path.basename(jit_location) + jit_blob_name = "{}/{}".format(blob_folder_name, jit_name) + logging.info("Uploading: %s -> %s", jit_location, az_blob_storage_superpmi_container_uri + "/" + jit_blob_name) + upload_blob(jit_location, jit_blob_name) - item_basename = os.path.basename(item) + jit_stat_result = os.stat(jit_location) + total_bytes_uploaded += jit_stat_result.st_size - collection_name = item_basename.split(".")[3] - if collection_name == "mch": - collection_name = "default" + logging.info("Uploaded {:n} bytes".format(total_bytes_uploaded)) - json_item[collection_name] = os.path.basename(item) - file_handle = tempfile.NamedTemporaryFile(delete=False, mode='w') - try: - json.dump(json_item, file_handle) - file_handle.close() +def list_collections_command(coreclr_args): + """ List the SuperPMI collections in Azure Storage - item_name = "{}/{}/{}/index.json".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type) - print("Uploading: {} -> {}".format(file_handle.name, "https://clrjit.blob.core.windows.net/superpmi/" + item_name)) - block_blob_service.create_blob_from_path(container_name, item_name, file_handle.name) - finally: - os.remove(file_handle.name) + Args: + coreclr_args (CoreclrArguments) : parsed args + """ + + blob_filter_string = "{}/{}/{}".format(coreclr_args.jit_ee_version, coreclr_args.host_os, coreclr_args.arch) + blob_prefix_filter = "{}/{}/{}".format(az_blob_storage_superpmi_container_uri, az_collections_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/superpmi/jit-ee-guid/Linux/x64/Linux.x64.Checked.frameworks.mch.zip + # By default, filter to just the current jit-ee-guid, OS, and architecture. + # Only include MCH files, not clrjit.dll or MCT (TOC) files. + def filter_superpmi_collections(url: str): + url = url.lower() + return (url.endswith(".mch") or url.endswith(".mch.zip")) and (coreclr_args.all or url.startswith(blob_prefix_filter)) + + urls = list_superpmi_collections_container_via_rest_api(filter_superpmi_collections) + if urls is None: + return + + count = len(urls) + + logging.info("SuperPMI list-collections") + logging.info("") + if coreclr_args.all: + logging.info("%s collections", count) + else: + logging.info("%s collections for %s", count, blob_filter_string) + logging.info("") + + for url in urls: + logging.info("%s", url) + + +def list_collections_local_command(coreclr_args): + """ List the SuperPMI collections local cache: where the Azure Storage collections are copied + + Args: + coreclr_args (CoreclrArguments) : parsed args + """ + + # Display the blob filter string the local cache corresponds to + blob_filter_string = "{}/{}/{}".format(coreclr_args.jit_ee_version, coreclr_args.host_os, coreclr_args.arch) + + default_mch_root_dir = os.path.join(coreclr_args.spmi_location, "mch") + default_mch_dir = os.path.join(default_mch_root_dir, "{}.{}.{}".format(coreclr_args.jit_ee_version, coreclr_args.host_os, coreclr_args.arch)) + + # Determine if a file should be allowed. The filenames look like: + # c:\gh\runtime\artifacts\spmi\mch\a5eec3a4-4176-43a7-8c2b-a05b551d4f49.Windows_NT.x64\corelib.Windows_NT.x64.Checked.mch + # c:\gh\runtime\artifacts\spmi\mch\a5eec3a4-4176-43a7-8c2b-a05b551d4f49.Windows_NT.x64\corelib.Windows_NT.x64.Checked.mch.mct + # Only include MCH files, not clrjit.dll or MCT (TOC) files. + def filter_superpmi_collections(path: str): + return path.lower().endswith(".mch") + + if coreclr_args.all: + if not os.path.isdir(default_mch_root_dir): + logging.error("Local dir \"%s\" not found", default_mch_root_dir) + return + local_items = get_files_from_path(default_mch_root_dir) + else: + if not os.path.isdir(default_mch_dir): + logging.error("Local dir \"%s\" not found", default_mch_dir) + return + local_items = get_files_from_path(default_mch_dir) + + filtered_local_items = [item for item in local_items if filter_superpmi_collections(item)] + + count = len(filtered_local_items) + + logging.info("SuperPMI list-collections --local") + logging.info("") + if coreclr_args.all: + logging.info("%s collections", count) + else: + logging.info("%s collections for %s", count, blob_filter_string) + logging.info("") + + for item in filtered_local_items: + logging.info("%s", item) + + +def merge_mch(coreclr_args): + """ Merge all the files specified by a given pattern into a single output MCH file. + This is a utility function mostly for use by the CI scripting. It is a + thin wrapper around: + + mcs -merge -recursive -dedup -thin + mcs -toc + + Args: + coreclr_args (CoreclrArguments) : parsed args + + Returns: + True on success, else False + """ + + logging.info("Merging %s -> %s", coreclr_args.pattern, coreclr_args.output_mch_path) + mcs_path = determine_mcs_tool_path(coreclr_args) + command = [mcs_path, "-merge", coreclr_args.output_mch_path, coreclr_args.pattern, "-recursive", "-dedup", "-thin"] + return_code = run_and_log(command) + if return_code != 0: + logging.error("mcs -merge Failed with code %s", return_code) + return False + + logging.info("Creating MCT file for %s", coreclr_args.output_mch_path) + command = [mcs_path, "-toc", coreclr_args.output_mch_path] + return_code = run_and_log(command) + if return_code != 0: + logging.error("mcs -toc Failed with code %s", return_code) + return False + + return True + + +def get_mch_files_for_replay(coreclr_args): + """ Given the argument `mch_files`, and any specified filters, find all the MCH files to + use for replay. + + Args: + coreclr_args (CoreclrArguments) : parsed args + + Returns: + None if error (with an error message already printed), else a list of MCH files. + """ + + if coreclr_args.mch_files is None: + logging.error("No MCH files specified") + return None + + mch_files = [] + for item in coreclr_args.mch_files: + # If there are specified filters, only run those matching files. + mch_files += get_files_from_path(item, + match_func=lambda path: + any(path.endswith(extension) for extension in [".mch"]) + and ((coreclr_args.filter is None) or any(filter_item.lower() in path for filter_item in coreclr_args.filter))) + + if len(mch_files) == 0: + logging.error("No MCH files found to replay") + return None + + return mch_files + + +def process_base_jit_path_arg(coreclr_args): + """ Process the -base_jit_path argument. + + If the argument is present, check it for being a path to a file. + If not present, try to find and download a baseline JIT based on the current environment: + 1. Determine the current git hash using: + git rev-parse HEAD + or use the `-git_hash` argument (call the result `git_hash`). + 2. Determine the baseline: where does this hash meet `master` using: + git merge-base `git_hash` master + or use the `-base_git_hash` argument (call the result `base_git_hash`). + 3. If the `-base_git_hash` argument is used, use that directly as the exact git + hash of the baseline JIT to use. + 4. Otherwise, figure out the latest hash, starting with `base_git_hash`, that contains any changes to + the src\\coreclr\\src\\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 directory to be rebuilt. 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.) + 5. Check if we've already downloaded a JIT that matches `base_git_hash`, and use that if available. + 6. Starting with `base_git_hash`, and possibly walking to older changes, look for matching builds + in the JIT rolling build drops. + 7. If a baseline clrjit is found, download it to the `spmi/basejit/git-hash.os.architecture.build_type` + cache directory. + 8. Set coreclr_args.base_jit_path to the full path to the downloaded baseline JIT. + + Args: + coreclr_args (CoreclrArguments) : parsed args + + Returns: + Nothing + + coreclr_args.base_jit_path is set to the path to the JIT to use for the baseline JIT. + """ + + if coreclr_args.base_jit_path is not None: + if not os.path.isfile(coreclr_args.base_jit_path): + raise RuntimeError("Specified -base_jit_path does not point to a file") + return + + # We cache baseline jits under the following directory. Note that we can't create the full directory path + # until we know the baseline JIT hash. + default_basejit_root_dir = os.path.join(coreclr_args.spmi_location, "basejit") + + # 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): + if coreclr_args.git_hash is None: + command = [ "git", "rev-parse", "HEAD" ] + logging.debug("Invoking: %s", " ".join(command)) + proc = subprocess.Popen(command, stdout=subprocess.PIPE) + stdout_git_rev_parse, _ = proc.communicate() + return_code = proc.returncode + if return_code == 0: + current_hash = stdout_git_rev_parse.decode('utf-8').strip() + logging.debug("Current hash: %s", current_hash) + else: + raise RuntimeError("Couldn't determine current git hash") + else: + current_hash = coreclr_args.git_hash + + if coreclr_args.base_git_hash is None: + # We've got the current hash; figure out the baseline hash. + command = [ "git", "merge-base", current_hash, "master" ] + logging.debug("Invoking: %s", " ".join(command)) + proc = subprocess.Popen(command, stdout=subprocess.PIPE) + stdout_git_merge_base, _ = proc.communicate() + return_code = proc.returncode + if return_code == 0: + baseline_hash = stdout_git_merge_base.decode('utf-8').strip() + logging.info("Baseline hash: %s", current_hash) + else: + raise RuntimeError("Couldn't determine baseline git hash") + else: + baseline_hash = coreclr_args.base_git_hash + + if coreclr_args.base_git_hash is None: + # Enumerate the last 20 changes, starting with the baseline, that included JIT changes. + command = [ "git", "log", "--pretty=format:%H", baseline_hash, "-20", "--", "src/coreclr/src/jit/*" ] + logging.debug("Invoking: %s", " ".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") + else: + # If `-base_git_hash` is specified, then we use exactly that hash and no other for the baseline. + change_list_hashes = [ coreclr_args.base_git_hash ] + + # For each hash, (1) see if we have the JIT already, and if not (2) try to download the corresponding JIT from the rolling build. + + hashnum = 1 + for git_hash in change_list_hashes: + logging.debug("%s: %s", hashnum, git_hash) - jit_location = coreclr_args.jit_location - if jit_location is None: jit_name = determine_jit_name(coreclr_args) - jit_location = os.path.join(coreclr_args.core_root, jit_name) + basejit_dir = os.path.join(default_basejit_root_dir, "{}.{}.{}.{}".format(git_hash, coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type)) + basejit_path = os.path.join(basejit_dir, jit_name) + if os.path.isfile(basejit_path): + # We found this baseline JIT in our cache; use it! + coreclr_args.base_jit_path = basejit_path + logging.info("Using baseline %s", coreclr_args.base_jit_path) + return - container_path = "{}/{}/{}/{}".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type, os.path.basename(jit_location)) + # It's not in our cache; is there one built by the rolling build to download? + 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_urls(urls, basejit_dir, verbose=False, fail_if_not_found=False) + + if len(local_files) > 0: + if hashnum > 1: + logging.warning("Warning: the baseline found is not built with the first git hash with JIT code changes; there may be extraneous diffs") + # We expect local_files to be length 1, since we only attempted to download a single file. + if len(local_files) > 1: + logging.error("Error: downloaded more than one file?") + + coreclr_args.base_jit_path = local_files[0] + logging.info("Downloaded %s", blob_uri) + logging.info("Using baseline %s", coreclr_args.base_jit_path) + 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. + logging.error("Error: no baseline JIT found") + + raise RuntimeError("No baseline JIT found") - assert os.path.isfile(jit_location) - print("Uploading: {} -> {}".format(jit_location, "https://clrjit.blob.core.windows.net/superpmi/" + os.path.basename(jit_location))) - block_blob_service.create_blob_from_path(container_name, container_path, jit_location) def setup_args(args): """ Setup the args for SuperPMI to use. @@ -1829,40 +2537,92 @@ def setup_args(args): args (CoreclrArguments) """ + + # Start setting up logging. + # Set up the console logger immediately. Later, after we've parsed some arguments, we'll add the file logger and + # change the console logger level to the one parsed by the arguments. We need to do this initial setup before the first + # logging command is executed. + logger = logging.getLogger() + logger.setLevel(logging.DEBUG) + + stream_handler = logging.StreamHandler(sys.stdout) + stream_handler.setLevel(logging.DEBUG) + logger.addHandler(stream_handler) + + # Parse the arguments + 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, - "mode", # "mode" is from the `parser.add_subparsers(dest='mode')` call + "mode", # "mode" is from the `parser.add_subparsers(dest='mode')` call lambda unused: True, "Unable to set mode") - def setup_mch_arg(mch_file): - if mch_file is not None: - return mch_file - - mch_directory = os.path.join(coreclr_args.spmi_location, "mch", "{}.{}.{}".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type)) - mch_filename = "{}.{}.{}.mch".format(coreclr_args.host_os, coreclr_args.arch, coreclr_args.build_type) - default_mch_location = os.path.join(mch_directory, mch_filename) - - if os.path.isfile(default_mch_location) and not args.force_download and coreclr_args.collection == "default": - return default_mch_location - - # Download the mch - else: - index = download_index(coreclr_args) + coreclr_args.verify(args, + "log_level", + lambda arg: any(arg.upper() == level for level in [ "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG" ]), + "Unable to set log_level {}".format, + modify_arg=lambda arg: "INFO" if arg is None else arg.upper()) - mch_filename = index[coreclr_args.collection] - mch_location = os.path.join(mch_directory, mch_filename) + coreclr_args.verify(args, + "log_file", + lambda unused: True, + "Unable to set log_file.") - if not os.path.isfile(mch_location): - download_mch(coreclr_args, specific_mch=index[coreclr_args.collection], include_baseline_jit=True) + def setup_spmi_location_arg(spmi_location): + return os.path.abspath(os.path.join(coreclr_args.artifacts_location, "spmi")) if spmi_location is None else spmi_location - return mch_location + coreclr_args.verify(args, + "spmi_location", + lambda unused: True, + "Unable to set spmi_location", + modify_arg=setup_spmi_location_arg) + + # 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. + + # Now, change the stream handler output level. + stream_handler.setLevel(coreclr_args.log_level) + + log_file = None + if coreclr_args.log_file is None: + if hasattr(coreclr_args, "spmi_location"): + log_file = os.path.join(coreclr_args.spmi_location, "superpmi.log") + if not os.path.isdir(coreclr_args.spmi_location): + os.makedirs(coreclr_args.spmi_location) + else: + log_file = coreclr_args.log_file + log_dir = os.path.basename(log_file) + if not os.path.isdir(log_dir): + os.makedirs(log_dir) + + if log_file is not None: + # If the log file exists, we could use the default behavior and simply append. + # For now, though, just delete it and warn. We can change behavior later if there's user feedback on it. + if os.path.isfile(log_file): + logging.critical("Warning: deleting existing log file %s", log_file) + os.remove(log_file) + file_handler = logging.FileHandler(log_file) + file_handler.setLevel(logging.DEBUG) + logger.addHandler(file_handler) + logging.critical("================ Logging to %s", log_file) + + # Finish verifying the arguments + + def setup_jit_ee_version_arg(jit_ee_version): + if jit_ee_version is not None: + # The user passed a specific jit_ee_version on the command-line, so use that + return jit_ee_version + return determine_jit_ee_version(coreclr_args) + + def setup_jit_path_arg(jit_path): + if jit_path is not None: + return os.path.abspath(jit_path) + return find_tool(coreclr_args, determine_jit_name(coreclr_args), search_path=False) # It doesn't make sense to search PATH for the JIT dll. def verify_superpmi_common_args(): - # core_root has already been verified in CoreclrArguments() initialization. - coreclr_args.verify(args, "break_on_assert", lambda unused: True, @@ -1873,12 +2633,6 @@ def verify_superpmi_common_args(): lambda unused: True, "Unable to set break_on_error") - coreclr_args.verify(args, - "spmi_location", - lambda unused: True, - "Unable to set spmi_location", - modify_arg=lambda spmi_location: os.path.abspath(os.path.join(coreclr_args.artifacts_location, "spmi")) if spmi_location is None else spmi_location) - coreclr_args.verify(args, "skip_cleanup", lambda unused: True, @@ -1890,18 +2644,51 @@ def verify_superpmi_common_args(): "Unable to set sequential.") coreclr_args.verify(args, - "log_file", + "spmi_log_file", lambda unused: True, - "Unable to set log_file.") + "Unable to set spmi_log_file.") - if coreclr_args.log_file is not None and not coreclr_args.sequential: - print("-log_file requires --sequential") + if coreclr_args.spmi_log_file is not None and not coreclr_args.sequential: + print("-spmi_log_file requires --sequential") sys.exit(1) + def verify_replay_common_args(): + + coreclr_args.verify(args, + "force_download", + lambda unused: True, + "Unable to set force_download") + + coreclr_args.verify(args, + "altjit", # Must be set before `jit_path` (determine_jit_name() depends on it) + lambda unused: True, + "Unable to set altjit.") + + coreclr_args.verify(args, + "jit_ee_version", + lambda unused: True, + "Invalid JIT-EE Version.", + modify_arg=setup_jit_ee_version_arg) + + coreclr_args.verify(args, + "filter", + lambda unused: True, + "Unable to set filter.") + + coreclr_args.verify(args, + "mch_files", + lambda unused: True, + "Unable to set mch_files") + if coreclr_args.mode == "collect": verify_superpmi_common_args() + coreclr_args.verify(args, + "altjit", # The replay code checks this, so make sure it's set + lambda unused: True, + "Unable to set altjit.") + coreclr_args.verify(args, "collection_command", lambda command: command is None or os.path.isfile(command), @@ -1950,35 +2737,30 @@ def verify_superpmi_common_args(): "Unable to set skip_collect_mc_files") coreclr_args.verify(args, - "existing_temp_dir", + "temp_dir", lambda unused: True, - "Unable to set existing_temp_dir.") + "Unable to set temp_dir.") coreclr_args.verify(args, - "has_run_collection_command", + "skip_collection_step", lambda unused: True, - "Unable to set has_run_collection_command.") + "Unable to set skip_collection_step.") coreclr_args.verify(args, - "has_merged_mch", + "skip_merge_step", lambda unused: True, - "Unable to set has_merged_mch.") + "Unable to set skip_merge_step.") coreclr_args.verify(args, - "has_verified_clean_mch", + "skip_clean_and_verify_step", lambda unused: True, - "Unable to set has_verified_clean_mch.") + "Unable to set skip_clean_and_verify_step.") coreclr_args.verify(args, "use_zapdisable", lambda unused: True, "Unable to set use_zapdisable") - coreclr_args.verify(False, # Force it to false. TODO: support altjit collections? - "altjit", - lambda unused: True, - "Unable to set altjit.") - if args.collection_command is None and args.merge_mch_files is not True: assert args.collection_args is None assert args.pmi is True @@ -1986,41 +2768,32 @@ def verify_superpmi_common_args(): if coreclr_args.merge_mch_files: assert len(coreclr_args.mch_files) > 0 - coreclr_args.has_run_collection_command = True + coreclr_args.skip_collection_step = True elif coreclr_args.mode == "replay": verify_superpmi_common_args() - - coreclr_args.verify(args, - "collection", - lambda collection_name: collection_name in download_index(coreclr_args), - "Invalid collection. Please run 'superpmi.py list-collections' to see valid options.") - - coreclr_args.verify(args, - "altjit", # Must be set before `jit_path` (determine_jit_name() depends on it) - lambda unused: True, - "Unable to set altjit.") + verify_replay_common_args() coreclr_args.verify(args, "jit_path", - lambda jit_path: os.path.isfile(jit_path), - lambda jit_path: "Error: JIT not found at jit_path {}".format(jit_path), - modify_arg=lambda arg: os.path.join(coreclr_args.core_root, determine_jit_name(coreclr_args)) if arg is None else os.path.abspath(arg)) + os.path.isfile, + "Error: JIT not found at jit_path {}".format, + modify_arg=setup_jit_path_arg) - standard_location = False + jit_in_product_location = False if coreclr_args.product_location.lower() in coreclr_args.jit_path.lower(): - standard_location = True + jit_in_product_location = True determined_arch = None determined_build_type = None - if standard_location: + if jit_in_product_location: # Get os/arch/flavor directory, e.g. split "F:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked" with "F:\gh\runtime\artifacts\bin\coreclr" # yielding # [0]: "" # [1]: "\Windows_NT.x64.Checked" standard_location_split = os.path.dirname(coreclr_args.jit_path).split(os.path.dirname(coreclr_args.product_location)) - assert(coreclr_args.host_os in standard_location_split[1]) + assert coreclr_args.host_os in standard_location_split[1] # Get arch/flavor. Remove leading slash. specialized_path = standard_location_split[1].split(os.path.sep)[1] @@ -2036,7 +2809,7 @@ def verify_superpmi_common_args(): # Make a more intelligent decision about the arch and build type # based on the path of the jit passed - if standard_location and not coreclr_args.build_type in coreclr_args.jit_path: + if jit_in_product_location and coreclr_args.build_type not in coreclr_args.jit_path: coreclr_args.verify(determined_arch.lower(), "arch", lambda unused: True, @@ -2047,15 +2820,10 @@ def verify_superpmi_common_args(): coreclr_args.check_build_type, "Invalid build_type") - coreclr_args.verify(args, - "mch_file", - lambda mch_file: os.path.isfile(mch_file), - lambda mch_file: "Incorrect file path to mch_file: {}".format(mch_file), - modify_arg=lambda arg: setup_mch_arg(arg)) - elif coreclr_args.mode == "asmdiffs": verify_superpmi_common_args() + verify_replay_common_args() coreclr_args.verify(args, "base_jit_path", @@ -2063,20 +2831,20 @@ def verify_superpmi_common_args(): "Unable to set base_jit_path") coreclr_args.verify(args, - "altjit", # Must be set before `jit_path` (determine_jit_name() depends on it) - lambda unused: True, - "Unable to set altjit.") + "diff_jit_path", + os.path.isfile, + "Error: JIT not found at diff_jit_path {}".format, + modify_arg=setup_jit_path_arg) coreclr_args.verify(args, - "diff_jit_path", - lambda jit_path: os.path.isfile(jit_path), - "Unable to set diff_jit_path", - modify_arg=lambda arg: os.path.join(coreclr_args.core_root, determine_jit_name(coreclr_args)) if arg is None else os.path.abspath(arg)) + "git_hash", + lambda unused: True, + "Unable to set git_hash") coreclr_args.verify(args, - "collection", - lambda collection_name: collection_name in download_index(coreclr_args), - "Invalid collection. Please run 'superpmi.py list-collections' to see valid options.") + "base_git_hash", + lambda unused: True, + "Unable to set base_git_hash") coreclr_args.verify(args, "diff_with_code", @@ -2089,9 +2857,9 @@ def verify_superpmi_common_args(): "Unable to set diff_with_code_only.") coreclr_args.verify(args, - "previous_temp_location", + "temp_dir", lambda unused: True, - "Unable to set previous_temp_location.") + "Unable to set temp_dir.") if coreclr_args.diff_with_code_only: # Set diff with code if we are not running SuperPMI to regenerate diffs. @@ -2117,19 +2885,21 @@ def verify_superpmi_common_args(): lambda unused: True, "Unable to set diff_jit_dump.") - standard_location = False + process_base_jit_path_arg(coreclr_args) + + jit_in_product_location = False if coreclr_args.product_location.lower() in coreclr_args.base_jit_path.lower(): - standard_location = True + jit_in_product_location = True determined_arch = None determined_build_type = None - if standard_location: + if jit_in_product_location: # Get os/arch/flavor directory, e.g. split "F:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked" with "F:\gh\runtime\artifacts\bin\coreclr" # yielding # [0]: "" # [1]: "\Windows_NT.x64.Checked" - standard_location_split = os.path.dirname(coreclr_args.jit_path).split(os.path.dirname(coreclr_args.product_location)) - assert(coreclr_args.host_os in standard_location_split[1]) + standard_location_split = os.path.dirname(coreclr_args.base_jit_path).split(os.path.dirname(coreclr_args.product_location)) + assert coreclr_args.host_os in standard_location_split[1] # Get arch/flavor. Remove leading slash. specialized_path = standard_location_split[1].split(os.path.sep)[1] @@ -2145,13 +2915,13 @@ def verify_superpmi_common_args(): # Make a more intelligent decision about the arch and build type # based on the path of the jit passed - if standard_location and not coreclr_args.build_type in coreclr_args.base_jit_path: + if jit_in_product_location and coreclr_args.build_type not in coreclr_args.base_jit_path: coreclr_args.verify(determined_build_type, "build_type", coreclr_args.check_build_type, "Invalid build_type") - if standard_location and not coreclr_args.arch in coreclr_args.base_jit_path: + if jit_in_product_location and coreclr_args.arch not in coreclr_args.base_jit_path: coreclr_args.verify(determined_arch.lower(), "arch", lambda unused: True, @@ -2159,37 +2929,85 @@ def verify_superpmi_common_args(): coreclr_args.verify(determine_coredis_tools(coreclr_args), "coredistools_location", - lambda coredistools_path: os.path.isfile(coredistools_path), + os.path.isfile, "Unable to find coredistools.") - coreclr_args.verify(args, - "mch_file", - lambda mch_file: os.path.isfile(mch_file), - lambda mch_file: "Incorrect file path to mch_file: {}".format(mch_file), - modify_arg=lambda arg: setup_mch_arg(arg)) - elif coreclr_args.mode == "upload": coreclr_args.verify(args, "az_storage_key", lambda item: item is not None, - "Unable to set az_storage_key.", - modify_arg=lambda arg: os.environ["CLRJIT_AZ_KEY"] if arg is None else arg) + "Specify az_storage_key or set environment variable CLRJIT_AZ_KEY to the key to use.", + modify_arg=lambda arg: os.environ["CLRJIT_AZ_KEY"] if arg is None and "CLRJIT_AZ_KEY" in os.environ else arg) + + coreclr_args.verify(args, + "jit_location", + lambda unused: True, + "Unable to set jit_location.") + + coreclr_args.verify(args, + "jit_ee_version", + lambda unused: True, + "Invalid JIT-EE Version.", + modify_arg=setup_jit_ee_version_arg) coreclr_args.verify(args, "mch_files", - lambda mch_files: all(os.path.isfile(item) for item in mch_files), - "Unable to set mch_files.") + lambda unused: True, + "Unable to set mch_files") + + elif coreclr_args.mode == "download": coreclr_args.verify(args, - "jit_location", + "force_download", lambda unused: True, - "Unable to set jit_location.") + "Unable to set force_download") - coreclr_args.verify(False, # Force `altjit` to false. TODO: support altjit uploads? - "altjit", + coreclr_args.verify(args, + "jit_ee_version", lambda unused: True, - "Unable to set altjit.") + "Invalid JIT-EE Version.", + modify_arg=setup_jit_ee_version_arg) + + coreclr_args.verify(args, + "filter", + lambda unused: True, + "Unable to set filter.") + + coreclr_args.verify(args, + "mch_files", + lambda unused: True, + "Unable to set mch_files") + + elif coreclr_args.mode == "list-collections": + + coreclr_args.verify(args, + "jit_ee_version", + lambda unused: True, + "Invalid JIT-EE Version.", + modify_arg=setup_jit_ee_version_arg) + + coreclr_args.verify(args, + "all", + lambda unused: True, + "Unable to set all") + + coreclr_args.verify(args, + "local", + lambda unused: True, + "Unable to set local") + + elif coreclr_args.mode == "merge-mch": + + coreclr_args.verify(args, + "output_mch_path", + lambda output_mch_path: not os.path.isdir(os.path.abspath(output_mch_path)) and not os.path.isfile(os.path.abspath(output_mch_path)), + "Invalid output_mch_path; is it an existing directory or file?") + + coreclr_args.verify(args, + "pattern", + lambda unused: True, + "Unable to set pattern") return coreclr_args @@ -2197,6 +3015,7 @@ def verify_superpmi_common_args(): # main ################################################################################ + def main(args): """ Main method """ @@ -2209,9 +3028,18 @@ def main(args): return 1 # Force tiered compilation off. It will affect both collection and replay. + # REVIEW: Is this true for replay? We specifically set this when doing collections. Can we remove this line? + # Or move it more close to the location that requires it, and output to the console that we're setting this? os.environ["COMPlus_TieredCompilation"] = "0" + # Parse the arguments. + coreclr_args = setup_args(args) + + # + # Run the selected command + # + success = True if coreclr_args.mode == "collect": @@ -2219,110 +3047,126 @@ def main(args): begin_time = datetime.datetime.now() - print("SuperPMI collect") - print("------------------------------------------------------------") - print("Start time: {}".format(begin_time.strftime("%H:%M:%S"))) + logging.info("SuperPMI collect") + logging.debug("------------------------------------------------------------") + logging.debug("Start time: %s", begin_time.strftime("%H:%M:%S")) collection = SuperPMICollect(coreclr_args) success = collection.collect() - print("Finished SuperPMI collect") - - if coreclr_args.output_mch_path != None: - print("MCH path: {}".format(coreclr_args.output_mch_path)) + if success and coreclr_args.output_mch_path is not None: + logging.info("Generated MCH file: %s", coreclr_args.output_mch_path) end_time = datetime.datetime.now() elapsed_time = end_time - begin_time - print("Finish time: {}".format(end_time.strftime("%H:%M:%S"))) - print("Elapsed time: {}".format(elapsed_time)) + logging.debug("Finish time: %s", end_time.strftime("%H:%M:%S")) + logging.debug("Elapsed time: %s", elapsed_time) elif coreclr_args.mode == "replay": # Start a new SuperPMI Replay + process_mch_files_arg(coreclr_args) + mch_files = get_mch_files_for_replay(coreclr_args) + if mch_files is None: + return 1 + begin_time = datetime.datetime.now() - print("SuperPMI replay") - print("------------------------------------------------------------") - print("Start time: {}".format(begin_time.strftime("%H:%M:%S"))) + logging.info("SuperPMI replay") + logging.debug("------------------------------------------------------------") + logging.debug("Start time: %s", begin_time.strftime("%H:%M:%S")) - mch_file = coreclr_args.mch_file jit_path = coreclr_args.jit_path - print("") - print("MCH Path: {}".format(mch_file)) - print("JIT Path: {}".format(jit_path)) + logging.info("JIT Path: %s", jit_path) - replay = SuperPMIReplay(coreclr_args, mch_file, jit_path) - success = replay.replay() + logging.info("Using MCH files:") + for mch_file in mch_files: + logging.info(" %s", mch_file) - print("Finished SuperPMI replay") + replay = SuperPMIReplay(coreclr_args, mch_files, jit_path) + success = replay.replay() end_time = datetime.datetime.now() elapsed_time = end_time - begin_time - print("Finish time: {}".format(end_time.strftime("%H:%M:%S"))) - print("Elapsed time: {}".format(elapsed_time)) + logging.debug("Finish time: %s", end_time.strftime("%H:%M:%S")) + logging.debug("Elapsed time: %s", elapsed_time) elif coreclr_args.mode == "asmdiffs": # Start a new SuperPMI Replay with AsmDiffs + process_mch_files_arg(coreclr_args) + mch_files = get_mch_files_for_replay(coreclr_args) + if mch_files is None: + return 1 + begin_time = datetime.datetime.now() - print("SuperPMI ASM diffs") - print("------------------------------------------------------------") - print("Start time: {}".format(begin_time.strftime("%H:%M:%S"))) + logging.info("SuperPMI ASM diffs") + logging.debug("------------------------------------------------------------") + logging.debug("Start time: %s", begin_time.strftime("%H:%M:%S")) - mch_file = coreclr_args.mch_file base_jit_path = coreclr_args.base_jit_path diff_jit_path = coreclr_args.diff_jit_path - print("") - print("MCH Path: {}".format(mch_file)) - print("Base JIT Path: {}".format(base_jit_path)) - print("Diff JIT Path: {}".format(diff_jit_path)) + logging.info("Base JIT Path: %s", base_jit_path) + logging.info("Diff JIT Path: %s", diff_jit_path) - asm_diffs = SuperPMIReplayAsmDiffs(coreclr_args, mch_file, base_jit_path, diff_jit_path) - success = asm_diffs.replay_with_asm_diffs() + logging.info("Using MCH files:") + for mch_file in mch_files: + logging.info(" %s", mch_file) - print("Finished SuperPMI replay") + asm_diffs = SuperPMIReplayAsmDiffs(coreclr_args, mch_files, base_jit_path, diff_jit_path) + success = asm_diffs.replay_with_asm_diffs() end_time = datetime.datetime.now() elapsed_time = end_time - begin_time - print("Finish time: {}".format(end_time.strftime("%H:%M:%S"))) - print("Elapsed time: {}".format(elapsed_time)) + logging.debug("Finish time: %s", end_time.strftime("%H:%M:%S")) + logging.debug("Elapsed time: %s", elapsed_time) elif coreclr_args.mode == "upload": begin_time = datetime.datetime.now() - print("SuperPMI upload") - print("------------------------------------------------------------") - print("Start time: {}".format(begin_time.strftime("%H:%M:%S"))) + logging.info("SuperPMI upload") + logging.debug("------------------------------------------------------------") + logging.debug("Start time: %s", begin_time.strftime("%H:%M:%S")) upload_mch(coreclr_args) - print("Finished SuperPMI upload") + end_time = datetime.datetime.now() + elapsed_time = end_time - begin_time + + logging.debug("Finish time: %s", end_time.strftime("%H:%M:%S")) + logging.debug("Elapsed time: %s", elapsed_time) + + elif coreclr_args.mode == "download": + begin_time = datetime.datetime.now() + + logging.info("SuperPMI download") + logging.debug("------------------------------------------------------------") + logging.debug("Start time: %s", begin_time.strftime("%H:%M:%S")) + + # Processing the arg does the download and caching + process_mch_files_arg(coreclr_args) end_time = datetime.datetime.now() elapsed_time = end_time - begin_time - print("Finish time: {}".format(end_time.strftime("%H:%M:%S"))) - print("Elapsed time: {}".format(elapsed_time)) + logging.debug("Finish time: %s", end_time.strftime("%H:%M:%S")) + logging.debug("Elapsed time: %s", elapsed_time) elif coreclr_args.mode == "list-collections": - index = download_index(coreclr_args) - - index_count = len(index) - print("SuperPMI list-collections") - print("") - print("{} different collections".format(index_count)) - print("") + if coreclr_args.local: + list_collections_local_command(coreclr_args) + else: + list_collections_command(coreclr_args) - for item, value in index.items(): - print("{} : {}".format(item, value)) + elif coreclr_args.mode == "merge-mch": + success = merge_mch(coreclr_args) - print("") else: raise NotImplementedError(coreclr_args.mode) @@ -2332,6 +3176,7 @@ def main(args): # __main__ ################################################################################ + if __name__ == "__main__": args = parser.parse_args() sys.exit(main(args)) diff --git a/src/coreclr/src/.nuget/Directory.Build.props b/src/coreclr/src/.nuget/Directory.Build.props index 1a8f5c0d7414..e44f8de0a11c 100644 --- a/src/coreclr/src/.nuget/Directory.Build.props +++ b/src/coreclr/src/.nuget/Directory.Build.props @@ -3,14 +3,19 @@ + + + AnyCPU - - true + + false true @@ -161,6 +166,9 @@ arm + + arm + arm64 diff --git a/src/coreclr/src/.nuget/Microsoft.CrossOsDiag.Private.CoreCLR/Microsoft.CrossOsDiag.Private.CoreCLR.proj b/src/coreclr/src/.nuget/Microsoft.CrossOsDiag.Private.CoreCLR/Microsoft.CrossOsDiag.Private.CoreCLR.proj index 037a6b102605..1b1eb74c02a5 100644 --- a/src/coreclr/src/.nuget/Microsoft.CrossOsDiag.Private.CoreCLR/Microsoft.CrossOsDiag.Private.CoreCLR.proj +++ b/src/coreclr/src/.nuget/Microsoft.CrossOsDiag.Private.CoreCLR/Microsoft.CrossOsDiag.Private.CoreCLR.proj @@ -3,7 +3,7 @@ false - linux-x64;linux-musl-x64;linux-arm64;linux-musl-arm64;linux-arm; + linux-x64;linux-musl-x64;linux-arm64;linux-musl-arm64;linux-arm;linux-musl-arm @@ -19,6 +19,7 @@ %(AdditionalProperties);CrossDacBinRoot=$(CrossDacArtifactsDir)/Linux.arm64.$(Configuration)/x64 %(AdditionalProperties);CrossDacBinRoot=$(CrossDacArtifactsDir)/Linux_musl.arm64.$(Configuration)/x64 %(AdditionalProperties);CrossDacBinRoot=$(CrossDacArtifactsDir)/Linux.arm.$(Configuration)/x86 + %(AdditionalProperties);CrossDacBinRoot=$(CrossDacArtifactsDir)/Linux_musl.arm.$(Configuration)/x86 diff --git a/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets b/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets index 9a4272c39479..6a286e91706d 100644 --- a/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets +++ b/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets @@ -30,7 +30,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_OSArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) $(_OSPlatform)-$(_OSArchitecture.ToLower()) - 5.0.0 + 6.0.0 runtime.$(MicrosoftNetCoreIlasmPackageRuntimeId).microsoft.netcore.ilasm runtime.$(MicrosoftNetCoreIlasmPackageRuntimeId).microsoft.netcore.ildasm @@ -79,7 +79,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_ilResourceReference>%(ILResourceReference.FullPath) - <_IldasmCommand>$(_IldasmDir)ildasm + <_IldasmCommand>"$(_IldasmDir)ildasm" <_IldasmCommand>$(_IldasmCommand) "$(_ilResourceReference)" <_IldasmCommand>$(_IldasmCommand) /OUT="$(IntermediateOutputPath)/$(MSBuildProjectName).ref.il" @@ -132,10 +132,10 @@ Copyright (c) .NET Foundation. All rights reserved. <_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) -DEBUG=IMPL <_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) -DEBUG=OPT <_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) -OPTIMIZE - <_IlasmSwitches Condition="'$(IlasmResourceFile)' != ''">$(_IlasmSwitches) -RESOURCES=$(IlasmResourceFile) + <_IlasmSwitches Condition="'$(IlasmResourceFile)' != ''">$(_IlasmSwitches) -RESOURCES="$(IlasmResourceFile)" - + @@ -143,6 +143,9 @@ Copyright (c) .NET Foundation. All rights reserved. + + + diff --git a/src/coreclr/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj b/src/coreclr/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj index c21e7eaa736b..7db8e23c29b5 100644 --- a/src/coreclr/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj +++ b/src/coreclr/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj @@ -8,7 +8,7 @@ - + diff --git a/src/coreclr/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj b/src/coreclr/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj index ce1739f8d6f5..357c60565948 100644 --- a/src/coreclr/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj +++ b/src/coreclr/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj @@ -8,7 +8,7 @@
- + diff --git a/src/coreclr/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.pkgproj b/src/coreclr/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.pkgproj index 5188a4cae994..f3ef1f744710 100644 --- a/src/coreclr/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.pkgproj +++ b/src/coreclr/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.pkgproj @@ -8,7 +8,7 @@ - + diff --git a/src/coreclr/src/CMakeLists.txt b/src/coreclr/src/CMakeLists.txt index e269657e5add..5f74a587d849 100644 --- a/src/coreclr/src/CMakeLists.txt +++ b/src/coreclr/src/CMakeLists.txt @@ -15,9 +15,11 @@ endif(CLR_CMAKE_TARGET_WIN32 AND FEATURE_EVENT_TRACE) add_subdirectory(debug/dbgutil) if(CLR_CMAKE_HOST_UNIX) - if(CLR_CMAKE_HOST_OSX OR (CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID)) - add_subdirectory(debug/createdump) - endif(CLR_CMAKE_HOST_OSX OR (CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID)) + if(CLR_CMAKE_BUILD_SUBSET_RUNTIME) + if(CLR_CMAKE_HOST_OSX OR (CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID)) + add_subdirectory(debug/createdump) + endif(CLR_CMAKE_HOST_OSX OR (CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID)) + endif(CLR_CMAKE_BUILD_SUBSET_RUNTIME) # Include the dummy c++ include files include_directories("pal/inc/rt/cpp") @@ -58,25 +60,42 @@ if(CLR_CMAKE_HOST_UNIX) add_subdirectory(nativeresources) endif(CLR_CMAKE_HOST_UNIX) +if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 10.0)) + add_compile_options(-Wno-error=stringop-overflow=) +endif() + add_subdirectory(utilcode) add_subdirectory(gcinfo) add_subdirectory(jit) -add_subdirectory(vm) -add_subdirectory(md) -add_subdirectory(debug) add_subdirectory(inc) -add_subdirectory(binder) -add_subdirectory(classlibnative) -add_subdirectory(dlls) -add_subdirectory(ToolBox) -add_subdirectory(tools) -add_subdirectory(unwinder) -add_subdirectory(ildasm) -add_subdirectory(ilasm) -add_subdirectory(interop) if(CLR_CMAKE_HOST_UNIX) add_subdirectory(palrt) -elseif(CLR_CMAKE_HOST_WIN32) - add_subdirectory(hosts) endif(CLR_CMAKE_HOST_UNIX) + +add_subdirectory(vm) +if (CLR_CMAKE_BUILD_SUBSET_RUNTIME) + add_subdirectory(md) + add_subdirectory(debug) + add_subdirectory(binder) + add_subdirectory(classlibnative) + add_subdirectory(dlls) + add_subdirectory(ToolBox) + add_subdirectory(tools) + add_subdirectory(unwinder) + add_subdirectory(ildasm) + add_subdirectory(ilasm) + add_subdirectory(interop) + + if(CLR_CMAKE_HOST_WIN32) + add_subdirectory(hosts) + endif(CLR_CMAKE_HOST_WIN32) +else() + if(CLR_CMAKE_HOST_UNIX) + # this is needed to compile the jit on unix platforms. + # When the runtime subset is compiled, the add_subdirectory(dlls) above + # brings the mscorrc library into the build graph + add_subdirectory(dlls/mscorrc) + endif(CLR_CMAKE_HOST_UNIX) +endif(CLR_CMAKE_BUILD_SUBSET_RUNTIME) + diff --git a/src/coreclr/src/Directory.Build.targets b/src/coreclr/src/Directory.Build.targets index 99a237595384..bc0daa25262b 100644 --- a/src/coreclr/src/Directory.Build.targets +++ b/src/coreclr/src/Directory.Build.targets @@ -10,10 +10,10 @@ AfterTargets="Build" Condition="Exists(@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb'))" Inputs="@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb')" - Outputs="@(BuiltBinary -> '$(BinDir)PDB/%(Filename).pdb')"> + Outputs="@(BuiltBinary -> '$(RuntimeBinDir)PDB/%(Filename).pdb')"> + DestinationFolder="$(RuntimeBinDir)PDB" /> diff --git a/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets b/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets index 18a6d21e57dc..e12999eccd73 100644 --- a/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets +++ b/src/coreclr/src/System.Private.CoreLib/CreateRuntimeRootILLinkDescriptorFile.targets @@ -7,18 +7,18 @@ <_ILLinkRuntimeRootDescriptorFilePath>$(ILLinkTrimXml) <_NamespaceFilePath Condition=" '$(_NamespaceFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\namespace.h - <_MscorlibFilePath Condition=" '$(_MscorlibFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\mscorlib.h + <_MscorlibFilePath Condition=" '$(_MscorlibFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\corelib.h <_CortypeFilePath Condition=" '$(_CortypeFilePath)' == '' ">$(MSBuildThisFileDirectory)..\inc\cortypeinfo.h <_RexcepFilePath Condition=" '$(_RexcepFilePath)' == '' ">$(MSBuildThisFileDirectory)..\vm\rexcep.h <_ILLinkDescriptorsIntermediatePath>$(IntermediateOutputPath)ILLink.Descriptors.Combined.xml <_ILLinkTasksToolsDir>$(PkgMicrosoft_NET_ILLink_Tasks)/tools - <_ILLinkTasksDir>$(_ILLinkTasksToolsDir)/$(NetFrameworkCurrent)/ - <_ILLinkTasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(_ILLinkTasksToolsDir)/netcoreapp3.0/ + <_ILLinkTasksDir>$(_ILLinkTasksToolsDir)/net472/ + <_ILLinkTasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(_ILLinkTasksToolsDir)/net5.0/ <_ILLinkTasksPath>$(_ILLinkTasksDir)ILLink.Tasks.dll - <_ILLinkDescriptorsFilePaths Include="$(MSBuildThisFileDirectory)ILLinkTrim.xml" /> + <_ILLinkDescriptorsFilePaths Include="$(ILLinkDirectory)ILLinkTrim.xml" /> <_ILLinkDescriptorsFilePaths Include="$(CoreLibSharedDir)ILLink\ILLink.Descriptors.Shared.xml" /> diff --git a/src/coreclr/src/System.Private.CoreLib/ILLinkTrim.xml b/src/coreclr/src/System.Private.CoreLib/ILLinkTrim.xml deleted file mode 100644 index 11a67fdac313..000000000000 --- a/src/coreclr/src/System.Private.CoreLib/ILLinkTrim.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj index 501487c6a111..b5bf44baebd3 100644 --- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -13,12 +13,16 @@ true - $(BinDir)/IL/ + $(RuntimeBinDir)/IL/ Debug;Release;Checked x64;x86;arm;arm64 true $(IntermediateOutputPath)System.Private.CoreLib.xml + $(MSBuildThisFileDirectory)src\ILLink\ + + true + true @@ -37,14 +41,7 @@ false true - true - true - 6.00 v4.0.30319 - true - true - prompt - 4 true $(NoWarn),0419,0649,CA2249,CA1830 enable @@ -53,13 +50,8 @@ CORECLR;NETCOREAPP;SYSTEM_PRIVATE_CORELIB true - - <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)/Documentation - <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)/Documentation true $(OutputPath)$(MSBuildProjectName).xml - true @@ -115,7 +107,6 @@ - @@ -219,11 +210,11 @@ - + @@ -238,7 +229,7 @@ - + @@ -254,21 +245,6 @@ - - Common\Interop\Windows\Kernel32\Interop.GetStdHandle.cs - - - Common\Interop\Windows\Kernel32\Interop.HandleTypes.cs - - - Common\Interop\Windows\Kernel32\Interop.LocalAlloc.cs - - - Common\Interop\Windows\Ole32\Interop.CoTaskMemAlloc.cs - - - Common\Interop\Windows\OleAut32\Interop.SysAllocStringByteLen.cs - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreclr/src/System.Private.CoreLib/src/Internal/Console.cs b/src/coreclr/src/System.Private.CoreLib/src/Internal/Console.cs deleted file mode 100644 index 307fd9177a81..000000000000 --- a/src/coreclr/src/System.Private.CoreLib/src/Internal/Console.cs +++ /dev/null @@ -1,35 +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 Microsoft.Win32.SafeHandles; - -namespace Internal -{ - // - // Simple limited console class for internal printf-style debugging in System.Private.CoreLib - // and low-level tests that want to call System.Private.CoreLib directly - // - - public static class Console - { - private static readonly SafeFileHandle _outputHandle = - new SafeFileHandle(Interop.Kernel32.GetStdHandle(Interop.Kernel32.HandleTypes.STD_OUTPUT_HANDLE), ownsHandle: false); - - public static unsafe void Write(string s) - { - byte[] bytes = Encoding.UTF8.GetBytes(s); - fixed (byte* pBytes = bytes) - { - Interop.Kernel32.WriteFile(_outputHandle, pBytes, bytes.Length, out _, IntPtr.Zero); - } - } - - public static void WriteLine(string? s) => - Write(s + Environment.NewLineConst); - - public static void WriteLine() => - Write(Environment.NewLineConst); - } -} diff --git a/src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs b/src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs index 45f4d4839fb8..6caaede63b1f 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs @@ -9,6 +9,7 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Runtime.Loader; +using System.Runtime.Versioning; // // Types in this file marked as 'public' are done so only to aid in @@ -25,7 +26,7 @@ public interface IClassFactory void CreateInstance( [MarshalAs(UnmanagedType.Interface)] object? pUnkOuter, ref Guid riid, - [MarshalAs(UnmanagedType.Interface)] out object? ppvObject); + out IntPtr ppvObject); void LockServer([MarshalAs(UnmanagedType.Bool)] bool fLock); } @@ -51,7 +52,7 @@ internal interface IClassFactory2 : IClassFactory new void CreateInstance( [MarshalAs(UnmanagedType.Interface)] object? pUnkOuter, ref Guid riid, - [MarshalAs(UnmanagedType.Interface)] out object? ppvObject); + out IntPtr ppvObject); new void LockServer([MarshalAs(UnmanagedType.Bool)] bool fLock); @@ -66,7 +67,7 @@ void CreateInstanceLic( [MarshalAs(UnmanagedType.Interface)] object? pUnkReserved, ref Guid riid, [MarshalAs(UnmanagedType.BStr)] string bstrKey, - [MarshalAs(UnmanagedType.Interface)] out object ppvObject); + out IntPtr ppvObject); } [StructLayout(LayoutKind.Sequential)] @@ -108,6 +109,7 @@ public static unsafe ComActivationContext Create(ref ComActivationContextInterna } } + [SupportedOSPlatform("windows")] public static class ComActivator { #if FEATURE_COMINTEROP_UNMANAGED_ACTIVATION @@ -219,7 +221,7 @@ public static void ClassRegistrationScenarioForType(ComActivationContext cxt, bo if (methParams[0].ParameterType == typeof(string)) { // We are dealing with the string overload of the function - provide the registry key - see comhost.dll implementation - objs[0] = $"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\CLSID\\{cxt.ClassId.ToString("B")}"; + objs[0] = $"HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\CLSID\\{cxt.ClassId:B}"; } else { @@ -493,28 +495,32 @@ public static Type GetValidatedInterfaceType(Type classType, ref Guid riid, obje #endif } - public static void ValidateObjectIsMarshallableAsInterface(object obj, Type interfaceType) + public static IntPtr GetObjectAsInterface(object obj, Type interfaceType) { #if FEATURE_COMINTEROP_UNMANAGED_ACTIVATION - // If the requested "interface type" is type object then return - // because type object is always marshallable. + // If the requested "interface type" is type object then return as IUnknown if (interfaceType == typeof(object)) { - return; + return Marshal.GetIUnknownForObject(obj); } Debug.Assert(interfaceType.IsInterface); - // The intent of this call is to validate the interface can be + // The intent of this call is to get AND validate the interface can be // marshalled to native code. An exception will be thrown if the // type is unable to be marshalled to native code. // Scenarios where this is relevant: // - Interfaces that use Generics // - Interfaces that define implementation - IntPtr ptr = Marshal.GetComInterfaceForObject(obj, interfaceType, CustomQueryInterfaceMode.Ignore); + IntPtr interfaceMaybe = Marshal.GetComInterfaceForObject(obj, interfaceType, CustomQueryInterfaceMode.Ignore); - // Decrement the above 'Marshal.GetComInterfaceForObject()' - Marshal.Release(ptr); + if (interfaceMaybe == IntPtr.Zero) + { + // E_NOINTERFACE + throw new InvalidCastException(); + } + + return interfaceMaybe; #else throw new PlatformNotSupportedException(); #endif @@ -544,18 +550,18 @@ public static object CreateAggregatedObject(object pUnkOuter, object comObject) public void CreateInstance( [MarshalAs(UnmanagedType.Interface)] object? pUnkOuter, ref Guid riid, - [MarshalAs(UnmanagedType.Interface)] out object? ppvObject) + out IntPtr ppvObject) { #if FEATURE_COMINTEROP_UNMANAGED_ACTIVATION Type interfaceType = BasicClassFactory.GetValidatedInterfaceType(_classType, ref riid, pUnkOuter); - ppvObject = Activator.CreateInstance(_classType)!; + object obj = Activator.CreateInstance(_classType)!; if (pUnkOuter != null) { - ppvObject = BasicClassFactory.CreateAggregatedObject(pUnkOuter, ppvObject); + obj = BasicClassFactory.CreateAggregatedObject(pUnkOuter, obj); } - BasicClassFactory.ValidateObjectIsMarshallableAsInterface(ppvObject, interfaceType); + ppvObject = BasicClassFactory.GetObjectAsInterface(obj, interfaceType); #else throw new PlatformNotSupportedException(); #endif @@ -593,7 +599,7 @@ public LicenseClassFactory(Guid clsid, Type classType) public void CreateInstance( [MarshalAs(UnmanagedType.Interface)] object? pUnkOuter, ref Guid riid, - [MarshalAs(UnmanagedType.Interface)] out object? ppvObject) + out IntPtr ppvObject) { #if FEATURE_COMINTEROP_UNMANAGED_ACTIVATION CreateInstanceInner(pUnkOuter, ref riid, key: null, isDesignTime: true, out ppvObject); @@ -640,7 +646,7 @@ public void CreateInstanceLic( [MarshalAs(UnmanagedType.Interface)] object? pUnkReserved, ref Guid riid, [MarshalAs(UnmanagedType.BStr)] string bstrKey, - [MarshalAs(UnmanagedType.Interface)] out object ppvObject) + out IntPtr ppvObject) { #if FEATURE_COMINTEROP_UNMANAGED_ACTIVATION Debug.Assert(pUnkReserved == null); @@ -655,18 +661,18 @@ private void CreateInstanceInner( ref Guid riid, string? key, bool isDesignTime, - out object ppvObject) + out IntPtr ppvObject) { #if FEATURE_COMINTEROP_UNMANAGED_ACTIVATION Type interfaceType = BasicClassFactory.GetValidatedInterfaceType(_classType, ref riid, pUnkOuter); - ppvObject = _licenseProxy.AllocateAndValidateLicense(_classType, key, isDesignTime); + object obj = _licenseProxy.AllocateAndValidateLicense(_classType, key, isDesignTime); if (pUnkOuter != null) { - ppvObject = BasicClassFactory.CreateAggregatedObject(pUnkOuter, ppvObject); + obj = BasicClassFactory.CreateAggregatedObject(pUnkOuter, obj); } - BasicClassFactory.ValidateObjectIsMarshallableAsInterface(ppvObject, interfaceType); + ppvObject = BasicClassFactory.GetObjectAsInterface(obj, interfaceType); #else throw new PlatformNotSupportedException(); #endif diff --git a/src/coreclr/src/System.Private.CoreLib/src/Interop/Unix/Interop.Libraries.cs b/src/coreclr/src/System.Private.CoreLib/src/Interop/Unix/Interop.Libraries.cs index 9a34b905608b..9e09c265d799 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/Interop/Unix/Interop.Libraries.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/Interop/Unix/Interop.Libraries.cs @@ -8,9 +8,5 @@ internal static partial class Interop internal static partial class Libraries { internal const string Kernel32 = RuntimeHelpers.QCall; - internal const string User32 = RuntimeHelpers.QCall; - internal const string Ole32 = RuntimeHelpers.QCall; - internal const string OleAut32 = RuntimeHelpers.QCall; - internal const string Advapi32 = RuntimeHelpers.QCall; } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs b/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs index d9ed61c6c103..10ede24a6573 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/ArgIterator.cs @@ -134,50 +134,50 @@ public override bool Equals(object? o) #else public ArgIterator(RuntimeArgumentHandle arglist) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } [CLSCompliant(false)] public unsafe ArgIterator(RuntimeArgumentHandle arglist, void* ptr) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } public void End() { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } public override bool Equals(object? o) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } public override int GetHashCode() { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } [CLSCompliant(false)] public System.TypedReference GetNextArg() { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } [CLSCompliant(false)] public System.TypedReference GetNextArg(System.RuntimeTypeHandle rth) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } public unsafe System.RuntimeTypeHandle GetNextArgType() { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } public int GetRemainingCount() { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/coreclr/issues/9204 + throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 } #endif // TARGET_WINDOWS } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Array.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Array.CoreCLR.cs index ee2e02db3798..e661ca109c0d 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Array.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Array.CoreCLR.cs @@ -483,6 +483,7 @@ private unsafe bool IsValueOfElementType(object value) public extern void Initialize(); } +#pragma warning disable CA1822 // Mark members as static //---------------------------------------------------------------------------------------- // ! READ THIS BEFORE YOU WORK ON THIS CLASS. // @@ -619,4 +620,5 @@ private void RemoveAt(int index) ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection); } } +#pragma warning restore CA1822 } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs index 081f1d6c05d5..59126ce8808f 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs @@ -80,10 +80,11 @@ private static void _BulkMoveWithWriteBarrier(ref byte destination, ref byte sou [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] private static extern unsafe void __Memmove(byte* dest, byte* src, nuint len); + // Used by ilmarshalers.cpp internal static unsafe void Memcpy(byte* dest, byte* src, int len) { Debug.Assert(len >= 0, "Negative length in memcpy!"); - Memmove(dest, src, (nuint)len); + Memmove(ref *dest, ref *src, (nuint)len); } // Used by ilmarshalers.cpp @@ -91,24 +92,16 @@ internal static unsafe void Memcpy(byte* pDest, int destIndex, byte[] src, int s { Debug.Assert((srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); Debug.Assert(src.Length - srcIndex >= len, "not enough bytes in src"); - // If dest has 0 elements, the fixed statement will throw an - // IndexOutOfRangeException. Special-case 0-byte copies. - if (len == 0) - return; - fixed (byte* pSrc = src) - { - Memcpy(pDest + destIndex, pSrc + srcIndex, len); - } + + Memmove(ref *(pDest + destIndex), ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(src), srcIndex), (nuint)len); } - // This method has different signature for x64 and other platforms and is done for performance reasons. [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void Memmove(ref T destination, ref T source, nuint elementCount) { if (!RuntimeHelpers.IsReferenceOrContainsReferences()) { // Blittable memmove - Memmove( ref Unsafe.As(ref destination), ref Unsafe.As(ref source), diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/CLRConfig.cs b/src/coreclr/src/System.Private.CoreLib/src/System/CLRConfig.cs index 9ac34e44182b..cb2a0321325c 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/CLRConfig.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/CLRConfig.cs @@ -28,7 +28,7 @@ internal static bool GetBoolValueWithFallbacks(string switchName, string environ // abstractions where reasonably possible. Span buffer = stackalloc char[32]; - int length = Interop.Kernel32.GetEnvironmentVariable(environmentName, buffer); + uint length = Interop.Kernel32.GetEnvironmentVariable(environmentName, ref buffer.GetPinnableReference(), (uint)buffer.Length); switch (length) { case 1: diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/ComparerHelpers.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/ComparerHelpers.cs index 7a49fad02133..1fb54677d0c5 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/ComparerHelpers.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/ComparerHelpers.cs @@ -126,7 +126,7 @@ internal static object CreateDefaultEqualityComparer(Type type) result = new ByteEqualityComparer(); } // If T implements IEquatable return a GenericEqualityComparer - else if (typeof(IEquatable<>).MakeGenericType(type).IsAssignableFrom(type)) + else if (type.IsAssignableTo(typeof(IEquatable<>).MakeGenericType(type))) { result = CreateInstanceForAnotherGenericParameter((RuntimeType)typeof(GenericEqualityComparer), runtimeType); } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.CoreCLR.cs index 2bc0e7ad5c91..252627d27633 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.CoreCLR.cs @@ -12,26 +12,6 @@ public abstract partial class EqualityComparer : IEqualityComparer, IEquality // To minimize generic instantiation overhead of creating the comparer per type, we keep the generic portion of the code as small // as possible and define most of the creation logic in a non-generic class. public static EqualityComparer Default { [Intrinsic] get; } = (EqualityComparer)ComparerHelpers.CreateDefaultEqualityComparer(typeof(T)); - - internal virtual int IndexOf(T[] array, T value, int startIndex, int count) - { - int endIndex = startIndex + count; - for (int i = startIndex; i < endIndex; i++) - { - if (Equals(array[i], value)) return i; - } - return -1; - } - - internal virtual int LastIndexOf(T[] array, T value, int startIndex, int count) - { - int endIndex = startIndex - count + 1; - for (int i = startIndex; i >= endIndex; i--) - { - if (Equals(array[i], value)) return i; - } - return -1; - } } public sealed partial class GenericEqualityComparer : EqualityComparer where T : IEquatable diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs index 5e51ac062923..1d026a643233 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs @@ -16,9 +16,6 @@ public static class Debugger [MethodImpl(MethodImplOptions.NoInlining)] public static void Break() => BreakInternal(); - // The VM depends on this private method. - private static void BreakCanThrow() => BreakInternal(); - [MethodImpl(MethodImplOptions.InternalCall)] private static extern void BreakInternal(); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs index cf60a806a9ce..948ebd253723 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs @@ -49,6 +49,6 @@ private void BuildStackFrame(int skipFrames, bool needFileInfo) } } - private bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false; + private static bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false; } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs index d2ea1e3fbdd0..b375cfddc7ba 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Environment.CoreCLR.cs @@ -11,7 +11,11 @@ namespace System { public static partial class Environment { - public static int CurrentManagedThreadId => Thread.CurrentThread.ManagedThreadId; + public static extern int CurrentManagedThreadId + { + [MethodImpl(MethodImplOptions.InternalCall)] + get; + } // Terminates this process with the given exit code. [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] @@ -83,9 +87,7 @@ public static string[] GetCommandLineArgs() [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] private static extern int GetProcessorCount(); - // If you change this method's signature then you must change the code that calls it - // in excep.cpp and probably you will have to visit mscorlib.h to add the new signature - // as well as metasig.h to create the new signature type + // Used by VM internal static string? GetResourceStringLocal(string key) => SR.GetResourceString(key); public static string StackTrace diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Exception.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Exception.CoreCLR.cs index c3f1e5b4fd43..d6bb435387b0 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Exception.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Exception.CoreCLR.cs @@ -266,8 +266,8 @@ private string? SerializationStackTraceString } // This piece of infrastructure exists to help avoid deadlocks - // between parts of mscorlib that might throw an exception while - // holding a lock that are also used by mscorlib's ResourceManager + // between parts of CoreLib that might throw an exception while + // holding a lock that are also used by CoreLib's ResourceManager // instance. As a special case of code that may throw while holding // a lock, we also need to fix our asynchronous exceptions to use // Win32 resources as well (assuming we ever call a managed diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/GC.cs b/src/coreclr/src/System.Private.CoreLib/src/System/GC.cs index 865600fe8d2d..d932d18d9fc9 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/GC.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/GC.cs @@ -294,7 +294,7 @@ public static int GetGeneration(WeakReference wo) public static void WaitForPendingFinalizers() { - // QCalls can not be exposed from mscorlib directly, need to wrap it. + // QCalls can not be exposed directly, need to wrap it. _WaitForPendingFinalizers(); } @@ -659,7 +659,7 @@ internal static void UnregisterMemoryLoadChangeNotification(Action notification) /// If pinned is set to true, must not be a reference type or a type that contains object references. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] // forced to ensure no perf drop for small memory buffers (hot path) - public static T[] AllocateUninitializedArray(int length, bool pinned = false) + public static T[] AllocateUninitializedArray(int length, bool pinned = false) // T[] rather than T?[] to match `new T[length]` behavior { if (!pinned) { @@ -685,7 +685,7 @@ public static T[] AllocateUninitializedArray(int length, bool pinned = false) // kept outside of the small arrays hot path to have inlining without big size growth return AllocateNewUninitializedArray(length, pinned); - // remove the local function when https://github.com/dotnet/coreclr/issues/5329 is implemented + // remove the local function when https://github.com/dotnet/runtime/issues/5973 is implemented static T[] AllocateNewUninitializedArray(int length, bool pinned) { GC_ALLOC_FLAGS flags = GC_ALLOC_FLAGS.GC_ALLOC_ZEROING_OPTIONAL; @@ -705,7 +705,7 @@ static T[] AllocateNewUninitializedArray(int length, bool pinned) /// /// If pinned is set to true, must not be a reference type or a type that contains object references. /// - public static T[] AllocateArray(int length, bool pinned = false) + public static T[] AllocateArray(int length, bool pinned = false) // T[] rather than T?[] to match `new T[length]` behavior { GC_ALLOC_FLAGS flags = GC_ALLOC_FLAGS.GC_ALLOC_NO_FLAGS; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Math.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Math.CoreCLR.cs index 74aca4342ee3..beeb322b52c0 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Math.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Math.CoreCLR.cs @@ -56,6 +56,7 @@ public static partial class Math [MethodImpl(MethodImplOptions.InternalCall)] public static extern double Cbrt(double d); + [Intrinsic] [MethodImpl(MethodImplOptions.InternalCall)] public static extern double Ceiling(double a); @@ -71,6 +72,7 @@ public static partial class Math [MethodImpl(MethodImplOptions.InternalCall)] public static extern double Exp(double d); + [Intrinsic] [MethodImpl(MethodImplOptions.InternalCall)] public static extern double Floor(double d); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/MathF.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/MathF.CoreCLR.cs index 371780f6abe0..f3dd3289c1c2 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/MathF.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/MathF.CoreCLR.cs @@ -45,6 +45,7 @@ public static partial class MathF [MethodImpl(MethodImplOptions.InternalCall)] public static extern float Cbrt(float x); + [Intrinsic] [MethodImpl(MethodImplOptions.InternalCall)] public static extern float Ceiling(float x); @@ -60,6 +61,7 @@ public static partial class MathF [MethodImpl(MethodImplOptions.InternalCall)] public static extern float Exp(float x); + [Intrinsic] [MethodImpl(MethodImplOptions.InternalCall)] public static extern float Floor(float x); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs b/src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs index a2598bd7779a..bba499737c27 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs @@ -153,7 +153,7 @@ private bool InvocationListEquals(MulticastDelegate d) return true; } - private bool TrySetSlot(object?[] a, int index, object o) + private static bool TrySetSlot(object?[] a, int index, object o) { if (a[index] == null && System.Threading.Interlocked.CompareExchange(ref a[index], o, null) == null) return true; @@ -221,7 +221,7 @@ internal void StoreDynamicMethod(MethodInfo dynamicMethod) // to form a new delegate. protected sealed override Delegate CombineImpl(Delegate? follow) { - if ((object?)follow == null) // cast to object for a more efficient test + if (follow is null) return this; // Verify that the types are the same... @@ -322,7 +322,7 @@ private object[] DeleteFromInvocationList(object[] invocationList, int invocatio return newInvocationList; } - private bool EqualInvocationLists(object[] a, object[] b, int start, int count) + private static bool EqualInvocationLists(object[] a, object[] b, int start, int count) { for (int i = 0; i < count; i++) { @@ -437,7 +437,7 @@ public sealed override Delegate[] GetInvocationList() // so it can become a simple test if (d2 is null) { - // return true/false not the test result https://github.com/dotnet/coreclr/issues/914 + // return true/false not the test result https://github.com/dotnet/runtime/issues/4207 return (d1 is null) ? true : false; } @@ -454,7 +454,7 @@ public sealed override Delegate[] GetInvocationList() // so it can become a simple test if (d2 is null) { - // return true/false not the test result https://github.com/dotnet/coreclr/issues/914 + // return true/false not the test result https://github.com/dotnet/runtime/issues/4207 return (d1 is null) ? false : true; } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Associates.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Associates.cs index 8876fdabb881..6d90ebf7b993 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Associates.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Associates.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace System.Reflection { @@ -31,6 +32,11 @@ internal static bool IncludeAccessor(MethodInfo? associate, bool nonPublic) return false; } + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", + Justification = "Module.ResolveMethod is marked as RequiresUnreferencedCode because it relies on tokens" + + "which are not guaranteed to be stable across trimming. So if somebody harcodes a token it could break." + + "The usage here is not like that as all these tokes come from existing metadata loaded from some IL" + + "and so trimming has no effect (the tokens are read AFTER trimming occured).")] private static RuntimeMethodInfo? AssignAssociates( int tkMethod, RuntimeType declaredType, diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/CustomAttribute.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/CustomAttribute.cs index a7625465c0e8..49f4cedbeef7 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/CustomAttribute.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/CustomAttribute.cs @@ -5,6 +5,7 @@ using System.Runtime.InteropServices; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace System.Reflection { @@ -289,6 +290,10 @@ protected CustomAttributeData() { } + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2075:UnrecognizedReflectionPattern", + Justification = "property setters and fiels which are accessed by any attribute instantiation which is present in the code linker has analyzed." + + "As such enumerating all fields and properties may return different results fater trimming" + + "but all those which are needed to actually have data should be there.")] private CustomAttributeData(RuntimeModule scope, MetadataToken caCtorToken, in ConstArray blob) { m_scope = scope; @@ -1160,6 +1165,10 @@ private static object[] GetCustomAttributes( return result; } + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2065:UnrecognizedReflectionPattern", + Justification = "Linker guarantees presence of all the constructor parameters, property setters and fiels which are accessed by any " + + "attribute instantiation which is present in the code linker has analyzed." + + "As such the reflection usage in this method should never fail as those methods/fields should always be present.")] private static void AddCustomAttributes( ref RuntimeType.ListBuilder attributes, RuntimeModule decoratedModule, int decoratedMetadataToken, @@ -1294,6 +1303,11 @@ private static void AddCustomAttributes( } } + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", + Justification = "Module.ResolveMethod and Module.ResolveType are marked as RequiresUnreferencedCode because they rely on tokens" + + "which are not guaranteed to be stable across trimming. So if somebody harcodes a token it could break." + + "The usage here is not like that as all these tokes come from existing metadata loaded from some IL" + + "and so trimming has no effect (the tokens are read AFTER trimming occured).")] private static bool FilterCustomAttributeRecord( MetadataToken caCtorToken, in MetadataImport scope, @@ -1336,7 +1350,7 @@ private static bool FilterCustomAttributeRecord( if (ctorHasParameters) { // Resolve method ctor token found in decorated decoratedModule scope - // See https://github.com/dotnet/coreclr/issues/21456 for why we fast-path non-generics here (fewer allocations) + // See https://github.com/dotnet/runtime/issues/11637 for why we fast-path non-generics here (fewer allocations) if (attributeType.IsGenericType) { ctorWithParameters = decoratedModule.ResolveMethod(caCtorToken, attributeType.GenericTypeArguments, null)!.MethodHandle.GetMethodInfo(); @@ -1426,6 +1440,11 @@ private static bool AttributeUsageCheck( return true; } + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", + Justification = "Module.ResolveType is marked as RequiresUnreferencedCode because it relies on tokens" + + "which are not guaranteed to be stable across trimming. So if somebody harcodes a token it could break." + + "The usage here is not like that as all these tokes come from existing metadata loaded from some IL" + + "and so trimming has no effect (the tokens are read AFTER trimming occured).")] internal static AttributeUsageAttribute GetAttributeUsage(RuntimeType decoratedAttribute) { RuntimeModule decoratedModule = decoratedAttribute.GetRuntimeModule(); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs index 60d6791a0572..1a384d14282c 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs @@ -497,7 +497,7 @@ public override FileStream[] GetFiles(bool getResourceModules) public override Module? GetModule(string name) => InternalAssembly.GetModule(name); - [RequiresUnreferencedCode("Types might be removed")] + [RequiresUnreferencedCode("Assembly references might be removed")] public override AssemblyName[] GetReferencedAssemblies() { return InternalAssembly.GetReferencedAssemblies(); @@ -595,7 +595,7 @@ private void SetCustomAttributeNoLock(ConstructorInfo con, byte[] binaryAttribut TypeBuilder.DefineCustomAttribute( _manifestModuleBuilder, // pass in the in-memory assembly module AssemblyBuilderData.AssemblyDefToken, - _manifestModuleBuilder.GetConstructorToken(con).Token, + _manifestModuleBuilder.GetConstructorToken(con), binaryAttribute, false, typeof(DebuggableAttribute) == con.DeclaringType); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ConstructorBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ConstructorBuilder.cs index de668d586341..245486413868 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ConstructorBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ConstructorBuilder.cs @@ -23,7 +23,7 @@ internal ConstructorBuilder(string name, MethodAttributes attributes, CallingCon m_methodBuilder.GetMethodSignature().InternalGetSignature(out _); - m_methodBuilder.GetToken(); + int dummy = m_methodBuilder.MetadataToken; } internal ConstructorBuilder(string name, MethodAttributes attributes, CallingConventions callingConvention, @@ -45,6 +45,10 @@ private TypeBuilder GetTypeBuilder() { return m_methodBuilder.GetTypeBuilder(); } + internal SignatureHelper GetMethodSignature() + { + return m_methodBuilder.GetMethodSignature(); + } #endregion #region Object Overrides @@ -56,7 +60,7 @@ public override string ToString() #endregion #region MemberInfo Overrides - internal int MetadataTokenInternal => m_methodBuilder.MetadataTokenInternal; + public override int MetadataToken => m_methodBuilder.MetadataToken; public override Module Module => m_methodBuilder.Module; @@ -118,11 +122,6 @@ public override bool IsDefined(Type attributeType, bool inherit) #endregion #region Public Members - public MethodToken GetToken() - { - return m_methodBuilder.GetToken(); - } - public ParameterBuilder DefineParameter(int iSequence, ParameterAttributes attributes, string? strParamName) { // Theoretically we shouldn't allow iSequence to be 0 because in reflection ctors don't have diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs index 2754a6e81216..51487b02a4c0 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs @@ -527,7 +527,7 @@ private static void EmitValue(BinaryWriter writer, Type type, object? value) // return the byte interpretation of the custom attribute internal void CreateCustomAttribute(ModuleBuilder mod, int tkOwner) { - CreateCustomAttribute(mod, tkOwner, mod.GetConstructorToken(m_con).Token, false); + CreateCustomAttribute(mod, tkOwner, mod.GetConstructorToken(m_con), false); } /// diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs index 34d501c1363d..693a2937c152 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs @@ -428,6 +428,8 @@ public override void EndScope() private int GetMemberRefToken(MethodBase methodInfo, Type[]? optionalParameterTypes) { Type[]? parameterTypes; + Type[][]? requiredCustomModifiers; + Type[][]? optionalCustomModifiers; if (optionalParameterTypes != null && (methodInfo.CallingConvention & CallingConventions.VarArgs) == 0) throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention); @@ -442,17 +444,28 @@ private int GetMemberRefToken(MethodBase methodInfo, Type[]? optionalParameterTy if (paramInfo != null && paramInfo.Length != 0) { parameterTypes = new Type[paramInfo.Length]; + requiredCustomModifiers = new Type[parameterTypes.Length][]; + optionalCustomModifiers = new Type[parameterTypes.Length][]; + for (int i = 0; i < paramInfo.Length; i++) + { parameterTypes[i] = paramInfo[i].ParameterType; + requiredCustomModifiers[i] = paramInfo[i].GetRequiredCustomModifiers(); + optionalCustomModifiers[i] = paramInfo[i].GetOptionalCustomModifiers(); + } } else { parameterTypes = null; + requiredCustomModifiers = null; + optionalCustomModifiers = null; } SignatureHelper sig = GetMemberRefSignature(methodInfo.CallingConvention, MethodBuilder.GetMethodBaseReturnType(methodInfo), parameterTypes, + requiredCustomModifiers, + optionalCustomModifiers, optionalParameterTypes); if (rtMeth != null) @@ -465,13 +478,17 @@ internal override SignatureHelper GetMemberRefSignature( CallingConventions call, Type? returnType, Type[]? parameterTypes, + Type[][]? requiredCustomModifiers, + Type[][]? optionalCustomModifiers, Type[]? optionalParameterTypes) { SignatureHelper sig = SignatureHelper.GetMethodSigHelper(call, returnType); if (parameterTypes != null) { - foreach (Type t in parameterTypes) - sig.AddArgument(t); + for (int i = 0; i < parameterTypes.Length; i++) + { + sig.AddArgument(parameterTypes[i], requiredCustomModifiers![i], optionalCustomModifiers![i]); + } } if (optionalParameterTypes != null && optionalParameterTypes.Length != 0) { diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.cs index 4d52ddcb876f..873979ecb7ac 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.cs @@ -50,7 +50,7 @@ public FieldBuilder DefineLiteral(string literalName, object? literalValue) } // Get the internal metadata token for this class. - public TypeToken TypeToken => m_typeBuilder.TypeToken; + internal int TypeToken => m_typeBuilder.TypeToken; // return the underlying field for the enum diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EventBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EventBuilder.cs index 426d0af22887..a66718182a83 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EventBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EventBuilder.cs @@ -30,7 +30,7 @@ internal EventBuilder( EventAttributes attr, // event attribute such as Public, Private, and Protected defined above // int eventType, // event type TypeBuilder type, // containing type - EventToken evToken) + int evToken) { m_name = name; m_module = mod; @@ -41,7 +41,7 @@ internal EventBuilder( // Return the Token for this event within the TypeBuilder that the // event is defined within. - public EventToken GetEventToken() + internal int GetEventToken() { return m_evToken; } @@ -57,9 +57,9 @@ private void SetMethodSemantics(MethodBuilder mdBuilder, MethodSemanticsAttribut ModuleBuilder module = m_module; TypeBuilder.DefineMethodSemantics( new QCallModule(ref module), - m_evToken.Token, + m_evToken, semantics, - mdBuilder.GetToken().Token); + mdBuilder.MetadataToken); } public void SetAddOnMethod(MethodBuilder mdBuilder) @@ -94,8 +94,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) TypeBuilder.DefineCustomAttribute( m_module, - m_evToken.Token, - m_module.GetConstructorToken(con).Token, + m_evToken, + m_module.GetConstructorToken(con), binaryAttribute, false, false); } @@ -108,12 +108,12 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder) throw new ArgumentNullException(nameof(customBuilder)); } m_type.ThrowIfCreated(); - customBuilder.CreateCustomAttribute(m_module, m_evToken.Token); + customBuilder.CreateCustomAttribute(m_module, m_evToken); } // These are package private so that TypeBuilder can access them. private string m_name; // The name of the event - private EventToken m_evToken; // The token of this event + private int m_evToken; // The token of this event private ModuleBuilder m_module; private EventAttributes m_attributes; private TypeBuilder m_type; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/FieldBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/FieldBuilder.cs index 3001b3df82de..c136a2c69368 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/FieldBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/FieldBuilder.cs @@ -10,7 +10,6 @@ public sealed class FieldBuilder : FieldInfo { #region Private Data Members private int m_fieldTok; - private FieldToken m_tkField; private TypeBuilder m_typeBuilder; private string m_fieldName; private FieldAttributes m_Attributes; @@ -48,9 +47,7 @@ internal FieldBuilder(TypeBuilder typeBuilder, string fieldName, Type type, ModuleBuilder module = m_typeBuilder.GetModuleBuilder(); m_fieldTok = TypeBuilder.DefineField(new QCallModule(ref module), - typeBuilder.TypeToken.Token, fieldName, signature, sigLength, m_Attributes); - - m_tkField = new FieldToken(m_fieldTok, type); + typeBuilder.TypeToken, fieldName, signature, sigLength, m_Attributes); } #endregion @@ -59,12 +56,12 @@ internal FieldBuilder(TypeBuilder typeBuilder, string fieldName, Type type, internal void SetData(byte[]? data, int size) { ModuleBuilder module = m_typeBuilder.GetModuleBuilder(); - ModuleBuilder.SetFieldRVAContent(new QCallModule(ref module), m_tkField.Token, data, size); + ModuleBuilder.SetFieldRVAContent(new QCallModule(ref module), m_fieldTok, data, size); } #endregion #region MemberInfo Overrides - internal int MetadataTokenInternal => m_fieldTok; + public override int MetadataToken => m_fieldTok; public override Module Module => m_typeBuilder.Module; @@ -140,17 +137,12 @@ public override bool IsDefined(Type attributeType, bool inherit) #endregion #region Public Members - public FieldToken GetToken() - { - return m_tkField; - } - public void SetOffset(int iOffset) { m_typeBuilder.ThrowIfCreated(); ModuleBuilder module = m_typeBuilder.GetModuleBuilder(); - TypeBuilder.SetFieldLayoutOffset(new QCallModule(ref module), GetToken().Token, iOffset); + TypeBuilder.SetFieldLayoutOffset(new QCallModule(ref module), m_fieldTok, iOffset); } public void SetConstant(object? defaultValue) @@ -164,7 +156,7 @@ public void SetConstant(object? defaultValue) throw new ArgumentException(SR.Argument_ConstantNull); } - TypeBuilder.SetConstantValue(m_typeBuilder.GetModuleBuilder(), GetToken().Token, m_fieldType, defaultValue); + TypeBuilder.SetConstantValue(m_typeBuilder.GetModuleBuilder(), m_fieldTok, m_fieldType, defaultValue); } public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) @@ -180,7 +172,7 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) m_typeBuilder.ThrowIfCreated(); TypeBuilder.DefineCustomAttribute(module, - m_tkField.Token, module.GetConstructorToken(con).Token, binaryAttribute, false, false); + m_fieldTok, module.GetConstructorToken(con), binaryAttribute, false, false); } public void SetCustomAttribute(CustomAttributeBuilder customBuilder) @@ -192,7 +184,7 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder) ModuleBuilder? module = m_typeBuilder.Module as ModuleBuilder; - customBuilder.CreateCustomAttribute(module!, m_tkField.Token); + customBuilder.CreateCustomAttribute(module!, m_fieldTok); } #endregion diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs index e21b2c1a6a84..4dc0b22b3b46 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs @@ -53,7 +53,7 @@ public override bool Equals(object? o) public override bool IsByRefLike => false; - internal int MetadataTokenInternal => m_type.MetadataTokenInternal; + public override int MetadataToken => m_type.MetadataToken; #endregion #region Type Overrides @@ -220,13 +220,13 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder) public void SetBaseTypeConstraint([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? baseTypeConstraint) { - m_type.CheckContext(baseTypeConstraint); + AssemblyBuilder.CheckContext(baseTypeConstraint); m_type.SetParent(baseTypeConstraint); } public void SetInterfaceConstraints(params Type[]? interfaceConstraints) { - m_type.CheckContext(interfaceConstraints); + AssemblyBuilder.CheckContext(interfaceConstraints); m_type.SetInterfaces(interfaceConstraints); } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs index c587b18c62ac..acdf1663b80c 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs @@ -162,16 +162,24 @@ private int GetMethodToken(MethodBase method, Type[]? optionalParameterTypes, bo return ((ModuleBuilder)m_methodBuilder.Module).GetMethodTokenInternal(method, optionalParameterTypes, useMethodDef); } + internal SignatureHelper GetMemberRefSignature( + CallingConventions call, + Type? returnType, + Type[]? parameterTypes, + Type[]? optionalParameterTypes) + { + return GetMemberRefSignature(call, returnType, parameterTypes, null, null, optionalParameterTypes); + } internal virtual SignatureHelper GetMemberRefSignature(CallingConventions call, Type? returnType, - Type[]? parameterTypes, Type[]? optionalParameterTypes) + Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers, Type[]? optionalParameterTypes) { - return GetMemberRefSignature(call, returnType, parameterTypes, optionalParameterTypes, 0); + return GetMemberRefSignature(call, returnType, parameterTypes, requiredCustomModifiers, optionalCustomModifiers, optionalParameterTypes, 0); } private SignatureHelper GetMemberRefSignature(CallingConventions call, Type? returnType, - Type[]? parameterTypes, Type[]? optionalParameterTypes, int cGenericParameters) + Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers, Type[]? optionalParameterTypes, int cGenericParameters) { - return ((ModuleBuilder)m_methodBuilder.Module).GetMemberRefSignature(call, returnType, parameterTypes, optionalParameterTypes, cGenericParameters); + return ((ModuleBuilder)m_methodBuilder.Module).GetMemberRefSignature(call, returnType, parameterTypes, requiredCustomModifiers, optionalCustomModifiers, optionalParameterTypes, cGenericParameters); } internal byte[]? BakeByteArray() @@ -534,7 +542,7 @@ public virtual void EmitCalli(OpCode opcode, CallingConventions callingConventio UpdateStackSize(OpCodes.Calli, stackchange); RecordTokenFixup(); - PutInteger4(modBuilder.GetSignatureToken(sig).Token); + PutInteger4(modBuilder.GetSignatureToken(sig)); } public virtual void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type? returnType, Type[]? parameterTypes) @@ -577,7 +585,7 @@ public virtual void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv EnsureCapacity(7); Emit(OpCodes.Calli); RecordTokenFixup(); - PutInteger4(modBuilder.GetSignatureToken(sig).Token); + PutInteger4(modBuilder.GetSignatureToken(sig)); } public virtual void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes) @@ -622,9 +630,9 @@ public virtual void Emit(OpCode opcode, SignatureHelper signature) int stackchange = 0; ModuleBuilder modBuilder = (ModuleBuilder)m_methodBuilder.Module; - SignatureToken sig = modBuilder.GetSignatureToken(signature); + int sig = modBuilder.GetSignatureToken(signature); - int tempVal = sig.Token; + int tempVal = sig; EnsureCapacity(7); InternalEmit(opcode); @@ -701,13 +709,13 @@ public virtual void Emit(OpCode opcode, Type cls) if (opcode == OpCodes.Ldtoken && cls != null && cls.IsGenericTypeDefinition) { // This gets the token for the generic type definition if cls is one. - tempVal = modBuilder.GetTypeToken(cls).Token; + tempVal = modBuilder.GetTypeToken(cls); } else { // This gets the token for the generic type instantiated on the formal parameters // if cls is a generic type definition. - tempVal = modBuilder.GetTypeTokenInternal(cls!).Token; + tempVal = modBuilder.GetTypeTokenInternal(cls!); } EnsureCapacity(7); @@ -792,7 +800,7 @@ public virtual void Emit(OpCode opcode, Label[] labels) public virtual void Emit(OpCode opcode, FieldInfo field) { ModuleBuilder modBuilder = (ModuleBuilder)m_methodBuilder.Module; - int tempVal = modBuilder.GetFieldToken(field).Token; + int tempVal = modBuilder.GetFieldToken(field); EnsureCapacity(7); InternalEmit(opcode); RecordTokenFixup(); @@ -806,7 +814,7 @@ public virtual void Emit(OpCode opcode, string str) // fixups if the module is persisted to a PE. ModuleBuilder modBuilder = (ModuleBuilder)m_methodBuilder.Module; - int tempVal = modBuilder.GetStringConstant(str).Token; + int tempVal = modBuilder.GetStringConstant(str); EnsureCapacity(7); InternalEmit(opcode); PutInteger4(tempVal); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs index 65b5033e996e..e99c584074c1 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs @@ -16,7 +16,7 @@ public sealed class MethodBuilder : MethodInfo #region Private Data Members // Identity internal string m_strName; // The name of the method - private MethodToken m_tkMethod; // The token of this method + private int m_token; // The token of this method private readonly ModuleBuilder m_module; [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] @@ -98,20 +98,6 @@ internal MethodBuilder(string name, MethodAttributes attributes, CallingConventi throw new ArgumentException(SR.Arg_NoStaticVirtual); } -#if !FEATURE_DEFAULT_INTERFACES - if ((attributes & MethodAttributes.SpecialName) != MethodAttributes.SpecialName) - { - if ((type.Attributes & TypeAttributes.Interface) == TypeAttributes.Interface) - { - // methods on interface have to be abstract + virtual except special name methods such as type initializer - if ((attributes & (MethodAttributes.Abstract | MethodAttributes.Virtual)) != - (MethodAttributes.Abstract | MethodAttributes.Virtual) && - (attributes & MethodAttributes.Static) == 0) - throw new ArgumentException(SR.Argument_BadAttributeOnInterfaceMethod); - } - } -#endif - m_callingConvention = callingConvention; if (parameterTypes != null) @@ -149,16 +135,6 @@ internal MethodBuilder(string name, MethodAttributes attributes, CallingConventi #region Internal Members - internal void CheckContext(params Type[]?[]? typess) - { - m_module.CheckContext(typess); - } - - internal void CheckContext(params Type?[]? types) - { - m_module.CheckContext(types); - } - internal void CreateMethodBodyHelper(ILGenerator il) { // Sets the IL of the method. An ILGenerator is passed as an argument and the method @@ -230,7 +206,7 @@ internal void CreateMethodBodyHelper(ILGenerator il) int tkExceptionClass = 0; if (catchClass[j] != null) { - tkExceptionClass = dynMod.GetTypeTokenInternal(catchClass[j]).Token; + tkExceptionClass = dynMod.GetTypeTokenInternal(catchClass[j]); } switch (type[j]) @@ -256,7 +232,7 @@ internal void CreateMethodBodyHelper(ILGenerator il) // set the debugging information such as scope and line number // if it is in a debug module // - SymbolToken tk = new SymbolToken(MetadataTokenInternal); + SymbolToken tk = new SymbolToken(MetadataToken); ISymbolWriter symWriter = dynMod.GetSymWriter()!; // call OpenMethod to make this method the current method @@ -311,9 +287,9 @@ internal void ReleaseBakedStructures() } } - internal void SetToken(MethodToken token) + internal void SetToken(int token) { - m_tkMethod = token; + m_token = token; } internal byte[]? GetBody() @@ -459,7 +435,7 @@ public override string ToString() #region MemberInfo Overrides public override string Name => m_strName; - internal int MetadataTokenInternal => GetToken().Token; + public override int MetadataToken => GetToken(); public override Module Module => m_containingType.Module; @@ -584,7 +560,7 @@ public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] nam if (names[i] == null) throw new ArgumentNullException(nameof(names)); - if (m_tkMethod.Token != 0) + if (m_token != 0) throw new InvalidOperationException(SR.InvalidOperation_MethodBuilderBaked); m_bIsGenMethDef = true; @@ -599,7 +575,7 @@ public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] nam #endregion #region Public Members - public MethodToken GetToken() + private int GetToken() { // We used to always "tokenize" a MethodBuilder when it is constructed. After change list 709498 // we only "tokenize" a method when requested. But the order in which the methods are tokenized @@ -611,13 +587,13 @@ public MethodToken GetToken() // I don't fully understand this change. So I will keep the logic and only fix the recursion and // the race condition. - if (m_tkMethod.Token != 0) + if (m_token != 0) { - return m_tkMethod; + return m_token; } MethodBuilder? currentMethod = null; - MethodToken currentToken = new MethodToken(0); + int currentToken = 0; int i; // We need to lock here to prevent a method from being "tokenized" twice. @@ -625,9 +601,9 @@ public MethodToken GetToken() // constructed MethodBuilders to the end of m_listMethods lock (m_containingType.m_listMethods!) { - if (m_tkMethod.Token != 0) + if (m_token != 0) { - return m_tkMethod; + return m_token; } // If m_tkMethod is still 0 when we obtain the lock, m_lastTokenizedMethod must be smaller @@ -645,20 +621,20 @@ public MethodToken GetToken() } Debug.Assert(currentMethod == this, "We should have found this method in m_containingType.m_listMethods"); - Debug.Assert(currentToken.Token != 0, "The token should not be 0"); + Debug.Assert(currentToken != 0, "The token should not be 0"); return currentToken; } - private MethodToken GetTokenNoLock() + private int GetTokenNoLock() { - Debug.Assert(m_tkMethod.Token == 0, "m_tkMethod should not have been initialized"); + Debug.Assert(m_token == 0, "m_token should not have been initialized"); byte[] sigBytes = GetMethodSignature().InternalGetSignature(out int sigLength); ModuleBuilder module = m_module; - int token = TypeBuilder.DefineMethod(new QCallModule(ref module), m_containingType.MetadataTokenInternal, m_strName, sigBytes, sigLength, Attributes); - m_tkMethod = new MethodToken(token); + int token = TypeBuilder.DefineMethod(new QCallModule(ref module), m_containingType.MetadataToken, m_strName, sigBytes, sigLength, Attributes); + m_token = token; if (m_inst != null) foreach (GenericTypeParameterBuilder tb in m_inst) @@ -666,19 +642,19 @@ private MethodToken GetTokenNoLock() TypeBuilder.SetMethodImpl(new QCallModule(ref module), token, m_dwMethodImplFlags); - return m_tkMethod; + return m_token; } public void SetParameters(params Type[] parameterTypes) { - CheckContext(parameterTypes); + AssemblyBuilder.CheckContext(parameterTypes); SetSignature(null, null, null, parameterTypes, null, null); } public void SetReturnType(Type? returnType) { - CheckContext(returnType); + AssemblyBuilder.CheckContext(returnType); SetSignature(returnType, null, null, null, null, null); } @@ -689,13 +665,13 @@ public void SetSignature( { // We should throw InvalidOperation_MethodBuilderBaked here if the method signature has been baked. // But we cannot because that would be a breaking change from V2. - if (m_tkMethod.Token != 0) + if (m_token != 0) return; - CheckContext(returnType); - CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes); - CheckContext(parameterTypeRequiredCustomModifiers); - CheckContext(parameterTypeOptionalCustomModifiers); + AssemblyBuilder.CheckContext(returnType); + AssemblyBuilder.CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes); + AssemblyBuilder.CheckContext(parameterTypeRequiredCustomModifiers); + AssemblyBuilder.CheckContext(parameterTypeOptionalCustomModifiers); ThrowIfGeneric(); @@ -742,7 +718,7 @@ public void SetImplementationFlags(MethodImplAttributes attributes) m_canBeRuntimeImpl = true; ModuleBuilder module = m_module; - TypeBuilder.SetMethodImpl(new QCallModule(ref module), MetadataTokenInternal, attributes); + TypeBuilder.SetMethodImpl(new QCallModule(ref module), MetadataToken, attributes); } public ILGenerator GetILGenerator() @@ -797,8 +773,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) ThrowIfGeneric(); - TypeBuilder.DefineCustomAttribute(m_module, MetadataTokenInternal, - ((ModuleBuilder)m_module).GetConstructorToken(con).Token, + TypeBuilder.DefineCustomAttribute(m_module, MetadataToken, + ((ModuleBuilder)m_module).GetConstructorToken(con), binaryAttribute, false, false); @@ -813,7 +789,7 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder) ThrowIfGeneric(); - customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, MetadataTokenInternal); + customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, MetadataToken); if (IsKnownCA(customBuilder.m_con)) ParseCA(customBuilder.m_con); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs index c1ed6b887a02..6127c5947806 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -122,16 +122,6 @@ internal void CheckTypeNameConflict(string strTypeName, Type? enclosingType) return SymbolType.FormCompoundType(strFormat, baseType, 0); } - internal void CheckContext(params Type[]?[]? typess) - { - AssemblyBuilder.CheckContext(typess); - } - - internal void CheckContext(params Type?[]? types) - { - AssemblyBuilder.CheckContext(types); - } - [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] private static extern int GetTypeRef(QCallModule module, string strFullName, QCallModule refedModule, string? strRefedModuleFileName, int tkResolution); @@ -255,7 +245,7 @@ private int GetTypeRefNested(Type type, Module? refedModule, string? strRefedMod return GetTypeRef(new QCallModule(ref thisModule), typeName, new QCallModule(ref refedRuntimeModule), strRefedModuleFileName, tkResolution); } - internal MethodToken InternalGetConstructorToken(ConstructorInfo con, bool usingRef) + internal int InternalGetConstructorToken(ConstructorInfo con, bool usingRef) { // Helper to get constructor token. If usingRef is true, we will never use the def token if (con == null) @@ -264,29 +254,29 @@ internal MethodToken InternalGetConstructorToken(ConstructorInfo con, bool using } int tr; - int mr = 0; + int mr; if (con is ConstructorBuilder conBuilder) { if (!usingRef && conBuilder.Module.Equals(this)) - return conBuilder.GetToken(); + return conBuilder.MetadataToken; // constructor is defined in a different module - tr = GetTypeTokenInternal(con.ReflectedType!).Token; - mr = GetMemberRef(con.ReflectedType!.Module, tr, conBuilder.GetToken().Token); + tr = GetTypeTokenInternal(con.ReflectedType!); + mr = GetMemberRef(con.ReflectedType!.Module, tr, conBuilder.MetadataToken); } else if (con is ConstructorOnTypeBuilderInstantiation conOnTypeBuilderInst) { if (usingRef) throw new InvalidOperationException(); - tr = GetTypeTokenInternal(con.DeclaringType!).Token; - mr = GetMemberRef(con.DeclaringType!.Module, tr, conOnTypeBuilderInst.MetadataTokenInternal); + tr = GetTypeTokenInternal(con.DeclaringType!); + mr = GetMemberRef(con.DeclaringType!.Module, tr, conOnTypeBuilderInst.MetadataToken); } else if (con is RuntimeConstructorInfo rtCon && !con.ReflectedType!.IsArray) { // constructor is not a dynamic field // We need to get the TypeRef tokens - tr = GetTypeTokenInternal(con.ReflectedType).Token; + tr = GetTypeTokenInternal(con.ReflectedType); mr = GetMemberRefOfMethodInfo(tr, rtCon); } else @@ -315,14 +305,14 @@ internal MethodToken InternalGetConstructorToken(ConstructorInfo con, bool using optionalCustomModifiers[i] = parameters[i].GetOptionalCustomModifiers(); } - tr = GetTypeTokenInternal(con.ReflectedType!).Token; + tr = GetTypeTokenInternal(con.ReflectedType!); SignatureHelper sigHelp = SignatureHelper.GetMethodSigHelper(this, con.CallingConvention, null, null, null, parameterTypes, requiredCustomModifiers, optionalCustomModifiers); byte[] sigBytes = sigHelp.InternalGetSignature(out int length); mr = GetMemberRefFromSignature(tr, con.Name, sigBytes, length); } - return new MethodToken(mr); + return mr; } internal void Init(string strModuleName) @@ -357,12 +347,11 @@ private static RuntimeModule GetRuntimeModuleFromModule(Module? m) return (m as RuntimeModule)!; } - private int GetMemberRefToken(MethodBase method, IEnumerable? optionalParameterTypes) + private int GetMemberRefToken(MethodBase method, Type[]? optionalParameterTypes) { - Type[] parameterTypes; - Type? returnType; int tkParent; int cGenericParameters = 0; + SignatureHelper sigHelp; if (method.IsGenericMethod) { @@ -387,55 +376,22 @@ private int GetMemberRefToken(MethodBase method, IEnumerable? optionalPara if (method.DeclaringType!.IsGenericType) { - MethodBase methDef; // methodInfo = G.M ==> methDef = G.M - - if (method is MethodOnTypeBuilderInstantiation motbi) - { - methDef = motbi.m_method; - } - else if (method is ConstructorOnTypeBuilderInstantiation cotbi) - { - methDef = cotbi.m_ctor; - } - else if (method is MethodBuilder || method is ConstructorBuilder) - { - // methodInfo must be GenericMethodDefinition; trying to emit G.M - methDef = method; - } - else - { - Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); - - if (method.IsGenericMethod) - { - Debug.Assert(masmi != null); + MethodBase methDef = GetGenericMethodBaseDefinition(method); - methDef = masmi.GetGenericMethodDefinition()!; - methDef = methDef.Module.ResolveMethod( - method.MetadataToken, - methDef.DeclaringType?.GetGenericArguments(), - methDef.GetGenericArguments())!; - } - else - { - methDef = method.Module.ResolveMethod( - method.MetadataToken, - method.DeclaringType?.GetGenericArguments(), - null)!; - } - } - - parameterTypes = methDef.GetParameterTypes(); - returnType = MethodBuilder.GetMethodBaseReturnType(methDef); + sigHelp = GetMemberRefSignature(methDef, cGenericParameters); } else { - parameterTypes = method.GetParameterTypes(); - returnType = MethodBuilder.GetMethodBaseReturnType(method); + sigHelp = GetMemberRefSignature(method, cGenericParameters); + } + + if (optionalParameterTypes?.Length > 0) + { + sigHelp.AddSentinel(); + sigHelp.AddArguments(optionalParameterTypes, null, null); } - byte[] sigBytes = GetMemberRefSignature(method.CallingConvention, returnType, parameterTypes, - optionalParameterTypes, cGenericParameters).InternalGetSignature(out int sigLength); + byte[] sigBytes = sigHelp.InternalGetSignature(out int sigLength); if (method.DeclaringType!.IsGenericType) { @@ -445,30 +401,31 @@ private int GetMemberRefToken(MethodBase method, IEnumerable? optionalPara else if (!method.Module.Equals(this)) { // Use typeRef as parent because the method's declaringType lives in a different assembly - tkParent = GetTypeToken(method.DeclaringType).Token; + tkParent = GetTypeToken(method.DeclaringType); } else { // Use methodDef as parent because the method lives in this assembly and its declaringType has no generic arguments if (masmi != null) - tkParent = GetMethodToken(masmi).Token; + tkParent = GetMethodToken(masmi); else - tkParent = GetConstructorToken((method as ConstructorInfo)!).Token; + tkParent = GetConstructorToken((method as ConstructorInfo)!); } return GetMemberRefFromSignature(tkParent, method.Name, sigBytes, sigLength); } internal SignatureHelper GetMemberRefSignature(CallingConventions call, Type? returnType, - Type[]? parameterTypes, IEnumerable? optionalParameterTypes, int cGenericParameters) + Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers, + IEnumerable? optionalParameterTypes, int cGenericParameters) { SignatureHelper sig = SignatureHelper.GetMethodSigHelper(this, call, returnType, cGenericParameters); if (parameterTypes != null) { - foreach (Type t in parameterTypes) + for (int i = 0; i < parameterTypes.Length; i++) { - sig.AddArgument(t); + sig.AddArgument(parameterTypes[i], requiredCustomModifiers![i], optionalCustomModifiers![i]); } } @@ -491,6 +448,90 @@ internal SignatureHelper GetMemberRefSignature(CallingConventions call, Type? re return sig; } + private static MethodBase GetGenericMethodBaseDefinition(MethodBase methodBase) + { + // methodInfo = G.M ==> methDef = G.M + MethodInfo? masmi = methodBase as MethodInfo; + MethodBase methDef; + + if (methodBase is MethodOnTypeBuilderInstantiation motbi) + { + methDef = motbi.m_method; + } + else if (methodBase is ConstructorOnTypeBuilderInstantiation cotbi) + { + methDef = cotbi.m_ctor; + } + else if (methodBase is MethodBuilder || methodBase is ConstructorBuilder) + { + // methodInfo must be GenericMethodDefinition; trying to emit G.M + methDef = methodBase; + } + else + { + Debug.Assert(methodBase is RuntimeMethodInfo || methodBase is RuntimeConstructorInfo); + + if (methodBase.IsGenericMethod) + { + Debug.Assert(masmi != null); + + methDef = masmi.GetGenericMethodDefinition()!; + methDef = methDef.Module.ResolveMethod( + methodBase.MetadataToken, + methDef.DeclaringType?.GetGenericArguments(), + methDef.GetGenericArguments())!; + } + else + { + methDef = methodBase.Module.ResolveMethod( + methodBase.MetadataToken, + methodBase.DeclaringType?.GetGenericArguments(), + null)!; + } + } + + return methDef; + } + + internal SignatureHelper GetMemberRefSignature(MethodBase? method, int cGenericParameters) + { + switch (method) + { + case MethodBuilder methodBuilder: + return methodBuilder.GetMethodSignature(); + case ConstructorBuilder constructorBuilder: + return constructorBuilder.GetMethodSignature(); + case MethodOnTypeBuilderInstantiation motbi when motbi.m_method is MethodBuilder methodBuilder: + return methodBuilder.GetMethodSignature(); + case MethodOnTypeBuilderInstantiation motbi: + method = motbi.m_method; + break; + case ConstructorOnTypeBuilderInstantiation cotbi when cotbi.m_ctor is ConstructorBuilder constructorBuilder: + return constructorBuilder.GetMethodSignature(); + case ConstructorOnTypeBuilderInstantiation cotbi: + method = cotbi.m_ctor; + break; + } + + Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); + ParameterInfo[] parameters = method.GetParametersNoCopy(); + + Type[] parameterTypes = new Type[parameters.Length]; + Type[][] requiredCustomModifiers = new Type[parameterTypes.Length][]; + Type[][] optionalCustomModifiers = new Type[parameterTypes.Length][]; + + for (int i = 0; i < parameters.Length; i++) + { + parameterTypes[i] = parameters[i].ParameterType; + requiredCustomModifiers[i] = parameters[i].GetRequiredCustomModifiers(); + optionalCustomModifiers[i] = parameters[i].GetOptionalCustomModifiers(); + } + + ParameterInfo? returnParameter = method is MethodInfo mi ? mi.ReturnParameter : null; + SignatureHelper sigHelp = SignatureHelper.GetMethodSigHelper(this, method.CallingConvention, cGenericParameters, returnParameter?.ParameterType, returnParameter?.GetRequiredCustomModifiers(), returnParameter?.GetOptionalCustomModifiers(), parameterTypes, requiredCustomModifiers, optionalCustomModifiers); + return sigHelp; + } + #endregion public override bool Equals(object? obj) => InternalModule.Equals(obj); @@ -742,13 +783,13 @@ public override FieldInfo[] GetFields(BindingFlags bindingFlags) return InternalModule.GetField(name, bindingAttr); } - [RequiresUnreferencedCode("Fields might be removed")] + [RequiresUnreferencedCode("Methods might be removed")] public override MethodInfo[] GetMethods(BindingFlags bindingFlags) { return InternalModule.GetMethods(bindingFlags); } - [RequiresUnreferencedCode("Fields might be removed")] + [RequiresUnreferencedCode("Methods might be removed")] protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder, CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers) { @@ -788,7 +829,7 @@ public TypeBuilder DefineType(string name, TypeAttributes attr, [DynamicallyAcce { lock (SyncRoot) { - CheckContext(parent); + AssemblyBuilder.CheckContext(parent); return DefineTypeNoLock(name, attr, parent, null, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize); } @@ -844,7 +885,7 @@ private TypeBuilder DefineTypeNoLock(string name, TypeAttributes attr, [Dynamica // Nested enum types can be defined manually using ModuleBuilder.DefineType. public EnumBuilder DefineEnum(string name, TypeAttributes visibility, Type underlyingType) { - CheckContext(underlyingType); + AssemblyBuilder.CheckContext(underlyingType); lock (SyncRoot) { EnumBuilder enumBuilder = DefineEnumNoLock(name, visibility, underlyingType); @@ -885,8 +926,8 @@ public MethodBuilder DefinePInvokeMethod(string name, string dllName, string ent throw new ArgumentException(SR.Argument_GlobalFunctionHasToBeStatic); } - CheckContext(returnType); - CheckContext(parameterTypes); + AssemblyBuilder.CheckContext(returnType); + AssemblyBuilder.CheckContext(parameterTypes); return _moduleData._globalTypeBuilder.DefinePInvokeMethod(name, dllName, entryName, attributes, callingConvention, returnType, parameterTypes, nativeCallConv, nativeCharSet); } @@ -936,10 +977,10 @@ private MethodBuilder DefineGlobalMethodNoLock(string name, MethodAttributes att throw new ArgumentException(SR.Argument_GlobalFunctionHasToBeStatic); } - CheckContext(returnType); - CheckContext(requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers, parameterTypes); - CheckContext(requiredParameterTypeCustomModifiers); - CheckContext(optionalParameterTypeCustomModifiers); + AssemblyBuilder.CheckContext(returnType); + AssemblyBuilder.CheckContext(requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers, parameterTypes); + AssemblyBuilder.CheckContext(requiredParameterTypeCustomModifiers); + AssemblyBuilder.CheckContext(optionalParameterTypeCustomModifiers); return _moduleData._globalTypeBuilder.DefineMethod(name, attributes, callingConvention, returnType, requiredReturnTypeCustomModifiers, optionalReturnTypeCustomModifiers, @@ -1024,12 +1065,12 @@ private FieldBuilder DefineUninitializedDataNoLock(string name, int size, FieldA // 1. GetTypeToken // 2. ldtoken (see ILGenerator) // For all other occasions we should return the generic type instantiated on its formal parameters. - internal TypeToken GetTypeTokenInternal(Type type) + internal int GetTypeTokenInternal(Type type) { return GetTypeTokenInternal(type, getGenericDefinition: false); } - private TypeToken GetTypeTokenInternal(Type type, bool getGenericDefinition) + private int GetTypeTokenInternal(Type type, bool getGenericDefinition) { lock (SyncRoot) { @@ -1037,19 +1078,19 @@ private TypeToken GetTypeTokenInternal(Type type, bool getGenericDefinition) } } - public TypeToken GetTypeToken(Type type) + internal int GetTypeToken(Type type) { return GetTypeTokenInternal(type, getGenericDefinition: true); } - private TypeToken GetTypeTokenWorkerNoLock(Type type, bool getGenericDefinition) + private int GetTypeTokenWorkerNoLock(Type type, bool getGenericDefinition) { if (type == null) { throw new ArgumentNullException(nameof(type)); } - CheckContext(type); + AssemblyBuilder.CheckContext(type); // Return a token for the class relative to the Module. Tokens // are used to indentify objects when the objects are used in IL @@ -1071,7 +1112,7 @@ private TypeToken GetTypeTokenWorkerNoLock(Type type, bool getGenericDefinition) type.IsPointer) { byte[] sig = SignatureHelper.GetTypeSigToken(this, type).InternalGetSignature(out int length); - return new TypeToken(GetTokenFromTypeSpec(sig, length)); + return GetTokenFromTypeSpec(sig, length); } Module refedModule = type.Module; @@ -1091,10 +1132,10 @@ private TypeToken GetTypeTokenWorkerNoLock(Type type, bool getGenericDefinition) } else if (type is GenericTypeParameterBuilder paramBuilder) { - return new TypeToken(paramBuilder.MetadataTokenInternal); + return paramBuilder.MetadataToken; } - return new TypeToken(GetTypeRefNested(type, this, string.Empty)); + return GetTypeRefNested(type, this, string.Empty); } // After this point, the referenced module is not the same as the referencing @@ -1117,10 +1158,10 @@ private TypeToken GetTypeTokenWorkerNoLock(Type type, bool getGenericDefinition) referencedModuleFileName = refedModuleBuilder._moduleData._moduleName; } - return new TypeToken(GetTypeRefNested(type, refedModule, referencedModuleFileName)); + return GetTypeRefNested(type, refedModule, referencedModuleFileName); } - public TypeToken GetTypeToken(string name) + internal int GetTypeToken(string name) { // Return a token for the class relative to the Module. // Module.GetType() verifies name @@ -1131,15 +1172,7 @@ public TypeToken GetTypeToken(string name) return GetTypeToken(InternalModule.GetType(name, false, true)!); } - public MethodToken GetMethodToken(MethodInfo method) - { - lock (SyncRoot) - { - return GetMethodTokenNoLock(method, true); - } - } - - internal MethodToken GetMethodTokenInternal(MethodInfo method) + internal int GetMethodToken(MethodInfo method) { lock (SyncRoot) { @@ -1151,7 +1184,7 @@ internal MethodToken GetMethodTokenInternal(MethodInfo method) // 1. GetMethodToken // 2. ldtoken (see ILGenerator) // For all other occasions we should return the method on the generic type instantiated on the formal parameters. - private MethodToken GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeDefinition) + private int GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeDefinition) { // Return a MemberRef token if MethodInfo is not defined in this module. Or // return the MethodDef token. @@ -1165,10 +1198,10 @@ private MethodToken GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeD if (method is MethodBuilder methBuilder) { - int methodToken = methBuilder.MetadataTokenInternal; + int methodToken = methBuilder.MetadataToken; if (method.Module.Equals(this)) { - return new MethodToken(methodToken); + return methodToken; } if (method.DeclaringType == null) @@ -1177,17 +1210,17 @@ private MethodToken GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeD } // method is defined in a different module - tr = getGenericTypeDefinition ? GetTypeToken(method.DeclaringType).Token : GetTypeTokenInternal(method.DeclaringType).Token; + tr = getGenericTypeDefinition ? GetTypeToken(method.DeclaringType) : GetTypeTokenInternal(method.DeclaringType); mr = GetMemberRef(method.DeclaringType.Module, tr, methodToken); } else if (method is MethodOnTypeBuilderInstantiation) { - return new MethodToken(GetMemberRefToken(method, null)); + return GetMemberRefToken(method, null); } else if (method is SymbolMethod symMethod) { if (symMethod.GetModule() == this) - return symMethod.GetToken(); + return symMethod.MetadataToken; // form the method token return symMethod.GetToken(this); @@ -1216,7 +1249,7 @@ private MethodToken GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeD } else if (method is RuntimeMethodInfo rtMeth) { - tr = getGenericTypeDefinition ? GetTypeToken(declaringType).Token : GetTypeTokenInternal(declaringType).Token; + tr = getGenericTypeDefinition ? GetTypeToken(declaringType) : GetTypeTokenInternal(declaringType); mr = GetMemberRefOfMethodInfo(tr, rtMeth); } else @@ -1236,7 +1269,7 @@ private MethodToken GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeD optionalCustomModifiers[i] = parameters[i].GetOptionalCustomModifiers(); } - tr = getGenericTypeDefinition ? GetTypeToken(declaringType).Token : GetTypeTokenInternal(declaringType).Token; + tr = getGenericTypeDefinition ? GetTypeToken(declaringType) : GetTypeTokenInternal(declaringType); SignatureHelper sigHelp; @@ -1258,10 +1291,10 @@ private MethodToken GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeD } } - return new MethodToken(mr); + return mr; } - internal int GetMethodTokenInternal(MethodBase method, IEnumerable? optionalParameterTypes, bool useMethodDef) + internal int GetMethodTokenInternal(MethodBase method, Type[]? optionalParameterTypes, bool useMethodDef) { int tk; MethodInfo? methodInfo = method as MethodInfo; @@ -1287,7 +1320,7 @@ internal int GetMethodTokenInternal(MethodBase method, IEnumerable? option } else { - tk = GetMethodTokenInternal(methodInfoUnbound).Token; + tk = GetMethodToken(methodInfoUnbound); } // For Ldtoken, Ldftn, and Ldvirtftn, we should emit the method def/ref token for a generic method definition. @@ -1310,11 +1343,11 @@ internal int GetMethodTokenInternal(MethodBase method, IEnumerable? option { if (methodInfo != null) { - tk = GetMethodTokenInternal(methodInfo).Token; + tk = GetMethodToken(methodInfo); } else { - tk = GetConstructorToken((method as ConstructorInfo)!).Token; + tk = GetConstructorToken((method as ConstructorInfo)!); } } else @@ -1326,7 +1359,7 @@ internal int GetMethodTokenInternal(MethodBase method, IEnumerable? option return tk; } - public MethodToken GetArrayMethodToken(Type arrayClass, string methodName, CallingConventions callingConvention, + internal int GetArrayMethodToken(Type arrayClass, string methodName, CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes) { lock (SyncRoot) @@ -1335,7 +1368,7 @@ public MethodToken GetArrayMethodToken(Type arrayClass, string methodName, Calli } } - private MethodToken GetArrayMethodTokenNoLock(Type arrayClass, string methodName, CallingConventions callingConvention, + private int GetArrayMethodTokenNoLock(Type arrayClass, string methodName, CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes) { if (arrayClass == null) @@ -1355,44 +1388,44 @@ private MethodToken GetArrayMethodTokenNoLock(Type arrayClass, string methodName throw new ArgumentException(SR.Argument_HasToBeArrayClass); } - CheckContext(returnType, arrayClass); - CheckContext(parameterTypes); + AssemblyBuilder.CheckContext(returnType, arrayClass); + AssemblyBuilder.CheckContext(parameterTypes); // Return a token for the MethodInfo for a method on an Array. This is primarily // used to get the LoadElementAddress method. SignatureHelper sigHelp = SignatureHelper.GetMethodSigHelper( this, callingConvention, returnType, null, null, parameterTypes, null, null); byte[] sigBytes = sigHelp.InternalGetSignature(out int length); - TypeToken typeSpec = GetTypeTokenInternal(arrayClass); + int typeSpec = GetTypeTokenInternal(arrayClass); ModuleBuilder thisModule = this; - return new MethodToken(GetArrayMethodToken(new QCallModule(ref thisModule), - typeSpec.Token, methodName, sigBytes, length)); + return GetArrayMethodToken(new QCallModule(ref thisModule), + typeSpec, methodName, sigBytes, length); } public MethodInfo GetArrayMethod(Type arrayClass, string methodName, CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes) { - CheckContext(returnType, arrayClass); - CheckContext(parameterTypes); + AssemblyBuilder.CheckContext(returnType, arrayClass); + AssemblyBuilder.CheckContext(parameterTypes); // GetArrayMethod is useful when you have an array of a type whose definition has not been completed and // you want to access methods defined on Array. For example, you might define a type and want to define a // method that takes an array of the type as a parameter. In order to access the elements of the array, // you will need to call methods of the Array class. - MethodToken token = GetArrayMethodToken(arrayClass, methodName, callingConvention, returnType, parameterTypes); + int token = GetArrayMethodToken(arrayClass, methodName, callingConvention, returnType, parameterTypes); return new SymbolMethod(this, token, arrayClass, methodName, callingConvention, returnType, parameterTypes); } - public MethodToken GetConstructorToken(ConstructorInfo con) + internal int GetConstructorToken(ConstructorInfo con) { // Return a token for the ConstructorInfo relative to the Module. return InternalGetConstructorToken(con, false); } - public FieldToken GetFieldToken(FieldInfo field) + internal int GetFieldToken(FieldInfo field) { lock (SyncRoot) { @@ -1400,7 +1433,7 @@ public FieldToken GetFieldToken(FieldInfo field) } } - private FieldToken GetFieldTokenNoLock(FieldInfo field) + private int GetFieldTokenNoLock(FieldInfo field) { if (field == null) { @@ -1416,12 +1449,12 @@ private FieldToken GetFieldTokenNoLock(FieldInfo field) { byte[] sig = SignatureHelper.GetTypeSigToken(this, field.DeclaringType).InternalGetSignature(out int length); tr = GetTokenFromTypeSpec(sig, length); - mr = GetMemberRef(this, tr, fdBuilder.GetToken().Token); + mr = GetMemberRef(this, tr, fdBuilder.MetadataToken); } else if (fdBuilder.Module.Equals(this)) { // field is defined in the same module - return fdBuilder.GetToken(); + return fdBuilder.MetadataToken; } else { @@ -1430,8 +1463,8 @@ private FieldToken GetFieldTokenNoLock(FieldInfo field) { throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule); } - tr = GetTypeTokenInternal(field.DeclaringType).Token; - mr = GetMemberRef(field.ReflectedType!.Module, tr, fdBuilder.GetToken().Token); + tr = GetTypeTokenInternal(field.DeclaringType); + mr = GetMemberRef(field.ReflectedType!.Module, tr, fdBuilder.MetadataToken); } } else if (field is RuntimeFieldInfo rtField) @@ -1451,7 +1484,7 @@ private FieldToken GetFieldTokenNoLock(FieldInfo field) } else { - tr = GetTypeTokenInternal(field.DeclaringType!).Token; + tr = GetTypeTokenInternal(field.DeclaringType!); mr = GetMemberRefOfFieldInfo(tr, field.DeclaringType!.GetTypeHandleInternal(), rtField); } } @@ -1460,12 +1493,12 @@ private FieldToken GetFieldTokenNoLock(FieldInfo field) FieldInfo fb = fOnTB.FieldInfo; byte[] sig = SignatureHelper.GetTypeSigToken(this, field.DeclaringType!).InternalGetSignature(out int length); tr = GetTokenFromTypeSpec(sig, length); - mr = GetMemberRef(fb.ReflectedType!.Module, tr, fOnTB.MetadataTokenInternal); + mr = GetMemberRef(fb.ReflectedType!.Module, tr, fOnTB.MetadataToken); } else { // user defined FieldInfo - tr = GetTypeTokenInternal(field.ReflectedType!).Token; + tr = GetTypeTokenInternal(field.ReflectedType!); SignatureHelper sigHelp = SignatureHelper.GetFieldSigHelper(this); @@ -1475,10 +1508,10 @@ private FieldToken GetFieldTokenNoLock(FieldInfo field) mr = GetMemberRefFromSignature(tr, field.Name, sigBytes, length); } - return new FieldToken(mr, field.GetType()); + return mr; } - public StringToken GetStringConstant(string str) + internal int GetStringConstant(string str) { if (str == null) { @@ -1488,10 +1521,10 @@ public StringToken GetStringConstant(string str) // Returns a token representing a String constant. If the string // value has already been defined, the existing token will be returned. ModuleBuilder thisModule = this; - return new StringToken(GetStringConstant(new QCallModule(ref thisModule), str, str.Length)); + return GetStringConstant(new QCallModule(ref thisModule), str, str.Length); } - public SignatureToken GetSignatureToken(SignatureHelper sigHelper) + internal int GetSignatureToken(SignatureHelper sigHelper) { // Define signature token given a signature helper. This will define a metadata // token for the signature described by SignatureHelper. @@ -1503,10 +1536,10 @@ public SignatureToken GetSignatureToken(SignatureHelper sigHelper) // get the signature in byte form byte[] sigBytes = sigHelper.InternalGetSignature(out int sigLength); ModuleBuilder thisModule = this; - return new SignatureToken(TypeBuilder.GetTokenFromSig(new QCallModule(ref thisModule), sigBytes, sigLength)); + return TypeBuilder.GetTokenFromSig(new QCallModule(ref thisModule), sigBytes, sigLength); } - public SignatureToken GetSignatureToken(byte[] sigBytes, int sigLength) + internal int GetSignatureToken(byte[] sigBytes, int sigLength) { if (sigBytes == null) { @@ -1517,7 +1550,7 @@ public SignatureToken GetSignatureToken(byte[] sigBytes, int sigLength) Buffer.BlockCopy(sigBytes, 0, localSigBytes, 0, sigBytes.Length); ModuleBuilder thisModule = this; - return new SignatureToken(TypeBuilder.GetTokenFromSig(new QCallModule(ref thisModule), localSigBytes, sigLength)); + return TypeBuilder.GetTokenFromSig(new QCallModule(ref thisModule), localSigBytes, sigLength); } #endregion @@ -1538,7 +1571,7 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) TypeBuilder.DefineCustomAttribute( this, 1, // This is hard coding the module token to 1 - GetConstructorToken(con).Token, + GetConstructorToken(con), binaryAttribute, false, false); } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ParameterBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ParameterBuilder.cs index e50546e54bfc..661bb8eddf6d 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ParameterBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ParameterBuilder.cs @@ -12,7 +12,7 @@ public virtual void SetConstant(object? defaultValue) { TypeBuilder.SetConstantValue( _methodBuilder.GetModuleBuilder(), - _token.Token, + _token, _position == 0 ? _methodBuilder.ReturnType : _methodBuilder.m_parameterTypes![_position - 1], defaultValue); } @@ -31,8 +31,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) TypeBuilder.DefineCustomAttribute( _methodBuilder.GetModuleBuilder(), - _token.Token, - ((ModuleBuilder)_methodBuilder.GetModule()).GetConstructorToken(con).Token, + _token, + ((ModuleBuilder)_methodBuilder.GetModule()).GetConstructorToken(con), binaryAttribute, false, false); } @@ -44,7 +44,7 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { throw new ArgumentNullException(nameof(customBuilder)); } - customBuilder.CreateCustomAttribute((ModuleBuilder)(_methodBuilder.GetModule()), _token.Token); + customBuilder.CreateCustomAttribute((ModuleBuilder)(_methodBuilder.GetModule()), _token); } internal ParameterBuilder( @@ -58,15 +58,15 @@ internal ParameterBuilder( _methodBuilder = methodBuilder; _attributes = attributes; ModuleBuilder module = _methodBuilder.GetModuleBuilder(); - _token = new ParameterToken(TypeBuilder.SetParamInfo( + _token = TypeBuilder.SetParamInfo( new QCallModule(ref module), - _methodBuilder.GetToken().Token, + _methodBuilder.MetadataToken, sequence, attributes, - paramName)); + paramName); } - public virtual ParameterToken GetToken() + internal int GetToken() { return _token; } @@ -87,6 +87,6 @@ public virtual ParameterToken GetToken() private readonly int _position; private readonly ParameterAttributes _attributes; private MethodBuilder _methodBuilder; - private ParameterToken _token; + private int _token; } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/PropertyBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/PropertyBuilder.cs index 76b14a4cf813..4151db895be0 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/PropertyBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/PropertyBuilder.cs @@ -26,12 +26,12 @@ public sealed class PropertyBuilder : PropertyInfo // Constructs a PropertyBuilder. // internal PropertyBuilder( - ModuleBuilder mod, // the module containing this PropertyBuilder - string name, // property name - SignatureHelper sig, // property signature descriptor info - PropertyAttributes attr, // property attribute such as DefaultProperty, Bindable, DisplayBind, etc - Type returnType, // return type of the property. - PropertyToken prToken, // the metadata token for this property + ModuleBuilder mod, // the module containing this PropertyBuilder + string name, // property name + SignatureHelper sig, // property signature descriptor info + PropertyAttributes attr, // property attribute such as DefaultProperty, Bindable, DisplayBind, etc + Type returnType, // return type of the property. + int prToken, // the metadata token for this property TypeBuilder containingType) // the containing type { if (name == null) @@ -43,11 +43,9 @@ internal PropertyBuilder( m_name = name; m_moduleBuilder = mod; - m_signature = sig; m_attributes = attr; m_returnType = returnType; - m_prToken = prToken; - m_tkProperty = prToken.Token; + m_tkProperty = prToken; m_containingType = containingType; } @@ -60,7 +58,7 @@ public void SetConstant(object? defaultValue) TypeBuilder.SetConstantValue( m_moduleBuilder, - m_prToken.Token, + m_tkProperty, m_returnType, defaultValue); } @@ -68,7 +66,7 @@ public void SetConstant(object? defaultValue) // Return the Token for this property within the TypeBuilder that the // property is defined within. - public PropertyToken PropertyToken => m_prToken; + internal int PropertyToken => m_tkProperty; public override Module Module => m_containingType.Module; @@ -83,9 +81,9 @@ private void SetMethodSemantics(MethodBuilder mdBuilder, MethodSemanticsAttribut ModuleBuilder module = m_moduleBuilder; TypeBuilder.DefineMethodSemantics( new QCallModule(ref module), - m_prToken.Token, + m_tkProperty, semantics, - mdBuilder.GetToken().Token); + mdBuilder.MetadataToken); } public void SetGetMethod(MethodBuilder mdBuilder) @@ -117,8 +115,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) m_containingType.ThrowIfCreated(); TypeBuilder.DefineCustomAttribute( m_moduleBuilder, - m_prToken.Token, - m_moduleBuilder.GetConstructorToken(con).Token, + m_tkProperty, + m_moduleBuilder.GetConstructorToken(con), binaryAttribute, false, false); } @@ -131,7 +129,7 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder) throw new ArgumentNullException(nameof(customBuilder)); } m_containingType.ThrowIfCreated(); - customBuilder.CreateCustomAttribute(m_moduleBuilder, m_prToken.Token); + customBuilder.CreateCustomAttribute(m_moduleBuilder, m_tkProperty); } // Not supported functions in dynamic module. @@ -221,13 +219,11 @@ public override bool IsDefined(Type attributeType, bool inherit) public override Type? ReflectedType => m_containingType; // These are package private so that TypeBuilder can access them. - private string m_name; // The name of the property - private PropertyToken m_prToken; // The token of this property - private int m_tkProperty; + private string m_name; // The name of the property + private int m_tkProperty; // The token of this property private ModuleBuilder m_moduleBuilder; - private SignatureHelper m_signature; - private PropertyAttributes m_attributes; // property's attribute flags - private Type m_returnType; // property's return type + private PropertyAttributes m_attributes; // property's attribute flags + private Type m_returnType; // property's return type private MethodInfo? m_getMethod; private MethodInfo? m_setMethod; private TypeBuilder m_containingType; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/SignatureHelper.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/SignatureHelper.cs index fc17ba8391c3..1dd65bffeb02 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/SignatureHelper.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/SignatureHelper.cs @@ -301,7 +301,7 @@ private void AddOneArgTypeHelper(Type clsArgument, Type[]? requiredCustomModifie AddElementType(CorElementType.ELEMENT_TYPE_CMOD_OPT); - int token = m_module!.GetTypeToken(t).Token; + int token = m_module!.GetTypeToken(t); Debug.Assert(!MetadataToken.IsNullToken(token)); AddToken(token); } @@ -324,7 +324,7 @@ private void AddOneArgTypeHelper(Type clsArgument, Type[]? requiredCustomModifie AddElementType(CorElementType.ELEMENT_TYPE_CMOD_REQD); - int token = m_module!.GetTypeToken(t).Token; + int token = m_module!.GetTypeToken(t); Debug.Assert(!MetadataToken.IsNullToken(token)); AddToken(token); } @@ -361,7 +361,7 @@ private void AddOneArgTypeHelperWorker(Type clsArgument, bool lastWasGenericInst else if (clsArgument is TypeBuilder) { TypeBuilder clsBuilder = (TypeBuilder)clsArgument; - TypeToken tkType; + int tkType; if (clsBuilder.Module.Equals(m_module)) { @@ -384,7 +384,7 @@ private void AddOneArgTypeHelperWorker(Type clsArgument, bool lastWasGenericInst else if (clsArgument is EnumBuilder) { TypeBuilder clsBuilder = ((EnumBuilder)clsArgument).m_typeBuilder; - TypeToken tkType; + int tkType; if (clsBuilder.Module.Equals(m_module)) { @@ -545,11 +545,11 @@ private void AddToken(int token) AddData(rid); } - private void InternalAddTypeToken(TypeToken clsToken, CorElementType CorType) + private void InternalAddTypeToken(int clsToken, CorElementType CorType) { // Add a type token into signature. CorType will be either CorElementType.ELEMENT_TYPE_CLASS or CorElementType.ELEMENT_TYPE_VALUETYPE AddElementType(CorType); - AddToken(clsToken.Token); + AddToken(clsToken); } private unsafe void InternalAddRuntimeType(Type type) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/SymbolMethod.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/SymbolMethod.cs index 0eb874a7b1f1..9e9aab8fcac4 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/SymbolMethod.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/SymbolMethod.cs @@ -13,13 +13,12 @@ internal sealed class SymbolMethod : MethodInfo private string m_name; private CallingConventions m_callingConvention; private Type m_returnType; - private MethodToken m_mdMethod; + private int m_token; private Type[] m_parameterTypes; - private SignatureHelper m_signature; #endregion #region Constructor - internal SymbolMethod(ModuleBuilder mod, MethodToken token, Type arrayClass, string methodName, + internal SymbolMethod(ModuleBuilder mod, int token, Type arrayClass, string methodName, CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes) { // This is a kind of MethodInfo to represent methods for array type of unbaked type @@ -29,7 +28,7 @@ internal SymbolMethod(ModuleBuilder mod, MethodToken token, Type arrayClass, str // passed into it is this MethodToken. The MethodToken was forged using a TypeSpec for an Array type and // the name of the method on Array. // As none of the methods on Array have CustomModifiers their is no need to pass those around in here. - m_mdMethod = token; + m_token = token; // The ParameterTypes are also a bit interesting in that they may be unbaked TypeBuilders. m_returnType = returnType ?? typeof(void); @@ -48,7 +47,8 @@ internal SymbolMethod(ModuleBuilder mod, MethodToken token, Type arrayClass, str m_name = methodName; m_callingConvention = callingConvention; - m_signature = SignatureHelper.GetMethodSigHelper( + // Validate signature + SignatureHelper.GetMethodSigHelper( mod, callingConvention, returnType, null, null, parameterTypes, null, null); } #endregion @@ -59,7 +59,7 @@ internal override Type[] GetParameterTypes() return m_parameterTypes; } - internal MethodToken GetToken(ModuleBuilder mod) + internal int GetToken(ModuleBuilder mod) { return mod.GetArrayMethodToken(m_containingType, m_name, m_callingConvention, m_returnType, m_parameterTypes); } @@ -135,11 +135,6 @@ public Module GetModule() return m_module; } - public MethodToken GetToken() - { - return m_mdMethod; - } - #endregion } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs index 5b2acd1605bb..d485dc69c1cc 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs @@ -50,7 +50,7 @@ public void Bake(ModuleBuilder module, int token) if (m_customBuilder == null) { Debug.Assert(m_con != null); - DefineCustomAttribute(module, token, module.GetConstructorToken(m_con).Token, + DefineCustomAttribute(module, token, module.GetConstructorToken(m_con), m_binaryAttribute, false, false); } else @@ -394,7 +394,7 @@ internal static unsafe void SetConstantValue(ModuleBuilder module, int tk, Type #region Private Data Members private List? m_ca; - private TypeToken m_tdType; + private int m_tdType; private readonly ModuleBuilder m_module; private readonly string? m_strName; private readonly string? m_strNameSpace; @@ -432,7 +432,7 @@ internal static unsafe void SetConstantValue(ModuleBuilder module, int tk, Type // ctor for the global (module) type internal TypeBuilder(ModuleBuilder module) { - m_tdType = new TypeToken((int)MetadataTokenType.TypeDef); + m_tdType = ((int)MetadataTokenType.TypeDef); m_isHiddenGlobalType = true; m_module = module; m_listMethods = new List(); @@ -514,7 +514,7 @@ internal TypeBuilder( interfaceTokens = new int[interfaces.Length + 1]; for (i = 0; i < interfaces.Length; i++) { - interfaceTokens[i] = m_module.GetTypeTokenInternal(interfaces[i]).Token; + interfaceTokens[i] = m_module.GetTypeTokenInternal(interfaces[i]); } } @@ -545,21 +545,21 @@ internal TypeBuilder( int tkParent = 0; if (m_typeParent != null) - tkParent = m_module.GetTypeTokenInternal(m_typeParent).Token; + tkParent = m_module.GetTypeTokenInternal(m_typeParent); int tkEnclosingType = 0; if (enclosingType != null) { - tkEnclosingType = enclosingType.m_tdType.Token; + tkEnclosingType = enclosingType.m_tdType; } - m_tdType = new TypeToken(DefineType(new QCallModule(ref module), - fullname, tkParent, m_iAttr, tkEnclosingType, interfaceTokens!)); + m_tdType = DefineType(new QCallModule(ref module), + fullname, tkParent, m_iAttr, tkEnclosingType, interfaceTokens!); m_iPackingSize = iPackingSize; m_iTypeSize = iTypeSize; if ((m_iPackingSize != 0) || (m_iTypeSize != 0)) - SetClassLayout(new QCallModule(ref module), m_tdType.Token, m_iPackingSize, m_iTypeSize); + SetClassLayout(new QCallModule(ref module), m_tdType, m_iPackingSize, m_iTypeSize); m_module.AddType(FullName!, this); } @@ -728,7 +728,7 @@ public override string ToString() public override bool IsByRefLike => false; - internal int MetadataTokenInternal => m_tdType.Token; + public override int MetadataToken => m_tdType; #endregion @@ -1183,7 +1183,7 @@ public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] nam public override Type MakeGenericType(params Type[] typeArguments) { - CheckContext(typeArguments); + AssemblyBuilder.CheckContext(typeArguments); return TypeBuilderInstantiation.MakeGenericType(this, typeArguments); } @@ -1225,11 +1225,11 @@ private void DefineMethodOverrideNoLock(MethodInfo methodInfoBody, MethodInfo me // Loader restriction: body method has to be from this class throw new ArgumentException(SR.ArgumentException_BadMethodImplBody); - MethodToken tkBody = m_module.GetMethodTokenInternal(methodInfoBody); - MethodToken tkDecl = m_module.GetMethodTokenInternal(methodInfoDeclaration); + int tkBody = m_module.GetMethodToken(methodInfoBody); + int tkDecl = m_module.GetMethodToken(methodInfoDeclaration); ModuleBuilder module = m_module; - DefineMethodImpl(new QCallModule(ref module), m_tdType.Token, tkBody.Token, tkDecl.Token); + DefineMethodImpl(new QCallModule(ref module), m_tdType, tkBody, tkDecl); } public MethodBuilder DefineMethod(string name, MethodAttributes attributes, Type? returnType, Type[]? parameterTypes) @@ -1275,10 +1275,10 @@ private MethodBuilder DefineMethodNoLock(string name, MethodAttributes attribute if (name.Length == 0) throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); - CheckContext(returnType); - CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes); - CheckContext(parameterTypeRequiredCustomModifiers); - CheckContext(parameterTypeOptionalCustomModifiers); + AssemblyBuilder.CheckContext(returnType); + AssemblyBuilder.CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes); + AssemblyBuilder.CheckContext(parameterTypeRequiredCustomModifiers); + AssemblyBuilder.CheckContext(parameterTypeOptionalCustomModifiers); if (parameterTypes != null) { @@ -1291,15 +1291,6 @@ private MethodBuilder DefineMethodNoLock(string name, MethodAttributes attribute ThrowIfCreated(); -#if !FEATURE_DEFAULT_INTERFACES - if (!m_isHiddenGlobalType) - { - if (((m_iAttr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface) && - (attributes & MethodAttributes.Abstract) == 0 && (attributes & MethodAttributes.Static) == 0) - throw new ArgumentException(SR.Argument_BadAttributeOnInterfaceMethod); - } -#endif - // pass in Method attributes MethodBuilder method = new MethodBuilder( name, attributes, callingConvention, @@ -1359,10 +1350,10 @@ private MethodBuilder DefinePInvokeMethodHelper( Type[]? parameterTypes, Type[][]? parameterTypeRequiredCustomModifiers, Type[][]? parameterTypeOptionalCustomModifiers, CallingConvention nativeCallConv, CharSet nativeCharSet) { - CheckContext(returnType); - CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes); - CheckContext(parameterTypeRequiredCustomModifiers); - CheckContext(parameterTypeOptionalCustomModifiers); + AssemblyBuilder.CheckContext(returnType); + AssemblyBuilder.CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes); + AssemblyBuilder.CheckContext(parameterTypeRequiredCustomModifiers); + AssemblyBuilder.CheckContext(parameterTypeOptionalCustomModifiers); lock (SyncRoot) { @@ -1408,7 +1399,7 @@ private MethodBuilder DefinePInvokeMethodHelper( } m_listMethods.Add(method); - MethodToken token = method.GetToken(); + int token = method.MetadataToken; int linkFlags = 0; switch (nativeCallConv) @@ -1449,8 +1440,9 @@ private MethodBuilder DefinePInvokeMethodHelper( SetPInvokeData(new QCallModule(ref module), dllName, importName, - token.Token, + token, linkFlags); + method.SetToken(token); return method; @@ -1569,9 +1561,9 @@ public ConstructorBuilder DefineConstructor(MethodAttributes attributes, Calling private ConstructorBuilder DefineConstructorNoLock(MethodAttributes attributes, CallingConventions callingConvention, Type[]? parameterTypes, Type[][]? requiredCustomModifiers, Type[][]? optionalCustomModifiers) { - CheckContext(parameterTypes); - CheckContext(requiredCustomModifiers); - CheckContext(optionalCustomModifiers); + AssemblyBuilder.CheckContext(parameterTypes); + AssemblyBuilder.CheckContext(requiredCustomModifiers); + AssemblyBuilder.CheckContext(optionalCustomModifiers); ThrowIfCreated(); @@ -1613,8 +1605,8 @@ public TypeBuilder DefineNestedType(string name, TypeAttributes attr, [Dynamical lock (SyncRoot) { // Why do we only call CheckContext here? Why don't we call it in the other overloads? - CheckContext(parent); - CheckContext(interfaces); + AssemblyBuilder.CheckContext(parent); + AssemblyBuilder.CheckContext(interfaces); return DefineNestedTypeNoLock(name, attr, parent, interfaces, PackingSize.Unspecified, UnspecifiedTypeSize); } @@ -1686,8 +1678,8 @@ private FieldBuilder DefineFieldNoLock(string fieldName, Type type, Type[]? requ Type[]? optionalCustomModifiers, FieldAttributes attributes) { ThrowIfCreated(); - CheckContext(type); - CheckContext(requiredCustomModifiers); + AssemblyBuilder.CheckContext(type); + AssemblyBuilder.CheckContext(requiredCustomModifiers); if (m_enumUnderlyingType == null && IsEnum) { @@ -1780,10 +1772,10 @@ private PropertyBuilder DefinePropertyNoLock(string name, PropertyAttributes att if (name.Length == 0) throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); - CheckContext(returnType); - CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes); - CheckContext(parameterTypeRequiredCustomModifiers); - CheckContext(parameterTypeOptionalCustomModifiers); + AssemblyBuilder.CheckContext(returnType); + AssemblyBuilder.CheckContext(returnTypeRequiredCustomModifiers, returnTypeOptionalCustomModifiers, parameterTypes); + AssemblyBuilder.CheckContext(parameterTypeRequiredCustomModifiers); + AssemblyBuilder.CheckContext(parameterTypeOptionalCustomModifiers); SignatureHelper sigHelper; byte[] sigBytes; @@ -1801,13 +1793,13 @@ private PropertyBuilder DefinePropertyNoLock(string name, PropertyAttributes att ModuleBuilder module = m_module; - PropertyToken prToken = new PropertyToken(DefineProperty( + int prToken = DefineProperty( new QCallModule(ref module), - m_tdType.Token, + m_tdType, name, attributes, sigBytes, - sigLength)); + sigLength); // create the property builder now. return new PropertyBuilder( @@ -1838,22 +1830,22 @@ private EventBuilder DefineEventNoLock(string name, EventAttributes attributes, throw new ArgumentException(SR.Argument_IllegalName, nameof(name)); int tkType; - EventToken evToken; + int evToken; - CheckContext(eventtype); + AssemblyBuilder.CheckContext(eventtype); ThrowIfCreated(); - tkType = m_module.GetTypeTokenInternal(eventtype).Token; + tkType = m_module.GetTypeTokenInternal(eventtype); // Internal helpers to define property records ModuleBuilder module = m_module; - evToken = new EventToken(DefineEvent( + evToken = DefineEvent( new QCallModule(ref module), - m_tdType.Token, + m_tdType, name, attributes, - tkType)); + tkType); // create the property builder now. return new EventBuilder( @@ -1885,15 +1877,6 @@ private EventBuilder DefineEventNoLock(string name, EventAttributes attributes, } } - internal void CheckContext(params Type[]?[]? typess) - { - m_module.CheckContext(typess); - } - internal void CheckContext(params Type?[]? types) - { - m_module.CheckContext(types); - } - private TypeInfo? CreateTypeNoLock() { if (IsCreated()) @@ -1904,12 +1887,12 @@ internal void CheckContext(params Type?[]? types) int[] interfaceTokens = new int[m_typeInterfaces.Count]; for (int i = 0; i < m_typeInterfaces.Count; i++) { - interfaceTokens[i] = m_module.GetTypeTokenInternal(m_typeInterfaces[i]).Token; + interfaceTokens[i] = m_module.GetTypeTokenInternal(m_typeInterfaces[i]); } int tkParent = 0; if (m_typeParent != null) - tkParent = m_module.GetTypeTokenInternal(m_typeParent).Token; + tkParent = m_module.GetTypeTokenInternal(m_typeParent); ModuleBuilder module = m_module; @@ -1929,17 +1912,17 @@ internal void CheckContext(params Type?[]? types) for (int i = 0; i < m_typeInterfaces.Count; i++) { - constraints[i] = m_module.GetTypeTokenInternal(m_typeInterfaces[i]).Token; + constraints[i] = m_module.GetTypeTokenInternal(m_typeInterfaces[i]); } - int declMember = m_declMeth == null ? m_DeclaringType!.m_tdType.Token : m_declMeth.GetToken().Token; - m_tdType = new TypeToken(DefineGenericParam(new QCallModule(ref module), - m_strName!, declMember, m_genParamAttributes, m_genParamPos, constraints)); + int declMember = m_declMeth == null ? m_DeclaringType!.m_tdType : m_declMeth.MetadataToken; + m_tdType = DefineGenericParam(new QCallModule(ref module), + m_strName!, declMember, m_genParamAttributes, m_genParamPos, constraints); if (m_ca != null) { foreach (CustAttr ca in m_ca) - ca.Bake(m_module, MetadataTokenInternal); + ca.Bake(m_module, MetadataToken); } m_hasBeenCreated = true; @@ -1951,9 +1934,9 @@ internal void CheckContext(params Type?[]? types) else { // Check for global typebuilder - if (((m_tdType.Token & 0x00FFFFFF) != 0) && ((tkParent & 0x00FFFFFF) != 0)) + if (((m_tdType & 0x00FFFFFF) != 0) && ((tkParent & 0x00FFFFFF) != 0)) { - SetParentType(new QCallModule(ref module), m_tdType.Token, tkParent); + SetParentType(new QCallModule(ref module), m_tdType, tkParent); } if (m_inst != null) @@ -1982,7 +1965,9 @@ internal void CheckContext(params Type?[]? types) MethodBuilder meth = m_listMethods[i]; if (meth.IsGenericMethodDefinition) - meth.GetToken(); // Doubles as "CreateMethod" for MethodBuilder -- analogous to CreateType() + { + int dummy = meth.MetadataToken; // Doubles as "CreateMethod" for MethodBuilder -- analogous to CreateType() + } MethodAttributes methodAttrs = meth.Attributes; @@ -2036,7 +2021,7 @@ internal void CheckContext(params Type?[]? types) ExceptionHandler[]? exceptions = meth.GetExceptionHandlers(); int[]? tokenFixups = meth.GetTokenFixups(); - SetMethodIL(new QCallModule(ref module), meth.GetToken().Token, meth.InitLocals, + SetMethodIL(new QCallModule(ref module), meth.MetadataToken, meth.InitLocals, body, (body != null) ? body.Length : 0, localSig, sigLength, maxStack, exceptions, (exceptions != null) ? exceptions.Length : 0, @@ -2054,7 +2039,7 @@ internal void CheckContext(params Type?[]? types) // Terminate the process. RuntimeType? cls = null; - TermCreateClass(new QCallModule(ref module), m_tdType.Token, ObjectHandleOnStack.Create(ref cls)); + TermCreateClass(new QCallModule(ref module), m_tdType, ObjectHandleOnStack.Create(ref cls)); if (!m_isHiddenGlobalType) { @@ -2087,7 +2072,7 @@ public void SetParent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes if (parent != null) { - CheckContext(parent); + AssemblyBuilder.CheckContext(parent); if (parent.IsInterface) throw new ArgumentException(SR.Argument_CannotSetParentToInterface); @@ -2118,18 +2103,18 @@ public void AddInterfaceImplementation([DynamicallyAccessedMembers(DynamicallyAc throw new ArgumentNullException(nameof(interfaceType)); } - CheckContext(interfaceType); + AssemblyBuilder.CheckContext(interfaceType); ThrowIfCreated(); - TypeToken tkInterface = m_module.GetTypeTokenInternal(interfaceType); + int tkInterface = m_module.GetTypeTokenInternal(interfaceType); ModuleBuilder module = m_module; - AddInterfaceImpl(new QCallModule(ref module), m_tdType.Token, tkInterface.Token); + AddInterfaceImpl(new QCallModule(ref module), m_tdType, tkInterface); m_typeInterfaces!.Add(interfaceType); } - public TypeToken TypeToken + internal int TypeToken { get { @@ -2148,7 +2133,7 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) if (binaryAttribute == null) throw new ArgumentNullException(nameof(binaryAttribute)); - DefineCustomAttribute(m_module, m_tdType.Token, ((ModuleBuilder)m_module).GetConstructorToken(con).Token, + DefineCustomAttribute(m_module, m_tdType, ((ModuleBuilder)m_module).GetConstructorToken(con), binaryAttribute, false, false); } @@ -2157,7 +2142,7 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder) if (customBuilder == null) throw new ArgumentNullException(nameof(customBuilder)); - customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, m_tdType.Token); + customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, m_tdType); } #endregion diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs index 4e3844dac940..44774438e0c2 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs @@ -106,6 +106,11 @@ public override Type MakeArrayType(int rank) public override string? FullName => m_strFullQualName ??= TypeNameBuilder.ToString(this, TypeNameBuilder.Format.FullName); public override string? Namespace => m_type.Namespace; public override string? AssemblyQualifiedName => TypeNameBuilder.ToString(this, TypeNameBuilder.Format.AssemblyQualifiedName); + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2055:UnrecognizedReflectionPatter", + Justification = "The entire TypeBuilderInstantiation is serving the MakeGenericType implementation. " + + "Currently this is not supported by linker. Once it is supported the outercall (Type.MakeGenericType)" + + "will validate that the types fullfill the necessary requirements of annotations on type parameters." + + "As such the actual internals of the implementation are not interesting.")] private Type Substitute(Type[] substitutes) { Type[] inst = GetGenericArguments(); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs index 4443867b1b52..a500e1ddf25a 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs @@ -122,14 +122,14 @@ internal override Type GetReturnType() public override object[] GetCustomAttributes(bool inherit) { return m_ctor.GetCustomAttributes(inherit); } public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return m_ctor.GetCustomAttributes(attributeType, inherit); } public override bool IsDefined(Type attributeType, bool inherit) { return m_ctor.IsDefined(attributeType, inherit); } - internal int MetadataTokenInternal + public override int MetadataToken { get { ConstructorBuilder? cb = m_ctor as ConstructorBuilder; if (cb != null) - return cb.MetadataTokenInternal; + return cb.MetadataToken; else { Debug.Assert(m_ctor is RuntimeConstructorInfo); @@ -223,14 +223,14 @@ internal FieldOnTypeBuilderInstantiation(FieldInfo field, TypeBuilderInstantiati public override object[] GetCustomAttributes(bool inherit) { return m_field.GetCustomAttributes(inherit); } public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return m_field.GetCustomAttributes(attributeType, inherit); } public override bool IsDefined(Type attributeType, bool inherit) { return m_field.IsDefined(attributeType, inherit); } - internal int MetadataTokenInternal + public override int MetadataToken { get { FieldBuilder? fb = m_field as FieldBuilder; if (fb != null) - return fb.MetadataTokenInternal; + return fb.MetadataToken; else { Debug.Assert(m_field is RuntimeFieldInfo); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/INVOCATION_FLAGS.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/INVOCATION_FLAGS.cs index e7d9b97ac5c6..b6a55518914a 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/INVOCATION_FLAGS.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/INVOCATION_FLAGS.cs @@ -14,7 +14,8 @@ internal enum INVOCATION_FLAGS : uint INVOCATION_FLAGS_INITIALIZED = 0x00000001, // it's used for both method and field to signify that no access is allowed INVOCATION_FLAGS_NO_INVOKE = 0x00000002, - /* unused 0x00000004 */ + // Set for static ctors, to ensure that the static ctor is run as a static ctor before it is explicitly executed via reflection + INVOCATION_FLAGS_RUN_CLASS_CONSTRUCTOR = 0x00000004, // Set for static ctors and ctors on abstract types, which // can be invoked only if the "this" object is provided (even if it's null). INVOCATION_FLAGS_NO_CTOR_INVOKE = 0x00000008, diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs index d2476660973f..20a72464b3ac 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs @@ -69,19 +69,33 @@ public override event ModuleResolveEventHandler? ModuleResolve } [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] - private static extern void GetCodeBase(QCallAssembly assembly, - bool copiedName, + private static extern bool GetCodeBase(QCallAssembly assembly, StringHandleOnStack retString); - internal string? GetCodeBase(bool copiedName) + internal string? GetCodeBase() { string? codeBase = null; RuntimeAssembly runtimeAssembly = this; - GetCodeBase(new QCallAssembly(ref runtimeAssembly), copiedName, new StringHandleOnStack(ref codeBase)); - return codeBase; + if (GetCodeBase(new QCallAssembly(ref runtimeAssembly), new StringHandleOnStack(ref codeBase))) + { + return codeBase; + } + return null; } - public override string? CodeBase => GetCodeBase(false); + public override string? CodeBase + { + get + { + var codeBase = GetCodeBase(); + if (codeBase is null) + { + // Not supported if the assembly was loaded from memory + throw new NotSupportedException(SR.NotSupported_CodeBase); + } + return codeBase; + } + } internal RuntimeAssembly GetNativeHandle() => this; @@ -90,7 +104,7 @@ private static extern void GetCodeBase(QCallAssembly assembly, // is returned. public override AssemblyName GetName(bool copiedName) { - string? codeBase = GetCodeBase(copiedName); + string? codeBase = GetCodeBase(); var an = new AssemblyName(GetSimpleName(), GetPublicKey(), @@ -360,6 +374,12 @@ private static extern void InternalLoad(ObjectHandleOnStack assemblyName, // given name. (Name should not include path.) public override FileStream? GetFile(string name) { + if (Location.Length == 0) + { + // Throw if the assembly was loaded from memory, indicated by Location returning an empty string + throw new FileNotFoundException(SR.IO_NoFileTableInInMemoryAssemblies); + } + RuntimeModule? m = (RuntimeModule?)GetModule(name); if (m == null) return null; @@ -371,6 +391,12 @@ private static extern void InternalLoad(ObjectHandleOnStack assemblyName, public override FileStream[] GetFiles(bool getResourceModules) { + if (Location.Length == 0) + { + // Throw if the assembly was loaded from memory, indicated by Location returning an empty string + throw new FileNotFoundException(SR.IO_NoFileTableInInMemoryAssemblies); + } + Module[] m = GetModules(getResourceModules); FileStream[] fs = new FileStream[m.Length]; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.cs index 9d0086ca4425..20162964af46 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; +using System.Runtime.CompilerServices; using System.Text; using RuntimeTypeCache = System.RuntimeType.RuntimeTypeCache; @@ -47,7 +48,12 @@ internal INVOCATION_FLAGS InvocationFlags // We don't need other flags if this method cannot be invoked invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_NO_INVOKE; } - else if (IsStatic || declaringType != null && declaringType.IsAbstract) + else if (IsStatic) + { + invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_RUN_CLASS_CONSTRUCTOR | + INVOCATION_FLAGS.INVOCATION_FLAGS_NO_CTOR_INVOKE; + } + else if (declaringType != null && declaringType.IsAbstract) { invocationFlags |= INVOCATION_FLAGS.INVOCATION_FLAGS_NO_CTOR_INVOKE; } @@ -280,6 +286,21 @@ internal void ThrowNoInvokeException() // check basic method consistency. This call will throw if there are problems in the target/method relationship CheckConsistency(obj); + if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_RUN_CLASS_CONSTRUCTOR) != 0) + { + // Run the class constructor through the class constructor mechanism instead of the Invoke path. + // This avoids allowing mutation of readonly static fields, and initializes the type correctly. + + var declaringType = DeclaringType; + + if (declaringType != null) + RuntimeHelpers.RunClassConstructor(declaringType.TypeHandle); + else + RuntimeHelpers.RunModuleConstructor(Module.ModuleHandle); + + return null; + } + Signature sig = Signature; // get the signature @@ -302,6 +323,7 @@ internal void ThrowNoInvokeException() return RuntimeMethodHandle.InvokeMethod(obj, null, sig, false, wrapExceptions); } + [RequiresUnreferencedCode("Trimming may change method bodies. For example it can change some instructions, remove branches or local variables.")] public override MethodBody? GetMethodBody() { RuntimeMethodBody? mb = RuntimeMethodHandle.GetMethodBody(this, ReflectedTypeInternal); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeExceptionHandlingClause.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeExceptionHandlingClause.cs index b8f5df8b4539..ff5ea23c21ef 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeExceptionHandlingClause.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeExceptionHandlingClause.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.Diagnostics.CodeAnalysis; using System.Globalization; namespace System.Reflection @@ -38,6 +39,11 @@ public override int FilterOffset public override Type? CatchType { + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", + Justification = "Module.ResolveType is marked as RequiresUnreferencedCode because it relies on tokens" + + "which are not guaranteed to be stable across trimming. So if somebody harcodes a token it could break." + + "The usage here is not like that as all these tokes come from existing metadata loaded from some IL" + + "and so trimming has no effect (the tokens are read AFTER trimming occured).")] get { if (_flags != ExceptionHandlingClauseOptions.Clause) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs index d0441ffbfa8f..9dfffd64a2e2 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs @@ -318,6 +318,7 @@ public override MethodImplAttributes GetMethodImplementationFlags() public override CallingConventions CallingConvention => Signature.CallingConvention; + [RequiresUnreferencedCode("Trimming may change method bodies. For example it can change some instructions, remove branches or local variables.")] public override MethodBody? GetMethodBody() { RuntimeMethodBody? mb = RuntimeMethodHandle.GetMethodBody(this, ReflectedTypeInternal); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs index ef1f82b58f36..b7e6a58f1fe4 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/RuntimePropertyInfo.cs @@ -226,7 +226,7 @@ public override MethodInfo[] GetAccessors(bool nonPublic) if (Associates.IncludeAccessor(m_setterMethod, nonPublic)) accessorList.Add(m_setterMethod!); - if ((object?)m_otherMethod != null) + if (m_otherMethod is not null) { for (int i = 0; i < m_otherMethod.Length; i++) { diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs index 5c9a38e2a6f7..6b6e4639bfec 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs @@ -286,9 +286,6 @@ public static IntPtr AllocateTypeAssociatedMemory(Type type, int size) [MethodImpl(MethodImplOptions.InternalCall)] private static extern IntPtr AllocTailCallArgBuffer(int size, IntPtr gcDesc); - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void FreeTailCallArgBuffer(); - [MethodImpl(MethodImplOptions.InternalCall)] private static unsafe extern TailCallTls* GetTailCallInfo(IntPtr retAddrSlot, IntPtr* retAddr); @@ -323,6 +320,12 @@ private static unsafe void DispatchTailCalls( finally { tls->Frame = prevFrame; + + // If the arg buffer is reporting inst argument, it is safe to abandon it now + if (tls->ArgBuffer != IntPtr.Zero && *(int*)tls->ArgBuffer == 1 /* TAILCALLARGBUFFER_INSTARG_ONLY */) + { + *(int*)tls->ArgBuffer = 2 /* TAILCALLARGBUFFER_ABANDONED */; + } } } @@ -481,9 +484,6 @@ internal unsafe struct TailCallTls { public PortableTailCallFrame* Frame; public IntPtr ArgBuffer; - private IntPtr _argBufferSize; - private IntPtr _argBufferGCDesc; - private fixed byte _argBufferInline[64]; } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelper.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelper.cs index 368d942f403a..93fd276b9d26 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelper.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelper.cs @@ -81,12 +81,15 @@ // means that the problem is already quite complex and we should not be dealing with it - see // ComEventsMethod.Invoke +using System.Runtime.Versioning; + namespace System.Runtime.InteropServices { /// /// The static methods provided in ComEventsHelper allow using .NET delegates to subscribe to events /// raised COM objects. /// + [SupportedOSPlatform("windows")] public static class ComEventsHelper { /// diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs index d8a0ea49e7d5..ac434ad00d9b 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsInfo.cs @@ -1,8 +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.Runtime.Versioning; + namespace System.Runtime.InteropServices { + [SupportedOSPlatform("windows")] internal class ComEventsInfo { private ComEventsSink? _sinks; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index 1b0c1a717487..1e377a9978f4 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Threading; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using Internal.Runtime.CompilerServices; namespace System.Runtime.InteropServices @@ -68,6 +69,7 @@ internal enum ComWrappersScenario /// /// Class for managing wrappers of COM IUnknown types. /// + [SupportedOSPlatform("windows")] [CLSCompliant(false)] public abstract partial class ComWrappers { diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/ComDataHelpers.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/ComDataHelpers.cs index e871eca76361..d0e230a6e564 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/ComDataHelpers.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/ComDataHelpers.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.Runtime.Versioning; + namespace System.Runtime.InteropServices.CustomMarshalers { internal static class ComDataHelpers { + [SupportedOSPlatform("windows")] public static TView GetOrCreateManagedViewFromComData(object comObject, Func createCallback) { object key = typeof(TView); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs index 10034bae86a0..3bd63b33612f 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableToDispatchMarshaler.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Runtime.Versioning; namespace System.Runtime.InteropServices.CustomMarshalers { + [SupportedOSPlatform("windows")] internal class EnumerableToDispatchMarshaler : ICustomMarshaler { private static readonly EnumerableToDispatchMarshaler s_enumerableToDispatchMarshaler = new EnumerableToDispatchMarshaler(); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs index 06f1f083ce20..a64da6919c2e 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs @@ -1,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.Diagnostics; using System.Runtime.InteropServices.ComTypes; namespace System.Runtime.InteropServices.CustomMarshalers @@ -38,6 +39,7 @@ public System.Collections.IEnumerator GetEnumerator() IntPtr.Zero); } + Debug.Assert(OperatingSystem.IsWindows()); IntPtr enumVariantPtr = IntPtr.Zero; try { diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs index 61e65f833d89..b4718f5e7c28 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumeratorToEnumVariantMarshaler.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Runtime.Versioning; using ComTypes = System.Runtime.InteropServices.ComTypes; namespace System.Runtime.InteropServices.CustomMarshalers { + [SupportedOSPlatform("windows")] internal class EnumeratorToEnumVariantMarshaler : ICustomMarshaler { private static readonly EnumeratorToEnumVariantMarshaler s_enumeratorToEnumVariantMarshaler = new EnumeratorToEnumVariantMarshaler(); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Expando/IExpando.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Expando/IExpando.cs deleted file mode 100644 index bbe6e24b645b..000000000000 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Expando/IExpando.cs +++ /dev/null @@ -1,27 +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.Reflection; - -namespace System.Runtime.InteropServices.Expando -{ - /// - /// IExpando is an interface which allows Objects implementing this interface to - /// support the ability to modify the object by adding and removing members, - /// represented by MemberInfo objects. - /// - [Guid("AFBF15E6-C37C-11d2-B88E-00A0C9B471B8")] - internal interface IExpando : IReflect - { - /// - /// Add a new Field to the reflection object. The field has - /// name as its name. - /// - FieldInfo AddField(string name); - - /// - /// Removes the specified member. - /// - void RemoveMember(MemberInfo m); - } -} diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs index 33d43881adb3..22a918584a56 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices.ComTypes; +using System.Runtime.Versioning; using System.StubHelpers; namespace System.Runtime.InteropServices @@ -25,7 +26,7 @@ public static partial class Marshal [MethodImpl(MethodImplOptions.InternalCall)] internal static extern int SizeOfHelper(Type t, bool throwIfNotMarshalable); - [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2006:UnrecognizedReflectionPattern", + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2070:UnrecognizedReflectionPattern", Justification = "Trimming doesn't affect types eligible for marshalling. Different exception for invalid inputs doesn't matter.")] public static IntPtr OffsetOf(Type t, string fieldName) { @@ -249,52 +250,6 @@ public static IntPtr GetHINSTANCE(Module m) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern Exception GetExceptionForHRInternal(int errorCode, IntPtr errorInfo); - public static IntPtr AllocHGlobal(IntPtr cb) - { - // For backwards compatibility on 32 bit platforms, ensure we pass values between - // int.MaxValue and uint.MaxValue to Windows. If the binary has had the - // LARGEADDRESSAWARE bit set in the PE header, it may get 3 or 4 GB of user mode - // address space. It is remotely that those allocations could have succeeded, - // though I couldn't reproduce that. In either case, that means we should continue - // throwing an OOM instead of an ArgumentOutOfRangeException for "negative" amounts of memory. - UIntPtr numBytes; -#if TARGET_64BIT - numBytes = new UIntPtr(unchecked((ulong)cb.ToInt64())); -#else // 32 - numBytes = new UIntPtr(unchecked((uint)cb.ToInt32())); -#endif - - IntPtr pNewMem = Interop.Kernel32.LocalAlloc(Interop.Kernel32.LMEM_FIXED, unchecked(numBytes)); - if (pNewMem == IntPtr.Zero) - { - throw new OutOfMemoryException(); - } - - return pNewMem; - } - - public static void FreeHGlobal(IntPtr hglobal) - { - if (!IsNullOrWin32Atom(hglobal)) - { - if (IntPtr.Zero != Interop.Kernel32.LocalFree(hglobal)) - { - ThrowExceptionForHR(GetHRForLastWin32Error()); - } - } - } - - public static IntPtr ReAllocHGlobal(IntPtr pv, IntPtr cb) - { - IntPtr pNewMem = Interop.Kernel32.LocalReAlloc(pv, cb, Interop.Kernel32.LMEM_MOVEABLE); - if (pNewMem == IntPtr.Zero) - { - throw new OutOfMemoryException(); - } - - return pNewMem; - } - #if FEATURE_COMINTEROP /// /// Converts the CLR exception to an HRESULT. This function also sets @@ -306,6 +261,7 @@ public static IntPtr ReAllocHGlobal(IntPtr pv, IntPtr cb) /// /// Given a managed object that wraps an ITypeInfo, return its name. /// + [SupportedOSPlatform("windows")] public static string GetTypeInfoName(ITypeInfo typeInfo) { if (typeInfo is null) @@ -319,12 +275,24 @@ public static string GetTypeInfoName(ITypeInfo typeInfo) // This method is identical to Type.GetTypeFromCLSID. Since it's interop specific, we expose it // on Marshal for more consistent API surface. - public static Type? GetTypeFromCLSID(Guid clsid) => RuntimeType.GetTypeFromCLSIDImpl(clsid, null, throwOnError: false); + internal static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError) + { + // Note: "throwOnError" is a vacuous parameter. Any errors due to the CLSID not being registered or the server not being found will happen + // on the Activator.CreateInstance() call. GetTypeFromCLSID() merely wraps the data in a Type object without any validation. + + Type? type = null; + GetTypeFromCLSID(clsid, server, ObjectHandleOnStack.Create(ref type)); + return type; + } + + [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] + private static extern void GetTypeFromCLSID(in Guid clsid, string? server, ObjectHandleOnStack retType); /// /// Return the IUnknown* for an Object if the current context is the one /// where the RCW was first seen. Will return null otherwise. /// + [SupportedOSPlatform("windows")] public static IntPtr /* IUnknown* */ GetIUnknownForObject(object o) { if (o is null) @@ -348,6 +316,7 @@ public static string GetTypeInfoName(ITypeInfo typeInfo) /// /// Return the IDispatch* for an Object. /// + [SupportedOSPlatform("windows")] public static IntPtr /* IDispatch */ GetIDispatchForObject(object o) { if (o is null) @@ -365,6 +334,7 @@ public static string GetTypeInfoName(ITypeInfo typeInfo) /// Return the IUnknown* representing the interface for the Object. /// Object o should support Type T /// + [SupportedOSPlatform("windows")] public static IntPtr /* IUnknown* */ GetComInterfaceForObject(object o, Type T) { if (o is null) @@ -380,6 +350,7 @@ public static string GetTypeInfoName(ITypeInfo typeInfo) return GetComInterfaceForObjectNative(o, T, false, true); } + [SupportedOSPlatform("windows")] public static IntPtr GetComInterfaceForObject([DisallowNull] T o) => GetComInterfaceForObject(o!, typeof(TInterface)); /// @@ -387,6 +358,7 @@ public static string GetTypeInfoName(ITypeInfo typeInfo) /// Object o should support Type T, it refer the value of mode to /// invoke customized QueryInterface or not. /// + [SupportedOSPlatform("windows")] public static IntPtr /* IUnknown* */ GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode) { if (o is null) @@ -409,6 +381,7 @@ public static string GetTypeInfoName(ITypeInfo typeInfo) /// /// Return the managed object representing the IUnknown* /// + [SupportedOSPlatform("windows")] public static object GetObjectForIUnknown(IntPtr /* IUnknown* */ pUnk) { if (pUnk == IntPtr.Zero) @@ -422,6 +395,7 @@ public static object GetObjectForIUnknown(IntPtr /* IUnknown* */ pUnk) [MethodImpl(MethodImplOptions.InternalCall)] private static extern object GetObjectForIUnknownNative(IntPtr /* IUnknown* */ pUnk); + [SupportedOSPlatform("windows")] public static object GetUniqueObjectForIUnknown(IntPtr unknown) { if (unknown == IntPtr.Zero) @@ -445,12 +419,15 @@ public static object GetUniqueObjectForIUnknown(IntPtr unknown) /// Return an Object for IUnknown, using the Type T. /// Type T should be either a COM imported Type or a sub-type of COM imported Type /// + [SupportedOSPlatform("windows")] [MethodImpl(MethodImplOptions.InternalCall)] public static extern object GetTypedObjectForIUnknown(IntPtr /* IUnknown* */ pUnk, Type t); + [SupportedOSPlatform("windows")] [MethodImpl(MethodImplOptions.InternalCall)] public static extern IntPtr CreateAggregatedObject(IntPtr pOuter, object o); + [SupportedOSPlatform("windows")] public static IntPtr CreateAggregatedObject(IntPtr pOuter, T o) where T : notnull { return CreateAggregatedObject(pOuter, (object)o); @@ -468,87 +445,11 @@ public static IntPtr CreateAggregatedObject(IntPtr pOuter, T o) where T : not [MethodImpl(MethodImplOptions.InternalCall)] public static extern bool IsComObject(object o); -#endif // FEATURE_COMINTEROP - - public static IntPtr AllocCoTaskMem(int cb) - { - IntPtr pNewMem = Interop.Ole32.CoTaskMemAlloc(new UIntPtr((uint)cb)); - if (pNewMem == IntPtr.Zero) - { - throw new OutOfMemoryException(); - } - - return pNewMem; - } - - public static void FreeCoTaskMem(IntPtr ptr) - { - if (!IsNullOrWin32Atom(ptr)) - { - Interop.Ole32.CoTaskMemFree(ptr); - } - } - - public static IntPtr ReAllocCoTaskMem(IntPtr pv, int cb) - { - IntPtr pNewMem = Interop.Ole32.CoTaskMemRealloc(pv, new UIntPtr((uint)cb)); - if (pNewMem == IntPtr.Zero && cb != 0) - { - throw new OutOfMemoryException(); - } - - return pNewMem; - } - - internal static IntPtr AllocBSTR(int length) - { - IntPtr bstr = Interop.OleAut32.SysAllocStringLen(null, length); - if (bstr == IntPtr.Zero) - { - throw new OutOfMemoryException(); - } - return bstr; - } - - public static void FreeBSTR(IntPtr ptr) - { - if (!IsNullOrWin32Atom(ptr)) - { - Interop.OleAut32.SysFreeString(ptr); - } - } - - public static IntPtr StringToBSTR(string? s) - { - if (s is null) - { - return IntPtr.Zero; - } - - IntPtr bstr = Interop.OleAut32.SysAllocStringLen(s, s.Length); - if (bstr == IntPtr.Zero) - { - throw new OutOfMemoryException(); - } - - return bstr; - } - - public static string PtrToStringBSTR(IntPtr ptr) - { - if (ptr == IntPtr.Zero) - { - throw new ArgumentNullException(nameof(ptr)); - } - - return PtrToStringUni(ptr, (int)(SysStringByteLen(ptr) / sizeof(char))); - } - -#if FEATURE_COMINTEROP /// /// Release the COM component and if the reference hits 0 zombie this object. /// Further usage of this Object might throw an exception /// + [SupportedOSPlatform("windows")] public static int ReleaseComObject(object o) { if (o is null) @@ -571,6 +472,7 @@ public static int ReleaseComObject(object o) /// Release the COM component and zombie this object. /// Further usage of this Object might throw an exception /// + [SupportedOSPlatform("windows")] public static int FinalReleaseComObject(object o) { if (o is null) @@ -589,6 +491,7 @@ public static int FinalReleaseComObject(object o) [MethodImpl(MethodImplOptions.InternalCall)] internal static extern void InternalFinalReleaseComObject(object o); + [SupportedOSPlatform("windows")] public static object? GetComObjectData(object obj, object key) { if (obj is null) @@ -614,6 +517,7 @@ public static int FinalReleaseComObject(object o) /// false if the data could not be added because there already was data for the /// specified key. /// + [SupportedOSPlatform("windows")] public static bool SetComObjectData(object obj, object key, object? data) { if (obj is null) @@ -637,6 +541,7 @@ public static bool SetComObjectData(object obj, object key, object? data) /// This method takes the given COM object and wraps it in an object /// of the specified type. The type must be derived from __ComObject. /// + [SupportedOSPlatform("windows")] [return: NotNullIfNotNull("o")] public static object? CreateWrapperOfType(object? o, Type t) { @@ -680,14 +585,15 @@ public static bool SetComObjectData(object obj, object key, object? data) if (!SetComObjectData(o, t, Wrapper)) { // Another thead already cached the wrapper so use that one instead. - Wrapper = GetComObjectData(o, t); + Wrapper = GetComObjectData(o, t)!; } } return Wrapper; } - public static TWrapper CreateWrapperOfType([AllowNull] T o) + [SupportedOSPlatform("windows")] + public static TWrapper CreateWrapperOfType(T? o) { return (TWrapper)CreateWrapperOfType(o, typeof(TWrapper))!; } @@ -701,6 +607,7 @@ public static TWrapper CreateWrapperOfType([AllowNull] T o) [MethodImpl(MethodImplOptions.InternalCall)] public static extern bool IsTypeVisibleFromCom(Type t); + [SupportedOSPlatform("windows")] public static unsafe int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr ppv) { if (pUnk == IntPtr.Zero) @@ -709,46 +616,53 @@ public static unsafe int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr pp fixed (Guid* pIID = &iid) fixed (IntPtr* p = &ppv) { - return ((delegate * stdcall )(*(*(void***)pUnk + 0 /* IUnknown.QueryInterface slot */)))(pUnk, pIID, p); + return ((delegate* unmanaged)(*(*(void***)pUnk + 0 /* IUnknown.QueryInterface slot */)))(pUnk, pIID, p); } } + [SupportedOSPlatform("windows")] public static unsafe int AddRef(IntPtr pUnk) { if (pUnk == IntPtr.Zero) throw new ArgumentNullException(nameof(pUnk)); - return ((delegate * stdcall )(*(*(void***)pUnk + 1 /* IUnknown.AddRef slot */)))(pUnk); + return ((delegate* unmanaged)(*(*(void***)pUnk + 1 /* IUnknown.AddRef slot */)))(pUnk); } + [SupportedOSPlatform("windows")] public static unsafe int Release(IntPtr pUnk) { if (pUnk == IntPtr.Zero) throw new ArgumentNullException(nameof(pUnk)); - return ((delegate * stdcall )(*(*(void***)pUnk + 2 /* IUnknown.Release slot */)))(pUnk); + return ((delegate* unmanaged)(*(*(void***)pUnk + 2 /* IUnknown.Release slot */)))(pUnk); } + [SupportedOSPlatform("windows")] [MethodImpl(MethodImplOptions.InternalCall)] public static extern void GetNativeVariantForObject(object? obj, /* VARIANT * */ IntPtr pDstNativeVariant); - public static void GetNativeVariantForObject([AllowNull] T obj, IntPtr pDstNativeVariant) + [SupportedOSPlatform("windows")] + public static void GetNativeVariantForObject(T? obj, IntPtr pDstNativeVariant) { GetNativeVariantForObject((object?)obj, pDstNativeVariant); } + [SupportedOSPlatform("windows")] [MethodImpl(MethodImplOptions.InternalCall)] public static extern object? GetObjectForNativeVariant(/* VARIANT * */ IntPtr pSrcNativeVariant); - [return: MaybeNull] - public static T GetObjectForNativeVariant(IntPtr pSrcNativeVariant) + [SupportedOSPlatform("windows")] + public static T? GetObjectForNativeVariant(IntPtr pSrcNativeVariant) { - return (T)GetObjectForNativeVariant(pSrcNativeVariant)!; + return (T?)GetObjectForNativeVariant(pSrcNativeVariant); } + [SupportedOSPlatform("windows")] [MethodImpl(MethodImplOptions.InternalCall)] public static extern object?[] GetObjectsForNativeVariants(/* VARIANT * */ IntPtr aSrcNativeVariant, int cVars); + [SupportedOSPlatform("windows")] public static T[] GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars) { object?[] objects = GetObjectsForNativeVariants(aSrcNativeVariant, cVars); @@ -763,15 +677,18 @@ public static T[] GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int c /// Returns the first valid COM slot that GetMethodInfoForSlot will work on /// This will be 3 for IUnknown based interfaces and 7 for IDispatch based interfaces. /// + [SupportedOSPlatform("windows")] [MethodImpl(MethodImplOptions.InternalCall)] public static extern int GetStartComSlot(Type t); /// /// Returns the last valid COM slot that GetMethodInfoForSlot will work on. /// + [SupportedOSPlatform("windows")] [MethodImpl(MethodImplOptions.InternalCall)] public static extern int GetEndComSlot(Type t); + [SupportedOSPlatform("windows")] public static object BindToMoniker(string monikerName) { CreateBindCtx(0, out IBindCtx bindctx); @@ -791,6 +708,7 @@ public static object BindToMoniker(string monikerName) [DllImport(Interop.Libraries.Ole32, PreserveSig = false)] private static extern void BindMoniker(IMoniker pmk, uint grfOpt, ref Guid iidResult, [MarshalAs(UnmanagedType.Interface)] out object ppvResult); + [SupportedOSPlatform("windows")] [MethodImpl(MethodImplOptions.InternalCall)] public static extern void ChangeWrapperHandleStrength(object otp, bool fIsWeak); #endif // FEATURE_COMINTEROP diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.CoreCLR.cs new file mode 100644 index 000000000000..e523487f0d6b --- /dev/null +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.CoreCLR.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.CompilerServices; +using System.Runtime.InteropServices; + +namespace System.Runtime.Intrinsics.X86 +{ + public abstract partial class X86Base + { + [DllImport(RuntimeHelpers.QCall)] + private static extern unsafe void __cpuidex(int* cpuInfo, int functionId, int subFunctionId); + } +} diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Versioning/CompatibilitySwitch.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Versioning/CompatibilitySwitch.cs index 3b69f789e61c..d90f81d48e98 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Versioning/CompatibilitySwitch.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Versioning/CompatibilitySwitch.cs @@ -7,24 +7,7 @@ namespace System.Runtime.Versioning { internal static class CompatibilitySwitch { - /* This class contains 3 sets of api: - * 1. internal apis : These apis are supposed to be used by mscorlib.dll and other assemblies which use the section in config - * These apis query for the value of quirk not only in windows quirk DB but also in runtime section of config files, - * registry and environment vars. - * 2. public apis : These apis are supposed to be used by FX assemblies which do not read the runtime section of config files and have - * have their own section in config files or do not use configs at all. - * - * 3. specialized apis: These apis are defined in order to retrieve a specific value defined in CLR Config. That value can have specific look-up rules - * for the order and location of the config sources used. - * - * These apis are for internal use only for FX assemblies. It has not been decided if they can be used by OOB components due to EULA restrictions - */ - internal static string? GetValueInternal(string compatibilitySwitchName) - { - return GetValueInternalCall(compatibilitySwitchName, false); - } - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern string? GetValueInternalCall(string compatibilitySwitchName, bool onlyDB); + internal static extern string? GetValueInternal(string compatibilitySwitchName); } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeHandles.cs index 965df43cfaf3..adc808e43de5 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeHandles.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeHandles.cs @@ -126,10 +126,7 @@ internal static bool IsTypeDefinition(RuntimeType type) internal static bool IsPrimitive(RuntimeType type) { - CorElementType corElemType = GetCorElementType(type); - return (corElemType >= CorElementType.ELEMENT_TYPE_BOOLEAN && corElemType <= CorElementType.ELEMENT_TYPE_R8) || - corElemType == CorElementType.ELEMENT_TYPE_I || - corElemType == CorElementType.ELEMENT_TYPE_U; + return RuntimeHelpers.IsPrimitiveType(GetCorElementType(type)); } internal static bool IsByRef(RuntimeType type) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs index a883bad112b3..744efa515e3c 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs @@ -234,6 +234,48 @@ internal MemberInfoCache(RuntimeTypeCache runtimeTypeCache) internal MethodBase AddMethod(RuntimeType declaringType, RuntimeMethodHandleInternal method, CacheType cacheType) { + // First, see if we've already cached an RuntimeMethodInfo or + // RuntimeConstructorInfo that corresponds to this member. Since another + // thread could be updating the backing store at the same time it's + // possible that the check below will result in a false negative. That's + // ok; we'll handle any concurrency issues in the later call to Insert. + + T?[]? allMembersLocal = m_allMembers; + if (allMembersLocal != null) + { + // if not a Method or a Constructor, fall through + if (cacheType == CacheType.Method) + { + foreach (T? candidate in allMembersLocal) + { + if (candidate is null) + { + break; // end of list; stop iteration and fall through to slower path + } + + if (candidate is RuntimeMethodInfo candidateRMI && candidateRMI.MethodHandle.Value == method.Value) + { + return candidateRMI; // match! + } + } + } + else if (cacheType == CacheType.Constructor) + { + foreach (T? candidate in allMembersLocal) + { + if (candidate is null) + { + break; // end of list; stop iteration and fall through to slower path + } + + if (candidate is RuntimeConstructorInfo candidateRCI && candidateRCI.MethodHandle.Value == method.Value) + { + return candidateRCI; // match! + } + } + } + } + T[] list = null!; MethodAttributes methodAttributes = RuntimeMethodHandle.GetAttributes(method); bool isPublic = (methodAttributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Public; @@ -264,6 +306,29 @@ internal MethodBase AddMethod(RuntimeType declaringType, RuntimeMethodHandleInte internal FieldInfo AddField(RuntimeFieldHandleInternal field) { + // First, see if we've already cached an RtFieldInfo that corresponds + // to this field. Since another thread could be updating the backing + // store at the same time it's possible that the check below will + // result in a false negative. That's ok; we'll handle any concurrency + // issues in the later call to Insert. + + T?[]? allMembersLocal = m_allMembers; + if (allMembersLocal != null) + { + foreach (T? candidate in allMembersLocal) + { + if (candidate is null) + { + break; // end of list; stop iteration and fall through to slower path + } + + if (candidate is RtFieldInfo candidateRtFI && candidateRtFI.GetFieldHandle() == field.Value) + { + return candidateRtFI; // match! + } + } + } + // create the runtime field info FieldAttributes fieldAttributes = RuntimeFieldHandle.GetAttributes(field); bool isPublic = (fieldAttributes & FieldAttributes.FieldAccessMask) == FieldAttributes.Public; @@ -507,7 +572,7 @@ private void MergeWithGlobalList(T[] list) } Debug.Assert(cachedMembers![freeSlotIndex] == null); - cachedMembers[freeSlotIndex] = newMemberInfo; + Volatile.Write(ref cachedMembers[freeSlotIndex], newMemberInfo); // value may be read outside of lock freeSlotIndex++; } } @@ -1679,6 +1744,9 @@ internal FieldInfo GetField(RuntimeFieldHandleInternal field) return retval; } + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2070:UnrecognizedReflectionPattern", + Justification = "The code in this method looks up the method by name, but it always starts with a method handle." + + "To get here something somwhere had to get the method handle and thus the method must exist.")] internal static MethodBase? GetMethodBase(RuntimeType? reflectedType, RuntimeMethodHandleInternal methodHandle) { Debug.Assert(!methodHandle.IsNullHandle()); @@ -2138,7 +2206,7 @@ private static bool FilterApplyBase( private static bool FilterApplyType( Type type, BindingFlags bindingFlags, string name, bool prefixLookup, string? ns) { - Debug.Assert((object)type != null); + Debug.Assert(type is not null); Debug.Assert(type is RuntimeType); bool isPublic = type.IsNestedPublic || type.IsPublic; @@ -2276,7 +2344,7 @@ private static bool FilterApplyMethodBase( for (int i = 0; i < parameterInfos.Length; i++) { // a null argument type implies a null arg which is always a perfect match - if ((object)argumentTypes[i] != null && !argumentTypes[i].MatchesParameterTypeExactly(parameterInfos[i])) + if (argumentTypes[i] is Type t && !t.MatchesParameterTypeExactly(parameterInfos[i])) return false; } } @@ -2769,7 +2837,7 @@ public override InterfaceMapping GetInterfaceMap(Type ifaceType) { PropertyInfo firstCandidate = candidates[0]; - if ((object?)returnType != null && !returnType.IsEquivalentTo(firstCandidate.PropertyType)) + if (returnType is not null && !returnType.IsEquivalentTo(firstCandidate.PropertyType)) return null; return firstCandidate; @@ -3798,7 +3866,9 @@ private void CreateInstanceCheckThis() throw new NotSupportedException(SR.Acc_CreateVoid); } - [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2006:UnrecognizedReflectionPattern", + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2082:UnrecognizedReflectionPattern", + Justification = "Implementation detail of Activator that linker intrinsically recognizes")] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2085:UnrecognizedReflectionPattern", Justification = "Implementation detail of Activator that linker intrinsically recognizes")] internal object? CreateInstanceImpl( BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture) @@ -4018,24 +4088,6 @@ private extern object InvokeDispMethod( bool[]? byrefModifiers, int culture, string[]? namedParameters); #endif // FEATURE_COMINTEROP -#if FEATURE_COMINTEROP_UNMANAGED_ACTIVATION - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern Type? GetTypeFromProgIDImpl(string progID, string? server, bool throwOnError); - - [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern Type? GetTypeFromCLSIDImpl(Guid clsid, string? server, bool throwOnError); -#else // FEATURE_COMINTEROP_UNMANAGED_ACTIVATION - internal static Type GetTypeFromProgIDImpl(string progID, string? server, bool throwOnError) - { - throw new NotImplementedException("CoreCLR_REMOVED -- Unmanaged activation removed"); - } - - internal static Type GetTypeFromCLSIDImpl(Guid clsid, string? server, bool throwOnError) - { - throw new NotImplementedException("CoreCLR_REMOVED -- Unmanaged activation removed"); - } -#endif // FEATURE_COMINTEROP_UNMANAGED_ACTIVATION - #endregion #if FEATURE_COMINTEROP @@ -4185,6 +4237,7 @@ private static void WrapArgsForInvokeCall(object[] aArgs, int[] aArgsWrapperType aArgs[i] = new UnknownWrapper(aArgs[i]); break; case DispatchWrapperType.Dispatch: + Debug.Assert(OperatingSystem.IsWindows()); aArgs[i] = new DispatchWrapper(aArgs[i]); break; case DispatchWrapperType.Error: diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/String.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/String.CoreCLR.cs index e97cdaa3c9bc..23ac59b6cd45 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/String.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/String.CoreCLR.cs @@ -3,6 +3,7 @@ using System.Runtime.CompilerServices; using System.Text; +using Internal.Runtime.CompilerServices; namespace System { @@ -80,15 +81,12 @@ public static string Intern(string str) } // Copies the source String (byte buffer) to the destination IntPtr memory allocated with len bytes. + // Used by ilmarshalers.cpp internal static unsafe void InternalCopy(string src, IntPtr dest, int len) { - if (len == 0) - return; - fixed (char* charPtr = &src._firstChar) + if (len != 0) { - byte* srcPtr = (byte*)charPtr; - byte* dstPtr = (byte*)dest; - Buffer.Memcpy(dstPtr, srcPtr, len); + Buffer.Memmove(ref *(byte*)dest, ref Unsafe.As(ref src.GetRawStringData()), (nuint)len); } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs b/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs index b507b28559da..1c4a5649c251 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs @@ -104,10 +104,7 @@ internal static unsafe IntPtr ConvertToNative(int flags, string strManaged, IntP // + 1 for the null character from the user. + 1 for the null character we put in. pbNativeBuffer = (byte*)Marshal.AllocCoTaskMem(nb + 2); - fixed (byte* pBytes = &bytes[0]) - { - Buffer.Memcpy(pbNativeBuffer, pBytes, nb); - } + Buffer.Memmove(ref *pbNativeBuffer, ref MemoryMarshal.GetArrayDataReference(bytes), (nuint)nb); } } @@ -127,7 +124,7 @@ internal static unsafe IntPtr ConvertToNative(int flags, string strManaged, IntP internal static void ClearNative(IntPtr pNative) { - Interop.Ole32.CoTaskMemFree(pNative); + Marshal.FreeCoTaskMem(pNative); } internal static unsafe void ConvertFixedToNative(int flags, string strManaged, IntPtr pNativeBuffer, int length) @@ -257,10 +254,7 @@ internal static unsafe IntPtr ConvertToNative(int flags, string strManaged, IntP internal static void ClearNative(IntPtr pNative) { - if (pNative != IntPtr.Zero) - { - Interop.Ole32.CoTaskMemFree(pNative); - } + Marshal.FreeCoTaskMem(pNative); } } @@ -336,24 +330,13 @@ internal static unsafe IntPtr ConvertToNative(string strManaged, IntPtr pNativeB } else { - // If not provided, allocate the buffer using SysAllocStringByteLen so + // If not provided, allocate the buffer using Marshal.AllocBSTRByteLen so // that odd-sized strings will be handled as well. - ptrToFirstChar = (byte*)Interop.OleAut32.SysAllocStringByteLen(null, lengthInBytes); - - if (ptrToFirstChar == null) - { - throw new OutOfMemoryException(); - } + ptrToFirstChar = (byte*)Marshal.AllocBSTRByteLen(lengthInBytes); } // copy characters from the managed string - fixed (char* ch = strManaged) - { - Buffer.Memcpy( - ptrToFirstChar, - (byte*)ch, - (strManaged.Length + 1) * 2); - } + Buffer.Memmove(ref *(char*)ptrToFirstChar, ref strManaged.GetRawStringData(), (nuint)strManaged.Length + 1); // copy the trail byte if present if (hasTrailByte) @@ -412,10 +395,7 @@ internal static unsafe IntPtr ConvertToNative(string strManaged, IntPtr pNativeB internal static void ClearNative(IntPtr pNative) { - if (IntPtr.Zero != pNative) - { - Interop.OleAut32.SysFreeString(pNative); - } + Marshal.FreeBSTR(pNative); } } // class BSTRMarshaler @@ -449,11 +429,9 @@ internal static unsafe IntPtr ConvertToNative(string strManaged, bool fBestFit, { byte[] bytes = AnsiCharMarshaler.DoAnsiConversion(strManaged, fBestFit, fThrowOnUnmappableChar, out int nbytesused); - Debug.Assert(nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative"); - fixed (byte* pBytes = &bytes[0]) - { - Buffer.Memcpy(pNative, pBytes, nbytesused); - } + Debug.Assert(nbytesused >= 0 && nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative"); + + Buffer.Memmove(ref *pNative, ref MemoryMarshal.GetArrayDataReference(bytes), (nuint)nbytesused); pNative[nbytesused] = 0; *pLength = nbytesused; @@ -476,14 +454,14 @@ internal static void ClearNative(IntPtr pNative) { if (IntPtr.Zero != pNative) { - Interop.Ole32.CoTaskMemFree((IntPtr)(((long)pNative) - sizeof(uint))); + Marshal.FreeCoTaskMem((IntPtr)(((long)pNative) - sizeof(uint))); } } } // class VBByValStrMarshaler internal static class AnsiBSTRMarshaler { - internal static IntPtr ConvertToNative(int flags, string strManaged) + internal static unsafe IntPtr ConvertToNative(int flags, string strManaged) { if (null == strManaged) { @@ -498,7 +476,14 @@ internal static IntPtr ConvertToNative(int flags, string strManaged) bytes = AnsiCharMarshaler.DoAnsiConversion(strManaged, 0 != (flags & 0xFF), 0 != (flags >> 8), out nb); } - return Interop.OleAut32.SysAllocStringByteLen(bytes, (uint)nb); + uint length = (uint)nb; + IntPtr bstr = Marshal.AllocBSTRByteLen(length); + if (bytes != null) + { + Buffer.Memmove(ref *(byte*)bstr, ref MemoryMarshal.GetArrayDataReference(bytes), length); + } + + return bstr; } internal static unsafe string? ConvertToManaged(IntPtr bstr) @@ -518,10 +503,7 @@ internal static IntPtr ConvertToNative(int flags, string strManaged) internal static void ClearNative(IntPtr pNative) { - if (IntPtr.Zero != pNative) - { - Interop.OleAut32.SysFreeString(pNative); - } + Marshal.FreeBSTR(pNative); } } // class AnsiBSTRMarshaler @@ -853,11 +835,12 @@ private static IntPtr ConvertStringToNative(string pManagedHome, int dwFlags) else { // marshal the object as Unicode string (UnmanagedType.LPWStr) - int allocSize = (pManagedHome.Length + 1) * 2; pNativeHome = Marshal.AllocCoTaskMem(allocSize); - - string.InternalCopy(pManagedHome, pNativeHome, allocSize); + unsafe + { + Buffer.Memmove(ref *(char*)pNativeHome, ref pManagedHome.GetRawStringData(), (nuint)pManagedHome.Length + 1); + } } return pNativeHome; @@ -880,14 +863,23 @@ private unsafe IntPtr ConvertStringBuilderToNative(StringBuilder pManagedHome, i // | | | // +====================================+ / <-- native home + // Cache StringBuilder capacity and length to ensure we don't allocate a certain amount of + // native memory and then walk beyond its end if the StringBuilder concurrently grows erroneously. + int pManagedHomeCapacity = pManagedHome.Capacity; + int pManagedHomeLength = pManagedHome.Length; + if (pManagedHomeLength > pManagedHomeCapacity) + { + ThrowHelper.ThrowInvalidOperationException(); + } + // Note that StringBuilder.Capacity is the number of characters NOT including any terminators. if (IsAnsi(dwFlags)) { - StubHelpers.CheckStringLength(pManagedHome.Capacity); + StubHelpers.CheckStringLength(pManagedHomeCapacity); // marshal the object as Ansi string (UnmanagedType.LPStr) - int allocSize = checked((pManagedHome.Capacity * Marshal.SystemMaxDBCSCharSize) + 4); + int allocSize = checked((pManagedHomeCapacity * Marshal.SystemMaxDBCSCharSize) + 4); pNativeHome = Marshal.AllocCoTaskMem(allocSize); byte* ptr = (byte*)pNativeHome; @@ -911,7 +903,7 @@ private unsafe IntPtr ConvertStringBuilderToNative(StringBuilder pManagedHome, i else { // marshal the object as Unicode string (UnmanagedType.LPWStr) - int allocSize = checked((pManagedHome.Capacity * 2) + 4); + int allocSize = checked((pManagedHomeCapacity * 2) + 4); pNativeHome = Marshal.AllocCoTaskMem(allocSize); byte* ptr = (byte*)pNativeHome; @@ -920,10 +912,10 @@ private unsafe IntPtr ConvertStringBuilderToNative(StringBuilder pManagedHome, i if (IsIn(dwFlags)) { - int length = pManagedHome.Length * 2; - pManagedHome.InternalCopy(pNativeHome, length); + pManagedHome.InternalCopy(pNativeHome, pManagedHomeLength); // null-terminate the native string + int length = pManagedHomeLength * 2; *(ptr + length + 0) = 0; *(ptr + length + 1) = 0; } @@ -1067,7 +1059,7 @@ internal void ClearNative(IntPtr pNativeHome) // this must happen regardless of BackPropAction Marshal.DestroyStructure(pNativeHome, layoutType); } - Interop.Ole32.CoTaskMemFree(pNativeHome); + Marshal.FreeCoTaskMem(pNativeHome); } StubHelpers.DestroyCleanupList(ref cleanupWorkList); } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs index d23263f57bc1..93775554ab35 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.InteropServices; namespace System.Text { @@ -104,58 +105,8 @@ internal unsafe void ReplaceBufferAnsiInternal(sbyte* newBuffer, int newLength) /// Copies the contents of this builder to the specified buffer. /// /// The destination buffer. - /// The number of bytes in the destination buffer. - internal unsafe void InternalCopy(IntPtr dest, int len) - { - if (len == 0) - { - return; - } - - bool isLastChunk = true; - byte* dstPtr = (byte*)dest.ToPointer(); - StringBuilder? currentSrc = FindChunkForByte(len); - - do - { - int chunkOffsetInBytes = currentSrc.m_ChunkOffset * sizeof(char); - int chunkLengthInBytes = currentSrc.m_ChunkLength * sizeof(char); - fixed (char* charPtr = ¤tSrc.m_ChunkChars[0]) - { - byte* srcPtr = (byte*)charPtr; - if (isLastChunk) - { - isLastChunk = false; - Buffer.Memcpy(dstPtr + chunkOffsetInBytes, srcPtr, len - chunkOffsetInBytes); - } - else - { - Buffer.Memcpy(dstPtr + chunkOffsetInBytes, srcPtr, chunkLengthInBytes); - } - } - - currentSrc = currentSrc.m_ChunkPrevious; - } - while (currentSrc != null); - } - - /// - /// Gets the chunk corresponding to the logical byte index in this builder. - /// - /// The logical byte index in this builder. - private StringBuilder FindChunkForByte(int byteIndex) - { - Debug.Assert(0 <= byteIndex && byteIndex <= Length * sizeof(char)); - - StringBuilder result = this; - while (result.m_ChunkOffset * sizeof(char) > byteIndex) - { - Debug.Assert(result.m_ChunkPrevious != null); - result = result.m_ChunkPrevious; - } - - Debug.Assert(result != null); - return result; - } + /// The number of chars in the destination buffer. + internal unsafe void InternalCopy(IntPtr dest, int charLen) => + CopyTo(0, new Span((char*)dest, charLen), charLen); } } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs index 595051fd2160..097277e894d9 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ClrThreadPoolBoundHandle.Windows.cs @@ -16,6 +16,7 @@ private static ThreadPoolBoundHandle BindHandleCore(SafeHandle handle) try { + Debug.Assert(OperatingSystem.IsWindows()); // ThreadPool.BindHandle will always return true, otherwise, it throws. See the underlying FCall // implementation in ThreadPoolNative::CorBindIoCompletionCallback to see the implementation. bool succeeded = ThreadPool.BindHandle(handle); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.Unix.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.Unix.cs new file mode 100644 index 000000000000..552fed57a7b9 --- /dev/null +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.Unix.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.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace System.Threading +{ + /// + /// A LIFO semaphore implemented using the PAL's semaphore with uninterruptible waits. + /// + internal sealed partial class LowLevelLifoSemaphore : IDisposable + { + private Semaphore? _semaphore; + + private void Create(int maximumSignalCount) + { + Debug.Assert(maximumSignalCount > 0); + _semaphore = new Semaphore(0, maximumSignalCount); + } + + public bool WaitCore(int timeoutMs) + { + Debug.Assert(_semaphore != null); + Debug.Assert(timeoutMs >= -1); + + int waitResult = WaitNative(_semaphore!.SafeWaitHandle, timeoutMs); + Debug.Assert(waitResult == WaitHandle.WaitSuccess || waitResult == WaitHandle.WaitTimeout); + return waitResult == WaitHandle.WaitSuccess; + } + + [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] + private static extern int WaitNative(SafeWaitHandle handle, int timeoutMs); + + public void ReleaseCore(int count) + { + Debug.Assert(_semaphore != null); + Debug.Assert(count > 0); + + _semaphore!.Release(count); + } + + public void Dispose() + { + Debug.Assert(_semaphore != null); + _semaphore!.Dispose(); + } + } +} diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs new file mode 100644 index 000000000000..8064083eab77 --- /dev/null +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs @@ -0,0 +1,203 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// +/*============================================================================= +** +** +** +** Purpose: Synchronizes access to a shared resource or region of code in a multi-threaded +** program. +** +** +=============================================================================*/ + +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; + +namespace System.Threading +{ + public static partial class Monitor + { + /*========================================================================= + ** Obtain the monitor lock of obj. Will block if another thread holds the lock + ** Will not block if the current thread holds the lock, + ** however the caller must ensure that the same number of Exit + ** calls are made as there were Enter calls. + ** + ** Exceptions: ArgumentNullException if object is null. + =========================================================================*/ + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void Enter(object obj); + + + // Use a ref bool instead of out to ensure that unverifiable code must + // initialize this value to something. If we used out, the value + // could be uninitialized if we threw an exception in our prolog. + // The JIT should inline this method to allow check of lockTaken argument to be optimized out + // in the typical case. Note that the method has to be transparent for inlining to be allowed by the VM. + public static void Enter(object obj, ref bool lockTaken) + { + if (lockTaken) + ThrowLockTakenException(); + + ReliableEnter(obj, ref lockTaken); + Debug.Assert(lockTaken); + } + + [DoesNotReturn] + private static void ThrowLockTakenException() + { + throw new ArgumentException(SR.Argument_MustBeFalse, "lockTaken"); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void ReliableEnter(object obj, ref bool lockTaken); + + + + /*========================================================================= + ** Release the monitor lock. If one or more threads are waiting to acquire the + ** lock, and the current thread has executed as many Exits as + ** Enters, one of the threads will be unblocked and allowed to proceed. + ** + ** Exceptions: ArgumentNullException if object is null. + ** SynchronizationLockException if the current thread does not + ** own the lock. + =========================================================================*/ + [MethodImpl(MethodImplOptions.InternalCall)] + public static extern void Exit(object obj); + + /*========================================================================= + ** Similar to Enter, but will never block. That is, if the current thread can + ** acquire the monitor lock without blocking, it will do so and TRUE will + ** be returned. Otherwise FALSE will be returned. + ** + ** Exceptions: ArgumentNullException if object is null. + =========================================================================*/ + public static bool TryEnter(object obj) + { + bool lockTaken = false; + TryEnter(obj, 0, ref lockTaken); + return lockTaken; + } + + // The JIT should inline this method to allow check of lockTaken argument to be optimized out + // in the typical case. Note that the method has to be transparent for inlining to be allowed by the VM. + public static void TryEnter(object obj, ref bool lockTaken) + { + if (lockTaken) + ThrowLockTakenException(); + + ReliableEnterTimeout(obj, 0, ref lockTaken); + } + + /*========================================================================= + ** Version of TryEnter that will block, but only up to a timeout period + ** expressed in milliseconds. If timeout == Timeout.Infinite the method + ** becomes equivalent to Enter. + ** + ** Exceptions: ArgumentNullException if object is null. + ** ArgumentException if timeout < -1 (Timeout.Infinite). + =========================================================================*/ + // The JIT should inline this method to allow check of lockTaken argument to be optimized out + // in the typical case. Note that the method has to be transparent for inlining to be allowed by the VM. + public static bool TryEnter(object obj, int millisecondsTimeout) + { + bool lockTaken = false; + TryEnter(obj, millisecondsTimeout, ref lockTaken); + return lockTaken; + } + + // The JIT should inline this method to allow check of lockTaken argument to be optimized out + // in the typical case. Note that the method has to be transparent for inlining to be allowed by the VM. + public static void TryEnter(object obj, int millisecondsTimeout, ref bool lockTaken) + { + if (lockTaken) + ThrowLockTakenException(); + + ReliableEnterTimeout(obj, millisecondsTimeout, ref lockTaken); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void ReliableEnterTimeout(object obj, int timeout, ref bool lockTaken); + + public static bool IsEntered(object obj) + { + if (obj == null) + throw new ArgumentNullException(nameof(obj)); + + return IsEnteredNative(obj); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool IsEnteredNative(object obj); + + /*======================================================================== + ** Waits for notification from the object (via a Pulse/PulseAll). + ** timeout indicates how long to wait before the method returns. + ** This method acquires the monitor waithandle for the object + ** If this thread holds the monitor lock for the object, it releases it. + ** On exit from the method, it obtains the monitor lock back. + ** + ** Exceptions: ArgumentNullException if object is null. + ========================================================================*/ + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern bool ObjWait(int millisecondsTimeout, object obj); + + [UnsupportedOSPlatform("browser")] + public static bool Wait(object obj, int millisecondsTimeout) + { + if (obj == null) + throw (new ArgumentNullException(nameof(obj))); + if (millisecondsTimeout < -1) + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + + return ObjWait(millisecondsTimeout, obj); + } + + /*======================================================================== + ** Sends a notification to a single waiting object. + * Exceptions: SynchronizationLockException if this method is not called inside + * a synchronized block of code. + ========================================================================*/ + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void ObjPulse(object obj); + + public static void Pulse(object obj) + { + if (obj == null) + { + throw new ArgumentNullException(nameof(obj)); + } + + ObjPulse(obj); + } + /*======================================================================== + ** Sends a notification to all waiting objects. + ========================================================================*/ + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void ObjPulseAll(object obj); + + public static void PulseAll(object obj) + { + if (obj == null) + { + throw new ArgumentNullException(nameof(obj)); + } + + ObjPulseAll(obj); + } + + /// + /// Gets the number of times there was contention upon trying to take a 's lock so far. + /// + public static long LockContentionCount => GetLockContentionCount(); + + [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] + private static extern long GetLockContentionCount(); + } +} diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Monitor.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Monitor.cs deleted file mode 100644 index 80226acdbcec..000000000000 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Monitor.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -/*============================================================================= -** -** -** -** Purpose: Synchronizes access to a shared resource or region of code in a multi-threaded -** program. -** -** -=============================================================================*/ - -using System.Runtime.CompilerServices; -using System.Diagnostics; -using System.Runtime.InteropServices; -using System.Diagnostics.CodeAnalysis; - -namespace System.Threading -{ - public static class Monitor - { - /*========================================================================= - ** Obtain the monitor lock of obj. Will block if another thread holds the lock - ** Will not block if the current thread holds the lock, - ** however the caller must ensure that the same number of Exit - ** calls are made as there were Enter calls. - ** - ** Exceptions: ArgumentNullException if object is null. - =========================================================================*/ - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern void Enter(object obj); - - - // Use a ref bool instead of out to ensure that unverifiable code must - // initialize this value to something. If we used out, the value - // could be uninitialized if we threw an exception in our prolog. - // The JIT should inline this method to allow check of lockTaken argument to be optimized out - // in the typical case. Note that the method has to be transparent for inlining to be allowed by the VM. - public static void Enter(object obj, ref bool lockTaken) - { - if (lockTaken) - ThrowLockTakenException(); - - ReliableEnter(obj, ref lockTaken); - Debug.Assert(lockTaken); - } - - [DoesNotReturn] - private static void ThrowLockTakenException() - { - throw new ArgumentException(SR.Argument_MustBeFalse, "lockTaken"); - } - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void ReliableEnter(object obj, ref bool lockTaken); - - - - /*========================================================================= - ** Release the monitor lock. If one or more threads are waiting to acquire the - ** lock, and the current thread has executed as many Exits as - ** Enters, one of the threads will be unblocked and allowed to proceed. - ** - ** Exceptions: ArgumentNullException if object is null. - ** SynchronizationLockException if the current thread does not - ** own the lock. - =========================================================================*/ - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern void Exit(object obj); - - /*========================================================================= - ** Similar to Enter, but will never block. That is, if the current thread can - ** acquire the monitor lock without blocking, it will do so and TRUE will - ** be returned. Otherwise FALSE will be returned. - ** - ** Exceptions: ArgumentNullException if object is null. - =========================================================================*/ - public static bool TryEnter(object obj) - { - bool lockTaken = false; - TryEnter(obj, 0, ref lockTaken); - return lockTaken; - } - - // The JIT should inline this method to allow check of lockTaken argument to be optimized out - // in the typical case. Note that the method has to be transparent for inlining to be allowed by the VM. - public static void TryEnter(object obj, ref bool lockTaken) - { - if (lockTaken) - ThrowLockTakenException(); - - ReliableEnterTimeout(obj, 0, ref lockTaken); - } - - /*========================================================================= - ** Version of TryEnter that will block, but only up to a timeout period - ** expressed in milliseconds. If timeout == Timeout.Infinite the method - ** becomes equivalent to Enter. - ** - ** Exceptions: ArgumentNullException if object is null. - ** ArgumentException if timeout < -1 (Timeout.Infinite). - =========================================================================*/ - // The JIT should inline this method to allow check of lockTaken argument to be optimized out - // in the typical case. Note that the method has to be transparent for inlining to be allowed by the VM. - public static bool TryEnter(object obj, int millisecondsTimeout) - { - bool lockTaken = false; - TryEnter(obj, millisecondsTimeout, ref lockTaken); - return lockTaken; - } - - private static int MillisecondsTimeoutFromTimeSpan(TimeSpan timeout) - { - long tm = (long)timeout.TotalMilliseconds; - if (tm < -1 || tm > (long)int.MaxValue) - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); - return (int)tm; - } - - public static bool TryEnter(object obj, TimeSpan timeout) - { - return TryEnter(obj, MillisecondsTimeoutFromTimeSpan(timeout)); - } - - // The JIT should inline this method to allow check of lockTaken argument to be optimized out - // in the typical case. Note that the method has to be transparent for inlining to be allowed by the VM. - public static void TryEnter(object obj, int millisecondsTimeout, ref bool lockTaken) - { - if (lockTaken) - ThrowLockTakenException(); - - ReliableEnterTimeout(obj, millisecondsTimeout, ref lockTaken); - } - - public static void TryEnter(object obj, TimeSpan timeout, ref bool lockTaken) - { - if (lockTaken) - ThrowLockTakenException(); - - ReliableEnterTimeout(obj, MillisecondsTimeoutFromTimeSpan(timeout), ref lockTaken); - } - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void ReliableEnterTimeout(object obj, int timeout, ref bool lockTaken); - - public static bool IsEntered(object obj) - { - if (obj == null) - throw new ArgumentNullException(nameof(obj)); - - return IsEnteredNative(obj); - } - - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern bool IsEnteredNative(object obj); - - /*======================================================================== - ** Waits for notification from the object (via a Pulse/PulseAll). - ** timeout indicates how long to wait before the method returns. - ** This method acquires the monitor waithandle for the object - ** If this thread holds the monitor lock for the object, it releases it. - ** On exit from the method, it obtains the monitor lock back. - ** If exitContext is true then the synchronization domain for the context - ** (if in a synchronized context) is exited before the wait and reacquired - ** - ** Exceptions: ArgumentNullException if object is null. - ========================================================================*/ - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern bool ObjWait(bool exitContext, int millisecondsTimeout, object obj); - - public static bool Wait(object obj, int millisecondsTimeout, bool exitContext) - { - if (obj == null) - throw (new ArgumentNullException(nameof(obj))); - return ObjWait(exitContext, millisecondsTimeout, obj); - } - - public static bool Wait(object obj, TimeSpan timeout, bool exitContext) - { - return Wait(obj, MillisecondsTimeoutFromTimeSpan(timeout), exitContext); - } - - public static bool Wait(object obj, int millisecondsTimeout) - { - return Wait(obj, millisecondsTimeout, false); - } - - public static bool Wait(object obj, TimeSpan timeout) - { - return Wait(obj, MillisecondsTimeoutFromTimeSpan(timeout), false); - } - - public static bool Wait(object obj) - { - return Wait(obj, Timeout.Infinite, false); - } - - /*======================================================================== - ** Sends a notification to a single waiting object. - * Exceptions: SynchronizationLockException if this method is not called inside - * a synchronized block of code. - ========================================================================*/ - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void ObjPulse(object obj); - - public static void Pulse(object obj) - { - if (obj == null) - { - throw new ArgumentNullException(nameof(obj)); - } - - ObjPulse(obj); - } - /*======================================================================== - ** Sends a notification to all waiting objects. - ========================================================================*/ - [MethodImpl(MethodImplOptions.InternalCall)] - private static extern void ObjPulseAll(object obj); - - public static void PulseAll(object obj) - { - if (obj == null) - { - throw new ArgumentNullException(nameof(obj)); - } - - ObjPulseAll(obj); - } - - /// - /// Gets the number of times there was contention upon trying to take a 's lock so far. - /// - public static long LockContentionCount => GetLockContentionCount(); - - [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] - private static extern long GetLockContentionCount(); - } -} diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs index 9edaf81e8a87..cc894d286a92 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs @@ -6,6 +6,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; +using System.Runtime.Versioning; namespace System.Threading { @@ -143,6 +144,11 @@ public sealed partial class Thread private int _managedThreadId; // INT32 #pragma warning restore CA1823, 169 + // This is used for a quick check on thread pool threads after running a work item to determine if the name, background + // state, or priority were changed by the work item, and if so to reset it. Other threads may also change some of those, + // but those types of changes may race with the reset anyway, so this field doesn't need to be synchronized. + private bool _mayNeedResetForThreadPool; + private Thread() { } private void Create(ThreadStart start) => @@ -182,6 +188,7 @@ internal ThreadHandle GetNativeHandle() /// method on the IThreadable interface passed in the constructor. Once the /// thread is dead, it cannot be restarted with another call to Start. /// + [UnsupportedOSPlatform("browser")] public void Start(object? parameter) { // In the case of a null delegate (second call to start on same thread) @@ -196,6 +203,7 @@ public void Start(object? parameter) Start(); } + [UnsupportedOSPlatform("browser")] public void Start() { #if FEATURE_COMINTEROP_APARTMENT_SUPPORT @@ -256,6 +264,9 @@ private void SetCultureOnUnstartedThreadNoCheck(CultureInfo value, bool uiCultur public static void Sleep(int millisecondsTimeout) => SleepInternal(millisecondsTimeout); + [DllImport(RuntimeHelpers.QCall)] + internal static extern void UninterruptibleSleep0(); + /// /// Wait for a length of time proportional to 'iterations'. Each iteration is should /// only take a few machine instructions. Calling this API is preferable to coding @@ -334,7 +345,14 @@ public extern bool IsAlive public bool IsBackground { get => IsBackgroundNative(); - set => SetBackgroundNative(value); + set + { + SetBackgroundNative(value); + if (!value) + { + _mayNeedResetForThreadPool = true; + } + } } [MethodImpl(MethodImplOptions.InternalCall)] @@ -348,13 +366,22 @@ public extern bool IsThreadPoolThread { [MethodImpl(MethodImplOptions.InternalCall)] get; + [MethodImpl(MethodImplOptions.InternalCall)] + internal set; } /// Returns the priority of the thread. public ThreadPriority Priority { get => (ThreadPriority)GetPriorityNative(); - set => SetPriorityNative((int)value); + set + { + SetPriorityNative((int)value); + if (value != ThreadPriority.Normal) + { + _mayNeedResetForThreadPool = true; + } + } } [MethodImpl(MethodImplOptions.InternalCall)] @@ -417,7 +444,7 @@ private bool TrySetApartmentStateUnchecked(ApartmentState state) [MethodImpl(MethodImplOptions.InternalCall)] internal extern int SetApartmentStateNative(int state); #else // FEATURE_COMINTEROP_APARTMENT_SUPPORT - private bool TrySetApartmentStateUnchecked(ApartmentState state) + private static bool TrySetApartmentStateUnchecked(ApartmentState state) { return state == ApartmentState.Unknown; } @@ -500,10 +527,23 @@ public static int GetCurrentProcessorId() // we will record that in a readonly static so that it could become a JIT constant and bypass caching entirely. private static readonly bool s_isProcessorNumberReallyFast = ProcessorIdCache.ProcessorNumberSpeedCheck(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void ResetThreadPoolThread() { - // Currently implemented in unmanaged method Thread::InternalReset and - // called internally from the ThreadPool in NotifyWorkItemComplete. + Debug.Assert(this == CurrentThread); + Debug.Assert(IsThreadPoolThread); + + if (!ThreadPool.UsePortableThreadPool) + { + // Currently implemented in unmanaged method Thread::InternalReset and + // called internally from the ThreadPool in NotifyWorkItemComplete. + return; + } + + if (_mayNeedResetForThreadPool) + { + ResetThreadPoolThreadSlow(); + } } } // End of class Thread } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs index 59fecc735dd7..95b283e707c6 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Threading/ThreadPool.CoreCLR.cs @@ -14,6 +14,7 @@ using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; +using System.Runtime.Versioning; namespace System.Threading { @@ -28,128 +29,102 @@ internal static class _ThreadPoolWaitCallback internal static bool PerformWaitCallback() => ThreadPoolWorkQueue.Dispatch(); } - internal sealed class RegisteredWaitHandleSafe : CriticalFinalizerObject + public sealed partial class RegisteredWaitHandle : MarshalByRefObject { - private static IntPtr InvalidHandle => new IntPtr(-1); - private IntPtr registeredWaitHandle = InvalidHandle; - private WaitHandle? m_internalWaitObject; - private bool bReleaseNeeded; - private volatile int m_lock; + private IntPtr _nativeRegisteredWaitHandle = InvalidHandleValue; + private bool _releaseHandle; - internal IntPtr GetHandle() => registeredWaitHandle; + private static bool IsValidHandle(IntPtr handle) => handle != InvalidHandleValue && handle != IntPtr.Zero; - internal void SetHandle(IntPtr handle) + internal void SetNativeRegisteredWaitHandle(IntPtr nativeRegisteredWaitHandle) { - registeredWaitHandle = handle; + Debug.Assert(!ThreadPool.UsePortableThreadPool); + Debug.Assert(IsValidHandle(nativeRegisteredWaitHandle)); + Debug.Assert(!IsValidHandle(_nativeRegisteredWaitHandle)); + + _nativeRegisteredWaitHandle = nativeRegisteredWaitHandle; } - internal void SetWaitObject(WaitHandle waitObject) + internal void OnBeforeRegister() { - m_internalWaitObject = waitObject; - if (waitObject != null) + if (ThreadPool.UsePortableThreadPool) { - m_internalWaitObject.SafeWaitHandle.DangerousAddRef(ref bReleaseNeeded); + GC.SuppressFinalize(this); + return; } + + Handle.DangerousAddRef(ref _releaseHandle); } - internal bool Unregister( - WaitHandle? waitObject // object to be notified when all callbacks to delegates have completed - ) + /// + /// Unregisters this wait handle registration from the wait threads. + /// + /// The event to signal when the handle is unregistered. + /// If the handle was successfully marked to be removed and the provided wait handle was set as the user provided event. + /// + /// This method will only return true on the first call. + /// Passing in a wait handle with a value of -1 will result in a blocking wait, where Unregister will not return until the full unregistration is completed. + /// + public bool Unregister(WaitHandle waitObject) { - bool result = false; + if (ThreadPool.UsePortableThreadPool) + { + return UnregisterPortable(waitObject); + } - // lock(this) cannot be used reliably in Cer since thin lock could be - // promoted to syncblock and that is not a guaranteed operation - bool bLockTaken = false; - do + s_callbackLock.Acquire(); + try { - if (Interlocked.CompareExchange(ref m_lock, 1, 0) == 0) + if (!IsValidHandle(_nativeRegisteredWaitHandle) || + !UnregisterWaitNative(_nativeRegisteredWaitHandle, waitObject?.SafeWaitHandle)) { - bLockTaken = true; - try - { - if (ValidHandle()) - { - result = UnregisterWaitNative(GetHandle(), waitObject?.SafeWaitHandle); - if (result) - { - if (bReleaseNeeded) - { - Debug.Assert(m_internalWaitObject != null, "Must be non-null for bReleaseNeeded to be true"); - m_internalWaitObject.SafeWaitHandle.DangerousRelease(); - bReleaseNeeded = false; - } - // if result not true don't release/suppress here so finalizer can make another attempt - SetHandle(InvalidHandle); - m_internalWaitObject = null; - GC.SuppressFinalize(this); - } - } - } - finally - { - m_lock = 0; - } + return false; + } + _nativeRegisteredWaitHandle = InvalidHandleValue; + + if (_releaseHandle) + { + Handle.DangerousRelease(); + _releaseHandle = false; } - Thread.SpinWait(1); // yield to processor } - while (!bLockTaken); + finally + { + s_callbackLock.Release(); + } - return result; + GC.SuppressFinalize(this); + return true; } - private bool ValidHandle() => - registeredWaitHandle != InvalidHandle && registeredWaitHandle != IntPtr.Zero; - - ~RegisteredWaitHandleSafe() + ~RegisteredWaitHandle() { - // if the app has already unregistered the wait, there is nothing to cleanup - // we can detect this by checking the handle. Normally, there is no race condition here - // so no need to protect reading of handle. However, if this object gets - // resurrected and then someone does an unregister, it would introduce a race condition - // - // PrepareConstrainedRegions call not needed since finalizer already in Cer - // - // lock(this) cannot be used reliably even in Cer since thin lock could be - // promoted to syncblock and that is not a guaranteed operation - // - // Note that we will not "spin" to get this lock. We make only a single attempt; - // if we can't get the lock, it means some other thread is in the middle of a call - // to Unregister, which will do the work of the finalizer anyway. - // - // Further, it's actually critical that we *not* wait for the lock here, because - // the other thread that's in the middle of Unregister may be suspended for shutdown. - // Then, during the live-object finalization phase of shutdown, this thread would - // end up spinning forever, as the other thread would never release the lock. - // This will result in a "leak" of sorts (since the handle will not be cleaned up) - // but the process is exiting anyway. - // - // During AD-unload, we don't finalize live objects until all threads have been - // aborted out of the AD. Since these locked regions are CERs, we won't abort them - // while the lock is held. So there should be no leak on AD-unload. - // - if (Interlocked.CompareExchange(ref m_lock, 1, 0) == 0) + if (ThreadPool.UsePortableThreadPool) { - try + return; + } + + s_callbackLock.Acquire(); + try + { + if (!IsValidHandle(_nativeRegisteredWaitHandle)) { - if (ValidHandle()) - { - WaitHandleCleanupNative(registeredWaitHandle); - if (bReleaseNeeded) - { - Debug.Assert(m_internalWaitObject != null, "Must be non-null for bReleaseNeeded to be true"); - m_internalWaitObject.SafeWaitHandle.DangerousRelease(); - bReleaseNeeded = false; - } - SetHandle(InvalidHandle); - m_internalWaitObject = null; - } + return; } - finally + + WaitHandleCleanupNative(_nativeRegisteredWaitHandle); + _nativeRegisteredWaitHandle = InvalidHandleValue; + + if (_releaseHandle) { - m_lock = 0; + Handle.DangerousRelease(); + _releaseHandle = false; } } + finally + { + s_callbackLock.Release(); + } } [MethodImpl(MethodImplOptions.InternalCall)] @@ -159,50 +134,137 @@ private bool ValidHandle() => private static extern bool UnregisterWaitNative(IntPtr handle, SafeHandle? waitObject); } - public sealed class RegisteredWaitHandle : MarshalByRefObject + internal sealed partial class CompleteWaitThreadPoolWorkItem : IThreadPoolWorkItem { - private readonly RegisteredWaitHandleSafe internalRegisteredWait; + void IThreadPoolWorkItem.Execute() => CompleteWait(); - internal RegisteredWaitHandle() + // Entry point from unmanaged code + private void CompleteWait() { - internalRegisteredWait = new RegisteredWaitHandleSafe(); + Debug.Assert(ThreadPool.UsePortableThreadPool); + PortableThreadPool.CompleteWait(_registeredWaitHandle, _timedOut); } + } - internal void SetHandle(IntPtr handle) - { - internalRegisteredWait.SetHandle(handle); - } + internal sealed class UnmanagedThreadPoolWorkItem : IThreadPoolWorkItem + { + private readonly IntPtr _callback; + private readonly IntPtr _state; - internal void SetWaitObject(WaitHandle waitObject) + public UnmanagedThreadPoolWorkItem(IntPtr callback, IntPtr state) { - internalRegisteredWait.SetWaitObject(waitObject); + _callback = callback; + _state = state; } - public bool Unregister( - WaitHandle? waitObject // object to be notified when all callbacks to delegates have completed - ) - { - return internalRegisteredWait.Unregister(waitObject); - } + void IThreadPoolWorkItem.Execute() => ExecuteUnmanagedThreadPoolWorkItem(_callback, _state); + + [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] + private static extern void ExecuteUnmanagedThreadPoolWorkItem(IntPtr callback, IntPtr state); } public static partial class ThreadPool { - // Time in ms for which ThreadPoolWorkQueue.Dispatch keeps executing work items before returning to the OS - private const uint DispatchQuantum = 30; - + // SOS's ThreadPool command depends on this name + internal static readonly bool UsePortableThreadPool = InitializeConfigAndDetermineUsePortableThreadPool(); + + // Time-senstiive work items are those that may need to run ahead of normal work items at least periodically. For a + // runtime that does not support time-sensitive work items on the managed side, the thread pool yields the thread to the + // runtime periodically (by exiting the dispatch loop) so that the runtime may use that thread for processing + // any time-sensitive work. For a runtime that supports time-sensitive work items on the managed side, the thread pool + // does not yield the thread and instead processes time-sensitive work items queued by specific APIs periodically. + internal static bool SupportsTimeSensitiveWorkItems => UsePortableThreadPool; + + // This needs to be initialized after UsePortableThreadPool above, as it may depend on UsePortableThreadPool and the + // config initialization internal static readonly bool EnableWorkerTracking = GetEnableWorkerTracking(); - internal static bool KeepDispatching(int startTickCount) + private static unsafe bool InitializeConfigAndDetermineUsePortableThreadPool() + { + bool usePortableThreadPool = false; + int configVariableIndex = 0; + while (true) + { + int nextConfigVariableIndex = + GetNextConfigUInt32Value( + configVariableIndex, + out uint configValue, + out bool isBoolean, + out char* appContextConfigNameUnsafe); + if (nextConfigVariableIndex < 0) + { + break; + } + + Debug.Assert(nextConfigVariableIndex > configVariableIndex); + configVariableIndex = nextConfigVariableIndex; + + if (appContextConfigNameUnsafe == null) + { + // Special case for UsePortableThreadPool, which doesn't go into the AppContext + Debug.Assert(configValue != 0); + Debug.Assert(isBoolean); + usePortableThreadPool = true; + continue; + } + + var appContextConfigName = new string(appContextConfigNameUnsafe); + if (isBoolean) + { + AppContext.SetSwitch(appContextConfigName, configValue != 0); + } + else + { + AppContext.SetData(appContextConfigName, configValue); + } + } + + return usePortableThreadPool; + } + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern unsafe int GetNextConfigUInt32Value( + int configVariableIndex, + out uint configValue, + out bool isBoolean, + out char* appContextConfigName); + + private static bool GetEnableWorkerTracking() => + UsePortableThreadPool + ? AppContextConfigHelper.GetBooleanConfig("System.Threading.ThreadPool.EnableWorkerTracking", false) + : GetEnableWorkerTrackingNative(); + + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern bool CanSetMinIOCompletionThreads(int ioCompletionThreads); + + internal static void SetMinIOCompletionThreads(int ioCompletionThreads) { - // Note: this function may incorrectly return false due to TickCount overflow - // if work item execution took around a multiple of 2^32 milliseconds (~49.7 days), - // which is improbable. - return (uint)(Environment.TickCount - startTickCount) < DispatchQuantum; + Debug.Assert(UsePortableThreadPool); + Debug.Assert(ioCompletionThreads >= 0); + + bool success = SetMinThreadsNative(1, ioCompletionThreads); // worker thread count is ignored + Debug.Assert(success); + } + + [MethodImpl(MethodImplOptions.InternalCall)] + internal static extern bool CanSetMaxIOCompletionThreads(int ioCompletionThreads); + + internal static void SetMaxIOCompletionThreads(int ioCompletionThreads) + { + Debug.Assert(UsePortableThreadPool); + Debug.Assert(ioCompletionThreads > 0); + + bool success = SetMaxThreadsNative(1, ioCompletionThreads); // worker thread count is ignored + Debug.Assert(success); } public static bool SetMaxThreads(int workerThreads, int completionPortThreads) { + if (UsePortableThreadPool) + { + return PortableThreadPool.ThreadPoolInstance.SetMaxThreads(workerThreads, completionPortThreads); + } + return workerThreads >= 0 && completionPortThreads >= 0 && @@ -212,10 +274,20 @@ public static bool SetMaxThreads(int workerThreads, int completionPortThreads) public static void GetMaxThreads(out int workerThreads, out int completionPortThreads) { GetMaxThreadsNative(out workerThreads, out completionPortThreads); + + if (UsePortableThreadPool) + { + workerThreads = PortableThreadPool.ThreadPoolInstance.GetMaxThreads(); + } } public static bool SetMinThreads(int workerThreads, int completionPortThreads) { + if (UsePortableThreadPool) + { + return PortableThreadPool.ThreadPoolInstance.SetMinThreads(workerThreads, completionPortThreads); + } + return workerThreads >= 0 && completionPortThreads >= 0 && @@ -225,11 +297,21 @@ public static bool SetMinThreads(int workerThreads, int completionPortThreads) public static void GetMinThreads(out int workerThreads, out int completionPortThreads) { GetMinThreadsNative(out workerThreads, out completionPortThreads); + + if (UsePortableThreadPool) + { + workerThreads = PortableThreadPool.ThreadPoolInstance.GetMinThreads(); + } } public static void GetAvailableThreads(out int workerThreads, out int completionPortThreads) { GetAvailableThreadsNative(out workerThreads, out completionPortThreads); + + if (UsePortableThreadPool) + { + workerThreads = PortableThreadPool.ThreadPoolInstance.GetAvailableThreads(); + } } /// @@ -238,11 +320,11 @@ public static void GetAvailableThreads(out int workerThreads, out int completion /// /// For a thread pool implementation that may have different types of threads, the count includes all types. /// - public static extern int ThreadCount - { - [MethodImpl(MethodImplOptions.InternalCall)] - get; - } + public static int ThreadCount => + (UsePortableThreadPool ? PortableThreadPool.ThreadPoolInstance.ThreadCount : 0) + GetThreadCount(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern int GetThreadCount(); /// /// Gets the number of work items that have been processed so far. @@ -250,51 +332,119 @@ public static extern int ThreadCount /// /// For a thread pool implementation that may have different types of work items, the count includes all types. /// - public static long CompletedWorkItemCount => GetCompletedWorkItemCount(); + public static long CompletedWorkItemCount + { + get + { + long count = GetCompletedWorkItemCount(); + if (UsePortableThreadPool) + { + count += PortableThreadPool.ThreadPoolInstance.CompletedWorkItemCount; + } + return count; + } + } [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] private static extern long GetCompletedWorkItemCount(); - private static extern long PendingUnmanagedWorkItemCount - { - [MethodImpl(MethodImplOptions.InternalCall)] - get; - } + private static long PendingUnmanagedWorkItemCount => UsePortableThreadPool ? 0 : GetPendingUnmanagedWorkItemCount(); + + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern long GetPendingUnmanagedWorkItemCount(); private static RegisteredWaitHandle RegisterWaitForSingleObject( - WaitHandle waitObject, - WaitOrTimerCallback callBack, + WaitHandle? waitObject, + WaitOrTimerCallback? callBack, object? state, uint millisecondsTimeOutInterval, - bool executeOnlyOnce, // NOTE: we do not allow other options that allow the callback to be queued as an APC - bool compressStack - ) + bool executeOnlyOnce, + bool flowExecutionContext) { - RegisteredWaitHandle registeredWaitHandle = new RegisteredWaitHandle(); - if (callBack != null) + if (waitObject == null) + throw new ArgumentNullException(nameof(waitObject)); + + if (callBack == null) + throw new ArgumentNullException(nameof(callBack)); + + RegisteredWaitHandle registeredWaitHandle = new RegisteredWaitHandle( + waitObject, + new _ThreadPoolWaitOrTimerCallback(callBack, state, flowExecutionContext), + (int)millisecondsTimeOutInterval, + !executeOnlyOnce); + + registeredWaitHandle.OnBeforeRegister(); + + if (UsePortableThreadPool) { - _ThreadPoolWaitOrTimerCallback callBackHelper = new _ThreadPoolWaitOrTimerCallback(callBack, state, compressStack); - state = (object)callBackHelper; - // call SetWaitObject before native call so that waitObject won't be closed before threadpoolmgr registration - // this could occur if callback were to fire before SetWaitObject does its addref - registeredWaitHandle.SetWaitObject(waitObject); - IntPtr nativeRegisteredWaitHandle = RegisterWaitForSingleObjectNative(waitObject, - state, - millisecondsTimeOutInterval, - executeOnlyOnce, - registeredWaitHandle); - registeredWaitHandle.SetHandle(nativeRegisteredWaitHandle); + PortableThreadPool.ThreadPoolInstance.RegisterWaitHandle(registeredWaitHandle); } else { - throw new ArgumentNullException(nameof(WaitOrTimerCallback)); + IntPtr nativeRegisteredWaitHandle = + RegisterWaitForSingleObjectNative( + waitObject, + registeredWaitHandle.Callback, + (uint)registeredWaitHandle.TimeoutDurationMs, + !registeredWaitHandle.Repeating, + registeredWaitHandle); + registeredWaitHandle.SetNativeRegisteredWaitHandle(nativeRegisteredWaitHandle); } + return registeredWaitHandle; } + internal static void UnsafeQueueWaitCompletion(CompleteWaitThreadPoolWorkItem completeWaitWorkItem) + { + Debug.Assert(UsePortableThreadPool); + +#if TARGET_WINDOWS // the IO completion thread pool is currently only available on Windows + QueueWaitCompletionNative(completeWaitWorkItem); +#else + UnsafeQueueUserWorkItemInternal(completeWaitWorkItem, preferLocal: false); +#endif + } + +#if TARGET_WINDOWS // the IO completion thread pool is currently only available on Windows + [MethodImpl(MethodImplOptions.InternalCall)] + private static extern void QueueWaitCompletionNative(CompleteWaitThreadPoolWorkItem completeWaitWorkItem); +#endif + + internal static void RequestWorkerThread() + { + if (UsePortableThreadPool) + { + PortableThreadPool.ThreadPoolInstance.RequestWorker(); + return; + } + + RequestWorkerThreadNative(); + } + [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] - internal static extern Interop.BOOL RequestWorkerThread(); + private static extern Interop.BOOL RequestWorkerThreadNative(); + + // Entry point from unmanaged code + private static void EnsureGateThreadRunning() + { + Debug.Assert(UsePortableThreadPool); + PortableThreadPool.EnsureGateThreadRunning(); + } + + /// + /// Called from the gate thread periodically to perform runtime-specific gate activities + /// + /// CPU utilization as a percentage since the last call + /// True if the runtime still needs to perform gate activities, false otherwise + internal static bool PerformRuntimeSpecificGateActivities(int cpuUtilization) + { + Debug.Assert(UsePortableThreadPool); + return PerformRuntimeSpecificGateActivitiesNative(cpuUtilization) != Interop.BOOL.FALSE; + } + + [DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)] + private static extern Interop.BOOL PerformRuntimeSpecificGateActivitiesNative(int cpuUtilization); [MethodImpl(MethodImplOptions.InternalCall)] private static extern unsafe bool PostQueuedCompletionStatus(NativeOverlapped* overlapped); @@ -303,6 +453,13 @@ bool compressStack public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) => PostQueuedCompletionStatus(overlapped); + // Entry point from unmanaged code + private static void UnsafeQueueUnmanagedWorkItem(IntPtr callback, IntPtr state) + { + Debug.Assert(SupportsTimeSensitiveWorkItems); + UnsafeQueueTimeSensitiveWorkItemInternal(new UnmanagedThreadPoolWorkItem(callback, state)); + } + // Native methods: [MethodImpl(MethodImplOptions.InternalCall)] @@ -320,22 +477,56 @@ public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapp [MethodImpl(MethodImplOptions.InternalCall)] private static extern void GetAvailableThreadsNative(out int workerThreads, out int completionPortThreads); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static bool NotifyWorkItemComplete(object? threadLocalCompletionCountObject, int currentTimeMs) + { + if (UsePortableThreadPool) + { + return + PortableThreadPool.ThreadPoolInstance.NotifyWorkItemComplete( + threadLocalCompletionCountObject, + currentTimeMs); + } + + return NotifyWorkItemCompleteNative(); + } + [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern bool NotifyWorkItemComplete(); + private static extern bool NotifyWorkItemCompleteNative(); + + internal static void ReportThreadStatus(bool isWorking) + { + if (UsePortableThreadPool) + { + PortableThreadPool.ThreadPoolInstance.ReportThreadStatus(isWorking); + return; + } + + ReportThreadStatusNative(isWorking); + } [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern void ReportThreadStatus(bool isWorking); + private static extern void ReportThreadStatusNative(bool isWorking); internal static void NotifyWorkItemProgress() { + if (UsePortableThreadPool) + { + PortableThreadPool.ThreadPoolInstance.NotifyWorkItemProgress(); + return; + } + NotifyWorkItemProgressNative(); } [MethodImpl(MethodImplOptions.InternalCall)] - internal static extern void NotifyWorkItemProgressNative(); + private static extern void NotifyWorkItemProgressNative(); + + internal static object? GetOrCreateThreadLocalCompletionCountObject() => + UsePortableThreadPool ? PortableThreadPool.ThreadPoolInstance.GetOrCreateThreadLocalCompletionCountObject() : null; [MethodImpl(MethodImplOptions.InternalCall)] - private static extern bool GetEnableWorkerTracking(); + private static extern bool GetEnableWorkerTrackingNative(); [MethodImpl(MethodImplOptions.InternalCall)] private static extern IntPtr RegisterWaitForSingleObjectNative( @@ -352,6 +543,7 @@ public static bool BindHandle(IntPtr osHandle) return BindIOCompletionCallbackNative(osHandle); } + [SupportedOSPlatform("windows")] public static bool BindHandle(SafeHandle osHandle) { if (osHandle == null) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Type.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Type.CoreCLR.cs index c81b37a4db72..7a39e6e5e8bd 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Type.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Type.CoreCLR.cs @@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using StackCrawlMark = System.Threading.StackCrawlMark; namespace System @@ -80,32 +81,6 @@ public bool IsInterface return TypeNameParser.GetType(typeName, assemblyResolver, typeResolver, throwOnError, ignoreCase, ref stackMark); } - //////////////////////////////////////////////////////////////////////////////// - // This will return a class based upon the progID. This is provided for - // COM classic support. Program ID's are not used in COM+ because they - // have been superceded by namespace. (This routine is called this instead - // of getClass() because of the name conflict with the first method above.) - // - // param progID: the progID of the class to retrieve - // returns: the class object associated to the progID - //// - public static Type? GetTypeFromProgID(string progID, string? server, bool throwOnError) - { - return RuntimeType.GetTypeFromProgIDImpl(progID, server, throwOnError); - } - - //////////////////////////////////////////////////////////////////////////////// - // This will return a class based upon the CLSID. This is provided for - // COM classic support. - // - // param CLSID: the CLSID of the class to retrieve - // returns: the class object associated to the CLSID - //// - public static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError) - { - return RuntimeType.GetTypeFromCLSIDImpl(clsid, server, throwOnError); - } - internal virtual RuntimeTypeHandle GetTypeHandleInternal() { return TypeHandle; diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Utf8String.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Utf8String.CoreCLR.cs index ce669f84ec9d..015f89ee16a0 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Utf8String.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Utf8String.CoreCLR.cs @@ -63,6 +63,8 @@ public sealed partial class Utf8String [MethodImpl(MethodImplOptions.InternalCall)] public extern Utf8String(ReadOnlySpan value); +#pragma warning disable CA1822 // Mark members as static + #if !CORECLR static #endif @@ -262,6 +264,8 @@ private Utf8String Ctor(string value) return Ctor(value.AsSpan()); } +#pragma warning restore CA1822 + /* * METHODS */ diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/ValueType.cs b/src/coreclr/src/System.Private.CoreLib/src/System/ValueType.cs index 646a4792e9ab..72ffecfe902d 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/ValueType.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/ValueType.cs @@ -20,7 +20,7 @@ namespace System [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public abstract class ValueType { - [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2006:UnrecognizedReflectionPattern", + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2075:UnrecognizedReflectionPattern", Justification = "Trimmed fields don't make a difference for equality")] public override bool Equals(object? obj) { diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Variant.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Variant.cs index 8ab1589db965..0ac655757935 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Variant.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Variant.cs @@ -279,6 +279,7 @@ public Variant(object? obj) else if (obj is DispatchWrapper) { vt = VarEnum.VT_DISPATCH; + Debug.Assert(OperatingSystem.IsWindows()); obj = ((DispatchWrapper)obj).WrappedObject; } else if (obj is ErrorWrapper) @@ -401,6 +402,7 @@ internal static void MarshalHelperCastVariant(object pValue, int vt, ref Variant switch (vt) { case 9: /*VT_DISPATCH*/ + Debug.Assert(OperatingSystem.IsWindows()); v = new Variant(new DispatchWrapper(pValue)); break; @@ -442,7 +444,9 @@ internal static void MarshalHelperCastVariant(object pValue, int vt, ref Variant 6 => /*VT_CY*/ new Variant(new CurrencyWrapper(iv.ToDecimal(provider))), 7 => /*VT_DATE*/ new Variant(iv.ToDateTime(provider)), 8 => /*VT_BSTR*/ new Variant(iv.ToString(provider)), +#pragma warning disable CA1416 // Validate platform compatibility 9 => /*VT_DISPATCH*/ new Variant(new DispatchWrapper((object)iv)), +#pragma warning restore CA1416 10 => /*VT_ERROR*/ new Variant(new ErrorWrapper(iv.ToInt32(provider))), 11 => /*VT_BOOL*/ new Variant(iv.ToBoolean(provider)), 12 => /*VT_VARIANT*/ new Variant((object)iv), diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/__ComObject.cs b/src/coreclr/src/System.Private.CoreLib/src/System/__ComObject.cs index 9015a016a7e9..be3294ffdf6e 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/__ComObject.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/__ComObject.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Runtime.InteropServices; using System.Reflection; +using System.Runtime.Versioning; namespace System { @@ -11,6 +12,7 @@ namespace System /// __ComObject is the root class for all COM wrappers. This class defines only /// the basics. This class is used for wrapping COM objects accessed from managed. /// + [SupportedOSPlatform("windows")] internal class __ComObject : MarshalByRefObject { private Hashtable? m_ObjectToDataMap; // Do not rename (runtime relies on this name). diff --git a/src/coreclr/src/ToolBox/SOS/CMakeLists.txt b/src/coreclr/src/ToolBox/SOS/CMakeLists.txt index e8de02243283..1474c5466f0a 100644 --- a/src/coreclr/src/ToolBox/SOS/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/SOS/CMakeLists.txt @@ -1,7 +1 @@ -if(CLR_CMAKE_TARGET_WIN32) - if (CMAKE_GENERATOR MATCHES "Visual Studio .*") - add_subdirectory(DacTableGen) - endif() -endif(CLR_CMAKE_TARGET_WIN32) - _install(FILES SOS_README.md DESTINATION .) diff --git a/src/coreclr/src/ToolBox/SOS/DIALib/DIALib.il b/src/coreclr/src/ToolBox/SOS/DIALib/DIALib.il new file mode 100644 index 000000000000..9fb4f1716957 --- /dev/null +++ b/src/coreclr/src/ToolBox/SOS/DIALib/DIALib.il @@ -0,0 +1,17245 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly DIALib +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibVersionAttribute::.ctor(int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 31 30 36 31 37 33 41 30 2D 30 31 37 33 // ..$106173A0-0173 + 2D 34 45 35 43 2D 38 34 45 37 2D 45 39 31 35 34 // -4E5C-84E7-E9154 + 32 32 42 45 39 39 37 00 00 ) // 22BE997.. + .custom instance void [mscorlib]System.Runtime.InteropServices.ImportedFromTypeLibAttribute::.ctor(string) = ( 01 00 07 44 69 61 32 4C 69 62 00 00 ) // ...Dia2Lib.. + .hash algorithm 0x00008004 + .ver 2:0:0:0 +} +.module DIALib.dll +// MVID: {E5EE27AE-42FF-4EFB-B964-A21EE69EDB47} +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x05C30000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class interface public abstract auto ansi import DIALib.IDiaDataSource +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 37 39 46 31 42 42 35 46 2D 42 36 36 45 // ..$79F1BB5F-B66E + 2D 34 38 45 35 2D 42 36 41 39 2D 31 35 34 35 43 // -48E5-B6A9-1545C + 33 32 33 43 41 33 44 00 00 ) // 323CA3D.. + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_lastError() runtime managed internalcall + { + } // end of method IDiaDataSource::get_lastError + + .method public hidebysig newslot abstract virtual + instance void loadDataFromPdb([in] string marshal( lpwstr) pdbPath) runtime managed internalcall + { + } // end of method IDiaDataSource::loadDataFromPdb + + .method public hidebysig newslot abstract virtual + instance void loadAndValidateDataFromPdb([in] string marshal( lpwstr) pdbPath, + [in] valuetype [mscorlib]System.Guid& pcsig70, + [in] uint32 sig, + [in] uint32 age) runtime managed internalcall + { + } // end of method IDiaDataSource::loadAndValidateDataFromPdb + + .method public hidebysig newslot abstract virtual + instance void loadDataForExe([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + } // end of method IDiaDataSource::loadDataForExe + + .method public hidebysig newslot abstract virtual + instance void loadDataFromIStream([in] class DIALib.IStream marshal( interface ) pIStream) runtime managed internalcall + { + } // end of method IDiaDataSource::loadDataFromIStream + + .method public hidebysig newslot abstract virtual + instance void openSession([out] class DIALib.IDiaSession& marshal( interface ) ppSession) runtime managed internalcall + { + } // end of method IDiaDataSource::openSession + + .method public hidebysig newslot abstract virtual + instance void loadDataFromCodeViewInfo([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] uint32 cbCvInfo, + [in] uint8& pbCvInfo, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + } // end of method IDiaDataSource::loadDataFromCodeViewInfo + + .method public hidebysig newslot abstract virtual + instance void loadDataFromMiscInfo([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] uint32 timeStampExe, + [in] uint32 timeStampDbg, + [in] uint32 sizeOfExe, + [in] uint32 cbMiscInfo, + [in] uint8& pbMiscInfo, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + } // end of method IDiaDataSource::loadDataFromMiscInfo + + .property string lastError() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance string DIALib.IDiaDataSource::get_lastError() + } // end of property IDiaDataSource::lastError +} // end of class DIALib.IDiaDataSource + +.class interface public abstract auto ansi import DIALib.DiaSource + implements DIALib.IDiaDataSource +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 37 39 46 31 42 42 35 46 2D 42 36 36 45 // ..$79F1BB5F-B66E + 2D 34 38 45 35 2D 42 36 41 39 2D 31 35 34 35 43 // -48E5-B6A9-1545C + 33 32 33 43 41 33 44 00 00 ) // 323CA3D.. + .custom instance void [mscorlib]System.Runtime.InteropServices.CoClassAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 15 44 49 41 4C 69 62 2E 44 69 61 53 6F 75 // ...DIALib.DiaSou + 72 63 65 43 6C 61 73 73 00 00 ) // rceClass.. +} // end of class DIALib.DiaSource + +.class public auto ansi import DIALib.DiaSourceClass + extends [mscorlib]System.Object + implements DIALib.IDiaDataSource, + DIALib.DiaSource +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.TypeLibTypeFlags) = ( 01 00 02 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 45 36 37 35 36 31 33 35 2D 31 45 36 35 // ..$E6756135-1E65 + 2D 34 44 31 37 2D 38 35 37 36 2D 36 31 30 37 36 // -4D17-8576-61076 + 31 33 39 38 43 33 43 00 00 ) // 1398C3C.. + .custom instance void [mscorlib]System.Runtime.InteropServices.ClassInterfaceAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ClassInterfaceType) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor() runtime managed internalcall + { + } // end of method DiaSourceClass::.ctor + + .method public hidebysig newslot specialname virtual + instance string + marshal( bstr) + get_lastError() runtime managed internalcall + { + .override DIALib.IDiaDataSource::get_lastError + } // end of method DiaSourceClass::get_lastError + + .method public hidebysig newslot virtual + instance void loadDataFromPdb([in] string marshal( lpwstr) pdbPath) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataFromPdb + } // end of method DiaSourceClass::loadDataFromPdb + + .method public hidebysig newslot virtual + instance void loadAndValidateDataFromPdb([in] string marshal( lpwstr) pdbPath, + [in] valuetype [mscorlib]System.Guid& pcsig70, + [in] uint32 sig, + [in] uint32 age) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadAndValidateDataFromPdb + } // end of method DiaSourceClass::loadAndValidateDataFromPdb + + .method public hidebysig newslot virtual + instance void loadDataForExe([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataForExe + } // end of method DiaSourceClass::loadDataForExe + + .method public hidebysig newslot virtual + instance void loadDataFromIStream([in] class DIALib.IStream marshal( interface ) pIStream) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataFromIStream + } // end of method DiaSourceClass::loadDataFromIStream + + .method public hidebysig newslot virtual + instance void openSession([out] class DIALib.IDiaSession& marshal( interface ) ppSession) runtime managed internalcall + { + .override DIALib.IDiaDataSource::openSession + } // end of method DiaSourceClass::openSession + + .method public hidebysig newslot virtual + instance void loadDataFromCodeViewInfo([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] uint32 cbCvInfo, + [in] uint8& pbCvInfo, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataFromCodeViewInfo + } // end of method DiaSourceClass::loadDataFromCodeViewInfo + + .method public hidebysig newslot virtual + instance void loadDataFromMiscInfo([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] uint32 timeStampExe, + [in] uint32 timeStampDbg, + [in] uint32 sizeOfExe, + [in] uint32 cbMiscInfo, + [in] uint8& pbMiscInfo, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataFromMiscInfo + } // end of method DiaSourceClass::loadDataFromMiscInfo + + .property string lastError() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance string DIALib.DiaSourceClass::get_lastError() + } // end of property DiaSourceClass::lastError +} // end of class DIALib.DiaSourceClass + +.class interface public abstract auto ansi import DIALib.DiaSourceAlt + implements DIALib.IDiaDataSource +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.CoClassAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 18 44 49 41 4C 69 62 2E 44 69 61 53 6F 75 // ...DIALib.DiaSou + 72 63 65 41 6C 74 43 6C 61 73 73 00 00 ) // rceAltClass.. + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 37 39 46 31 42 42 35 46 2D 42 36 36 45 // ..$79F1BB5F-B66E + 2D 34 38 45 35 2D 42 36 41 39 2D 31 35 34 35 43 // -48E5-B6A9-1545C + 33 32 33 43 41 33 44 00 00 ) // 323CA3D.. +} // end of class DIALib.DiaSourceAlt + +.class public auto ansi import DIALib.DiaSourceAltClass + extends [mscorlib]System.Object + implements DIALib.IDiaDataSource, + DIALib.DiaSourceAlt +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.TypeLibTypeFlags) = ( 01 00 02 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.ClassInterfaceAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ClassInterfaceType) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 39 31 39 30 34 38 33 31 2D 34 39 43 41 // ..$91904831-49CA + 2D 34 37 36 36 2D 42 39 35 43 2D 32 35 33 39 37 // -4766-B95C-25397 + 45 32 44 44 36 44 43 00 00 ) // E2DD6DC.. + .method public specialname rtspecialname + instance void .ctor() runtime managed internalcall + { + } // end of method DiaSourceAltClass::.ctor + + .method public hidebysig newslot specialname virtual + instance string + marshal( bstr) + get_lastError() runtime managed internalcall + { + .override DIALib.IDiaDataSource::get_lastError + } // end of method DiaSourceAltClass::get_lastError + + .method public hidebysig newslot virtual + instance void loadDataFromPdb([in] string marshal( lpwstr) pdbPath) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataFromPdb + } // end of method DiaSourceAltClass::loadDataFromPdb + + .method public hidebysig newslot virtual + instance void loadAndValidateDataFromPdb([in] string marshal( lpwstr) pdbPath, + [in] valuetype [mscorlib]System.Guid& pcsig70, + [in] uint32 sig, + [in] uint32 age) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadAndValidateDataFromPdb + } // end of method DiaSourceAltClass::loadAndValidateDataFromPdb + + .method public hidebysig newslot virtual + instance void loadDataForExe([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataForExe + } // end of method DiaSourceAltClass::loadDataForExe + + .method public hidebysig newslot virtual + instance void loadDataFromIStream([in] class DIALib.IStream marshal( interface ) pIStream) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataFromIStream + } // end of method DiaSourceAltClass::loadDataFromIStream + + .method public hidebysig newslot virtual + instance void openSession([out] class DIALib.IDiaSession& marshal( interface ) ppSession) runtime managed internalcall + { + .override DIALib.IDiaDataSource::openSession + } // end of method DiaSourceAltClass::openSession + + .method public hidebysig newslot virtual + instance void loadDataFromCodeViewInfo([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] uint32 cbCvInfo, + [in] uint8& pbCvInfo, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataFromCodeViewInfo + } // end of method DiaSourceAltClass::loadDataFromCodeViewInfo + + .method public hidebysig newslot virtual + instance void loadDataFromMiscInfo([in] string marshal( lpwstr) executable, + [in] string marshal( lpwstr) searchPath, + [in] uint32 timeStampExe, + [in] uint32 timeStampDbg, + [in] uint32 sizeOfExe, + [in] uint32 cbMiscInfo, + [in] uint8& pbMiscInfo, + [in] object marshal( iunknown ) pCallback) runtime managed internalcall + { + .override DIALib.IDiaDataSource::loadDataFromMiscInfo + } // end of method DiaSourceAltClass::loadDataFromMiscInfo + + .property string lastError() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance string DIALib.DiaSourceAltClass::get_lastError() + } // end of property DiaSourceAltClass::lastError +} // end of class DIALib.DiaSourceAltClass + +.class interface public abstract auto ansi import DIALib.IDiaStackWalker +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 35 34 38 35 32 31 36 42 2D 41 35 34 43 // ..$5485216B-A54C + 2D 34 36 39 46 2D 39 36 37 30 2D 35 32 42 32 34 // -469F-9670-52B24 + 44 35 32 32 39 42 42 00 00 ) // D5229BB.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot abstract virtual + instance void getEnumFrames([in] class DIALib.IDiaStackWalkHelper marshal( interface ) pHelper, + [out] class DIALib.IDiaEnumStackFrames& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaStackWalker::getEnumFrames + + .method public hidebysig newslot abstract virtual + instance void getEnumFrames2([in] valuetype DIALib.CV_CPU_TYPE_e cpuid, + [in] class DIALib.IDiaStackWalkHelper marshal( interface ) pHelper, + [out] class DIALib.IDiaEnumStackFrames& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaStackWalker::getEnumFrames2 + +} // end of class DIALib.IDiaStackWalker + +.class interface public abstract auto ansi import DIALib.DiaStackWalker + implements DIALib.IDiaStackWalker +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.CoClassAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 1A 44 49 41 4C 69 62 2E 44 69 61 53 74 61 // ...DIALib.DiaSta + 63 6B 57 61 6C 6B 65 72 43 6C 61 73 73 00 00 ) // ckWalkerClass.. + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 35 34 38 35 32 31 36 42 2D 41 35 34 43 // ..$5485216B-A54C + 2D 34 36 39 46 2D 39 36 37 30 2D 35 32 42 32 34 // -469F-9670-52B24 + 44 35 32 32 39 42 42 00 00 ) // D5229BB.. +} // end of class DIALib.DiaStackWalker + +.class public auto ansi import DIALib.DiaStackWalkerClass + extends [mscorlib]System.Object + implements DIALib.IDiaStackWalker, + DIALib.DiaStackWalker +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 43 45 34 41 38 35 44 42 2D 35 37 36 38 // ..$CE4A85DB-5768 + 2D 34 37 35 42 2D 41 34 45 31 2D 43 30 42 43 41 // -475B-A4E1-C0BCA + 32 31 31 32 41 36 42 00 00 ) // 2112A6B.. + .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.TypeLibTypeFlags) = ( 01 00 02 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.ClassInterfaceAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ClassInterfaceType) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor() runtime managed internalcall + { + } // end of method DiaStackWalkerClass::.ctor + + .method public hidebysig newslot virtual + instance void getEnumFrames([in] class DIALib.IDiaStackWalkHelper marshal( interface ) pHelper, + [out] class DIALib.IDiaEnumStackFrames& marshal( interface ) ppenum) runtime managed internalcall + { + .override DIALib.IDiaStackWalker::getEnumFrames + } // end of method DiaStackWalkerClass::getEnumFrames + + .method public hidebysig newslot virtual + instance void getEnumFrames2([in] valuetype DIALib.CV_CPU_TYPE_e cpuid, + [in] class DIALib.IDiaStackWalkHelper marshal( interface ) pHelper, + [out] class DIALib.IDiaEnumStackFrames& marshal( interface ) ppenum) runtime managed internalcall + { + .override DIALib.IDiaStackWalker::getEnumFrames2 + } // end of method DiaStackWalkerClass::getEnumFrames2 + +} // end of class DIALib.DiaStackWalkerClass + +.class interface public abstract auto ansi import DIALib.ISequentialStream +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 30 43 37 33 33 41 33 30 2D 32 41 31 43 // ..$0C733A30-2A1C + 2D 31 31 43 45 2D 41 44 45 35 2D 30 30 41 41 30 // -11CE-ADE5-00AA0 + 30 34 34 37 37 33 44 00 00 ) // 044773D.. + .method public hidebysig newslot abstract virtual + instance void RemoteRead([out] uint8& pv, + [in] uint32 cb, + [out] uint32& pcbRead) runtime managed internalcall + { + } // end of method ISequentialStream::RemoteRead + + .method public hidebysig newslot abstract virtual + instance void RemoteWrite([in] uint8& pv, + [in] uint32 cb, + [out] uint32& pcbWritten) runtime managed internalcall + { + } // end of method ISequentialStream::RemoteWrite + +} // end of class DIALib.ISequentialStream + +.class interface public abstract auto ansi import DIALib.IStream + implements DIALib.ISequentialStream +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 30 30 30 30 30 30 30 43 2D 30 30 30 30 // ..$0000000C-0000 + 2D 30 30 30 30 2D 43 30 30 30 2D 30 30 30 30 30 // -0000-C000-00000 + 30 30 30 30 30 34 36 00 00 ) // 0000046.. + .method public hidebysig newslot abstract virtual + instance void RemoteRead([out] uint8& pv, + [in] uint32 cb, + [out] uint32& pcbRead) runtime managed internalcall + { + } // end of method IStream::RemoteRead + + .method public hidebysig newslot abstract virtual + instance void RemoteWrite([in] uint8& pv, + [in] uint32 cb, + [out] uint32& pcbWritten) runtime managed internalcall + { + } // end of method IStream::RemoteWrite + + .method public hidebysig newslot abstract virtual + instance void RemoteSeek([in] valuetype DIALib._LARGE_INTEGER dlibMove, + [in] uint32 dwOrigin, + [out] valuetype DIALib._ULARGE_INTEGER& plibNewPosition) runtime managed internalcall + { + } // end of method IStream::RemoteSeek + + .method public hidebysig newslot abstract virtual + instance void SetSize([in] valuetype DIALib._ULARGE_INTEGER libNewSize) runtime managed internalcall + { + } // end of method IStream::SetSize + + .method public hidebysig newslot abstract virtual + instance void RemoteCopyTo([in] class DIALib.IStream marshal( interface ) pstm, + [in] valuetype DIALib._ULARGE_INTEGER cb, + [out] valuetype DIALib._ULARGE_INTEGER& pcbRead, + [out] valuetype DIALib._ULARGE_INTEGER& pcbWritten) runtime managed internalcall + { + } // end of method IStream::RemoteCopyTo + + .method public hidebysig newslot abstract virtual + instance void Commit([in] uint32 grfCommitFlags) runtime managed internalcall + { + } // end of method IStream::Commit + + .method public hidebysig newslot abstract virtual + instance void Revert() runtime managed internalcall + { + } // end of method IStream::Revert + + .method public hidebysig newslot abstract virtual + instance void LockRegion([in] valuetype DIALib._ULARGE_INTEGER libOffset, + [in] valuetype DIALib._ULARGE_INTEGER cb, + [in] uint32 dwLockType) runtime managed internalcall + { + } // end of method IStream::LockRegion + + .method public hidebysig newslot abstract virtual + instance void UnlockRegion([in] valuetype DIALib._ULARGE_INTEGER libOffset, + [in] valuetype DIALib._ULARGE_INTEGER cb, + [in] uint32 dwLockType) runtime managed internalcall + { + } // end of method IStream::UnlockRegion + + .method public hidebysig newslot abstract virtual + instance void Stat([out] valuetype DIALib.tagSTATSTG& pstatstg, + [in] uint32 grfStatFlag) runtime managed internalcall + { + } // end of method IStream::Stat + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IStream& marshal( interface ) ppstm) runtime managed internalcall + { + } // end of method IStream::Clone + +} // end of class DIALib.IStream + +.class interface public abstract auto ansi import DIALib.IDiaSession +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 32 46 36 30 39 45 45 31 2D 44 31 43 38 // ..$2F609EE1-D1C8 + 2D 34 45 32 34 2D 38 32 38 38 2D 33 33 32 36 42 // -4E24-8288-3326B + 41 44 43 44 32 31 31 00 00 ) // ADCD211.. + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_loadAddress() runtime managed internalcall + { + } // end of method IDiaSession::get_loadAddress + + .method public hidebysig newslot specialname abstract virtual + instance void set_loadAddress([in] uint64 pRetVal) runtime managed internalcall + { + } // end of method IDiaSession::set_loadAddress + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_globalScope() runtime managed internalcall + { + } // end of method IDiaSession::get_globalScope + + .method public hidebysig newslot abstract virtual + instance void getEnumTables([out] class DIALib.IDiaEnumTables& marshal( interface ) ppEnumTables) runtime managed internalcall + { + } // end of method IDiaSession::getEnumTables + + .method public hidebysig newslot abstract virtual + instance void getSymbolsByAddr([out] class DIALib.IDiaEnumSymbolsByAddr& marshal( interface ) ppEnumbyAddr) runtime managed internalcall + { + } // end of method IDiaSession::getSymbolsByAddr + + .method public hidebysig newslot abstract virtual + instance void findChildren([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findChildren + + .method public hidebysig newslot abstract virtual + instance void findChildrenEx([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findChildrenEx + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByAddr([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findChildrenExByAddr + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByVA([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findChildrenExByVA + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByRVA([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findChildrenExByRVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolByAddr([in] uint32 isect, + [in] uint32 offset, + [in] valuetype DIALib.SymTagEnum symTag, + [out] class DIALib.IDiaSymbol& marshal( interface ) ppSymbol) runtime managed internalcall + { + } // end of method IDiaSession::findSymbolByAddr + + .method public hidebysig newslot abstract virtual + instance void findSymbolByRVA([in] uint32 rva, + [in] valuetype DIALib.SymTagEnum symTag, + [out] class DIALib.IDiaSymbol& marshal( interface ) ppSymbol) runtime managed internalcall + { + } // end of method IDiaSession::findSymbolByRVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolByVA([in] uint64 va, + [in] valuetype DIALib.SymTagEnum symTag, + [out] class DIALib.IDiaSymbol& marshal( interface ) ppSymbol) runtime managed internalcall + { + } // end of method IDiaSession::findSymbolByVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolByToken([in] uint32 token, + [in] valuetype DIALib.SymTagEnum symTag, + [out] class DIALib.IDiaSymbol& marshal( interface ) ppSymbol) runtime managed internalcall + { + } // end of method IDiaSession::findSymbolByToken + + .method public hidebysig newslot abstract virtual + instance void symsAreEquiv([in] class DIALib.IDiaSymbol marshal( interface ) symbolA, + [in] class DIALib.IDiaSymbol marshal( interface ) symbolB) runtime managed internalcall + { + } // end of method IDiaSession::symsAreEquiv + + .method public hidebysig newslot abstract virtual + instance void symbolById([in] uint32 id, + [out] class DIALib.IDiaSymbol& marshal( interface ) ppSymbol) runtime managed internalcall + { + } // end of method IDiaSession::symbolById + + .method public hidebysig newslot abstract virtual + instance void findSymbolByRVAEx([in] uint32 rva, + [in] valuetype DIALib.SymTagEnum symTag, + [out] class DIALib.IDiaSymbol& marshal( interface ) ppSymbol, + [out] int32& displacement) runtime managed internalcall + { + } // end of method IDiaSession::findSymbolByRVAEx + + .method public hidebysig newslot abstract virtual + instance void findSymbolByVAEx([in] uint64 va, + [in] valuetype DIALib.SymTagEnum symTag, + [out] class DIALib.IDiaSymbol& marshal( interface ) ppSymbol, + [out] int32& displacement) runtime managed internalcall + { + } // end of method IDiaSession::findSymbolByVAEx + + .method public hidebysig newslot abstract virtual + instance void findFile([in] class DIALib.IDiaSymbol marshal( interface ) pCompiland, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSourceFiles& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findFile + + .method public hidebysig newslot abstract virtual + instance void findFileById([in] uint32 uniqueId, + [out] class DIALib.IDiaSourceFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findFileById + + .method public hidebysig newslot abstract virtual + instance void findLines([in] class DIALib.IDiaSymbol marshal( interface ) compiland, + [in] class DIALib.IDiaSourceFile marshal( interface ) file, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findLines + + .method public hidebysig newslot abstract virtual + instance void findLinesByAddr([in] uint32 seg, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findLinesByAddr + + .method public hidebysig newslot abstract virtual + instance void findLinesByRVA([in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findLinesByRVA + + .method public hidebysig newslot abstract virtual + instance void findLinesByVA([in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findLinesByVA + + .method public hidebysig newslot abstract virtual + instance void findLinesByLinenum([in] class DIALib.IDiaSymbol marshal( interface ) compiland, + [in] class DIALib.IDiaSourceFile marshal( interface ) file, + [in] uint32 linenum, + [in] uint32 column, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findLinesByLinenum + + .method public hidebysig newslot abstract virtual + instance void findInjectedSource([in] string marshal( lpwstr) srcFile, + [out] class DIALib.IDiaEnumInjectedSources& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInjectedSource + + .method public hidebysig newslot abstract virtual + instance void getEnumDebugStreams([out] class DIALib.IDiaEnumDebugStreams& marshal( interface ) ppEnumDebugStreams) runtime managed internalcall + { + } // end of method IDiaSession::getEnumDebugStreams + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByAddr([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineFramesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByRVA([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineFramesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByVA([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineFramesByVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLines([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineeLines + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByAddr([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] uint32 isect, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineeLinesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByRVA([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineeLinesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByVA([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineeLinesByVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByLinenum([in] class DIALib.IDiaSymbol marshal( interface ) compiland, + [in] class DIALib.IDiaSourceFile marshal( interface ) file, + [in] uint32 linenum, + [in] uint32 column, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineeLinesByLinenum + + .method public hidebysig newslot abstract virtual + instance void findInlineesByName([in] string marshal( lpwstr) name, + [in] uint32 option, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInlineesByName + + .method public hidebysig newslot abstract virtual + instance void findAcceleratorInlineeLinesByLinenum([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] class DIALib.IDiaSourceFile marshal( interface ) file, + [in] uint32 linenum, + [in] uint32 column, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findAcceleratorInlineeLinesByLinenum + + .method public hidebysig newslot abstract virtual + instance void findSymbolsForAcceleratorPointerTag([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] uint32 tagValue, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findSymbolsForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void findSymbolsByRVAForAcceleratorPointerTag([in] class DIALib.IDiaSymbol marshal( interface ) parent, + [in] uint32 tagValue, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findSymbolsByRVAForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void findAcceleratorInlineesByName([in] string marshal( lpwstr) name, + [in] uint32 option, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findAcceleratorInlineesByName + + .method public hidebysig newslot abstract virtual + instance void addressForVA([in] uint64 va, + [out] uint32& pISect, + [out] uint32& pOffset) runtime managed internalcall + { + } // end of method IDiaSession::addressForVA + + .method public hidebysig newslot abstract virtual + instance void addressForRVA([in] uint32 rva, + [out] uint32& pISect, + [out] uint32& pOffset) runtime managed internalcall + { + } // end of method IDiaSession::addressForRVA + + .method public hidebysig newslot abstract virtual + instance void findILOffsetsByAddr([in] uint32 isect, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findILOffsetsByAddr + + .method public hidebysig newslot abstract virtual + instance void findILOffsetsByRVA([in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findILOffsetsByRVA + + .method public hidebysig newslot abstract virtual + instance void findILOffsetsByVA([in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findILOffsetsByVA + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyFiles([out] class DIALib.IDiaEnumInputAssemblyFiles& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInputAssemblyFiles + + .method public hidebysig newslot abstract virtual + instance void findInputAssembly([in] uint32 index, + [out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInputAssembly + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyById([in] uint32 uniqueId, + [out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInputAssemblyById + + .method public hidebysig newslot abstract virtual + instance void getFuncMDTokenMapSize([out] uint32& pcb) runtime managed internalcall + { + } // end of method IDiaSession::getFuncMDTokenMapSize + + .method public hidebysig newslot abstract virtual + instance void getFuncMDTokenMap([in] uint32 cb, + [out] uint32& pcb, + [out] uint8& pb) runtime managed internalcall + { + } // end of method IDiaSession::getFuncMDTokenMap + + .method public hidebysig newslot abstract virtual + instance void getTypeMDTokenMapSize([out] uint32& pcb) runtime managed internalcall + { + } // end of method IDiaSession::getTypeMDTokenMapSize + + .method public hidebysig newslot abstract virtual + instance void getTypeMDTokenMap([in] uint32 cb, + [out] uint32& pcb, + [out] uint8& pb) runtime managed internalcall + { + } // end of method IDiaSession::getTypeMDTokenMap + + .method public hidebysig newslot abstract virtual + instance void getNumberOfFunctionFragments_VA([in] uint64 vaFunc, + [in] uint32 cbFunc, + [out] uint32& pNumFragments) runtime managed internalcall + { + } // end of method IDiaSession::getNumberOfFunctionFragments_VA + + .method public hidebysig newslot abstract virtual + instance void getNumberOfFunctionFragments_RVA([in] uint32 rvaFunc, + [in] uint32 cbFunc, + [out] uint32& pNumFragments) runtime managed internalcall + { + } // end of method IDiaSession::getNumberOfFunctionFragments_RVA + + .method public hidebysig newslot abstract virtual + instance void getFunctionFragments_VA([in] uint64 vaFunc, + [in] uint32 cbFunc, + [in] uint32 cFragments, + [out] uint64& pVaFragment, + [out] uint32& pLenFragment) runtime managed internalcall + { + } // end of method IDiaSession::getFunctionFragments_VA + + .method public hidebysig newslot abstract virtual + instance void getFunctionFragments_RVA([in] uint32 rvaFunc, + [in] uint32 cbFunc, + [in] uint32 cFragments, + [out] uint32& pRvaFragment, + [out] uint32& pLenFragment) runtime managed internalcall + { + } // end of method IDiaSession::getFunctionFragments_RVA + + .method public hidebysig newslot abstract virtual + instance void getExports([out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::getExports + + .method public hidebysig newslot abstract virtual + instance void getHeapAllocationSites([out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::getHeapAllocationSites + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyFile([in] class DIALib.IDiaSymbol marshal( interface ) pSymbol, + [out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSession::findInputAssemblyFile + + .property uint64 loadAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .set instance void DIALib.IDiaSession::set_loadAddress(uint64) + .get instance uint64 DIALib.IDiaSession::get_loadAddress() + } // end of property IDiaSession::loadAddress + .property class DIALib.IDiaSymbol globalScope() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSession::get_globalScope() + } // end of property IDiaSession::globalScope +} // end of class DIALib.IDiaSession + +.class interface public abstract auto ansi import DIALib.IDiaStackWalkHelper +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 32 31 46 38 31 42 31 42 2D 43 35 42 42 // ..$21F81B1B-C5BB + 2D 34 32 41 33 2D 42 43 34 46 2D 43 43 42 41 41 // -42A3-BC4F-CCBAA + 37 35 42 39 46 31 39 00 00 ) // 75B9F19.. + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_registerValue([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::get_registerValue + + .method public hidebysig newslot specialname abstract virtual + instance void set_registerValue([in] uint32 index, + [in] uint64 pRetVal) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::set_registerValue + + .method public hidebysig newslot abstract virtual + instance void readMemory([in] valuetype DIALib.MemoryTypeEnum 'type', + [in] uint64 va, + [in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::readMemory + + .method public hidebysig newslot abstract virtual + instance void searchForReturnAddress([in] class DIALib.IDiaFrameData marshal( interface ) frame, + [out] uint64& returnAddress) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::searchForReturnAddress + + .method public hidebysig newslot abstract virtual + instance void searchForReturnAddressStart([in] class DIALib.IDiaFrameData marshal( interface ) frame, + [in] uint64 startAddress, + [out] uint64& returnAddress) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::searchForReturnAddressStart + + .method public hidebysig newslot abstract virtual + instance void frameForVA([in] uint64 va, + [out] class DIALib.IDiaFrameData& marshal( interface ) ppFrame) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::frameForVA + + .method public hidebysig newslot abstract virtual + instance void symbolForVA([in] uint64 va, + [out] class DIALib.IDiaSymbol& marshal( interface ) ppSymbol) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::symbolForVA + + .method public hidebysig newslot abstract virtual + instance void pdataForVA([in] uint64 va, + [in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::pdataForVA + + .method public hidebysig newslot abstract virtual + instance void imageForVA([in] uint64 vaContext, + [out] uint64& pvaImageStart) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::imageForVA + + .method public hidebysig newslot abstract virtual + instance void addressForVA([in] uint64 va, + [out] uint32& pISect, + [out] uint32& pOffset) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::addressForVA + + .method public hidebysig newslot abstract virtual + instance void numberOfFunctionFragmentsForVA([in] uint64 vaFunc, + [in] uint32 cbFunc, + [out] uint32& pNumFragments) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::numberOfFunctionFragmentsForVA + + .method public hidebysig newslot abstract virtual + instance void functionFragmentsForVA([in] uint64 vaFunc, + [in] uint32 cbFunc, + [in] uint32 cFragments, + [out] uint64& pVaFragment, + [out] uint32& pLenFragment) runtime managed internalcall + { + } // end of method IDiaStackWalkHelper::functionFragmentsForVA + + .property uint64 registerValue(uint32) + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaStackWalkHelper::get_registerValue(uint32) + .set instance void DIALib.IDiaStackWalkHelper::set_registerValue(uint32, + uint64) + } // end of property IDiaStackWalkHelper::registerValue +} // end of class DIALib.IDiaStackWalkHelper + +.class interface public abstract auto ansi import DIALib.IDiaEnumStackFrames +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 45 43 39 44 34 36 31 44 2D 43 45 37 34 // ..$EC9D461D-CE74 + 2D 34 37 31 31 2D 41 30 32 30 2D 37 44 38 46 39 // -4711-A020-7D8F9 + 41 31 44 44 32 35 35 00 00 ) // A1DD255.. + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaStackFrame& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumStackFrames::Next + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumStackFrames::Reset + +} // end of class DIALib.IDiaEnumStackFrames + +.class public auto ansi sealed DIALib.CV_CPU_TYPE_e + extends [mscorlib]System.Enum +{ + .field public specialname rtspecialname int32 value__ + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_8080 = int32(0x00000000) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_8086 = int32(0x00000001) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_80286 = int32(0x00000002) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_80386 = int32(0x00000003) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_80486 = int32(0x00000004) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PENTIUM = int32(0x00000005) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PENTIUMII = int32(0x00000006) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PENTIUMPRO = int32(0x00000006) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PENTIUMIII = int32(0x00000007) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPS = int32(0x00000010) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPSR4000 = int32(0x00000010) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPS16 = int32(0x00000011) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPS32 = int32(0x00000012) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPS64 = int32(0x00000013) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPSI = int32(0x00000014) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPSII = int32(0x00000015) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPSIII = int32(0x00000016) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPSIV = int32(0x00000017) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_MIPSV = int32(0x00000018) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_M68000 = int32(0x00000020) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_M68010 = int32(0x00000021) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_M68020 = int32(0x00000022) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_M68030 = int32(0x00000023) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_M68040 = int32(0x00000024) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ALPHA = int32(0x00000030) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ALPHA_21064 = int32(0x00000030) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ALPHA_21164 = int32(0x00000031) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ALPHA_21164A = int32(0x00000032) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ALPHA_21264 = int32(0x00000033) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ALPHA_21364 = int32(0x00000034) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PPC601 = int32(0x00000040) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PPC603 = int32(0x00000041) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PPC604 = int32(0x00000042) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PPC620 = int32(0x00000043) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PPCFP = int32(0x00000044) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_PPCBE = int32(0x00000045) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_SH3 = int32(0x00000050) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_SH3E = int32(0x00000051) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_SH3DSP = int32(0x00000052) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_SH4 = int32(0x00000053) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_SHMEDIA = int32(0x00000054) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM3 = int32(0x00000060) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM4 = int32(0x00000061) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM4T = int32(0x00000062) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM5 = int32(0x00000063) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM5T = int32(0x00000064) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM6 = int32(0x00000065) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM_XMAC = int32(0x00000066) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM_WMMX = int32(0x00000067) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM7 = int32(0x00000068) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_OMNI = int32(0x00000070) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_IA64 = int32(0x00000080) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_IA64_1 = int32(0x00000080) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_IA64_2 = int32(0x00000081) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_CEE = int32(0x00000090) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_AM33 = int32(0x000000A0) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_M32R = int32(0x000000B0) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_TRICORE = int32(0x000000C0) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_X64 = int32(0x000000D0) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_AMD64 = int32(0x000000D0) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_EBC = int32(0x000000E0) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_THUMB = int32(0x000000F0) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARMNT = int32(0x000000F4) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM64 = int32(0x000000F6) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_HYBRID_X86_ARM64 = int32(0x000000F7) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM64EC = int32(0x000000F8) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_ARM64X = int32(0x000000F9) + .field public static literal valuetype DIALib.CV_CPU_TYPE_e CV_CFL_D3D11_SHADER = int32(0x00000100) +} // end of class DIALib.CV_CPU_TYPE_e + +.class public sequential ansi sealed beforefieldinit DIALib._LARGE_INTEGER + extends [mscorlib]System.ValueType +{ + .pack 8 + .size 0 + .field public int64 QuadPart +} // end of class DIALib._LARGE_INTEGER + +.class public sequential ansi sealed beforefieldinit DIALib._ULARGE_INTEGER + extends [mscorlib]System.ValueType +{ + .pack 8 + .size 0 + .field public uint64 QuadPart +} // end of class DIALib._ULARGE_INTEGER + +.class public sequential ansi sealed beforefieldinit DIALib.tagSTATSTG + extends [mscorlib]System.ValueType +{ + .pack 8 + .size 0 + .field public marshal( lpwstr) string pwcsName + .field public uint32 'type' + .field public valuetype DIALib._ULARGE_INTEGER cbSize + .field public valuetype DIALib._FILETIME mtime + .field public valuetype DIALib._FILETIME ctime + .field public valuetype DIALib._FILETIME atime + .field public uint32 grfMode + .field public uint32 grfLocksSupported + .field public valuetype [mscorlib]System.Guid 'clsid' + .field public uint32 grfStateBits + .field public uint32 reserved +} // end of class DIALib.tagSTATSTG + +.class public sequential ansi sealed beforefieldinit DIALib._FILETIME + extends [mscorlib]System.ValueType +{ + .pack 4 + .size 0 + .field public uint32 dwLowDateTime + .field public uint32 dwHighDateTime +} // end of class DIALib._FILETIME + +.class interface public abstract auto ansi import DIALib.IDiaSymbol +{ + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 0A 73 79 6D 49 6E 64 65 78 49 64 00 00 ) // ...symIndexId.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 43 42 37 38 37 42 32 46 2D 42 44 36 43 // ..$CB787B2F-BD6C + 2D 34 36 33 35 2D 42 41 35 32 2D 39 33 33 31 32 // -4635-BA52-93312 + 36 42 44 32 44 43 44 00 00 ) // 6BD2DCD.. + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symIndexId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_symIndexId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symTag() runtime managed internalcall + { + } // end of method IDiaSymbol::get_symTag + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_name() runtime managed internalcall + { + } // end of method IDiaSymbol::get_name + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lexicalParent() runtime managed internalcall + { + } // end of method IDiaSymbol::get_lexicalParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_classParent() runtime managed internalcall + { + } // end of method IDiaSymbol::get_classParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_type() runtime managed internalcall + { + } // end of method IDiaSymbol::get_type + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_dataKind() runtime managed internalcall + { + } // end of method IDiaSymbol::get_dataKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_locationType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_locationType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaSymbol::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_registerId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_offset() runtime managed internalcall + { + } // end of method IDiaSymbol::get_offset + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_length() runtime managed internalcall + { + } // end of method IDiaSymbol::get_length + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_slot() runtime managed internalcall + { + } // end of method IDiaSymbol::get_slot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_volatileType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_volatileType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_constType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_unalignedType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_unalignedType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_access() runtime managed internalcall + { + } // end of method IDiaSymbol::get_access + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_libraryName() runtime managed internalcall + { + } // end of method IDiaSymbol::get_libraryName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_platform() runtime managed internalcall + { + } // end of method IDiaSymbol::get_platform + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_language() runtime managed internalcall + { + } // end of method IDiaSymbol::get_language + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_editAndContinueEnabled() runtime managed internalcall + { + } // end of method IDiaSymbol::get_editAndContinueEnabled + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol::get_frontEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol::get_frontEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol::get_frontEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol::get_backEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol::get_backEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol::get_backEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_sourceFileName() runtime managed internalcall + { + } // end of method IDiaSymbol::get_sourceFileName + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_unused() runtime managed internalcall + { + } // end of method IDiaSymbol::get_unused + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_thunkOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol::get_thunkOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_thisAdjust() runtime managed internalcall + { + } // end of method IDiaSymbol::get_thisAdjust + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseOffset() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtualBaseOffset + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtual() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtual + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intro() runtime managed internalcall + { + } // end of method IDiaSymbol::get_intro + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_pure() runtime managed internalcall + { + } // end of method IDiaSymbol::get_pure + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_callingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol::get_callingConvention + + .method public hidebysig newslot specialname abstract virtual + instance object + marshal( struct) + get_value() runtime managed internalcall + { + } // end of method IDiaSymbol::get_value + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_baseType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_token() runtime managed internalcall + { + } // end of method IDiaSymbol::get_token + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_timeStamp() runtime managed internalcall + { + } // end of method IDiaSymbol::get_timeStamp + + .method public hidebysig newslot specialname abstract virtual + instance valuetype [mscorlib]System.Guid + get_guid() runtime managed internalcall + { + } // end of method IDiaSymbol::get_guid + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_symbolsFileName() runtime managed internalcall + { + } // end of method IDiaSymbol::get_symbolsFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_reference() runtime managed internalcall + { + } // end of method IDiaSymbol::get_reference + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_count() runtime managed internalcall + { + } // end of method IDiaSymbol::get_count + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bitPosition() runtime managed internalcall + { + } // end of method IDiaSymbol::get_bitPosition + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_arrayIndexType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_arrayIndexType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_packed() runtime managed internalcall + { + } // end of method IDiaSymbol::get_packed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constructor() runtime managed internalcall + { + } // end of method IDiaSymbol::get_constructor + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_overloadedOperator() runtime managed internalcall + { + } // end of method IDiaSymbol::get_overloadedOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_nested() runtime managed internalcall + { + } // end of method IDiaSymbol::get_nested + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasNestedTypes() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasNestedTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAssignmentOperator() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasAssignmentOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasCastOperator() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasCastOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_scoped() runtime managed internalcall + { + } // end of method IDiaSymbol::get_scoped + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_indirectVirtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol::get_indirectVirtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBasePointerOffset() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtualBasePointerOffset + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualTableShape() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtualTableShape + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lexicalParentId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_lexicalParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_classParentId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_classParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_typeId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_typeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_arrayIndexTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_arrayIndexTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualTableShapeId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtualTableShapeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_code() runtime managed internalcall + { + } // end of method IDiaSymbol::get_code + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_function() runtime managed internalcall + { + } // end of method IDiaSymbol::get_function + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_managed() runtime managed internalcall + { + } // end of method IDiaSymbol::get_managed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_msil() runtime managed internalcall + { + } // end of method IDiaSymbol::get_msil + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseDispIndex() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtualBaseDispIndex + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_undecoratedName() runtime managed internalcall + { + } // end of method IDiaSymbol::get_undecoratedName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_age() runtime managed internalcall + { + } // end of method IDiaSymbol::get_age + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_signature() runtime managed internalcall + { + } // end of method IDiaSymbol::get_signature + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_compilerGenerated() runtime managed internalcall + { + } // end of method IDiaSymbol::get_compilerGenerated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_addressTaken() runtime managed internalcall + { + } // end of method IDiaSymbol::get_addressTaken + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_rank() runtime managed internalcall + { + } // end of method IDiaSymbol::get_rank + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lowerBound() runtime managed internalcall + { + } // end of method IDiaSymbol::get_lowerBound + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_upperBound() runtime managed internalcall + { + } // end of method IDiaSymbol::get_upperBound + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lowerBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_lowerBoundId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_upperBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_upperBoundId + + .method public hidebysig newslot abstract virtual + instance void get_dataBytes([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaSymbol::get_dataBytes + + .method public hidebysig newslot abstract virtual + instance void findChildren([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findChildren + + .method public hidebysig newslot abstract virtual + instance void findChildrenEx([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findChildrenEx + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByAddr([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findChildrenExByAddr + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findChildrenExByVA + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByRVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findChildrenExByRVA + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetSection() runtime managed internalcall + { + } // end of method IDiaSymbol::get_targetSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetOffset() runtime managed internalcall + { + } // end of method IDiaSymbol::get_targetOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol::get_targetRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_targetVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol::get_targetVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_machineType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_machineType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_oemId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_oemSymbolId + + .method public hidebysig newslot abstract virtual + instance void get_types([in] uint32 cTypes, + [out] uint32& pcTypes, + [out] class DIALib.IDiaSymbol& marshal( interface ) pTypes) runtime managed internalcall + { + } // end of method IDiaSymbol::get_types + + .method public hidebysig newslot abstract virtual + instance void get_typeIds([in] uint32 cTypeIds, + [out] uint32& pcTypeIds, + [out] uint32& pdwTypeIds) runtime managed internalcall + { + } // end of method IDiaSymbol::get_typeIds + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_objectPointerType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_objectPointerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_udtKind() runtime managed internalcall + { + } // end of method IDiaSymbol::get_udtKind + + .method public hidebysig newslot abstract virtual + instance void get_undecoratedNameEx([in] uint32 undecorateOptions, + [out] string& marshal( bstr) name) runtime managed internalcall + { + } // end of method IDiaSymbol::get_undecoratedNameEx + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noReturn() runtime managed internalcall + { + } // end of method IDiaSymbol::get_noReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_customCallingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol::get_customCallingConvention + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noInline() runtime managed internalcall + { + } // end of method IDiaSymbol::get_noInline + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_optimizedCodeDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol::get_optimizedCodeDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_notReached() runtime managed internalcall + { + } // end of method IDiaSymbol::get_notReached + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_interruptReturn() runtime managed internalcall + { + } // end of method IDiaSymbol::get_interruptReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_farReturn() runtime managed internalcall + { + } // end of method IDiaSymbol::get_farReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStatic() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isStatic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLTCG() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isLTCG + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isDataAligned() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isDataAligned + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSecurityChecks() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasSecurityChecks + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_compilerName() runtime managed internalcall + { + } // end of method IDiaSymbol::get_compilerName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAlloca() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasAlloca + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSetJump() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasSetJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasLongJump() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasLongJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasInlAsm() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasInlAsm + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEH() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSEH() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasSEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEHa() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasEHa + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isNaked() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isNaked + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAggregated() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isAggregated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSplitted() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isSplitted + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_container() runtime managed internalcall + { + } // end of method IDiaSymbol::get_container + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_inlSpec() runtime managed internalcall + { + } // end of method IDiaSymbol::get_inlSpec + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noStackOrdering() runtime managed internalcall + { + } // end of method IDiaSymbol::get_noStackOrdering + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualBaseTableType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_virtualBaseTableType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasManagedCode() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasManagedCode + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHotpatchable() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isHotpatchable + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCVTCIL() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isCVTCIL + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMSILNetmodule() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isMSILNetmodule + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCTypes() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isCTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStripped() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isStripped + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol::get_frontEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol::get_backEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_wasInlined() runtime managed internalcall + { + } // end of method IDiaSymbol::get_wasInlined + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_strictGSCheck() runtime managed internalcall + { + } // end of method IDiaSymbol::get_strictGSCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCxxReturnUdt() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isCxxReturnUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isConstructorVirtualBase() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isConstructorVirtualBase + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_RValueReference() runtime managed internalcall + { + } // end of method IDiaSymbol::get_RValueReference + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_unmodifiedType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_unmodifiedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_framePointerPresent() runtime managed internalcall + { + } // end of method IDiaSymbol::get_framePointerPresent + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSafeBuffers() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isSafeBuffers + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intrinsic() runtime managed internalcall + { + } // end of method IDiaSymbol::get_intrinsic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_sealed() runtime managed internalcall + { + } // end of method IDiaSymbol::get_sealed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaFloat() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hfaFloat + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaDouble() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hfaDouble + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol::get_liveRangeStartAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol::get_liveRangeStartAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol::get_liveRangeStartRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_countLiveRanges() runtime managed internalcall + { + } // end of method IDiaSymbol::get_countLiveRanges + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_liveRangeLength() runtime managed internalcall + { + } // end of method IDiaSymbol::get_liveRangeLength + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_offsetInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol::get_offsetInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_paramBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_paramBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_localBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_localBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLocationControlFlowDependent() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isLocationControlFlowDependent + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_stride() runtime managed internalcall + { + } // end of method IDiaSymbol::get_stride + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRows() runtime managed internalcall + { + } // end of method IDiaSymbol::get_numberOfRows + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfColumns() runtime managed internalcall + { + } // end of method IDiaSymbol::get_numberOfColumns + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMatrixRowMajor() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isMatrixRowMajor + + .method public hidebysig newslot abstract virtual + instance void get_numericProperties([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pProperties) runtime managed internalcall + { + } // end of method IDiaSymbol::get_numericProperties + + .method public hidebysig newslot abstract virtual + instance void get_modifierValues([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint16& pModifiers) runtime managed internalcall + { + } // end of method IDiaSymbol::get_modifierValues + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isReturnValue() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isReturnValue + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedAway() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isOptimizedAway + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_builtInKind() runtime managed internalcall + { + } // end of method IDiaSymbol::get_builtInKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_registerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataSlot() runtime managed internalcall + { + } // end of method IDiaSymbol::get_baseDataSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataOffset() runtime managed internalcall + { + } // end of method IDiaSymbol::get_baseDataOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_textureSlot() runtime managed internalcall + { + } // end of method IDiaSymbol::get_textureSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_samplerSlot() runtime managed internalcall + { + } // end of method IDiaSymbol::get_samplerSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_uavSlot() runtime managed internalcall + { + } // end of method IDiaSymbol::get_uavSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_sizeInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol::get_sizeInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_memorySpaceKind() runtime managed internalcall + { + } // end of method IDiaSymbol::get_memorySpaceKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_unmodifiedTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_unmodifiedTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_subTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_subTypeId + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_subType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_subType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfModifiers() runtime managed internalcall + { + } // end of method IDiaSymbol::get_numberOfModifiers + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRegisterIndices() runtime managed internalcall + { + } // end of method IDiaSymbol::get_numberOfRegisterIndices + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHLSLData() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isHLSLData + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToDataMember() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isPointerToDataMember + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToMemberFunction() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isPointerToMemberFunction + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSingleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isSingleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMultipleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isMultipleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isVirtualInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isVirtualInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_restrictedType() runtime managed internalcall + { + } // end of method IDiaSymbol::get_restrictedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerBasedOnSymbolValue() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isPointerBasedOnSymbolValue + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_baseSymbol() runtime managed internalcall + { + } // end of method IDiaSymbol::get_baseSymbol + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol::get_baseSymbolId + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_objectFileName() runtime managed internalcall + { + } // end of method IDiaSymbol::get_objectFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorGroupSharedLocal() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isAcceleratorGroupSharedLocal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorPointerTagLiveRange() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isAcceleratorPointerTagLiveRange + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorStubFunction() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isAcceleratorStubFunction + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfAcceleratorPointerTags() runtime managed internalcall + { + } // end of method IDiaSymbol::get_numberOfAcceleratorPointerTags + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSdl() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isSdl + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isWinRTPointer() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isWinRTPointer + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isRefUdt() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isRefUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isValueUdt() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isValueUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isInterfaceUdt() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isInterfaceUdt + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByAddr([in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findInlineFramesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByRVA([in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findInlineFramesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByVA([in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findInlineFramesByVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLines([out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findInlineeLines + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByAddr([in] uint32 isect, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findInlineeLinesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByRVA([in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findInlineeLinesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByVA([in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findInlineeLinesByVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolsForAcceleratorPointerTag([in] uint32 tagValue, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findSymbolsForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void findSymbolsByRVAForAcceleratorPointerTag([in] uint32 tagValue, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findSymbolsByRVAForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void get_acceleratorPointerTags([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pPointerTags) runtime managed internalcall + { + } // end of method IDiaSymbol::get_acceleratorPointerTags + + .method public hidebysig newslot abstract virtual + instance void getSrcLineOnTypeDefn([out] class DIALib.IDiaLineNumber& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::getSrcLineOnTypeDefn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPGO() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isPGO + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasValidPGOCounts() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasValidPGOCounts + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedForSpeed() runtime managed internalcall + { + } // end of method IDiaSymbol::get_isOptimizedForSpeed + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEntryCount() runtime managed internalcall + { + } // end of method IDiaSymbol::get_PGOEntryCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEdgeCount() runtime managed internalcall + { + } // end of method IDiaSymbol::get_PGOEdgeCount + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_PGODynamicInstructionCount() runtime managed internalcall + { + } // end of method IDiaSymbol::get_PGODynamicInstructionCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_staticSize() runtime managed internalcall + { + } // end of method IDiaSymbol::get_staticSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_finalLiveStaticSize() runtime managed internalcall + { + } // end of method IDiaSymbol::get_finalLiveStaticSize + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_phaseName() runtime managed internalcall + { + } // end of method IDiaSymbol::get_phaseName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasControlFlowCheck() runtime managed internalcall + { + } // end of method IDiaSymbol::get_hasControlFlowCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constantExport() runtime managed internalcall + { + } // end of method IDiaSymbol::get_constantExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_dataExport() runtime managed internalcall + { + } // end of method IDiaSymbol::get_dataExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_privateExport() runtime managed internalcall + { + } // end of method IDiaSymbol::get_privateExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noNameExport() runtime managed internalcall + { + } // end of method IDiaSymbol::get_noNameExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportHasExplicitlyAssignedOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol::get_exportHasExplicitlyAssignedOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportIsForwarder() runtime managed internalcall + { + } // end of method IDiaSymbol::get_exportIsForwarder + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_ordinal() runtime managed internalcall + { + } // end of method IDiaSymbol::get_ordinal + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frameSize() runtime managed internalcall + { + } // end of method IDiaSymbol::get_frameSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol::get_exceptionHandlerAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol::get_exceptionHandlerAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol::get_exceptionHandlerRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_exceptionHandlerVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol::get_exceptionHandlerVirtualAddress + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyFile([out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol::findInputAssemblyFile + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_characteristics() runtime managed internalcall + { + } // end of method IDiaSymbol::get_characteristics + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_coffGroup() runtime managed internalcall + { + } // end of method IDiaSymbol::get_coffGroup + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindID() runtime managed internalcall + { + } // end of method IDiaSymbol::get_bindID + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSpace() runtime managed internalcall + { + } // end of method IDiaSymbol::get_bindSpace + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSlot() runtime managed internalcall + { + } // end of method IDiaSymbol::get_bindSlot + + .property uint32 symIndexId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 00 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_symIndexId() + } // end of property IDiaSymbol::symIndexId + .property uint32 symTag() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_symTag() + } // end of property IDiaSymbol::symTag + .property string name() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol::get_name() + } // end of property IDiaSymbol::name + .property class DIALib.IDiaSymbol lexicalParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_lexicalParent() + } // end of property IDiaSymbol::lexicalParent + .property class DIALib.IDiaSymbol classParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_classParent() + } // end of property IDiaSymbol::classParent + .property class DIALib.IDiaSymbol 'type'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_type() + } // end of property IDiaSymbol::'type' + .property uint32 dataKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_dataKind() + } // end of property IDiaSymbol::dataKind + .property uint32 locationType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_locationType() + } // end of property IDiaSymbol::locationType + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_addressSection() + } // end of property IDiaSymbol::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_addressOffset() + } // end of property IDiaSymbol::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_relativeVirtualAddress() + } // end of property IDiaSymbol::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol::get_virtualAddress() + } // end of property IDiaSymbol::virtualAddress + .property uint32 registerId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_registerId() + } // end of property IDiaSymbol::registerId + .property int32 offset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_offset() + } // end of property IDiaSymbol::offset + .property uint64 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol::get_length() + } // end of property IDiaSymbol::length + .property uint32 slot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_slot() + } // end of property IDiaSymbol::slot + .property int32 volatileType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 10 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_volatileType() + } // end of property IDiaSymbol::volatileType + .property int32 constType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 11 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_constType() + } // end of property IDiaSymbol::constType + .property int32 unalignedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 12 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_unalignedType() + } // end of property IDiaSymbol::unalignedType + .property uint32 access() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 13 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_access() + } // end of property IDiaSymbol::access + .property string libraryName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 14 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol::get_libraryName() + } // end of property IDiaSymbol::libraryName + .property uint32 platform() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 15 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_platform() + } // end of property IDiaSymbol::platform + .property uint32 language() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 16 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_language() + } // end of property IDiaSymbol::language + .property int32 editAndContinueEnabled() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 17 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_editAndContinueEnabled() + } // end of property IDiaSymbol::editAndContinueEnabled + .property uint32 frontEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 18 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_frontEndMajor() + } // end of property IDiaSymbol::frontEndMajor + .property uint32 frontEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 19 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_frontEndMinor() + } // end of property IDiaSymbol::frontEndMinor + .property uint32 frontEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_frontEndBuild() + } // end of property IDiaSymbol::frontEndBuild + .property uint32 backEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_backEndMajor() + } // end of property IDiaSymbol::backEndMajor + .property uint32 backEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_backEndMinor() + } // end of property IDiaSymbol::backEndMinor + .property uint32 backEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_backEndBuild() + } // end of property IDiaSymbol::backEndBuild + .property string sourceFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1E 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol::get_sourceFileName() + } // end of property IDiaSymbol::sourceFileName + .property string 'unused'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1F 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol::get_unused() + } // end of property IDiaSymbol::'unused' + .property uint32 thunkOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 20 00 00 00 00 00 ) // .. ..... + .get instance uint32 DIALib.IDiaSymbol::get_thunkOrdinal() + } // end of property IDiaSymbol::thunkOrdinal + .property int32 thisAdjust() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 21 00 00 00 00 00 ) // ..!..... + .get instance int32 DIALib.IDiaSymbol::get_thisAdjust() + } // end of property IDiaSymbol::thisAdjust + .property uint32 virtualBaseOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 22 00 00 00 00 00 ) // .."..... + .get instance uint32 DIALib.IDiaSymbol::get_virtualBaseOffset() + } // end of property IDiaSymbol::virtualBaseOffset + .property int32 'virtual'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 23 00 00 00 00 00 ) // ..#..... + .get instance int32 DIALib.IDiaSymbol::get_virtual() + } // end of property IDiaSymbol::'virtual' + .property int32 intro() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 24 00 00 00 00 00 ) // ..$..... + .get instance int32 DIALib.IDiaSymbol::get_intro() + } // end of property IDiaSymbol::intro + .property int32 pure() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 25 00 00 00 00 00 ) // ..%..... + .get instance int32 DIALib.IDiaSymbol::get_pure() + } // end of property IDiaSymbol::pure + .property uint32 callingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 26 00 00 00 00 00 ) // ..&..... + .get instance uint32 DIALib.IDiaSymbol::get_callingConvention() + } // end of property IDiaSymbol::callingConvention + .property object 'value'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 27 00 00 00 00 00 ) // ..'..... + .get instance object DIALib.IDiaSymbol::get_value() + } // end of property IDiaSymbol::'value' + .property uint32 baseType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 28 00 00 00 00 00 ) // ..(..... + .get instance uint32 DIALib.IDiaSymbol::get_baseType() + } // end of property IDiaSymbol::baseType + .property uint32 token() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 29 00 00 00 00 00 ) // ..)..... + .get instance uint32 DIALib.IDiaSymbol::get_token() + } // end of property IDiaSymbol::token + .property uint32 timeStamp() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2A 00 00 00 00 00 ) // ..*..... + .get instance uint32 DIALib.IDiaSymbol::get_timeStamp() + } // end of property IDiaSymbol::timeStamp + .property valuetype [mscorlib]System.Guid + guid() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2B 00 00 00 00 00 ) // ..+..... + .get instance valuetype [mscorlib]System.Guid DIALib.IDiaSymbol::get_guid() + } // end of property IDiaSymbol::guid + .property string symbolsFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2C 00 00 00 00 00 ) // ..,..... + .get instance string DIALib.IDiaSymbol::get_symbolsFileName() + } // end of property IDiaSymbol::symbolsFileName + .property int32 reference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2E 00 00 00 00 00 ) // ........ + .get instance int32 DIALib.IDiaSymbol::get_reference() + } // end of property IDiaSymbol::reference + .property uint32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2F 00 00 00 00 00 ) // ../..... + .get instance uint32 DIALib.IDiaSymbol::get_count() + } // end of property IDiaSymbol::count + .property uint32 bitPosition() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 31 00 00 00 00 00 ) // ..1..... + .get instance uint32 DIALib.IDiaSymbol::get_bitPosition() + } // end of property IDiaSymbol::bitPosition + .property class DIALib.IDiaSymbol arrayIndexType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 32 00 00 00 00 00 ) // ..2..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_arrayIndexType() + } // end of property IDiaSymbol::arrayIndexType + .property int32 packed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 33 00 00 00 00 00 ) // ..3..... + .get instance int32 DIALib.IDiaSymbol::get_packed() + } // end of property IDiaSymbol::packed + .property int32 constructor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 34 00 00 00 00 00 ) // ..4..... + .get instance int32 DIALib.IDiaSymbol::get_constructor() + } // end of property IDiaSymbol::constructor + .property int32 overloadedOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 35 00 00 00 00 00 ) // ..5..... + .get instance int32 DIALib.IDiaSymbol::get_overloadedOperator() + } // end of property IDiaSymbol::overloadedOperator + .property int32 'nested'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 36 00 00 00 00 00 ) // ..6..... + .get instance int32 DIALib.IDiaSymbol::get_nested() + } // end of property IDiaSymbol::'nested' + .property int32 hasNestedTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 37 00 00 00 00 00 ) // ..7..... + .get instance int32 DIALib.IDiaSymbol::get_hasNestedTypes() + } // end of property IDiaSymbol::hasNestedTypes + .property int32 hasAssignmentOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 38 00 00 00 00 00 ) // ..8..... + .get instance int32 DIALib.IDiaSymbol::get_hasAssignmentOperator() + } // end of property IDiaSymbol::hasAssignmentOperator + .property int32 hasCastOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 39 00 00 00 00 00 ) // ..9..... + .get instance int32 DIALib.IDiaSymbol::get_hasCastOperator() + } // end of property IDiaSymbol::hasCastOperator + .property int32 scoped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3A 00 00 00 00 00 ) // ..:..... + .get instance int32 DIALib.IDiaSymbol::get_scoped() + } // end of property IDiaSymbol::scoped + .property int32 virtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3B 00 00 00 00 00 ) // ..;..... + .get instance int32 DIALib.IDiaSymbol::get_virtualBaseClass() + } // end of property IDiaSymbol::virtualBaseClass + .property int32 indirectVirtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3C 00 00 00 00 00 ) // ..<..... + .get instance int32 DIALib.IDiaSymbol::get_indirectVirtualBaseClass() + } // end of property IDiaSymbol::indirectVirtualBaseClass + .property int32 virtualBasePointerOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3D 00 00 00 00 00 ) // ..=..... + .get instance int32 DIALib.IDiaSymbol::get_virtualBasePointerOffset() + } // end of property IDiaSymbol::virtualBasePointerOffset + .property class DIALib.IDiaSymbol virtualTableShape() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3E 00 00 00 00 00 ) // ..>..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_virtualTableShape() + } // end of property IDiaSymbol::virtualTableShape + .property uint32 lexicalParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 40 00 00 00 00 00 ) // ..@..... + .get instance uint32 DIALib.IDiaSymbol::get_lexicalParentId() + } // end of property IDiaSymbol::lexicalParentId + .property uint32 classParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 41 00 00 00 00 00 ) // ..A..... + .get instance uint32 DIALib.IDiaSymbol::get_classParentId() + } // end of property IDiaSymbol::classParentId + .property uint32 typeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 42 00 00 00 00 00 ) // ..B..... + .get instance uint32 DIALib.IDiaSymbol::get_typeId() + } // end of property IDiaSymbol::typeId + .property uint32 arrayIndexTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 43 00 00 00 00 00 ) // ..C..... + .get instance uint32 DIALib.IDiaSymbol::get_arrayIndexTypeId() + } // end of property IDiaSymbol::arrayIndexTypeId + .property uint32 virtualTableShapeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 44 00 00 00 00 00 ) // ..D..... + .get instance uint32 DIALib.IDiaSymbol::get_virtualTableShapeId() + } // end of property IDiaSymbol::virtualTableShapeId + .property int32 code() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 45 00 00 00 00 00 ) // ..E..... + .get instance int32 DIALib.IDiaSymbol::get_code() + } // end of property IDiaSymbol::code + .property int32 function() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 46 00 00 00 00 00 ) // ..F..... + .get instance int32 DIALib.IDiaSymbol::get_function() + } // end of property IDiaSymbol::function + .property int32 'managed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 47 00 00 00 00 00 ) // ..G..... + .get instance int32 DIALib.IDiaSymbol::get_managed() + } // end of property IDiaSymbol::'managed' + .property int32 msil() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 48 00 00 00 00 00 ) // ..H..... + .get instance int32 DIALib.IDiaSymbol::get_msil() + } // end of property IDiaSymbol::msil + .property uint32 virtualBaseDispIndex() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 49 00 00 00 00 00 ) // ..I..... + .get instance uint32 DIALib.IDiaSymbol::get_virtualBaseDispIndex() + } // end of property IDiaSymbol::virtualBaseDispIndex + .property string undecoratedName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4A 00 00 00 00 00 ) // ..J..... + .get instance string DIALib.IDiaSymbol::get_undecoratedName() + } // end of property IDiaSymbol::undecoratedName + .property uint32 age() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4B 00 00 00 00 00 ) // ..K..... + .get instance uint32 DIALib.IDiaSymbol::get_age() + } // end of property IDiaSymbol::age + .property uint32 signature() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4C 00 00 00 00 00 ) // ..L..... + .get instance uint32 DIALib.IDiaSymbol::get_signature() + } // end of property IDiaSymbol::signature + .property int32 compilerGenerated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4D 00 00 00 00 00 ) // ..M..... + .get instance int32 DIALib.IDiaSymbol::get_compilerGenerated() + } // end of property IDiaSymbol::compilerGenerated + .property int32 addressTaken() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4E 00 00 00 00 00 ) // ..N..... + .get instance int32 DIALib.IDiaSymbol::get_addressTaken() + } // end of property IDiaSymbol::addressTaken + .property uint32 rank() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4F 00 00 00 00 00 ) // ..O..... + .get instance uint32 DIALib.IDiaSymbol::get_rank() + } // end of property IDiaSymbol::rank + .property class DIALib.IDiaSymbol lowerBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 50 00 00 00 00 00 ) // ..P..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_lowerBound() + } // end of property IDiaSymbol::lowerBound + .property class DIALib.IDiaSymbol upperBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 51 00 00 00 00 00 ) // ..Q..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_upperBound() + } // end of property IDiaSymbol::upperBound + .property uint32 lowerBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 52 00 00 00 00 00 ) // ..R..... + .get instance uint32 DIALib.IDiaSymbol::get_lowerBoundId() + } // end of property IDiaSymbol::lowerBoundId + .property uint32 upperBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 53 00 00 00 00 00 ) // ..S..... + .get instance uint32 DIALib.IDiaSymbol::get_upperBoundId() + } // end of property IDiaSymbol::upperBoundId + .property uint32 targetSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 54 00 00 00 00 00 ) // ..T..... + .get instance uint32 DIALib.IDiaSymbol::get_targetSection() + } // end of property IDiaSymbol::targetSection + .property uint32 targetOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 55 00 00 00 00 00 ) // ..U..... + .get instance uint32 DIALib.IDiaSymbol::get_targetOffset() + } // end of property IDiaSymbol::targetOffset + .property uint32 targetRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 56 00 00 00 00 00 ) // ..V..... + .get instance uint32 DIALib.IDiaSymbol::get_targetRelativeVirtualAddress() + } // end of property IDiaSymbol::targetRelativeVirtualAddress + .property uint64 targetVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 57 00 00 00 00 00 ) // ..W..... + .get instance uint64 DIALib.IDiaSymbol::get_targetVirtualAddress() + } // end of property IDiaSymbol::targetVirtualAddress + .property uint32 machineType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 58 00 00 00 00 00 ) // ..X..... + .get instance uint32 DIALib.IDiaSymbol::get_machineType() + } // end of property IDiaSymbol::machineType + .property uint32 oemId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 59 00 00 00 00 00 ) // ..Y..... + .get instance uint32 DIALib.IDiaSymbol::get_oemId() + } // end of property IDiaSymbol::oemId + .property uint32 oemSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5A 00 00 00 00 00 ) // ..Z..... + .get instance uint32 DIALib.IDiaSymbol::get_oemSymbolId() + } // end of property IDiaSymbol::oemSymbolId + .property class DIALib.IDiaSymbol objectPointerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5B 00 00 00 00 00 ) // ..[..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_objectPointerType() + } // end of property IDiaSymbol::objectPointerType + .property uint32 udtKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5C 00 00 00 00 00 ) // ..\..... + .get instance uint32 DIALib.IDiaSymbol::get_udtKind() + } // end of property IDiaSymbol::udtKind + .property int32 noReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5D 00 00 00 00 00 ) // ..]..... + .get instance int32 DIALib.IDiaSymbol::get_noReturn() + } // end of property IDiaSymbol::noReturn + .property int32 customCallingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5E 00 00 00 00 00 ) // ..^..... + .get instance int32 DIALib.IDiaSymbol::get_customCallingConvention() + } // end of property IDiaSymbol::customCallingConvention + .property int32 noInline() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5F 00 00 00 00 00 ) // .._..... + .get instance int32 DIALib.IDiaSymbol::get_noInline() + } // end of property IDiaSymbol::noInline + .property int32 optimizedCodeDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 60 00 00 00 00 00 ) // ..`..... + .get instance int32 DIALib.IDiaSymbol::get_optimizedCodeDebugInfo() + } // end of property IDiaSymbol::optimizedCodeDebugInfo + .property int32 notReached() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 61 00 00 00 00 00 ) // ..a..... + .get instance int32 DIALib.IDiaSymbol::get_notReached() + } // end of property IDiaSymbol::notReached + .property int32 interruptReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 62 00 00 00 00 00 ) // ..b..... + .get instance int32 DIALib.IDiaSymbol::get_interruptReturn() + } // end of property IDiaSymbol::interruptReturn + .property int32 farReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 63 00 00 00 00 00 ) // ..c..... + .get instance int32 DIALib.IDiaSymbol::get_farReturn() + } // end of property IDiaSymbol::farReturn + .property int32 isStatic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 64 00 00 00 00 00 ) // ..d..... + .get instance int32 DIALib.IDiaSymbol::get_isStatic() + } // end of property IDiaSymbol::isStatic + .property int32 hasDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 65 00 00 00 00 00 ) // ..e..... + .get instance int32 DIALib.IDiaSymbol::get_hasDebugInfo() + } // end of property IDiaSymbol::hasDebugInfo + .property int32 isLTCG() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 66 00 00 00 00 00 ) // ..f..... + .get instance int32 DIALib.IDiaSymbol::get_isLTCG() + } // end of property IDiaSymbol::isLTCG + .property int32 isDataAligned() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 67 00 00 00 00 00 ) // ..g..... + .get instance int32 DIALib.IDiaSymbol::get_isDataAligned() + } // end of property IDiaSymbol::isDataAligned + .property int32 hasSecurityChecks() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 68 00 00 00 00 00 ) // ..h..... + .get instance int32 DIALib.IDiaSymbol::get_hasSecurityChecks() + } // end of property IDiaSymbol::hasSecurityChecks + .property string compilerName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 69 00 00 00 00 00 ) // ..i..... + .get instance string DIALib.IDiaSymbol::get_compilerName() + } // end of property IDiaSymbol::compilerName + .property int32 hasAlloca() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6A 00 00 00 00 00 ) // ..j..... + .get instance int32 DIALib.IDiaSymbol::get_hasAlloca() + } // end of property IDiaSymbol::hasAlloca + .property int32 hasSetJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6B 00 00 00 00 00 ) // ..k..... + .get instance int32 DIALib.IDiaSymbol::get_hasSetJump() + } // end of property IDiaSymbol::hasSetJump + .property int32 hasLongJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6C 00 00 00 00 00 ) // ..l..... + .get instance int32 DIALib.IDiaSymbol::get_hasLongJump() + } // end of property IDiaSymbol::hasLongJump + .property int32 hasInlAsm() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6D 00 00 00 00 00 ) // ..m..... + .get instance int32 DIALib.IDiaSymbol::get_hasInlAsm() + } // end of property IDiaSymbol::hasInlAsm + .property int32 hasEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6E 00 00 00 00 00 ) // ..n..... + .get instance int32 DIALib.IDiaSymbol::get_hasEH() + } // end of property IDiaSymbol::hasEH + .property int32 hasSEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6F 00 00 00 00 00 ) // ..o..... + .get instance int32 DIALib.IDiaSymbol::get_hasSEH() + } // end of property IDiaSymbol::hasSEH + .property int32 hasEHa() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 70 00 00 00 00 00 ) // ..p..... + .get instance int32 DIALib.IDiaSymbol::get_hasEHa() + } // end of property IDiaSymbol::hasEHa + .property int32 isNaked() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 71 00 00 00 00 00 ) // ..q..... + .get instance int32 DIALib.IDiaSymbol::get_isNaked() + } // end of property IDiaSymbol::isNaked + .property int32 isAggregated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 72 00 00 00 00 00 ) // ..r..... + .get instance int32 DIALib.IDiaSymbol::get_isAggregated() + } // end of property IDiaSymbol::isAggregated + .property int32 isSplitted() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 73 00 00 00 00 00 ) // ..s..... + .get instance int32 DIALib.IDiaSymbol::get_isSplitted() + } // end of property IDiaSymbol::isSplitted + .property class DIALib.IDiaSymbol container() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 74 00 00 00 00 00 ) // ..t..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_container() + } // end of property IDiaSymbol::container + .property int32 inlSpec() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 75 00 00 00 00 00 ) // ..u..... + .get instance int32 DIALib.IDiaSymbol::get_inlSpec() + } // end of property IDiaSymbol::inlSpec + .property int32 noStackOrdering() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 76 00 00 00 00 00 ) // ..v..... + .get instance int32 DIALib.IDiaSymbol::get_noStackOrdering() + } // end of property IDiaSymbol::noStackOrdering + .property class DIALib.IDiaSymbol virtualBaseTableType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 77 00 00 00 00 00 ) // ..w..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_virtualBaseTableType() + } // end of property IDiaSymbol::virtualBaseTableType + .property int32 hasManagedCode() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 78 00 00 00 00 00 ) // ..x..... + .get instance int32 DIALib.IDiaSymbol::get_hasManagedCode() + } // end of property IDiaSymbol::hasManagedCode + .property int32 isHotpatchable() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 79 00 00 00 00 00 ) // ..y..... + .get instance int32 DIALib.IDiaSymbol::get_isHotpatchable() + } // end of property IDiaSymbol::isHotpatchable + .property int32 isCVTCIL() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7A 00 00 00 00 00 ) // ..z..... + .get instance int32 DIALib.IDiaSymbol::get_isCVTCIL() + } // end of property IDiaSymbol::isCVTCIL + .property int32 isMSILNetmodule() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7B 00 00 00 00 00 ) // ..{..... + .get instance int32 DIALib.IDiaSymbol::get_isMSILNetmodule() + } // end of property IDiaSymbol::isMSILNetmodule + .property int32 isCTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7C 00 00 00 00 00 ) // ..|..... + .get instance int32 DIALib.IDiaSymbol::get_isCTypes() + } // end of property IDiaSymbol::isCTypes + .property int32 isStripped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7D 00 00 00 00 00 ) // ..}..... + .get instance int32 DIALib.IDiaSymbol::get_isStripped() + } // end of property IDiaSymbol::isStripped + .property uint32 frontEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7E 00 00 00 00 00 ) // ..~..... + .get instance uint32 DIALib.IDiaSymbol::get_frontEndQFE() + } // end of property IDiaSymbol::frontEndQFE + .property uint32 backEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_backEndQFE() + } // end of property IDiaSymbol::backEndQFE + .property int32 wasInlined() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 80 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_wasInlined() + } // end of property IDiaSymbol::wasInlined + .property int32 strictGSCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 81 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_strictGSCheck() + } // end of property IDiaSymbol::strictGSCheck + .property int32 isCxxReturnUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 82 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isCxxReturnUdt() + } // end of property IDiaSymbol::isCxxReturnUdt + .property int32 isConstructorVirtualBase() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 83 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isConstructorVirtualBase() + } // end of property IDiaSymbol::isConstructorVirtualBase + .property int32 RValueReference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 84 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_RValueReference() + } // end of property IDiaSymbol::RValueReference + .property class DIALib.IDiaSymbol unmodifiedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 85 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_unmodifiedType() + } // end of property IDiaSymbol::unmodifiedType + .property int32 framePointerPresent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 86 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_framePointerPresent() + } // end of property IDiaSymbol::framePointerPresent + .property int32 isSafeBuffers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 87 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isSafeBuffers() + } // end of property IDiaSymbol::isSafeBuffers + .property int32 intrinsic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 88 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_intrinsic() + } // end of property IDiaSymbol::intrinsic + .property int32 'sealed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 89 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_sealed() + } // end of property IDiaSymbol::'sealed' + .property int32 hfaFloat() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_hfaFloat() + } // end of property IDiaSymbol::hfaFloat + .property int32 hfaDouble() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8B 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_hfaDouble() + } // end of property IDiaSymbol::hfaDouble + .property uint32 liveRangeStartAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_liveRangeStartAddressSection() + } // end of property IDiaSymbol::liveRangeStartAddressSection + .property uint32 liveRangeStartAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_liveRangeStartAddressOffset() + } // end of property IDiaSymbol::liveRangeStartAddressOffset + .property uint32 liveRangeStartRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_liveRangeStartRelativeVirtualAddress() + } // end of property IDiaSymbol::liveRangeStartRelativeVirtualAddress + .property uint32 countLiveRanges() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_countLiveRanges() + } // end of property IDiaSymbol::countLiveRanges + .property uint64 liveRangeLength() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 90 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol::get_liveRangeLength() + } // end of property IDiaSymbol::liveRangeLength + .property uint32 offsetInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 91 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_offsetInUdt() + } // end of property IDiaSymbol::offsetInUdt + .property uint32 paramBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 92 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_paramBasePointerRegisterId() + } // end of property IDiaSymbol::paramBasePointerRegisterId + .property uint32 localBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 93 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_localBasePointerRegisterId() + } // end of property IDiaSymbol::localBasePointerRegisterId + .property int32 isLocationControlFlowDependent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 94 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isLocationControlFlowDependent() + } // end of property IDiaSymbol::isLocationControlFlowDependent + .property uint32 stride() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 95 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_stride() + } // end of property IDiaSymbol::stride + .property uint32 numberOfRows() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 96 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_numberOfRows() + } // end of property IDiaSymbol::numberOfRows + .property uint32 numberOfColumns() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 97 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_numberOfColumns() + } // end of property IDiaSymbol::numberOfColumns + .property int32 isMatrixRowMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 98 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isMatrixRowMajor() + } // end of property IDiaSymbol::isMatrixRowMajor + .property int32 isReturnValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 99 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isReturnValue() + } // end of property IDiaSymbol::isReturnValue + .property int32 isOptimizedAway() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isOptimizedAway() + } // end of property IDiaSymbol::isOptimizedAway + .property uint32 builtInKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_builtInKind() + } // end of property IDiaSymbol::builtInKind + .property uint32 registerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_registerType() + } // end of property IDiaSymbol::registerType + .property uint32 baseDataSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_baseDataSlot() + } // end of property IDiaSymbol::baseDataSlot + .property uint32 baseDataOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_baseDataOffset() + } // end of property IDiaSymbol::baseDataOffset + .property uint32 textureSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_textureSlot() + } // end of property IDiaSymbol::textureSlot + .property uint32 samplerSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_samplerSlot() + } // end of property IDiaSymbol::samplerSlot + .property uint32 uavSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_uavSlot() + } // end of property IDiaSymbol::uavSlot + .property uint32 sizeInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_sizeInUdt() + } // end of property IDiaSymbol::sizeInUdt + .property uint32 memorySpaceKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_memorySpaceKind() + } // end of property IDiaSymbol::memorySpaceKind + .property uint32 unmodifiedTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_unmodifiedTypeId() + } // end of property IDiaSymbol::unmodifiedTypeId + .property uint32 subTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_subTypeId() + } // end of property IDiaSymbol::subTypeId + .property class DIALib.IDiaSymbol subType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A6 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_subType() + } // end of property IDiaSymbol::subType + .property uint32 numberOfModifiers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_numberOfModifiers() + } // end of property IDiaSymbol::numberOfModifiers + .property uint32 numberOfRegisterIndices() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A8 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_numberOfRegisterIndices() + } // end of property IDiaSymbol::numberOfRegisterIndices + .property int32 isHLSLData() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isHLSLData() + } // end of property IDiaSymbol::isHLSLData + .property int32 isPointerToDataMember() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isPointerToDataMember() + } // end of property IDiaSymbol::isPointerToDataMember + .property int32 isPointerToMemberFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isPointerToMemberFunction() + } // end of property IDiaSymbol::isPointerToMemberFunction + .property int32 isSingleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isSingleInheritance() + } // end of property IDiaSymbol::isSingleInheritance + .property int32 isMultipleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isMultipleInheritance() + } // end of property IDiaSymbol::isMultipleInheritance + .property int32 isVirtualInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isVirtualInheritance() + } // end of property IDiaSymbol::isVirtualInheritance + .property int32 restrictedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_restrictedType() + } // end of property IDiaSymbol::restrictedType + .property int32 isPointerBasedOnSymbolValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B0 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isPointerBasedOnSymbolValue() + } // end of property IDiaSymbol::isPointerBasedOnSymbolValue + .property class DIALib.IDiaSymbol baseSymbol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B1 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_baseSymbol() + } // end of property IDiaSymbol::baseSymbol + .property uint32 baseSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_baseSymbolId() + } // end of property IDiaSymbol::baseSymbolId + .property string objectFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B3 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol::get_objectFileName() + } // end of property IDiaSymbol::objectFileName + .property int32 isAcceleratorGroupSharedLocal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B4 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isAcceleratorGroupSharedLocal() + } // end of property IDiaSymbol::isAcceleratorGroupSharedLocal + .property int32 isAcceleratorPointerTagLiveRange() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B5 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isAcceleratorPointerTagLiveRange() + } // end of property IDiaSymbol::isAcceleratorPointerTagLiveRange + .property int32 isAcceleratorStubFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isAcceleratorStubFunction() + } // end of property IDiaSymbol::isAcceleratorStubFunction + .property uint32 numberOfAcceleratorPointerTags() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_numberOfAcceleratorPointerTags() + } // end of property IDiaSymbol::numberOfAcceleratorPointerTags + .property int32 isSdl() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isSdl() + } // end of property IDiaSymbol::isSdl + .property int32 isWinRTPointer() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isWinRTPointer() + } // end of property IDiaSymbol::isWinRTPointer + .property int32 isRefUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isRefUdt() + } // end of property IDiaSymbol::isRefUdt + .property int32 isValueUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isValueUdt() + } // end of property IDiaSymbol::isValueUdt + .property int32 isInterfaceUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isInterfaceUdt() + } // end of property IDiaSymbol::isInterfaceUdt + .property int32 isPGO() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isPGO() + } // end of property IDiaSymbol::isPGO + .property int32 hasValidPGOCounts() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_hasValidPGOCounts() + } // end of property IDiaSymbol::hasValidPGOCounts + .property int32 isOptimizedForSpeed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_isOptimizedForSpeed() + } // end of property IDiaSymbol::isOptimizedForSpeed + .property uint32 PGOEntryCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_PGOEntryCount() + } // end of property IDiaSymbol::PGOEntryCount + .property uint32 PGOEdgeCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_PGOEdgeCount() + } // end of property IDiaSymbol::PGOEdgeCount + .property uint64 PGODynamicInstructionCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol::get_PGODynamicInstructionCount() + } // end of property IDiaSymbol::PGODynamicInstructionCount + .property uint32 staticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_staticSize() + } // end of property IDiaSymbol::staticSize + .property uint32 finalLiveStaticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_finalLiveStaticSize() + } // end of property IDiaSymbol::finalLiveStaticSize + .property string phaseName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C5 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol::get_phaseName() + } // end of property IDiaSymbol::phaseName + .property int32 hasControlFlowCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_hasControlFlowCheck() + } // end of property IDiaSymbol::hasControlFlowCheck + .property int32 constantExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C7 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_constantExport() + } // end of property IDiaSymbol::constantExport + .property int32 dataExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_dataExport() + } // end of property IDiaSymbol::dataExport + .property int32 privateExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_privateExport() + } // end of property IDiaSymbol::privateExport + .property int32 noNameExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_noNameExport() + } // end of property IDiaSymbol::noNameExport + .property int32 exportHasExplicitlyAssignedOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_exportHasExplicitlyAssignedOrdinal() + } // end of property IDiaSymbol::exportHasExplicitlyAssignedOrdinal + .property int32 exportIsForwarder() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol::get_exportIsForwarder() + } // end of property IDiaSymbol::exportIsForwarder + .property uint32 ordinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CD 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_ordinal() + } // end of property IDiaSymbol::ordinal + .property uint32 frameSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CE 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_frameSize() + } // end of property IDiaSymbol::frameSize + .property uint32 exceptionHandlerAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CF 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_exceptionHandlerAddressSection() + } // end of property IDiaSymbol::exceptionHandlerAddressSection + .property uint32 exceptionHandlerAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_exceptionHandlerAddressOffset() + } // end of property IDiaSymbol::exceptionHandlerAddressOffset + .property uint32 exceptionHandlerRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_exceptionHandlerRelativeVirtualAddress() + } // end of property IDiaSymbol::exceptionHandlerRelativeVirtualAddress + .property uint64 exceptionHandlerVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol::get_exceptionHandlerVirtualAddress() + } // end of property IDiaSymbol::exceptionHandlerVirtualAddress + .property uint32 characteristics() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_characteristics() + } // end of property IDiaSymbol::characteristics + .property class DIALib.IDiaSymbol coffGroup() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D4 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol::get_coffGroup() + } // end of property IDiaSymbol::coffGroup + .property uint32 bindID() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_bindID() + } // end of property IDiaSymbol::bindID + .property uint32 bindSpace() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D6 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_bindSpace() + } // end of property IDiaSymbol::bindSpace + .property uint32 bindSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol::get_bindSlot() + } // end of property IDiaSymbol::bindSlot +} // end of class DIALib.IDiaSymbol + +.class interface public abstract auto ansi import DIALib.IDiaEnumTables +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 43 36 35 43 32 42 30 41 2D 31 31 35 30 // ..$C65C2B0A-1150 + 2D 34 44 37 41 2D 41 46 43 43 2D 45 30 35 42 46 // -4D7A-AFCC-E05BF + 33 44 45 45 38 31 45 00 00 ) // 3DEE81E.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumTables::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumTables::get_count + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaTable + marshal( interface ) + Item([in] object marshal( struct) index) runtime managed internalcall + { + } // end of method IDiaEnumTables::Item + + .method public hidebysig newslot abstract virtual + instance void Next(uint32 celt, + class DIALib.IDiaTable& marshal( interface ) rgelt, + uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumTables::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumTables::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumTables::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumTables& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumTables::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumTables::get_count() + } // end of property IDiaEnumTables::count +} // end of class DIALib.IDiaEnumTables + +.class interface public abstract auto ansi import DIALib.IDiaEnumSymbolsByAddr +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 36 32 34 42 37 44 39 43 2D 32 34 45 41 // ..$624B7D9C-24EA + 2D 34 34 32 31 2D 39 44 30 36 2D 33 42 35 37 37 // -4421-9D06-3B577 + 34 37 31 43 31 46 41 00 00 ) // 471C1FA.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + symbolByAddr([in] uint32 isect, + [in] uint32 offset) runtime managed internalcall + { + } // end of method IDiaEnumSymbolsByAddr::symbolByAddr + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + symbolByRVA([in] uint32 relativeVirtualAddress) runtime managed internalcall + { + } // end of method IDiaEnumSymbolsByAddr::symbolByRVA + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + symbolByVA([in] uint64 virtualAddress) runtime managed internalcall + { + } // end of method IDiaEnumSymbolsByAddr::symbolByVA + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaSymbol& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumSymbolsByAddr::Next + + .method public hidebysig newslot abstract virtual + instance void Prev([in] uint32 celt, + [out] class DIALib.IDiaSymbol& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumSymbolsByAddr::Prev + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumSymbolsByAddr& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumSymbolsByAddr::Clone + +} // end of class DIALib.IDiaEnumSymbolsByAddr + +.class public auto ansi sealed DIALib.SymTagEnum + extends [mscorlib]System.Enum +{ + .field public specialname rtspecialname int32 value__ + .field public static literal valuetype DIALib.SymTagEnum SymTagNull = int32(0x00000000) + .field public static literal valuetype DIALib.SymTagEnum SymTagExe = int32(0x00000001) + .field public static literal valuetype DIALib.SymTagEnum SymTagCompiland = int32(0x00000002) + .field public static literal valuetype DIALib.SymTagEnum SymTagCompilandDetails = int32(0x00000003) + .field public static literal valuetype DIALib.SymTagEnum SymTagCompilandEnv = int32(0x00000004) + .field public static literal valuetype DIALib.SymTagEnum SymTagFunction = int32(0x00000005) + .field public static literal valuetype DIALib.SymTagEnum SymTagBlock = int32(0x00000006) + .field public static literal valuetype DIALib.SymTagEnum SymTagData = int32(0x00000007) + .field public static literal valuetype DIALib.SymTagEnum SymTagAnnotation = int32(0x00000008) + .field public static literal valuetype DIALib.SymTagEnum SymTagLabel = int32(0x00000009) + .field public static literal valuetype DIALib.SymTagEnum SymTagPublicSymbol = int32(0x0000000A) + .field public static literal valuetype DIALib.SymTagEnum SymTagUDT = int32(0x0000000B) + .field public static literal valuetype DIALib.SymTagEnum SymTagEnum = int32(0x0000000C) + .field public static literal valuetype DIALib.SymTagEnum SymTagFunctionType = int32(0x0000000D) + .field public static literal valuetype DIALib.SymTagEnum SymTagPointerType = int32(0x0000000E) + .field public static literal valuetype DIALib.SymTagEnum SymTagArrayType = int32(0x0000000F) + .field public static literal valuetype DIALib.SymTagEnum SymTagBaseType = int32(0x00000010) + .field public static literal valuetype DIALib.SymTagEnum SymTagTypedef = int32(0x00000011) + .field public static literal valuetype DIALib.SymTagEnum SymTagBaseClass = int32(0x00000012) + .field public static literal valuetype DIALib.SymTagEnum SymTagFriend = int32(0x00000013) + .field public static literal valuetype DIALib.SymTagEnum SymTagFunctionArgType = int32(0x00000014) + .field public static literal valuetype DIALib.SymTagEnum SymTagFuncDebugStart = int32(0x00000015) + .field public static literal valuetype DIALib.SymTagEnum SymTagFuncDebugEnd = int32(0x00000016) + .field public static literal valuetype DIALib.SymTagEnum SymTagUsingNamespace = int32(0x00000017) + .field public static literal valuetype DIALib.SymTagEnum SymTagVTableShape = int32(0x00000018) + .field public static literal valuetype DIALib.SymTagEnum SymTagVTable = int32(0x00000019) + .field public static literal valuetype DIALib.SymTagEnum SymTagCustom = int32(0x0000001A) + .field public static literal valuetype DIALib.SymTagEnum SymTagThunk = int32(0x0000001B) + .field public static literal valuetype DIALib.SymTagEnum SymTagCustomType = int32(0x0000001C) + .field public static literal valuetype DIALib.SymTagEnum SymTagManagedType = int32(0x0000001D) + .field public static literal valuetype DIALib.SymTagEnum SymTagDimension = int32(0x0000001E) + .field public static literal valuetype DIALib.SymTagEnum SymTagCallSite = int32(0x0000001F) + .field public static literal valuetype DIALib.SymTagEnum SymTagInlineSite = int32(0x00000020) + .field public static literal valuetype DIALib.SymTagEnum SymTagBaseInterface = int32(0x00000021) + .field public static literal valuetype DIALib.SymTagEnum SymTagVectorType = int32(0x00000022) + .field public static literal valuetype DIALib.SymTagEnum SymTagMatrixType = int32(0x00000023) + .field public static literal valuetype DIALib.SymTagEnum SymTagHLSLType = int32(0x00000024) + .field public static literal valuetype DIALib.SymTagEnum SymTagCaller = int32(0x00000025) + .field public static literal valuetype DIALib.SymTagEnum SymTagCallee = int32(0x00000026) + .field public static literal valuetype DIALib.SymTagEnum SymTagExport = int32(0x00000027) + .field public static literal valuetype DIALib.SymTagEnum SymTagHeapAllocationSite = int32(0x00000028) + .field public static literal valuetype DIALib.SymTagEnum SymTagCoffGroup = int32(0x00000029) + .field public static literal valuetype DIALib.SymTagEnum SymTagInlinee = int32(0x0000002A) + .field public static literal valuetype DIALib.SymTagEnum SymTagMax = int32(0x0000002B) +} // end of class DIALib.SymTagEnum + +.class interface public abstract auto ansi import DIALib.IDiaEnumSymbols +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 43 41 42 37 32 43 34 38 2D 34 34 33 42 // ..$CAB72C48-443B + 2D 34 38 46 35 2D 39 42 30 42 2D 34 32 46 30 38 // -48F5-9B0B-42F08 + 32 30 41 42 32 39 41 00 00 ) // 20AB29A.. + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumSymbols::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumSymbols::get_count + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + Item([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaEnumSymbols::Item + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaSymbol& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumSymbols::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumSymbols::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumSymbols::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumSymbols::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumSymbols::get_count() + } // end of property IDiaEnumSymbols::count +} // end of class DIALib.IDiaEnumSymbols + +.class interface public abstract auto ansi import DIALib.IDiaEnumSourceFiles +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 31 30 46 33 44 42 44 39 2D 36 36 34 46 // ..$10F3DBD9-664F + 2D 34 34 36 39 2D 42 38 30 38 2D 39 34 37 31 43 // -4469-B808-9471C + 37 41 35 30 35 33 38 00 00 ) // 7A50538.. + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumSourceFiles::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumSourceFiles::get_count + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaSourceFile + marshal( interface ) + Item([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaEnumSourceFiles::Item + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaSourceFile& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumSourceFiles::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumSourceFiles::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumSourceFiles::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumSourceFiles& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumSourceFiles::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumSourceFiles::get_count() + } // end of property IDiaEnumSourceFiles::count +} // end of class DIALib.IDiaEnumSourceFiles + +.class interface public abstract auto ansi import DIALib.IDiaSourceFile +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 32 45 46 35 33 35 33 2D 46 35 41 38 // ..$A2EF5353-F5A8 + 2D 34 45 42 33 2D 39 30 44 32 2D 43 42 35 32 36 // -4EB3-90D2-CB526 + 41 43 42 33 43 44 44 00 00 ) // ACB3CDD.. + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_uniqueId() runtime managed internalcall + { + } // end of method IDiaSourceFile::get_uniqueId + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_fileName() runtime managed internalcall + { + } // end of method IDiaSourceFile::get_fileName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_checksumType() runtime managed internalcall + { + } // end of method IDiaSourceFile::get_checksumType + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaEnumSymbols + marshal( interface ) + get_compilands() runtime managed internalcall + { + } // end of method IDiaSourceFile::get_compilands + + .method public hidebysig newslot abstract virtual + instance void get_checksum([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaSourceFile::get_checksum + + .property uint32 uniqueId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSourceFile::get_uniqueId() + } // end of property IDiaSourceFile::uniqueId + .property string fileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance string DIALib.IDiaSourceFile::get_fileName() + } // end of property IDiaSourceFile::fileName + .property uint32 checksumType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSourceFile::get_checksumType() + } // end of property IDiaSourceFile::checksumType + .property class DIALib.IDiaEnumSymbols compilands() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance class DIALib.IDiaEnumSymbols DIALib.IDiaSourceFile::get_compilands() + } // end of property IDiaSourceFile::compilands +} // end of class DIALib.IDiaSourceFile + +.class interface public abstract auto ansi import DIALib.IDiaEnumLineNumbers +{ + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 46 45 33 30 45 38 37 38 2D 35 34 41 43 // ..$FE30E878-54AC + 2D 34 34 46 31 2D 38 31 42 41 2D 33 39 44 45 39 // -44F1-81BA-39DE9 + 34 30 46 36 30 35 32 00 00 ) // 40F6052.. + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumLineNumbers::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumLineNumbers::get_count + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaLineNumber + marshal( interface ) + Item([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaEnumLineNumbers::Item + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaLineNumber& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumLineNumbers::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumLineNumbers::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumLineNumbers::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumLineNumbers::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumLineNumbers::get_count() + } // end of property IDiaEnumLineNumbers::count +} // end of class DIALib.IDiaEnumLineNumbers + +.class interface public abstract auto ansi import DIALib.IDiaEnumInjectedSources +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 44 35 36 31 32 35 37 33 2D 36 39 32 35 // ..$D5612573-6925 + 2D 34 34 36 38 2D 38 38 38 33 2D 39 38 43 44 45 // -4468-8883-98CDE + 43 38 43 33 38 34 41 00 00 ) // C8C384A.. + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumInjectedSources::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumInjectedSources::get_count + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaInjectedSource + marshal( interface ) + Item([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaEnumInjectedSources::Item + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaInjectedSource& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumInjectedSources::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumInjectedSources::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumInjectedSources::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumInjectedSources& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumInjectedSources::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumInjectedSources::get_count() + } // end of property IDiaEnumInjectedSources::count +} // end of class DIALib.IDiaEnumInjectedSources + +.class interface public abstract auto ansi import DIALib.IDiaEnumDebugStreams +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 30 38 43 42 42 34 31 45 2D 34 37 41 36 // ..$08CBB41E-47A6 + 2D 34 46 38 37 2D 39 32 46 31 2D 31 43 39 43 38 // -4F87-92F1-1C9C8 + 37 43 45 44 30 34 34 00 00 ) // 7CED044.. + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumDebugStreams::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumDebugStreams::get_count + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaEnumDebugStreamData + marshal( interface ) + Item([in] object marshal( struct) index) runtime managed internalcall + { + } // end of method IDiaEnumDebugStreams::Item + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaEnumDebugStreamData& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumDebugStreams::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumDebugStreams::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumDebugStreams::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumDebugStreams& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumDebugStreams::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumDebugStreams::get_count() + } // end of property IDiaEnumDebugStreams::count +} // end of class DIALib.IDiaEnumDebugStreams + +.class interface public abstract auto ansi import DIALib.IDiaEnumInputAssemblyFiles +{ + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 31 43 37 46 46 36 35 33 2D 35 31 46 37 // ..$1C7FF653-51F7 + 2D 34 35 37 45 2D 38 34 31 39 2D 42 32 30 46 35 // -457E-8419-B20F5 + 37 45 46 37 45 34 44 00 00 ) // 7EF7E4D.. + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumInputAssemblyFiles::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumInputAssemblyFiles::get_count + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaInputAssemblyFile + marshal( interface ) + Item([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaEnumInputAssemblyFiles::Item + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumInputAssemblyFiles::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumInputAssemblyFiles::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumInputAssemblyFiles::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumInputAssemblyFiles& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumInputAssemblyFiles::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumInputAssemblyFiles::get_count() + } // end of property IDiaEnumInputAssemblyFiles::count +} // end of class DIALib.IDiaEnumInputAssemblyFiles + +.class interface public abstract auto ansi import DIALib.IDiaInputAssemblyFile +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 33 42 46 45 35 36 42 30 2D 33 39 30 43 // ..$3BFE56B0-390C + 2D 34 38 36 33 2D 39 34 33 30 2D 31 46 33 44 30 // -4863-9430-1F3D0 + 38 33 42 37 36 38 34 00 00 ) // 83B7684.. + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_uniqueId() runtime managed internalcall + { + } // end of method IDiaInputAssemblyFile::get_uniqueId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_index() runtime managed internalcall + { + } // end of method IDiaInputAssemblyFile::get_index + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_timeStamp() runtime managed internalcall + { + } // end of method IDiaInputAssemblyFile::get_timeStamp + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_pdbAvailableAtILMerge() runtime managed internalcall + { + } // end of method IDiaInputAssemblyFile::get_pdbAvailableAtILMerge + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_fileName() runtime managed internalcall + { + } // end of method IDiaInputAssemblyFile::get_fileName + + .method public hidebysig newslot abstract virtual + instance void get_version([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaInputAssemblyFile::get_version + + .property uint32 uniqueId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaInputAssemblyFile::get_uniqueId() + } // end of property IDiaInputAssemblyFile::uniqueId + .property uint32 index() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaInputAssemblyFile::get_index() + } // end of property IDiaInputAssemblyFile::index + .property uint32 timeStamp() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaInputAssemblyFile::get_timeStamp() + } // end of property IDiaInputAssemblyFile::timeStamp + .property int32 pdbAvailableAtILMerge() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaInputAssemblyFile::get_pdbAvailableAtILMerge() + } // end of property IDiaInputAssemblyFile::pdbAvailableAtILMerge + .property string fileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance string DIALib.IDiaInputAssemblyFile::get_fileName() + } // end of property IDiaInputAssemblyFile::fileName +} // end of class DIALib.IDiaInputAssemblyFile + +.class interface public abstract auto ansi import DIALib.IDiaLineNumber +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 42 33 38 38 45 42 31 34 2D 42 45 34 44 // ..$B388EB14-BE4D + 2D 34 32 31 44 2D 41 38 41 31 2D 36 43 46 37 41 // -421D-A8A1-6CF7A + 42 30 35 37 30 38 36 00 00 ) // B057086.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_compiland() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_compiland + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSourceFile + marshal( interface ) + get_sourceFile() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_sourceFile + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lineNumber() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_lineNumber + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lineNumberEnd() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_lineNumberEnd + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_columnNumber() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_columnNumber + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_columnNumberEnd() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_columnNumberEnd + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_length() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_length + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_sourceFileId() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_sourceFileId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_statement() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_statement + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_compilandId() runtime managed internalcall + { + } // end of method IDiaLineNumber::get_compilandId + + .property class DIALib.IDiaSymbol compiland() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaLineNumber::get_compiland() + } // end of property IDiaLineNumber::compiland + .property class DIALib.IDiaSourceFile sourceFile() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance class DIALib.IDiaSourceFile DIALib.IDiaLineNumber::get_sourceFile() + } // end of property IDiaLineNumber::sourceFile + .property uint32 lineNumber() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_lineNumber() + } // end of property IDiaLineNumber::lineNumber + .property uint32 lineNumberEnd() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_lineNumberEnd() + } // end of property IDiaLineNumber::lineNumberEnd + .property uint32 columnNumber() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_columnNumber() + } // end of property IDiaLineNumber::columnNumber + .property uint32 columnNumberEnd() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_columnNumberEnd() + } // end of property IDiaLineNumber::columnNumberEnd + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_addressSection() + } // end of property IDiaLineNumber::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_addressOffset() + } // end of property IDiaLineNumber::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_relativeVirtualAddress() + } // end of property IDiaLineNumber::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaLineNumber::get_virtualAddress() + } // end of property IDiaLineNumber::virtualAddress + .property uint32 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_length() + } // end of property IDiaLineNumber::length + .property uint32 sourceFileId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_sourceFileId() + } // end of property IDiaLineNumber::sourceFileId + .property int32 statement() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaLineNumber::get_statement() + } // end of property IDiaLineNumber::statement + .property uint32 compilandId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaLineNumber::get_compilandId() + } // end of property IDiaLineNumber::compilandId +} // end of class DIALib.IDiaLineNumber + +.class interface public abstract auto ansi import DIALib.IEnumUnknown +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 30 30 30 30 30 31 30 30 2D 30 30 30 30 // ..$00000100-0000 + 2D 30 30 30 30 2D 43 30 30 30 2D 30 30 30 30 30 // -0000-C000-00000 + 30 30 30 30 30 34 36 00 00 ) // 0000046.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot abstract virtual + instance void RemoteNext([in] uint32 celt, + [out] object& marshal( iunknown ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IEnumUnknown::RemoteNext + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IEnumUnknown::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IEnumUnknown::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IEnumUnknown& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IEnumUnknown::Clone + +} // end of class DIALib.IEnumUnknown + +.class interface public abstract auto ansi import DIALib.IDiaTable + implements DIALib.IEnumUnknown +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 34 41 35 39 46 42 37 37 2D 41 42 41 43 // ..$4A59FB77-ABAC + 2D 34 36 39 42 2D 41 33 30 42 2D 39 45 43 43 38 // -469B-A30B-9ECC8 + 35 42 46 45 46 31 34 00 00 ) // 5BFEF14.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .method public hidebysig newslot abstract virtual + instance void RemoteNext([in] uint32 celt, + [out] object& marshal( iunknown ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaTable::RemoteNext + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaTable::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaTable::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IEnumUnknown& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaTable::Clone + + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaTable::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_name() runtime managed internalcall + { + } // end of method IDiaTable::get_name + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaTable::get_count + + .method public hidebysig newslot abstract virtual + instance object + marshal( iunknown ) + Item([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaTable::Item + + .property string name() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance string DIALib.IDiaTable::get_name() + } // end of property IDiaTable::name + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaTable::get_count() + } // end of property IDiaTable::count +} // end of class DIALib.IDiaTable + +.class interface public abstract auto ansi import DIALib.IDiaInjectedSource +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 45 36 30 35 43 44 43 2D 38 31 30 35 // ..$AE605CDC-8105 + 2D 34 41 32 33 2D 42 37 31 30 2D 33 32 35 39 46 // -4A23-B710-3259F + 31 45 32 36 31 31 32 00 00 ) // 1E26112.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_crc() runtime managed internalcall + { + } // end of method IDiaInjectedSource::get_crc + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_length() runtime managed internalcall + { + } // end of method IDiaInjectedSource::get_length + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_fileName() runtime managed internalcall + { + } // end of method IDiaInjectedSource::get_fileName + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_objectFileName() runtime managed internalcall + { + } // end of method IDiaInjectedSource::get_objectFileName + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_virtualFilename() runtime managed internalcall + { + } // end of method IDiaInjectedSource::get_virtualFilename + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_sourceCompression() runtime managed internalcall + { + } // end of method IDiaInjectedSource::get_sourceCompression + + .method public hidebysig newslot abstract virtual + instance void get_source([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaInjectedSource::get_source + + .property uint32 crc() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaInjectedSource::get_crc() + } // end of property IDiaInjectedSource::crc + .property uint64 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaInjectedSource::get_length() + } // end of property IDiaInjectedSource::length + .property string fileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance string DIALib.IDiaInjectedSource::get_fileName() + } // end of property IDiaInjectedSource::fileName + .property string objectFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance string DIALib.IDiaInjectedSource::get_objectFileName() + } // end of property IDiaInjectedSource::objectFileName + .property string virtualFilename() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance string DIALib.IDiaInjectedSource::get_virtualFilename() + } // end of property IDiaInjectedSource::virtualFilename + .property uint32 sourceCompression() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaInjectedSource::get_sourceCompression() + } // end of property IDiaInjectedSource::sourceCompression +} // end of class DIALib.IDiaInjectedSource + +.class interface public abstract auto ansi import DIALib.IDiaEnumDebugStreamData +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 34 38 36 39 34 33 45 38 2D 44 31 38 37 // ..$486943E8-D187 + 2D 34 41 36 42 2D 41 33 43 34 2D 32 39 31 32 35 // -4A6B-A3C4-29125 + 39 46 46 46 36 30 44 00 00 ) // 9FFF60D.. + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumDebugStreamData::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumDebugStreamData::get_count + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_name() runtime managed internalcall + { + } // end of method IDiaEnumDebugStreamData::get_name + + .method public hidebysig newslot abstract virtual + instance void Item([in] uint32 index, + [in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaEnumDebugStreamData::Item + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumDebugStreamData::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumDebugStreamData::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumDebugStreamData::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumDebugStreamData& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumDebugStreamData::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumDebugStreamData::get_count() + } // end of property IDiaEnumDebugStreamData::count + .property string name() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance string DIALib.IDiaEnumDebugStreamData::get_name() + } // end of property IDiaEnumDebugStreamData::name +} // end of class DIALib.IDiaEnumDebugStreamData + +.class public auto ansi sealed DIALib.MemoryTypeEnum + extends [mscorlib]System.Enum +{ + .field public specialname rtspecialname int32 value__ + .field public static literal valuetype DIALib.MemoryTypeEnum MemTypeCode = int32(0x00000000) + .field public static literal valuetype DIALib.MemoryTypeEnum MemTypeData = int32(0x00000001) + .field public static literal valuetype DIALib.MemoryTypeEnum MemTypeStack = int32(0x00000002) + .field public static literal valuetype DIALib.MemoryTypeEnum MemTypeCodeOnHeap = int32(0x00000003) + .field public static literal valuetype DIALib.MemoryTypeEnum MemTypeAny = int32(0xFFFFFFFF) +} // end of class DIALib.MemoryTypeEnum + +.class interface public abstract auto ansi import DIALib.IDiaFrameData +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 33 39 31 38 34 42 37 2D 36 41 33 36 // ..$A39184B7-6A36 + 2D 34 32 44 45 2D 38 45 45 43 2D 37 44 46 39 46 // -42DE-8EEC-7DF9F + 33 46 35 39 46 33 33 00 00 ) // 3F59F33.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaFrameData::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaFrameData::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaFrameData::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaFrameData::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthBlock() runtime managed internalcall + { + } // end of method IDiaFrameData::get_lengthBlock + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthLocals() runtime managed internalcall + { + } // end of method IDiaFrameData::get_lengthLocals + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthParams() runtime managed internalcall + { + } // end of method IDiaFrameData::get_lengthParams + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_maxStack() runtime managed internalcall + { + } // end of method IDiaFrameData::get_maxStack + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthProlog() runtime managed internalcall + { + } // end of method IDiaFrameData::get_lengthProlog + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthSavedRegisters() runtime managed internalcall + { + } // end of method IDiaFrameData::get_lengthSavedRegisters + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_program() runtime managed internalcall + { + } // end of method IDiaFrameData::get_program + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_systemExceptionHandling() runtime managed internalcall + { + } // end of method IDiaFrameData::get_systemExceptionHandling + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_cplusplusExceptionHandling() runtime managed internalcall + { + } // end of method IDiaFrameData::get_cplusplusExceptionHandling + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_functionStart() runtime managed internalcall + { + } // end of method IDiaFrameData::get_functionStart + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_allocatesBasePointer() runtime managed internalcall + { + } // end of method IDiaFrameData::get_allocatesBasePointer + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_type() runtime managed internalcall + { + } // end of method IDiaFrameData::get_type + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaFrameData + marshal( interface ) + get_functionParent() runtime managed internalcall + { + } // end of method IDiaFrameData::get_functionParent + + .method public hidebysig newslot abstract virtual + instance void execute(class DIALib.IDiaStackWalkFrame marshal( interface ) frame) runtime managed internalcall + { + } // end of method IDiaFrameData::execute + + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_addressSection() + } // end of property IDiaFrameData::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_addressOffset() + } // end of property IDiaFrameData::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_relativeVirtualAddress() + } // end of property IDiaFrameData::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaFrameData::get_virtualAddress() + } // end of property IDiaFrameData::virtualAddress + .property uint32 lengthBlock() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_lengthBlock() + } // end of property IDiaFrameData::lengthBlock + .property uint32 lengthLocals() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_lengthLocals() + } // end of property IDiaFrameData::lengthLocals + .property uint32 lengthParams() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_lengthParams() + } // end of property IDiaFrameData::lengthParams + .property uint32 maxStack() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_maxStack() + } // end of property IDiaFrameData::maxStack + .property uint32 lengthProlog() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_lengthProlog() + } // end of property IDiaFrameData::lengthProlog + .property uint32 lengthSavedRegisters() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_lengthSavedRegisters() + } // end of property IDiaFrameData::lengthSavedRegisters + .property string program() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance string DIALib.IDiaFrameData::get_program() + } // end of property IDiaFrameData::program + .property int32 systemExceptionHandling() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaFrameData::get_systemExceptionHandling() + } // end of property IDiaFrameData::systemExceptionHandling + .property int32 cplusplusExceptionHandling() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaFrameData::get_cplusplusExceptionHandling() + } // end of property IDiaFrameData::cplusplusExceptionHandling + .property int32 functionStart() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaFrameData::get_functionStart() + } // end of property IDiaFrameData::functionStart + .property int32 allocatesBasePointer() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 10 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaFrameData::get_allocatesBasePointer() + } // end of property IDiaFrameData::allocatesBasePointer + .property uint32 'type'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 11 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaFrameData::get_type() + } // end of property IDiaFrameData::'type' + .property class DIALib.IDiaFrameData functionParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 12 00 00 00 00 00 ) + .get instance class DIALib.IDiaFrameData DIALib.IDiaFrameData::get_functionParent() + } // end of property IDiaFrameData::functionParent +} // end of class DIALib.IDiaFrameData + +.class interface public abstract auto ansi import DIALib.IDiaStackWalkFrame +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 30 37 43 35 39 30 43 31 2D 34 33 38 44 // ..$07C590C1-438D + 2D 34 46 34 37 2D 42 44 43 44 2D 34 33 39 37 42 // -4F47-BDCD-4397B + 43 38 31 41 44 37 35 00 00 ) // C81AD75.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_registerValue([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaStackWalkFrame::get_registerValue + + .method public hidebysig newslot specialname abstract virtual + instance void set_registerValue([in] uint32 index, + [in] uint64 pRetVal) runtime managed internalcall + { + } // end of method IDiaStackWalkFrame::set_registerValue + + .method public hidebysig newslot abstract virtual + instance void readMemory([in] valuetype DIALib.MemoryTypeEnum 'type', + [in] uint64 va, + [in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaStackWalkFrame::readMemory + + .method public hidebysig newslot abstract virtual + instance void searchForReturnAddress([in] class DIALib.IDiaFrameData marshal( interface ) frame, + [out] uint64& returnAddress) runtime managed internalcall + { + } // end of method IDiaStackWalkFrame::searchForReturnAddress + + .method public hidebysig newslot abstract virtual + instance void searchForReturnAddressStart([in] class DIALib.IDiaFrameData marshal( interface ) frame, + [in] uint64 startAddress, + [out] uint64& returnAddress) runtime managed internalcall + { + } // end of method IDiaStackWalkFrame::searchForReturnAddressStart + + .property uint64 registerValue(uint32) + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .set instance void DIALib.IDiaStackWalkFrame::set_registerValue(uint32, + uint64) + .get instance uint64 DIALib.IDiaStackWalkFrame::get_registerValue(uint32) + } // end of property IDiaStackWalkFrame::registerValue +} // end of class DIALib.IDiaStackWalkFrame + +.class interface public abstract auto ansi import DIALib.IDiaStackFrame +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 35 45 44 42 43 39 36 44 2D 43 44 44 36 // ..$5EDBC96D-CDD6 + 2D 34 37 39 32 2D 41 46 42 45 2D 43 43 38 39 30 // -4792-AFBE-CC890 + 30 37 44 39 36 31 30 00 00 ) // 07D9610.. + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_type() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_type + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_base() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_base + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_size() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_size + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_returnAddress() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_returnAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_localsBase() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_localsBase + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthLocals() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_lengthLocals + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthParams() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_lengthParams + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthProlog() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_lengthProlog + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lengthSavedRegisters() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_lengthSavedRegisters + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_systemExceptionHandling() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_systemExceptionHandling + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_cplusplusExceptionHandling() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_cplusplusExceptionHandling + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_functionStart() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_functionStart + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_allocatesBasePointer() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_allocatesBasePointer + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_maxStack() runtime managed internalcall + { + } // end of method IDiaStackFrame::get_maxStack + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_registerValue([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaStackFrame::get_registerValue + + .property uint32 'type'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaStackFrame::get_type() + } // end of property IDiaStackFrame::'type' + .property uint64 base() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaStackFrame::get_base() + } // end of property IDiaStackFrame::base + .property uint32 size() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaStackFrame::get_size() + } // end of property IDiaStackFrame::size + .property uint64 returnAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaStackFrame::get_returnAddress() + } // end of property IDiaStackFrame::returnAddress + .property uint64 localsBase() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaStackFrame::get_localsBase() + } // end of property IDiaStackFrame::localsBase + .property uint32 lengthLocals() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaStackFrame::get_lengthLocals() + } // end of property IDiaStackFrame::lengthLocals + .property uint32 lengthParams() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaStackFrame::get_lengthParams() + } // end of property IDiaStackFrame::lengthParams + .property uint32 lengthProlog() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaStackFrame::get_lengthProlog() + } // end of property IDiaStackFrame::lengthProlog + .property uint32 lengthSavedRegisters() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaStackFrame::get_lengthSavedRegisters() + } // end of property IDiaStackFrame::lengthSavedRegisters + .property int32 systemExceptionHandling() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaStackFrame::get_systemExceptionHandling() + } // end of property IDiaStackFrame::systemExceptionHandling + .property int32 cplusplusExceptionHandling() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaStackFrame::get_cplusplusExceptionHandling() + } // end of property IDiaStackFrame::cplusplusExceptionHandling + .property int32 functionStart() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaStackFrame::get_functionStart() + } // end of property IDiaStackFrame::functionStart + .property int32 allocatesBasePointer() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaStackFrame::get_allocatesBasePointer() + } // end of property IDiaStackFrame::allocatesBasePointer + .property uint32 maxStack() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaStackFrame::get_maxStack() + } // end of property IDiaStackFrame::maxStack + .property uint64 registerValue(uint32) + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaStackFrame::get_registerValue(uint32) + } // end of property IDiaStackFrame::registerValue +} // end of class DIALib.IDiaStackFrame + +.class interface public abstract auto ansi import DIALib.IDiaSectionContrib +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 30 43 46 34 42 36 30 45 2D 33 35 42 31 // ..$0CF4B60E-35B1 + 2D 34 43 36 43 2D 42 44 44 38 2D 38 35 34 42 39 // -4C6C-BDD8-854B9 + 43 38 45 33 38 35 37 00 00 ) // C8E3857.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_compiland() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_compiland + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_length() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_length + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_notPaged() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_notPaged + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_code() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_code + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_initializedData() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_initializedData + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_uninitializedData() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_uninitializedData + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_remove() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_remove + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_comdat() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_comdat + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_discardable() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_discardable + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_notCached() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_notCached + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_share() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_share + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_execute() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_execute + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_read() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_read + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_write() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_write + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_dataCrc() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_dataCrc + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relocationsCrc() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_relocationsCrc + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_compilandId() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_compilandId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_code16bit() runtime managed internalcall + { + } // end of method IDiaSectionContrib::get_code16bit + + .property class DIALib.IDiaSymbol compiland() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSectionContrib::get_compiland() + } // end of property IDiaSectionContrib::compiland + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSectionContrib::get_addressSection() + } // end of property IDiaSectionContrib::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSectionContrib::get_addressOffset() + } // end of property IDiaSectionContrib::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSectionContrib::get_relativeVirtualAddress() + } // end of property IDiaSectionContrib::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSectionContrib::get_virtualAddress() + } // end of property IDiaSectionContrib::virtualAddress + .property uint32 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSectionContrib::get_length() + } // end of property IDiaSectionContrib::length + .property int32 notPaged() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_notPaged() + } // end of property IDiaSectionContrib::notPaged + .property int32 code() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_code() + } // end of property IDiaSectionContrib::code + .property int32 initializedData() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_initializedData() + } // end of property IDiaSectionContrib::initializedData + .property int32 uninitializedData() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_uninitializedData() + } // end of property IDiaSectionContrib::uninitializedData + .property int32 remove() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_remove() + } // end of property IDiaSectionContrib::remove + .property int32 comdat() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_comdat() + } // end of property IDiaSectionContrib::comdat + .property int32 discardable() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_discardable() + } // end of property IDiaSectionContrib::discardable + .property int32 notCached() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_notCached() + } // end of property IDiaSectionContrib::notCached + .property int32 share() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 10 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_share() + } // end of property IDiaSectionContrib::share + .property int32 execute() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 11 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_execute() + } // end of property IDiaSectionContrib::execute + .property int32 read() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 12 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_read() + } // end of property IDiaSectionContrib::read + .property int32 write() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 13 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_write() + } // end of property IDiaSectionContrib::write + .property uint32 dataCrc() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 14 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSectionContrib::get_dataCrc() + } // end of property IDiaSectionContrib::dataCrc + .property uint32 relocationsCrc() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 15 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSectionContrib::get_relocationsCrc() + } // end of property IDiaSectionContrib::relocationsCrc + .property uint32 compilandId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 16 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSectionContrib::get_compilandId() + } // end of property IDiaSectionContrib::compilandId + .property int32 code16bit() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 17 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSectionContrib::get_code16bit() + } // end of property IDiaSectionContrib::code16bit +} // end of class DIALib.IDiaSectionContrib + +.class interface public abstract auto ansi import DIALib.IDiaEnumSectionContribs +{ + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 31 39 39 34 44 45 42 32 2D 32 43 38 32 // ..$1994DEB2-2C82 + 2D 34 42 31 44 2D 41 35 37 46 2D 41 46 46 34 32 // -4B1D-A57F-AFF42 + 34 44 35 34 41 36 38 00 00 ) // 4D54A68.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot abstract virtual + instance class [mscorlib]System.Collections.IEnumerator + marshal( custom ("System.Runtime.InteropServices.CustomMarshalers.EnumeratorToEnumVariantMarshaler, CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a","")) + GetEnumerator() runtime managed internalcall + { + } // end of method IDiaEnumSectionContribs::GetEnumerator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_count() runtime managed internalcall + { + } // end of method IDiaEnumSectionContribs::get_count + + .method public hidebysig newslot abstract virtual + instance class DIALib.IDiaSectionContrib + marshal( interface ) + Item([in] uint32 index) runtime managed internalcall + { + } // end of method IDiaEnumSectionContribs::Item + + .method public hidebysig newslot abstract virtual + instance void Next([in] uint32 celt, + [out] class DIALib.IDiaSectionContrib& marshal( interface ) rgelt, + [out] uint32& pceltFetched) runtime managed internalcall + { + } // end of method IDiaEnumSectionContribs::Next + + .method public hidebysig newslot abstract virtual + instance void Skip([in] uint32 celt) runtime managed internalcall + { + } // end of method IDiaEnumSectionContribs::Skip + + .method public hidebysig newslot abstract virtual + instance void Reset() runtime managed internalcall + { + } // end of method IDiaEnumSectionContribs::Reset + + .method public hidebysig newslot abstract virtual + instance void Clone([out] class DIALib.IDiaEnumSectionContribs& marshal( interface ) ppenum) runtime managed internalcall + { + } // end of method IDiaEnumSectionContribs::Clone + + .property int32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaEnumSectionContribs::get_count() + } // end of property IDiaEnumSectionContribs::count +} // end of class DIALib.IDiaEnumSectionContribs + +.class interface public abstract auto ansi import DIALib.IDiaSymbol2 + implements DIALib.IDiaSymbol +{ + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 0A 73 79 6D 49 6E 64 65 78 49 64 00 00 ) // ...symIndexId.. + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 36 31 31 45 38 36 43 44 2D 42 37 44 31 // ..$611E86CD-B7D1 + 2D 34 35 34 36 2D 38 41 31 35 2D 30 37 30 45 32 // -4546-8A15-070E2 + 42 30 37 41 34 32 37 00 00 ) // B07A427.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symIndexId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_symIndexId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symTag() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_symTag + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_name() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_name + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lexicalParent() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_lexicalParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_classParent() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_classParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_type() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_type + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_dataKind() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_dataKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_locationType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_locationType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_registerId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_offset() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_offset + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_length() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_length + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_slot() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_slot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_volatileType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_volatileType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_constType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_unalignedType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_unalignedType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_access() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_access + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_libraryName() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_libraryName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_platform() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_platform + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_language() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_language + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_editAndContinueEnabled() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_editAndContinueEnabled + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_frontEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_frontEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_frontEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_backEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_backEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_backEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_sourceFileName() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_sourceFileName + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_unused() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_unused + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_thunkOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_thunkOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_thisAdjust() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_thisAdjust + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseOffset() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtualBaseOffset + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtual() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtual + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intro() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_intro + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_pure() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_pure + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_callingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_callingConvention + + .method public hidebysig newslot specialname abstract virtual + instance object + marshal( struct) + get_value() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_value + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_baseType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_token() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_token + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_timeStamp() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_timeStamp + + .method public hidebysig newslot specialname abstract virtual + instance valuetype [mscorlib]System.Guid + get_guid() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_guid + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_symbolsFileName() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_symbolsFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_reference() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_reference + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_count() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_count + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bitPosition() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_bitPosition + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_arrayIndexType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_arrayIndexType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_packed() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_packed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constructor() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_constructor + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_overloadedOperator() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_overloadedOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_nested() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_nested + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasNestedTypes() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasNestedTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAssignmentOperator() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasAssignmentOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasCastOperator() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasCastOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_scoped() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_scoped + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_indirectVirtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_indirectVirtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBasePointerOffset() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtualBasePointerOffset + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualTableShape() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtualTableShape + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lexicalParentId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_lexicalParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_classParentId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_classParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_typeId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_typeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_arrayIndexTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_arrayIndexTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualTableShapeId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtualTableShapeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_code() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_code + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_function() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_function + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_managed() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_managed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_msil() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_msil + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseDispIndex() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtualBaseDispIndex + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_undecoratedName() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_undecoratedName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_age() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_age + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_signature() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_signature + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_compilerGenerated() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_compilerGenerated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_addressTaken() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_addressTaken + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_rank() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_rank + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lowerBound() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_lowerBound + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_upperBound() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_upperBound + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lowerBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_lowerBoundId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_upperBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_upperBoundId + + .method public hidebysig newslot abstract virtual + instance void get_dataBytes([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaSymbol2::get_dataBytes + + .method public hidebysig newslot abstract virtual + instance void findChildren([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findChildren + + .method public hidebysig newslot abstract virtual + instance void findChildrenEx([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findChildrenEx + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByAddr([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findChildrenExByAddr + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findChildrenExByVA + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByRVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findChildrenExByRVA + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetSection() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_targetSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetOffset() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_targetOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_targetRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_targetVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_targetVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_machineType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_machineType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_oemId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_oemSymbolId + + .method public hidebysig newslot abstract virtual + instance void get_types([in] uint32 cTypes, + [out] uint32& pcTypes, + [out] class DIALib.IDiaSymbol& marshal( interface ) pTypes) runtime managed internalcall + { + } // end of method IDiaSymbol2::get_types + + .method public hidebysig newslot abstract virtual + instance void get_typeIds([in] uint32 cTypeIds, + [out] uint32& pcTypeIds, + [out] uint32& pdwTypeIds) runtime managed internalcall + { + } // end of method IDiaSymbol2::get_typeIds + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_objectPointerType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_objectPointerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_udtKind() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_udtKind + + .method public hidebysig newslot abstract virtual + instance void get_undecoratedNameEx([in] uint32 undecorateOptions, + [out] string& marshal( bstr) name) runtime managed internalcall + { + } // end of method IDiaSymbol2::get_undecoratedNameEx + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noReturn() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_noReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_customCallingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_customCallingConvention + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noInline() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_noInline + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_optimizedCodeDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_optimizedCodeDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_notReached() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_notReached + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_interruptReturn() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_interruptReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_farReturn() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_farReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStatic() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isStatic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLTCG() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isLTCG + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isDataAligned() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isDataAligned + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSecurityChecks() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasSecurityChecks + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_compilerName() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_compilerName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAlloca() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasAlloca + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSetJump() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasSetJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasLongJump() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasLongJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasInlAsm() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasInlAsm + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEH() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSEH() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasSEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEHa() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasEHa + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isNaked() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isNaked + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAggregated() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isAggregated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSplitted() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isSplitted + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_container() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_container + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_inlSpec() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_inlSpec + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noStackOrdering() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_noStackOrdering + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualBaseTableType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_virtualBaseTableType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasManagedCode() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasManagedCode + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHotpatchable() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isHotpatchable + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCVTCIL() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isCVTCIL + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMSILNetmodule() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isMSILNetmodule + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCTypes() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isCTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStripped() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isStripped + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_frontEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_backEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_wasInlined() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_wasInlined + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_strictGSCheck() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_strictGSCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCxxReturnUdt() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isCxxReturnUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isConstructorVirtualBase() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isConstructorVirtualBase + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_RValueReference() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_RValueReference + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_unmodifiedType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_unmodifiedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_framePointerPresent() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_framePointerPresent + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSafeBuffers() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isSafeBuffers + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intrinsic() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_intrinsic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_sealed() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_sealed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaFloat() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hfaFloat + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaDouble() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hfaDouble + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_liveRangeStartAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_liveRangeStartAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_liveRangeStartRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_countLiveRanges() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_countLiveRanges + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_liveRangeLength() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_liveRangeLength + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_offsetInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_offsetInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_paramBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_paramBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_localBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_localBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLocationControlFlowDependent() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isLocationControlFlowDependent + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_stride() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_stride + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRows() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_numberOfRows + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfColumns() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_numberOfColumns + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMatrixRowMajor() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isMatrixRowMajor + + .method public hidebysig newslot abstract virtual + instance void get_numericProperties([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pProperties) runtime managed internalcall + { + } // end of method IDiaSymbol2::get_numericProperties + + .method public hidebysig newslot abstract virtual + instance void get_modifierValues([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint16& pModifiers) runtime managed internalcall + { + } // end of method IDiaSymbol2::get_modifierValues + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isReturnValue() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isReturnValue + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedAway() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isOptimizedAway + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_builtInKind() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_builtInKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_registerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataSlot() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_baseDataSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataOffset() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_baseDataOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_textureSlot() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_textureSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_samplerSlot() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_samplerSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_uavSlot() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_uavSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_sizeInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_sizeInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_memorySpaceKind() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_memorySpaceKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_unmodifiedTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_unmodifiedTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_subTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_subTypeId + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_subType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_subType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfModifiers() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_numberOfModifiers + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRegisterIndices() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_numberOfRegisterIndices + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHLSLData() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isHLSLData + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToDataMember() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isPointerToDataMember + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToMemberFunction() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isPointerToMemberFunction + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSingleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isSingleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMultipleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isMultipleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isVirtualInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isVirtualInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_restrictedType() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_restrictedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerBasedOnSymbolValue() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isPointerBasedOnSymbolValue + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_baseSymbol() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_baseSymbol + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_baseSymbolId + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_objectFileName() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_objectFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorGroupSharedLocal() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isAcceleratorGroupSharedLocal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorPointerTagLiveRange() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isAcceleratorPointerTagLiveRange + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorStubFunction() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isAcceleratorStubFunction + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfAcceleratorPointerTags() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_numberOfAcceleratorPointerTags + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSdl() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isSdl + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isWinRTPointer() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isWinRTPointer + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isRefUdt() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isRefUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isValueUdt() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isValueUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isInterfaceUdt() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isInterfaceUdt + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByAddr([in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findInlineFramesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByRVA([in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findInlineFramesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByVA([in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findInlineFramesByVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLines([out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findInlineeLines + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByAddr([in] uint32 isect, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findInlineeLinesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByRVA([in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findInlineeLinesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByVA([in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findInlineeLinesByVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolsForAcceleratorPointerTag([in] uint32 tagValue, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findSymbolsForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void findSymbolsByRVAForAcceleratorPointerTag([in] uint32 tagValue, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findSymbolsByRVAForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void get_acceleratorPointerTags([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pPointerTags) runtime managed internalcall + { + } // end of method IDiaSymbol2::get_acceleratorPointerTags + + .method public hidebysig newslot abstract virtual + instance void getSrcLineOnTypeDefn([out] class DIALib.IDiaLineNumber& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::getSrcLineOnTypeDefn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPGO() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isPGO + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasValidPGOCounts() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasValidPGOCounts + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedForSpeed() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isOptimizedForSpeed + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEntryCount() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_PGOEntryCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEdgeCount() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_PGOEdgeCount + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_PGODynamicInstructionCount() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_PGODynamicInstructionCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_staticSize() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_staticSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_finalLiveStaticSize() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_finalLiveStaticSize + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_phaseName() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_phaseName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasControlFlowCheck() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_hasControlFlowCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constantExport() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_constantExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_dataExport() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_dataExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_privateExport() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_privateExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noNameExport() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_noNameExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportHasExplicitlyAssignedOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_exportHasExplicitlyAssignedOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportIsForwarder() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_exportIsForwarder + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_ordinal() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_ordinal + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frameSize() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_frameSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_exceptionHandlerAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_exceptionHandlerAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_exceptionHandlerRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_exceptionHandlerVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_exceptionHandlerVirtualAddress + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyFile([out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol2::findInputAssemblyFile + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_characteristics() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_characteristics + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_coffGroup() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_coffGroup + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindID() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_bindID + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSpace() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_bindSpace + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSlot() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_bindSlot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCClass() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isObjCClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCCategory() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isObjCCategory + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCProtocol() runtime managed internalcall + { + } // end of method IDiaSymbol2::get_isObjCProtocol + + .property uint32 symIndexId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 00 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_symIndexId() + } // end of property IDiaSymbol2::symIndexId + .property uint32 symTag() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_symTag() + } // end of property IDiaSymbol2::symTag + .property string name() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol2::get_name() + } // end of property IDiaSymbol2::name + .property class DIALib.IDiaSymbol lexicalParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_lexicalParent() + } // end of property IDiaSymbol2::lexicalParent + .property class DIALib.IDiaSymbol classParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_classParent() + } // end of property IDiaSymbol2::classParent + .property class DIALib.IDiaSymbol 'type'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_type() + } // end of property IDiaSymbol2::'type' + .property uint32 dataKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_dataKind() + } // end of property IDiaSymbol2::dataKind + .property uint32 locationType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_locationType() + } // end of property IDiaSymbol2::locationType + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_addressSection() + } // end of property IDiaSymbol2::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_addressOffset() + } // end of property IDiaSymbol2::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_relativeVirtualAddress() + } // end of property IDiaSymbol2::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol2::get_virtualAddress() + } // end of property IDiaSymbol2::virtualAddress + .property uint32 registerId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_registerId() + } // end of property IDiaSymbol2::registerId + .property int32 offset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_offset() + } // end of property IDiaSymbol2::offset + .property uint64 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol2::get_length() + } // end of property IDiaSymbol2::length + .property uint32 slot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_slot() + } // end of property IDiaSymbol2::slot + .property int32 volatileType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 10 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_volatileType() + } // end of property IDiaSymbol2::volatileType + .property int32 constType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 11 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_constType() + } // end of property IDiaSymbol2::constType + .property int32 unalignedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 12 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_unalignedType() + } // end of property IDiaSymbol2::unalignedType + .property uint32 access() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 13 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_access() + } // end of property IDiaSymbol2::access + .property string libraryName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 14 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol2::get_libraryName() + } // end of property IDiaSymbol2::libraryName + .property uint32 platform() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 15 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_platform() + } // end of property IDiaSymbol2::platform + .property uint32 language() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 16 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_language() + } // end of property IDiaSymbol2::language + .property int32 editAndContinueEnabled() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 17 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_editAndContinueEnabled() + } // end of property IDiaSymbol2::editAndContinueEnabled + .property uint32 frontEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 18 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_frontEndMajor() + } // end of property IDiaSymbol2::frontEndMajor + .property uint32 frontEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 19 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_frontEndMinor() + } // end of property IDiaSymbol2::frontEndMinor + .property uint32 frontEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_frontEndBuild() + } // end of property IDiaSymbol2::frontEndBuild + .property uint32 backEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_backEndMajor() + } // end of property IDiaSymbol2::backEndMajor + .property uint32 backEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_backEndMinor() + } // end of property IDiaSymbol2::backEndMinor + .property uint32 backEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_backEndBuild() + } // end of property IDiaSymbol2::backEndBuild + .property string sourceFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1E 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol2::get_sourceFileName() + } // end of property IDiaSymbol2::sourceFileName + .property string 'unused'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1F 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol2::get_unused() + } // end of property IDiaSymbol2::'unused' + .property uint32 thunkOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 20 00 00 00 00 00 ) // .. ..... + .get instance uint32 DIALib.IDiaSymbol2::get_thunkOrdinal() + } // end of property IDiaSymbol2::thunkOrdinal + .property int32 thisAdjust() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 21 00 00 00 00 00 ) // ..!..... + .get instance int32 DIALib.IDiaSymbol2::get_thisAdjust() + } // end of property IDiaSymbol2::thisAdjust + .property uint32 virtualBaseOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 22 00 00 00 00 00 ) // .."..... + .get instance uint32 DIALib.IDiaSymbol2::get_virtualBaseOffset() + } // end of property IDiaSymbol2::virtualBaseOffset + .property int32 'virtual'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 23 00 00 00 00 00 ) // ..#..... + .get instance int32 DIALib.IDiaSymbol2::get_virtual() + } // end of property IDiaSymbol2::'virtual' + .property int32 intro() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 24 00 00 00 00 00 ) // ..$..... + .get instance int32 DIALib.IDiaSymbol2::get_intro() + } // end of property IDiaSymbol2::intro + .property int32 pure() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 25 00 00 00 00 00 ) // ..%..... + .get instance int32 DIALib.IDiaSymbol2::get_pure() + } // end of property IDiaSymbol2::pure + .property uint32 callingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 26 00 00 00 00 00 ) // ..&..... + .get instance uint32 DIALib.IDiaSymbol2::get_callingConvention() + } // end of property IDiaSymbol2::callingConvention + .property object 'value'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 27 00 00 00 00 00 ) // ..'..... + .get instance object DIALib.IDiaSymbol2::get_value() + } // end of property IDiaSymbol2::'value' + .property uint32 baseType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 28 00 00 00 00 00 ) // ..(..... + .get instance uint32 DIALib.IDiaSymbol2::get_baseType() + } // end of property IDiaSymbol2::baseType + .property uint32 token() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 29 00 00 00 00 00 ) // ..)..... + .get instance uint32 DIALib.IDiaSymbol2::get_token() + } // end of property IDiaSymbol2::token + .property uint32 timeStamp() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2A 00 00 00 00 00 ) // ..*..... + .get instance uint32 DIALib.IDiaSymbol2::get_timeStamp() + } // end of property IDiaSymbol2::timeStamp + .property valuetype [mscorlib]System.Guid + guid() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2B 00 00 00 00 00 ) // ..+..... + .get instance valuetype [mscorlib]System.Guid DIALib.IDiaSymbol2::get_guid() + } // end of property IDiaSymbol2::guid + .property string symbolsFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2C 00 00 00 00 00 ) // ..,..... + .get instance string DIALib.IDiaSymbol2::get_symbolsFileName() + } // end of property IDiaSymbol2::symbolsFileName + .property int32 reference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2E 00 00 00 00 00 ) // ........ + .get instance int32 DIALib.IDiaSymbol2::get_reference() + } // end of property IDiaSymbol2::reference + .property uint32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2F 00 00 00 00 00 ) // ../..... + .get instance uint32 DIALib.IDiaSymbol2::get_count() + } // end of property IDiaSymbol2::count + .property uint32 bitPosition() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 31 00 00 00 00 00 ) // ..1..... + .get instance uint32 DIALib.IDiaSymbol2::get_bitPosition() + } // end of property IDiaSymbol2::bitPosition + .property class DIALib.IDiaSymbol arrayIndexType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 32 00 00 00 00 00 ) // ..2..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_arrayIndexType() + } // end of property IDiaSymbol2::arrayIndexType + .property int32 packed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 33 00 00 00 00 00 ) // ..3..... + .get instance int32 DIALib.IDiaSymbol2::get_packed() + } // end of property IDiaSymbol2::packed + .property int32 constructor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 34 00 00 00 00 00 ) // ..4..... + .get instance int32 DIALib.IDiaSymbol2::get_constructor() + } // end of property IDiaSymbol2::constructor + .property int32 overloadedOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 35 00 00 00 00 00 ) // ..5..... + .get instance int32 DIALib.IDiaSymbol2::get_overloadedOperator() + } // end of property IDiaSymbol2::overloadedOperator + .property int32 'nested'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 36 00 00 00 00 00 ) // ..6..... + .get instance int32 DIALib.IDiaSymbol2::get_nested() + } // end of property IDiaSymbol2::'nested' + .property int32 hasNestedTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 37 00 00 00 00 00 ) // ..7..... + .get instance int32 DIALib.IDiaSymbol2::get_hasNestedTypes() + } // end of property IDiaSymbol2::hasNestedTypes + .property int32 hasAssignmentOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 38 00 00 00 00 00 ) // ..8..... + .get instance int32 DIALib.IDiaSymbol2::get_hasAssignmentOperator() + } // end of property IDiaSymbol2::hasAssignmentOperator + .property int32 hasCastOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 39 00 00 00 00 00 ) // ..9..... + .get instance int32 DIALib.IDiaSymbol2::get_hasCastOperator() + } // end of property IDiaSymbol2::hasCastOperator + .property int32 scoped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3A 00 00 00 00 00 ) // ..:..... + .get instance int32 DIALib.IDiaSymbol2::get_scoped() + } // end of property IDiaSymbol2::scoped + .property int32 virtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3B 00 00 00 00 00 ) // ..;..... + .get instance int32 DIALib.IDiaSymbol2::get_virtualBaseClass() + } // end of property IDiaSymbol2::virtualBaseClass + .property int32 indirectVirtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3C 00 00 00 00 00 ) // ..<..... + .get instance int32 DIALib.IDiaSymbol2::get_indirectVirtualBaseClass() + } // end of property IDiaSymbol2::indirectVirtualBaseClass + .property int32 virtualBasePointerOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3D 00 00 00 00 00 ) // ..=..... + .get instance int32 DIALib.IDiaSymbol2::get_virtualBasePointerOffset() + } // end of property IDiaSymbol2::virtualBasePointerOffset + .property class DIALib.IDiaSymbol virtualTableShape() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3E 00 00 00 00 00 ) // ..>..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_virtualTableShape() + } // end of property IDiaSymbol2::virtualTableShape + .property uint32 lexicalParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 40 00 00 00 00 00 ) // ..@..... + .get instance uint32 DIALib.IDiaSymbol2::get_lexicalParentId() + } // end of property IDiaSymbol2::lexicalParentId + .property uint32 classParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 41 00 00 00 00 00 ) // ..A..... + .get instance uint32 DIALib.IDiaSymbol2::get_classParentId() + } // end of property IDiaSymbol2::classParentId + .property uint32 typeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 42 00 00 00 00 00 ) // ..B..... + .get instance uint32 DIALib.IDiaSymbol2::get_typeId() + } // end of property IDiaSymbol2::typeId + .property uint32 arrayIndexTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 43 00 00 00 00 00 ) // ..C..... + .get instance uint32 DIALib.IDiaSymbol2::get_arrayIndexTypeId() + } // end of property IDiaSymbol2::arrayIndexTypeId + .property uint32 virtualTableShapeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 44 00 00 00 00 00 ) // ..D..... + .get instance uint32 DIALib.IDiaSymbol2::get_virtualTableShapeId() + } // end of property IDiaSymbol2::virtualTableShapeId + .property int32 code() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 45 00 00 00 00 00 ) // ..E..... + .get instance int32 DIALib.IDiaSymbol2::get_code() + } // end of property IDiaSymbol2::code + .property int32 function() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 46 00 00 00 00 00 ) // ..F..... + .get instance int32 DIALib.IDiaSymbol2::get_function() + } // end of property IDiaSymbol2::function + .property int32 'managed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 47 00 00 00 00 00 ) // ..G..... + .get instance int32 DIALib.IDiaSymbol2::get_managed() + } // end of property IDiaSymbol2::'managed' + .property int32 msil() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 48 00 00 00 00 00 ) // ..H..... + .get instance int32 DIALib.IDiaSymbol2::get_msil() + } // end of property IDiaSymbol2::msil + .property uint32 virtualBaseDispIndex() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 49 00 00 00 00 00 ) // ..I..... + .get instance uint32 DIALib.IDiaSymbol2::get_virtualBaseDispIndex() + } // end of property IDiaSymbol2::virtualBaseDispIndex + .property string undecoratedName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4A 00 00 00 00 00 ) // ..J..... + .get instance string DIALib.IDiaSymbol2::get_undecoratedName() + } // end of property IDiaSymbol2::undecoratedName + .property uint32 age() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4B 00 00 00 00 00 ) // ..K..... + .get instance uint32 DIALib.IDiaSymbol2::get_age() + } // end of property IDiaSymbol2::age + .property uint32 signature() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4C 00 00 00 00 00 ) // ..L..... + .get instance uint32 DIALib.IDiaSymbol2::get_signature() + } // end of property IDiaSymbol2::signature + .property int32 compilerGenerated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4D 00 00 00 00 00 ) // ..M..... + .get instance int32 DIALib.IDiaSymbol2::get_compilerGenerated() + } // end of property IDiaSymbol2::compilerGenerated + .property int32 addressTaken() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4E 00 00 00 00 00 ) // ..N..... + .get instance int32 DIALib.IDiaSymbol2::get_addressTaken() + } // end of property IDiaSymbol2::addressTaken + .property uint32 rank() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4F 00 00 00 00 00 ) // ..O..... + .get instance uint32 DIALib.IDiaSymbol2::get_rank() + } // end of property IDiaSymbol2::rank + .property class DIALib.IDiaSymbol lowerBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 50 00 00 00 00 00 ) // ..P..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_lowerBound() + } // end of property IDiaSymbol2::lowerBound + .property class DIALib.IDiaSymbol upperBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 51 00 00 00 00 00 ) // ..Q..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_upperBound() + } // end of property IDiaSymbol2::upperBound + .property uint32 lowerBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 52 00 00 00 00 00 ) // ..R..... + .get instance uint32 DIALib.IDiaSymbol2::get_lowerBoundId() + } // end of property IDiaSymbol2::lowerBoundId + .property uint32 upperBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 53 00 00 00 00 00 ) // ..S..... + .get instance uint32 DIALib.IDiaSymbol2::get_upperBoundId() + } // end of property IDiaSymbol2::upperBoundId + .property uint32 targetSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 54 00 00 00 00 00 ) // ..T..... + .get instance uint32 DIALib.IDiaSymbol2::get_targetSection() + } // end of property IDiaSymbol2::targetSection + .property uint32 targetOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 55 00 00 00 00 00 ) // ..U..... + .get instance uint32 DIALib.IDiaSymbol2::get_targetOffset() + } // end of property IDiaSymbol2::targetOffset + .property uint32 targetRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 56 00 00 00 00 00 ) // ..V..... + .get instance uint32 DIALib.IDiaSymbol2::get_targetRelativeVirtualAddress() + } // end of property IDiaSymbol2::targetRelativeVirtualAddress + .property uint64 targetVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 57 00 00 00 00 00 ) // ..W..... + .get instance uint64 DIALib.IDiaSymbol2::get_targetVirtualAddress() + } // end of property IDiaSymbol2::targetVirtualAddress + .property uint32 machineType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 58 00 00 00 00 00 ) // ..X..... + .get instance uint32 DIALib.IDiaSymbol2::get_machineType() + } // end of property IDiaSymbol2::machineType + .property uint32 oemId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 59 00 00 00 00 00 ) // ..Y..... + .get instance uint32 DIALib.IDiaSymbol2::get_oemId() + } // end of property IDiaSymbol2::oemId + .property uint32 oemSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5A 00 00 00 00 00 ) // ..Z..... + .get instance uint32 DIALib.IDiaSymbol2::get_oemSymbolId() + } // end of property IDiaSymbol2::oemSymbolId + .property class DIALib.IDiaSymbol objectPointerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5B 00 00 00 00 00 ) // ..[..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_objectPointerType() + } // end of property IDiaSymbol2::objectPointerType + .property uint32 udtKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5C 00 00 00 00 00 ) // ..\..... + .get instance uint32 DIALib.IDiaSymbol2::get_udtKind() + } // end of property IDiaSymbol2::udtKind + .property int32 noReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5D 00 00 00 00 00 ) // ..]..... + .get instance int32 DIALib.IDiaSymbol2::get_noReturn() + } // end of property IDiaSymbol2::noReturn + .property int32 customCallingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5E 00 00 00 00 00 ) // ..^..... + .get instance int32 DIALib.IDiaSymbol2::get_customCallingConvention() + } // end of property IDiaSymbol2::customCallingConvention + .property int32 noInline() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5F 00 00 00 00 00 ) // .._..... + .get instance int32 DIALib.IDiaSymbol2::get_noInline() + } // end of property IDiaSymbol2::noInline + .property int32 optimizedCodeDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 60 00 00 00 00 00 ) // ..`..... + .get instance int32 DIALib.IDiaSymbol2::get_optimizedCodeDebugInfo() + } // end of property IDiaSymbol2::optimizedCodeDebugInfo + .property int32 notReached() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 61 00 00 00 00 00 ) // ..a..... + .get instance int32 DIALib.IDiaSymbol2::get_notReached() + } // end of property IDiaSymbol2::notReached + .property int32 interruptReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 62 00 00 00 00 00 ) // ..b..... + .get instance int32 DIALib.IDiaSymbol2::get_interruptReturn() + } // end of property IDiaSymbol2::interruptReturn + .property int32 farReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 63 00 00 00 00 00 ) // ..c..... + .get instance int32 DIALib.IDiaSymbol2::get_farReturn() + } // end of property IDiaSymbol2::farReturn + .property int32 isStatic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 64 00 00 00 00 00 ) // ..d..... + .get instance int32 DIALib.IDiaSymbol2::get_isStatic() + } // end of property IDiaSymbol2::isStatic + .property int32 hasDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 65 00 00 00 00 00 ) // ..e..... + .get instance int32 DIALib.IDiaSymbol2::get_hasDebugInfo() + } // end of property IDiaSymbol2::hasDebugInfo + .property int32 isLTCG() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 66 00 00 00 00 00 ) // ..f..... + .get instance int32 DIALib.IDiaSymbol2::get_isLTCG() + } // end of property IDiaSymbol2::isLTCG + .property int32 isDataAligned() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 67 00 00 00 00 00 ) // ..g..... + .get instance int32 DIALib.IDiaSymbol2::get_isDataAligned() + } // end of property IDiaSymbol2::isDataAligned + .property int32 hasSecurityChecks() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 68 00 00 00 00 00 ) // ..h..... + .get instance int32 DIALib.IDiaSymbol2::get_hasSecurityChecks() + } // end of property IDiaSymbol2::hasSecurityChecks + .property string compilerName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 69 00 00 00 00 00 ) // ..i..... + .get instance string DIALib.IDiaSymbol2::get_compilerName() + } // end of property IDiaSymbol2::compilerName + .property int32 hasAlloca() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6A 00 00 00 00 00 ) // ..j..... + .get instance int32 DIALib.IDiaSymbol2::get_hasAlloca() + } // end of property IDiaSymbol2::hasAlloca + .property int32 hasSetJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6B 00 00 00 00 00 ) // ..k..... + .get instance int32 DIALib.IDiaSymbol2::get_hasSetJump() + } // end of property IDiaSymbol2::hasSetJump + .property int32 hasLongJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6C 00 00 00 00 00 ) // ..l..... + .get instance int32 DIALib.IDiaSymbol2::get_hasLongJump() + } // end of property IDiaSymbol2::hasLongJump + .property int32 hasInlAsm() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6D 00 00 00 00 00 ) // ..m..... + .get instance int32 DIALib.IDiaSymbol2::get_hasInlAsm() + } // end of property IDiaSymbol2::hasInlAsm + .property int32 hasEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6E 00 00 00 00 00 ) // ..n..... + .get instance int32 DIALib.IDiaSymbol2::get_hasEH() + } // end of property IDiaSymbol2::hasEH + .property int32 hasSEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6F 00 00 00 00 00 ) // ..o..... + .get instance int32 DIALib.IDiaSymbol2::get_hasSEH() + } // end of property IDiaSymbol2::hasSEH + .property int32 hasEHa() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 70 00 00 00 00 00 ) // ..p..... + .get instance int32 DIALib.IDiaSymbol2::get_hasEHa() + } // end of property IDiaSymbol2::hasEHa + .property int32 isNaked() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 71 00 00 00 00 00 ) // ..q..... + .get instance int32 DIALib.IDiaSymbol2::get_isNaked() + } // end of property IDiaSymbol2::isNaked + .property int32 isAggregated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 72 00 00 00 00 00 ) // ..r..... + .get instance int32 DIALib.IDiaSymbol2::get_isAggregated() + } // end of property IDiaSymbol2::isAggregated + .property int32 isSplitted() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 73 00 00 00 00 00 ) // ..s..... + .get instance int32 DIALib.IDiaSymbol2::get_isSplitted() + } // end of property IDiaSymbol2::isSplitted + .property class DIALib.IDiaSymbol container() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 74 00 00 00 00 00 ) // ..t..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_container() + } // end of property IDiaSymbol2::container + .property int32 inlSpec() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 75 00 00 00 00 00 ) // ..u..... + .get instance int32 DIALib.IDiaSymbol2::get_inlSpec() + } // end of property IDiaSymbol2::inlSpec + .property int32 noStackOrdering() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 76 00 00 00 00 00 ) // ..v..... + .get instance int32 DIALib.IDiaSymbol2::get_noStackOrdering() + } // end of property IDiaSymbol2::noStackOrdering + .property class DIALib.IDiaSymbol virtualBaseTableType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 77 00 00 00 00 00 ) // ..w..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_virtualBaseTableType() + } // end of property IDiaSymbol2::virtualBaseTableType + .property int32 hasManagedCode() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 78 00 00 00 00 00 ) // ..x..... + .get instance int32 DIALib.IDiaSymbol2::get_hasManagedCode() + } // end of property IDiaSymbol2::hasManagedCode + .property int32 isHotpatchable() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 79 00 00 00 00 00 ) // ..y..... + .get instance int32 DIALib.IDiaSymbol2::get_isHotpatchable() + } // end of property IDiaSymbol2::isHotpatchable + .property int32 isCVTCIL() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7A 00 00 00 00 00 ) // ..z..... + .get instance int32 DIALib.IDiaSymbol2::get_isCVTCIL() + } // end of property IDiaSymbol2::isCVTCIL + .property int32 isMSILNetmodule() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7B 00 00 00 00 00 ) // ..{..... + .get instance int32 DIALib.IDiaSymbol2::get_isMSILNetmodule() + } // end of property IDiaSymbol2::isMSILNetmodule + .property int32 isCTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7C 00 00 00 00 00 ) // ..|..... + .get instance int32 DIALib.IDiaSymbol2::get_isCTypes() + } // end of property IDiaSymbol2::isCTypes + .property int32 isStripped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7D 00 00 00 00 00 ) // ..}..... + .get instance int32 DIALib.IDiaSymbol2::get_isStripped() + } // end of property IDiaSymbol2::isStripped + .property uint32 frontEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7E 00 00 00 00 00 ) // ..~..... + .get instance uint32 DIALib.IDiaSymbol2::get_frontEndQFE() + } // end of property IDiaSymbol2::frontEndQFE + .property uint32 backEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_backEndQFE() + } // end of property IDiaSymbol2::backEndQFE + .property int32 wasInlined() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 80 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_wasInlined() + } // end of property IDiaSymbol2::wasInlined + .property int32 strictGSCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 81 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_strictGSCheck() + } // end of property IDiaSymbol2::strictGSCheck + .property int32 isCxxReturnUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 82 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isCxxReturnUdt() + } // end of property IDiaSymbol2::isCxxReturnUdt + .property int32 isConstructorVirtualBase() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 83 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isConstructorVirtualBase() + } // end of property IDiaSymbol2::isConstructorVirtualBase + .property int32 RValueReference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 84 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_RValueReference() + } // end of property IDiaSymbol2::RValueReference + .property class DIALib.IDiaSymbol unmodifiedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 85 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_unmodifiedType() + } // end of property IDiaSymbol2::unmodifiedType + .property int32 framePointerPresent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 86 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_framePointerPresent() + } // end of property IDiaSymbol2::framePointerPresent + .property int32 isSafeBuffers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 87 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isSafeBuffers() + } // end of property IDiaSymbol2::isSafeBuffers + .property int32 intrinsic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 88 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_intrinsic() + } // end of property IDiaSymbol2::intrinsic + .property int32 'sealed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 89 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_sealed() + } // end of property IDiaSymbol2::'sealed' + .property int32 hfaFloat() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_hfaFloat() + } // end of property IDiaSymbol2::hfaFloat + .property int32 hfaDouble() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8B 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_hfaDouble() + } // end of property IDiaSymbol2::hfaDouble + .property uint32 liveRangeStartAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_liveRangeStartAddressSection() + } // end of property IDiaSymbol2::liveRangeStartAddressSection + .property uint32 liveRangeStartAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_liveRangeStartAddressOffset() + } // end of property IDiaSymbol2::liveRangeStartAddressOffset + .property uint32 liveRangeStartRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_liveRangeStartRelativeVirtualAddress() + } // end of property IDiaSymbol2::liveRangeStartRelativeVirtualAddress + .property uint32 countLiveRanges() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_countLiveRanges() + } // end of property IDiaSymbol2::countLiveRanges + .property uint64 liveRangeLength() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 90 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol2::get_liveRangeLength() + } // end of property IDiaSymbol2::liveRangeLength + .property uint32 offsetInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 91 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_offsetInUdt() + } // end of property IDiaSymbol2::offsetInUdt + .property uint32 paramBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 92 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_paramBasePointerRegisterId() + } // end of property IDiaSymbol2::paramBasePointerRegisterId + .property uint32 localBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 93 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_localBasePointerRegisterId() + } // end of property IDiaSymbol2::localBasePointerRegisterId + .property int32 isLocationControlFlowDependent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 94 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isLocationControlFlowDependent() + } // end of property IDiaSymbol2::isLocationControlFlowDependent + .property uint32 stride() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 95 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_stride() + } // end of property IDiaSymbol2::stride + .property uint32 numberOfRows() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 96 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_numberOfRows() + } // end of property IDiaSymbol2::numberOfRows + .property uint32 numberOfColumns() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 97 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_numberOfColumns() + } // end of property IDiaSymbol2::numberOfColumns + .property int32 isMatrixRowMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 98 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isMatrixRowMajor() + } // end of property IDiaSymbol2::isMatrixRowMajor + .property int32 isReturnValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 99 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isReturnValue() + } // end of property IDiaSymbol2::isReturnValue + .property int32 isOptimizedAway() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isOptimizedAway() + } // end of property IDiaSymbol2::isOptimizedAway + .property uint32 builtInKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_builtInKind() + } // end of property IDiaSymbol2::builtInKind + .property uint32 registerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_registerType() + } // end of property IDiaSymbol2::registerType + .property uint32 baseDataSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_baseDataSlot() + } // end of property IDiaSymbol2::baseDataSlot + .property uint32 baseDataOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_baseDataOffset() + } // end of property IDiaSymbol2::baseDataOffset + .property uint32 textureSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_textureSlot() + } // end of property IDiaSymbol2::textureSlot + .property uint32 samplerSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_samplerSlot() + } // end of property IDiaSymbol2::samplerSlot + .property uint32 uavSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_uavSlot() + } // end of property IDiaSymbol2::uavSlot + .property uint32 sizeInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_sizeInUdt() + } // end of property IDiaSymbol2::sizeInUdt + .property uint32 memorySpaceKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_memorySpaceKind() + } // end of property IDiaSymbol2::memorySpaceKind + .property uint32 unmodifiedTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_unmodifiedTypeId() + } // end of property IDiaSymbol2::unmodifiedTypeId + .property uint32 subTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_subTypeId() + } // end of property IDiaSymbol2::subTypeId + .property class DIALib.IDiaSymbol subType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A6 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_subType() + } // end of property IDiaSymbol2::subType + .property uint32 numberOfModifiers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_numberOfModifiers() + } // end of property IDiaSymbol2::numberOfModifiers + .property uint32 numberOfRegisterIndices() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A8 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_numberOfRegisterIndices() + } // end of property IDiaSymbol2::numberOfRegisterIndices + .property int32 isHLSLData() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isHLSLData() + } // end of property IDiaSymbol2::isHLSLData + .property int32 isPointerToDataMember() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isPointerToDataMember() + } // end of property IDiaSymbol2::isPointerToDataMember + .property int32 isPointerToMemberFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isPointerToMemberFunction() + } // end of property IDiaSymbol2::isPointerToMemberFunction + .property int32 isSingleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isSingleInheritance() + } // end of property IDiaSymbol2::isSingleInheritance + .property int32 isMultipleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isMultipleInheritance() + } // end of property IDiaSymbol2::isMultipleInheritance + .property int32 isVirtualInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isVirtualInheritance() + } // end of property IDiaSymbol2::isVirtualInheritance + .property int32 restrictedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_restrictedType() + } // end of property IDiaSymbol2::restrictedType + .property int32 isPointerBasedOnSymbolValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B0 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isPointerBasedOnSymbolValue() + } // end of property IDiaSymbol2::isPointerBasedOnSymbolValue + .property class DIALib.IDiaSymbol baseSymbol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B1 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_baseSymbol() + } // end of property IDiaSymbol2::baseSymbol + .property uint32 baseSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_baseSymbolId() + } // end of property IDiaSymbol2::baseSymbolId + .property string objectFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B3 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol2::get_objectFileName() + } // end of property IDiaSymbol2::objectFileName + .property int32 isAcceleratorGroupSharedLocal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B4 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isAcceleratorGroupSharedLocal() + } // end of property IDiaSymbol2::isAcceleratorGroupSharedLocal + .property int32 isAcceleratorPointerTagLiveRange() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B5 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isAcceleratorPointerTagLiveRange() + } // end of property IDiaSymbol2::isAcceleratorPointerTagLiveRange + .property int32 isAcceleratorStubFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isAcceleratorStubFunction() + } // end of property IDiaSymbol2::isAcceleratorStubFunction + .property uint32 numberOfAcceleratorPointerTags() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_numberOfAcceleratorPointerTags() + } // end of property IDiaSymbol2::numberOfAcceleratorPointerTags + .property int32 isSdl() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isSdl() + } // end of property IDiaSymbol2::isSdl + .property int32 isWinRTPointer() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isWinRTPointer() + } // end of property IDiaSymbol2::isWinRTPointer + .property int32 isRefUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isRefUdt() + } // end of property IDiaSymbol2::isRefUdt + .property int32 isValueUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isValueUdt() + } // end of property IDiaSymbol2::isValueUdt + .property int32 isInterfaceUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isInterfaceUdt() + } // end of property IDiaSymbol2::isInterfaceUdt + .property int32 isPGO() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isPGO() + } // end of property IDiaSymbol2::isPGO + .property int32 hasValidPGOCounts() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_hasValidPGOCounts() + } // end of property IDiaSymbol2::hasValidPGOCounts + .property int32 isOptimizedForSpeed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isOptimizedForSpeed() + } // end of property IDiaSymbol2::isOptimizedForSpeed + .property uint32 PGOEntryCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_PGOEntryCount() + } // end of property IDiaSymbol2::PGOEntryCount + .property uint32 PGOEdgeCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_PGOEdgeCount() + } // end of property IDiaSymbol2::PGOEdgeCount + .property uint64 PGODynamicInstructionCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol2::get_PGODynamicInstructionCount() + } // end of property IDiaSymbol2::PGODynamicInstructionCount + .property uint32 staticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_staticSize() + } // end of property IDiaSymbol2::staticSize + .property uint32 finalLiveStaticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_finalLiveStaticSize() + } // end of property IDiaSymbol2::finalLiveStaticSize + .property string phaseName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C5 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol2::get_phaseName() + } // end of property IDiaSymbol2::phaseName + .property int32 hasControlFlowCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_hasControlFlowCheck() + } // end of property IDiaSymbol2::hasControlFlowCheck + .property int32 constantExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C7 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_constantExport() + } // end of property IDiaSymbol2::constantExport + .property int32 dataExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_dataExport() + } // end of property IDiaSymbol2::dataExport + .property int32 privateExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_privateExport() + } // end of property IDiaSymbol2::privateExport + .property int32 noNameExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_noNameExport() + } // end of property IDiaSymbol2::noNameExport + .property int32 exportHasExplicitlyAssignedOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_exportHasExplicitlyAssignedOrdinal() + } // end of property IDiaSymbol2::exportHasExplicitlyAssignedOrdinal + .property int32 exportIsForwarder() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_exportIsForwarder() + } // end of property IDiaSymbol2::exportIsForwarder + .property uint32 ordinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CD 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_ordinal() + } // end of property IDiaSymbol2::ordinal + .property uint32 frameSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CE 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_frameSize() + } // end of property IDiaSymbol2::frameSize + .property uint32 exceptionHandlerAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CF 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_exceptionHandlerAddressSection() + } // end of property IDiaSymbol2::exceptionHandlerAddressSection + .property uint32 exceptionHandlerAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_exceptionHandlerAddressOffset() + } // end of property IDiaSymbol2::exceptionHandlerAddressOffset + .property uint32 exceptionHandlerRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_exceptionHandlerRelativeVirtualAddress() + } // end of property IDiaSymbol2::exceptionHandlerRelativeVirtualAddress + .property uint64 exceptionHandlerVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol2::get_exceptionHandlerVirtualAddress() + } // end of property IDiaSymbol2::exceptionHandlerVirtualAddress + .property uint32 characteristics() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_characteristics() + } // end of property IDiaSymbol2::characteristics + .property class DIALib.IDiaSymbol coffGroup() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D4 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol2::get_coffGroup() + } // end of property IDiaSymbol2::coffGroup + .property uint32 bindID() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_bindID() + } // end of property IDiaSymbol2::bindID + .property uint32 bindSpace() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D6 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_bindSpace() + } // end of property IDiaSymbol2::bindSpace + .property uint32 bindSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol2::get_bindSlot() + } // end of property IDiaSymbol2::bindSlot + .property int32 isObjCClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isObjCClass() + } // end of property IDiaSymbol2::isObjCClass + .property int32 isObjCCategory() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isObjCCategory() + } // end of property IDiaSymbol2::isObjCCategory + .property int32 isObjCProtocol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol2::get_isObjCProtocol() + } // end of property IDiaSymbol2::isObjCProtocol +} // end of class DIALib.IDiaSymbol2 + +.class interface public abstract auto ansi import DIALib.IDiaSymbol3 + implements DIALib.IDiaSymbol2 +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 39 39 42 36 36 35 46 37 2D 43 31 42 32 // ..$99B665F7-C1B2 + 2D 34 39 44 33 2D 38 39 42 32 2D 41 33 38 34 33 // -49D3-89B2-A3843 + 36 31 41 43 41 42 35 00 00 ) // 61ACAB5.. + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 0A 73 79 6D 49 6E 64 65 78 49 64 00 00 ) // ...symIndexId.. + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symIndexId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_symIndexId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symTag() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_symTag + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_name() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_name + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lexicalParent() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_lexicalParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_classParent() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_classParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_type() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_type + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_dataKind() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_dataKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_locationType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_locationType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_registerId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_offset() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_offset + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_length() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_length + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_slot() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_slot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_volatileType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_volatileType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_constType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_unalignedType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_unalignedType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_access() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_access + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_libraryName() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_libraryName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_platform() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_platform + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_language() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_language + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_editAndContinueEnabled() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_editAndContinueEnabled + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_frontEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_frontEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_frontEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_backEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_backEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_backEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_sourceFileName() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_sourceFileName + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_unused() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_unused + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_thunkOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_thunkOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_thisAdjust() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_thisAdjust + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseOffset() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtualBaseOffset + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtual() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtual + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intro() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_intro + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_pure() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_pure + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_callingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_callingConvention + + .method public hidebysig newslot specialname abstract virtual + instance object + marshal( struct) + get_value() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_value + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_baseType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_token() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_token + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_timeStamp() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_timeStamp + + .method public hidebysig newslot specialname abstract virtual + instance valuetype [mscorlib]System.Guid + get_guid() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_guid + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_symbolsFileName() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_symbolsFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_reference() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_reference + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_count() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_count + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bitPosition() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_bitPosition + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_arrayIndexType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_arrayIndexType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_packed() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_packed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constructor() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_constructor + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_overloadedOperator() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_overloadedOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_nested() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_nested + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasNestedTypes() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasNestedTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAssignmentOperator() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasAssignmentOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasCastOperator() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasCastOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_scoped() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_scoped + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_indirectVirtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_indirectVirtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBasePointerOffset() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtualBasePointerOffset + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualTableShape() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtualTableShape + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lexicalParentId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_lexicalParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_classParentId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_classParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_typeId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_typeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_arrayIndexTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_arrayIndexTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualTableShapeId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtualTableShapeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_code() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_code + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_function() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_function + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_managed() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_managed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_msil() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_msil + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseDispIndex() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtualBaseDispIndex + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_undecoratedName() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_undecoratedName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_age() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_age + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_signature() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_signature + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_compilerGenerated() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_compilerGenerated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_addressTaken() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_addressTaken + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_rank() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_rank + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lowerBound() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_lowerBound + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_upperBound() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_upperBound + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lowerBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_lowerBoundId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_upperBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_upperBoundId + + .method public hidebysig newslot abstract virtual + instance void get_dataBytes([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaSymbol3::get_dataBytes + + .method public hidebysig newslot abstract virtual + instance void findChildren([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findChildren + + .method public hidebysig newslot abstract virtual + instance void findChildrenEx([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findChildrenEx + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByAddr([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findChildrenExByAddr + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findChildrenExByVA + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByRVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findChildrenExByRVA + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetSection() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_targetSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetOffset() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_targetOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_targetRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_targetVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_targetVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_machineType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_machineType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_oemId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_oemSymbolId + + .method public hidebysig newslot abstract virtual + instance void get_types([in] uint32 cTypes, + [out] uint32& pcTypes, + [out] class DIALib.IDiaSymbol& marshal( interface ) pTypes) runtime managed internalcall + { + } // end of method IDiaSymbol3::get_types + + .method public hidebysig newslot abstract virtual + instance void get_typeIds([in] uint32 cTypeIds, + [out] uint32& pcTypeIds, + [out] uint32& pdwTypeIds) runtime managed internalcall + { + } // end of method IDiaSymbol3::get_typeIds + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_objectPointerType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_objectPointerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_udtKind() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_udtKind + + .method public hidebysig newslot abstract virtual + instance void get_undecoratedNameEx([in] uint32 undecorateOptions, + [out] string& marshal( bstr) name) runtime managed internalcall + { + } // end of method IDiaSymbol3::get_undecoratedNameEx + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noReturn() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_noReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_customCallingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_customCallingConvention + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noInline() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_noInline + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_optimizedCodeDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_optimizedCodeDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_notReached() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_notReached + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_interruptReturn() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_interruptReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_farReturn() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_farReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStatic() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isStatic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLTCG() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isLTCG + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isDataAligned() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isDataAligned + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSecurityChecks() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasSecurityChecks + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_compilerName() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_compilerName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAlloca() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasAlloca + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSetJump() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasSetJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasLongJump() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasLongJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasInlAsm() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasInlAsm + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEH() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSEH() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasSEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEHa() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasEHa + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isNaked() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isNaked + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAggregated() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isAggregated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSplitted() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isSplitted + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_container() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_container + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_inlSpec() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_inlSpec + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noStackOrdering() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_noStackOrdering + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualBaseTableType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_virtualBaseTableType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasManagedCode() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasManagedCode + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHotpatchable() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isHotpatchable + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCVTCIL() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isCVTCIL + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMSILNetmodule() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isMSILNetmodule + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCTypes() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isCTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStripped() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isStripped + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_frontEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_backEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_wasInlined() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_wasInlined + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_strictGSCheck() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_strictGSCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCxxReturnUdt() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isCxxReturnUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isConstructorVirtualBase() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isConstructorVirtualBase + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_RValueReference() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_RValueReference + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_unmodifiedType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_unmodifiedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_framePointerPresent() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_framePointerPresent + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSafeBuffers() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isSafeBuffers + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intrinsic() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_intrinsic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_sealed() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_sealed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaFloat() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hfaFloat + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaDouble() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hfaDouble + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_liveRangeStartAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_liveRangeStartAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_liveRangeStartRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_countLiveRanges() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_countLiveRanges + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_liveRangeLength() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_liveRangeLength + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_offsetInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_offsetInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_paramBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_paramBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_localBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_localBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLocationControlFlowDependent() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isLocationControlFlowDependent + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_stride() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_stride + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRows() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_numberOfRows + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfColumns() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_numberOfColumns + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMatrixRowMajor() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isMatrixRowMajor + + .method public hidebysig newslot abstract virtual + instance void get_numericProperties([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pProperties) runtime managed internalcall + { + } // end of method IDiaSymbol3::get_numericProperties + + .method public hidebysig newslot abstract virtual + instance void get_modifierValues([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint16& pModifiers) runtime managed internalcall + { + } // end of method IDiaSymbol3::get_modifierValues + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isReturnValue() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isReturnValue + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedAway() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isOptimizedAway + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_builtInKind() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_builtInKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_registerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataSlot() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_baseDataSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataOffset() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_baseDataOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_textureSlot() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_textureSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_samplerSlot() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_samplerSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_uavSlot() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_uavSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_sizeInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_sizeInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_memorySpaceKind() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_memorySpaceKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_unmodifiedTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_unmodifiedTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_subTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_subTypeId + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_subType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_subType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfModifiers() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_numberOfModifiers + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRegisterIndices() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_numberOfRegisterIndices + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHLSLData() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isHLSLData + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToDataMember() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isPointerToDataMember + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToMemberFunction() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isPointerToMemberFunction + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSingleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isSingleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMultipleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isMultipleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isVirtualInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isVirtualInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_restrictedType() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_restrictedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerBasedOnSymbolValue() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isPointerBasedOnSymbolValue + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_baseSymbol() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_baseSymbol + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_baseSymbolId + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_objectFileName() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_objectFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorGroupSharedLocal() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isAcceleratorGroupSharedLocal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorPointerTagLiveRange() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isAcceleratorPointerTagLiveRange + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorStubFunction() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isAcceleratorStubFunction + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfAcceleratorPointerTags() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_numberOfAcceleratorPointerTags + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSdl() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isSdl + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isWinRTPointer() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isWinRTPointer + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isRefUdt() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isRefUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isValueUdt() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isValueUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isInterfaceUdt() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isInterfaceUdt + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByAddr([in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findInlineFramesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByRVA([in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findInlineFramesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByVA([in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findInlineFramesByVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLines([out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findInlineeLines + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByAddr([in] uint32 isect, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findInlineeLinesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByRVA([in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findInlineeLinesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByVA([in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findInlineeLinesByVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolsForAcceleratorPointerTag([in] uint32 tagValue, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findSymbolsForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void findSymbolsByRVAForAcceleratorPointerTag([in] uint32 tagValue, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findSymbolsByRVAForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void get_acceleratorPointerTags([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pPointerTags) runtime managed internalcall + { + } // end of method IDiaSymbol3::get_acceleratorPointerTags + + .method public hidebysig newslot abstract virtual + instance void getSrcLineOnTypeDefn([out] class DIALib.IDiaLineNumber& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::getSrcLineOnTypeDefn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPGO() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isPGO + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasValidPGOCounts() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasValidPGOCounts + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedForSpeed() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isOptimizedForSpeed + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEntryCount() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_PGOEntryCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEdgeCount() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_PGOEdgeCount + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_PGODynamicInstructionCount() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_PGODynamicInstructionCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_staticSize() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_staticSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_finalLiveStaticSize() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_finalLiveStaticSize + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_phaseName() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_phaseName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasControlFlowCheck() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_hasControlFlowCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constantExport() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_constantExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_dataExport() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_dataExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_privateExport() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_privateExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noNameExport() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_noNameExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportHasExplicitlyAssignedOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_exportHasExplicitlyAssignedOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportIsForwarder() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_exportIsForwarder + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_ordinal() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_ordinal + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frameSize() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_frameSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_exceptionHandlerAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_exceptionHandlerAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_exceptionHandlerRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_exceptionHandlerVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_exceptionHandlerVirtualAddress + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyFile([out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol3::findInputAssemblyFile + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_characteristics() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_characteristics + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_coffGroup() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_coffGroup + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindID() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_bindID + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSpace() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_bindSpace + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSlot() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_bindSlot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCClass() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isObjCClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCCategory() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isObjCCategory + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCProtocol() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_isObjCProtocol + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_inlinee() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_inlinee + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_inlineeId() runtime managed internalcall + { + } // end of method IDiaSymbol3::get_inlineeId + + .property uint32 symIndexId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 00 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_symIndexId() + } // end of property IDiaSymbol3::symIndexId + .property uint32 symTag() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_symTag() + } // end of property IDiaSymbol3::symTag + .property string name() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol3::get_name() + } // end of property IDiaSymbol3::name + .property class DIALib.IDiaSymbol lexicalParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_lexicalParent() + } // end of property IDiaSymbol3::lexicalParent + .property class DIALib.IDiaSymbol classParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_classParent() + } // end of property IDiaSymbol3::classParent + .property class DIALib.IDiaSymbol 'type'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_type() + } // end of property IDiaSymbol3::'type' + .property uint32 dataKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_dataKind() + } // end of property IDiaSymbol3::dataKind + .property uint32 locationType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_locationType() + } // end of property IDiaSymbol3::locationType + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_addressSection() + } // end of property IDiaSymbol3::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_addressOffset() + } // end of property IDiaSymbol3::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_relativeVirtualAddress() + } // end of property IDiaSymbol3::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol3::get_virtualAddress() + } // end of property IDiaSymbol3::virtualAddress + .property uint32 registerId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_registerId() + } // end of property IDiaSymbol3::registerId + .property int32 offset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_offset() + } // end of property IDiaSymbol3::offset + .property uint64 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol3::get_length() + } // end of property IDiaSymbol3::length + .property uint32 slot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_slot() + } // end of property IDiaSymbol3::slot + .property int32 volatileType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 10 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_volatileType() + } // end of property IDiaSymbol3::volatileType + .property int32 constType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 11 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_constType() + } // end of property IDiaSymbol3::constType + .property int32 unalignedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 12 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_unalignedType() + } // end of property IDiaSymbol3::unalignedType + .property uint32 access() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 13 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_access() + } // end of property IDiaSymbol3::access + .property string libraryName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 14 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol3::get_libraryName() + } // end of property IDiaSymbol3::libraryName + .property uint32 platform() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 15 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_platform() + } // end of property IDiaSymbol3::platform + .property uint32 language() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 16 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_language() + } // end of property IDiaSymbol3::language + .property int32 editAndContinueEnabled() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 17 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_editAndContinueEnabled() + } // end of property IDiaSymbol3::editAndContinueEnabled + .property uint32 frontEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 18 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_frontEndMajor() + } // end of property IDiaSymbol3::frontEndMajor + .property uint32 frontEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 19 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_frontEndMinor() + } // end of property IDiaSymbol3::frontEndMinor + .property uint32 frontEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_frontEndBuild() + } // end of property IDiaSymbol3::frontEndBuild + .property uint32 backEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_backEndMajor() + } // end of property IDiaSymbol3::backEndMajor + .property uint32 backEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_backEndMinor() + } // end of property IDiaSymbol3::backEndMinor + .property uint32 backEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_backEndBuild() + } // end of property IDiaSymbol3::backEndBuild + .property string sourceFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1E 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol3::get_sourceFileName() + } // end of property IDiaSymbol3::sourceFileName + .property string 'unused'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1F 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol3::get_unused() + } // end of property IDiaSymbol3::'unused' + .property uint32 thunkOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 20 00 00 00 00 00 ) // .. ..... + .get instance uint32 DIALib.IDiaSymbol3::get_thunkOrdinal() + } // end of property IDiaSymbol3::thunkOrdinal + .property int32 thisAdjust() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 21 00 00 00 00 00 ) // ..!..... + .get instance int32 DIALib.IDiaSymbol3::get_thisAdjust() + } // end of property IDiaSymbol3::thisAdjust + .property uint32 virtualBaseOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 22 00 00 00 00 00 ) // .."..... + .get instance uint32 DIALib.IDiaSymbol3::get_virtualBaseOffset() + } // end of property IDiaSymbol3::virtualBaseOffset + .property int32 'virtual'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 23 00 00 00 00 00 ) // ..#..... + .get instance int32 DIALib.IDiaSymbol3::get_virtual() + } // end of property IDiaSymbol3::'virtual' + .property int32 intro() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 24 00 00 00 00 00 ) // ..$..... + .get instance int32 DIALib.IDiaSymbol3::get_intro() + } // end of property IDiaSymbol3::intro + .property int32 pure() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 25 00 00 00 00 00 ) // ..%..... + .get instance int32 DIALib.IDiaSymbol3::get_pure() + } // end of property IDiaSymbol3::pure + .property uint32 callingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 26 00 00 00 00 00 ) // ..&..... + .get instance uint32 DIALib.IDiaSymbol3::get_callingConvention() + } // end of property IDiaSymbol3::callingConvention + .property object 'value'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 27 00 00 00 00 00 ) // ..'..... + .get instance object DIALib.IDiaSymbol3::get_value() + } // end of property IDiaSymbol3::'value' + .property uint32 baseType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 28 00 00 00 00 00 ) // ..(..... + .get instance uint32 DIALib.IDiaSymbol3::get_baseType() + } // end of property IDiaSymbol3::baseType + .property uint32 token() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 29 00 00 00 00 00 ) // ..)..... + .get instance uint32 DIALib.IDiaSymbol3::get_token() + } // end of property IDiaSymbol3::token + .property uint32 timeStamp() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2A 00 00 00 00 00 ) // ..*..... + .get instance uint32 DIALib.IDiaSymbol3::get_timeStamp() + } // end of property IDiaSymbol3::timeStamp + .property valuetype [mscorlib]System.Guid + guid() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2B 00 00 00 00 00 ) // ..+..... + .get instance valuetype [mscorlib]System.Guid DIALib.IDiaSymbol3::get_guid() + } // end of property IDiaSymbol3::guid + .property string symbolsFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2C 00 00 00 00 00 ) // ..,..... + .get instance string DIALib.IDiaSymbol3::get_symbolsFileName() + } // end of property IDiaSymbol3::symbolsFileName + .property int32 reference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2E 00 00 00 00 00 ) // ........ + .get instance int32 DIALib.IDiaSymbol3::get_reference() + } // end of property IDiaSymbol3::reference + .property uint32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2F 00 00 00 00 00 ) // ../..... + .get instance uint32 DIALib.IDiaSymbol3::get_count() + } // end of property IDiaSymbol3::count + .property uint32 bitPosition() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 31 00 00 00 00 00 ) // ..1..... + .get instance uint32 DIALib.IDiaSymbol3::get_bitPosition() + } // end of property IDiaSymbol3::bitPosition + .property class DIALib.IDiaSymbol arrayIndexType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 32 00 00 00 00 00 ) // ..2..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_arrayIndexType() + } // end of property IDiaSymbol3::arrayIndexType + .property int32 packed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 33 00 00 00 00 00 ) // ..3..... + .get instance int32 DIALib.IDiaSymbol3::get_packed() + } // end of property IDiaSymbol3::packed + .property int32 constructor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 34 00 00 00 00 00 ) // ..4..... + .get instance int32 DIALib.IDiaSymbol3::get_constructor() + } // end of property IDiaSymbol3::constructor + .property int32 overloadedOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 35 00 00 00 00 00 ) // ..5..... + .get instance int32 DIALib.IDiaSymbol3::get_overloadedOperator() + } // end of property IDiaSymbol3::overloadedOperator + .property int32 'nested'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 36 00 00 00 00 00 ) // ..6..... + .get instance int32 DIALib.IDiaSymbol3::get_nested() + } // end of property IDiaSymbol3::'nested' + .property int32 hasNestedTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 37 00 00 00 00 00 ) // ..7..... + .get instance int32 DIALib.IDiaSymbol3::get_hasNestedTypes() + } // end of property IDiaSymbol3::hasNestedTypes + .property int32 hasAssignmentOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 38 00 00 00 00 00 ) // ..8..... + .get instance int32 DIALib.IDiaSymbol3::get_hasAssignmentOperator() + } // end of property IDiaSymbol3::hasAssignmentOperator + .property int32 hasCastOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 39 00 00 00 00 00 ) // ..9..... + .get instance int32 DIALib.IDiaSymbol3::get_hasCastOperator() + } // end of property IDiaSymbol3::hasCastOperator + .property int32 scoped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3A 00 00 00 00 00 ) // ..:..... + .get instance int32 DIALib.IDiaSymbol3::get_scoped() + } // end of property IDiaSymbol3::scoped + .property int32 virtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3B 00 00 00 00 00 ) // ..;..... + .get instance int32 DIALib.IDiaSymbol3::get_virtualBaseClass() + } // end of property IDiaSymbol3::virtualBaseClass + .property int32 indirectVirtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3C 00 00 00 00 00 ) // ..<..... + .get instance int32 DIALib.IDiaSymbol3::get_indirectVirtualBaseClass() + } // end of property IDiaSymbol3::indirectVirtualBaseClass + .property int32 virtualBasePointerOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3D 00 00 00 00 00 ) // ..=..... + .get instance int32 DIALib.IDiaSymbol3::get_virtualBasePointerOffset() + } // end of property IDiaSymbol3::virtualBasePointerOffset + .property class DIALib.IDiaSymbol virtualTableShape() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3E 00 00 00 00 00 ) // ..>..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_virtualTableShape() + } // end of property IDiaSymbol3::virtualTableShape + .property uint32 lexicalParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 40 00 00 00 00 00 ) // ..@..... + .get instance uint32 DIALib.IDiaSymbol3::get_lexicalParentId() + } // end of property IDiaSymbol3::lexicalParentId + .property uint32 classParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 41 00 00 00 00 00 ) // ..A..... + .get instance uint32 DIALib.IDiaSymbol3::get_classParentId() + } // end of property IDiaSymbol3::classParentId + .property uint32 typeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 42 00 00 00 00 00 ) // ..B..... + .get instance uint32 DIALib.IDiaSymbol3::get_typeId() + } // end of property IDiaSymbol3::typeId + .property uint32 arrayIndexTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 43 00 00 00 00 00 ) // ..C..... + .get instance uint32 DIALib.IDiaSymbol3::get_arrayIndexTypeId() + } // end of property IDiaSymbol3::arrayIndexTypeId + .property uint32 virtualTableShapeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 44 00 00 00 00 00 ) // ..D..... + .get instance uint32 DIALib.IDiaSymbol3::get_virtualTableShapeId() + } // end of property IDiaSymbol3::virtualTableShapeId + .property int32 code() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 45 00 00 00 00 00 ) // ..E..... + .get instance int32 DIALib.IDiaSymbol3::get_code() + } // end of property IDiaSymbol3::code + .property int32 function() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 46 00 00 00 00 00 ) // ..F..... + .get instance int32 DIALib.IDiaSymbol3::get_function() + } // end of property IDiaSymbol3::function + .property int32 'managed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 47 00 00 00 00 00 ) // ..G..... + .get instance int32 DIALib.IDiaSymbol3::get_managed() + } // end of property IDiaSymbol3::'managed' + .property int32 msil() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 48 00 00 00 00 00 ) // ..H..... + .get instance int32 DIALib.IDiaSymbol3::get_msil() + } // end of property IDiaSymbol3::msil + .property uint32 virtualBaseDispIndex() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 49 00 00 00 00 00 ) // ..I..... + .get instance uint32 DIALib.IDiaSymbol3::get_virtualBaseDispIndex() + } // end of property IDiaSymbol3::virtualBaseDispIndex + .property string undecoratedName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4A 00 00 00 00 00 ) // ..J..... + .get instance string DIALib.IDiaSymbol3::get_undecoratedName() + } // end of property IDiaSymbol3::undecoratedName + .property uint32 age() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4B 00 00 00 00 00 ) // ..K..... + .get instance uint32 DIALib.IDiaSymbol3::get_age() + } // end of property IDiaSymbol3::age + .property uint32 signature() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4C 00 00 00 00 00 ) // ..L..... + .get instance uint32 DIALib.IDiaSymbol3::get_signature() + } // end of property IDiaSymbol3::signature + .property int32 compilerGenerated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4D 00 00 00 00 00 ) // ..M..... + .get instance int32 DIALib.IDiaSymbol3::get_compilerGenerated() + } // end of property IDiaSymbol3::compilerGenerated + .property int32 addressTaken() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4E 00 00 00 00 00 ) // ..N..... + .get instance int32 DIALib.IDiaSymbol3::get_addressTaken() + } // end of property IDiaSymbol3::addressTaken + .property uint32 rank() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4F 00 00 00 00 00 ) // ..O..... + .get instance uint32 DIALib.IDiaSymbol3::get_rank() + } // end of property IDiaSymbol3::rank + .property class DIALib.IDiaSymbol lowerBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 50 00 00 00 00 00 ) // ..P..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_lowerBound() + } // end of property IDiaSymbol3::lowerBound + .property class DIALib.IDiaSymbol upperBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 51 00 00 00 00 00 ) // ..Q..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_upperBound() + } // end of property IDiaSymbol3::upperBound + .property uint32 lowerBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 52 00 00 00 00 00 ) // ..R..... + .get instance uint32 DIALib.IDiaSymbol3::get_lowerBoundId() + } // end of property IDiaSymbol3::lowerBoundId + .property uint32 upperBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 53 00 00 00 00 00 ) // ..S..... + .get instance uint32 DIALib.IDiaSymbol3::get_upperBoundId() + } // end of property IDiaSymbol3::upperBoundId + .property uint32 targetSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 54 00 00 00 00 00 ) // ..T..... + .get instance uint32 DIALib.IDiaSymbol3::get_targetSection() + } // end of property IDiaSymbol3::targetSection + .property uint32 targetOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 55 00 00 00 00 00 ) // ..U..... + .get instance uint32 DIALib.IDiaSymbol3::get_targetOffset() + } // end of property IDiaSymbol3::targetOffset + .property uint32 targetRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 56 00 00 00 00 00 ) // ..V..... + .get instance uint32 DIALib.IDiaSymbol3::get_targetRelativeVirtualAddress() + } // end of property IDiaSymbol3::targetRelativeVirtualAddress + .property uint64 targetVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 57 00 00 00 00 00 ) // ..W..... + .get instance uint64 DIALib.IDiaSymbol3::get_targetVirtualAddress() + } // end of property IDiaSymbol3::targetVirtualAddress + .property uint32 machineType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 58 00 00 00 00 00 ) // ..X..... + .get instance uint32 DIALib.IDiaSymbol3::get_machineType() + } // end of property IDiaSymbol3::machineType + .property uint32 oemId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 59 00 00 00 00 00 ) // ..Y..... + .get instance uint32 DIALib.IDiaSymbol3::get_oemId() + } // end of property IDiaSymbol3::oemId + .property uint32 oemSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5A 00 00 00 00 00 ) // ..Z..... + .get instance uint32 DIALib.IDiaSymbol3::get_oemSymbolId() + } // end of property IDiaSymbol3::oemSymbolId + .property class DIALib.IDiaSymbol objectPointerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5B 00 00 00 00 00 ) // ..[..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_objectPointerType() + } // end of property IDiaSymbol3::objectPointerType + .property uint32 udtKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5C 00 00 00 00 00 ) // ..\..... + .get instance uint32 DIALib.IDiaSymbol3::get_udtKind() + } // end of property IDiaSymbol3::udtKind + .property int32 noReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5D 00 00 00 00 00 ) // ..]..... + .get instance int32 DIALib.IDiaSymbol3::get_noReturn() + } // end of property IDiaSymbol3::noReturn + .property int32 customCallingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5E 00 00 00 00 00 ) // ..^..... + .get instance int32 DIALib.IDiaSymbol3::get_customCallingConvention() + } // end of property IDiaSymbol3::customCallingConvention + .property int32 noInline() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5F 00 00 00 00 00 ) // .._..... + .get instance int32 DIALib.IDiaSymbol3::get_noInline() + } // end of property IDiaSymbol3::noInline + .property int32 optimizedCodeDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 60 00 00 00 00 00 ) // ..`..... + .get instance int32 DIALib.IDiaSymbol3::get_optimizedCodeDebugInfo() + } // end of property IDiaSymbol3::optimizedCodeDebugInfo + .property int32 notReached() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 61 00 00 00 00 00 ) // ..a..... + .get instance int32 DIALib.IDiaSymbol3::get_notReached() + } // end of property IDiaSymbol3::notReached + .property int32 interruptReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 62 00 00 00 00 00 ) // ..b..... + .get instance int32 DIALib.IDiaSymbol3::get_interruptReturn() + } // end of property IDiaSymbol3::interruptReturn + .property int32 farReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 63 00 00 00 00 00 ) // ..c..... + .get instance int32 DIALib.IDiaSymbol3::get_farReturn() + } // end of property IDiaSymbol3::farReturn + .property int32 isStatic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 64 00 00 00 00 00 ) // ..d..... + .get instance int32 DIALib.IDiaSymbol3::get_isStatic() + } // end of property IDiaSymbol3::isStatic + .property int32 hasDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 65 00 00 00 00 00 ) // ..e..... + .get instance int32 DIALib.IDiaSymbol3::get_hasDebugInfo() + } // end of property IDiaSymbol3::hasDebugInfo + .property int32 isLTCG() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 66 00 00 00 00 00 ) // ..f..... + .get instance int32 DIALib.IDiaSymbol3::get_isLTCG() + } // end of property IDiaSymbol3::isLTCG + .property int32 isDataAligned() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 67 00 00 00 00 00 ) // ..g..... + .get instance int32 DIALib.IDiaSymbol3::get_isDataAligned() + } // end of property IDiaSymbol3::isDataAligned + .property int32 hasSecurityChecks() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 68 00 00 00 00 00 ) // ..h..... + .get instance int32 DIALib.IDiaSymbol3::get_hasSecurityChecks() + } // end of property IDiaSymbol3::hasSecurityChecks + .property string compilerName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 69 00 00 00 00 00 ) // ..i..... + .get instance string DIALib.IDiaSymbol3::get_compilerName() + } // end of property IDiaSymbol3::compilerName + .property int32 hasAlloca() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6A 00 00 00 00 00 ) // ..j..... + .get instance int32 DIALib.IDiaSymbol3::get_hasAlloca() + } // end of property IDiaSymbol3::hasAlloca + .property int32 hasSetJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6B 00 00 00 00 00 ) // ..k..... + .get instance int32 DIALib.IDiaSymbol3::get_hasSetJump() + } // end of property IDiaSymbol3::hasSetJump + .property int32 hasLongJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6C 00 00 00 00 00 ) // ..l..... + .get instance int32 DIALib.IDiaSymbol3::get_hasLongJump() + } // end of property IDiaSymbol3::hasLongJump + .property int32 hasInlAsm() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6D 00 00 00 00 00 ) // ..m..... + .get instance int32 DIALib.IDiaSymbol3::get_hasInlAsm() + } // end of property IDiaSymbol3::hasInlAsm + .property int32 hasEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6E 00 00 00 00 00 ) // ..n..... + .get instance int32 DIALib.IDiaSymbol3::get_hasEH() + } // end of property IDiaSymbol3::hasEH + .property int32 hasSEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6F 00 00 00 00 00 ) // ..o..... + .get instance int32 DIALib.IDiaSymbol3::get_hasSEH() + } // end of property IDiaSymbol3::hasSEH + .property int32 hasEHa() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 70 00 00 00 00 00 ) // ..p..... + .get instance int32 DIALib.IDiaSymbol3::get_hasEHa() + } // end of property IDiaSymbol3::hasEHa + .property int32 isNaked() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 71 00 00 00 00 00 ) // ..q..... + .get instance int32 DIALib.IDiaSymbol3::get_isNaked() + } // end of property IDiaSymbol3::isNaked + .property int32 isAggregated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 72 00 00 00 00 00 ) // ..r..... + .get instance int32 DIALib.IDiaSymbol3::get_isAggregated() + } // end of property IDiaSymbol3::isAggregated + .property int32 isSplitted() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 73 00 00 00 00 00 ) // ..s..... + .get instance int32 DIALib.IDiaSymbol3::get_isSplitted() + } // end of property IDiaSymbol3::isSplitted + .property class DIALib.IDiaSymbol container() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 74 00 00 00 00 00 ) // ..t..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_container() + } // end of property IDiaSymbol3::container + .property int32 inlSpec() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 75 00 00 00 00 00 ) // ..u..... + .get instance int32 DIALib.IDiaSymbol3::get_inlSpec() + } // end of property IDiaSymbol3::inlSpec + .property int32 noStackOrdering() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 76 00 00 00 00 00 ) // ..v..... + .get instance int32 DIALib.IDiaSymbol3::get_noStackOrdering() + } // end of property IDiaSymbol3::noStackOrdering + .property class DIALib.IDiaSymbol virtualBaseTableType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 77 00 00 00 00 00 ) // ..w..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_virtualBaseTableType() + } // end of property IDiaSymbol3::virtualBaseTableType + .property int32 hasManagedCode() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 78 00 00 00 00 00 ) // ..x..... + .get instance int32 DIALib.IDiaSymbol3::get_hasManagedCode() + } // end of property IDiaSymbol3::hasManagedCode + .property int32 isHotpatchable() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 79 00 00 00 00 00 ) // ..y..... + .get instance int32 DIALib.IDiaSymbol3::get_isHotpatchable() + } // end of property IDiaSymbol3::isHotpatchable + .property int32 isCVTCIL() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7A 00 00 00 00 00 ) // ..z..... + .get instance int32 DIALib.IDiaSymbol3::get_isCVTCIL() + } // end of property IDiaSymbol3::isCVTCIL + .property int32 isMSILNetmodule() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7B 00 00 00 00 00 ) // ..{..... + .get instance int32 DIALib.IDiaSymbol3::get_isMSILNetmodule() + } // end of property IDiaSymbol3::isMSILNetmodule + .property int32 isCTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7C 00 00 00 00 00 ) // ..|..... + .get instance int32 DIALib.IDiaSymbol3::get_isCTypes() + } // end of property IDiaSymbol3::isCTypes + .property int32 isStripped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7D 00 00 00 00 00 ) // ..}..... + .get instance int32 DIALib.IDiaSymbol3::get_isStripped() + } // end of property IDiaSymbol3::isStripped + .property uint32 frontEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7E 00 00 00 00 00 ) // ..~..... + .get instance uint32 DIALib.IDiaSymbol3::get_frontEndQFE() + } // end of property IDiaSymbol3::frontEndQFE + .property uint32 backEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_backEndQFE() + } // end of property IDiaSymbol3::backEndQFE + .property int32 wasInlined() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 80 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_wasInlined() + } // end of property IDiaSymbol3::wasInlined + .property int32 strictGSCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 81 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_strictGSCheck() + } // end of property IDiaSymbol3::strictGSCheck + .property int32 isCxxReturnUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 82 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isCxxReturnUdt() + } // end of property IDiaSymbol3::isCxxReturnUdt + .property int32 isConstructorVirtualBase() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 83 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isConstructorVirtualBase() + } // end of property IDiaSymbol3::isConstructorVirtualBase + .property int32 RValueReference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 84 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_RValueReference() + } // end of property IDiaSymbol3::RValueReference + .property class DIALib.IDiaSymbol unmodifiedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 85 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_unmodifiedType() + } // end of property IDiaSymbol3::unmodifiedType + .property int32 framePointerPresent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 86 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_framePointerPresent() + } // end of property IDiaSymbol3::framePointerPresent + .property int32 isSafeBuffers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 87 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isSafeBuffers() + } // end of property IDiaSymbol3::isSafeBuffers + .property int32 intrinsic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 88 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_intrinsic() + } // end of property IDiaSymbol3::intrinsic + .property int32 'sealed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 89 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_sealed() + } // end of property IDiaSymbol3::'sealed' + .property int32 hfaFloat() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_hfaFloat() + } // end of property IDiaSymbol3::hfaFloat + .property int32 hfaDouble() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8B 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_hfaDouble() + } // end of property IDiaSymbol3::hfaDouble + .property uint32 liveRangeStartAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_liveRangeStartAddressSection() + } // end of property IDiaSymbol3::liveRangeStartAddressSection + .property uint32 liveRangeStartAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_liveRangeStartAddressOffset() + } // end of property IDiaSymbol3::liveRangeStartAddressOffset + .property uint32 liveRangeStartRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_liveRangeStartRelativeVirtualAddress() + } // end of property IDiaSymbol3::liveRangeStartRelativeVirtualAddress + .property uint32 countLiveRanges() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_countLiveRanges() + } // end of property IDiaSymbol3::countLiveRanges + .property uint64 liveRangeLength() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 90 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol3::get_liveRangeLength() + } // end of property IDiaSymbol3::liveRangeLength + .property uint32 offsetInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 91 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_offsetInUdt() + } // end of property IDiaSymbol3::offsetInUdt + .property uint32 paramBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 92 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_paramBasePointerRegisterId() + } // end of property IDiaSymbol3::paramBasePointerRegisterId + .property uint32 localBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 93 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_localBasePointerRegisterId() + } // end of property IDiaSymbol3::localBasePointerRegisterId + .property int32 isLocationControlFlowDependent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 94 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isLocationControlFlowDependent() + } // end of property IDiaSymbol3::isLocationControlFlowDependent + .property uint32 stride() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 95 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_stride() + } // end of property IDiaSymbol3::stride + .property uint32 numberOfRows() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 96 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_numberOfRows() + } // end of property IDiaSymbol3::numberOfRows + .property uint32 numberOfColumns() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 97 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_numberOfColumns() + } // end of property IDiaSymbol3::numberOfColumns + .property int32 isMatrixRowMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 98 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isMatrixRowMajor() + } // end of property IDiaSymbol3::isMatrixRowMajor + .property int32 isReturnValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 99 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isReturnValue() + } // end of property IDiaSymbol3::isReturnValue + .property int32 isOptimizedAway() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isOptimizedAway() + } // end of property IDiaSymbol3::isOptimizedAway + .property uint32 builtInKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_builtInKind() + } // end of property IDiaSymbol3::builtInKind + .property uint32 registerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_registerType() + } // end of property IDiaSymbol3::registerType + .property uint32 baseDataSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_baseDataSlot() + } // end of property IDiaSymbol3::baseDataSlot + .property uint32 baseDataOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_baseDataOffset() + } // end of property IDiaSymbol3::baseDataOffset + .property uint32 textureSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_textureSlot() + } // end of property IDiaSymbol3::textureSlot + .property uint32 samplerSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_samplerSlot() + } // end of property IDiaSymbol3::samplerSlot + .property uint32 uavSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_uavSlot() + } // end of property IDiaSymbol3::uavSlot + .property uint32 sizeInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_sizeInUdt() + } // end of property IDiaSymbol3::sizeInUdt + .property uint32 memorySpaceKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_memorySpaceKind() + } // end of property IDiaSymbol3::memorySpaceKind + .property uint32 unmodifiedTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_unmodifiedTypeId() + } // end of property IDiaSymbol3::unmodifiedTypeId + .property uint32 subTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_subTypeId() + } // end of property IDiaSymbol3::subTypeId + .property class DIALib.IDiaSymbol subType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A6 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_subType() + } // end of property IDiaSymbol3::subType + .property uint32 numberOfModifiers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_numberOfModifiers() + } // end of property IDiaSymbol3::numberOfModifiers + .property uint32 numberOfRegisterIndices() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A8 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_numberOfRegisterIndices() + } // end of property IDiaSymbol3::numberOfRegisterIndices + .property int32 isHLSLData() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isHLSLData() + } // end of property IDiaSymbol3::isHLSLData + .property int32 isPointerToDataMember() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isPointerToDataMember() + } // end of property IDiaSymbol3::isPointerToDataMember + .property int32 isPointerToMemberFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isPointerToMemberFunction() + } // end of property IDiaSymbol3::isPointerToMemberFunction + .property int32 isSingleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isSingleInheritance() + } // end of property IDiaSymbol3::isSingleInheritance + .property int32 isMultipleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isMultipleInheritance() + } // end of property IDiaSymbol3::isMultipleInheritance + .property int32 isVirtualInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isVirtualInheritance() + } // end of property IDiaSymbol3::isVirtualInheritance + .property int32 restrictedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_restrictedType() + } // end of property IDiaSymbol3::restrictedType + .property int32 isPointerBasedOnSymbolValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B0 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isPointerBasedOnSymbolValue() + } // end of property IDiaSymbol3::isPointerBasedOnSymbolValue + .property class DIALib.IDiaSymbol baseSymbol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B1 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_baseSymbol() + } // end of property IDiaSymbol3::baseSymbol + .property uint32 baseSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_baseSymbolId() + } // end of property IDiaSymbol3::baseSymbolId + .property string objectFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B3 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol3::get_objectFileName() + } // end of property IDiaSymbol3::objectFileName + .property int32 isAcceleratorGroupSharedLocal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B4 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isAcceleratorGroupSharedLocal() + } // end of property IDiaSymbol3::isAcceleratorGroupSharedLocal + .property int32 isAcceleratorPointerTagLiveRange() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B5 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isAcceleratorPointerTagLiveRange() + } // end of property IDiaSymbol3::isAcceleratorPointerTagLiveRange + .property int32 isAcceleratorStubFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isAcceleratorStubFunction() + } // end of property IDiaSymbol3::isAcceleratorStubFunction + .property uint32 numberOfAcceleratorPointerTags() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_numberOfAcceleratorPointerTags() + } // end of property IDiaSymbol3::numberOfAcceleratorPointerTags + .property int32 isSdl() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isSdl() + } // end of property IDiaSymbol3::isSdl + .property int32 isWinRTPointer() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isWinRTPointer() + } // end of property IDiaSymbol3::isWinRTPointer + .property int32 isRefUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isRefUdt() + } // end of property IDiaSymbol3::isRefUdt + .property int32 isValueUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isValueUdt() + } // end of property IDiaSymbol3::isValueUdt + .property int32 isInterfaceUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isInterfaceUdt() + } // end of property IDiaSymbol3::isInterfaceUdt + .property int32 isPGO() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isPGO() + } // end of property IDiaSymbol3::isPGO + .property int32 hasValidPGOCounts() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_hasValidPGOCounts() + } // end of property IDiaSymbol3::hasValidPGOCounts + .property int32 isOptimizedForSpeed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isOptimizedForSpeed() + } // end of property IDiaSymbol3::isOptimizedForSpeed + .property uint32 PGOEntryCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_PGOEntryCount() + } // end of property IDiaSymbol3::PGOEntryCount + .property uint32 PGOEdgeCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_PGOEdgeCount() + } // end of property IDiaSymbol3::PGOEdgeCount + .property uint64 PGODynamicInstructionCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol3::get_PGODynamicInstructionCount() + } // end of property IDiaSymbol3::PGODynamicInstructionCount + .property uint32 staticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_staticSize() + } // end of property IDiaSymbol3::staticSize + .property uint32 finalLiveStaticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_finalLiveStaticSize() + } // end of property IDiaSymbol3::finalLiveStaticSize + .property string phaseName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C5 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol3::get_phaseName() + } // end of property IDiaSymbol3::phaseName + .property int32 hasControlFlowCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_hasControlFlowCheck() + } // end of property IDiaSymbol3::hasControlFlowCheck + .property int32 constantExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C7 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_constantExport() + } // end of property IDiaSymbol3::constantExport + .property int32 dataExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_dataExport() + } // end of property IDiaSymbol3::dataExport + .property int32 privateExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_privateExport() + } // end of property IDiaSymbol3::privateExport + .property int32 noNameExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_noNameExport() + } // end of property IDiaSymbol3::noNameExport + .property int32 exportHasExplicitlyAssignedOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_exportHasExplicitlyAssignedOrdinal() + } // end of property IDiaSymbol3::exportHasExplicitlyAssignedOrdinal + .property int32 exportIsForwarder() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_exportIsForwarder() + } // end of property IDiaSymbol3::exportIsForwarder + .property uint32 ordinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CD 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_ordinal() + } // end of property IDiaSymbol3::ordinal + .property uint32 frameSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CE 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_frameSize() + } // end of property IDiaSymbol3::frameSize + .property uint32 exceptionHandlerAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CF 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_exceptionHandlerAddressSection() + } // end of property IDiaSymbol3::exceptionHandlerAddressSection + .property uint32 exceptionHandlerAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_exceptionHandlerAddressOffset() + } // end of property IDiaSymbol3::exceptionHandlerAddressOffset + .property uint32 exceptionHandlerRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_exceptionHandlerRelativeVirtualAddress() + } // end of property IDiaSymbol3::exceptionHandlerRelativeVirtualAddress + .property uint64 exceptionHandlerVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol3::get_exceptionHandlerVirtualAddress() + } // end of property IDiaSymbol3::exceptionHandlerVirtualAddress + .property uint32 characteristics() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_characteristics() + } // end of property IDiaSymbol3::characteristics + .property class DIALib.IDiaSymbol coffGroup() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D4 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_coffGroup() + } // end of property IDiaSymbol3::coffGroup + .property uint32 bindID() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_bindID() + } // end of property IDiaSymbol3::bindID + .property uint32 bindSpace() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D6 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_bindSpace() + } // end of property IDiaSymbol3::bindSpace + .property uint32 bindSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_bindSlot() + } // end of property IDiaSymbol3::bindSlot + .property int32 isObjCClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isObjCClass() + } // end of property IDiaSymbol3::isObjCClass + .property int32 isObjCCategory() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isObjCCategory() + } // end of property IDiaSymbol3::isObjCCategory + .property int32 isObjCProtocol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol3::get_isObjCProtocol() + } // end of property IDiaSymbol3::isObjCProtocol + .property class DIALib.IDiaSymbol inlinee() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DB 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol3::get_inlinee() + } // end of property IDiaSymbol3::inlinee + .property uint32 inlineeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DC 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol3::get_inlineeId() + } // end of property IDiaSymbol3::inlineeId +} // end of class DIALib.IDiaSymbol3 + +.class interface public abstract auto ansi import DIALib.IDiaSymbol4 + implements DIALib.IDiaSymbol3 +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 0A 73 79 6D 49 6E 64 65 78 49 64 00 00 ) // ...symIndexId.. + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 42 46 36 43 38 38 41 37 2D 45 39 44 36 // ..$BF6C88A7-E9D6 + 2D 34 33 34 36 2D 39 39 41 31 2D 44 30 35 33 44 // -4346-99A1-D053D + 45 35 41 37 38 30 38 00 00 ) // E5A7808.. + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symIndexId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_symIndexId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symTag() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_symTag + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_name() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_name + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lexicalParent() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_lexicalParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_classParent() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_classParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_type() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_type + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_dataKind() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_dataKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_locationType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_locationType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_registerId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_offset() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_offset + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_length() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_length + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_slot() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_slot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_volatileType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_volatileType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_constType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_unalignedType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_unalignedType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_access() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_access + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_libraryName() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_libraryName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_platform() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_platform + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_language() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_language + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_editAndContinueEnabled() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_editAndContinueEnabled + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_frontEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_frontEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_frontEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_backEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_backEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_backEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_sourceFileName() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_sourceFileName + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_unused() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_unused + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_thunkOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_thunkOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_thisAdjust() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_thisAdjust + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseOffset() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtualBaseOffset + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtual() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtual + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intro() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_intro + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_pure() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_pure + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_callingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_callingConvention + + .method public hidebysig newslot specialname abstract virtual + instance object + marshal( struct) + get_value() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_value + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_baseType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_token() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_token + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_timeStamp() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_timeStamp + + .method public hidebysig newslot specialname abstract virtual + instance valuetype [mscorlib]System.Guid + get_guid() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_guid + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_symbolsFileName() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_symbolsFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_reference() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_reference + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_count() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_count + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bitPosition() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_bitPosition + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_arrayIndexType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_arrayIndexType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_packed() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_packed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constructor() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_constructor + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_overloadedOperator() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_overloadedOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_nested() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_nested + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasNestedTypes() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasNestedTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAssignmentOperator() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasAssignmentOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasCastOperator() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasCastOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_scoped() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_scoped + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_indirectVirtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_indirectVirtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBasePointerOffset() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtualBasePointerOffset + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualTableShape() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtualTableShape + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lexicalParentId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_lexicalParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_classParentId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_classParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_typeId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_typeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_arrayIndexTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_arrayIndexTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualTableShapeId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtualTableShapeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_code() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_code + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_function() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_function + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_managed() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_managed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_msil() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_msil + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseDispIndex() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtualBaseDispIndex + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_undecoratedName() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_undecoratedName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_age() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_age + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_signature() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_signature + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_compilerGenerated() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_compilerGenerated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_addressTaken() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_addressTaken + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_rank() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_rank + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lowerBound() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_lowerBound + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_upperBound() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_upperBound + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lowerBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_lowerBoundId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_upperBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_upperBoundId + + .method public hidebysig newslot abstract virtual + instance void get_dataBytes([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaSymbol4::get_dataBytes + + .method public hidebysig newslot abstract virtual + instance void findChildren([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findChildren + + .method public hidebysig newslot abstract virtual + instance void findChildrenEx([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findChildrenEx + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByAddr([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findChildrenExByAddr + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findChildrenExByVA + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByRVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findChildrenExByRVA + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetSection() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_targetSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetOffset() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_targetOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_targetRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_targetVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_targetVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_machineType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_machineType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_oemId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_oemSymbolId + + .method public hidebysig newslot abstract virtual + instance void get_types([in] uint32 cTypes, + [out] uint32& pcTypes, + [out] class DIALib.IDiaSymbol& marshal( interface ) pTypes) runtime managed internalcall + { + } // end of method IDiaSymbol4::get_types + + .method public hidebysig newslot abstract virtual + instance void get_typeIds([in] uint32 cTypeIds, + [out] uint32& pcTypeIds, + [out] uint32& pdwTypeIds) runtime managed internalcall + { + } // end of method IDiaSymbol4::get_typeIds + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_objectPointerType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_objectPointerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_udtKind() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_udtKind + + .method public hidebysig newslot abstract virtual + instance void get_undecoratedNameEx([in] uint32 undecorateOptions, + [out] string& marshal( bstr) name) runtime managed internalcall + { + } // end of method IDiaSymbol4::get_undecoratedNameEx + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noReturn() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_noReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_customCallingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_customCallingConvention + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noInline() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_noInline + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_optimizedCodeDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_optimizedCodeDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_notReached() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_notReached + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_interruptReturn() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_interruptReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_farReturn() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_farReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStatic() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isStatic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLTCG() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isLTCG + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isDataAligned() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isDataAligned + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSecurityChecks() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasSecurityChecks + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_compilerName() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_compilerName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAlloca() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasAlloca + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSetJump() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasSetJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasLongJump() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasLongJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasInlAsm() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasInlAsm + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEH() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSEH() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasSEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEHa() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasEHa + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isNaked() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isNaked + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAggregated() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isAggregated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSplitted() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isSplitted + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_container() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_container + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_inlSpec() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_inlSpec + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noStackOrdering() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_noStackOrdering + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualBaseTableType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_virtualBaseTableType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasManagedCode() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasManagedCode + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHotpatchable() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isHotpatchable + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCVTCIL() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isCVTCIL + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMSILNetmodule() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isMSILNetmodule + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCTypes() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isCTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStripped() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isStripped + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_frontEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_backEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_wasInlined() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_wasInlined + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_strictGSCheck() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_strictGSCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCxxReturnUdt() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isCxxReturnUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isConstructorVirtualBase() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isConstructorVirtualBase + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_RValueReference() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_RValueReference + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_unmodifiedType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_unmodifiedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_framePointerPresent() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_framePointerPresent + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSafeBuffers() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isSafeBuffers + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intrinsic() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_intrinsic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_sealed() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_sealed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaFloat() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hfaFloat + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaDouble() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hfaDouble + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_liveRangeStartAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_liveRangeStartAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_liveRangeStartRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_countLiveRanges() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_countLiveRanges + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_liveRangeLength() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_liveRangeLength + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_offsetInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_offsetInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_paramBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_paramBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_localBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_localBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLocationControlFlowDependent() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isLocationControlFlowDependent + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_stride() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_stride + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRows() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_numberOfRows + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfColumns() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_numberOfColumns + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMatrixRowMajor() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isMatrixRowMajor + + .method public hidebysig newslot abstract virtual + instance void get_numericProperties([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pProperties) runtime managed internalcall + { + } // end of method IDiaSymbol4::get_numericProperties + + .method public hidebysig newslot abstract virtual + instance void get_modifierValues([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint16& pModifiers) runtime managed internalcall + { + } // end of method IDiaSymbol4::get_modifierValues + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isReturnValue() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isReturnValue + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedAway() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isOptimizedAway + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_builtInKind() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_builtInKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_registerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataSlot() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_baseDataSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataOffset() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_baseDataOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_textureSlot() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_textureSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_samplerSlot() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_samplerSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_uavSlot() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_uavSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_sizeInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_sizeInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_memorySpaceKind() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_memorySpaceKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_unmodifiedTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_unmodifiedTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_subTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_subTypeId + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_subType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_subType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfModifiers() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_numberOfModifiers + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRegisterIndices() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_numberOfRegisterIndices + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHLSLData() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isHLSLData + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToDataMember() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isPointerToDataMember + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToMemberFunction() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isPointerToMemberFunction + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSingleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isSingleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMultipleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isMultipleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isVirtualInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isVirtualInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_restrictedType() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_restrictedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerBasedOnSymbolValue() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isPointerBasedOnSymbolValue + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_baseSymbol() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_baseSymbol + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_baseSymbolId + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_objectFileName() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_objectFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorGroupSharedLocal() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isAcceleratorGroupSharedLocal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorPointerTagLiveRange() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isAcceleratorPointerTagLiveRange + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorStubFunction() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isAcceleratorStubFunction + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfAcceleratorPointerTags() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_numberOfAcceleratorPointerTags + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSdl() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isSdl + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isWinRTPointer() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isWinRTPointer + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isRefUdt() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isRefUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isValueUdt() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isValueUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isInterfaceUdt() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isInterfaceUdt + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByAddr([in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findInlineFramesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByRVA([in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findInlineFramesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByVA([in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findInlineFramesByVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLines([out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findInlineeLines + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByAddr([in] uint32 isect, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findInlineeLinesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByRVA([in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findInlineeLinesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByVA([in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findInlineeLinesByVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolsForAcceleratorPointerTag([in] uint32 tagValue, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findSymbolsForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void findSymbolsByRVAForAcceleratorPointerTag([in] uint32 tagValue, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findSymbolsByRVAForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void get_acceleratorPointerTags([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pPointerTags) runtime managed internalcall + { + } // end of method IDiaSymbol4::get_acceleratorPointerTags + + .method public hidebysig newslot abstract virtual + instance void getSrcLineOnTypeDefn([out] class DIALib.IDiaLineNumber& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::getSrcLineOnTypeDefn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPGO() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isPGO + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasValidPGOCounts() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasValidPGOCounts + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedForSpeed() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isOptimizedForSpeed + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEntryCount() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_PGOEntryCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEdgeCount() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_PGOEdgeCount + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_PGODynamicInstructionCount() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_PGODynamicInstructionCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_staticSize() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_staticSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_finalLiveStaticSize() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_finalLiveStaticSize + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_phaseName() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_phaseName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasControlFlowCheck() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_hasControlFlowCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constantExport() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_constantExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_dataExport() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_dataExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_privateExport() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_privateExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noNameExport() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_noNameExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportHasExplicitlyAssignedOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_exportHasExplicitlyAssignedOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportIsForwarder() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_exportIsForwarder + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_ordinal() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_ordinal + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frameSize() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_frameSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_exceptionHandlerAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_exceptionHandlerAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_exceptionHandlerRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_exceptionHandlerVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_exceptionHandlerVirtualAddress + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyFile([out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol4::findInputAssemblyFile + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_characteristics() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_characteristics + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_coffGroup() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_coffGroup + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindID() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_bindID + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSpace() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_bindSpace + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSlot() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_bindSlot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCClass() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isObjCClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCCategory() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isObjCCategory + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCProtocol() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_isObjCProtocol + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_inlinee() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_inlinee + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_inlineeId() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_inlineeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noexcept() runtime managed internalcall + { + } // end of method IDiaSymbol4::get_noexcept + + .property uint32 symIndexId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 00 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_symIndexId() + } // end of property IDiaSymbol4::symIndexId + .property uint32 symTag() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_symTag() + } // end of property IDiaSymbol4::symTag + .property string name() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol4::get_name() + } // end of property IDiaSymbol4::name + .property class DIALib.IDiaSymbol lexicalParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_lexicalParent() + } // end of property IDiaSymbol4::lexicalParent + .property class DIALib.IDiaSymbol classParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_classParent() + } // end of property IDiaSymbol4::classParent + .property class DIALib.IDiaSymbol 'type'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_type() + } // end of property IDiaSymbol4::'type' + .property uint32 dataKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_dataKind() + } // end of property IDiaSymbol4::dataKind + .property uint32 locationType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_locationType() + } // end of property IDiaSymbol4::locationType + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_addressSection() + } // end of property IDiaSymbol4::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_addressOffset() + } // end of property IDiaSymbol4::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_relativeVirtualAddress() + } // end of property IDiaSymbol4::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol4::get_virtualAddress() + } // end of property IDiaSymbol4::virtualAddress + .property uint32 registerId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_registerId() + } // end of property IDiaSymbol4::registerId + .property int32 offset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_offset() + } // end of property IDiaSymbol4::offset + .property uint64 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol4::get_length() + } // end of property IDiaSymbol4::length + .property uint32 slot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_slot() + } // end of property IDiaSymbol4::slot + .property int32 volatileType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 10 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_volatileType() + } // end of property IDiaSymbol4::volatileType + .property int32 constType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 11 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_constType() + } // end of property IDiaSymbol4::constType + .property int32 unalignedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 12 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_unalignedType() + } // end of property IDiaSymbol4::unalignedType + .property uint32 access() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 13 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_access() + } // end of property IDiaSymbol4::access + .property string libraryName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 14 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol4::get_libraryName() + } // end of property IDiaSymbol4::libraryName + .property uint32 platform() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 15 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_platform() + } // end of property IDiaSymbol4::platform + .property uint32 language() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 16 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_language() + } // end of property IDiaSymbol4::language + .property int32 editAndContinueEnabled() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 17 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_editAndContinueEnabled() + } // end of property IDiaSymbol4::editAndContinueEnabled + .property uint32 frontEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 18 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_frontEndMajor() + } // end of property IDiaSymbol4::frontEndMajor + .property uint32 frontEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 19 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_frontEndMinor() + } // end of property IDiaSymbol4::frontEndMinor + .property uint32 frontEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_frontEndBuild() + } // end of property IDiaSymbol4::frontEndBuild + .property uint32 backEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_backEndMajor() + } // end of property IDiaSymbol4::backEndMajor + .property uint32 backEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_backEndMinor() + } // end of property IDiaSymbol4::backEndMinor + .property uint32 backEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_backEndBuild() + } // end of property IDiaSymbol4::backEndBuild + .property string sourceFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1E 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol4::get_sourceFileName() + } // end of property IDiaSymbol4::sourceFileName + .property string 'unused'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1F 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol4::get_unused() + } // end of property IDiaSymbol4::'unused' + .property uint32 thunkOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 20 00 00 00 00 00 ) // .. ..... + .get instance uint32 DIALib.IDiaSymbol4::get_thunkOrdinal() + } // end of property IDiaSymbol4::thunkOrdinal + .property int32 thisAdjust() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 21 00 00 00 00 00 ) // ..!..... + .get instance int32 DIALib.IDiaSymbol4::get_thisAdjust() + } // end of property IDiaSymbol4::thisAdjust + .property uint32 virtualBaseOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 22 00 00 00 00 00 ) // .."..... + .get instance uint32 DIALib.IDiaSymbol4::get_virtualBaseOffset() + } // end of property IDiaSymbol4::virtualBaseOffset + .property int32 'virtual'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 23 00 00 00 00 00 ) // ..#..... + .get instance int32 DIALib.IDiaSymbol4::get_virtual() + } // end of property IDiaSymbol4::'virtual' + .property int32 intro() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 24 00 00 00 00 00 ) // ..$..... + .get instance int32 DIALib.IDiaSymbol4::get_intro() + } // end of property IDiaSymbol4::intro + .property int32 pure() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 25 00 00 00 00 00 ) // ..%..... + .get instance int32 DIALib.IDiaSymbol4::get_pure() + } // end of property IDiaSymbol4::pure + .property uint32 callingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 26 00 00 00 00 00 ) // ..&..... + .get instance uint32 DIALib.IDiaSymbol4::get_callingConvention() + } // end of property IDiaSymbol4::callingConvention + .property object 'value'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 27 00 00 00 00 00 ) // ..'..... + .get instance object DIALib.IDiaSymbol4::get_value() + } // end of property IDiaSymbol4::'value' + .property uint32 baseType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 28 00 00 00 00 00 ) // ..(..... + .get instance uint32 DIALib.IDiaSymbol4::get_baseType() + } // end of property IDiaSymbol4::baseType + .property uint32 token() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 29 00 00 00 00 00 ) // ..)..... + .get instance uint32 DIALib.IDiaSymbol4::get_token() + } // end of property IDiaSymbol4::token + .property uint32 timeStamp() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2A 00 00 00 00 00 ) // ..*..... + .get instance uint32 DIALib.IDiaSymbol4::get_timeStamp() + } // end of property IDiaSymbol4::timeStamp + .property valuetype [mscorlib]System.Guid + guid() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2B 00 00 00 00 00 ) // ..+..... + .get instance valuetype [mscorlib]System.Guid DIALib.IDiaSymbol4::get_guid() + } // end of property IDiaSymbol4::guid + .property string symbolsFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2C 00 00 00 00 00 ) // ..,..... + .get instance string DIALib.IDiaSymbol4::get_symbolsFileName() + } // end of property IDiaSymbol4::symbolsFileName + .property int32 reference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2E 00 00 00 00 00 ) // ........ + .get instance int32 DIALib.IDiaSymbol4::get_reference() + } // end of property IDiaSymbol4::reference + .property uint32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2F 00 00 00 00 00 ) // ../..... + .get instance uint32 DIALib.IDiaSymbol4::get_count() + } // end of property IDiaSymbol4::count + .property uint32 bitPosition() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 31 00 00 00 00 00 ) // ..1..... + .get instance uint32 DIALib.IDiaSymbol4::get_bitPosition() + } // end of property IDiaSymbol4::bitPosition + .property class DIALib.IDiaSymbol arrayIndexType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 32 00 00 00 00 00 ) // ..2..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_arrayIndexType() + } // end of property IDiaSymbol4::arrayIndexType + .property int32 packed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 33 00 00 00 00 00 ) // ..3..... + .get instance int32 DIALib.IDiaSymbol4::get_packed() + } // end of property IDiaSymbol4::packed + .property int32 constructor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 34 00 00 00 00 00 ) // ..4..... + .get instance int32 DIALib.IDiaSymbol4::get_constructor() + } // end of property IDiaSymbol4::constructor + .property int32 overloadedOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 35 00 00 00 00 00 ) // ..5..... + .get instance int32 DIALib.IDiaSymbol4::get_overloadedOperator() + } // end of property IDiaSymbol4::overloadedOperator + .property int32 'nested'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 36 00 00 00 00 00 ) // ..6..... + .get instance int32 DIALib.IDiaSymbol4::get_nested() + } // end of property IDiaSymbol4::'nested' + .property int32 hasNestedTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 37 00 00 00 00 00 ) // ..7..... + .get instance int32 DIALib.IDiaSymbol4::get_hasNestedTypes() + } // end of property IDiaSymbol4::hasNestedTypes + .property int32 hasAssignmentOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 38 00 00 00 00 00 ) // ..8..... + .get instance int32 DIALib.IDiaSymbol4::get_hasAssignmentOperator() + } // end of property IDiaSymbol4::hasAssignmentOperator + .property int32 hasCastOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 39 00 00 00 00 00 ) // ..9..... + .get instance int32 DIALib.IDiaSymbol4::get_hasCastOperator() + } // end of property IDiaSymbol4::hasCastOperator + .property int32 scoped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3A 00 00 00 00 00 ) // ..:..... + .get instance int32 DIALib.IDiaSymbol4::get_scoped() + } // end of property IDiaSymbol4::scoped + .property int32 virtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3B 00 00 00 00 00 ) // ..;..... + .get instance int32 DIALib.IDiaSymbol4::get_virtualBaseClass() + } // end of property IDiaSymbol4::virtualBaseClass + .property int32 indirectVirtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3C 00 00 00 00 00 ) // ..<..... + .get instance int32 DIALib.IDiaSymbol4::get_indirectVirtualBaseClass() + } // end of property IDiaSymbol4::indirectVirtualBaseClass + .property int32 virtualBasePointerOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3D 00 00 00 00 00 ) // ..=..... + .get instance int32 DIALib.IDiaSymbol4::get_virtualBasePointerOffset() + } // end of property IDiaSymbol4::virtualBasePointerOffset + .property class DIALib.IDiaSymbol virtualTableShape() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3E 00 00 00 00 00 ) // ..>..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_virtualTableShape() + } // end of property IDiaSymbol4::virtualTableShape + .property uint32 lexicalParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 40 00 00 00 00 00 ) // ..@..... + .get instance uint32 DIALib.IDiaSymbol4::get_lexicalParentId() + } // end of property IDiaSymbol4::lexicalParentId + .property uint32 classParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 41 00 00 00 00 00 ) // ..A..... + .get instance uint32 DIALib.IDiaSymbol4::get_classParentId() + } // end of property IDiaSymbol4::classParentId + .property uint32 typeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 42 00 00 00 00 00 ) // ..B..... + .get instance uint32 DIALib.IDiaSymbol4::get_typeId() + } // end of property IDiaSymbol4::typeId + .property uint32 arrayIndexTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 43 00 00 00 00 00 ) // ..C..... + .get instance uint32 DIALib.IDiaSymbol4::get_arrayIndexTypeId() + } // end of property IDiaSymbol4::arrayIndexTypeId + .property uint32 virtualTableShapeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 44 00 00 00 00 00 ) // ..D..... + .get instance uint32 DIALib.IDiaSymbol4::get_virtualTableShapeId() + } // end of property IDiaSymbol4::virtualTableShapeId + .property int32 code() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 45 00 00 00 00 00 ) // ..E..... + .get instance int32 DIALib.IDiaSymbol4::get_code() + } // end of property IDiaSymbol4::code + .property int32 function() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 46 00 00 00 00 00 ) // ..F..... + .get instance int32 DIALib.IDiaSymbol4::get_function() + } // end of property IDiaSymbol4::function + .property int32 'managed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 47 00 00 00 00 00 ) // ..G..... + .get instance int32 DIALib.IDiaSymbol4::get_managed() + } // end of property IDiaSymbol4::'managed' + .property int32 msil() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 48 00 00 00 00 00 ) // ..H..... + .get instance int32 DIALib.IDiaSymbol4::get_msil() + } // end of property IDiaSymbol4::msil + .property uint32 virtualBaseDispIndex() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 49 00 00 00 00 00 ) // ..I..... + .get instance uint32 DIALib.IDiaSymbol4::get_virtualBaseDispIndex() + } // end of property IDiaSymbol4::virtualBaseDispIndex + .property string undecoratedName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4A 00 00 00 00 00 ) // ..J..... + .get instance string DIALib.IDiaSymbol4::get_undecoratedName() + } // end of property IDiaSymbol4::undecoratedName + .property uint32 age() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4B 00 00 00 00 00 ) // ..K..... + .get instance uint32 DIALib.IDiaSymbol4::get_age() + } // end of property IDiaSymbol4::age + .property uint32 signature() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4C 00 00 00 00 00 ) // ..L..... + .get instance uint32 DIALib.IDiaSymbol4::get_signature() + } // end of property IDiaSymbol4::signature + .property int32 compilerGenerated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4D 00 00 00 00 00 ) // ..M..... + .get instance int32 DIALib.IDiaSymbol4::get_compilerGenerated() + } // end of property IDiaSymbol4::compilerGenerated + .property int32 addressTaken() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4E 00 00 00 00 00 ) // ..N..... + .get instance int32 DIALib.IDiaSymbol4::get_addressTaken() + } // end of property IDiaSymbol4::addressTaken + .property uint32 rank() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4F 00 00 00 00 00 ) // ..O..... + .get instance uint32 DIALib.IDiaSymbol4::get_rank() + } // end of property IDiaSymbol4::rank + .property class DIALib.IDiaSymbol lowerBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 50 00 00 00 00 00 ) // ..P..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_lowerBound() + } // end of property IDiaSymbol4::lowerBound + .property class DIALib.IDiaSymbol upperBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 51 00 00 00 00 00 ) // ..Q..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_upperBound() + } // end of property IDiaSymbol4::upperBound + .property uint32 lowerBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 52 00 00 00 00 00 ) // ..R..... + .get instance uint32 DIALib.IDiaSymbol4::get_lowerBoundId() + } // end of property IDiaSymbol4::lowerBoundId + .property uint32 upperBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 53 00 00 00 00 00 ) // ..S..... + .get instance uint32 DIALib.IDiaSymbol4::get_upperBoundId() + } // end of property IDiaSymbol4::upperBoundId + .property uint32 targetSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 54 00 00 00 00 00 ) // ..T..... + .get instance uint32 DIALib.IDiaSymbol4::get_targetSection() + } // end of property IDiaSymbol4::targetSection + .property uint32 targetOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 55 00 00 00 00 00 ) // ..U..... + .get instance uint32 DIALib.IDiaSymbol4::get_targetOffset() + } // end of property IDiaSymbol4::targetOffset + .property uint32 targetRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 56 00 00 00 00 00 ) // ..V..... + .get instance uint32 DIALib.IDiaSymbol4::get_targetRelativeVirtualAddress() + } // end of property IDiaSymbol4::targetRelativeVirtualAddress + .property uint64 targetVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 57 00 00 00 00 00 ) // ..W..... + .get instance uint64 DIALib.IDiaSymbol4::get_targetVirtualAddress() + } // end of property IDiaSymbol4::targetVirtualAddress + .property uint32 machineType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 58 00 00 00 00 00 ) // ..X..... + .get instance uint32 DIALib.IDiaSymbol4::get_machineType() + } // end of property IDiaSymbol4::machineType + .property uint32 oemId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 59 00 00 00 00 00 ) // ..Y..... + .get instance uint32 DIALib.IDiaSymbol4::get_oemId() + } // end of property IDiaSymbol4::oemId + .property uint32 oemSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5A 00 00 00 00 00 ) // ..Z..... + .get instance uint32 DIALib.IDiaSymbol4::get_oemSymbolId() + } // end of property IDiaSymbol4::oemSymbolId + .property class DIALib.IDiaSymbol objectPointerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5B 00 00 00 00 00 ) // ..[..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_objectPointerType() + } // end of property IDiaSymbol4::objectPointerType + .property uint32 udtKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5C 00 00 00 00 00 ) // ..\..... + .get instance uint32 DIALib.IDiaSymbol4::get_udtKind() + } // end of property IDiaSymbol4::udtKind + .property int32 noReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5D 00 00 00 00 00 ) // ..]..... + .get instance int32 DIALib.IDiaSymbol4::get_noReturn() + } // end of property IDiaSymbol4::noReturn + .property int32 customCallingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5E 00 00 00 00 00 ) // ..^..... + .get instance int32 DIALib.IDiaSymbol4::get_customCallingConvention() + } // end of property IDiaSymbol4::customCallingConvention + .property int32 noInline() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5F 00 00 00 00 00 ) // .._..... + .get instance int32 DIALib.IDiaSymbol4::get_noInline() + } // end of property IDiaSymbol4::noInline + .property int32 optimizedCodeDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 60 00 00 00 00 00 ) // ..`..... + .get instance int32 DIALib.IDiaSymbol4::get_optimizedCodeDebugInfo() + } // end of property IDiaSymbol4::optimizedCodeDebugInfo + .property int32 notReached() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 61 00 00 00 00 00 ) // ..a..... + .get instance int32 DIALib.IDiaSymbol4::get_notReached() + } // end of property IDiaSymbol4::notReached + .property int32 interruptReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 62 00 00 00 00 00 ) // ..b..... + .get instance int32 DIALib.IDiaSymbol4::get_interruptReturn() + } // end of property IDiaSymbol4::interruptReturn + .property int32 farReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 63 00 00 00 00 00 ) // ..c..... + .get instance int32 DIALib.IDiaSymbol4::get_farReturn() + } // end of property IDiaSymbol4::farReturn + .property int32 isStatic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 64 00 00 00 00 00 ) // ..d..... + .get instance int32 DIALib.IDiaSymbol4::get_isStatic() + } // end of property IDiaSymbol4::isStatic + .property int32 hasDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 65 00 00 00 00 00 ) // ..e..... + .get instance int32 DIALib.IDiaSymbol4::get_hasDebugInfo() + } // end of property IDiaSymbol4::hasDebugInfo + .property int32 isLTCG() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 66 00 00 00 00 00 ) // ..f..... + .get instance int32 DIALib.IDiaSymbol4::get_isLTCG() + } // end of property IDiaSymbol4::isLTCG + .property int32 isDataAligned() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 67 00 00 00 00 00 ) // ..g..... + .get instance int32 DIALib.IDiaSymbol4::get_isDataAligned() + } // end of property IDiaSymbol4::isDataAligned + .property int32 hasSecurityChecks() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 68 00 00 00 00 00 ) // ..h..... + .get instance int32 DIALib.IDiaSymbol4::get_hasSecurityChecks() + } // end of property IDiaSymbol4::hasSecurityChecks + .property string compilerName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 69 00 00 00 00 00 ) // ..i..... + .get instance string DIALib.IDiaSymbol4::get_compilerName() + } // end of property IDiaSymbol4::compilerName + .property int32 hasAlloca() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6A 00 00 00 00 00 ) // ..j..... + .get instance int32 DIALib.IDiaSymbol4::get_hasAlloca() + } // end of property IDiaSymbol4::hasAlloca + .property int32 hasSetJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6B 00 00 00 00 00 ) // ..k..... + .get instance int32 DIALib.IDiaSymbol4::get_hasSetJump() + } // end of property IDiaSymbol4::hasSetJump + .property int32 hasLongJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6C 00 00 00 00 00 ) // ..l..... + .get instance int32 DIALib.IDiaSymbol4::get_hasLongJump() + } // end of property IDiaSymbol4::hasLongJump + .property int32 hasInlAsm() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6D 00 00 00 00 00 ) // ..m..... + .get instance int32 DIALib.IDiaSymbol4::get_hasInlAsm() + } // end of property IDiaSymbol4::hasInlAsm + .property int32 hasEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6E 00 00 00 00 00 ) // ..n..... + .get instance int32 DIALib.IDiaSymbol4::get_hasEH() + } // end of property IDiaSymbol4::hasEH + .property int32 hasSEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6F 00 00 00 00 00 ) // ..o..... + .get instance int32 DIALib.IDiaSymbol4::get_hasSEH() + } // end of property IDiaSymbol4::hasSEH + .property int32 hasEHa() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 70 00 00 00 00 00 ) // ..p..... + .get instance int32 DIALib.IDiaSymbol4::get_hasEHa() + } // end of property IDiaSymbol4::hasEHa + .property int32 isNaked() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 71 00 00 00 00 00 ) // ..q..... + .get instance int32 DIALib.IDiaSymbol4::get_isNaked() + } // end of property IDiaSymbol4::isNaked + .property int32 isAggregated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 72 00 00 00 00 00 ) // ..r..... + .get instance int32 DIALib.IDiaSymbol4::get_isAggregated() + } // end of property IDiaSymbol4::isAggregated + .property int32 isSplitted() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 73 00 00 00 00 00 ) // ..s..... + .get instance int32 DIALib.IDiaSymbol4::get_isSplitted() + } // end of property IDiaSymbol4::isSplitted + .property class DIALib.IDiaSymbol container() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 74 00 00 00 00 00 ) // ..t..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_container() + } // end of property IDiaSymbol4::container + .property int32 inlSpec() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 75 00 00 00 00 00 ) // ..u..... + .get instance int32 DIALib.IDiaSymbol4::get_inlSpec() + } // end of property IDiaSymbol4::inlSpec + .property int32 noStackOrdering() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 76 00 00 00 00 00 ) // ..v..... + .get instance int32 DIALib.IDiaSymbol4::get_noStackOrdering() + } // end of property IDiaSymbol4::noStackOrdering + .property class DIALib.IDiaSymbol virtualBaseTableType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 77 00 00 00 00 00 ) // ..w..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_virtualBaseTableType() + } // end of property IDiaSymbol4::virtualBaseTableType + .property int32 hasManagedCode() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 78 00 00 00 00 00 ) // ..x..... + .get instance int32 DIALib.IDiaSymbol4::get_hasManagedCode() + } // end of property IDiaSymbol4::hasManagedCode + .property int32 isHotpatchable() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 79 00 00 00 00 00 ) // ..y..... + .get instance int32 DIALib.IDiaSymbol4::get_isHotpatchable() + } // end of property IDiaSymbol4::isHotpatchable + .property int32 isCVTCIL() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7A 00 00 00 00 00 ) // ..z..... + .get instance int32 DIALib.IDiaSymbol4::get_isCVTCIL() + } // end of property IDiaSymbol4::isCVTCIL + .property int32 isMSILNetmodule() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7B 00 00 00 00 00 ) // ..{..... + .get instance int32 DIALib.IDiaSymbol4::get_isMSILNetmodule() + } // end of property IDiaSymbol4::isMSILNetmodule + .property int32 isCTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7C 00 00 00 00 00 ) // ..|..... + .get instance int32 DIALib.IDiaSymbol4::get_isCTypes() + } // end of property IDiaSymbol4::isCTypes + .property int32 isStripped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7D 00 00 00 00 00 ) // ..}..... + .get instance int32 DIALib.IDiaSymbol4::get_isStripped() + } // end of property IDiaSymbol4::isStripped + .property uint32 frontEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7E 00 00 00 00 00 ) // ..~..... + .get instance uint32 DIALib.IDiaSymbol4::get_frontEndQFE() + } // end of property IDiaSymbol4::frontEndQFE + .property uint32 backEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_backEndQFE() + } // end of property IDiaSymbol4::backEndQFE + .property int32 wasInlined() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 80 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_wasInlined() + } // end of property IDiaSymbol4::wasInlined + .property int32 strictGSCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 81 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_strictGSCheck() + } // end of property IDiaSymbol4::strictGSCheck + .property int32 isCxxReturnUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 82 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isCxxReturnUdt() + } // end of property IDiaSymbol4::isCxxReturnUdt + .property int32 isConstructorVirtualBase() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 83 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isConstructorVirtualBase() + } // end of property IDiaSymbol4::isConstructorVirtualBase + .property int32 RValueReference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 84 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_RValueReference() + } // end of property IDiaSymbol4::RValueReference + .property class DIALib.IDiaSymbol unmodifiedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 85 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_unmodifiedType() + } // end of property IDiaSymbol4::unmodifiedType + .property int32 framePointerPresent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 86 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_framePointerPresent() + } // end of property IDiaSymbol4::framePointerPresent + .property int32 isSafeBuffers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 87 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isSafeBuffers() + } // end of property IDiaSymbol4::isSafeBuffers + .property int32 intrinsic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 88 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_intrinsic() + } // end of property IDiaSymbol4::intrinsic + .property int32 'sealed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 89 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_sealed() + } // end of property IDiaSymbol4::'sealed' + .property int32 hfaFloat() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_hfaFloat() + } // end of property IDiaSymbol4::hfaFloat + .property int32 hfaDouble() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8B 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_hfaDouble() + } // end of property IDiaSymbol4::hfaDouble + .property uint32 liveRangeStartAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_liveRangeStartAddressSection() + } // end of property IDiaSymbol4::liveRangeStartAddressSection + .property uint32 liveRangeStartAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_liveRangeStartAddressOffset() + } // end of property IDiaSymbol4::liveRangeStartAddressOffset + .property uint32 liveRangeStartRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_liveRangeStartRelativeVirtualAddress() + } // end of property IDiaSymbol4::liveRangeStartRelativeVirtualAddress + .property uint32 countLiveRanges() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_countLiveRanges() + } // end of property IDiaSymbol4::countLiveRanges + .property uint64 liveRangeLength() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 90 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol4::get_liveRangeLength() + } // end of property IDiaSymbol4::liveRangeLength + .property uint32 offsetInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 91 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_offsetInUdt() + } // end of property IDiaSymbol4::offsetInUdt + .property uint32 paramBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 92 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_paramBasePointerRegisterId() + } // end of property IDiaSymbol4::paramBasePointerRegisterId + .property uint32 localBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 93 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_localBasePointerRegisterId() + } // end of property IDiaSymbol4::localBasePointerRegisterId + .property int32 isLocationControlFlowDependent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 94 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isLocationControlFlowDependent() + } // end of property IDiaSymbol4::isLocationControlFlowDependent + .property uint32 stride() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 95 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_stride() + } // end of property IDiaSymbol4::stride + .property uint32 numberOfRows() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 96 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_numberOfRows() + } // end of property IDiaSymbol4::numberOfRows + .property uint32 numberOfColumns() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 97 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_numberOfColumns() + } // end of property IDiaSymbol4::numberOfColumns + .property int32 isMatrixRowMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 98 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isMatrixRowMajor() + } // end of property IDiaSymbol4::isMatrixRowMajor + .property int32 isReturnValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 99 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isReturnValue() + } // end of property IDiaSymbol4::isReturnValue + .property int32 isOptimizedAway() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isOptimizedAway() + } // end of property IDiaSymbol4::isOptimizedAway + .property uint32 builtInKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_builtInKind() + } // end of property IDiaSymbol4::builtInKind + .property uint32 registerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_registerType() + } // end of property IDiaSymbol4::registerType + .property uint32 baseDataSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_baseDataSlot() + } // end of property IDiaSymbol4::baseDataSlot + .property uint32 baseDataOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_baseDataOffset() + } // end of property IDiaSymbol4::baseDataOffset + .property uint32 textureSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_textureSlot() + } // end of property IDiaSymbol4::textureSlot + .property uint32 samplerSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_samplerSlot() + } // end of property IDiaSymbol4::samplerSlot + .property uint32 uavSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_uavSlot() + } // end of property IDiaSymbol4::uavSlot + .property uint32 sizeInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_sizeInUdt() + } // end of property IDiaSymbol4::sizeInUdt + .property uint32 memorySpaceKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_memorySpaceKind() + } // end of property IDiaSymbol4::memorySpaceKind + .property uint32 unmodifiedTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_unmodifiedTypeId() + } // end of property IDiaSymbol4::unmodifiedTypeId + .property uint32 subTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_subTypeId() + } // end of property IDiaSymbol4::subTypeId + .property class DIALib.IDiaSymbol subType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A6 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_subType() + } // end of property IDiaSymbol4::subType + .property uint32 numberOfModifiers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_numberOfModifiers() + } // end of property IDiaSymbol4::numberOfModifiers + .property uint32 numberOfRegisterIndices() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A8 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_numberOfRegisterIndices() + } // end of property IDiaSymbol4::numberOfRegisterIndices + .property int32 isHLSLData() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isHLSLData() + } // end of property IDiaSymbol4::isHLSLData + .property int32 isPointerToDataMember() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isPointerToDataMember() + } // end of property IDiaSymbol4::isPointerToDataMember + .property int32 isPointerToMemberFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isPointerToMemberFunction() + } // end of property IDiaSymbol4::isPointerToMemberFunction + .property int32 isSingleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isSingleInheritance() + } // end of property IDiaSymbol4::isSingleInheritance + .property int32 isMultipleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isMultipleInheritance() + } // end of property IDiaSymbol4::isMultipleInheritance + .property int32 isVirtualInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isVirtualInheritance() + } // end of property IDiaSymbol4::isVirtualInheritance + .property int32 restrictedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_restrictedType() + } // end of property IDiaSymbol4::restrictedType + .property int32 isPointerBasedOnSymbolValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B0 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isPointerBasedOnSymbolValue() + } // end of property IDiaSymbol4::isPointerBasedOnSymbolValue + .property class DIALib.IDiaSymbol baseSymbol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B1 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_baseSymbol() + } // end of property IDiaSymbol4::baseSymbol + .property uint32 baseSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_baseSymbolId() + } // end of property IDiaSymbol4::baseSymbolId + .property string objectFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B3 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol4::get_objectFileName() + } // end of property IDiaSymbol4::objectFileName + .property int32 isAcceleratorGroupSharedLocal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B4 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isAcceleratorGroupSharedLocal() + } // end of property IDiaSymbol4::isAcceleratorGroupSharedLocal + .property int32 isAcceleratorPointerTagLiveRange() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B5 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isAcceleratorPointerTagLiveRange() + } // end of property IDiaSymbol4::isAcceleratorPointerTagLiveRange + .property int32 isAcceleratorStubFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isAcceleratorStubFunction() + } // end of property IDiaSymbol4::isAcceleratorStubFunction + .property uint32 numberOfAcceleratorPointerTags() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_numberOfAcceleratorPointerTags() + } // end of property IDiaSymbol4::numberOfAcceleratorPointerTags + .property int32 isSdl() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isSdl() + } // end of property IDiaSymbol4::isSdl + .property int32 isWinRTPointer() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isWinRTPointer() + } // end of property IDiaSymbol4::isWinRTPointer + .property int32 isRefUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isRefUdt() + } // end of property IDiaSymbol4::isRefUdt + .property int32 isValueUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isValueUdt() + } // end of property IDiaSymbol4::isValueUdt + .property int32 isInterfaceUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isInterfaceUdt() + } // end of property IDiaSymbol4::isInterfaceUdt + .property int32 isPGO() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isPGO() + } // end of property IDiaSymbol4::isPGO + .property int32 hasValidPGOCounts() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_hasValidPGOCounts() + } // end of property IDiaSymbol4::hasValidPGOCounts + .property int32 isOptimizedForSpeed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isOptimizedForSpeed() + } // end of property IDiaSymbol4::isOptimizedForSpeed + .property uint32 PGOEntryCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_PGOEntryCount() + } // end of property IDiaSymbol4::PGOEntryCount + .property uint32 PGOEdgeCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_PGOEdgeCount() + } // end of property IDiaSymbol4::PGOEdgeCount + .property uint64 PGODynamicInstructionCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol4::get_PGODynamicInstructionCount() + } // end of property IDiaSymbol4::PGODynamicInstructionCount + .property uint32 staticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_staticSize() + } // end of property IDiaSymbol4::staticSize + .property uint32 finalLiveStaticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_finalLiveStaticSize() + } // end of property IDiaSymbol4::finalLiveStaticSize + .property string phaseName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C5 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol4::get_phaseName() + } // end of property IDiaSymbol4::phaseName + .property int32 hasControlFlowCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_hasControlFlowCheck() + } // end of property IDiaSymbol4::hasControlFlowCheck + .property int32 constantExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C7 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_constantExport() + } // end of property IDiaSymbol4::constantExport + .property int32 dataExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_dataExport() + } // end of property IDiaSymbol4::dataExport + .property int32 privateExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_privateExport() + } // end of property IDiaSymbol4::privateExport + .property int32 noNameExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_noNameExport() + } // end of property IDiaSymbol4::noNameExport + .property int32 exportHasExplicitlyAssignedOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_exportHasExplicitlyAssignedOrdinal() + } // end of property IDiaSymbol4::exportHasExplicitlyAssignedOrdinal + .property int32 exportIsForwarder() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_exportIsForwarder() + } // end of property IDiaSymbol4::exportIsForwarder + .property uint32 ordinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CD 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_ordinal() + } // end of property IDiaSymbol4::ordinal + .property uint32 frameSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CE 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_frameSize() + } // end of property IDiaSymbol4::frameSize + .property uint32 exceptionHandlerAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CF 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_exceptionHandlerAddressSection() + } // end of property IDiaSymbol4::exceptionHandlerAddressSection + .property uint32 exceptionHandlerAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_exceptionHandlerAddressOffset() + } // end of property IDiaSymbol4::exceptionHandlerAddressOffset + .property uint32 exceptionHandlerRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_exceptionHandlerRelativeVirtualAddress() + } // end of property IDiaSymbol4::exceptionHandlerRelativeVirtualAddress + .property uint64 exceptionHandlerVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol4::get_exceptionHandlerVirtualAddress() + } // end of property IDiaSymbol4::exceptionHandlerVirtualAddress + .property uint32 characteristics() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_characteristics() + } // end of property IDiaSymbol4::characteristics + .property class DIALib.IDiaSymbol coffGroup() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D4 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_coffGroup() + } // end of property IDiaSymbol4::coffGroup + .property uint32 bindID() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_bindID() + } // end of property IDiaSymbol4::bindID + .property uint32 bindSpace() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D6 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_bindSpace() + } // end of property IDiaSymbol4::bindSpace + .property uint32 bindSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_bindSlot() + } // end of property IDiaSymbol4::bindSlot + .property int32 isObjCClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isObjCClass() + } // end of property IDiaSymbol4::isObjCClass + .property int32 isObjCCategory() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isObjCCategory() + } // end of property IDiaSymbol4::isObjCCategory + .property int32 isObjCProtocol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_isObjCProtocol() + } // end of property IDiaSymbol4::isObjCProtocol + .property class DIALib.IDiaSymbol inlinee() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DB 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol4::get_inlinee() + } // end of property IDiaSymbol4::inlinee + .property uint32 inlineeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DC 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol4::get_inlineeId() + } // end of property IDiaSymbol4::inlineeId + .property int32 noexcept() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol4::get_noexcept() + } // end of property IDiaSymbol4::noexcept +} // end of class DIALib.IDiaSymbol4 + +.class interface public abstract auto ansi import DIALib.IDiaSymbol5 + implements DIALib.IDiaSymbol4 +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 42 45 32 44 45 30 30 2D 44 43 32 44 // ..$ABE2DE00-DC2D + 2D 34 37 39 33 2D 41 46 39 41 2D 45 46 31 44 39 // -4793-AF9A-EF1D9 + 30 38 33 32 36 34 34 00 00 ) // 0832644.. + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 0A 73 79 6D 49 6E 64 65 78 49 64 00 00 ) // ...symIndexId.. + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symIndexId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_symIndexId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symTag() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_symTag + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_name() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_name + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lexicalParent() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_lexicalParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_classParent() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_classParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_type() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_type + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_dataKind() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_dataKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_locationType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_locationType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_registerId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_offset() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_offset + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_length() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_length + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_slot() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_slot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_volatileType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_volatileType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_constType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_unalignedType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_unalignedType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_access() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_access + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_libraryName() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_libraryName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_platform() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_platform + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_language() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_language + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_editAndContinueEnabled() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_editAndContinueEnabled + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_frontEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_frontEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_frontEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_backEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_backEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_backEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_sourceFileName() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_sourceFileName + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_unused() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_unused + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_thunkOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_thunkOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_thisAdjust() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_thisAdjust + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseOffset() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtualBaseOffset + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtual() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtual + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intro() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_intro + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_pure() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_pure + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_callingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_callingConvention + + .method public hidebysig newslot specialname abstract virtual + instance object + marshal( struct) + get_value() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_value + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_baseType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_token() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_token + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_timeStamp() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_timeStamp + + .method public hidebysig newslot specialname abstract virtual + instance valuetype [mscorlib]System.Guid + get_guid() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_guid + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_symbolsFileName() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_symbolsFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_reference() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_reference + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_count() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_count + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bitPosition() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_bitPosition + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_arrayIndexType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_arrayIndexType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_packed() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_packed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constructor() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_constructor + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_overloadedOperator() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_overloadedOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_nested() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_nested + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasNestedTypes() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasNestedTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAssignmentOperator() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasAssignmentOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasCastOperator() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasCastOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_scoped() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_scoped + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_indirectVirtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_indirectVirtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBasePointerOffset() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtualBasePointerOffset + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualTableShape() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtualTableShape + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lexicalParentId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_lexicalParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_classParentId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_classParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_typeId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_typeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_arrayIndexTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_arrayIndexTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualTableShapeId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtualTableShapeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_code() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_code + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_function() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_function + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_managed() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_managed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_msil() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_msil + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseDispIndex() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtualBaseDispIndex + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_undecoratedName() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_undecoratedName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_age() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_age + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_signature() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_signature + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_compilerGenerated() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_compilerGenerated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_addressTaken() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_addressTaken + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_rank() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_rank + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lowerBound() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_lowerBound + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_upperBound() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_upperBound + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lowerBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_lowerBoundId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_upperBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_upperBoundId + + .method public hidebysig newslot abstract virtual + instance void get_dataBytes([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaSymbol5::get_dataBytes + + .method public hidebysig newslot abstract virtual + instance void findChildren([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findChildren + + .method public hidebysig newslot abstract virtual + instance void findChildrenEx([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findChildrenEx + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByAddr([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findChildrenExByAddr + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findChildrenExByVA + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByRVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findChildrenExByRVA + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetSection() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_targetSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetOffset() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_targetOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_targetRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_targetVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_targetVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_machineType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_machineType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_oemId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_oemSymbolId + + .method public hidebysig newslot abstract virtual + instance void get_types([in] uint32 cTypes, + [out] uint32& pcTypes, + [out] class DIALib.IDiaSymbol& marshal( interface ) pTypes) runtime managed internalcall + { + } // end of method IDiaSymbol5::get_types + + .method public hidebysig newslot abstract virtual + instance void get_typeIds([in] uint32 cTypeIds, + [out] uint32& pcTypeIds, + [out] uint32& pdwTypeIds) runtime managed internalcall + { + } // end of method IDiaSymbol5::get_typeIds + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_objectPointerType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_objectPointerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_udtKind() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_udtKind + + .method public hidebysig newslot abstract virtual + instance void get_undecoratedNameEx([in] uint32 undecorateOptions, + [out] string& marshal( bstr) name) runtime managed internalcall + { + } // end of method IDiaSymbol5::get_undecoratedNameEx + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noReturn() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_noReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_customCallingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_customCallingConvention + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noInline() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_noInline + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_optimizedCodeDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_optimizedCodeDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_notReached() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_notReached + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_interruptReturn() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_interruptReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_farReturn() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_farReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStatic() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isStatic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLTCG() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isLTCG + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isDataAligned() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isDataAligned + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSecurityChecks() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasSecurityChecks + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_compilerName() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_compilerName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAlloca() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasAlloca + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSetJump() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasSetJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasLongJump() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasLongJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasInlAsm() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasInlAsm + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEH() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSEH() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasSEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEHa() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasEHa + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isNaked() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isNaked + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAggregated() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isAggregated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSplitted() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isSplitted + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_container() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_container + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_inlSpec() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_inlSpec + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noStackOrdering() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_noStackOrdering + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualBaseTableType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_virtualBaseTableType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasManagedCode() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasManagedCode + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHotpatchable() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isHotpatchable + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCVTCIL() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isCVTCIL + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMSILNetmodule() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isMSILNetmodule + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCTypes() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isCTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStripped() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isStripped + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_frontEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_backEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_wasInlined() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_wasInlined + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_strictGSCheck() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_strictGSCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCxxReturnUdt() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isCxxReturnUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isConstructorVirtualBase() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isConstructorVirtualBase + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_RValueReference() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_RValueReference + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_unmodifiedType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_unmodifiedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_framePointerPresent() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_framePointerPresent + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSafeBuffers() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isSafeBuffers + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intrinsic() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_intrinsic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_sealed() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_sealed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaFloat() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hfaFloat + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaDouble() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hfaDouble + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_liveRangeStartAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_liveRangeStartAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_liveRangeStartRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_countLiveRanges() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_countLiveRanges + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_liveRangeLength() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_liveRangeLength + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_offsetInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_offsetInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_paramBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_paramBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_localBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_localBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLocationControlFlowDependent() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isLocationControlFlowDependent + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_stride() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_stride + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRows() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_numberOfRows + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfColumns() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_numberOfColumns + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMatrixRowMajor() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isMatrixRowMajor + + .method public hidebysig newslot abstract virtual + instance void get_numericProperties([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pProperties) runtime managed internalcall + { + } // end of method IDiaSymbol5::get_numericProperties + + .method public hidebysig newslot abstract virtual + instance void get_modifierValues([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint16& pModifiers) runtime managed internalcall + { + } // end of method IDiaSymbol5::get_modifierValues + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isReturnValue() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isReturnValue + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedAway() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isOptimizedAway + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_builtInKind() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_builtInKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_registerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataSlot() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_baseDataSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataOffset() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_baseDataOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_textureSlot() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_textureSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_samplerSlot() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_samplerSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_uavSlot() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_uavSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_sizeInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_sizeInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_memorySpaceKind() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_memorySpaceKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_unmodifiedTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_unmodifiedTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_subTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_subTypeId + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_subType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_subType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfModifiers() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_numberOfModifiers + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRegisterIndices() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_numberOfRegisterIndices + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHLSLData() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isHLSLData + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToDataMember() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isPointerToDataMember + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToMemberFunction() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isPointerToMemberFunction + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSingleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isSingleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMultipleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isMultipleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isVirtualInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isVirtualInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_restrictedType() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_restrictedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerBasedOnSymbolValue() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isPointerBasedOnSymbolValue + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_baseSymbol() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_baseSymbol + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_baseSymbolId + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_objectFileName() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_objectFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorGroupSharedLocal() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isAcceleratorGroupSharedLocal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorPointerTagLiveRange() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isAcceleratorPointerTagLiveRange + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorStubFunction() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isAcceleratorStubFunction + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfAcceleratorPointerTags() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_numberOfAcceleratorPointerTags + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSdl() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isSdl + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isWinRTPointer() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isWinRTPointer + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isRefUdt() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isRefUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isValueUdt() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isValueUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isInterfaceUdt() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isInterfaceUdt + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByAddr([in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findInlineFramesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByRVA([in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findInlineFramesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByVA([in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findInlineFramesByVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLines([out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findInlineeLines + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByAddr([in] uint32 isect, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findInlineeLinesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByRVA([in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findInlineeLinesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByVA([in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findInlineeLinesByVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolsForAcceleratorPointerTag([in] uint32 tagValue, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findSymbolsForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void findSymbolsByRVAForAcceleratorPointerTag([in] uint32 tagValue, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findSymbolsByRVAForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void get_acceleratorPointerTags([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pPointerTags) runtime managed internalcall + { + } // end of method IDiaSymbol5::get_acceleratorPointerTags + + .method public hidebysig newslot abstract virtual + instance void getSrcLineOnTypeDefn([out] class DIALib.IDiaLineNumber& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::getSrcLineOnTypeDefn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPGO() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isPGO + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasValidPGOCounts() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasValidPGOCounts + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedForSpeed() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isOptimizedForSpeed + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEntryCount() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_PGOEntryCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEdgeCount() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_PGOEdgeCount + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_PGODynamicInstructionCount() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_PGODynamicInstructionCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_staticSize() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_staticSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_finalLiveStaticSize() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_finalLiveStaticSize + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_phaseName() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_phaseName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasControlFlowCheck() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasControlFlowCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constantExport() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_constantExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_dataExport() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_dataExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_privateExport() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_privateExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noNameExport() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_noNameExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportHasExplicitlyAssignedOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_exportHasExplicitlyAssignedOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportIsForwarder() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_exportIsForwarder + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_ordinal() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_ordinal + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frameSize() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_frameSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_exceptionHandlerAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_exceptionHandlerAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_exceptionHandlerRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_exceptionHandlerVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_exceptionHandlerVirtualAddress + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyFile([out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol5::findInputAssemblyFile + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_characteristics() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_characteristics + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_coffGroup() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_coffGroup + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindID() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_bindID + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSpace() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_bindSpace + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSlot() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_bindSlot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCClass() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isObjCClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCCategory() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isObjCCategory + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCProtocol() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_isObjCProtocol + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_inlinee() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_inlinee + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_inlineeId() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_inlineeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noexcept() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_noexcept + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAbsoluteAddress() runtime managed internalcall + { + } // end of method IDiaSymbol5::get_hasAbsoluteAddress + + .property uint32 symIndexId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 00 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_symIndexId() + } // end of property IDiaSymbol5::symIndexId + .property uint32 symTag() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_symTag() + } // end of property IDiaSymbol5::symTag + .property string name() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol5::get_name() + } // end of property IDiaSymbol5::name + .property class DIALib.IDiaSymbol lexicalParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_lexicalParent() + } // end of property IDiaSymbol5::lexicalParent + .property class DIALib.IDiaSymbol classParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_classParent() + } // end of property IDiaSymbol5::classParent + .property class DIALib.IDiaSymbol 'type'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_type() + } // end of property IDiaSymbol5::'type' + .property uint32 dataKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_dataKind() + } // end of property IDiaSymbol5::dataKind + .property uint32 locationType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_locationType() + } // end of property IDiaSymbol5::locationType + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_addressSection() + } // end of property IDiaSymbol5::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_addressOffset() + } // end of property IDiaSymbol5::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_relativeVirtualAddress() + } // end of property IDiaSymbol5::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol5::get_virtualAddress() + } // end of property IDiaSymbol5::virtualAddress + .property uint32 registerId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_registerId() + } // end of property IDiaSymbol5::registerId + .property int32 offset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_offset() + } // end of property IDiaSymbol5::offset + .property uint64 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol5::get_length() + } // end of property IDiaSymbol5::length + .property uint32 slot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_slot() + } // end of property IDiaSymbol5::slot + .property int32 volatileType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 10 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_volatileType() + } // end of property IDiaSymbol5::volatileType + .property int32 constType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 11 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_constType() + } // end of property IDiaSymbol5::constType + .property int32 unalignedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 12 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_unalignedType() + } // end of property IDiaSymbol5::unalignedType + .property uint32 access() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 13 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_access() + } // end of property IDiaSymbol5::access + .property string libraryName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 14 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol5::get_libraryName() + } // end of property IDiaSymbol5::libraryName + .property uint32 platform() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 15 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_platform() + } // end of property IDiaSymbol5::platform + .property uint32 language() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 16 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_language() + } // end of property IDiaSymbol5::language + .property int32 editAndContinueEnabled() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 17 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_editAndContinueEnabled() + } // end of property IDiaSymbol5::editAndContinueEnabled + .property uint32 frontEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 18 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_frontEndMajor() + } // end of property IDiaSymbol5::frontEndMajor + .property uint32 frontEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 19 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_frontEndMinor() + } // end of property IDiaSymbol5::frontEndMinor + .property uint32 frontEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_frontEndBuild() + } // end of property IDiaSymbol5::frontEndBuild + .property uint32 backEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_backEndMajor() + } // end of property IDiaSymbol5::backEndMajor + .property uint32 backEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_backEndMinor() + } // end of property IDiaSymbol5::backEndMinor + .property uint32 backEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_backEndBuild() + } // end of property IDiaSymbol5::backEndBuild + .property string sourceFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1E 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol5::get_sourceFileName() + } // end of property IDiaSymbol5::sourceFileName + .property string 'unused'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1F 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol5::get_unused() + } // end of property IDiaSymbol5::'unused' + .property uint32 thunkOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 20 00 00 00 00 00 ) // .. ..... + .get instance uint32 DIALib.IDiaSymbol5::get_thunkOrdinal() + } // end of property IDiaSymbol5::thunkOrdinal + .property int32 thisAdjust() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 21 00 00 00 00 00 ) // ..!..... + .get instance int32 DIALib.IDiaSymbol5::get_thisAdjust() + } // end of property IDiaSymbol5::thisAdjust + .property uint32 virtualBaseOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 22 00 00 00 00 00 ) // .."..... + .get instance uint32 DIALib.IDiaSymbol5::get_virtualBaseOffset() + } // end of property IDiaSymbol5::virtualBaseOffset + .property int32 'virtual'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 23 00 00 00 00 00 ) // ..#..... + .get instance int32 DIALib.IDiaSymbol5::get_virtual() + } // end of property IDiaSymbol5::'virtual' + .property int32 intro() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 24 00 00 00 00 00 ) // ..$..... + .get instance int32 DIALib.IDiaSymbol5::get_intro() + } // end of property IDiaSymbol5::intro + .property int32 pure() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 25 00 00 00 00 00 ) // ..%..... + .get instance int32 DIALib.IDiaSymbol5::get_pure() + } // end of property IDiaSymbol5::pure + .property uint32 callingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 26 00 00 00 00 00 ) // ..&..... + .get instance uint32 DIALib.IDiaSymbol5::get_callingConvention() + } // end of property IDiaSymbol5::callingConvention + .property object 'value'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 27 00 00 00 00 00 ) // ..'..... + .get instance object DIALib.IDiaSymbol5::get_value() + } // end of property IDiaSymbol5::'value' + .property uint32 baseType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 28 00 00 00 00 00 ) // ..(..... + .get instance uint32 DIALib.IDiaSymbol5::get_baseType() + } // end of property IDiaSymbol5::baseType + .property uint32 token() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 29 00 00 00 00 00 ) // ..)..... + .get instance uint32 DIALib.IDiaSymbol5::get_token() + } // end of property IDiaSymbol5::token + .property uint32 timeStamp() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2A 00 00 00 00 00 ) // ..*..... + .get instance uint32 DIALib.IDiaSymbol5::get_timeStamp() + } // end of property IDiaSymbol5::timeStamp + .property valuetype [mscorlib]System.Guid + guid() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2B 00 00 00 00 00 ) // ..+..... + .get instance valuetype [mscorlib]System.Guid DIALib.IDiaSymbol5::get_guid() + } // end of property IDiaSymbol5::guid + .property string symbolsFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2C 00 00 00 00 00 ) // ..,..... + .get instance string DIALib.IDiaSymbol5::get_symbolsFileName() + } // end of property IDiaSymbol5::symbolsFileName + .property int32 reference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2E 00 00 00 00 00 ) // ........ + .get instance int32 DIALib.IDiaSymbol5::get_reference() + } // end of property IDiaSymbol5::reference + .property uint32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2F 00 00 00 00 00 ) // ../..... + .get instance uint32 DIALib.IDiaSymbol5::get_count() + } // end of property IDiaSymbol5::count + .property uint32 bitPosition() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 31 00 00 00 00 00 ) // ..1..... + .get instance uint32 DIALib.IDiaSymbol5::get_bitPosition() + } // end of property IDiaSymbol5::bitPosition + .property class DIALib.IDiaSymbol arrayIndexType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 32 00 00 00 00 00 ) // ..2..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_arrayIndexType() + } // end of property IDiaSymbol5::arrayIndexType + .property int32 packed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 33 00 00 00 00 00 ) // ..3..... + .get instance int32 DIALib.IDiaSymbol5::get_packed() + } // end of property IDiaSymbol5::packed + .property int32 constructor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 34 00 00 00 00 00 ) // ..4..... + .get instance int32 DIALib.IDiaSymbol5::get_constructor() + } // end of property IDiaSymbol5::constructor + .property int32 overloadedOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 35 00 00 00 00 00 ) // ..5..... + .get instance int32 DIALib.IDiaSymbol5::get_overloadedOperator() + } // end of property IDiaSymbol5::overloadedOperator + .property int32 'nested'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 36 00 00 00 00 00 ) // ..6..... + .get instance int32 DIALib.IDiaSymbol5::get_nested() + } // end of property IDiaSymbol5::'nested' + .property int32 hasNestedTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 37 00 00 00 00 00 ) // ..7..... + .get instance int32 DIALib.IDiaSymbol5::get_hasNestedTypes() + } // end of property IDiaSymbol5::hasNestedTypes + .property int32 hasAssignmentOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 38 00 00 00 00 00 ) // ..8..... + .get instance int32 DIALib.IDiaSymbol5::get_hasAssignmentOperator() + } // end of property IDiaSymbol5::hasAssignmentOperator + .property int32 hasCastOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 39 00 00 00 00 00 ) // ..9..... + .get instance int32 DIALib.IDiaSymbol5::get_hasCastOperator() + } // end of property IDiaSymbol5::hasCastOperator + .property int32 scoped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3A 00 00 00 00 00 ) // ..:..... + .get instance int32 DIALib.IDiaSymbol5::get_scoped() + } // end of property IDiaSymbol5::scoped + .property int32 virtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3B 00 00 00 00 00 ) // ..;..... + .get instance int32 DIALib.IDiaSymbol5::get_virtualBaseClass() + } // end of property IDiaSymbol5::virtualBaseClass + .property int32 indirectVirtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3C 00 00 00 00 00 ) // ..<..... + .get instance int32 DIALib.IDiaSymbol5::get_indirectVirtualBaseClass() + } // end of property IDiaSymbol5::indirectVirtualBaseClass + .property int32 virtualBasePointerOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3D 00 00 00 00 00 ) // ..=..... + .get instance int32 DIALib.IDiaSymbol5::get_virtualBasePointerOffset() + } // end of property IDiaSymbol5::virtualBasePointerOffset + .property class DIALib.IDiaSymbol virtualTableShape() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3E 00 00 00 00 00 ) // ..>..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_virtualTableShape() + } // end of property IDiaSymbol5::virtualTableShape + .property uint32 lexicalParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 40 00 00 00 00 00 ) // ..@..... + .get instance uint32 DIALib.IDiaSymbol5::get_lexicalParentId() + } // end of property IDiaSymbol5::lexicalParentId + .property uint32 classParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 41 00 00 00 00 00 ) // ..A..... + .get instance uint32 DIALib.IDiaSymbol5::get_classParentId() + } // end of property IDiaSymbol5::classParentId + .property uint32 typeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 42 00 00 00 00 00 ) // ..B..... + .get instance uint32 DIALib.IDiaSymbol5::get_typeId() + } // end of property IDiaSymbol5::typeId + .property uint32 arrayIndexTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 43 00 00 00 00 00 ) // ..C..... + .get instance uint32 DIALib.IDiaSymbol5::get_arrayIndexTypeId() + } // end of property IDiaSymbol5::arrayIndexTypeId + .property uint32 virtualTableShapeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 44 00 00 00 00 00 ) // ..D..... + .get instance uint32 DIALib.IDiaSymbol5::get_virtualTableShapeId() + } // end of property IDiaSymbol5::virtualTableShapeId + .property int32 code() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 45 00 00 00 00 00 ) // ..E..... + .get instance int32 DIALib.IDiaSymbol5::get_code() + } // end of property IDiaSymbol5::code + .property int32 function() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 46 00 00 00 00 00 ) // ..F..... + .get instance int32 DIALib.IDiaSymbol5::get_function() + } // end of property IDiaSymbol5::function + .property int32 'managed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 47 00 00 00 00 00 ) // ..G..... + .get instance int32 DIALib.IDiaSymbol5::get_managed() + } // end of property IDiaSymbol5::'managed' + .property int32 msil() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 48 00 00 00 00 00 ) // ..H..... + .get instance int32 DIALib.IDiaSymbol5::get_msil() + } // end of property IDiaSymbol5::msil + .property uint32 virtualBaseDispIndex() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 49 00 00 00 00 00 ) // ..I..... + .get instance uint32 DIALib.IDiaSymbol5::get_virtualBaseDispIndex() + } // end of property IDiaSymbol5::virtualBaseDispIndex + .property string undecoratedName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4A 00 00 00 00 00 ) // ..J..... + .get instance string DIALib.IDiaSymbol5::get_undecoratedName() + } // end of property IDiaSymbol5::undecoratedName + .property uint32 age() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4B 00 00 00 00 00 ) // ..K..... + .get instance uint32 DIALib.IDiaSymbol5::get_age() + } // end of property IDiaSymbol5::age + .property uint32 signature() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4C 00 00 00 00 00 ) // ..L..... + .get instance uint32 DIALib.IDiaSymbol5::get_signature() + } // end of property IDiaSymbol5::signature + .property int32 compilerGenerated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4D 00 00 00 00 00 ) // ..M..... + .get instance int32 DIALib.IDiaSymbol5::get_compilerGenerated() + } // end of property IDiaSymbol5::compilerGenerated + .property int32 addressTaken() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4E 00 00 00 00 00 ) // ..N..... + .get instance int32 DIALib.IDiaSymbol5::get_addressTaken() + } // end of property IDiaSymbol5::addressTaken + .property uint32 rank() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4F 00 00 00 00 00 ) // ..O..... + .get instance uint32 DIALib.IDiaSymbol5::get_rank() + } // end of property IDiaSymbol5::rank + .property class DIALib.IDiaSymbol lowerBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 50 00 00 00 00 00 ) // ..P..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_lowerBound() + } // end of property IDiaSymbol5::lowerBound + .property class DIALib.IDiaSymbol upperBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 51 00 00 00 00 00 ) // ..Q..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_upperBound() + } // end of property IDiaSymbol5::upperBound + .property uint32 lowerBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 52 00 00 00 00 00 ) // ..R..... + .get instance uint32 DIALib.IDiaSymbol5::get_lowerBoundId() + } // end of property IDiaSymbol5::lowerBoundId + .property uint32 upperBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 53 00 00 00 00 00 ) // ..S..... + .get instance uint32 DIALib.IDiaSymbol5::get_upperBoundId() + } // end of property IDiaSymbol5::upperBoundId + .property uint32 targetSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 54 00 00 00 00 00 ) // ..T..... + .get instance uint32 DIALib.IDiaSymbol5::get_targetSection() + } // end of property IDiaSymbol5::targetSection + .property uint32 targetOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 55 00 00 00 00 00 ) // ..U..... + .get instance uint32 DIALib.IDiaSymbol5::get_targetOffset() + } // end of property IDiaSymbol5::targetOffset + .property uint32 targetRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 56 00 00 00 00 00 ) // ..V..... + .get instance uint32 DIALib.IDiaSymbol5::get_targetRelativeVirtualAddress() + } // end of property IDiaSymbol5::targetRelativeVirtualAddress + .property uint64 targetVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 57 00 00 00 00 00 ) // ..W..... + .get instance uint64 DIALib.IDiaSymbol5::get_targetVirtualAddress() + } // end of property IDiaSymbol5::targetVirtualAddress + .property uint32 machineType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 58 00 00 00 00 00 ) // ..X..... + .get instance uint32 DIALib.IDiaSymbol5::get_machineType() + } // end of property IDiaSymbol5::machineType + .property uint32 oemId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 59 00 00 00 00 00 ) // ..Y..... + .get instance uint32 DIALib.IDiaSymbol5::get_oemId() + } // end of property IDiaSymbol5::oemId + .property uint32 oemSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5A 00 00 00 00 00 ) // ..Z..... + .get instance uint32 DIALib.IDiaSymbol5::get_oemSymbolId() + } // end of property IDiaSymbol5::oemSymbolId + .property class DIALib.IDiaSymbol objectPointerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5B 00 00 00 00 00 ) // ..[..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_objectPointerType() + } // end of property IDiaSymbol5::objectPointerType + .property uint32 udtKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5C 00 00 00 00 00 ) // ..\..... + .get instance uint32 DIALib.IDiaSymbol5::get_udtKind() + } // end of property IDiaSymbol5::udtKind + .property int32 noReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5D 00 00 00 00 00 ) // ..]..... + .get instance int32 DIALib.IDiaSymbol5::get_noReturn() + } // end of property IDiaSymbol5::noReturn + .property int32 customCallingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5E 00 00 00 00 00 ) // ..^..... + .get instance int32 DIALib.IDiaSymbol5::get_customCallingConvention() + } // end of property IDiaSymbol5::customCallingConvention + .property int32 noInline() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5F 00 00 00 00 00 ) // .._..... + .get instance int32 DIALib.IDiaSymbol5::get_noInline() + } // end of property IDiaSymbol5::noInline + .property int32 optimizedCodeDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 60 00 00 00 00 00 ) // ..`..... + .get instance int32 DIALib.IDiaSymbol5::get_optimizedCodeDebugInfo() + } // end of property IDiaSymbol5::optimizedCodeDebugInfo + .property int32 notReached() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 61 00 00 00 00 00 ) // ..a..... + .get instance int32 DIALib.IDiaSymbol5::get_notReached() + } // end of property IDiaSymbol5::notReached + .property int32 interruptReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 62 00 00 00 00 00 ) // ..b..... + .get instance int32 DIALib.IDiaSymbol5::get_interruptReturn() + } // end of property IDiaSymbol5::interruptReturn + .property int32 farReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 63 00 00 00 00 00 ) // ..c..... + .get instance int32 DIALib.IDiaSymbol5::get_farReturn() + } // end of property IDiaSymbol5::farReturn + .property int32 isStatic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 64 00 00 00 00 00 ) // ..d..... + .get instance int32 DIALib.IDiaSymbol5::get_isStatic() + } // end of property IDiaSymbol5::isStatic + .property int32 hasDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 65 00 00 00 00 00 ) // ..e..... + .get instance int32 DIALib.IDiaSymbol5::get_hasDebugInfo() + } // end of property IDiaSymbol5::hasDebugInfo + .property int32 isLTCG() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 66 00 00 00 00 00 ) // ..f..... + .get instance int32 DIALib.IDiaSymbol5::get_isLTCG() + } // end of property IDiaSymbol5::isLTCG + .property int32 isDataAligned() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 67 00 00 00 00 00 ) // ..g..... + .get instance int32 DIALib.IDiaSymbol5::get_isDataAligned() + } // end of property IDiaSymbol5::isDataAligned + .property int32 hasSecurityChecks() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 68 00 00 00 00 00 ) // ..h..... + .get instance int32 DIALib.IDiaSymbol5::get_hasSecurityChecks() + } // end of property IDiaSymbol5::hasSecurityChecks + .property string compilerName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 69 00 00 00 00 00 ) // ..i..... + .get instance string DIALib.IDiaSymbol5::get_compilerName() + } // end of property IDiaSymbol5::compilerName + .property int32 hasAlloca() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6A 00 00 00 00 00 ) // ..j..... + .get instance int32 DIALib.IDiaSymbol5::get_hasAlloca() + } // end of property IDiaSymbol5::hasAlloca + .property int32 hasSetJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6B 00 00 00 00 00 ) // ..k..... + .get instance int32 DIALib.IDiaSymbol5::get_hasSetJump() + } // end of property IDiaSymbol5::hasSetJump + .property int32 hasLongJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6C 00 00 00 00 00 ) // ..l..... + .get instance int32 DIALib.IDiaSymbol5::get_hasLongJump() + } // end of property IDiaSymbol5::hasLongJump + .property int32 hasInlAsm() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6D 00 00 00 00 00 ) // ..m..... + .get instance int32 DIALib.IDiaSymbol5::get_hasInlAsm() + } // end of property IDiaSymbol5::hasInlAsm + .property int32 hasEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6E 00 00 00 00 00 ) // ..n..... + .get instance int32 DIALib.IDiaSymbol5::get_hasEH() + } // end of property IDiaSymbol5::hasEH + .property int32 hasSEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6F 00 00 00 00 00 ) // ..o..... + .get instance int32 DIALib.IDiaSymbol5::get_hasSEH() + } // end of property IDiaSymbol5::hasSEH + .property int32 hasEHa() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 70 00 00 00 00 00 ) // ..p..... + .get instance int32 DIALib.IDiaSymbol5::get_hasEHa() + } // end of property IDiaSymbol5::hasEHa + .property int32 isNaked() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 71 00 00 00 00 00 ) // ..q..... + .get instance int32 DIALib.IDiaSymbol5::get_isNaked() + } // end of property IDiaSymbol5::isNaked + .property int32 isAggregated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 72 00 00 00 00 00 ) // ..r..... + .get instance int32 DIALib.IDiaSymbol5::get_isAggregated() + } // end of property IDiaSymbol5::isAggregated + .property int32 isSplitted() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 73 00 00 00 00 00 ) // ..s..... + .get instance int32 DIALib.IDiaSymbol5::get_isSplitted() + } // end of property IDiaSymbol5::isSplitted + .property class DIALib.IDiaSymbol container() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 74 00 00 00 00 00 ) // ..t..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_container() + } // end of property IDiaSymbol5::container + .property int32 inlSpec() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 75 00 00 00 00 00 ) // ..u..... + .get instance int32 DIALib.IDiaSymbol5::get_inlSpec() + } // end of property IDiaSymbol5::inlSpec + .property int32 noStackOrdering() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 76 00 00 00 00 00 ) // ..v..... + .get instance int32 DIALib.IDiaSymbol5::get_noStackOrdering() + } // end of property IDiaSymbol5::noStackOrdering + .property class DIALib.IDiaSymbol virtualBaseTableType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 77 00 00 00 00 00 ) // ..w..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_virtualBaseTableType() + } // end of property IDiaSymbol5::virtualBaseTableType + .property int32 hasManagedCode() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 78 00 00 00 00 00 ) // ..x..... + .get instance int32 DIALib.IDiaSymbol5::get_hasManagedCode() + } // end of property IDiaSymbol5::hasManagedCode + .property int32 isHotpatchable() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 79 00 00 00 00 00 ) // ..y..... + .get instance int32 DIALib.IDiaSymbol5::get_isHotpatchable() + } // end of property IDiaSymbol5::isHotpatchable + .property int32 isCVTCIL() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7A 00 00 00 00 00 ) // ..z..... + .get instance int32 DIALib.IDiaSymbol5::get_isCVTCIL() + } // end of property IDiaSymbol5::isCVTCIL + .property int32 isMSILNetmodule() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7B 00 00 00 00 00 ) // ..{..... + .get instance int32 DIALib.IDiaSymbol5::get_isMSILNetmodule() + } // end of property IDiaSymbol5::isMSILNetmodule + .property int32 isCTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7C 00 00 00 00 00 ) // ..|..... + .get instance int32 DIALib.IDiaSymbol5::get_isCTypes() + } // end of property IDiaSymbol5::isCTypes + .property int32 isStripped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7D 00 00 00 00 00 ) // ..}..... + .get instance int32 DIALib.IDiaSymbol5::get_isStripped() + } // end of property IDiaSymbol5::isStripped + .property uint32 frontEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7E 00 00 00 00 00 ) // ..~..... + .get instance uint32 DIALib.IDiaSymbol5::get_frontEndQFE() + } // end of property IDiaSymbol5::frontEndQFE + .property uint32 backEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_backEndQFE() + } // end of property IDiaSymbol5::backEndQFE + .property int32 wasInlined() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 80 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_wasInlined() + } // end of property IDiaSymbol5::wasInlined + .property int32 strictGSCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 81 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_strictGSCheck() + } // end of property IDiaSymbol5::strictGSCheck + .property int32 isCxxReturnUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 82 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isCxxReturnUdt() + } // end of property IDiaSymbol5::isCxxReturnUdt + .property int32 isConstructorVirtualBase() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 83 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isConstructorVirtualBase() + } // end of property IDiaSymbol5::isConstructorVirtualBase + .property int32 RValueReference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 84 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_RValueReference() + } // end of property IDiaSymbol5::RValueReference + .property class DIALib.IDiaSymbol unmodifiedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 85 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_unmodifiedType() + } // end of property IDiaSymbol5::unmodifiedType + .property int32 framePointerPresent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 86 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_framePointerPresent() + } // end of property IDiaSymbol5::framePointerPresent + .property int32 isSafeBuffers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 87 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isSafeBuffers() + } // end of property IDiaSymbol5::isSafeBuffers + .property int32 intrinsic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 88 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_intrinsic() + } // end of property IDiaSymbol5::intrinsic + .property int32 'sealed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 89 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_sealed() + } // end of property IDiaSymbol5::'sealed' + .property int32 hfaFloat() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_hfaFloat() + } // end of property IDiaSymbol5::hfaFloat + .property int32 hfaDouble() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8B 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_hfaDouble() + } // end of property IDiaSymbol5::hfaDouble + .property uint32 liveRangeStartAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_liveRangeStartAddressSection() + } // end of property IDiaSymbol5::liveRangeStartAddressSection + .property uint32 liveRangeStartAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_liveRangeStartAddressOffset() + } // end of property IDiaSymbol5::liveRangeStartAddressOffset + .property uint32 liveRangeStartRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_liveRangeStartRelativeVirtualAddress() + } // end of property IDiaSymbol5::liveRangeStartRelativeVirtualAddress + .property uint32 countLiveRanges() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_countLiveRanges() + } // end of property IDiaSymbol5::countLiveRanges + .property uint64 liveRangeLength() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 90 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol5::get_liveRangeLength() + } // end of property IDiaSymbol5::liveRangeLength + .property uint32 offsetInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 91 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_offsetInUdt() + } // end of property IDiaSymbol5::offsetInUdt + .property uint32 paramBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 92 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_paramBasePointerRegisterId() + } // end of property IDiaSymbol5::paramBasePointerRegisterId + .property uint32 localBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 93 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_localBasePointerRegisterId() + } // end of property IDiaSymbol5::localBasePointerRegisterId + .property int32 isLocationControlFlowDependent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 94 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isLocationControlFlowDependent() + } // end of property IDiaSymbol5::isLocationControlFlowDependent + .property uint32 stride() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 95 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_stride() + } // end of property IDiaSymbol5::stride + .property uint32 numberOfRows() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 96 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_numberOfRows() + } // end of property IDiaSymbol5::numberOfRows + .property uint32 numberOfColumns() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 97 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_numberOfColumns() + } // end of property IDiaSymbol5::numberOfColumns + .property int32 isMatrixRowMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 98 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isMatrixRowMajor() + } // end of property IDiaSymbol5::isMatrixRowMajor + .property int32 isReturnValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 99 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isReturnValue() + } // end of property IDiaSymbol5::isReturnValue + .property int32 isOptimizedAway() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isOptimizedAway() + } // end of property IDiaSymbol5::isOptimizedAway + .property uint32 builtInKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_builtInKind() + } // end of property IDiaSymbol5::builtInKind + .property uint32 registerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_registerType() + } // end of property IDiaSymbol5::registerType + .property uint32 baseDataSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_baseDataSlot() + } // end of property IDiaSymbol5::baseDataSlot + .property uint32 baseDataOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_baseDataOffset() + } // end of property IDiaSymbol5::baseDataOffset + .property uint32 textureSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_textureSlot() + } // end of property IDiaSymbol5::textureSlot + .property uint32 samplerSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_samplerSlot() + } // end of property IDiaSymbol5::samplerSlot + .property uint32 uavSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_uavSlot() + } // end of property IDiaSymbol5::uavSlot + .property uint32 sizeInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_sizeInUdt() + } // end of property IDiaSymbol5::sizeInUdt + .property uint32 memorySpaceKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_memorySpaceKind() + } // end of property IDiaSymbol5::memorySpaceKind + .property uint32 unmodifiedTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_unmodifiedTypeId() + } // end of property IDiaSymbol5::unmodifiedTypeId + .property uint32 subTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_subTypeId() + } // end of property IDiaSymbol5::subTypeId + .property class DIALib.IDiaSymbol subType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A6 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_subType() + } // end of property IDiaSymbol5::subType + .property uint32 numberOfModifiers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_numberOfModifiers() + } // end of property IDiaSymbol5::numberOfModifiers + .property uint32 numberOfRegisterIndices() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A8 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_numberOfRegisterIndices() + } // end of property IDiaSymbol5::numberOfRegisterIndices + .property int32 isHLSLData() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isHLSLData() + } // end of property IDiaSymbol5::isHLSLData + .property int32 isPointerToDataMember() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isPointerToDataMember() + } // end of property IDiaSymbol5::isPointerToDataMember + .property int32 isPointerToMemberFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isPointerToMemberFunction() + } // end of property IDiaSymbol5::isPointerToMemberFunction + .property int32 isSingleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isSingleInheritance() + } // end of property IDiaSymbol5::isSingleInheritance + .property int32 isMultipleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isMultipleInheritance() + } // end of property IDiaSymbol5::isMultipleInheritance + .property int32 isVirtualInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isVirtualInheritance() + } // end of property IDiaSymbol5::isVirtualInheritance + .property int32 restrictedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_restrictedType() + } // end of property IDiaSymbol5::restrictedType + .property int32 isPointerBasedOnSymbolValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B0 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isPointerBasedOnSymbolValue() + } // end of property IDiaSymbol5::isPointerBasedOnSymbolValue + .property class DIALib.IDiaSymbol baseSymbol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B1 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_baseSymbol() + } // end of property IDiaSymbol5::baseSymbol + .property uint32 baseSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_baseSymbolId() + } // end of property IDiaSymbol5::baseSymbolId + .property string objectFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B3 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol5::get_objectFileName() + } // end of property IDiaSymbol5::objectFileName + .property int32 isAcceleratorGroupSharedLocal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B4 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isAcceleratorGroupSharedLocal() + } // end of property IDiaSymbol5::isAcceleratorGroupSharedLocal + .property int32 isAcceleratorPointerTagLiveRange() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B5 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isAcceleratorPointerTagLiveRange() + } // end of property IDiaSymbol5::isAcceleratorPointerTagLiveRange + .property int32 isAcceleratorStubFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isAcceleratorStubFunction() + } // end of property IDiaSymbol5::isAcceleratorStubFunction + .property uint32 numberOfAcceleratorPointerTags() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_numberOfAcceleratorPointerTags() + } // end of property IDiaSymbol5::numberOfAcceleratorPointerTags + .property int32 isSdl() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isSdl() + } // end of property IDiaSymbol5::isSdl + .property int32 isWinRTPointer() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isWinRTPointer() + } // end of property IDiaSymbol5::isWinRTPointer + .property int32 isRefUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isRefUdt() + } // end of property IDiaSymbol5::isRefUdt + .property int32 isValueUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isValueUdt() + } // end of property IDiaSymbol5::isValueUdt + .property int32 isInterfaceUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isInterfaceUdt() + } // end of property IDiaSymbol5::isInterfaceUdt + .property int32 isPGO() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isPGO() + } // end of property IDiaSymbol5::isPGO + .property int32 hasValidPGOCounts() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_hasValidPGOCounts() + } // end of property IDiaSymbol5::hasValidPGOCounts + .property int32 isOptimizedForSpeed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isOptimizedForSpeed() + } // end of property IDiaSymbol5::isOptimizedForSpeed + .property uint32 PGOEntryCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_PGOEntryCount() + } // end of property IDiaSymbol5::PGOEntryCount + .property uint32 PGOEdgeCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_PGOEdgeCount() + } // end of property IDiaSymbol5::PGOEdgeCount + .property uint64 PGODynamicInstructionCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol5::get_PGODynamicInstructionCount() + } // end of property IDiaSymbol5::PGODynamicInstructionCount + .property uint32 staticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_staticSize() + } // end of property IDiaSymbol5::staticSize + .property uint32 finalLiveStaticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_finalLiveStaticSize() + } // end of property IDiaSymbol5::finalLiveStaticSize + .property string phaseName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C5 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol5::get_phaseName() + } // end of property IDiaSymbol5::phaseName + .property int32 hasControlFlowCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_hasControlFlowCheck() + } // end of property IDiaSymbol5::hasControlFlowCheck + .property int32 constantExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C7 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_constantExport() + } // end of property IDiaSymbol5::constantExport + .property int32 dataExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_dataExport() + } // end of property IDiaSymbol5::dataExport + .property int32 privateExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_privateExport() + } // end of property IDiaSymbol5::privateExport + .property int32 noNameExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_noNameExport() + } // end of property IDiaSymbol5::noNameExport + .property int32 exportHasExplicitlyAssignedOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_exportHasExplicitlyAssignedOrdinal() + } // end of property IDiaSymbol5::exportHasExplicitlyAssignedOrdinal + .property int32 exportIsForwarder() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_exportIsForwarder() + } // end of property IDiaSymbol5::exportIsForwarder + .property uint32 ordinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CD 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_ordinal() + } // end of property IDiaSymbol5::ordinal + .property uint32 frameSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CE 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_frameSize() + } // end of property IDiaSymbol5::frameSize + .property uint32 exceptionHandlerAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CF 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_exceptionHandlerAddressSection() + } // end of property IDiaSymbol5::exceptionHandlerAddressSection + .property uint32 exceptionHandlerAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_exceptionHandlerAddressOffset() + } // end of property IDiaSymbol5::exceptionHandlerAddressOffset + .property uint32 exceptionHandlerRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_exceptionHandlerRelativeVirtualAddress() + } // end of property IDiaSymbol5::exceptionHandlerRelativeVirtualAddress + .property uint64 exceptionHandlerVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol5::get_exceptionHandlerVirtualAddress() + } // end of property IDiaSymbol5::exceptionHandlerVirtualAddress + .property uint32 characteristics() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_characteristics() + } // end of property IDiaSymbol5::characteristics + .property class DIALib.IDiaSymbol coffGroup() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D4 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_coffGroup() + } // end of property IDiaSymbol5::coffGroup + .property uint32 bindID() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_bindID() + } // end of property IDiaSymbol5::bindID + .property uint32 bindSpace() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D6 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_bindSpace() + } // end of property IDiaSymbol5::bindSpace + .property uint32 bindSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_bindSlot() + } // end of property IDiaSymbol5::bindSlot + .property int32 isObjCClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isObjCClass() + } // end of property IDiaSymbol5::isObjCClass + .property int32 isObjCCategory() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isObjCCategory() + } // end of property IDiaSymbol5::isObjCCategory + .property int32 isObjCProtocol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_isObjCProtocol() + } // end of property IDiaSymbol5::isObjCProtocol + .property class DIALib.IDiaSymbol inlinee() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DB 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol5::get_inlinee() + } // end of property IDiaSymbol5::inlinee + .property uint32 inlineeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DC 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol5::get_inlineeId() + } // end of property IDiaSymbol5::inlineeId + .property int32 noexcept() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_noexcept() + } // end of property IDiaSymbol5::noexcept + .property int32 hasAbsoluteAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol5::get_hasAbsoluteAddress() + } // end of property IDiaSymbol5::hasAbsoluteAddress +} // end of class DIALib.IDiaSymbol5 + +.class interface public abstract auto ansi import DIALib.IDiaSymbol6 + implements DIALib.IDiaSymbol5 +{ + .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(valuetype [mscorlib]System.Runtime.InteropServices.ComInterfaceType) = ( 01 00 01 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 38 31 33 33 44 41 44 33 2D 37 35 46 45 // ..$8133DAD3-75FE + 2D 34 32 33 34 2D 41 43 37 45 2D 46 38 45 37 41 // -4234-AC7E-F8E7A + 31 44 33 43 42 42 33 00 00 ) // 1D3CBB3.. + .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 0A 73 79 6D 49 6E 64 65 78 49 64 00 00 ) // ...symIndexId.. + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symIndexId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_symIndexId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_symTag() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_symTag + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_name() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_name + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lexicalParent() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_lexicalParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_classParent() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_classParent + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_type() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_type + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_dataKind() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_dataKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_locationType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_locationType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressSection() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_addressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_addressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_addressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_relativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_relativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_virtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_registerId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_offset() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_offset + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_length() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_length + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_slot() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_slot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_volatileType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_volatileType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_constType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_unalignedType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_unalignedType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_access() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_access + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_libraryName() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_libraryName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_platform() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_platform + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_language() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_language + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_editAndContinueEnabled() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_editAndContinueEnabled + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_frontEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_frontEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_frontEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMajor() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_backEndMajor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndMinor() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_backEndMinor + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndBuild() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_backEndBuild + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_sourceFileName() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_sourceFileName + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_unused() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_unused + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_thunkOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_thunkOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_thisAdjust() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_thisAdjust + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseOffset() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtualBaseOffset + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtual() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtual + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intro() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_intro + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_pure() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_pure + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_callingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_callingConvention + + .method public hidebysig newslot specialname abstract virtual + instance object + marshal( struct) + get_value() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_value + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_baseType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_token() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_token + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_timeStamp() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_timeStamp + + .method public hidebysig newslot specialname abstract virtual + instance valuetype [mscorlib]System.Guid + get_guid() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_guid + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_symbolsFileName() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_symbolsFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_reference() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_reference + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_count() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_count + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bitPosition() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_bitPosition + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_arrayIndexType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_arrayIndexType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_packed() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_packed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constructor() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_constructor + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_overloadedOperator() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_overloadedOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_nested() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_nested + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasNestedTypes() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasNestedTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAssignmentOperator() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasAssignmentOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasCastOperator() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasCastOperator + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_scoped() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_scoped + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_indirectVirtualBaseClass() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_indirectVirtualBaseClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_virtualBasePointerOffset() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtualBasePointerOffset + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualTableShape() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtualTableShape + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lexicalParentId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_lexicalParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_classParentId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_classParentId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_typeId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_typeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_arrayIndexTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_arrayIndexTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualTableShapeId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtualTableShapeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_code() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_code + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_function() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_function + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_managed() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_managed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_msil() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_msil + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_virtualBaseDispIndex() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtualBaseDispIndex + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_undecoratedName() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_undecoratedName + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_age() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_age + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_signature() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_signature + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_compilerGenerated() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_compilerGenerated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_addressTaken() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_addressTaken + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_rank() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_rank + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_lowerBound() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_lowerBound + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_upperBound() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_upperBound + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_lowerBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_lowerBoundId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_upperBoundId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_upperBoundId + + .method public hidebysig newslot abstract virtual + instance void get_dataBytes([in] uint32 cbData, + [out] uint32& pcbData, + [out] uint8& pbData) runtime managed internalcall + { + } // end of method IDiaSymbol6::get_dataBytes + + .method public hidebysig newslot abstract virtual + instance void findChildren([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findChildren + + .method public hidebysig newslot abstract virtual + instance void findChildrenEx([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findChildrenEx + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByAddr([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findChildrenExByAddr + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findChildrenExByVA + + .method public hidebysig newslot abstract virtual + instance void findChildrenExByRVA([in] valuetype DIALib.SymTagEnum symTag, + [in] string marshal( lpwstr) name, + [in] uint32 compareFlags, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findChildrenExByRVA + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetSection() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_targetSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetOffset() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_targetOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_targetRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_targetRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_targetVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_targetVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_machineType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_machineType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_oemId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_oemSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_oemSymbolId + + .method public hidebysig newslot abstract virtual + instance void get_types([in] uint32 cTypes, + [out] uint32& pcTypes, + [out] class DIALib.IDiaSymbol& marshal( interface ) pTypes) runtime managed internalcall + { + } // end of method IDiaSymbol6::get_types + + .method public hidebysig newslot abstract virtual + instance void get_typeIds([in] uint32 cTypeIds, + [out] uint32& pcTypeIds, + [out] uint32& pdwTypeIds) runtime managed internalcall + { + } // end of method IDiaSymbol6::get_typeIds + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_objectPointerType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_objectPointerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_udtKind() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_udtKind + + .method public hidebysig newslot abstract virtual + instance void get_undecoratedNameEx([in] uint32 undecorateOptions, + [out] string& marshal( bstr) name) runtime managed internalcall + { + } // end of method IDiaSymbol6::get_undecoratedNameEx + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noReturn() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_noReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_customCallingConvention() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_customCallingConvention + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noInline() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_noInline + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_optimizedCodeDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_optimizedCodeDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_notReached() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_notReached + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_interruptReturn() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_interruptReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_farReturn() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_farReturn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStatic() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isStatic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasDebugInfo() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasDebugInfo + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLTCG() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isLTCG + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isDataAligned() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isDataAligned + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSecurityChecks() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasSecurityChecks + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_compilerName() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_compilerName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAlloca() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasAlloca + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSetJump() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasSetJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasLongJump() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasLongJump + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasInlAsm() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasInlAsm + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEH() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasSEH() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasSEH + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasEHa() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasEHa + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isNaked() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isNaked + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAggregated() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isAggregated + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSplitted() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isSplitted + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_container() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_container + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_inlSpec() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_inlSpec + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noStackOrdering() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_noStackOrdering + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_virtualBaseTableType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_virtualBaseTableType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasManagedCode() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasManagedCode + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHotpatchable() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isHotpatchable + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCVTCIL() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isCVTCIL + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMSILNetmodule() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isMSILNetmodule + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCTypes() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isCTypes + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStripped() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isStripped + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frontEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_frontEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_backEndQFE() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_backEndQFE + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_wasInlined() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_wasInlined + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_strictGSCheck() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_strictGSCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isCxxReturnUdt() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isCxxReturnUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isConstructorVirtualBase() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isConstructorVirtualBase + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_RValueReference() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_RValueReference + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_unmodifiedType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_unmodifiedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_framePointerPresent() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_framePointerPresent + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSafeBuffers() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isSafeBuffers + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_intrinsic() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_intrinsic + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_sealed() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_sealed + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaFloat() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hfaFloat + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hfaDouble() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hfaDouble + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_liveRangeStartAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_liveRangeStartAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_liveRangeStartRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_liveRangeStartRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_countLiveRanges() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_countLiveRanges + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_liveRangeLength() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_liveRangeLength + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_offsetInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_offsetInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_paramBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_paramBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_localBasePointerRegisterId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_localBasePointerRegisterId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isLocationControlFlowDependent() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isLocationControlFlowDependent + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_stride() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_stride + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRows() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_numberOfRows + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfColumns() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_numberOfColumns + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMatrixRowMajor() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isMatrixRowMajor + + .method public hidebysig newslot abstract virtual + instance void get_numericProperties([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pProperties) runtime managed internalcall + { + } // end of method IDiaSymbol6::get_numericProperties + + .method public hidebysig newslot abstract virtual + instance void get_modifierValues([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint16& pModifiers) runtime managed internalcall + { + } // end of method IDiaSymbol6::get_modifierValues + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isReturnValue() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isReturnValue + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedAway() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isOptimizedAway + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_builtInKind() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_builtInKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_registerType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_registerType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataSlot() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_baseDataSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseDataOffset() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_baseDataOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_textureSlot() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_textureSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_samplerSlot() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_samplerSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_uavSlot() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_uavSlot + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_sizeInUdt() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_sizeInUdt + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_memorySpaceKind() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_memorySpaceKind + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_unmodifiedTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_unmodifiedTypeId + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_subTypeId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_subTypeId + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_subType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_subType + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfModifiers() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_numberOfModifiers + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfRegisterIndices() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_numberOfRegisterIndices + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isHLSLData() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isHLSLData + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToDataMember() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isPointerToDataMember + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerToMemberFunction() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isPointerToMemberFunction + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSingleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isSingleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isMultipleInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isMultipleInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isVirtualInheritance() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isVirtualInheritance + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_restrictedType() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_restrictedType + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPointerBasedOnSymbolValue() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isPointerBasedOnSymbolValue + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_baseSymbol() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_baseSymbol + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_baseSymbolId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_baseSymbolId + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_objectFileName() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_objectFileName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorGroupSharedLocal() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isAcceleratorGroupSharedLocal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorPointerTagLiveRange() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isAcceleratorPointerTagLiveRange + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isAcceleratorStubFunction() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isAcceleratorStubFunction + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_numberOfAcceleratorPointerTags() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_numberOfAcceleratorPointerTags + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isSdl() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isSdl + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isWinRTPointer() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isWinRTPointer + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isRefUdt() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isRefUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isValueUdt() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isValueUdt + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isInterfaceUdt() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isInterfaceUdt + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByAddr([in] uint32 isect, + [in] uint32 offset, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findInlineFramesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByRVA([in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findInlineFramesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineFramesByVA([in] uint64 va, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findInlineFramesByVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLines([out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findInlineeLines + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByAddr([in] uint32 isect, + [in] uint32 offset, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findInlineeLinesByAddr + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByRVA([in] uint32 rva, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findInlineeLinesByRVA + + .method public hidebysig newslot abstract virtual + instance void findInlineeLinesByVA([in] uint64 va, + [in] uint32 length, + [out] class DIALib.IDiaEnumLineNumbers& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findInlineeLinesByVA + + .method public hidebysig newslot abstract virtual + instance void findSymbolsForAcceleratorPointerTag([in] uint32 tagValue, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findSymbolsForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void findSymbolsByRVAForAcceleratorPointerTag([in] uint32 tagValue, + [in] uint32 rva, + [out] class DIALib.IDiaEnumSymbols& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findSymbolsByRVAForAcceleratorPointerTag + + .method public hidebysig newslot abstract virtual + instance void get_acceleratorPointerTags([in] uint32 cnt, + [out] uint32& pcnt, + [out] uint32& pPointerTags) runtime managed internalcall + { + } // end of method IDiaSymbol6::get_acceleratorPointerTags + + .method public hidebysig newslot abstract virtual + instance void getSrcLineOnTypeDefn([out] class DIALib.IDiaLineNumber& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::getSrcLineOnTypeDefn + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isPGO() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isPGO + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasValidPGOCounts() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasValidPGOCounts + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isOptimizedForSpeed() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isOptimizedForSpeed + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEntryCount() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_PGOEntryCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_PGOEdgeCount() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_PGOEdgeCount + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_PGODynamicInstructionCount() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_PGODynamicInstructionCount + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_staticSize() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_staticSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_finalLiveStaticSize() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_finalLiveStaticSize + + .method public hidebysig newslot specialname abstract virtual + instance string + marshal( bstr) + get_phaseName() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_phaseName + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasControlFlowCheck() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasControlFlowCheck + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_constantExport() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_constantExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_dataExport() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_dataExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_privateExport() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_privateExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noNameExport() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_noNameExport + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportHasExplicitlyAssignedOrdinal() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_exportHasExplicitlyAssignedOrdinal + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_exportIsForwarder() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_exportIsForwarder + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_ordinal() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_ordinal + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_frameSize() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_frameSize + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressSection() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_exceptionHandlerAddressSection + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerAddressOffset() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_exceptionHandlerAddressOffset + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_exceptionHandlerRelativeVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_exceptionHandlerRelativeVirtualAddress + + .method public hidebysig newslot specialname abstract virtual + instance uint64 get_exceptionHandlerVirtualAddress() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_exceptionHandlerVirtualAddress + + .method public hidebysig newslot abstract virtual + instance void findInputAssemblyFile([out] class DIALib.IDiaInputAssemblyFile& marshal( interface ) ppResult) runtime managed internalcall + { + } // end of method IDiaSymbol6::findInputAssemblyFile + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_characteristics() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_characteristics + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_coffGroup() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_coffGroup + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindID() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_bindID + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSpace() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_bindSpace + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_bindSlot() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_bindSlot + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCClass() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isObjCClass + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCCategory() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isObjCCategory + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isObjCProtocol() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isObjCProtocol + + .method public hidebysig newslot specialname abstract virtual + instance class DIALib.IDiaSymbol + marshal( interface ) + get_inlinee() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_inlinee + + .method public hidebysig newslot specialname abstract virtual + instance uint32 get_inlineeId() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_inlineeId + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_noexcept() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_noexcept + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_hasAbsoluteAddress() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_hasAbsoluteAddress + + .method public hidebysig newslot specialname abstract virtual + instance int32 get_isStaticMemberFunc() runtime managed internalcall + { + } // end of method IDiaSymbol6::get_isStaticMemberFunc + + .property uint32 symIndexId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 00 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_symIndexId() + } // end of property IDiaSymbol6::symIndexId + .property uint32 symTag() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 01 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_symTag() + } // end of property IDiaSymbol6::symTag + .property string name() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 02 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol6::get_name() + } // end of property IDiaSymbol6::name + .property class DIALib.IDiaSymbol lexicalParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 03 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_lexicalParent() + } // end of property IDiaSymbol6::lexicalParent + .property class DIALib.IDiaSymbol classParent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 04 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_classParent() + } // end of property IDiaSymbol6::classParent + .property class DIALib.IDiaSymbol 'type'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 05 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_type() + } // end of property IDiaSymbol6::'type' + .property uint32 dataKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 06 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_dataKind() + } // end of property IDiaSymbol6::dataKind + .property uint32 locationType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 07 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_locationType() + } // end of property IDiaSymbol6::locationType + .property uint32 addressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_addressSection() + } // end of property IDiaSymbol6::addressSection + .property uint32 addressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 09 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_addressOffset() + } // end of property IDiaSymbol6::addressOffset + .property uint32 relativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_relativeVirtualAddress() + } // end of property IDiaSymbol6::relativeVirtualAddress + .property uint64 virtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0B 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol6::get_virtualAddress() + } // end of property IDiaSymbol6::virtualAddress + .property uint32 registerId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_registerId() + } // end of property IDiaSymbol6::registerId + .property int32 offset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0D 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_offset() + } // end of property IDiaSymbol6::offset + .property uint64 length() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0E 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol6::get_length() + } // end of property IDiaSymbol6::length + .property uint32 slot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 0F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_slot() + } // end of property IDiaSymbol6::slot + .property int32 volatileType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 10 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_volatileType() + } // end of property IDiaSymbol6::volatileType + .property int32 constType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 11 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_constType() + } // end of property IDiaSymbol6::constType + .property int32 unalignedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 12 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_unalignedType() + } // end of property IDiaSymbol6::unalignedType + .property uint32 access() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 13 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_access() + } // end of property IDiaSymbol6::access + .property string libraryName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 14 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol6::get_libraryName() + } // end of property IDiaSymbol6::libraryName + .property uint32 platform() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 15 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_platform() + } // end of property IDiaSymbol6::platform + .property uint32 language() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 16 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_language() + } // end of property IDiaSymbol6::language + .property int32 editAndContinueEnabled() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 17 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_editAndContinueEnabled() + } // end of property IDiaSymbol6::editAndContinueEnabled + .property uint32 frontEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 18 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_frontEndMajor() + } // end of property IDiaSymbol6::frontEndMajor + .property uint32 frontEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 19 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_frontEndMinor() + } // end of property IDiaSymbol6::frontEndMinor + .property uint32 frontEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1A 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_frontEndBuild() + } // end of property IDiaSymbol6::frontEndBuild + .property uint32 backEndMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_backEndMajor() + } // end of property IDiaSymbol6::backEndMajor + .property uint32 backEndMinor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_backEndMinor() + } // end of property IDiaSymbol6::backEndMinor + .property uint32 backEndBuild() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_backEndBuild() + } // end of property IDiaSymbol6::backEndBuild + .property string sourceFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1E 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol6::get_sourceFileName() + } // end of property IDiaSymbol6::sourceFileName + .property string 'unused'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 1F 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol6::get_unused() + } // end of property IDiaSymbol6::'unused' + .property uint32 thunkOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 20 00 00 00 00 00 ) // .. ..... + .get instance uint32 DIALib.IDiaSymbol6::get_thunkOrdinal() + } // end of property IDiaSymbol6::thunkOrdinal + .property int32 thisAdjust() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 21 00 00 00 00 00 ) // ..!..... + .get instance int32 DIALib.IDiaSymbol6::get_thisAdjust() + } // end of property IDiaSymbol6::thisAdjust + .property uint32 virtualBaseOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 22 00 00 00 00 00 ) // .."..... + .get instance uint32 DIALib.IDiaSymbol6::get_virtualBaseOffset() + } // end of property IDiaSymbol6::virtualBaseOffset + .property int32 'virtual'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 23 00 00 00 00 00 ) // ..#..... + .get instance int32 DIALib.IDiaSymbol6::get_virtual() + } // end of property IDiaSymbol6::'virtual' + .property int32 intro() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 24 00 00 00 00 00 ) // ..$..... + .get instance int32 DIALib.IDiaSymbol6::get_intro() + } // end of property IDiaSymbol6::intro + .property int32 pure() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 25 00 00 00 00 00 ) // ..%..... + .get instance int32 DIALib.IDiaSymbol6::get_pure() + } // end of property IDiaSymbol6::pure + .property uint32 callingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 26 00 00 00 00 00 ) // ..&..... + .get instance uint32 DIALib.IDiaSymbol6::get_callingConvention() + } // end of property IDiaSymbol6::callingConvention + .property object 'value'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 27 00 00 00 00 00 ) // ..'..... + .get instance object DIALib.IDiaSymbol6::get_value() + } // end of property IDiaSymbol6::'value' + .property uint32 baseType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 28 00 00 00 00 00 ) // ..(..... + .get instance uint32 DIALib.IDiaSymbol6::get_baseType() + } // end of property IDiaSymbol6::baseType + .property uint32 token() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 29 00 00 00 00 00 ) // ..)..... + .get instance uint32 DIALib.IDiaSymbol6::get_token() + } // end of property IDiaSymbol6::token + .property uint32 timeStamp() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2A 00 00 00 00 00 ) // ..*..... + .get instance uint32 DIALib.IDiaSymbol6::get_timeStamp() + } // end of property IDiaSymbol6::timeStamp + .property valuetype [mscorlib]System.Guid + guid() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2B 00 00 00 00 00 ) // ..+..... + .get instance valuetype [mscorlib]System.Guid DIALib.IDiaSymbol6::get_guid() + } // end of property IDiaSymbol6::guid + .property string symbolsFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2C 00 00 00 00 00 ) // ..,..... + .get instance string DIALib.IDiaSymbol6::get_symbolsFileName() + } // end of property IDiaSymbol6::symbolsFileName + .property int32 reference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2E 00 00 00 00 00 ) // ........ + .get instance int32 DIALib.IDiaSymbol6::get_reference() + } // end of property IDiaSymbol6::reference + .property uint32 count() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 2F 00 00 00 00 00 ) // ../..... + .get instance uint32 DIALib.IDiaSymbol6::get_count() + } // end of property IDiaSymbol6::count + .property uint32 bitPosition() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 31 00 00 00 00 00 ) // ..1..... + .get instance uint32 DIALib.IDiaSymbol6::get_bitPosition() + } // end of property IDiaSymbol6::bitPosition + .property class DIALib.IDiaSymbol arrayIndexType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 32 00 00 00 00 00 ) // ..2..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_arrayIndexType() + } // end of property IDiaSymbol6::arrayIndexType + .property int32 packed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 33 00 00 00 00 00 ) // ..3..... + .get instance int32 DIALib.IDiaSymbol6::get_packed() + } // end of property IDiaSymbol6::packed + .property int32 constructor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 34 00 00 00 00 00 ) // ..4..... + .get instance int32 DIALib.IDiaSymbol6::get_constructor() + } // end of property IDiaSymbol6::constructor + .property int32 overloadedOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 35 00 00 00 00 00 ) // ..5..... + .get instance int32 DIALib.IDiaSymbol6::get_overloadedOperator() + } // end of property IDiaSymbol6::overloadedOperator + .property int32 'nested'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 36 00 00 00 00 00 ) // ..6..... + .get instance int32 DIALib.IDiaSymbol6::get_nested() + } // end of property IDiaSymbol6::'nested' + .property int32 hasNestedTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 37 00 00 00 00 00 ) // ..7..... + .get instance int32 DIALib.IDiaSymbol6::get_hasNestedTypes() + } // end of property IDiaSymbol6::hasNestedTypes + .property int32 hasAssignmentOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 38 00 00 00 00 00 ) // ..8..... + .get instance int32 DIALib.IDiaSymbol6::get_hasAssignmentOperator() + } // end of property IDiaSymbol6::hasAssignmentOperator + .property int32 hasCastOperator() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 39 00 00 00 00 00 ) // ..9..... + .get instance int32 DIALib.IDiaSymbol6::get_hasCastOperator() + } // end of property IDiaSymbol6::hasCastOperator + .property int32 scoped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3A 00 00 00 00 00 ) // ..:..... + .get instance int32 DIALib.IDiaSymbol6::get_scoped() + } // end of property IDiaSymbol6::scoped + .property int32 virtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3B 00 00 00 00 00 ) // ..;..... + .get instance int32 DIALib.IDiaSymbol6::get_virtualBaseClass() + } // end of property IDiaSymbol6::virtualBaseClass + .property int32 indirectVirtualBaseClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3C 00 00 00 00 00 ) // ..<..... + .get instance int32 DIALib.IDiaSymbol6::get_indirectVirtualBaseClass() + } // end of property IDiaSymbol6::indirectVirtualBaseClass + .property int32 virtualBasePointerOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3D 00 00 00 00 00 ) // ..=..... + .get instance int32 DIALib.IDiaSymbol6::get_virtualBasePointerOffset() + } // end of property IDiaSymbol6::virtualBasePointerOffset + .property class DIALib.IDiaSymbol virtualTableShape() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 3E 00 00 00 00 00 ) // ..>..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_virtualTableShape() + } // end of property IDiaSymbol6::virtualTableShape + .property uint32 lexicalParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 40 00 00 00 00 00 ) // ..@..... + .get instance uint32 DIALib.IDiaSymbol6::get_lexicalParentId() + } // end of property IDiaSymbol6::lexicalParentId + .property uint32 classParentId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 41 00 00 00 00 00 ) // ..A..... + .get instance uint32 DIALib.IDiaSymbol6::get_classParentId() + } // end of property IDiaSymbol6::classParentId + .property uint32 typeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 42 00 00 00 00 00 ) // ..B..... + .get instance uint32 DIALib.IDiaSymbol6::get_typeId() + } // end of property IDiaSymbol6::typeId + .property uint32 arrayIndexTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 43 00 00 00 00 00 ) // ..C..... + .get instance uint32 DIALib.IDiaSymbol6::get_arrayIndexTypeId() + } // end of property IDiaSymbol6::arrayIndexTypeId + .property uint32 virtualTableShapeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 44 00 00 00 00 00 ) // ..D..... + .get instance uint32 DIALib.IDiaSymbol6::get_virtualTableShapeId() + } // end of property IDiaSymbol6::virtualTableShapeId + .property int32 code() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 45 00 00 00 00 00 ) // ..E..... + .get instance int32 DIALib.IDiaSymbol6::get_code() + } // end of property IDiaSymbol6::code + .property int32 function() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 46 00 00 00 00 00 ) // ..F..... + .get instance int32 DIALib.IDiaSymbol6::get_function() + } // end of property IDiaSymbol6::function + .property int32 'managed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 47 00 00 00 00 00 ) // ..G..... + .get instance int32 DIALib.IDiaSymbol6::get_managed() + } // end of property IDiaSymbol6::'managed' + .property int32 msil() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 48 00 00 00 00 00 ) // ..H..... + .get instance int32 DIALib.IDiaSymbol6::get_msil() + } // end of property IDiaSymbol6::msil + .property uint32 virtualBaseDispIndex() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 49 00 00 00 00 00 ) // ..I..... + .get instance uint32 DIALib.IDiaSymbol6::get_virtualBaseDispIndex() + } // end of property IDiaSymbol6::virtualBaseDispIndex + .property string undecoratedName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4A 00 00 00 00 00 ) // ..J..... + .get instance string DIALib.IDiaSymbol6::get_undecoratedName() + } // end of property IDiaSymbol6::undecoratedName + .property uint32 age() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4B 00 00 00 00 00 ) // ..K..... + .get instance uint32 DIALib.IDiaSymbol6::get_age() + } // end of property IDiaSymbol6::age + .property uint32 signature() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4C 00 00 00 00 00 ) // ..L..... + .get instance uint32 DIALib.IDiaSymbol6::get_signature() + } // end of property IDiaSymbol6::signature + .property int32 compilerGenerated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4D 00 00 00 00 00 ) // ..M..... + .get instance int32 DIALib.IDiaSymbol6::get_compilerGenerated() + } // end of property IDiaSymbol6::compilerGenerated + .property int32 addressTaken() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4E 00 00 00 00 00 ) // ..N..... + .get instance int32 DIALib.IDiaSymbol6::get_addressTaken() + } // end of property IDiaSymbol6::addressTaken + .property uint32 rank() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 4F 00 00 00 00 00 ) // ..O..... + .get instance uint32 DIALib.IDiaSymbol6::get_rank() + } // end of property IDiaSymbol6::rank + .property class DIALib.IDiaSymbol lowerBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 50 00 00 00 00 00 ) // ..P..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_lowerBound() + } // end of property IDiaSymbol6::lowerBound + .property class DIALib.IDiaSymbol upperBound() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 51 00 00 00 00 00 ) // ..Q..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_upperBound() + } // end of property IDiaSymbol6::upperBound + .property uint32 lowerBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 52 00 00 00 00 00 ) // ..R..... + .get instance uint32 DIALib.IDiaSymbol6::get_lowerBoundId() + } // end of property IDiaSymbol6::lowerBoundId + .property uint32 upperBoundId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 53 00 00 00 00 00 ) // ..S..... + .get instance uint32 DIALib.IDiaSymbol6::get_upperBoundId() + } // end of property IDiaSymbol6::upperBoundId + .property uint32 targetSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 54 00 00 00 00 00 ) // ..T..... + .get instance uint32 DIALib.IDiaSymbol6::get_targetSection() + } // end of property IDiaSymbol6::targetSection + .property uint32 targetOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 55 00 00 00 00 00 ) // ..U..... + .get instance uint32 DIALib.IDiaSymbol6::get_targetOffset() + } // end of property IDiaSymbol6::targetOffset + .property uint32 targetRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 56 00 00 00 00 00 ) // ..V..... + .get instance uint32 DIALib.IDiaSymbol6::get_targetRelativeVirtualAddress() + } // end of property IDiaSymbol6::targetRelativeVirtualAddress + .property uint64 targetVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 57 00 00 00 00 00 ) // ..W..... + .get instance uint64 DIALib.IDiaSymbol6::get_targetVirtualAddress() + } // end of property IDiaSymbol6::targetVirtualAddress + .property uint32 machineType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 58 00 00 00 00 00 ) // ..X..... + .get instance uint32 DIALib.IDiaSymbol6::get_machineType() + } // end of property IDiaSymbol6::machineType + .property uint32 oemId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 59 00 00 00 00 00 ) // ..Y..... + .get instance uint32 DIALib.IDiaSymbol6::get_oemId() + } // end of property IDiaSymbol6::oemId + .property uint32 oemSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5A 00 00 00 00 00 ) // ..Z..... + .get instance uint32 DIALib.IDiaSymbol6::get_oemSymbolId() + } // end of property IDiaSymbol6::oemSymbolId + .property class DIALib.IDiaSymbol objectPointerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5B 00 00 00 00 00 ) // ..[..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_objectPointerType() + } // end of property IDiaSymbol6::objectPointerType + .property uint32 udtKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5C 00 00 00 00 00 ) // ..\..... + .get instance uint32 DIALib.IDiaSymbol6::get_udtKind() + } // end of property IDiaSymbol6::udtKind + .property int32 noReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5D 00 00 00 00 00 ) // ..]..... + .get instance int32 DIALib.IDiaSymbol6::get_noReturn() + } // end of property IDiaSymbol6::noReturn + .property int32 customCallingConvention() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5E 00 00 00 00 00 ) // ..^..... + .get instance int32 DIALib.IDiaSymbol6::get_customCallingConvention() + } // end of property IDiaSymbol6::customCallingConvention + .property int32 noInline() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 5F 00 00 00 00 00 ) // .._..... + .get instance int32 DIALib.IDiaSymbol6::get_noInline() + } // end of property IDiaSymbol6::noInline + .property int32 optimizedCodeDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 60 00 00 00 00 00 ) // ..`..... + .get instance int32 DIALib.IDiaSymbol6::get_optimizedCodeDebugInfo() + } // end of property IDiaSymbol6::optimizedCodeDebugInfo + .property int32 notReached() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 61 00 00 00 00 00 ) // ..a..... + .get instance int32 DIALib.IDiaSymbol6::get_notReached() + } // end of property IDiaSymbol6::notReached + .property int32 interruptReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 62 00 00 00 00 00 ) // ..b..... + .get instance int32 DIALib.IDiaSymbol6::get_interruptReturn() + } // end of property IDiaSymbol6::interruptReturn + .property int32 farReturn() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 63 00 00 00 00 00 ) // ..c..... + .get instance int32 DIALib.IDiaSymbol6::get_farReturn() + } // end of property IDiaSymbol6::farReturn + .property int32 isStatic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 64 00 00 00 00 00 ) // ..d..... + .get instance int32 DIALib.IDiaSymbol6::get_isStatic() + } // end of property IDiaSymbol6::isStatic + .property int32 hasDebugInfo() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 65 00 00 00 00 00 ) // ..e..... + .get instance int32 DIALib.IDiaSymbol6::get_hasDebugInfo() + } // end of property IDiaSymbol6::hasDebugInfo + .property int32 isLTCG() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 66 00 00 00 00 00 ) // ..f..... + .get instance int32 DIALib.IDiaSymbol6::get_isLTCG() + } // end of property IDiaSymbol6::isLTCG + .property int32 isDataAligned() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 67 00 00 00 00 00 ) // ..g..... + .get instance int32 DIALib.IDiaSymbol6::get_isDataAligned() + } // end of property IDiaSymbol6::isDataAligned + .property int32 hasSecurityChecks() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 68 00 00 00 00 00 ) // ..h..... + .get instance int32 DIALib.IDiaSymbol6::get_hasSecurityChecks() + } // end of property IDiaSymbol6::hasSecurityChecks + .property string compilerName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 69 00 00 00 00 00 ) // ..i..... + .get instance string DIALib.IDiaSymbol6::get_compilerName() + } // end of property IDiaSymbol6::compilerName + .property int32 hasAlloca() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6A 00 00 00 00 00 ) // ..j..... + .get instance int32 DIALib.IDiaSymbol6::get_hasAlloca() + } // end of property IDiaSymbol6::hasAlloca + .property int32 hasSetJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6B 00 00 00 00 00 ) // ..k..... + .get instance int32 DIALib.IDiaSymbol6::get_hasSetJump() + } // end of property IDiaSymbol6::hasSetJump + .property int32 hasLongJump() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6C 00 00 00 00 00 ) // ..l..... + .get instance int32 DIALib.IDiaSymbol6::get_hasLongJump() + } // end of property IDiaSymbol6::hasLongJump + .property int32 hasInlAsm() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6D 00 00 00 00 00 ) // ..m..... + .get instance int32 DIALib.IDiaSymbol6::get_hasInlAsm() + } // end of property IDiaSymbol6::hasInlAsm + .property int32 hasEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6E 00 00 00 00 00 ) // ..n..... + .get instance int32 DIALib.IDiaSymbol6::get_hasEH() + } // end of property IDiaSymbol6::hasEH + .property int32 hasSEH() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 6F 00 00 00 00 00 ) // ..o..... + .get instance int32 DIALib.IDiaSymbol6::get_hasSEH() + } // end of property IDiaSymbol6::hasSEH + .property int32 hasEHa() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 70 00 00 00 00 00 ) // ..p..... + .get instance int32 DIALib.IDiaSymbol6::get_hasEHa() + } // end of property IDiaSymbol6::hasEHa + .property int32 isNaked() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 71 00 00 00 00 00 ) // ..q..... + .get instance int32 DIALib.IDiaSymbol6::get_isNaked() + } // end of property IDiaSymbol6::isNaked + .property int32 isAggregated() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 72 00 00 00 00 00 ) // ..r..... + .get instance int32 DIALib.IDiaSymbol6::get_isAggregated() + } // end of property IDiaSymbol6::isAggregated + .property int32 isSplitted() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 73 00 00 00 00 00 ) // ..s..... + .get instance int32 DIALib.IDiaSymbol6::get_isSplitted() + } // end of property IDiaSymbol6::isSplitted + .property class DIALib.IDiaSymbol container() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 74 00 00 00 00 00 ) // ..t..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_container() + } // end of property IDiaSymbol6::container + .property int32 inlSpec() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 75 00 00 00 00 00 ) // ..u..... + .get instance int32 DIALib.IDiaSymbol6::get_inlSpec() + } // end of property IDiaSymbol6::inlSpec + .property int32 noStackOrdering() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 76 00 00 00 00 00 ) // ..v..... + .get instance int32 DIALib.IDiaSymbol6::get_noStackOrdering() + } // end of property IDiaSymbol6::noStackOrdering + .property class DIALib.IDiaSymbol virtualBaseTableType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 77 00 00 00 00 00 ) // ..w..... + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_virtualBaseTableType() + } // end of property IDiaSymbol6::virtualBaseTableType + .property int32 hasManagedCode() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 78 00 00 00 00 00 ) // ..x..... + .get instance int32 DIALib.IDiaSymbol6::get_hasManagedCode() + } // end of property IDiaSymbol6::hasManagedCode + .property int32 isHotpatchable() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 79 00 00 00 00 00 ) // ..y..... + .get instance int32 DIALib.IDiaSymbol6::get_isHotpatchable() + } // end of property IDiaSymbol6::isHotpatchable + .property int32 isCVTCIL() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7A 00 00 00 00 00 ) // ..z..... + .get instance int32 DIALib.IDiaSymbol6::get_isCVTCIL() + } // end of property IDiaSymbol6::isCVTCIL + .property int32 isMSILNetmodule() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7B 00 00 00 00 00 ) // ..{..... + .get instance int32 DIALib.IDiaSymbol6::get_isMSILNetmodule() + } // end of property IDiaSymbol6::isMSILNetmodule + .property int32 isCTypes() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7C 00 00 00 00 00 ) // ..|..... + .get instance int32 DIALib.IDiaSymbol6::get_isCTypes() + } // end of property IDiaSymbol6::isCTypes + .property int32 isStripped() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7D 00 00 00 00 00 ) // ..}..... + .get instance int32 DIALib.IDiaSymbol6::get_isStripped() + } // end of property IDiaSymbol6::isStripped + .property uint32 frontEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7E 00 00 00 00 00 ) // ..~..... + .get instance uint32 DIALib.IDiaSymbol6::get_frontEndQFE() + } // end of property IDiaSymbol6::frontEndQFE + .property uint32 backEndQFE() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 7F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_backEndQFE() + } // end of property IDiaSymbol6::backEndQFE + .property int32 wasInlined() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 80 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_wasInlined() + } // end of property IDiaSymbol6::wasInlined + .property int32 strictGSCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 81 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_strictGSCheck() + } // end of property IDiaSymbol6::strictGSCheck + .property int32 isCxxReturnUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 82 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isCxxReturnUdt() + } // end of property IDiaSymbol6::isCxxReturnUdt + .property int32 isConstructorVirtualBase() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 83 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isConstructorVirtualBase() + } // end of property IDiaSymbol6::isConstructorVirtualBase + .property int32 RValueReference() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 84 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_RValueReference() + } // end of property IDiaSymbol6::RValueReference + .property class DIALib.IDiaSymbol unmodifiedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 85 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_unmodifiedType() + } // end of property IDiaSymbol6::unmodifiedType + .property int32 framePointerPresent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 86 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_framePointerPresent() + } // end of property IDiaSymbol6::framePointerPresent + .property int32 isSafeBuffers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 87 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isSafeBuffers() + } // end of property IDiaSymbol6::isSafeBuffers + .property int32 intrinsic() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 88 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_intrinsic() + } // end of property IDiaSymbol6::intrinsic + .property int32 'sealed'() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 89 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_sealed() + } // end of property IDiaSymbol6::'sealed' + .property int32 hfaFloat() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_hfaFloat() + } // end of property IDiaSymbol6::hfaFloat + .property int32 hfaDouble() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8B 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_hfaDouble() + } // end of property IDiaSymbol6::hfaDouble + .property uint32 liveRangeStartAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_liveRangeStartAddressSection() + } // end of property IDiaSymbol6::liveRangeStartAddressSection + .property uint32 liveRangeStartAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_liveRangeStartAddressOffset() + } // end of property IDiaSymbol6::liveRangeStartAddressOffset + .property uint32 liveRangeStartRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_liveRangeStartRelativeVirtualAddress() + } // end of property IDiaSymbol6::liveRangeStartRelativeVirtualAddress + .property uint32 countLiveRanges() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 8F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_countLiveRanges() + } // end of property IDiaSymbol6::countLiveRanges + .property uint64 liveRangeLength() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 90 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol6::get_liveRangeLength() + } // end of property IDiaSymbol6::liveRangeLength + .property uint32 offsetInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 91 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_offsetInUdt() + } // end of property IDiaSymbol6::offsetInUdt + .property uint32 paramBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 92 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_paramBasePointerRegisterId() + } // end of property IDiaSymbol6::paramBasePointerRegisterId + .property uint32 localBasePointerRegisterId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 93 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_localBasePointerRegisterId() + } // end of property IDiaSymbol6::localBasePointerRegisterId + .property int32 isLocationControlFlowDependent() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 94 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isLocationControlFlowDependent() + } // end of property IDiaSymbol6::isLocationControlFlowDependent + .property uint32 stride() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 95 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_stride() + } // end of property IDiaSymbol6::stride + .property uint32 numberOfRows() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 96 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_numberOfRows() + } // end of property IDiaSymbol6::numberOfRows + .property uint32 numberOfColumns() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 97 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_numberOfColumns() + } // end of property IDiaSymbol6::numberOfColumns + .property int32 isMatrixRowMajor() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 98 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isMatrixRowMajor() + } // end of property IDiaSymbol6::isMatrixRowMajor + .property int32 isReturnValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 99 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isReturnValue() + } // end of property IDiaSymbol6::isReturnValue + .property int32 isOptimizedAway() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9A 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isOptimizedAway() + } // end of property IDiaSymbol6::isOptimizedAway + .property uint32 builtInKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9B 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_builtInKind() + } // end of property IDiaSymbol6::builtInKind + .property uint32 registerType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9C 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_registerType() + } // end of property IDiaSymbol6::registerType + .property uint32 baseDataSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9D 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_baseDataSlot() + } // end of property IDiaSymbol6::baseDataSlot + .property uint32 baseDataOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9E 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_baseDataOffset() + } // end of property IDiaSymbol6::baseDataOffset + .property uint32 textureSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 9F 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_textureSlot() + } // end of property IDiaSymbol6::textureSlot + .property uint32 samplerSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_samplerSlot() + } // end of property IDiaSymbol6::samplerSlot + .property uint32 uavSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_uavSlot() + } // end of property IDiaSymbol6::uavSlot + .property uint32 sizeInUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_sizeInUdt() + } // end of property IDiaSymbol6::sizeInUdt + .property uint32 memorySpaceKind() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_memorySpaceKind() + } // end of property IDiaSymbol6::memorySpaceKind + .property uint32 unmodifiedTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_unmodifiedTypeId() + } // end of property IDiaSymbol6::unmodifiedTypeId + .property uint32 subTypeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_subTypeId() + } // end of property IDiaSymbol6::subTypeId + .property class DIALib.IDiaSymbol subType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A6 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_subType() + } // end of property IDiaSymbol6::subType + .property uint32 numberOfModifiers() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_numberOfModifiers() + } // end of property IDiaSymbol6::numberOfModifiers + .property uint32 numberOfRegisterIndices() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A8 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_numberOfRegisterIndices() + } // end of property IDiaSymbol6::numberOfRegisterIndices + .property int32 isHLSLData() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 A9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isHLSLData() + } // end of property IDiaSymbol6::isHLSLData + .property int32 isPointerToDataMember() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isPointerToDataMember() + } // end of property IDiaSymbol6::isPointerToDataMember + .property int32 isPointerToMemberFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isPointerToMemberFunction() + } // end of property IDiaSymbol6::isPointerToMemberFunction + .property int32 isSingleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isSingleInheritance() + } // end of property IDiaSymbol6::isSingleInheritance + .property int32 isMultipleInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isMultipleInheritance() + } // end of property IDiaSymbol6::isMultipleInheritance + .property int32 isVirtualInheritance() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isVirtualInheritance() + } // end of property IDiaSymbol6::isVirtualInheritance + .property int32 restrictedType() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 AF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_restrictedType() + } // end of property IDiaSymbol6::restrictedType + .property int32 isPointerBasedOnSymbolValue() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B0 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isPointerBasedOnSymbolValue() + } // end of property IDiaSymbol6::isPointerBasedOnSymbolValue + .property class DIALib.IDiaSymbol baseSymbol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B1 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_baseSymbol() + } // end of property IDiaSymbol6::baseSymbol + .property uint32 baseSymbolId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B2 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_baseSymbolId() + } // end of property IDiaSymbol6::baseSymbolId + .property string objectFileName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B3 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol6::get_objectFileName() + } // end of property IDiaSymbol6::objectFileName + .property int32 isAcceleratorGroupSharedLocal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B4 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isAcceleratorGroupSharedLocal() + } // end of property IDiaSymbol6::isAcceleratorGroupSharedLocal + .property int32 isAcceleratorPointerTagLiveRange() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B5 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isAcceleratorPointerTagLiveRange() + } // end of property IDiaSymbol6::isAcceleratorPointerTagLiveRange + .property int32 isAcceleratorStubFunction() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isAcceleratorStubFunction() + } // end of property IDiaSymbol6::isAcceleratorStubFunction + .property uint32 numberOfAcceleratorPointerTags() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_numberOfAcceleratorPointerTags() + } // end of property IDiaSymbol6::numberOfAcceleratorPointerTags + .property int32 isSdl() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isSdl() + } // end of property IDiaSymbol6::isSdl + .property int32 isWinRTPointer() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 B9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isWinRTPointer() + } // end of property IDiaSymbol6::isWinRTPointer + .property int32 isRefUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isRefUdt() + } // end of property IDiaSymbol6::isRefUdt + .property int32 isValueUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isValueUdt() + } // end of property IDiaSymbol6::isValueUdt + .property int32 isInterfaceUdt() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isInterfaceUdt() + } // end of property IDiaSymbol6::isInterfaceUdt + .property int32 isPGO() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isPGO() + } // end of property IDiaSymbol6::isPGO + .property int32 hasValidPGOCounts() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_hasValidPGOCounts() + } // end of property IDiaSymbol6::hasValidPGOCounts + .property int32 isOptimizedForSpeed() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 BF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isOptimizedForSpeed() + } // end of property IDiaSymbol6::isOptimizedForSpeed + .property uint32 PGOEntryCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_PGOEntryCount() + } // end of property IDiaSymbol6::PGOEntryCount + .property uint32 PGOEdgeCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_PGOEdgeCount() + } // end of property IDiaSymbol6::PGOEdgeCount + .property uint64 PGODynamicInstructionCount() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol6::get_PGODynamicInstructionCount() + } // end of property IDiaSymbol6::PGODynamicInstructionCount + .property uint32 staticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_staticSize() + } // end of property IDiaSymbol6::staticSize + .property uint32 finalLiveStaticSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C4 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_finalLiveStaticSize() + } // end of property IDiaSymbol6::finalLiveStaticSize + .property string phaseName() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C5 00 00 00 00 00 ) + .get instance string DIALib.IDiaSymbol6::get_phaseName() + } // end of property IDiaSymbol6::phaseName + .property int32 hasControlFlowCheck() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C6 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_hasControlFlowCheck() + } // end of property IDiaSymbol6::hasControlFlowCheck + .property int32 constantExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C7 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_constantExport() + } // end of property IDiaSymbol6::constantExport + .property int32 dataExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_dataExport() + } // end of property IDiaSymbol6::dataExport + .property int32 privateExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 C9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_privateExport() + } // end of property IDiaSymbol6::privateExport + .property int32 noNameExport() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_noNameExport() + } // end of property IDiaSymbol6::noNameExport + .property int32 exportHasExplicitlyAssignedOrdinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CB 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_exportHasExplicitlyAssignedOrdinal() + } // end of property IDiaSymbol6::exportHasExplicitlyAssignedOrdinal + .property int32 exportIsForwarder() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CC 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_exportIsForwarder() + } // end of property IDiaSymbol6::exportIsForwarder + .property uint32 ordinal() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CD 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_ordinal() + } // end of property IDiaSymbol6::ordinal + .property uint32 frameSize() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CE 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_frameSize() + } // end of property IDiaSymbol6::frameSize + .property uint32 exceptionHandlerAddressSection() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 CF 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_exceptionHandlerAddressSection() + } // end of property IDiaSymbol6::exceptionHandlerAddressSection + .property uint32 exceptionHandlerAddressOffset() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D0 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_exceptionHandlerAddressOffset() + } // end of property IDiaSymbol6::exceptionHandlerAddressOffset + .property uint32 exceptionHandlerRelativeVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D1 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_exceptionHandlerRelativeVirtualAddress() + } // end of property IDiaSymbol6::exceptionHandlerRelativeVirtualAddress + .property uint64 exceptionHandlerVirtualAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D2 00 00 00 00 00 ) + .get instance uint64 DIALib.IDiaSymbol6::get_exceptionHandlerVirtualAddress() + } // end of property IDiaSymbol6::exceptionHandlerVirtualAddress + .property uint32 characteristics() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D3 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_characteristics() + } // end of property IDiaSymbol6::characteristics + .property class DIALib.IDiaSymbol coffGroup() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D4 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_coffGroup() + } // end of property IDiaSymbol6::coffGroup + .property uint32 bindID() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D5 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_bindID() + } // end of property IDiaSymbol6::bindID + .property uint32 bindSpace() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D6 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_bindSpace() + } // end of property IDiaSymbol6::bindSpace + .property uint32 bindSlot() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D7 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_bindSlot() + } // end of property IDiaSymbol6::bindSlot + .property int32 isObjCClass() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D8 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isObjCClass() + } // end of property IDiaSymbol6::isObjCClass + .property int32 isObjCCategory() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 D9 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isObjCCategory() + } // end of property IDiaSymbol6::isObjCCategory + .property int32 isObjCProtocol() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DA 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isObjCProtocol() + } // end of property IDiaSymbol6::isObjCProtocol + .property class DIALib.IDiaSymbol inlinee() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DB 00 00 00 00 00 ) + .get instance class DIALib.IDiaSymbol DIALib.IDiaSymbol6::get_inlinee() + } // end of property IDiaSymbol6::inlinee + .property uint32 inlineeId() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DC 00 00 00 00 00 ) + .get instance uint32 DIALib.IDiaSymbol6::get_inlineeId() + } // end of property IDiaSymbol6::inlineeId + .property int32 noexcept() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DD 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_noexcept() + } // end of property IDiaSymbol6::noexcept + .property int32 hasAbsoluteAddress() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DE 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_hasAbsoluteAddress() + } // end of property IDiaSymbol6::hasAbsoluteAddress + .property int32 isStaticMemberFunc() + { + .custom instance void [mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01 00 DF 00 00 00 00 00 ) + .get instance int32 DIALib.IDiaSymbol6::get_isStaticMemberFunc() + } // end of property IDiaSymbol6::isStaticMemberFunc +} // end of class DIALib.IDiaSymbol6 + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file DIALib.res diff --git a/src/coreclr/src/ToolBox/SOS/DIALib/DIALib.ilproj b/src/coreclr/src/ToolBox/SOS/DIALib/DIALib.ilproj new file mode 100644 index 000000000000..0486489d2328 --- /dev/null +++ b/src/coreclr/src/ToolBox/SOS/DIALib/DIALib.ilproj @@ -0,0 +1,7 @@ + + + $(NetCoreAppCurrent) + AnyCPU + false + + \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt b/src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt deleted file mode 100644 index e3fc3ed9e3a5..000000000000 --- a/src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Quick note: The CMake C# support is using the CSC bundled with the MSBuild that the native build runs on, not the one supplied by the local .NET SDK. - -project(DacTableGen LANGUAGES CSharp) - -file(TO_CMAKE_PATH "$ENV{VSInstallDir}\\DIA SDK" DIASDK_DIR) -file(COPY "${DIASDK_DIR}/bin/msdia140.dll" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") - -set (DIALib "${CMAKE_CURRENT_BINARY_DIR}/DIALib.dll") -FIND_PROGRAM(TLBIMP tlbimp.exe) -FIND_PROGRAM(MIDL midl.exe) -add_custom_command( - OUTPUT "${DIALib}" - COMMAND ${MIDL} /I "${DIASDK_DIR}/include" "${DIASDK_DIR}/idl/dia2.idl" /tlb "${CMAKE_CURRENT_BINARY_DIR}/dia2.tlb" - COMMAND ${TLBIMP} dia2.tlb /out:"${DIALib}" -) -add_custom_target(gen_dialib DEPENDS "${DIALib}") - -set(DACTABLEGEN_SOURCES - cvconst.cs - diautil.cs - main.cs - MapSymbolProvider.cs -) -# DacTableGen doesn't use the defines from the rest of the build tree, so clear all of the compile definitions -set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "") - -set(CMAKE_CSharp_FLAGS "/platform:anycpu32bitpreferred") -add_executable(dactablegen ${DACTABLEGEN_SOURCES}) -add_dependencies(dactablegen gen_dialib) - -set_target_properties(dactablegen PROPERTIES VS_DOTNET_REFERENCES "System") -set_target_properties(dactablegen PROPERTIES VS_DOTNET_REFERENCE_DIALib "${DIALib}") diff --git a/src/coreclr/src/ToolBox/SOS/DacTableGen/DacTableGen.csproj b/src/coreclr/src/ToolBox/SOS/DacTableGen/DacTableGen.csproj new file mode 100644 index 000000000000..9bba95a4e619 --- /dev/null +++ b/src/coreclr/src/ToolBox/SOS/DacTableGen/DacTableGen.csproj @@ -0,0 +1,35 @@ + + + Exe + $(NetCoreAppCurrent) + AnyCPU + $(RuntimeBinDir)\DacTableGen + false + false + + + + + + + + + $([MSBuild]::NormalizePath('$(Pkgvswhere)','tools','vswhere.exe')) + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/SOS/Directory.Build.props b/src/coreclr/src/ToolBox/SOS/Directory.Build.props new file mode 100644 index 000000000000..93c2d4a55e7b --- /dev/null +++ b/src/coreclr/src/ToolBox/SOS/Directory.Build.props @@ -0,0 +1,7 @@ + + + AnyCPU + + + + \ No newline at end of file diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/mcs/CMakeLists.txt index 7c82afea565f..8524fe8faec7 100644 --- a/src/coreclr/src/ToolBox/superpmi/mcs/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/mcs/CMakeLists.txt @@ -5,7 +5,7 @@ add_definitions(-DSELF_NO_HOST) if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) endif(CLR_CMAKE_HOST_WIN32) include_directories(.) @@ -24,6 +24,7 @@ set(MCS_SOURCES verbildump.cpp verbinteg.cpp verbmerge.cpp + verbprintjiteeversion.cpp verbremovedup.cpp verbstat.cpp verbstrip.cpp @@ -48,7 +49,7 @@ set(MCS_SOURCES _add_executable(mcs ${MCS_SOURCES} ) -target_precompile_header(TARGET mcs HEADER standardpch.h) +target_precompile_headers(mcs PRIVATE "$<$:standardpch.h>") if(CLR_CMAKE_HOST_UNIX) target_link_libraries(mcs @@ -64,7 +65,7 @@ else() ${STATIC_MT_CPP_LIB} ) - _install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$/mcs.pdb DESTINATION PDB) + _install (FILES $ DESTINATION PDB) endif(CLR_CMAKE_HOST_UNIX) _install (TARGETS mcs DESTINATION .) diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/commandline.cpp b/src/coreclr/src/ToolBox/superpmi/mcs/commandline.cpp index 30fff554ca69..58df7b3dec39 100644 --- a/src/coreclr/src/ToolBox/superpmi/mcs/commandline.cpp +++ b/src/coreclr/src/ToolBox/superpmi/mcs/commandline.cpp @@ -96,6 +96,9 @@ void CommandLine::DumpHelp(const char* program) printf(" e.g. -merge a.mch *.mc -recursive\n"); printf(" e.g. -merge a.mch *.mc -recursive -dedup -thin\n"); printf("\n"); + printf(" -printJITEEVersion\n"); + printf(" Print the JITEEVersion GUID with which this was built, in the form: a5eec3a4-4176-43a7-8c2b-a05b551d4f49\n"); + printf("\n"); printf(" -removeDup inputfile outputfile\n"); printf(" Copy methodContexts from inputfile to outputfile, skipping duplicates.\n"); printf(" e.g. -removeDup a.mc b.mc\n"); @@ -245,6 +248,12 @@ bool CommandLine::Parse(int argc, char* argv[], /* OUT */ Options* o) foundVerb = true; o->actionMerge = true; } + else if ((_strnicmp(&argv[i][1], "printjiteeversion", argLen) == 0)) + { + tempLen = strlen(argv[i]); + foundVerb = true; + o->actionPrintJITEEVersion = true; + } else if ((_strnicmp(&argv[i][1], "recursive", argLen) == 0)) { tempLen = strlen(argv[i]); @@ -593,6 +602,11 @@ bool CommandLine::Parse(int argc, char* argv[], /* OUT */ Options* o) } return true; } + if (o->actionPrintJITEEVersion) + { + // No arguments to check + return true; + } DumpHelp(argv[0]); return false; diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/commandline.h b/src/coreclr/src/ToolBox/superpmi/mcs/commandline.h index 4b18ae9eb156..b791b4c3bb8d 100644 --- a/src/coreclr/src/ToolBox/superpmi/mcs/commandline.h +++ b/src/coreclr/src/ToolBox/superpmi/mcs/commandline.h @@ -26,6 +26,7 @@ class CommandLine , actionILDump(false) , actionInteg(false) , actionMerge(false) + , actionPrintJITEEVersion(false) , actionRemoveDup(false) , actionStat(false) , actionStrip(false) @@ -52,6 +53,7 @@ class CommandLine bool actionILDump; bool actionInteg; bool actionMerge; + bool actionPrintJITEEVersion; bool actionRemoveDup; bool actionStat; bool actionStrip; diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/mcs.cpp b/src/coreclr/src/ToolBox/superpmi/mcs/mcs.cpp index 3c4e2dfb0d7b..52bc21f49bdf 100644 --- a/src/coreclr/src/ToolBox/superpmi/mcs/mcs.cpp +++ b/src/coreclr/src/ToolBox/superpmi/mcs/mcs.cpp @@ -19,6 +19,7 @@ #include "verbconcat.h" #include "verbmerge.h" #include "verbstrip.h" +#include "verbprintjiteeversion.h" #include "logging.h" int __cdecl main(int argc, char* argv[]) @@ -97,6 +98,10 @@ int __cdecl main(int argc, char* argv[]) { exitCode = verbTOC::DoWork(o.nameOfFile1); } + if (o.actionPrintJITEEVersion) + { + exitCode = verbPrintJITEEVersion::DoWork(); + } Logger::Shutdown(); return exitCode; diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/verbildump.cpp b/src/coreclr/src/ToolBox/superpmi/mcs/verbildump.cpp index 5a41401cc53d..0af9a807cbf7 100644 --- a/src/coreclr/src/ToolBox/superpmi/mcs/verbildump.cpp +++ b/src/coreclr/src/ToolBox/superpmi/mcs/verbildump.cpp @@ -893,6 +893,7 @@ void DumpILToConsoleBare(unsigned char* ilCode, int len) LogError("unknown ilCode 0xfe%2x at offset %d in MethodGen::PrettyPrint", ilCode[i], i); break; } + break; default: LogError("unknown ilCode 0x%02x at offset %d in MethodGen::PrettyPrint", ilCode[i], i); break; diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/verbprintjiteeversion.cpp b/src/coreclr/src/ToolBox/superpmi/mcs/verbprintjiteeversion.cpp new file mode 100644 index 000000000000..318146aa3946 --- /dev/null +++ b/src/coreclr/src/ToolBox/superpmi/mcs/verbprintjiteeversion.cpp @@ -0,0 +1,34 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +#include "standardpch.h" +#include "verbprintjiteeversion.h" +#include "runtimedetails.h" + +// Print the GUID in format a5eec3a4-4176-43a7-8c2b-a05b551d4f49 +// +// This is useful for tools that want to determine which MCH file to use for a +// particular JIT: if the JIT and MCS are built from the same source tree, then +// use this function to print out the JITEEVersion, and use that to determine +// which MCH files to use. +// +int verbPrintJITEEVersion::DoWork() +{ + const GUID& g = JITEEVersionIdentifier; + printf("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n", + g.Data1, + g.Data2, + g.Data3, + g.Data4[0], + g.Data4[1], + g.Data4[2], + g.Data4[3], + g.Data4[4], + g.Data4[5], + g.Data4[6], + g.Data4[7]); + + return 0; +} diff --git a/src/coreclr/src/ToolBox/superpmi/mcs/verbprintjiteeversion.h b/src/coreclr/src/ToolBox/superpmi/mcs/verbprintjiteeversion.h new file mode 100644 index 000000000000..16a8197f6e5c --- /dev/null +++ b/src/coreclr/src/ToolBox/superpmi/mcs/verbprintjiteeversion.h @@ -0,0 +1,18 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +//---------------------------------------------------------- +// verbPrintJITEEVersion.h - verb that prints the JITEEVersion GUID that this was built with +//---------------------------------------------------------- +#ifndef _verbPrintJITEEVersion +#define _verbPrintJITEEVersion + +class verbPrintJITEEVersion +{ +public: + static int DoWork(); +}; + +#endif diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp index e27491bbd5ee..f0ccdc46c754 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.cpp @@ -796,6 +796,16 @@ void CompileResult::applyRelocs(unsigned char* block1, ULONG blocksize1, void* o size_t address = section_begin + (size_t)fixupLocation - (size_t)originalAddr; if ((section_begin <= address) && (address < section_end)) // A reloc for our section? { +#if defined(TARGET_AMD64) + // During an actual compile, recordRelocation() will be called before the compile + // is actually finished, and it will write the relative offset into the fixupLocation. + // Then, emitEndCodeGen() will patch forward jumps by subtracting any adjustment due + // to overestimation of instruction sizes. Because we're applying the relocs after the + // compile has finished, we need to reverse that: i.e. add in the (negative) adjustment + // that's now in the fixupLocation. + INT32 adjustment = *(INT32*)address; + delta += adjustment; +#endif LogDebug(" fixupLoc-%016llX (@%p) : %08X => %08X", fixupLocation, address, *(DWORD*)address, delta); *(DWORD*)address = (DWORD)delta; @@ -885,9 +895,17 @@ void* CompileResult::repAddressMap(void* replayAddress) { if (AddressMap == nullptr) return nullptr; - Agnostic_AddressMap value; - value = AddressMap->Get((DWORDLONG)replayAddress); - return (void*)value.Address; + + int index = AddressMap->GetIndex((DWORDLONG)replayAddress); + + if (index != -1) + { + Agnostic_AddressMap value; + value = AddressMap->Get((DWORDLONG)replayAddress); + return (void*)value.Address; + } + + return nullptr; } void* CompileResult::searchAddressMap(void* newAddress) { @@ -952,45 +970,12 @@ void CompileResult::dmpAllocUnwindInfo(DWORD key, const Agnostic_AllocUnwindInfo value.pUnwindBlock_index, value.funcKind); } -void CompileResult::recAllocMethodBlockCounts(ULONG count, ICorJitInfo::BlockCounts** pBlockCounts, HRESULT result) -{ - if (AllocMethodBlockCounts == nullptr) - AllocMethodBlockCounts = new LightWeightMap(); - - Agnostic_AllocMethodBlockCounts value; - - value.count = (DWORD)count; - value.result = (DWORD)result; - value.pBlockCounts_index = - AllocMethodBlockCounts->AddBuffer((unsigned char*)*pBlockCounts, count * sizeof(ICorJitInfo::BlockCounts)); - - AllocMethodBlockCounts->Add((DWORD)0, value); -} -void CompileResult::dmpAllocMethodBlockCounts(DWORD key, const Agnostic_AllocMethodBlockCounts& value) -{ - printf("AllocMethodBlockCounts key %u, value cnt-%u ind-%u res-%08X", key, value.count, value.pBlockCounts_index, - value.result); -} -HRESULT CompileResult::repAllocMethodBlockCounts(ULONG count, ICorJitInfo::BlockCounts** pBlockCounts) -{ - Agnostic_AllocMethodBlockCounts value; - value = AllocMethodBlockCounts->Get((DWORD)0); - - if (count != value.count) - __debugbreak(); - - HRESULT result = (HRESULT)value.result; - *pBlockCounts = (ICorJitInfo::BlockCounts*)AllocMethodBlockCounts->GetBuffer(value.pBlockCounts_index); - recAddressMap((void*)0x4242, (void*)*pBlockCounts, count * (sizeof(ICorJitInfo::BlockCounts))); - return result; -} - void CompileResult::recRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle) { repRecordCallSite(instrOffset, callSig, methodHandle); } -void CompileResult::dmpRecordCallSite(DWORD key, const Agnostic_RecordCallSite& value) +void CompileResult::dmpRecordCallSiteWithSignature(DWORD key, const Agnostic_RecordCallSite& value) const { printf("RecordCallSite key %u, callSig{cc-%u rtc-%016llX rts-%016llX rt-%u flg-%u na-%u cc-%u ci-%u mc-%u mi-%u " "sig-%u pSig-%u scp-%016llX tok-%08X} ftn-%016llX", @@ -1001,16 +986,26 @@ void CompileResult::dmpRecordCallSite(DWORD key, const Agnostic_RecordCallSite& value.callSig.token, value.methodHandle); } -void CompileResult::repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle) +void CompileResult::dmpRecordCallSiteWithoutSignature(DWORD key, DWORDLONG methodHandle) const { - if (RecordCallSite == nullptr) - RecordCallSite = new LightWeightMap(); + printf("RecordCallSite without call signature key %u, ftn-%016llX", key, methodHandle); +} - Agnostic_RecordCallSite value; - ZeroMemory(&value, sizeof(Agnostic_RecordCallSite)); +void CompileResult::repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle) +{ + + if (RecordCallSiteWithSignature == nullptr) + { + // The most call site records have only `methodHandle`, so creating two separate maps give us better perfomance + // and smaller memory consumption. Note: we are not reading values from these maps during a normal replay. + RecordCallSiteWithSignature = new LightWeightMap(); + RecordCallSiteWithoutSignature = new LightWeightMap(); + } if (callSig != nullptr) { + Agnostic_RecordCallSite value; + ZeroMemory(&value, sizeof(Agnostic_RecordCallSite)); value.callSig.callConv = (DWORD)callSig->callConv; value.callSig.retTypeClass = (DWORDLONG)callSig->retTypeClass; value.callSig.retTypeSigClass = (DWORDLONG)callSig->retTypeSigClass; @@ -1019,51 +1014,35 @@ void CompileResult::repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callS value.callSig.numArgs = (DWORD)callSig->numArgs; value.callSig.sigInst_classInstCount = (DWORD)callSig->sigInst.classInstCount; value.callSig.sigInst_classInst_Index = - RecordCallSite->AddBuffer((unsigned char*)callSig->sigInst.classInst, + RecordCallSiteWithSignature->AddBuffer((unsigned char*)callSig->sigInst.classInst, callSig->sigInst.classInstCount * 8); // porting issue value.callSig.sigInst_methInstCount = (DWORD)callSig->sigInst.methInstCount; value.callSig.sigInst_methInst_Index = - RecordCallSite->AddBuffer((unsigned char*)callSig->sigInst.methInst, + RecordCallSiteWithSignature->AddBuffer((unsigned char*)callSig->sigInst.methInst, callSig->sigInst.methInstCount * 8); // porting issue value.callSig.args = (DWORDLONG)callSig->args; value.callSig.cbSig = (DWORD)callSig->cbSig; - value.callSig.pSig_Index = (DWORD)RecordCallSite->AddBuffer((unsigned char*)callSig->pSig, callSig->cbSig); + value.callSig.pSig_Index = (DWORD)RecordCallSiteWithSignature->AddBuffer((unsigned char*)callSig->pSig, callSig->cbSig); value.callSig.scope = (DWORDLONG)callSig->scope; value.callSig.token = (DWORD)callSig->token; + value.methodHandle = (DWORDLONG)methodHandle; + RecordCallSiteWithSignature->Add(instrOffset, value); } else { - value.callSig.callConv = (DWORD)-1; - value.callSig.retTypeClass = (DWORDLONG)-1; - value.callSig.retTypeSigClass = (DWORDLONG)-1; - value.callSig.retType = (DWORD)-1; - value.callSig.flags = (DWORD)-1; - value.callSig.numArgs = (DWORD)-1; - value.callSig.sigInst_classInstCount = (DWORD)-1; - value.callSig.sigInst_classInst_Index = (DWORD)-1; - value.callSig.sigInst_methInstCount = (DWORD)-1; - value.callSig.sigInst_methInst_Index = (DWORD)-1; - value.callSig.args = (DWORDLONG)-1; - value.callSig.cbSig = (DWORD)-1; - value.callSig.pSig_Index = (DWORD)-1; - value.callSig.scope = (DWORDLONG)-1; - value.callSig.token = (DWORD)-1; + RecordCallSiteWithoutSignature->Add(instrOffset, (DWORDLONG)methodHandle); } - - value.methodHandle = (DWORDLONG)methodHandle; - - RecordCallSite->Add(instrOffset, value); } bool CompileResult::fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO* pCallSig) { - if (RecordCallSite == nullptr) + if (RecordCallSiteWithSignature == nullptr) return false; - if (RecordCallSite->GetIndex(instrOffset) == -1) + if (RecordCallSiteWithSignature->GetIndex(instrOffset) == -1) return false; - Agnostic_RecordCallSite value = RecordCallSite->Get(instrOffset); + Agnostic_RecordCallSite value = RecordCallSiteWithSignature->Get(instrOffset); if (value.callSig.callConv == (DWORD)-1) return false; @@ -1076,12 +1055,12 @@ bool CompileResult::fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO pCallSig->numArgs = (unsigned)value.callSig.numArgs; pCallSig->sigInst.classInstCount = (unsigned)value.callSig.sigInst_classInstCount; pCallSig->sigInst.classInst = - (CORINFO_CLASS_HANDLE*)RecordCallSite->GetBuffer(value.callSig.sigInst_classInst_Index); + (CORINFO_CLASS_HANDLE*)RecordCallSiteWithSignature->GetBuffer(value.callSig.sigInst_classInst_Index); pCallSig->sigInst.methInstCount = (unsigned)value.callSig.sigInst_methInstCount; - pCallSig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)RecordCallSite->GetBuffer(value.callSig.sigInst_methInst_Index); + pCallSig->sigInst.methInst = (CORINFO_CLASS_HANDLE*)RecordCallSiteWithSignature->GetBuffer(value.callSig.sigInst_methInst_Index); pCallSig->args = (CORINFO_ARG_LIST_HANDLE)value.callSig.args; pCallSig->cbSig = (unsigned int)value.callSig.cbSig; - pCallSig->pSig = (PCCOR_SIGNATURE)RecordCallSite->GetBuffer(value.callSig.pSig_Index); + pCallSig->pSig = (PCCOR_SIGNATURE)RecordCallSiteWithSignature->GetBuffer(value.callSig.pSig_Index); pCallSig->scope = (CORINFO_MODULE_HANDLE)value.callSig.scope; pCallSig->token = (mdToken)value.callSig.token; @@ -1090,14 +1069,16 @@ bool CompileResult::fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO bool CompileResult::fndRecordCallSiteMethodHandle(ULONG instrOffset, CORINFO_METHOD_HANDLE* pMethodHandle) { - if (RecordCallSite == nullptr) - return false; - - if (RecordCallSite->GetIndex(instrOffset) == -1) - return false; - - Agnostic_RecordCallSite value = RecordCallSite->Get(instrOffset); - *pMethodHandle = (CORINFO_METHOD_HANDLE)value.methodHandle; - - return true; + + if (RecordCallSiteWithSignature != nullptr && RecordCallSiteWithSignature->GetIndex(instrOffset) != -1) + { + Agnostic_RecordCallSite value = RecordCallSiteWithSignature->Get(instrOffset); + *pMethodHandle = (CORINFO_METHOD_HANDLE)value.methodHandle; + } + else if (RecordCallSiteWithoutSignature != nullptr && RecordCallSiteWithoutSignature->GetIndex(instrOffset) != -1) + { + CORINFO_METHOD_HANDLE value = (CORINFO_METHOD_HANDLE)RecordCallSiteWithoutSignature->Get(instrOffset); + *pMethodHandle = value; + } + return false; } diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.h index 09ec839c4b52..7390611b6511 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/compileresult.h @@ -166,12 +166,6 @@ class CompileResult DWORD HandlerLength; DWORD ClassToken; // one view of symetric union }; - struct Agnostic_AllocMethodBlockCounts - { - DWORD count; - DWORD pBlockCounts_index; - DWORD result; - }; struct Agnostic_CORINFO_SIG_INFO2 { DWORD callConv; @@ -328,12 +322,9 @@ class CompileResult CorJitFuncKind funcKind); void dmpAllocUnwindInfo(DWORD key, const Agnostic_AllocUnwindInfo& value); - void recAllocMethodBlockCounts(ULONG count, ICorJitInfo::BlockCounts** pBlockCounts, HRESULT result); - void dmpAllocMethodBlockCounts(DWORD key, const Agnostic_AllocMethodBlockCounts& value); - HRESULT repAllocMethodBlockCounts(ULONG count, ICorJitInfo::BlockCounts** pBlockCounts); - void recRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle); - void dmpRecordCallSite(DWORD key, const Agnostic_RecordCallSite& value); + void dmpRecordCallSiteWithSignature(DWORD key, const Agnostic_RecordCallSite& value) const; + void dmpRecordCallSiteWithoutSignature(DWORD key, DWORDLONG methodHandle) const; void repRecordCallSite(ULONG instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_HANDLE methodHandle); bool fndRecordCallSiteSigInfo(ULONG instrOffset, CORINFO_SIG_INFO* pCallSig); bool fndRecordCallSiteMethodHandle(ULONG instrOffset, CORINFO_METHOD_HANDLE* pMethodHandle); diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/crlwmlist.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/crlwmlist.h index b42077de7abe..d9146674464b 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/crlwmlist.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/crlwmlist.h @@ -19,7 +19,6 @@ #endif LWM(AddressMap, DWORDLONG, CompileResult::Agnostic_AddressMap) -LWM(AllocMethodBlockCounts, DWORD, CompileResult::Agnostic_AllocMethodBlockCounts) LWM(AllocGCInfo, DWORD, CompileResult::Agnostic_AllocGCInfo) LWM(AllocMem, DWORD, CompileResult::Agnostic_AllocMemDetails) DENSELWM(AllocUnwindInfo, CompileResult::Agnostic_AllocUnwindInfo) @@ -30,7 +29,8 @@ LWM(CompileMethod, DWORD, CompileResult::Agnostic_CompileMethodResults) DENSELWM(MessageLog, DWORD) DENSELWM(MethodMustBeLoadedBeforeCodeIsRun, DWORDLONG) DENSELWM(ProcessName, DWORD) -LWM(RecordCallSite, DWORD, CompileResult::Agnostic_RecordCallSite) +LWM(RecordCallSiteWithSignature, DWORD, CompileResult::Agnostic_RecordCallSite) +LWM(RecordCallSiteWithoutSignature, DWORD, DWORDLONG) DENSELWM(RecordRelocation, CompileResult::Agnostic_RecordRelocation) DENSELWM(ReportFatalError, DWORD) DENSELWM(ReportInliningDecision, CompileResult::Agnostic_ReportInliningDecision) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h index 2a5594f81243..2cc65360a026 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lightweightmap.h @@ -78,6 +78,33 @@ class LightWeightMapBuffer return newOffset + sizeof(unsigned int); } + const unsigned char* CreateBuffer(unsigned int len) + { + if (len == 0) + { + return nullptr; + } + + if (locked) + { + LogError("Added item that extended the buffer after it was locked by a call to GetBuffer()"); + __debugbreak(); + } + + unsigned int newbuffsize = bufferLength + sizeof(unsigned int) + len; + unsigned char* newbuffer = new unsigned char[newbuffsize]; + unsigned int newOffset = bufferLength; + if (bufferLength > 0) + memcpy(newbuffer, buffer, bufferLength); + memset(newbuffer + bufferLength + sizeof(unsigned int), 0, len); + *((unsigned int*)(newbuffer + bufferLength)) = len; + bufferLength += sizeof(unsigned int) + len; + if (buffer != nullptr) + delete[] buffer; + buffer = newbuffer; + return buffer + newOffset + sizeof(unsigned int); + } + unsigned char* GetBuffer(unsigned int offset) { if (offset == (unsigned int)-1) @@ -342,7 +369,14 @@ class LightWeightMap : public LightWeightMapBuffer else if (res > 0) last = mid - 1; // repeat search in bottom half. else + { + int resItem = memcmp(&pItems[mid], &item, sizeof(_Item)); + if (resItem != 0) + { + LogDebug("Tried to add a new value for an existing key, the new value was ignored"); + } return false; // found it. return position ///// + } } insert = first; if (insert != (unsigned int)first) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h index 1922e7d0f5df..b9731198754a 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/lwmlist.h @@ -18,6 +18,7 @@ #define DENSELWM(map, value) LWM(map, this_is_an_error, value) #endif +LWM(AllocMethodBlockCounts, DWORD, Agnostic_AllocMethodBlockCounts) LWM(AppendClassName, Agnostic_AppendClassName, DWORD) LWM(AreTypesEquivalent, DLDL, DWORD) LWM(AsCorInfoType, DWORDLONG, DWORD) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index d45c5e07942d..b2443351f856 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -47,6 +47,7 @@ MethodContext::MethodContext() cr = new CompileResult(); index = -1; + isReadyToRunCompilation = ReadyToRunCompilation::Uninitialized; } MethodContext::~MethodContext() @@ -1119,6 +1120,8 @@ void MethodContext::recGetJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes, DW // zero. GetJitFlags->Add((DWORD)0, value); DEBUG_REC(dmpGetJitFlags((DWORD)0, value)); + InitReadyToRunFlag(jitFlags); + } void MethodContext::dmpGetJitFlags(DWORD key, DD value) { @@ -1132,6 +1135,7 @@ DWORD MethodContext::repGetJitFlags(CORJIT_FLAGS* jitFlags, DWORD sizeInBytes) CORJIT_FLAGS* resultFlags = (CORJIT_FLAGS*)GetJitFlags->GetBuffer(value.A); memcpy(jitFlags, resultFlags, value.B); DEBUG_REP(dmpGetJitFlags((DWORD)0, value)); + InitReadyToRunFlag(resultFlags); return value.B; } @@ -2453,7 +2457,7 @@ bool MethodContext::repConvertPInvokeCalliToCall(CORINFO_RESOLVED_TOKEN* pResolv key.B = (DWORD)pResolvedToken->token; DWORDLONG value = ConvertPInvokeCalliToCall->Get(key); - DEBUG_REP(dmpGetArgType(key, value)); + DEBUG_REP(dmpConvertPInvokeCalliToCall(key, value)); pResolvedToken->hMethod = (CORINFO_METHOD_HANDLE)value; return value != 0; @@ -3060,7 +3064,7 @@ void MethodContext::recResolveVirtualMethod(CORINFO_METHOD_HANDLE virtMethod, key.implementingClass = (DWORDLONG)implClass; key.ownerType = (DWORDLONG)ownerType; ResolveVirtualMethod->Add(key, (DWORDLONG)result); - DEBUG_REC(dmpResolveVirtualMethod(key, result)); + DEBUG_REC(dmpResolveVirtualMethod(key, (DWORDLONG)result)); } void MethodContext::dmpResolveVirtualMethod(const Agnostic_ResolveVirtualMethod& key, DWORDLONG value) @@ -3368,8 +3372,13 @@ void MethodContext::recGetFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndi value.fieldValue = (DWORD)-1; - // Make an attempt at stashing a copy of the value - if (result > (void*)0xffff) // TODO-Cleanup: sometimes there is a field offset? + AssertCodeMsg(isReadyToRunCompilation != ReadyToRunCompilation::Uninitialized, EXCEPTIONCODE_MC, + "ReadyToRun flag should be initialized"); + + // Make an attempt at stashing a copy of the value, Jit can try to access + // a static readonly field value. + if (isReadyToRunCompilation == ReadyToRunCompilation::NotReadyToRun && + result > (void*)0xffff) { DWORDLONG scratch = 0x4242424242424242; switch (cit) @@ -3408,8 +3417,9 @@ void MethodContext::recGetFieldAddress(CORINFO_FIELD_HANDLE field, void** ppIndi value.fieldValue = (DWORD)GetFieldAddress->AddBuffer((unsigned char*)result, sizeof(size_t), true); // important to not merge two fields into one address - GetFieldAddress->AddBuffer((unsigned char*)&scratch, sizeof(DWORD)); // Padding out the data so we can - // read it back "safetly" on x64 + GetFieldAddress->AddBuffer((unsigned char*)&scratch, sizeof(DWORD)); // Padding out the data so we + // can read it back "safetly" + // on x64 break; default: break; @@ -3429,8 +3439,13 @@ void* MethodContext::repGetFieldAddress(CORINFO_FIELD_HANDLE field, void** ppInd value = GetFieldAddress->Get((DWORDLONG)field); + AssertCodeMsg(isReadyToRunCompilation != ReadyToRunCompilation::Uninitialized, + EXCEPTIONCODE_MC, "isReadyToRunCompilation should be initialized"); + if (ppIndirection != nullptr) + { *ppIndirection = (void*)value.ppIndirection; + } void* temp; if (value.fieldValue != (DWORD)-1) @@ -3439,7 +3454,9 @@ void* MethodContext::repGetFieldAddress(CORINFO_FIELD_HANDLE field, void** ppInd cr->recAddressMap((void*)value.fieldAddress, temp, toCorInfoSize(repGetFieldType(field, nullptr, nullptr))); } else + { temp = (void*)value.fieldAddress; + } DEBUG_REP(dmpGetFieldAddress((DWORDLONG)field, value)); return temp; @@ -3458,7 +3475,7 @@ void MethodContext::recGetStaticFieldCurrentClass(CORINFO_FIELD_HANDLE field, value.isSpeculative = isSpeculative; GetStaticFieldCurrentClass->Add((DWORDLONG)field, value); - DEBUG_REC(dmpGetFieldAddress((DWORDLONG)field, value)); + DEBUG_REC(dmpGetStaticFieldCurrentClass((DWORDLONG)field, value)); } void MethodContext::dmpGetStaticFieldCurrentClass(DWORDLONG key, const Agnostic_GetStaticFieldCurrentClass& value) { @@ -3475,7 +3492,7 @@ CORINFO_CLASS_HANDLE MethodContext::repGetStaticFieldCurrentClass(CORINFO_FIELD_ } CORINFO_CLASS_HANDLE result = (CORINFO_CLASS_HANDLE)value.classHandle; - DEBUG_REP(dmpGetStaticFieldCurrentValue((DWORDLONG)field, value)); + DEBUG_REP(dmpGetStaticFieldCurrentClass((DWORDLONG)field, value)); return result; } @@ -5133,6 +5150,50 @@ DWORD MethodContext::repGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, v return (DWORD)value.B; } + +void MethodContext::recAllocMethodBlockCounts(ULONG count, ICorJitInfo::BlockCounts** pBlockCounts, HRESULT result) +{ + if (AllocMethodBlockCounts == nullptr) + AllocMethodBlockCounts = new LightWeightMap(); + + Agnostic_AllocMethodBlockCounts value; + + value.address = (DWORDLONG)*pBlockCounts; + value.count = (DWORD)count; + value.result = (DWORD)result; + + AllocMethodBlockCounts->Add((DWORD)0, value); +} +void MethodContext::dmpAllocMethodBlockCounts(DWORD key, const Agnostic_AllocMethodBlockCounts& value) +{ + printf("AllocMethodBlockCounts key %u, value addr-%016llX cnt-%u res-%08X", key, value.address, value.count, value.result); +} +HRESULT MethodContext::repAllocMethodBlockCounts(ULONG count, ICorJitInfo::BlockCounts** pBlockCounts) +{ + Agnostic_AllocMethodBlockCounts value; + value = AllocMethodBlockCounts->Get((DWORD)0); + + if (count != value.count) + { + LogWarning("AllocMethodBlockCount mismatch: record %d, replay %d", value.count, count); + } + + HRESULT result = (HRESULT)value.result; + + // Allocate a scratch buffer, linked to method context via AllocMethodBlockCounts, so it gets + // cleaned up when the method context does. + // + // We won't bother recording this via AddBuffer because currently SPMI will never look at it. + // But we need a writeable buffer because the jit will store IL offsets inside. + // + // Todo, perhaps: record the buffer as a compile result instead, and defer copying until + // jit completion so we can snapshot the offsets the jit writes. + // + *pBlockCounts = (ICorJitInfo::BlockCounts*)AllocMethodBlockCounts->CreateBuffer(count * sizeof(ICorJitInfo::BlockCounts)); + cr->recAddressMap((void*)value.address, (void*)*pBlockCounts, count * (sizeof(ICorJitInfo::BlockCounts))); + return result; +} + void MethodContext::recGetMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd, UINT32 * pCount, ICorJitInfo::BlockCounts** pBlockCounts, @@ -5226,6 +5287,7 @@ void MethodContext::recIsMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLA key.B = (DWORDLONG)cls2; IsMoreSpecificType->Add(key, (DWORD)result); + DEBUG_REC(dmpIsMoreSpecificType(key, (DWORD)result)); } void MethodContext::dmpIsMoreSpecificType(DLDL key, DWORD value) { @@ -5233,6 +5295,9 @@ void MethodContext::dmpIsMoreSpecificType(DLDL key, DWORD value) } BOOL MethodContext::repIsMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLASS_HANDLE cls2) { + AssertCodeMsg(IsMoreSpecificType != nullptr, EXCEPTIONCODE_MC, "Didn't find %016llX %016llX", (DWORDLONG)cls1, + (DWORDLONG)cls2); + DLDL key; ZeroMemory(&key, sizeof(DLDL)); // We use the input structs as a key and use memcmp to compare.. so we need to zero // out padding too @@ -5246,6 +5311,7 @@ BOOL MethodContext::repIsMoreSpecificType(CORINFO_CLASS_HANDLE cls1, CORINFO_CLA value = IsMoreSpecificType->Get(key); + DEBUG_REP(dmpIsMoreSpecificType(key, value)); return (BOOL)value; } @@ -6442,3 +6508,16 @@ bool MethodContext::IsStringContentEqual(LightWeightMap* prev, Lig return (prev == curr); } } + +void MethodContext::InitReadyToRunFlag(const CORJIT_FLAGS* jitFlags) +{ + if (jitFlags->IsSet(CORJIT_FLAGS::CORJIT_FLAG_READYTORUN)) + { + isReadyToRunCompilation = ReadyToRunCompilation::ReadyToRun; + } + else + { + isReadyToRunCompilation = ReadyToRunCompilation::NotReadyToRun; + } + +} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h index 36c0fbb478bb..2b0e6a9b55be 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontext.h @@ -422,6 +422,12 @@ class MethodContext DWORDLONG method; DWORDLONG delegateCls; }; + struct Agnostic_AllocMethodBlockCounts + { + DWORDLONG address; + DWORD count; + DWORD result; + }; struct Agnostic_GetMethodBlockCounts { DWORD count; @@ -1168,6 +1174,10 @@ class MethodContext void dmpGetFieldThreadLocalStoreID(DWORDLONG key, DLD value); DWORD repGetFieldThreadLocalStoreID(CORINFO_FIELD_HANDLE field, void** ppIndirection); + void recAllocMethodBlockCounts(ULONG count, ICorJitInfo::BlockCounts** pBlockCounts, HRESULT result); + void dmpAllocMethodBlockCounts(DWORD key, const Agnostic_AllocMethodBlockCounts& value); + HRESULT repAllocMethodBlockCounts(ULONG count, ICorJitInfo::BlockCounts** pBlockCounts); + void recGetMethodBlockCounts(CORINFO_METHOD_HANDLE ftnHnd, UINT32 * pCount, ICorJitInfo::BlockCounts** pBlockCounts, @@ -1319,6 +1329,17 @@ class MethodContext bool IsEnvironmentHeaderEqual(const Environment& prevEnv); bool IsEnvironmentContentEqual(const Environment& prevEnv); + enum class ReadyToRunCompilation + { + Uninitialized, + ReadyToRun, + NotReadyToRun + }; + + ReadyToRunCompilation isReadyToRunCompilation; + + void InitReadyToRunFlag(const CORJIT_FLAGS* jitFlags); + template static bool AreLWMHeadersEqual(LightWeightMap* prev, LightWeightMap* curr); static bool IsIntConfigContentEqual(LightWeightMap* prev, @@ -1338,6 +1359,7 @@ class MethodContext // ************************************************************************************* enum mcPackets { + Packet_AllocMethodBlockCounts = 131, Packet_AppendClassName = 149, // Added 8/6/2014 - needed for SIMD Packet_AreTypesEquivalent = 1, Packet_AsCorInfoType = 2, @@ -1493,7 +1515,6 @@ enum mcPackets Packet_ShouldEnforceCallvirtRestriction = 112, // Retired 2/18/2020 PacketCR_AddressMap = 113, - PacketCR_AllocMethodBlockCounts = 131, PacketCR_AllocGCInfo = 114, PacketCR_AllocMem = 115, PacketCR_AllocUnwindInfo = 132, @@ -1515,7 +1536,9 @@ enum mcPackets PacketCR_SetMethodAttribs = 129, PacketCR_SetVars = 130, PacketCR_SetPatchpointInfo = 176, // added 8/5/2019 - PacketCR_RecordCallSite = 146, // Added 10/28/2013 - to support indirect calls + PacketCR_RecordCallSite = 146, // Retired 9/13/2020 + PacketCR_RecordCallSiteWithSignature = 179, // Added 9/13/2020 + PacketCR_RecordCallSiteWithoutSignature = 180, // Added 9/13/2020 }; #endif diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp index 84fdd6ca2021..06a5826c1469 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/methodcontextreader.cpp @@ -81,7 +81,7 @@ MethodContextReader::MethodContextReader( , Offset(offset) , Increment(increment) { - this->mutex = CreateMutexA(NULL, FALSE, nullptr); + this->mutex = CreateMutexW(NULL, FALSE, nullptr); std::string tocFileName, mchFileName; diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/registertablexarch.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/registertablexarch.h deleted file mode 100644 index f6c177cd04cb..000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/registertablexarch.h +++ /dev/null @@ -1,124 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// - -//---------------------------------------------------------- -// RegisterTableXarch.h - X macro table for x86/AMD64 registers, for use with DISX86 -//---------------------------------------------------------- - -#ifndef REGDEF -#error Must define REGDEF macro before including this file -#endif - -/* -REGDEF(msdisID, name) -*/ - -// 32 bit general purpose registers -REGDEF(DISX86::REGA::regaEax, "eax") -REGDEF(DISX86::REGA::regaEcx, "ecx") -REGDEF(DISX86::REGA::regaEdx, "edx") -REGDEF(DISX86::REGA::regaEbx, "ebx") -REGDEF(DISX86::REGA::regaEsp, "esp") -REGDEF(DISX86::REGA::regaEbp, "ebp") -REGDEF(DISX86::REGA::regaEsi, "esi") -REGDEF(DISX86::REGA::regaEdi, "edi") -REGDEF(DISX86::REGA::regaR8d, "r8d") -REGDEF(DISX86::REGA::regaR9d, "r9d") -REGDEF(DISX86::REGA::regaR10d, "r10d") -REGDEF(DISX86::REGA::regaR11d, "r11d") -REGDEF(DISX86::REGA::regaR12d, "r12d") -REGDEF(DISX86::REGA::regaR13d, "r13d") -REGDEF(DISX86::REGA::regaR14d, "r14d") -REGDEF(DISX86::REGA::regaR15d, "r15d") - -// 64 bit general purpose registers -REGDEF(DISX86::REGA::regaRax, "rax") -REGDEF(DISX86::REGA::regaRcx, "rcx") -REGDEF(DISX86::REGA::regaRdx, "rdx") -REGDEF(DISX86::REGA::regaRbx, "rbx") -REGDEF(DISX86::REGA::regaRsp, "rsp") -REGDEF(DISX86::REGA::regaRbp, "rbp") -REGDEF(DISX86::REGA::regaRsi, "rsi") -REGDEF(DISX86::REGA::regaRdi, "rdi") -REGDEF(DISX86::REGA::regaR8, "r8") -REGDEF(DISX86::REGA::regaR9, "r9") -REGDEF(DISX86::REGA::regaR10, "r10") -REGDEF(DISX86::REGA::regaR11, "r11") -REGDEF(DISX86::REGA::regaR12, "r12") -REGDEF(DISX86::REGA::regaR13, "r13") -REGDEF(DISX86::REGA::regaR14, "r14") -REGDEF(DISX86::REGA::regaR15, "r15") - -// 16 bit general purpose registers -REGDEF(DISX86::REGA::regaAx, "ax") -REGDEF(DISX86::REGA::regaCx, "cx") -REGDEF(DISX86::REGA::regaDx, "dx") -REGDEF(DISX86::REGA::regaBx, "bx") -REGDEF(DISX86::REGA::regaSp, "sp") -REGDEF(DISX86::REGA::regaBp, "bp") -REGDEF(DISX86::REGA::regaSi, "si") -REGDEF(DISX86::REGA::regaDi, "di") -REGDEF(DISX86::REGA::regaR8w, "r8w") -REGDEF(DISX86::REGA::regaR9w, "r9w") -REGDEF(DISX86::REGA::regaR10w, "r10w") -REGDEF(DISX86::REGA::regaR11w, "r11w") -REGDEF(DISX86::REGA::regaR12w, "r12w") -REGDEF(DISX86::REGA::regaR13w, "r13w") -REGDEF(DISX86::REGA::regaR14w, "r14w") -REGDEF(DISX86::REGA::regaR15w, "r15w") - -// 8 bit general purpose registers -REGDEF(DISX86::REGA::regaAl, "al") -REGDEF(DISX86::REGA::regaCl, "cl") -REGDEF(DISX86::REGA::regaDl, "dl") -REGDEF(DISX86::REGA::regaBl, "bl") -REGDEF(DISX86::REGA::regaSpl, "spl") -REGDEF(DISX86::REGA::regaBpl, "bpl") -REGDEF(DISX86::REGA::regaSil, "sil") -REGDEF(DISX86::REGA::regaDil, "dil") -REGDEF(DISX86::REGA::regaR8b, "r8b") -REGDEF(DISX86::REGA::regaR9b, "r9b") -REGDEF(DISX86::REGA::regaR10b, "r10b") -REGDEF(DISX86::REGA::regaR11b, "r11b") -REGDEF(DISX86::REGA::regaR12b, "r12b") -REGDEF(DISX86::REGA::regaR13b, "r13b") -REGDEF(DISX86::REGA::regaR14b, "r14b") -REGDEF(DISX86::REGA::regaR15b, "r15b") - -// 8 bit general purpose registers -REGDEF(DISX86::REGA::regaAh, "ah") -REGDEF(DISX86::REGA::regaCh, "ch") -REGDEF(DISX86::REGA::regaDh, "dh") -REGDEF(DISX86::REGA::regaBh, "bh") - -// x87 floating point stack -REGDEF(DISX86::REGA::regaSt0, "st0") -REGDEF(DISX86::REGA::regaSt1, "st1") -REGDEF(DISX86::REGA::regaSt2, "st2") -REGDEF(DISX86::REGA::regaSt3, "st3") -REGDEF(DISX86::REGA::regaSt4, "st4") -REGDEF(DISX86::REGA::regaSt5, "st5") -REGDEF(DISX86::REGA::regaSt6, "st6") -REGDEF(DISX86::REGA::regaSt7, "st7") - -// XMM registers -REGDEF(DISX86::REGA::regaXmm0, "xmm0") -REGDEF(DISX86::REGA::regaXmm1, "xmm1") -REGDEF(DISX86::REGA::regaXmm2, "xmm2") -REGDEF(DISX86::REGA::regaXmm3, "xmm3") -REGDEF(DISX86::REGA::regaXmm4, "xmm4") -REGDEF(DISX86::REGA::regaXmm5, "xmm5") -REGDEF(DISX86::REGA::regaXmm6, "xmm6") -REGDEF(DISX86::REGA::regaXmm7, "xmm7") -REGDEF(DISX86::REGA::regaXmm8, "xmm8") -REGDEF(DISX86::REGA::regaXmm9, "xmm9") -REGDEF(DISX86::REGA::regaXmm10, "xmm10") -REGDEF(DISX86::REGA::regaXmm11, "xmm11") -REGDEF(DISX86::REGA::regaXmm12, "xmm12") -REGDEF(DISX86::REGA::regaXmm13, "xmm13") -REGDEF(DISX86::REGA::regaXmm14, "xmm14") -REGDEF(DISX86::REGA::regaXmm15, "xmm15") - -#undef REGDEF diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt index 5c7310f4e91e..b1b5c5696732 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/CMakeLists.txt @@ -8,7 +8,7 @@ add_definitions(-DSELF_NO_HOST) if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) endif(CLR_CMAKE_HOST_WIN32) include_directories(.) @@ -44,7 +44,7 @@ _add_library(superpmi-shim-collector ${SUPERPMI_SHIM_COLLECTOR_SOURCES} ) -target_precompile_header(TARGET superpmi-shim-collector HEADER standardpch.h) +target_precompile_headers(superpmi-shim-collector PRIVATE "$<$:standardpch.h>") if(CLR_CMAKE_HOST_UNIX) target_link_libraries(superpmi-shim-collector @@ -60,7 +60,7 @@ else() ${STATIC_MT_CPP_LIB} ) - _install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$/superpmi-shim-collector.pdb DESTINATION PDB) + _install (FILES $ DESTINATION PDB) endif(CLR_CMAKE_HOST_UNIX) _install (TARGETS superpmi-shim-collector DESTINATION .) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp index e55e7093e52c..10bcb3c0a998 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitcompiler.cpp @@ -41,7 +41,6 @@ CorJitResult __stdcall interceptor_ICJC::compileMethod(ICorJitInfo* our_ICorJitInfo.getBuiltinClass(CLASSID_FIELD_HANDLE); our_ICorJitInfo.getBuiltinClass(CLASSID_METHOD_HANDLE); our_ICorJitInfo.getBuiltinClass(CLASSID_STRING); - our_ICorJitInfo.getBuiltinClass(CLASSID_ARGUMENT_HANDLE); our_ICorJitInfo.getBuiltinClass(CLASSID_RUNTIME_TYPE); #ifdef fatMC diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp index f5b69299113e..bb1bba81f01d 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -2030,7 +2030,7 @@ HRESULT interceptor_ICJI::allocMethodBlockCounts(UINT32 count, // The n { mc->cr->AddCall("allocMethodBlockCounts"); HRESULT result = original_ICorJitInfo->allocMethodBlockCounts(count, pBlockCounts); - mc->cr->recAllocMethodBlockCounts(count, pBlockCounts, result); + mc->recAllocMethodBlockCounts(count, pBlockCounts, result); return result; } diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt index d3d9a5278677..0e65456fc5c2 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-counter/CMakeLists.txt @@ -8,7 +8,7 @@ add_definitions(-DSELF_NO_HOST) if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) endif(CLR_CMAKE_HOST_WIN32) include_directories(.) @@ -46,7 +46,7 @@ _add_library(superpmi-shim-counter ${SUPERPMI_SHIM_COUNTER_SOURCES} ) -target_precompile_header(TARGET superpmi-shim-counter HEADER standardpch.h) +target_precompile_headers(superpmi-shim-counter PRIVATE "$<$:standardpch.h>") if(CLR_CMAKE_HOST_UNIX) target_link_libraries(superpmi-shim-counter @@ -62,7 +62,7 @@ else() ${STATIC_MT_CPP_LIB} ) - _install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$/superpmi-shim-counter.pdb DESTINATION PDB) + _install (FILES $ DESTINATION PDB) endif(CLR_CMAKE_HOST_UNIX) _install (TARGETS superpmi-shim-counter DESTINATION .) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt index cb4caded38d0..72fdf073a6d3 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shim-simple/CMakeLists.txt @@ -8,7 +8,7 @@ add_definitions(-DSELF_NO_HOST) if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) endif(CLR_CMAKE_HOST_WIN32) include_directories(.) @@ -45,7 +45,7 @@ _add_library(superpmi-shim-simple ${SUPERPMI_SHIM_SIMPLE_SOURCES} ) -target_precompile_header(TARGET superpmi-shim-simple HEADER standardpch.h) +target_precompile_headers(superpmi-shim-simple PRIVATE "$<$:standardpch.h>") if(CLR_CMAKE_HOST_UNIX) target_link_libraries(superpmi-shim-simple @@ -61,7 +61,7 @@ else() ${STATIC_MT_CPP_LIB} ) - _install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$/superpmi-shim-simple.pdb DESTINATION PDB) + _install (FILES $ DESTINATION PDB) endif(CLR_CMAKE_HOST_UNIX) _install (TARGETS superpmi-shim-simple DESTINATION .) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/CMakeLists.txt b/src/coreclr/src/ToolBox/superpmi/superpmi/CMakeLists.txt index adc3cde6a178..3bc6ca865572 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/CMakeLists.txt @@ -9,7 +9,7 @@ add_definitions(-DUSE_COREDISTOOLS) if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) endif(CLR_CMAKE_HOST_WIN32) include_directories(.) @@ -45,7 +45,7 @@ _add_executable(superpmi ${SUPERPMI_SOURCES} ) -target_precompile_header(TARGET superpmi HEADER standardpch.h) +target_precompile_headers(superpmi PRIVATE "$<$:standardpch.h>") if(CLR_CMAKE_HOST_UNIX) target_link_libraries(superpmi @@ -62,7 +62,7 @@ else() ${STATIC_MT_CPP_LIB} ) - _install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$/superpmi.pdb DESTINATION PDB) + _install (FILES $ DESTINATION PDB) endif(CLR_CMAKE_HOST_UNIX) _install (TARGETS superpmi DESTINATION .) diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/filecache.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/filecache.cpp deleted file mode 100644 index 0455fa9fe7a6..000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/filecache.cpp +++ /dev/null @@ -1,140 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// - -// TODO-Cleanup: this class is unused - -#include "standardpch.h" -#include "filecache.h" - -#define FileCacheSize 0xFFFFFF // needs to be bigger than the biggest read request. - -HANDLE FileCache::cachedHandle; -bool FileCache::openAsCache; -BYTE* FileCache::rawBuff; -unsigned int FileCache::offset; -unsigned int FileCache::length; -__int64 FileCache::fileoffset; - -HANDLE -FileCache::CreateFileA(_In_ LPCSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile) -{ - openAsCache = false; - rawBuff = nullptr; - offset = 0; - length = 0; - - if ((dwShareMode & CACHE_THIS_FILE) == CACHE_THIS_FILE) - { - dwShareMode ^= CACHE_THIS_FILE; - openAsCache = true; - } - HANDLE temp = ::CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, - dwFlagsAndAttributes, hTemplateFile); - if (openAsCache) - cachedHandle = temp; // yes yes.. this is unsafe.. but one accessor now is okay. bswhack - return temp; -} - -HANDLE -FileCache::CreateFileW(_In_ LPCWSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile) -{ - openAsCache = false; - rawBuff = nullptr; - offset = 0; - length = 0; - return ::CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, - dwFlagsAndAttributes, hTemplateFile); -} - -// Somewhat sloppy quick copy... we don't treat lpNumberOfBytesRead etc correctly -BOOL FileCache::ReadFile(_In_ HANDLE hFile, - _Out_writes_bytes_to_opt_(nNumberOfBytesToRead, *lpNumberOfBytesRead) __out_data_source(FILE) - LPVOID lpBuffer, - _In_ DWORD nNumberOfBytesToRead, - _Out_opt_ LPDWORD lpNumberOfBytesRead, - _Inout_opt_ LPOVERLAPPED lpOverlapped) -{ - if (!openAsCache) - return ::ReadFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped); - else - { - if (rawBuff == nullptr) - { - rawBuff = new BYTE[FileCacheSize]; - length = FileCacheSize; - offset = FileCacheSize; - } - if (nNumberOfBytesToRead > FileCacheSize) - { - printf("ERROR: nNumberOfBytesToRead exceeds FileCacheSize %u > %u\n", nNumberOfBytesToRead, FileCacheSize); - __debugbreak(); - } - if ((offset + nNumberOfBytesToRead) > length) - { - memmove(rawBuff, &rawBuff[offset], - length - offset); // Use memmove since we have overlapping regions more than half the time - ::ReadFile(hFile, &rawBuff[length - offset], offset, lpNumberOfBytesRead, lpOverlapped); - if (*lpNumberOfBytesRead == 0) - __debugbreak(); - length -= offset - (*lpNumberOfBytesRead); - LARGE_INTEGER DataTemp; - LARGE_INTEGER zero; - zero.QuadPart = 0; - ::SetFilePointerEx(hFile, zero, &DataTemp, FILE_CURRENT); - fileoffset = DataTemp.QuadPart; - - offset = 0; - } - memcpy(lpBuffer, &rawBuff[offset], nNumberOfBytesToRead); - offset += nNumberOfBytesToRead; - if (offset > FileCacheSize) - __debugbreak(); - return true; - } -} - -BOOL FileCache::WriteFile(_In_ HANDLE hFile, - _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, - _In_ DWORD nNumberOfBytesToWrite, - _Out_opt_ LPDWORD lpNumberOfBytesWritten, - _Inout_opt_ LPOVERLAPPED lpOverlapped) -{ - if (!openAsCache) - return ::WriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped); - else - { - printf("ERROR: We only support one file open via the cache.\n"); - __debugbreak(); - return false; - } -} - -BOOL FileCache::CloseHandle(_In_ HANDLE hObject) -{ - if (!openAsCache) - return ::CloseHandle(hObject); - else - { - if (rawBuff != nullptr) - delete[] rawBuff; - return ::CloseHandle(hObject); - } -} -__int64 FileCache::GetFilePos(HANDLE hFile) -{ - return (fileoffset - (__int64)length) + (__int64)offset; -} diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/filecache.h b/src/coreclr/src/ToolBox/superpmi/superpmi/filecache.h deleted file mode 100644 index 876100ec6e49..000000000000 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/filecache.h +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -// - -// TODO-Cleanup: this class is unused - -//---------------------------------------------------------- -// FileCache.h - very simple read ahead/ReadFile abstraction -//---------------------------------------------------------- -#ifndef _FileCache -#define _FileCache - -#define WIN32_LEAN_AND_MEAN -#include - -#define CACHE_THIS_FILE 0xFF - -class FileCache -{ -public: - static HANDLE CreateFileA(_In_ LPCSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile); - - static HANDLE CreateFileW(_In_ LPCWSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile); - - static BOOL ReadFile(_In_ HANDLE hFile, - _Out_writes_bytes_to_opt_(nNumberOfBytesToRead, *lpNumberOfBytesRead) __out_data_source(FILE) - LPVOID lpBuffer, - _In_ DWORD nNumberOfBytesToRead, - _Out_opt_ LPDWORD lpNumberOfBytesRead, - _Inout_opt_ LPOVERLAPPED lpOverlapped); - - static BOOL WriteFile(_In_ HANDLE hFile, - _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, - _In_ DWORD nNumberOfBytesToWrite, - _Out_opt_ LPDWORD lpNumberOfBytesWritten, - _Inout_opt_ LPOVERLAPPED lpOverlapped); - - static BOOL CloseHandle(_In_ HANDLE hObject); - - static __int64 GetFilePos(HANDLE hFile); - -private: - static HANDLE cachedHandle; - static bool openAsCache; - static BYTE* rawBuff; - static unsigned int offset; - static unsigned int length; - static __int64 fileoffset; -}; -#endif diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp index f0e2114d992c..6b8f4540a522 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp @@ -1784,7 +1784,7 @@ HRESULT MyICJI::allocMethodBlockCounts(UINT32 count, // The number of b BlockCounts** pBlockCounts) { jitInstance->mc->cr->AddCall("allocMethodBlockCounts"); - return jitInstance->mc->cr->repAllocMethodBlockCounts(count, pBlockCounts); + return jitInstance->mc->repAllocMethodBlockCounts(count, pBlockCounts); } // get profile information to be used for optimizing the current method. The format diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp b/src/coreclr/src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp index 88dd861ee48e..d3ed43bf90e1 100644 --- a/src/coreclr/src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp +++ b/src/coreclr/src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp @@ -31,9 +31,18 @@ bool StartProcess(char* commandLine, HANDLE hStdOutput, HANDLE hStdError, HANDLE ZeroMemory(&pi, sizeof(pi)); +#if TARGET_UNIX + const unsigned cmdLen = (unsigned)strlen(commandLine) + 1; + WCHAR* cmdLineW = new WCHAR[cmdLen]; + MultiByteToWideChar(CP_UTF8, 0, commandLine, cmdLen, cmdLineW, cmdLen); +#endif // Start the child process. if (!CreateProcess(NULL, // No module name (use command line) +#if TARGET_UNIX + cmdLineW, // Command line +#else commandLine, // Command line +#endif NULL, // Process handle not inheritable NULL, // Thread handle not inheritable TRUE, // Set handle inheritance to TRUE (required to use STARTF_USESTDHANDLES) @@ -45,10 +54,17 @@ bool StartProcess(char* commandLine, HANDLE hStdOutput, HANDLE hStdError, HANDLE { LogError("CreateProcess failed (%d). CommandLine: %s", GetLastError(), commandLine); *hProcess = INVALID_HANDLE_VALUE; +#if TARGET_UNIX + delete[] cmdLineW; +#endif return false; } *hProcess = pi.hProcess; + +#if TARGET_UNIX + delete[] cmdLineW; +#endif return true; } @@ -382,7 +398,6 @@ char* ConstructChildProcessArgs(const CommandLine::Options& o) ADDARG_STRING(o.reproName, "-reproName"); ADDARG_STRING(o.writeLogFile, "-writeLogFile"); ADDARG_STRING(o.methodStatsTypes, "-emitMethodStats"); - ADDARG_STRING(o.reproName, "-reproName"); ADDARG_STRING(o.hash, "-matchHash"); ADDARG_STRING(o.targetArchitecture, "-target"); ADDARG_STRING(o.compileList, "-compile"); diff --git a/src/coreclr/src/binder/CMakeLists.txt b/src/coreclr/src/binder/CMakeLists.txt index 9c242ed1518d..208f1214dd0d 100644 --- a/src/coreclr/src/binder/CMakeLists.txt +++ b/src/coreclr/src/binder/CMakeLists.txt @@ -82,11 +82,13 @@ endif(CLR_CMAKE_TARGET_WIN32) convert_to_absolute_path(BINDER_SOURCES ${BINDER_SOURCES}) convert_to_absolute_path(BINDER_CROSSGEN_SOURCES ${BINDER_CROSSGEN_SOURCES}) -add_library_clr(v3binder +add_library_clr(v3binder_obj OBJECT ${BINDER_SOURCES} ) -add_dependencies(v3binder eventing_headers) +add_dependencies(v3binder_obj eventing_headers) +add_library(v3binder INTERFACE) +target_sources(v3binder INTERFACE $) add_library_clr(v3binder_crossgen STATIC diff --git a/src/coreclr/src/binder/applicationcontext.cpp b/src/coreclr/src/binder/applicationcontext.cpp index d19029548541..f865b4240490 100644 --- a/src/coreclr/src/binder/applicationcontext.cpp +++ b/src/coreclr/src/binder/applicationcontext.cpp @@ -127,74 +127,6 @@ namespace BINDER_SPACE return hr; } - HRESULT GetNextPath(SString& paths, SString::Iterator& startPos, SString& outPath) - { - HRESULT hr = S_OK; - - bool wrappedWithQuotes = false; - - // Skip any leading spaces or path separators - while (paths.Skip(startPos, W(' ')) || paths.Skip(startPos, PATH_SEPARATOR_CHAR_W)) {} - - if (startPos == paths.End()) - { - // No more paths in the string and we just skipped over some white space - outPath.Set(W("")); - return S_FALSE; - } - - // Support paths being wrapped with quotations - if (paths.Skip(startPos, W('\"'))) - { - wrappedWithQuotes = true; - } - - SString::Iterator iEnd = startPos; // Where current path ends - SString::Iterator iNext; // Where next path starts - if (wrappedWithQuotes) - { - if (paths.Find(iEnd, W('\"'))) - { - iNext = iEnd; - // Find where the next path starts - there should be a path separator right after the closing quotation mark - if (paths.Find(iNext, PATH_SEPARATOR_CHAR_W)) - { - iNext++; - } - else - { - iNext = paths.End(); - } - } - else - { - // There was no terminating quotation mark - that's bad - GO_WITH_HRESULT(E_INVALIDARG); - } - } - else if (paths.Find(iEnd, PATH_SEPARATOR_CHAR_W)) - { - iNext = iEnd + 1; - } - else - { - iNext = iEnd = paths.End(); - } - - // Skip any trailing spaces - while (iEnd[-1] == W(' ')) - { - iEnd--; - } - - _ASSERTE(startPos < iEnd); - - outPath.Set(paths, startPos, iEnd); - startPos = iNext; - Exit: - return hr; - } - HRESULT ApplicationContext::SetupBindingPaths(SString &sTrustedPlatformAssemblies, SString &sPlatformResourceRoots, SString &sAppPaths, @@ -221,64 +153,15 @@ namespace BINDER_SPACE for (SString::Iterator i = sTrustedPlatformAssemblies.Begin(); i != sTrustedPlatformAssemblies.End(); ) { SString fileName; + SString simpleName; + bool isNativeImage = false; HRESULT pathResult = S_OK; - IF_FAIL_GO(pathResult = GetNextPath(sTrustedPlatformAssemblies, i, fileName)); + IF_FAIL_GO(pathResult = GetNextTPAPath(sTrustedPlatformAssemblies, i, /*dllOnly*/ false, fileName, simpleName, isNativeImage)); if (pathResult == S_FALSE) { break; } -#ifndef CROSSGEN_COMPILE - if (Path::IsRelative(fileName)) - { - GO_WITH_HRESULT(E_INVALIDARG); - } -#endif - - // Find the beginning of the simple name - SString::Iterator iSimpleNameStart = fileName.End(); - - if (!fileName.FindBack(iSimpleNameStart, DIRECTORY_SEPARATOR_CHAR_W)) - { - iSimpleNameStart = fileName.Begin(); - } - else - { - // Advance past the directory separator to the first character of the file name - iSimpleNameStart++; - } - - if (iSimpleNameStart == fileName.End()) - { - GO_WITH_HRESULT(E_INVALIDARG); - } - - SString simpleName; - bool isNativeImage = false; - - // GCC complains if we create SStrings inline as part of a function call - SString sNiDll(W(".ni.dll")); - SString sNiExe(W(".ni.exe")); - SString sDll(W(".dll")); - SString sExe(W(".exe")); - - if (fileName.EndsWithCaseInsensitive(sNiDll) || - fileName.EndsWithCaseInsensitive(sNiExe)) - { - simpleName.Set(fileName, iSimpleNameStart, fileName.End() - 7); - isNativeImage = true; - } - else if (fileName.EndsWithCaseInsensitive(sDll) || - fileName.EndsWithCaseInsensitive(sExe)) - { - simpleName.Set(fileName, iSimpleNameStart, fileName.End() - 4); - } - else - { - // Invalid filename - GO_WITH_HRESULT(E_INVALIDARG); - } - const SimpleNameToFileNameMapEntry *pExistingEntry = m_pTrustedPlatformAssemblyMap->LookupPtr(simpleName.GetUnicode()); if (pExistingEntry != nullptr) diff --git a/src/coreclr/src/binder/assemblybinder.cpp b/src/coreclr/src/binder/assemblybinder.cpp index 5f13adc7b2c8..aa29465af824 100644 --- a/src/coreclr/src/binder/assemblybinder.cpp +++ b/src/coreclr/src/binder/assemblybinder.cpp @@ -22,6 +22,7 @@ #include "utils.hpp" #include "variables.hpp" #include "stringarraylist.h" +#include "configuration.h" #define APP_DOMAIN_LOCKED_UNLOCKED 0x02 #define APP_DOMAIN_LOCKED_CONTEXT 0x04 @@ -401,14 +402,59 @@ namespace BINDER_SPACE sCoreLib.Set(systemDirectory); CombinePath(sCoreLib, sCoreLibName, sCoreLib); - IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib, - TRUE /* fIsInGAC */, - fBindToNativeImage, - &pSystemAssembly, - NULL /* szMDAssemblyPath */, - bundleFileLocation)); + hr = AssemblyBinder::GetAssembly(sCoreLib, + TRUE /* fIsInGAC */, + fBindToNativeImage, + &pSystemAssembly, + NULL /* szMDAssemblyPath */, + bundleFileLocation); BinderTracing::PathProbed(sCoreLib, pathSource, hr); + if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) + { + // Try to find corelib in the TPA + StackSString sCoreLibSimpleName(CoreLibName_W); + StackSString sTrustedPlatformAssemblies = Configuration::GetKnobStringValue(W("TRUSTED_PLATFORM_ASSEMBLIES")); + sTrustedPlatformAssemblies.Normalize(); + + bool found = false; + for (SString::Iterator i = sTrustedPlatformAssemblies.Begin(); i != sTrustedPlatformAssemblies.End(); ) + { + SString fileName; + SString simpleName; + bool isNativeImage = false; + HRESULT pathResult = S_OK; + IF_FAIL_GO(pathResult = GetNextTPAPath(sTrustedPlatformAssemblies, i, /*dllOnly*/ true, fileName, simpleName, isNativeImage)); + if (pathResult == S_FALSE) + { + break; + } + + if (simpleName.EqualsCaseInsensitive(sCoreLibSimpleName)) + { + sCoreLib = fileName; + found = true; + break; + } + } + + if (!found) + { + GO_WITH_HRESULT(HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)); + } + + hr = AssemblyBinder::GetAssembly(sCoreLib, + TRUE /* fIsInGAC */, + fBindToNativeImage, + &pSystemAssembly, + NULL /* szMDAssemblyPath */, + bundleFileLocation); + + BinderTracing::PathProbed(sCoreLib, BinderTracing::PathSource::ApplicationAssemblies, hr); + } + + IF_FAIL_GO(hr); + *ppSystemAssembly = pSystemAssembly.Extract(); Exit: @@ -447,25 +493,25 @@ namespace BINDER_SPACE // Satellite assembly's path: // * Absolute path when looking for a file on disk // * Bundle-relative path when looking within the single-file bundle. - StackSString sMscorlibSatellite; + StackSString sCoreLibSatellite; BinderTracing::PathSource pathSource = BinderTracing::PathSource::Bundle; BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle(relativePath, /*pathIsBundleRelative */ true); if (!bundleFileLocation.IsValid()) { - sMscorlibSatellite.Set(systemDirectory); + sCoreLibSatellite.Set(systemDirectory); pathSource = BinderTracing::PathSource::ApplicationAssemblies; } - CombinePath(sMscorlibSatellite, relativePath, sMscorlibSatellite); + CombinePath(sCoreLibSatellite, relativePath, sCoreLibSatellite); ReleaseHolder pSystemAssembly; - IF_FAIL_GO(AssemblyBinder::GetAssembly(sMscorlibSatellite, + IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLibSatellite, TRUE /* fIsInGAC */, FALSE /* fExplicitBindToNativeImage */, &pSystemAssembly, NULL /* szMDAssemblyPath */, bundleFileLocation)); - BinderTracing::PathProbed(sMscorlibSatellite, pathSource, hr); + BinderTracing::PathProbed(sCoreLibSatellite, pathSource, hr); *ppSystemAssembly = pSystemAssembly.Extract(); diff --git a/src/coreclr/src/binder/assemblyname.cpp b/src/coreclr/src/binder/assemblyname.cpp index b073dc66f88b..71e70283c0b3 100644 --- a/src/coreclr/src/binder/assemblyname.cpp +++ b/src/coreclr/src/binder/assemblyname.cpp @@ -315,10 +315,10 @@ namespace BINDER_SPACE return ulRef; } - BOOL AssemblyName::IsMscorlib() + BOOL AssemblyName::IsCoreLib() { // TODO: Is this simple comparison enough? - return EqualsCaseInsensitive(GetSimpleName(), g_BinderVariables->mscorlib); + return EqualsCaseInsensitive(GetSimpleName(), g_BinderVariables->corelib); } ULONG AssemblyName::Hash(DWORD dwIncludeFlags) diff --git a/src/coreclr/src/binder/bindertracing.cpp b/src/coreclr/src/binder/bindertracing.cpp index 2e5c83d7b09b..29ba819ee6c9 100644 --- a/src/coreclr/src/binder/bindertracing.cpp +++ b/src/coreclr/src/binder/bindertracing.cpp @@ -216,14 +216,14 @@ namespace BinderTracing AssemblyBindOperation::~AssemblyBindOperation() { - if (!BinderTracing::IsEnabled() || ShouldIgnoreBind()) - return; - - // Make sure the bind request is populated. Tracing may have been enabled mid-bind. - if (!m_populatedBindRequest) - PopulateBindRequest(m_bindRequest); + if (BinderTracing::IsEnabled() && !ShouldIgnoreBind()) + { + // Make sure the bind request is populated. Tracing may have been enabled mid-bind. + if (!m_populatedBindRequest) + PopulateBindRequest(m_bindRequest); - FireAssemblyLoadStop(m_bindRequest, m_resultAssembly, m_cached); + FireAssemblyLoadStop(m_bindRequest, m_resultAssembly, m_cached); + } if (m_resultAssembly != nullptr) m_resultAssembly->Release(); @@ -246,7 +246,7 @@ namespace BinderTracing // ActivityTracker or EventSource may have triggered the system satellite load. // Don't track system satellite binding to avoid potential infinite recursion. - m_ignoreBind = m_bindRequest.AssemblySpec->IsMscorlibSatellite(); + m_ignoreBind = m_bindRequest.AssemblySpec->IsCoreLibSatellite(); m_checkedIgnoreBind = true; return m_ignoreBind; } diff --git a/src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp b/src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp index f492adfab28b..69d8d8337289 100644 --- a/src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp +++ b/src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp @@ -20,8 +20,8 @@ HRESULT CLRPrivBinderAssemblyLoadContext::BindAssemblyByNameWorker(BINDER_SPACE: HRESULT hr = S_OK; #ifdef _DEBUG - // MSCORLIB should be bound using BindToSystem - _ASSERTE(!pAssemblyName->IsMscorlib()); + // CoreLib should be bound using BindToSystem + _ASSERTE(!pAssemblyName->IsCoreLib()); #endif // Do we have the assembly already loaded in the context of the current binder? @@ -145,7 +145,7 @@ HRESULT CLRPrivBinderAssemblyLoadContext::BindUsingPEImage( /* in */ PEImage *pP // Disallow attempt to bind to the core library. Aside from that, // the LoadContext can load any assembly (even if it was in a different LoadContext like TPA). - if (pAssemblyName->IsMscorlib()) + if (pAssemblyName->IsCoreLib()) { IF_FAIL_GO(HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)); } diff --git a/src/coreclr/src/binder/clrprivbindercoreclr.cpp b/src/coreclr/src/binder/clrprivbindercoreclr.cpp index 1045cb93e76d..571e127d7dab 100644 --- a/src/coreclr/src/binder/clrprivbindercoreclr.cpp +++ b/src/coreclr/src/binder/clrprivbindercoreclr.cpp @@ -20,8 +20,8 @@ HRESULT CLRPrivBinderCoreCLR::BindAssemblyByNameWorker(BINDER_SPACE::AssemblyNam HRESULT hr = S_OK; #ifdef _DEBUG - // MSCORLIB should be bound using BindToSystem - _ASSERTE(!pAssemblyName->IsMscorlib()); + // CoreLib should be bound using BindToSystem + _ASSERTE(!pAssemblyName->IsCoreLib()); #endif hr = AssemblyBinder::BindAssembly(&m_appContext, @@ -49,76 +49,72 @@ HRESULT CLRPrivBinderCoreCLR::BindAssemblyByName(IAssemblyName *pIAssemblyNa HRESULT hr = S_OK; VALIDATE_ARG_RET(pIAssemblyName != nullptr && ppAssembly != nullptr); - EX_TRY - { - *ppAssembly = nullptr; + *ppAssembly = nullptr; - ReleaseHolder pCoreCLRFoundAssembly; - ReleaseHolder pAssemblyName; + ReleaseHolder pCoreCLRFoundAssembly; + ReleaseHolder pAssemblyName; - SAFE_NEW(pAssemblyName, AssemblyName); - IF_FAIL_GO(pAssemblyName->Init(pIAssemblyName)); + SAFE_NEW(pAssemblyName, AssemblyName); + IF_FAIL_GO(pAssemblyName->Init(pIAssemblyName)); - hr = BindAssemblyByNameWorker(pAssemblyName, &pCoreCLRFoundAssembly, false /* excludeAppPaths */); + hr = BindAssemblyByNameWorker(pAssemblyName, &pCoreCLRFoundAssembly, false /* excludeAppPaths */); #if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE) - if ((hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) || - (hr == FUSION_E_APP_DOMAIN_LOCKED) || (hr == FUSION_E_REF_DEF_MISMATCH)) + if ((hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) || + (hr == FUSION_E_APP_DOMAIN_LOCKED) || (hr == FUSION_E_REF_DEF_MISMATCH)) + { + // If we are here, one of the following is possible: + // + // 1) The assembly has not been found in the current binder's application context (i.e. it has not already been loaded), OR + // 2) An assembly with the same simple name was already loaded in the context of the current binder but we ran into a Ref/Def + // mismatch (either due to version difference or strong-name difference). + // + // Attempt to resolve the assembly via managed ALC instance. This can either fail the bind or return reference to an existing + // assembly that has been loaded + INT_PTR pManagedAssemblyLoadContext = GetManagedAssemblyLoadContext(); + if (pManagedAssemblyLoadContext == NULL) { - // If we are here, one of the following is possible: - // - // 1) The assembly has not been found in the current binder's application context (i.e. it has not already been loaded), OR - // 2) An assembly with the same simple name was already loaded in the context of the current binder but we ran into a Ref/Def - // mismatch (either due to version difference or strong-name difference). - // - // Attempt to resolve the assembly via managed ALC instance. This can either fail the bind or return reference to an existing - // assembly that has been loaded - INT_PTR pManagedAssemblyLoadContext = GetManagedAssemblyLoadContext(); - if (pManagedAssemblyLoadContext == NULL) + // For satellite assemblies, the managed ALC has additional resolution logic (defined by the runtime) which + // should be run even if the managed default ALC has not yet been used. (For non-satellite assemblies, any + // additional logic comes through a user-defined event handler which would have initialized the managed ALC, + // so if the managed ALC is not set yet, there is no additional logic to run) + SString &culture = pAssemblyName->GetCulture(); + if (!culture.IsEmpty() && !culture.EqualsCaseInsensitive(g_BinderVariables->cultureNeutral)) { - // For satellite assemblies, the managed ALC has additional resolution logic (defined by the runtime) which - // should be run even if the managed default ALC has not yet been used. (For non-satellite assemblies, any - // additional logic comes through a user-defined event handler which would have initialized the managed ALC, - // so if the managed ALC is not set yet, there is no additional logic to run) - SString &culture = pAssemblyName->GetCulture(); - if (!culture.IsEmpty() && !culture.EqualsCaseInsensitive(g_BinderVariables->cultureNeutral)) - { - // Make sure the managed default ALC is initialized. - GCX_COOP(); - PREPARE_NONVIRTUAL_CALLSITE(METHOD__ASSEMBLYLOADCONTEXT__INITIALIZE_DEFAULT_CONTEXT); - DECLARE_ARGHOLDER_ARRAY(args, 0); - CALL_MANAGED_METHOD_NORET(args) - - pManagedAssemblyLoadContext = GetManagedAssemblyLoadContext(); - _ASSERTE(pManagedAssemblyLoadContext != NULL); - } + // Make sure the managed default ALC is initialized. + GCX_COOP(); + PREPARE_NONVIRTUAL_CALLSITE(METHOD__ASSEMBLYLOADCONTEXT__INITIALIZE_DEFAULT_CONTEXT); + DECLARE_ARGHOLDER_ARRAY(args, 0); + CALL_MANAGED_METHOD_NORET(args) + + pManagedAssemblyLoadContext = GetManagedAssemblyLoadContext(); + _ASSERTE(pManagedAssemblyLoadContext != NULL); } + } - if (pManagedAssemblyLoadContext != NULL) + if (pManagedAssemblyLoadContext != NULL) + { + hr = AssemblyBinder::BindUsingHostAssemblyResolver(pManagedAssemblyLoadContext, pAssemblyName, pIAssemblyName, + NULL, &pCoreCLRFoundAssembly); + if (SUCCEEDED(hr)) { - hr = AssemblyBinder::BindUsingHostAssemblyResolver(pManagedAssemblyLoadContext, pAssemblyName, pIAssemblyName, - NULL, &pCoreCLRFoundAssembly); - if (SUCCEEDED(hr)) + // We maybe returned an assembly that was bound to a different AssemblyLoadContext instance. + // In such a case, we will not overwrite the binding context (which would be wrong since it would not + // be present in the cache of the current binding context). + if (pCoreCLRFoundAssembly->GetBinder() == NULL) { - // We maybe returned an assembly that was bound to a different AssemblyLoadContext instance. - // In such a case, we will not overwrite the binding context (which would be wrong since it would not - // be present in the cache of the current binding context). - if (pCoreCLRFoundAssembly->GetBinder() == NULL) - { - pCoreCLRFoundAssembly->SetBinder(this); - } + pCoreCLRFoundAssembly->SetBinder(this); } } } + } #endif // !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE) - IF_FAIL_GO(hr); + IF_FAIL_GO(hr); - *ppAssembly = pCoreCLRFoundAssembly.Extract(); + *ppAssembly = pCoreCLRFoundAssembly.Extract(); Exit:; - } - EX_CATCH_HRESULT(hr); return hr; } @@ -155,8 +151,8 @@ HRESULT CLRPrivBinderCoreCLR::BindUsingPEImage( /* in */ PEImage *pPEImage, IF_FAIL_GO(HRESULT_FROM_WIN32(ERROR_BAD_FORMAT)); } - // Easy out for mscorlib - if (pAssemblyName->IsMscorlib()) + // Easy out for CoreLib + if (pAssemblyName->IsCoreLib()) { IF_FAIL_GO(HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)); } diff --git a/src/coreclr/src/binder/inc/assembly.hpp b/src/coreclr/src/binder/inc/assembly.hpp index 9ad7d4226e8b..3f5fb87594e2 100644 --- a/src/coreclr/src/binder/inc/assembly.hpp +++ b/src/coreclr/src/binder/inc/assembly.hpp @@ -116,7 +116,7 @@ namespace BINDER_SPACE #ifndef CROSSGEN_COMPILE protected: #endif - // Asssembly Flags + // Assembly Flags enum { FLAG_NONE = 0x00, diff --git a/src/coreclr/src/binder/inc/assemblyname.hpp b/src/coreclr/src/binder/inc/assemblyname.hpp index 38590e09f78a..fb66d9830e0a 100644 --- a/src/coreclr/src/binder/inc/assemblyname.hpp +++ b/src/coreclr/src/binder/inc/assemblyname.hpp @@ -65,7 +65,7 @@ namespace BINDER_SPACE inline void SetHave(DWORD dwIdentityFlags); - BOOL IsMscorlib(); + BOOL IsCoreLib(); ULONG Hash(/* in */ DWORD dwIncludeFlags); BOOL Equals(/* in */ AssemblyName *pAssemblyName, diff --git a/src/coreclr/src/binder/inc/utils.hpp b/src/coreclr/src/binder/inc/utils.hpp index 6108d3aea22c..1c8ea114f5e6 100644 --- a/src/coreclr/src/binder/inc/utils.hpp +++ b/src/coreclr/src/binder/inc/utils.hpp @@ -39,6 +39,9 @@ namespace BINDER_SPACE SBuffer &publicKeyTokenBLOB); BOOL IsFileNotFound(HRESULT hr); + + HRESULT GetNextPath(SString& paths, SString::Iterator& startPos, SString& outPath); + HRESULT GetNextTPAPath(SString& paths, SString::Iterator& startPos, bool dllOnly, SString& outPath, SString& simpleName, bool& isNativeImage); }; #endif diff --git a/src/coreclr/src/binder/inc/variables.hpp b/src/coreclr/src/binder/inc/variables.hpp index 50f392d0366e..d060a691bbec 100644 --- a/src/coreclr/src/binder/inc/variables.hpp +++ b/src/coreclr/src/binder/inc/variables.hpp @@ -31,7 +31,7 @@ namespace BINDER_SPACE // AssemblyName string constants SString cultureNeutral; - SString mscorlib; + SString corelib; }; extern Variables *g_BinderVariables; diff --git a/src/coreclr/src/binder/utils.cpp b/src/coreclr/src/binder/utils.cpp index c98d7f71bf83..21fc115a7766 100644 --- a/src/coreclr/src/binder/utils.cpp +++ b/src/coreclr/src/binder/utils.cpp @@ -15,6 +15,8 @@ #include "strongnameinternal.h" #include "corpriv.h" +#include "clr/fs/path.h" +using namespace clr::fs; namespace BINDER_SPACE { @@ -115,4 +117,139 @@ namespace BINDER_SPACE { return RuntimeFileNotFound(hr); } + + HRESULT GetNextPath(SString& paths, SString::Iterator& startPos, SString& outPath) + { + HRESULT hr = S_OK; + + bool wrappedWithQuotes = false; + + // Skip any leading spaces or path separators + while (paths.Skip(startPos, W(' ')) || paths.Skip(startPos, PATH_SEPARATOR_CHAR_W)) {} + + if (startPos == paths.End()) + { + // No more paths in the string and we just skipped over some white space + outPath.Set(W("")); + return S_FALSE; + } + + // Support paths being wrapped with quotations + if (paths.Skip(startPos, W('\"'))) + { + wrappedWithQuotes = true; + } + + SString::Iterator iEnd = startPos; // Where current path ends + SString::Iterator iNext; // Where next path starts + if (wrappedWithQuotes) + { + if (paths.Find(iEnd, W('\"'))) + { + iNext = iEnd; + // Find where the next path starts - there should be a path separator right after the closing quotation mark + if (paths.Find(iNext, PATH_SEPARATOR_CHAR_W)) + { + iNext++; + } + else + { + iNext = paths.End(); + } + } + else + { + // There was no terminating quotation mark - that's bad + GO_WITH_HRESULT(E_INVALIDARG); + } + } + else if (paths.Find(iEnd, PATH_SEPARATOR_CHAR_W)) + { + iNext = iEnd + 1; + } + else + { + iNext = iEnd = paths.End(); + } + + // Skip any trailing spaces + while (iEnd[-1] == W(' ')) + { + iEnd--; + } + + _ASSERTE(startPos < iEnd); + + outPath.Set(paths, startPos, iEnd); + startPos = iNext; + Exit: + return hr; + } + + HRESULT GetNextTPAPath(SString& paths, SString::Iterator& startPos, bool dllOnly, SString& outPath, SString& simpleName, bool& isNativeImage) + { + HRESULT hr = S_OK; + isNativeImage = false; + + HRESULT pathResult = S_OK; + IF_FAIL_GO(pathResult = GetNextPath(paths, startPos, outPath)); + if (pathResult == S_FALSE) + { + return S_FALSE; + } + +#ifndef CROSSGEN_COMPILE + if (Path::IsRelative(outPath)) + { + GO_WITH_HRESULT(E_INVALIDARG); + } +#endif + + { + // Find the beginning of the simple name + SString::Iterator iSimpleNameStart = outPath.End(); + + if (!outPath.FindBack(iSimpleNameStart, DIRECTORY_SEPARATOR_CHAR_W)) + { + iSimpleNameStart = outPath.Begin(); + } + else + { + // Advance past the directory separator to the first character of the file name + iSimpleNameStart++; + } + + if (iSimpleNameStart == outPath.End()) + { + GO_WITH_HRESULT(E_INVALIDARG); + } + + // GCC complains if we create SStrings inline as part of a function call + SString sNiDll(W(".ni.dll")); + SString sNiExe(W(".ni.exe")); + SString sDll(W(".dll")); + SString sExe(W(".exe")); + + if (!dllOnly && (outPath.EndsWithCaseInsensitive(sNiDll) || + outPath.EndsWithCaseInsensitive(sNiExe))) + { + simpleName.Set(outPath, iSimpleNameStart, outPath.End() - 7); + isNativeImage = true; + } + else if (outPath.EndsWithCaseInsensitive(sDll) || + (!dllOnly && outPath.EndsWithCaseInsensitive(sExe))) + { + simpleName.Set(outPath, iSimpleNameStart, outPath.End() - 4); + } + else + { + // Invalid filename + GO_WITH_HRESULT(E_INVALIDARG); + } + } + + Exit: + return hr; + } + }; diff --git a/src/coreclr/src/binder/variables.cpp b/src/coreclr/src/binder/variables.cpp index d9c3f672657d..fbdd106b4dd2 100644 --- a/src/coreclr/src/binder/variables.cpp +++ b/src/coreclr/src/binder/variables.cpp @@ -40,7 +40,7 @@ namespace BINDER_SPACE // AssemblyName string constants cultureNeutral.SetLiteral(W("neutral")); - mscorlib.SetLiteral(CoreLibName_W); + corelib.SetLiteral(CoreLibName_W); } EX_CATCH_HRESULT(hr); diff --git a/src/coreclr/src/classlibnative/bcltype/CMakeLists.txt b/src/coreclr/src/classlibnative/bcltype/CMakeLists.txt index c3122ec12ec3..fdcf344c16ac 100644 --- a/src/coreclr/src/classlibnative/bcltype/CMakeLists.txt +++ b/src/coreclr/src/classlibnative/bcltype/CMakeLists.txt @@ -10,9 +10,11 @@ set(BCLTYPE_SOURCES variant.cpp ) -add_library_clr(bcltype +add_library_clr(bcltype_obj OBJECT ${BCLTYPE_SOURCES} ) -add_dependencies(bcltype eventing_headers) +add_dependencies(bcltype_obj eventing_headers) +add_library(bcltype INTERFACE) +target_sources(bcltype INTERFACE $) diff --git a/src/coreclr/src/classlibnative/bcltype/objectnative.cpp b/src/coreclr/src/classlibnative/bcltype/objectnative.cpp index efa76170bada..7af628a04e5c 100644 --- a/src/coreclr/src/classlibnative/bcltype/objectnative.cpp +++ b/src/coreclr/src/classlibnative/bcltype/objectnative.cpp @@ -254,7 +254,7 @@ FCIMPL1(Object*, ObjectNative::AllocateUninitializedClone, Object* pObjUNSAFE) } FCIMPLEND -FCIMPL3(FC_BOOL_RET, ObjectNative::WaitTimeout, CLR_BOOL exitContext, INT32 Timeout, Object* pThisUNSAFE) +FCIMPL2(FC_BOOL_RET, ObjectNative::WaitTimeout, INT32 Timeout, Object* pThisUNSAFE) { FCALL_CONTRACT; @@ -262,13 +262,11 @@ FCIMPL3(FC_BOOL_RET, ObjectNative::WaitTimeout, CLR_BOOL exitContext, INT32 Time OBJECTREF pThis = (OBJECTREF) pThisUNSAFE; HELPER_METHOD_FRAME_BEGIN_RET_1(pThis); - if (pThis == NULL) - COMPlusThrow(kNullReferenceException, W("NullReference_This")); - - if ((Timeout < 0) && (Timeout != INFINITE_TIMEOUT)) - COMPlusThrowArgumentOutOfRange(W("millisecondsTimeout"), W("ArgumentOutOfRange_NeedNonNegNum")); + // Arguments validated on managed side + _ASSERTE(pThis != NULL); + _ASSERTE(Timeout >= INFINITE_TIMEOUT); - retVal = pThis->Wait(Timeout, exitContext); + retVal = pThis->Wait(Timeout); HELPER_METHOD_FRAME_END(); FC_RETURN_BOOL(retVal); diff --git a/src/coreclr/src/classlibnative/bcltype/objectnative.h b/src/coreclr/src/classlibnative/bcltype/objectnative.h index 4091f2faa8fd..cc084e4d3b51 100644 --- a/src/coreclr/src/classlibnative/bcltype/objectnative.h +++ b/src/coreclr/src/classlibnative/bcltype/objectnative.h @@ -33,7 +33,7 @@ class ObjectNative static FCDECL2(FC_BOOL_RET, Equals, Object *pThisRef, Object *pCompareRef); static FCDECL1(Object*, AllocateUninitializedClone, Object* pObjUNSAFE); static FCDECL1(Object*, GetClass, Object* pThis); - static FCDECL3(FC_BOOL_RET, WaitTimeout, CLR_BOOL exitContext, INT32 Timeout, Object* pThisUNSAFE); + static FCDECL2(FC_BOOL_RET, WaitTimeout, INT32 Timeout, Object* pThisUNSAFE); static FCDECL1(void, Pulse, Object* pThisUNSAFE); static FCDECL1(void, PulseAll, Object* pThisUNSAFE); static FCDECL1(FC_BOOL_RET, IsLockHeld, Object* pThisUNSAFE); diff --git a/src/coreclr/src/classlibnative/bcltype/system.cpp b/src/coreclr/src/classlibnative/bcltype/system.cpp index c037236f6959..74623125fdf4 100644 --- a/src/coreclr/src/classlibnative/bcltype/system.cpp +++ b/src/coreclr/src/classlibnative/bcltype/system.cpp @@ -46,7 +46,7 @@ void WINAPI InitializeGetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime) { // GetSystemTimePreciseAsFileTime exists and we'd like to use it. However, on // misconfigured systems, it's possible for the "precise" time to be inaccurate: - // https://github.com/dotnet/coreclr/issues/14187 + // https://github.com/dotnet/runtime/issues/9014 // If it's inaccurate, though, we expect it to be wildly inaccurate, so as a // workaround/heuristic, we get both the "normal" and "precise" times, and as // long as they're close, we use the precise one. This workaround can be removed @@ -607,9 +607,17 @@ BOOL QCALLTYPE SystemNative::WinRTSupported() #endif // FEATURE_COMINTEROP +#if defined(TARGET_X86) || defined(TARGET_AMD64) +void QCALLTYPE SystemNative::X86BaseCpuId(int cpuInfo[4], int functionId, int subFunctionId) +{ + QCALL_CONTRACT; + BEGIN_QCALL; + __cpuidex(cpuInfo, functionId, subFunctionId); + END_QCALL; +} - +#endif // defined(TARGET_X86) || defined(TARGET_AMD64) diff --git a/src/coreclr/src/classlibnative/bcltype/system.h b/src/coreclr/src/classlibnative/bcltype/system.h index 20d357c17302..ff6720f0a8c0 100644 --- a/src/coreclr/src/classlibnative/bcltype/system.h +++ b/src/coreclr/src/classlibnative/bcltype/system.h @@ -81,6 +81,10 @@ class SystemNative // Return a method info for the method were the exception was thrown static FCDECL1(ReflectMethodObject*, GetMethodFromStackTrace, ArrayBase* pStackTraceUNSAFE); +#if defined(TARGET_X86) || defined(TARGET_AMD64) + static void QCALLTYPE X86BaseCpuId(int cpuInfo[4], int functionId, int subFunctionId); +#endif // defined(TARGET_X86) || defined(TARGET_AMD64) + private: // Common processing code for FailFast static void GenericFailFast(STRINGREF refMesgString, EXCEPTIONREF refExceptionForWatsonBucketing, UINT_PTR retAddress, UINT exitCode, STRINGREF errorSource); diff --git a/src/coreclr/src/classlibnative/bcltype/varargsnative.cpp b/src/coreclr/src/classlibnative/bcltype/varargsnative.cpp index fb2c1aefe3c7..55dd48bf280e 100644 --- a/src/coreclr/src/classlibnative/bcltype/varargsnative.cpp +++ b/src/coreclr/src/classlibnative/bcltype/varargsnative.cpp @@ -502,7 +502,7 @@ VarArgsNative::GetNextArgHelper( value->data = (BYTE*)origArgPtr + (sizeof(void*)-1); } #endif - value->type = MscorlibBinder::GetElementType(elemType); + value->type = CoreLibBinder::GetElementType(elemType); break; case ELEMENT_TYPE_I2: @@ -513,7 +513,7 @@ VarArgsNative::GetNextArgHelper( value->data = (BYTE*)origArgPtr + (sizeof(void*)-2); } #endif - value->type = MscorlibBinder::GetElementType(elemType); + value->type = CoreLibBinder::GetElementType(elemType); break; case ELEMENT_TYPE_I4: @@ -522,13 +522,13 @@ VarArgsNative::GetNextArgHelper( case ELEMENT_TYPE_STRING: case ELEMENT_TYPE_I: case ELEMENT_TYPE_U: - value->type = MscorlibBinder::GetElementType(elemType); + value->type = CoreLibBinder::GetElementType(elemType); break; case ELEMENT_TYPE_I8: case ELEMENT_TYPE_U8: case ELEMENT_TYPE_R8: - value->type = MscorlibBinder::GetElementType(elemType); + value->type = CoreLibBinder::GetElementType(elemType); #if !defined(HOST_64BIT) && (DATA_ALIGNMENT > 4) if ( fData && origArgPtr == value->data ) { // allocate an aligned copy of the value @@ -575,7 +575,8 @@ VarArgsNative::GetNextArgHelper( } #endif - // fall through + FALLTHROUGH; + case ELEMENT_TYPE_CLASS: { value->type = data->SigPtr.GetTypeHandleThrowing(data->ArgCookie->pModule, &typeContext); diff --git a/src/coreclr/src/classlibnative/float/CMakeLists.txt b/src/coreclr/src/classlibnative/float/CMakeLists.txt index 2345ad0b9135..b2c47ea39b65 100644 --- a/src/coreclr/src/classlibnative/float/CMakeLists.txt +++ b/src/coreclr/src/classlibnative/float/CMakeLists.txt @@ -7,9 +7,12 @@ set(FLOAT_SOURCES floatsingle.cpp ) -add_library_clr(comfloat_wks +add_library_clr(comfloat_wks_obj OBJECT ${FLOAT_SOURCES} ) -add_dependencies(comfloat_wks eventing_headers) +add_dependencies(comfloat_wks_obj eventing_headers) + +add_library(comfloat_wks INTERFACE) +target_sources(comfloat_wks INTERFACE $) \ No newline at end of file diff --git a/src/coreclr/src/classlibnative/float/floatdouble.cpp b/src/coreclr/src/classlibnative/float/floatdouble.cpp index d3ef36c66a61..a2a00b0628bd 100644 --- a/src/coreclr/src/classlibnative/float/floatdouble.cpp +++ b/src/coreclr/src/classlibnative/float/floatdouble.cpp @@ -125,7 +125,7 @@ FCIMPLEND #if defined(_MSC_VER) && defined(TARGET_AMD64) // The /fp:fast form of `ceil` for AMD64 does not correctly handle: `-1.0 < value <= -0.0` -// https://github.com/dotnet/coreclr/issues/19739 +// https://github.com/dotnet/runtime/issues/11003 #pragma float_control(push) #pragma float_control(precise, on) #endif @@ -172,7 +172,7 @@ FCIMPLEND #if defined(_MSC_VER) && defined(TARGET_X86) // The /fp:fast form of `floor` for x86 does not correctly handle: `-0.0` -// https://github.com/dotnet/coreclr/issues/19739 +// https://github.com/dotnet/runtime/issues/11003 #pragma float_control(push) #pragma float_control(precise, on) #endif diff --git a/src/coreclr/src/classlibnative/float/floatsingle.cpp b/src/coreclr/src/classlibnative/float/floatsingle.cpp index 781badfc1f8a..9972e17c6901 100644 --- a/src/coreclr/src/classlibnative/float/floatsingle.cpp +++ b/src/coreclr/src/classlibnative/float/floatsingle.cpp @@ -123,7 +123,7 @@ FCIMPLEND #if defined(_MSC_VER) && defined(TARGET_AMD64) // The /fp:fast form of `ceilf` for AMD64 does not correctly handle: `-1.0 < value <= -0.0` -// https://github.com/dotnet/coreclr/issues/19739 +// https://github.com/dotnet/runtime/issues/11003 #pragma float_control(push) #pragma float_control(precise, on) #endif diff --git a/src/coreclr/src/debug/createdump/CMakeLists.txt b/src/coreclr/src/debug/createdump/CMakeLists.txt index d5137b0cf5f1..71b6083f9bcf 100644 --- a/src/coreclr/src/debug/createdump/CMakeLists.txt +++ b/src/coreclr/src/debug/createdump/CMakeLists.txt @@ -14,6 +14,7 @@ if(CLR_CMAKE_HOST_WIN32) set(CREATEDUMP_SOURCES main.cpp + dumpname.cpp createdumpwindows.cpp createdump.rc ) @@ -28,6 +29,7 @@ if(CLR_CMAKE_HOST_WIN32) advapi32.lib version.lib dbghelp.lib + ws2_32.lib ) else(CLR_CMAKE_HOST_WIN32) @@ -49,6 +51,7 @@ else(CLR_CMAKE_HOST_WIN32) set(CREATEDUMP_SOURCES main.cpp + dumpname.cpp createdumpunix.cpp crashinfo.cpp threadinfo.cpp @@ -83,4 +86,4 @@ endif(CLR_CMAKE_HOST_OSX) endif(CLR_CMAKE_HOST_WIN32) -install_clr(TARGETS createdump ADDITIONAL_DESTINATION sharedFramework) +install_clr(TARGETS createdump ADDITIONAL_DESTINATIONS sharedFramework) diff --git a/src/coreclr/src/debug/createdump/crashinfo.cpp b/src/coreclr/src/debug/createdump/crashinfo.cpp index 612fafb7c34e..bccbb8553a91 100644 --- a/src/coreclr/src/debug/createdump/crashinfo.cpp +++ b/src/coreclr/src/debug/createdump/crashinfo.cpp @@ -306,23 +306,27 @@ CrashInfo::EnumerateManagedModules(IXCLRDataProcess* pClrDataProcess) if (!moduleData.IsDynamic && moduleData.LoadedPEAddress != 0) { - ArrayHolder wszUnicodeName = new WCHAR[MAX_LONGPATH + 1]; + ArrayHolder wszUnicodeName = new (std::nothrow) WCHAR[MAX_LONGPATH + 1]; + if (wszUnicodeName == nullptr) + { + fprintf(stderr, "Allocating unicode module name FAILED\n"); + result = false; + break; + } if (SUCCEEDED(hr = pClrDataModule->GetFileName(MAX_LONGPATH, nullptr, wszUnicodeName))) { - // If the module file name isn't empty - if (wszUnicodeName[0] != 0) { - ArrayHolder pszName = new (std::nothrow) char[MAX_LONGPATH + 1]; - if (pszName == nullptr) { - fprintf(stderr, "Allocating module name FAILED\n"); - result = false; - break; - } - sprintf_s(pszName.GetPtr(), MAX_LONGPATH, "%S", (WCHAR*)wszUnicodeName); - TRACE(" %s\n", pszName.GetPtr()); - - // Change the module mapping name - ReplaceModuleMapping(moduleData.LoadedPEAddress, moduleData.LoadedPESize, std::string(pszName.GetPtr())); + ArrayHolder pszName = new (std::nothrow) char[MAX_LONGPATH + 1]; + if (pszName == nullptr) + { + fprintf(stderr, "Allocating ascii module name FAILED\n"); + result = false; + break; } + sprintf_s(pszName.GetPtr(), MAX_LONGPATH, "%S", (WCHAR*)wszUnicodeName); + TRACE(" %s\n", pszName.GetPtr()); + + // Change the module mapping name + ReplaceModuleMapping(moduleData.LoadedPEAddress, moduleData.LoadedPESize, std::string(pszName.GetPtr())); } else { TRACE("\nModule.GetFileName FAILED %08x\n", hr); @@ -368,16 +372,21 @@ CrashInfo::ReplaceModuleMapping(CLRDATA_ADDRESS baseAddress, ULONG64 size, const { uint64_t start = (uint64_t)baseAddress; uint64_t end = ((baseAddress + size) + (PAGE_SIZE - 1)) & PAGE_MASK; + uint32_t flags = GetMemoryRegionFlags(start); + + // Make sure that the page containing the PE header for the managed asseblies is in the dump + // especially on MacOS where they are added artificially. + MemoryRegion header(flags | MEMORY_REGION_FLAG_MEMORY_BACKED, start, start + PAGE_SIZE); + InsertMemoryRegion(header); // Add or change the module mapping for this PE image. The managed assembly images may already // be in the module mappings list but they may not have the full assembly name (like in .NET 2.0 // they have the name "/dev/zero"). On MacOS, the managed assembly modules have not been added. - MemoryRegion search(0, start, start + PAGE_SIZE); - const auto& found = m_moduleMappings.find(search); + const auto& found = m_moduleMappings.find(header); if (found == m_moduleMappings.end()) { // On MacOS the assemblies are always added. - MemoryRegion newRegion(GetMemoryRegionFlags(start), start, end, 0, pszName); + MemoryRegion newRegion(flags, start, end, 0, pszName); m_moduleMappings.insert(newRegion); if (g_diagnostics) { diff --git a/src/coreclr/src/debug/createdump/crashinfomac.cpp b/src/coreclr/src/debug/createdump/crashinfomac.cpp index 033f98d29037..c4f55bb2dd49 100644 --- a/src/coreclr/src/debug/createdump/crashinfomac.cpp +++ b/src/coreclr/src/debug/createdump/crashinfomac.cpp @@ -24,49 +24,7 @@ void CrashInfo::CleanupAndResumeProcess() { // Resume all the threads suspended in EnumerateAndSuspendThreads - for (ThreadInfo* thread : m_threads) - { - ::thread_resume(thread->Port()); - } -} - -static -kern_return_t -SuspendMachThread(thread_act_t thread, int tid) -{ - kern_return_t result; - - while (true) - { - result = thread_suspend(thread); - if (result != KERN_SUCCESS) - { - fprintf(stderr, "thread_suspend(%d) FAILED %x %s\n", tid, result, mach_error_string(result)); - break; - } - - // Ensure that if the thread was running in the kernel, the kernel operation - // is safely aborted so that it can be restarted later. - result = thread_abort_safely(thread); - if (result == KERN_SUCCESS) - { - break; - } - else - { - TRACE("thread_abort_safely(%d) FAILED %x %s\n", tid, result, mach_error_string(result)); - } - // The thread was running in the kernel executing a non-atomic operation - // that cannot be restarted, so we need to resume the thread and retry - result = thread_resume(thread); - if (result != KERN_SUCCESS) - { - fprintf(stderr, "thread_resume(%d) FAILED %x %s\n", tid, result, mach_error_string(result)); - break; - } - } - - return result; + ::task_resume(Task()); } // @@ -78,7 +36,14 @@ CrashInfo::EnumerateAndSuspendThreads() thread_act_port_array_t threadList; mach_msg_type_number_t threadCount; - kern_return_t result = ::task_threads(Task(), &threadList, &threadCount); + kern_return_t result = ::task_suspend(Task()); + if (result != KERN_SUCCESS) + { + fprintf(stderr, "task_suspend(%d) FAILED %x %s\n", m_pid, result, mach_error_string(result)); + return false; + } + + result = ::task_threads(Task(), &threadList, &threadCount); if (result != KERN_SUCCESS) { fprintf(stderr, "task_threads(%d) FAILED %x %s\n", m_pid, result, mach_error_string(result)); @@ -102,11 +67,6 @@ CrashInfo::EnumerateAndSuspendThreads() tid = tident.thread_id; } - result = SuspendMachThread(threadList[i], tid); - if (result != KERN_SUCCESS) - { - return false; - } // Add to the list of threads ThreadInfo* thread = new ThreadInfo(*this, tid, threadList[i]); m_threads.push_back(thread); @@ -148,7 +108,7 @@ CrashInfo::EnumerateMemoryRegions() fprintf(stderr, "mach_vm_region_recurse for address %016llx %08llx FAILED %x %s\n", address, size, result, mach_error_string(result)); return false; } - TRACE("%016llx - %016llx (%06llx) %08llx %s %d %d %d %c%c%c\n", + TRACE("%016llx - %016llx (%06llx) %08llx %s %d %d %d %c%c%c %02x\n", address, address + size, size / PAGE_SIZE, @@ -159,14 +119,15 @@ CrashInfo::EnumerateMemoryRegions() depth, (info.protection & VM_PROT_READ) ? 'r' : '-', (info.protection & VM_PROT_WRITE) ? 'w' : '-', - (info.protection & VM_PROT_EXECUTE) ? 'x' : '-'); + (info.protection & VM_PROT_EXECUTE) ? 'x' : '-', + info.protection); if (info.is_submap) { depth++; } else { - if (info.share_mode != SM_EMPTY && (info.protection & (VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE)) != 0) + if ((info.protection & (VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE)) != 0) { MemoryRegion memoryRegion(ConvertProtectionFlags(info.protection), address, address + size, info.offset); m_allMemoryRegions.insert(memoryRegion); @@ -242,33 +203,32 @@ CrashInfo::TryFindDyLinker(mach_vm_address_t address, mach_vm_size_t size, bool* if (size > sizeof(mach_header_64)) { - mach_header_64* header = nullptr; - mach_msg_type_number_t read = 0; - kern_return_t kresult = ::vm_read(Task(), address, sizeof(mach_header_64), (vm_offset_t*)&header, &read); - if (kresult == KERN_SUCCESS) - { - if (header->magic == MH_MAGIC_64) + mach_header_64 header; + size_t read = 0; + if (ReadProcessMemory((void*)address, &header, sizeof(mach_header_64), &read)) + { + if (header.magic == MH_MAGIC_64) { TRACE("TryFindDyLinker: found module header at %016llx %08llx ncmds %d sizeofcmds %08x type %02x\n", address, size, - header->ncmds, - header->sizeofcmds, - header->filetype); + header.ncmds, + header.sizeofcmds, + header.filetype); - if (header->filetype == MH_DYLINKER) + if (header.filetype == MH_DYLINKER) { TRACE("TryFindDyLinker: found dylinker\n"); *found = true; // Enumerate all the modules in dyld's image cache. VisitModule is called for every module found. - result = EnumerateModules(address, header); + result = EnumerateModules(address, &header); } } } - if (header != nullptr) + else { - ::vm_deallocate(Task(), (vm_address_t)header, sizeof(mach_header_64)); + TRACE("TryFindDyLinker: ReadProcessMemory header at %p %d FAILED\n", address, read); } } @@ -388,37 +348,35 @@ CrashInfo::ReadProcessMemory(void* address, void* buffer, size_t size, size_t* r // and the size be a multiple of the page size. We can't differentiate // between the cases in which that's required and those in which it // isn't, so we do it all the time. - int* addressAligned = (int*)((SIZE_T)address & ~(PAGE_SIZE - 1)); - ssize_t offset = ((SIZE_T)address & (PAGE_SIZE - 1)); + vm_address_t addressAligned = (vm_address_t)address & ~(PAGE_SIZE - 1); + ssize_t offset = (ssize_t)address & (PAGE_SIZE - 1); char *data = (char*)alloca(PAGE_SIZE); ssize_t numberOfBytesRead = 0; - ssize_t bytesToRead; + ssize_t bytesLeft = size; - while (size > 0) + while (bytesLeft > 0) { - vm_size_t bytesRead; - - bytesToRead = PAGE_SIZE - offset; - if (bytesToRead > size) + vm_size_t bytesRead = PAGE_SIZE; + kern_return_t result = ::vm_read_overwrite(Task(), addressAligned, PAGE_SIZE, (vm_address_t)data, &bytesRead); + if (result != KERN_SUCCESS || bytesRead != PAGE_SIZE) { - bytesToRead = size; + TRACE_VERBOSE("ReadProcessMemory(%p %d): vm_read_overwrite failed bytesLeft %d bytesRead %d from %p: %x %s\n", + address, size, bytesLeft, bytesRead, (void*)addressAligned, result, mach_error_string(result)); + break; } - bytesRead = PAGE_SIZE; - kern_return_t result = ::vm_read_overwrite(Task(), (vm_address_t)addressAligned, PAGE_SIZE, (vm_address_t)data, &bytesRead); - if (result != KERN_SUCCESS || bytesRead != PAGE_SIZE) + ssize_t bytesToCopy = PAGE_SIZE - offset; + if (bytesToCopy > bytesLeft) { - TRACE_VERBOSE("vm_read_overwrite failed for %d bytes from %p: %x %s\n", PAGE_SIZE, (char *)addressAligned, result, mach_error_string(result)); - *read = 0; - return false; + bytesToCopy = bytesLeft; } - memcpy((LPSTR)buffer + numberOfBytesRead, data + offset, bytesToRead); - addressAligned = (int*)((char*)addressAligned + PAGE_SIZE); - numberOfBytesRead += bytesToRead; - size -= bytesToRead; + memcpy((LPSTR)buffer + numberOfBytesRead, data + offset, bytesToCopy); + addressAligned = addressAligned + PAGE_SIZE; + numberOfBytesRead += bytesToCopy; + bytesLeft -= bytesToCopy; offset = 0; } *read = numberOfBytesRead; - return true; + return size == 0 || numberOfBytesRead > 0; } // For src/inc/llvm/ELF.h diff --git a/src/coreclr/src/debug/createdump/createdump.h b/src/coreclr/src/debug/createdump/createdump.h index 234cf09033fb..41cb93414374 100644 --- a/src/coreclr/src/debug/createdump/createdump.h +++ b/src/coreclr/src/debug/createdump/createdump.h @@ -95,4 +95,6 @@ typedef int T_CONTEXT; #define MAX_LONGPATH 1024 #endif -bool CreateDump(const char* dumpPathTemplate, int pid, MINIDUMP_TYPE minidumpType); +bool FormatDumpName(std::string& name, const char* pattern, const char* exename, int pid); +bool CreateDump(const char* dumpPathTemplate, int pid, const char* dumpType, MINIDUMP_TYPE minidumpType); + diff --git a/src/coreclr/src/debug/createdump/createdumpunix.cpp b/src/coreclr/src/debug/createdump/createdumpunix.cpp index 156b58da6a46..6ddc21a75c2a 100644 --- a/src/coreclr/src/debug/createdump/createdumpunix.cpp +++ b/src/coreclr/src/debug/createdump/createdumpunix.cpp @@ -7,10 +7,11 @@ // The Linux/MacOS create dump code // bool -CreateDump(const char* dumpPath, int pid, MINIDUMP_TYPE minidumpType) +CreateDump(const char* dumpPathTemplate, int pid, const char* dumpType, MINIDUMP_TYPE minidumpType) { ReleaseHolder crashInfo = new CrashInfo(pid); DumpWriter dumpWriter(*crashInfo); + std::string dumpPath; bool result = false; // Initialize the crash info @@ -18,7 +19,7 @@ CreateDump(const char* dumpPath, int pid, MINIDUMP_TYPE minidumpType) { goto exit; } - printf("Process %d %s\n", crashInfo->Pid(), crashInfo->Name().c_str()); + printf("Gathering state for process %d %s\n", pid, crashInfo->Name().c_str()); // Suspend all the threads in the target process and build the list of threads if (!crashInfo->EnumerateAndSuspendThreads()) @@ -30,7 +31,15 @@ CreateDump(const char* dumpPath, int pid, MINIDUMP_TYPE minidumpType) { goto exit; } - if (!dumpWriter.OpenDump(dumpPath)) + // Format the dump pattern template now that the process name on MacOS has been obtained + if (!FormatDumpName(dumpPath, dumpPathTemplate, crashInfo->Name().c_str(), pid)) + { + goto exit; + } + printf("Writing %s to file %s\n", dumpType, dumpPath.c_str()); + + // Write the actual dump file + if (!dumpWriter.OpenDump(dumpPath.c_str())) { goto exit; } diff --git a/src/coreclr/src/debug/createdump/createdumpwindows.cpp b/src/coreclr/src/debug/createdump/createdumpwindows.cpp index 51c6dbe87a91..1eed949603ed 100644 --- a/src/coreclr/src/debug/createdump/createdumpwindows.cpp +++ b/src/coreclr/src/debug/createdump/createdumpwindows.cpp @@ -2,28 +2,42 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "createdump.h" +#include "psapi.h" // // The Windows create dump code // bool -CreateDump(const char* dumpPath, int pid, MINIDUMP_TYPE minidumpType) +CreateDump(const char* dumpPathTemplate, int pid, const char* dumpType, MINIDUMP_TYPE minidumpType) { HANDLE hFile = INVALID_HANDLE_VALUE; HANDLE hProcess = NULL; bool result = false; + ArrayHolder pszName = new char[MAX_LONGPATH + 1]; + std::string dumpPath; + hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); if (hProcess == NULL) { fprintf(stderr, "Invalid process id '%d' error %d\n", pid, GetLastError()); goto exit; } + if (GetModuleBaseNameA(hProcess, NULL, pszName, MAX_LONGPATH) <= 0) + { + fprintf(stderr, "Get process name FAILED %d\n", GetLastError()); + goto exit; + } + if (!FormatDumpName(dumpPath, dumpPathTemplate, pszName, pid)) + { + goto exit; + } + printf("Writing %s to file %s\n", dumpType, dumpPath.c_str()); - hFile = CreateFileA(dumpPath, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + hFile = CreateFileA(dumpPath.c_str(), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { - fprintf(stderr, "Invalid dump path '%s' error %d\n", dumpPath, GetLastError()); + fprintf(stderr, "Invalid dump path '%s' error %d\n", dumpPath.c_str(), GetLastError()); goto exit; } diff --git a/src/coreclr/src/debug/createdump/datatarget.cpp b/src/coreclr/src/debug/createdump/datatarget.cpp index 9051426c6f6c..e5361ec5d423 100644 --- a/src/coreclr/src/debug/createdump/datatarget.cpp +++ b/src/coreclr/src/debug/createdump/datatarget.cpp @@ -127,6 +127,7 @@ DumpDataTarget::ReadVirtual( size_t read = 0; if (!m_crashInfo.ReadProcessMemory((void*)(ULONG_PTR)address, buffer, size, &read)) { + TRACE("DumpDataTarget::ReadVirtual %p %d FAILED\n", (void*)address, size); *done = 0; return E_FAIL; } diff --git a/src/coreclr/src/debug/createdump/dumpname.cpp b/src/coreclr/src/debug/createdump/dumpname.cpp new file mode 100644 index 000000000000..751997c6755b --- /dev/null +++ b/src/coreclr/src/debug/createdump/dumpname.cpp @@ -0,0 +1,124 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "createdump.h" +#include +#ifdef HOST_WINDOWS +#include +#endif + +// +// Format the core dump name using a subset of the standard coredump pattern +// defined here: https://man7.org/linux/man-pages/man5/core.5.html. +// +// Supported: +// +// %% A single % character. +// %d PID of dumped process (for backwards createdump compatibility). +// %p PID of dumped process. +// %e The process executable filename. +// %h Hostname return by gethostname(). +// %t Time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). +// +// Unsupported: +// +// %c Core file size soft resource limit of crashing process. +// %E Pathname of executable, with slashes ('/') replaced by exclamation marks ('!'). +// %g Numeric real GID of dumped process. +// %i TID of thread that triggered core dump, as seen in the PID namespace in which the thread resides. +// %I TID of thread that triggered core dump, as seen in the initial PID namespace. +// %P PID of dumped process, as seen in the initial PID namespace. +// %s Number of signal causing dump. +// %u Numeric real UID of dumped process. +// +bool +FormatDumpName(std::string& name, const char* pattern, const char* exename, int pid) +{ + const char* p = pattern; + if (*p == '|') + { + fprintf(stderr, "Pipe syntax in dump name not supported\n"); + return false; + } + +#ifdef HOST_WINDOWS + WSAData wsadata; + int wsaerr = WSAStartup(1, &wsadata); +#endif + + while (*p) + { + if (*p != '%') + { + name.append(1, *p); + } + else + { + switch (*++p) + { + case '\0': + return true; + + case '%': + name.append(1, '%'); + break; + + // process Id + case 'd': + case 'p': + name.append(std::to_string(pid)); + break; + + // time of dump + case 't': + time_t dumptime; + time(&dumptime); + name.append(std::to_string(dumptime)); + break; + + // hostname + case 'h': { + ArrayHolder buffer = new char[MAX_LONGPATH + 1]; + if (gethostname(buffer, MAX_LONGPATH) != 0) + { + fprintf(stderr, "Could not get the host name for dump name: %d\n", +#ifdef HOST_WINDOWS + WSAGetLastError()); +#else + errno); +#endif + return false; + } + name.append(buffer); + break; + } + + // executable file name + case 'e': + name.append(exename); + break; + + // executable file path with / replaced with ! + case 'E': + // signal number that caused the dump + case 's': + // gid + case 'g': + // coredump size limit + case 'c': + // the numeric real UID of dumped process + case 'u': + // thread id that triggered the dump + case 'i': + case 'I': + // pid of dumped process + case 'P': + default: + fprintf(stderr, "Invalid dump name format char '%c'\n", *p); + return false; + } + } + ++p; + } + return true; +} diff --git a/src/coreclr/src/debug/createdump/mac.h b/src/coreclr/src/debug/createdump/mac.h index 16b198e93551..87745903ab18 100644 --- a/src/coreclr/src/debug/createdump/mac.h +++ b/src/coreclr/src/debug/createdump/mac.h @@ -68,6 +68,7 @@ typedef struct elf64_note { Elf64_Word n_type; /* Content type */ } Elf64_Nhdr; +#if defined(TARGET_AMD64) struct user_fpregs_struct { unsigned short int cwd; @@ -113,6 +114,25 @@ struct user_regs_struct unsigned long long int fs; unsigned long long int gs; }; +#elif defined(TARGET_ARM64) +struct user_fpsimd_struct +{ + uint64_t vregs[2*32]; + uint32_t fpcr; + uint32_t fpsr; +}; + +struct user_regs_struct +{ + uint64_t regs[31]; + uint64_t sp; + uint64_t pc; + uint32_t pstate; +}; +#else +#error Unexpected architecture +#endif + typedef pid_t __pid_t; diff --git a/src/coreclr/src/debug/createdump/main.cpp b/src/coreclr/src/debug/createdump/main.cpp index 626175c2903c..4fde335b5aa1 100644 --- a/src/coreclr/src/debug/createdump/main.cpp +++ b/src/coreclr/src/debug/createdump/main.cpp @@ -5,14 +5,18 @@ #ifdef HOST_WINDOWS #define DEFAULT_DUMP_PATH "%TEMP%\\" -#define DEFAULT_DUMP_TEMPLATE "dump.%d.dmp" +#define DEFAULT_DUMP_TEMPLATE "dump.%p.dmp" #else #define DEFAULT_DUMP_PATH "/tmp/" -#define DEFAULT_DUMP_TEMPLATE "coredump.%d" +#define DEFAULT_DUMP_TEMPLATE "coredump.%p" #endif const char* g_help = "createdump [options] pid\n" -"-f, --name - dump path and file name. The pid can be placed in the name with %d. The default is '" DEFAULT_DUMP_PATH DEFAULT_DUMP_TEMPLATE "'\n" +"-f, --name - dump path and file name. The default is '" DEFAULT_DUMP_PATH DEFAULT_DUMP_TEMPLATE "'. These specifiers are substituted with following values:\n" +" %p PID of dumped process.\n" +" %e The process executable filename.\n" +" %h Hostname return by gethostname().\n" +" %t Time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).\n" "-n, --normal - create minidump.\n" "-h, --withheap - create minidump with heap (default).\n" "-t, --triage - create triage minidump.\n" @@ -21,8 +25,6 @@ const char* g_help = "createdump [options] pid\n" bool g_diagnostics = false; -bool CreateDump(const char* dumpPathTemplate, int pid, MINIDUMP_TYPE minidumpType); - // // Main entry point // @@ -35,10 +37,20 @@ int __cdecl main(const int argc, const char* argv[]) MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | MiniDumpWithTokenInformation); + const char* dumpType = "minidump with heap"; const char* dumpPathTemplate = nullptr; int exitCode = 0; int pid = 0; +#ifdef __APPLE__ + char* enabled = getenv("COMPlus_DbgEnableElfDumpOnMacOS"); + if (enabled == nullptr || strcmp(enabled, "1") != 0) + { + fprintf(stderr, "MachO coredumps are not supported. To enable ELF coredumps on MacOS, set the COMPlus_DbgEnableElfDumpOnMacOS environment variable to 1.\n"); + return -1; + } +#endif + #ifdef HOST_UNIX exitCode = PAL_InitializeDLL(); if (exitCode != 0) @@ -60,11 +72,15 @@ int __cdecl main(const int argc, const char* argv[]) } else if ((strcmp(*argv, "-n") == 0) || (strcmp(*argv, "--normal") == 0)) { + dumpType = "minidump"; minidumpType = (MINIDUMP_TYPE)(MiniDumpNormal | + MiniDumpWithDataSegs | + MiniDumpWithHandleData | MiniDumpWithThreadInfo); } else if ((strcmp(*argv, "-h") == 0) || (strcmp(*argv, "--withheap") == 0)) { + dumpType = "minidump with heap"; minidumpType = (MINIDUMP_TYPE)(MiniDumpWithPrivateReadWriteMemory | MiniDumpWithDataSegs | MiniDumpWithHandleData | @@ -75,11 +91,16 @@ int __cdecl main(const int argc, const char* argv[]) } else if ((strcmp(*argv, "-t") == 0) || (strcmp(*argv, "--triage") == 0)) { + dumpType = "triage minidump"; minidumpType = (MINIDUMP_TYPE)(MiniDumpFilterTriage | + MiniDumpWithDataSegs | + MiniDumpWithHandleData | + MiniDumpFilterModulePaths | MiniDumpWithThreadInfo); } else if ((strcmp(*argv, "-u") == 0) || (strcmp(*argv, "--full") == 0)) { + dumpType = "full dump"; minidumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithDataSegs | MiniDumpWithHandleData | @@ -102,7 +123,6 @@ int __cdecl main(const int argc, const char* argv[]) if (pid != 0) { ArrayHolder tmpPath = new char[MAX_LONGPATH]; - ArrayHolder dumpPath = new char[MAX_LONGPATH]; if (dumpPathTemplate == nullptr) { @@ -120,29 +140,7 @@ int __cdecl main(const int argc, const char* argv[]) dumpPathTemplate = tmpPath; } - snprintf(dumpPath, MAX_LONGPATH, dumpPathTemplate, pid); - - const char* dumpType = "minidump"; - switch (minidumpType) - { - case MiniDumpWithPrivateReadWriteMemory: - dumpType = "minidump with heap"; - break; - - case MiniDumpFilterTriage: - dumpType = "triage minidump"; - break; - - case MiniDumpWithFullMemory: - dumpType = "full dump"; - break; - - default: - break; - } - printf("Writing %s to file %s\n", dumpType, (char*)dumpPath); - - if (CreateDump(dumpPath, pid, minidumpType)) + if (CreateDump(dumpPathTemplate, pid, dumpType, minidumpType)) { printf("Dump successfully written\n"); } @@ -150,6 +148,7 @@ int __cdecl main(const int argc, const char* argv[]) { exitCode = -1; } + fflush(stdout); fflush(stderr); } diff --git a/src/coreclr/src/debug/createdump/memoryregion.h b/src/coreclr/src/debug/createdump/memoryregion.h index c3085108ac7c..9176d3576eaf 100644 --- a/src/coreclr/src/debug/createdump/memoryregion.h +++ b/src/coreclr/src/debug/createdump/memoryregion.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. -#if defined(__arm__) || defined(__aarch64__) +#if !defined(PAGE_SIZE) && (defined(__arm__) || defined(__aarch64__)) #define PAGE_SIZE sysconf(_SC_PAGESIZE) #endif @@ -124,7 +124,7 @@ struct MemoryRegion void Trace() const { - TRACE("%" PRIA PRIx64 " - %" PRIA PRIx64 " (%06" PRId64 ") %" PRIA PRIx64 " %c%c%c%c%c%c %s\n", + TRACE("%" PRIA PRIx64 " - %" PRIA PRIx64 " (%06" PRIx64 ") %" PRIA PRIx64 " %c%c%c%c%c%c %02x %s\n", m_startAddress, m_endAddress, Size() / PAGE_SIZE, @@ -135,6 +135,7 @@ struct MemoryRegion (m_flags & MEMORY_REGION_FLAG_SHARED) ? 's' : '-', (m_flags & MEMORY_REGION_FLAG_PRIVATE) ? 'p' : '-', (m_flags & MEMORY_REGION_FLAG_MEMORY_BACKED) ? 'b' : '-', + m_flags, m_fileName.c_str()); } }; diff --git a/src/coreclr/src/debug/createdump/threadinfo.cpp b/src/coreclr/src/debug/createdump/threadinfo.cpp index f9fd7bbc5a9a..0a663707758f 100644 --- a/src/coreclr/src/debug/createdump/threadinfo.cpp +++ b/src/coreclr/src/debug/createdump/threadinfo.cpp @@ -43,8 +43,11 @@ void ThreadInfo::UnwindNativeFrames(CONTEXT* pContext) { uint64_t previousSp = 0; + uint64_t previousIp = 0; + int ipMatchCount = 0; - // For each native frame + // For each native frame, add a page around the IP and any unwind info not already + // added in VisitProgramHeader (Linux) and VisitSection (MacOS) to the dump. while (true) { uint64_t ip = 0, sp = 0; @@ -54,6 +57,24 @@ ThreadInfo::UnwindNativeFrames(CONTEXT* pContext) if (ip == 0 || sp <= previousSp) { break; } + // Break out of the endless loop if the IP matches over a 1000 times. This is a fallback + // behavior of libunwind when the module the IP is in doesn't have unwind info and for + // simple stack overflows. The stack memory is added to the dump in GetThreadStack and + // it isn't necessary to add the same IP page over and over again. The only place this + // check won't catch is the stack overflow case that repeats a sequence of IPs over and + // over. + if (ip == previousIp) + { + if (ipMatchCount++ > 1000) + { + TRACE("Unwind: same ip %" PRIA PRIx64 " over 1000 times\n", ip); + break; + } + } + else + { + ipMatchCount = 0; + } // Add two pages around the instruction pointer to the core dump m_crashInfo.InsertMemoryRegion(ip - PAGE_SIZE, PAGE_SIZE * 2); @@ -72,6 +93,7 @@ ThreadInfo::UnwindNativeFrames(CONTEXT* pContext) break; } previousSp = sp; + previousIp = ip; } } diff --git a/src/coreclr/src/debug/createdump/threadinfomac.cpp b/src/coreclr/src/debug/createdump/threadinfomac.cpp index a33395f41dad..c9c8db8bb505 100644 --- a/src/coreclr/src/debug/createdump/threadinfomac.cpp +++ b/src/coreclr/src/debug/createdump/threadinfomac.cpp @@ -25,6 +25,7 @@ ThreadInfo::Initialize() m_ppid = 0; m_tgid = 0; +#if defined(TARGET_AMD64) x86_thread_state64_t state; mach_msg_type_number_t stateCount = x86_THREAD_STATE64_COUNT; kern_return_t result = ::thread_get_state(Port(), x86_THREAD_STATE64, (thread_state_t)&state, &stateCount); @@ -88,6 +89,38 @@ ThreadInfo::Initialize() memcpy(m_fpRegisters.st_space, &fpstate.__fpu_stmm0, sizeof(m_fpRegisters.st_space)); memcpy(m_fpRegisters.xmm_space, &fpstate.__fpu_xmm0, sizeof(m_fpRegisters.xmm_space)); +#elif defined(TARGET_ARM64) + arm_thread_state64_t state; + mach_msg_type_number_t stateCount = ARM_THREAD_STATE64_COUNT; + kern_return_t result = ::thread_get_state(Port(), ARM_THREAD_STATE64, (thread_state_t)&state, &stateCount); + if (result != KERN_SUCCESS) + { + fprintf(stderr, "thread_get_state(%x) FAILED %x %s\n", m_tid, result, mach_error_string(result)); + return false; + } + + memcpy(m_gpRegisters.regs, &state.__x, sizeof(state.__x)); + m_gpRegisters.regs[29] = arm_thread_state64_get_fp(state); + m_gpRegisters.regs[30] = (uint64_t)arm_thread_state64_get_lr_fptr(state); + + m_gpRegisters.sp = arm_thread_state64_get_sp(state); + m_gpRegisters.pc = (uint64_t)arm_thread_state64_get_pc_fptr(state); + + arm_neon_state64_t fpstate; + stateCount = ARM_NEON_STATE64_COUNT; + result = ::thread_get_state(Port(), ARM_NEON_STATE64, (thread_state_t)&fpstate, &stateCount); + if (result != KERN_SUCCESS) + { + fprintf(stderr, "thread_get_state(%x) FAILED %x %s\n", m_tid, result, mach_error_string(result)); + return false; + } + + memcpy(m_fpRegisters.vregs, &fpstate.__v, sizeof(m_fpRegisters.vregs)); + m_fpRegisters.fpsr = fpstate.__fpsr; + m_fpRegisters.fpcr = fpstate.__fpcr; +#else +#error Unexpected architecture +#endif return true; } diff --git a/src/coreclr/src/debug/daccess/CMakeLists.txt b/src/coreclr/src/debug/daccess/CMakeLists.txt index b683d762885b..64aada0d827e 100644 --- a/src/coreclr/src/debug/daccess/CMakeLists.txt +++ b/src/coreclr/src/debug/daccess/CMakeLists.txt @@ -38,18 +38,21 @@ convert_to_absolute_path(DACCESS_SOURCES ${DACCESS_SOURCES}) add_library_clr(daccess ${DACCESS_SOURCES}) set_target_properties(daccess PROPERTIES DAC_COMPONENT TRUE) -target_precompile_header(TARGET daccess HEADER stdafx.h) +target_precompile_headers(daccess PRIVATE [["stdafx.h"]]) add_dependencies(daccess eventing_headers) if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS) add_definitions(-DUSE_DAC_TABLE_RVA) + set(args $<$>:--dynamic> $ ${GENERATED_INCLUDE_DIR}/dactablerva.h) + add_custom_command( OUTPUT ${GENERATED_INCLUDE_DIR}/dactablerva.h DEPENDS coreclr VERBATIM - COMMAND sh ${CLR_DIR}/src/pal/tools/gen-dactable-rva.sh $ ${GENERATED_INCLUDE_DIR}/dactablerva.h + COMMAND_EXPAND_LISTS + COMMAND sh ${CLR_DIR}/src/pal/tools/gen-dactable-rva.sh ${args} COMMENT Generating ${GENERATED_INCLUDE_DIR}/dactablerva.h ) diff --git a/src/coreclr/src/debug/daccess/daccess.cpp b/src/coreclr/src/debug/daccess/daccess.cpp index e999ec866f7d..0344ddc1a3fb 100644 --- a/src/coreclr/src/debug/daccess/daccess.cpp +++ b/src/coreclr/src/debug/daccess/daccess.cpp @@ -3297,6 +3297,10 @@ ClrDataAccess::QueryInterface(THIS_ { ifaceRet = static_cast(this); } + else if (IsEqualIID(interfaceId, __uuidof(ISOSDacInterface10))) + { + ifaceRet = static_cast(this); + } else { *iface = NULL; @@ -6635,7 +6639,7 @@ bool ClrDataAccess::GetILImageNameFromNgenImage( LPCWSTR ilExtension, if (wszFileExtension != 0) { LPWSTR wszNextFileExtension = wszFileExtension; - // Find last occurence + // Find last occurrence do { wszFileExtension = wszNextFileExtension; diff --git a/src/coreclr/src/debug/daccess/dacdbiimpl.cpp b/src/coreclr/src/debug/daccess/dacdbiimpl.cpp index 4bcd6f2ff4cb..51cb32072d3d 100644 --- a/src/coreclr/src/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/src/debug/daccess/dacdbiimpl.cpp @@ -468,7 +468,7 @@ BOOL DacDbiInterfaceImpl::IsLeftSideInitialized() } -// Determines if a given adddress is a CLR stub. +// Determines if a given address is a CLR stub. BOOL DacDbiInterfaceImpl::IsTransitionStub(CORDB_ADDRESS address) { DD_ENTER_MAY_THROW; @@ -2399,7 +2399,7 @@ TypeHandle DacDbiInterfaceImpl::FindLoadedElementType(CorElementType elementType // Lookup operations run the class loader in non-load mode. ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE(); - MethodTable * pMethodTable = (&g_Mscorlib)->GetElementType(elementType); + MethodTable * pMethodTable = (&g_CoreLib)->GetElementType(elementType); return TypeHandle(pMethodTable); } // DacDbiInterfaceImpl::FindLoadedElementType @@ -4272,6 +4272,30 @@ void DacDbiInterfaceImpl::GetModuleSimpleName(VMPTR_Module vmModule, IStringHold IfFailThrow(pStrFilename->AssignCopy(convert.GetUnicode())); } +HRESULT DacDbiInterfaceImpl::IsModuleMapped(VMPTR_Module pModule, OUT BOOL *isModuleMapped) +{ + LOG((LF_CORDB, LL_INFO10000, "DDBII::IMM - TADDR 0x%x\n", pModule)); + DD_ENTER_MAY_THROW; + + HRESULT hr = S_FALSE; + PTR_Module pTargetModule = pModule.GetDacPtr(); + + EX_TRY + { + PTR_PEFile pPEFile = pTargetModule->GetFile(); + _ASSERTE(pPEFile != NULL); + + if (pPEFile->HasLoadedIL()) + { + *isModuleMapped = pPEFile->GetLoadedIL()->IsMapped(); + hr = S_OK; + } + } + EX_CATCH_HRESULT(hr); + + return hr; +} + // Helper to intialize a TargetBuffer from a MemoryRange // // Arguments: @@ -5743,7 +5767,7 @@ void DacDbiInterfaceImpl::GetContext(VMPTR_Thread vmThread, DT_CONTEXT * pContex if (pFilterContext == NULL) { // If the filter context is NULL, then we use the true context of the thread. - pContextBuffer->ContextFlags = CONTEXT_ALL; + pContextBuffer->ContextFlags = DT_CONTEXT_ALL; HRESULT hr = m_pTarget->GetThreadContext(pThread->GetOSThreadId(), pContextBuffer->ContextFlags, sizeof(*pContextBuffer), @@ -7240,7 +7264,7 @@ HRESULT DacDbiInterfaceImpl::GetArrayLayout(COR_TYPEID id, COR_ARRAY_LAYOUT *pLa if (mt->IsString()) { COR_TYPEID token; - token.token1 = MscorlibBinder::GetElementType(ELEMENT_TYPE_CHAR).GetAddr(); + token.token1 = CoreLibBinder::GetElementType(ELEMENT_TYPE_CHAR).GetAddr(); token.token2 = 0; pLayout->componentID = token; diff --git a/src/coreclr/src/debug/daccess/dacdbiimpl.h b/src/coreclr/src/debug/daccess/dacdbiimpl.h index 9178e7173626..e7a3dc9b3a09 100644 --- a/src/coreclr/src/debug/daccess/dacdbiimpl.h +++ b/src/coreclr/src/debug/daccess/dacdbiimpl.h @@ -363,6 +363,8 @@ class DacDbiInterfaceImpl : HRESULT GetLoaderHeapMemoryRanges(OUT DacDbiArrayList * pRanges); + HRESULT IsModuleMapped(VMPTR_Module pModule, OUT BOOL *isModuleMapped); + // retrieves the list of COM interfaces implemented by vmObject, as it is known at // the time of the call (the list may change as new interface types become available // in the runtime) @@ -731,7 +733,7 @@ class DacDbiInterfaceImpl : void GetModuleForDomainFile(VMPTR_DomainFile vmDomainFile, OUT VMPTR_Module * pModule); - // Yields true if the adddress is a CLR stub. + // Yields true if the address is a CLR stub. BOOL IsTransitionStub(CORDB_ADDRESS address); // Get the "type" of address. diff --git a/src/coreclr/src/debug/daccess/dacimpl.h b/src/coreclr/src/debug/daccess/dacimpl.h index c0809924bc3e..fdea07159d26 100644 --- a/src/coreclr/src/debug/daccess/dacimpl.h +++ b/src/coreclr/src/debug/daccess/dacimpl.h @@ -841,7 +841,8 @@ class ClrDataAccess public ISOSDacInterface6, public ISOSDacInterface7, public ISOSDacInterface8, - public ISOSDacInterface9 + public ISOSDacInterface9, + public ISOSDacInterface10 { public: ClrDataAccess(ICorDebugDataTarget * pTarget, ICLRDataTarget * pLegacyTarget=0); @@ -1209,6 +1210,12 @@ class ClrDataAccess // ISOSDacInterface9 virtual HRESULT STDMETHODCALLTYPE GetBreakingChangeVersion(int* pVersion); + // ISOSDacInterface10 + virtual HRESULT STDMETHODCALLTYPE GetObjectComWrappersData(CLRDATA_ADDRESS objAddr, CLRDATA_ADDRESS *rcw, unsigned int count, CLRDATA_ADDRESS *mowList, unsigned int *pNeeded); + virtual HRESULT STDMETHODCALLTYPE IsComWrappersCCW(CLRDATA_ADDRESS ccw, BOOL *isComWrappersCCW); + virtual HRESULT STDMETHODCALLTYPE GetComWrappersCCWData(CLRDATA_ADDRESS ccw, CLRDATA_ADDRESS *managedObject, int *refCount); + virtual HRESULT STDMETHODCALLTYPE IsComWrappersRCW(CLRDATA_ADDRESS rcw, BOOL *isComWrappersRCW); + virtual HRESULT STDMETHODCALLTYPE GetComWrappersRCWData(CLRDATA_ADDRESS rcw, CLRDATA_ADDRESS *identity); // // ClrDataAccess. // @@ -1475,6 +1482,9 @@ class ClrDataAccess #endif #ifdef FEATURE_COMWRAPPERS + BOOL DACGetComWrappersCCWVTableQIAddress(CLRDATA_ADDRESS ccwPtr, TADDR *vTableAddress, TADDR *qiAddress); + BOOL DACIsComWrappersCCW(CLRDATA_ADDRESS ccwPtr); + TADDR DACGetManagedObjectWrapperFromCCW(CLRDATA_ADDRESS ccwPtr); HRESULT DACTryGetComWrappersObjectFromCCW(CLRDATA_ADDRESS ccwPtr, OBJECTREF* objRef); #endif @@ -4027,4 +4037,36 @@ extern unsigned __int64 g_nFindStackTotalTime; #endif // #if defined(DAC_MEASURE_PERF) +#ifdef FEATURE_COMWRAPPERS + +// Public contract for ExternalObjectContext, keep in sync with definition in +// interoplibinterface.cpp +struct ExternalObjectContextDACnterface +{ + PTR_VOID identity; + INT_PTR _padding1; + DWORD SyncBlockIndex; + INT64 _padding3; +}; + +typedef DPTR(ExternalObjectContextDACnterface) PTR_ExternalObjectContext; + +// Public contract for ManagedObjectWrapper, keep in sync with definition in +// comwrappers.hpp +struct ManagedObjectWrapperDACInterface +{ + PTR_VOID managedObject; + INT32 _padding1; + INT32 _padding2; + INT_PTR _padding3; + INT_PTR _padding4; + INT_PTR _padding6; + LONGLONG _refCount; + INT32 _padding7; +}; + +typedef DPTR(ManagedObjectWrapperDACInterface) PTR_ManagedObjectWrapper; + +#endif // FEATURE_COMWRAPPERS + #endif // #ifndef __DACIMPL_H__ diff --git a/src/coreclr/src/debug/daccess/enummem.cpp b/src/coreclr/src/debug/daccess/enummem.cpp index 95909b89e3f8..d885ad3dd3bd 100644 --- a/src/coreclr/src/debug/daccess/enummem.cpp +++ b/src/coreclr/src/debug/daccess/enummem.cpp @@ -20,6 +20,11 @@ #include "binder.h" #include "win32threadpool.h" +#ifdef FEATURE_COMWRAPPERS +#include +#include +#endif // FEATURE_COMWRAPPERS + extern HRESULT GetDacTableAddress(ICorDebugDataTarget* dataTarget, ULONG64 baseAddress, PULONG64 dacTableAddress); #if defined(DAC_MEASURE_PERF) @@ -276,7 +281,7 @@ HRESULT ClrDataAccess::EnumMemCLRStatic(IN CLRDataEnumMemoryFlags flags) } CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_pEEDbgInterfaceImpl.EnumMem(); ) CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_CORDebuggerControlFlags.EnumMem(); ) - CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_Mscorlib.EnumMem(); ) + CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_CoreLib.EnumMem(); ) CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_pPredefinedArrayTypes[ELEMENT_TYPE_OBJECT].EnumMemoryRegions(flags); ) CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( StubManager::EnumMemoryRegions(flags); ) CATCH_ALL_EXCEPT_RETHROW_COR_E_OPERATIONCANCELLED( g_pFinalizerThread.EnumMem(); ) @@ -1056,10 +1061,10 @@ HRESULT ClrDataAccess::EnumMemDumpAllThreadsStack(CLRDataEnumMemoryFlags flags) { SUPPORTS_DAC; -#ifdef FEATURE_COMINTEROP +#if defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) // Dump the exception object stored in the WinRT stowed exception EnumMemStowedException(flags); -#endif +#endif // defined(FEATURE_COMINTEROP) || defined(FEATURE_COMWRAPPERS) HRESULT status = S_OK; TSIZE_T cbMemoryReported = m_cbMemoryReported; @@ -1377,6 +1382,10 @@ HRESULT ClrDataAccess::EnumMemStowedException(CLRDataEnumMemoryFlags flags) return S_OK; } + // Make sure we include the whole stowed exception array so we can debug a stowed exception + // in a minidump + ReportMem(remoteStowedExceptionArray, stowedExceptionCount * sizeof(TADDR)); + for (ULONG i = 0; i < stowedExceptionCount; ++i) { // Read the i-th stowed exception @@ -1389,6 +1398,8 @@ HRESULT ClrDataAccess::EnumMemStowedException(CLRDataEnumMemoryFlags flags) continue; } + ReportMem(remoteStowedException, sizeof(STOWED_EXCEPTION_INFORMATION_HEADER)); + // check if this is a v2 stowed exception STOWED_EXCEPTION_INFORMATION_V2 stowedException = { 0 }; if (FAILED(m_pTarget->ReadVirtual(TO_CDADDR(remoteStowedException), @@ -1399,6 +1410,8 @@ HRESULT ClrDataAccess::EnumMemStowedException(CLRDataEnumMemoryFlags flags) continue; } + ReportMem(remoteStowedException, sizeof(STOWED_EXCEPTION_INFORMATION_V2)); + // Read the full v2 stowed exception and get the CCW pointer out of it if (FAILED(m_pTarget->ReadVirtual(TO_CDADDR(remoteStowedException), (PBYTE)&stowedException, sizeof(STOWED_EXCEPTION_INFORMATION_V2), &bytesRead)) @@ -1424,21 +1437,36 @@ HRESULT ClrDataAccess::DumpStowedExceptionObject(CLRDataEnumMemoryFlags flags, C OBJECTREF managedExceptionObject = NULL; -#ifdef FEATURE_COMINTEROP - // dump the managed exception object wrapped in CCW - // memory of the CCW object itself is dumped later by DacInstanceManager::DumpAllInstances - DacpCCWData ccwData; - GetCCWData(ccwPtr, &ccwData); // this call collects some memory implicitly - managedExceptionObject = OBJECTREF(CLRDATA_ADDRESS_TO_TADDR(ccwData.managedObject)); -#endif #ifdef FEATURE_COMWRAPPERS + OBJECTREF wrappedObjAddress; + if (DACTryGetComWrappersObjectFromCCW(ccwPtr, &wrappedObjAddress) == S_OK) + { + managedExceptionObject = wrappedObjAddress; + // Now report the CCW itself + ReportMem(TO_TADDR(ccwPtr), sizeof(TADDR)); + TADDR managedObjectWrapperPtrPtr = ccwPtr & InteropLib::ABI::DispatchThisPtrMask; + ReportMem(managedObjectWrapperPtrPtr, sizeof(TADDR)); + + // Plus its QI and VTable that we query to determine if it is a ComWrappers CCW + TADDR vTableAddress = NULL; + TADDR qiAddress = NULL; + DACGetComWrappersCCWVTableQIAddress(ccwPtr, &vTableAddress, &qiAddress); + ReportMem(vTableAddress, sizeof(TADDR)); + ReportMem(qiAddress, sizeof(TADDR)); + + // And the MOW it points to + TADDR mow = DACGetManagedObjectWrapperFromCCW(ccwPtr); + ReportMem(mow, sizeof(ManagedObjectWrapperDACInterface)); + } +#endif +#ifdef FEATURE_COMINTEROP if (managedExceptionObject == NULL) { - OBJECTREF wrappedObjAddress; - if (DACTryGetComWrappersObjectFromCCW(ccwPtr, &wrappedObjAddress) == S_OK) - { - managedExceptionObject = wrappedObjAddress; - } + // dump the managed exception object wrapped in CCW + // memory of the CCW object itself is dumped later by DacInstanceManager::DumpAllInstances + DacpCCWData ccwData; + GetCCWData(ccwPtr, &ccwData); // this call collects some memory implicitly + managedExceptionObject = OBJECTREF(CLRDATA_ADDRESS_TO_TADDR(ccwData.managedObject)); } #endif DumpManagedExcepObject(flags, managedExceptionObject); diff --git a/src/coreclr/src/debug/daccess/fntableaccess.h b/src/coreclr/src/debug/daccess/fntableaccess.h index b9b73e6fe3b3..9501e0bbeec3 100644 --- a/src/coreclr/src/debug/daccess/fntableaccess.h +++ b/src/coreclr/src/debug/daccess/fntableaccess.h @@ -106,7 +106,7 @@ struct FakeStub UINT32 m_signature; #else #ifdef HOST_64BIT - //README ALIGNEMENT: in retail mode UINT m_numCodeBytes does not align to 16byte for the code + //README ALIGNMENT: in retail mode UINT m_numCodeBytes does not align to 16byte for the code // after the Stub struct. This is to pad properly UINT m_pad_code_bytes; #endif // HOST_64BIT diff --git a/src/coreclr/src/debug/daccess/inspect.cpp b/src/coreclr/src/debug/daccess/inspect.cpp index 75cfcc3cadce..28375862bd38 100644 --- a/src/coreclr/src/debug/daccess/inspect.cpp +++ b/src/coreclr/src/debug/daccess/inspect.cpp @@ -136,7 +136,7 @@ GetTypeFieldValueFlags(TypeHandle typeHandle, // Perform extra checks to identify well-known classes. // - if ((&g_Mscorlib)->IsClass(typeHandle.GetMethodTable(), CLASS__STRING)) + if ((&g_CoreLib)->IsClass(typeHandle.GetMethodTable(), CLASS__STRING)) { otherFlags |= CLRDATA_VALUE_IS_STRING; } diff --git a/src/coreclr/src/debug/daccess/nidump.cpp b/src/coreclr/src/debug/daccess/nidump.cpp index 5a0bbfd81006..e59fc9195954 100644 --- a/src/coreclr/src/debug/daccess/nidump.cpp +++ b/src/coreclr/src/debug/daccess/nidump.cpp @@ -92,7 +92,6 @@ FORCEINLINE ULONG DacSigUncompressData( return *pData++; return DacSigUncompressBigData(pData); } -//const static mdToken g_tkCorEncodeToken[4] ={mdtTypeDef, mdtTypeRef, mdtTypeSpec, mdtBaseType}; // uncompress a token inline mdToken DacSigUncompressToken( // return the token. @@ -102,7 +101,7 @@ inline mdToken DacSigUncompressToken( // return the token. mdToken tkType; tk = DacSigUncompressData(pData); - tkType = g_tkCorEncodeToken[tk & 0x3]; + tkType = CorSigDecodeTokenType(tk & 0x3); tk = TokenFromRid(tk >> 2, tkType); return tk; } @@ -477,7 +476,7 @@ NativeImageDumper::NativeImageDumper(PTR_VOID loadedBase, m_dis(dis), m_MetadataSize(0), m_ILHostCopy(NULL), - m_isMscorlibHardBound(false), + m_isCoreLibHardBound(false), m_sectionAlignment(0) { IfFailThrow(m_display->GetDumpOptions(&m_dumpOptions)); @@ -1132,54 +1131,54 @@ NativeImageDumper::DumpNativeImage() /* XXX Wed 12/14/2005 * Now for the real insanity. I need to initialize static classes in - * the DAC. First I need to find mscorlib's dependency entry. Search + * the DAC. First I need to find CoreLib's dependency entry. Search * through all of the dependencies to find the one marked as - * fIsMscorlib. If I don't find anything marked that way, then "self" - * is mscorlib. + * fIsCoreLib. If I don't find anything marked that way, then "self" + * is CoreLib. */ - Dependency * mscorlib = NULL; + Dependency * corelib = NULL; for( COUNT_T i = 0; i < m_numDependencies; ++i ) { - if( m_dependencies[i].fIsMscorlib ) + if( m_dependencies[i].fIsCoreLib ) { - mscorlib = &m_dependencies[i]; + corelib = &m_dependencies[i]; break; } } - //If we're actually dumping mscorlib, remap the mscorlib dependency to our own native image. - if( (mscorlib == NULL) || !wcscmp(m_name, CoreLibName_W)) + //If we're actually dumping CoreLib, remap the CoreLib dependency to our own native image. + if( (corelib == NULL) || !wcscmp(m_name, CoreLibName_W)) { - mscorlib = GetDependency(0); - mscorlib->fIsMscorlib = TRUE; - _ASSERTE(mscorlib->fIsHardbound); + corelib = GetDependency(0); + corelib->fIsCoreLib = TRUE; + _ASSERTE(corelib->fIsHardbound); } - _ASSERTE(mscorlib != NULL); - if( mscorlib->fIsHardbound ) + _ASSERTE(corelib != NULL); + if( corelib->fIsHardbound ) { - m_isMscorlibHardBound = true; + m_isCoreLibHardBound = true; } - if( m_isMscorlibHardBound ) + if( m_isCoreLibHardBound ) { //go through the module to the binder. - PTR_Module mscorlibModule = mscorlib->pModule; + PTR_Module corelibModule = corelib->pModule; - PTR_MscorlibBinder binder = mscorlibModule->m_pBinder; - g_Mscorlib = *binder; + PTR_CoreLibBinder binder = corelibModule->m_pBinder; + g_CoreLib = *binder; - PTR_MethodTable mt = MscorlibBinder::GetExistingClass(CLASS__OBJECT); + PTR_MethodTable mt = CoreLibBinder::GetExistingClass(CLASS__OBJECT); g_pObjectClass = mt; } if (g_pObjectClass == NULL) { - //if mscorlib is not hard bound, then warn the user (many features of nidump are shut off) - m_display->ErrorPrintF( "Assembly %S is soft bound to mscorlib. nidump cannot dump MethodTables completely.\n", m_name ); + //if CoreLib is not hard bound, then warn the user (many features of nidump are shut off) + m_display->ErrorPrintF( "Assembly %S is soft bound to CoreLib. nidump cannot dump MethodTables completely.\n", m_name ); // TritonTODO: reason? // reset "hard bound state" - m_isMscorlibHardBound = false; + m_isCoreLibHardBound = false; } } @@ -1267,8 +1266,8 @@ void NativeImageDumper::TraceDumpDependency(int idx, NativeImageDumper::Dependen m_display->ErrorPrintF("\tSize: %x (%d)\n", dependency->size, dependency->size); m_display->ErrorPrintF("\tModule: P=%p, L=%p\n", DataPtrToDisplay(dac_cast(dependency->pModule)), PTR_TO_TADDR(dependency->pModule)); - m_display->ErrorPrintF("Mscorlib=%s, Hardbound=%s\n", - (dependency->fIsMscorlib ? "true" : "false"), + m_display->ErrorPrintF("CoreLib=%s, Hardbound=%s\n", + (dependency->fIsCoreLib ? "true" : "false"), (dependency->fIsHardbound ? "true" : "false")); m_display->ErrorPrintF("Name: %S\n", dependency->name); } @@ -2391,7 +2390,7 @@ mdAssemblyRef NativeImageDumper::MapAssemblyRefToManifest(mdAssemblyRef token, I } else if (wcscmp(szAssemblyName, CoreLibName_W) == 0) { - // Mscorlib is special - version number and public key token are ignored. + // CoreLib is special - version number and public key token are ignored. ret = currentRef; break; } @@ -2400,7 +2399,7 @@ mdAssemblyRef NativeImageDumper::MapAssemblyRefToManifest(mdAssemblyRef token, I metadata.usBuildNumber == 255 && metadata.usRevisionNumber == 255) { - // WinMDs encode all assemblyrefs with version 255.255.255.255 including CLR assembly dependencies (mscorlib, System). + // WinMDs encode all assemblyrefs with version 255.255.255.255 including CLR assembly dependencies (corelib, System). ret = currentRef; } else @@ -2602,8 +2601,8 @@ NativeImageDumper::Dependency *NativeImageDumper::OpenDependency(int index) Dependency& dependency = m_dependencies[index]; AppendTokenName(entry->dwAssemblyRef, buf, m_manifestImport, true); bool isHardBound = !!(entry->signNativeImage != INVALID_NGEN_SIGNATURE); - SString mscorlibStr(SString::Literal, CoreLibName_W); - bool isMscorlib = (0 == buf.Compare( mscorlibStr )); + SString corelibStr(SString::Literal, CoreLibName_W); + bool isCoreLib = (0 == buf.Compare( corelibStr )); dependency.fIsHardbound = isHardBound; wcscpy_s(dependency.name, _countof(dependency.name), (const WCHAR*)buf); @@ -2703,7 +2702,7 @@ NativeImageDumper::Dependency *NativeImageDumper::OpenDependency(int index) ofRead, IID_IMetaDataImport2, (IUnknown **) &dependency.pImport)); - dependency.fIsMscorlib = isMscorlib; + dependency.fIsCoreLib = isCoreLib; } m_dependencies[index].entry = entry; @@ -3716,7 +3715,7 @@ void NativeImageDumper::DumpModule( PTR_Module module ) /* REVISIT_TODO Fri 10/14/2005 * Dump the binder */ - PTR_MscorlibBinder binder = module->m_pBinder; + PTR_CoreLibBinder binder = module->m_pBinder; if( NULL != binder ) { DisplayStartStructureWithOffset( m_pBinder, DPtrToPreferredAddr(binder), @@ -3726,38 +3725,38 @@ void NativeImageDumper::DumpModule( PTR_Module module ) //these four fields don't have anything useful in ngen images. DisplayWriteFieldPointer( m_classDescriptions, DPtrToPreferredAddr(binder->m_classDescriptions), - MscorlibBinder, MODULE ); + CoreLibBinder, MODULE ); DisplayWriteFieldPointer( m_methodDescriptions, DPtrToPreferredAddr(binder->m_methodDescriptions), - MscorlibBinder, MODULE ); + CoreLibBinder, MODULE ); DisplayWriteFieldPointer( m_fieldDescriptions, DPtrToPreferredAddr(binder->m_fieldDescriptions), - MscorlibBinder, MODULE ); + CoreLibBinder, MODULE ); DisplayWriteFieldPointer( m_pModule, DPtrToPreferredAddr(binder->m_pModule), - MscorlibBinder, MODULE ); + CoreLibBinder, MODULE ); - DisplayWriteFieldInt( m_cClasses, binder->m_cClasses, MscorlibBinder, + DisplayWriteFieldInt( m_cClasses, binder->m_cClasses, CoreLibBinder, MODULE ); DisplayWriteFieldAddress( m_pClasses, DPtrToPreferredAddr(binder->m_pClasses), sizeof(*binder->m_pClasses) * binder->m_cClasses, - MscorlibBinder, MODULE ); - DisplayWriteFieldInt( m_cFields, binder->m_cFields, MscorlibBinder, + CoreLibBinder, MODULE ); + DisplayWriteFieldInt( m_cFields, binder->m_cFields, CoreLibBinder, MODULE ); DisplayWriteFieldAddress( m_pFields, DPtrToPreferredAddr(binder->m_pFields), sizeof(*binder->m_pFields) * binder->m_cFields, - MscorlibBinder, MODULE ); - DisplayWriteFieldInt( m_cMethods, binder->m_cMethods, MscorlibBinder, + CoreLibBinder, MODULE ); + DisplayWriteFieldInt( m_cMethods, binder->m_cMethods, CoreLibBinder, MODULE ); DisplayWriteFieldAddress( m_pMethods, DPtrToPreferredAddr(binder->m_pMethods), sizeof(*binder->m_pMethods) * binder->m_cMethods, - MscorlibBinder, MODULE ); + CoreLibBinder, MODULE ); DisplayEndStructure( MODULE ); //m_pBinder } @@ -6766,11 +6765,11 @@ NativeImageDumper::DumpMethodTable( PTR_MethodTable mt, const char * name, MethodTableToString( mt, buf ); m_display->ErrorPrintF( "WARNING! MethodTable %S is generic but is not hard bound to its EEClass. Cannot compute generic dictionary sizes.\n", (const WCHAR *)buf ); } - else if( !m_isMscorlibHardBound ) + else if( !m_isCoreLibHardBound ) { /* REVISIT_TODO Mon 8/20/2007 - * If we're not hard bound to mscorlib, most things don't work. They depend on knowing what - * g_pObjectClass is. Without the hard binding to mscorlib, I can't figure that out. + * If we're not hard bound to CoreLib, most things don't work. They depend on knowing what + * g_pObjectClass is. Without the hard binding to CoreLib, I can't figure that out. */ haveCompleteExtents = false; } @@ -7996,7 +7995,7 @@ void NativeImageDumper::DumpMethodDesc( PTR_MethodDesc md, PTR_Module module ) InstantiatedMethodDesc, METHODDESCS ); #ifdef FEATURE_COMINTEROP - if (imd->IMD_HasComPlusCallInfo()) + if (imd->IsGenericComPlusCall()) { PTR_ComPlusCallInfo compluscall = imd->IMD_GetComPlusCallInfo(); DumpComPlusCallInfo( compluscall, METHODDESCS ); diff --git a/src/coreclr/src/debug/daccess/nidump.h b/src/coreclr/src/debug/daccess/nidump.h index b8c0a04ddb41..a6e9461a475a 100644 --- a/src/coreclr/src/debug/daccess/nidump.h +++ b/src/coreclr/src/debug/daccess/nidump.h @@ -305,7 +305,7 @@ class NativeImageDumper TADDR pMetadataStartTarget; TADDR pMetadataStartHost; SIZE_T MetadataSize; - bool fIsMscorlib; + bool fIsCoreLib; bool fIsHardbound; WCHAR name[128]; }; @@ -548,9 +548,9 @@ class NativeImageDumper COUNT_T m_ILSectionSize; #endif - //This is true if we are hard bound to mscorlib. This enables various forms of generics dumping and MT + //This is true if we are hard bound to corelib. This enables various forms of generics dumping and MT //dumping that require g_pObjectClass to be set. - bool m_isMscorlibHardBound; + bool m_isCoreLibHardBound; #if 0 PTR_CCOR_SIGNATURE metadataToHostDAC( PCCOR_SIGNATURE pSig, diff --git a/src/coreclr/src/debug/daccess/reimpl.cpp b/src/coreclr/src/debug/daccess/reimpl.cpp index 832522fca7c9..63beae098e6e 100644 --- a/src/coreclr/src/debug/daccess/reimpl.cpp +++ b/src/coreclr/src/debug/daccess/reimpl.cpp @@ -97,7 +97,7 @@ DacGetThreadContext(Thread* thread, T_CONTEXT* context) ULONG32 contextFlags; - contextFlags = CONTEXT_ALL; + contextFlags = DT_CONTEXT_ALL; HRESULT status = g_dacImpl->m_pTarget-> diff --git a/src/coreclr/src/debug/daccess/request.cpp b/src/coreclr/src/debug/daccess/request.cpp index 4c6671149bee..99366e980e26 100644 --- a/src/coreclr/src/debug/daccess/request.cpp +++ b/src/coreclr/src/debug/daccess/request.cpp @@ -15,11 +15,15 @@ #include "typestring.h" #include #include + #ifdef FEATURE_COMINTEROP #include #endif // FEATURE_COMINTEROP +#ifdef FEATURE_COMWRAPPERS +#include #include +#endif // FEATURE_COMWRAPPERS #ifndef TARGET_UNIX // It is unfortunate having to include this header just to get the definition of GenericModeBlock @@ -1058,7 +1062,7 @@ HRESULT ClrDataAccess::GetMethodDescData( OBJECTREF value = pResolver->GetManagedResolver(); if (value) { - FieldDesc *pField = (&g_Mscorlib)->GetField(FIELD__DYNAMICRESOLVER__DYNAMIC_METHOD); + FieldDesc *pField = (&g_CoreLib)->GetField(FIELD__DYNAMICRESOLVER__DYNAMIC_METHOD); _ASSERTE(pField); value = pField->GetRefValue(value); if (value) @@ -4071,58 +4075,93 @@ PTR_IUnknown ClrDataAccess::DACGetCOMIPFromCCW(PTR_ComCallWrapper pCCW, int vtab #endif #ifdef FEATURE_COMWRAPPERS -HRESULT ClrDataAccess::DACTryGetComWrappersObjectFromCCW(CLRDATA_ADDRESS ccwPtr, OBJECTREF* objRef) +BOOL ClrDataAccess::DACGetComWrappersCCWVTableQIAddress(CLRDATA_ADDRESS ccwPtr, TADDR *vTableAddress, TADDR *qiAddress) { - if (ccwPtr == 0 || objRef == NULL) - return E_INVALIDARG; - - SOSDacEnter(); + _ASSERTE(vTableAddress != NULL && qiAddress != NULL); - // Read CCWs QI address and compare it to the managed object wrapper's implementation. + HRESULT hr = S_OK; ULONG32 bytesRead = 0; TADDR ccw = CLRDATA_ADDRESS_TO_TADDR(ccwPtr); - TADDR vTableAddress = NULL; - IfFailGo(m_pTarget->ReadVirtual(ccw, (PBYTE)&vTableAddress, sizeof(TADDR), &bytesRead)); - if (bytesRead != sizeof(TADDR) + *vTableAddress = NULL; + if (FAILED(m_pTarget->ReadVirtual(ccw, (PBYTE)vTableAddress, sizeof(TADDR), &bytesRead)) + || bytesRead != sizeof(TADDR) || vTableAddress == NULL) { - hr = E_FAIL; - goto ErrExit; + return FALSE; } - TADDR qiAddress = NULL; - IfFailGo(m_pTarget->ReadVirtual(vTableAddress, (PBYTE)&qiAddress, sizeof(TADDR), &bytesRead)); - if (bytesRead != sizeof(TADDR) + *qiAddress = NULL; + if (FAILED(m_pTarget->ReadVirtual(*vTableAddress, (PBYTE)qiAddress, sizeof(TADDR), &bytesRead)) + || bytesRead != sizeof(TADDR) || qiAddress == NULL) { - hr = E_FAIL; - goto ErrExit; + return FALSE; } #ifdef TARGET_ARM // clear the THUMB bit on qiAddress before comparing with known vtable entry - qiAddress &= ~THUMB_CODE; + *qiAddress &= ~THUMB_CODE; #endif - if (qiAddress != GetEEFuncEntryPoint(ManagedObjectWrapper_QueryInterface)) + return TRUE; +} + +BOOL ClrDataAccess::DACIsComWrappersCCW(CLRDATA_ADDRESS ccwPtr) +{ + TADDR vTableAddress = NULL; + TADDR qiAddress = NULL; + if (!DACGetComWrappersCCWVTableQIAddress(ccwPtr, &vTableAddress, &qiAddress)) + { + return FALSE; + } + + return qiAddress == GetEEFuncEntryPoint(ManagedObjectWrapper_QueryInterface); +} + +TADDR ClrDataAccess::DACGetManagedObjectWrapperFromCCW(CLRDATA_ADDRESS ccwPtr) +{ + if (!DACIsComWrappersCCW(ccwPtr)) + { + return NULL; + } + + ULONG32 bytesRead = 0; + TADDR managedObjectWrapperPtrPtr = ccwPtr & InteropLib::ABI::DispatchThisPtrMask; + TADDR managedObjectWrapperPtr = 0; + if (FAILED(m_pTarget->ReadVirtual(managedObjectWrapperPtrPtr, (PBYTE)&managedObjectWrapperPtr, sizeof(TADDR), &bytesRead)) + || bytesRead != sizeof(TADDR)) + { + return NULL; + } + + return managedObjectWrapperPtr; +} + +HRESULT ClrDataAccess::DACTryGetComWrappersObjectFromCCW(CLRDATA_ADDRESS ccwPtr, OBJECTREF* objRef) +{ + if (ccwPtr == 0 || objRef == NULL) + return E_INVALIDARG; + + SOSDacEnter(); + + if (!DACIsComWrappersCCW(ccwPtr)) { hr = E_FAIL; goto ErrExit; } - // Mask the "dispatch pointer" to get a double pointer to the ManagedObjectWrapper - TADDR managedObjectWrapperPtrPtr = ccw & InteropLib::ABI::DispatchThisPtrMask; + TADDR ccw = CLRDATA_ADDRESS_TO_TADDR(ccwPtr); // Return ManagedObjectWrapper as an OBJECTHANDLE. (The OBJECTHANDLE is guaranteed to live at offset 0). - TADDR managedObjectWrapperPtr; - IfFailGo(m_pTarget->ReadVirtual(managedObjectWrapperPtrPtr, (PBYTE)&managedObjectWrapperPtr, sizeof(TADDR), &bytesRead)); - if (bytesRead != sizeof(TADDR)) + TADDR managedObjectWrapperPtr = DACGetManagedObjectWrapperFromCCW(ccwPtr); + if (managedObjectWrapperPtr == NULL) { hr = E_FAIL; goto ErrExit; } + ULONG32 bytesRead = 0; OBJECTHANDLE handle; IfFailGo(m_pTarget->ReadVirtual(managedObjectWrapperPtr, (PBYTE)&handle, sizeof(OBJECTHANDLE), &bytesRead)); if (bytesRead != sizeof(OBJECTHANDLE)) @@ -4741,3 +4780,236 @@ HRESULT ClrDataAccess::GetBreakingChangeVersion(int* pVersion) *pVersion = SOS_BREAKING_CHANGE_VERSION; return S_OK; } + +HRESULT ClrDataAccess::GetObjectComWrappersData(CLRDATA_ADDRESS objAddr, CLRDATA_ADDRESS *rcw, unsigned int count, CLRDATA_ADDRESS *mowList, unsigned int *pNeeded) +{ +#ifdef FEATURE_COMWRAPPERS + if (objAddr == 0 ) + { + return E_INVALIDARG; + } + + if (count > 0 && mowList == NULL) + { + return E_INVALIDARG; + } + + SOSDacEnter(); + if (pNeeded != NULL) + { + *pNeeded = 0; + } + + if (rcw != NULL) + { + *rcw = 0; + } + + PTR_SyncBlock pSyncBlk = PTR_Object(TO_TADDR(objAddr))->PassiveGetSyncBlock(); + if (pSyncBlk != NULL) + { + PTR_InteropSyncBlockInfo pInfo = pSyncBlk->GetInteropInfoNoCreate(); + if (pInfo != NULL) + { + if (rcw != NULL) + { + *rcw = TO_TADDR(pInfo->m_externalComObjectContext); + } + + DPTR(NewHolder) mapHolder(PTR_TO_MEMBER_TADDR(InteropSyncBlockInfo, pInfo, m_managedObjectComWrapperMap)); + DPTR(ManagedObjectComWrapperByIdMap *)ppMap(PTR_TO_MEMBER_TADDR(NewHolder, mapHolder, m_value)); + DPTR(ManagedObjectComWrapperByIdMap) pMap(TO_TADDR(*ppMap)); + + CQuickArrayList comWrappers; + if (pMap != NULL) + { + ManagedObjectComWrapperByIdMap::Iterator iter = pMap->Begin(); + while (iter != pMap->End()) + { + comWrappers.Push(TO_CDADDR(iter->Value())); + ++iter; + + } + } + + if (pNeeded != NULL) + { + *pNeeded = (unsigned int)comWrappers.Size(); + } + + for (SIZE_T pos = 0; pos < comWrappers.Size(); ++pos) + { + if (pos >= count) + { + hr = S_FALSE; + break; + } + + mowList[pos] = comWrappers[pos]; + } + } + else + { + hr = S_FALSE; + } + } + else + { + hr = S_FALSE; + } + + SOSDacLeave(); + return hr; +#else // FEATURE_COMWRAPPERS + return E_NOTIMPL; +#endif // FEATURE_COMWRAPPERS +} + +HRESULT ClrDataAccess::IsComWrappersCCW(CLRDATA_ADDRESS ccw, BOOL *isComWrappersCCW) +{ +#ifdef FEATURE_COMWRAPPERS + if (ccw == 0) + { + return E_INVALIDARG; + } + + SOSDacEnter(); + + if (isComWrappersCCW != NULL) + { + TADDR managedObjectWrapperPtr = DACGetManagedObjectWrapperFromCCW(ccw); + *isComWrappersCCW = managedObjectWrapperPtr != NULL; + hr = *isComWrappersCCW ? S_OK : S_FALSE; + } + + SOSDacLeave(); + return hr; +#else // FEATURE_COMWRAPPERS + return E_NOTIMPL; +#endif // FEATURE_COMWRAPPERS +} + +HRESULT ClrDataAccess::GetComWrappersCCWData(CLRDATA_ADDRESS ccw, CLRDATA_ADDRESS *managedObject, int *refCount) +{ +#ifdef FEATURE_COMWRAPPERS + if (ccw == 0) + { + return E_INVALIDARG; + } + + SOSDacEnter(); + + TADDR managedObjectWrapperPtr = DACGetManagedObjectWrapperFromCCW(ccw); + if (managedObjectWrapperPtr != NULL) + { + PTR_ManagedObjectWrapper pMOW(managedObjectWrapperPtr); + + if (managedObject != NULL) + { + OBJECTREF managedObjectRef; + if (SUCCEEDED(DACTryGetComWrappersObjectFromCCW(ccw, &managedObjectRef))) + { + *managedObject = PTR_HOST_TO_TADDR(managedObjectRef); + } + else + { + *managedObject = 0; + } + } + + if (refCount != NULL) + { + *refCount = (int)pMOW->_refCount; + } + } + else + { + // Not a ComWrappers CCW + hr = E_INVALIDARG; + } + + SOSDacLeave(); + return hr; +#else // FEATURE_COMWRAPPERS + return E_NOTIMPL; +#endif // FEATURE_COMWRAPPERS +} + +HRESULT ClrDataAccess::IsComWrappersRCW(CLRDATA_ADDRESS rcw, BOOL *isComWrappersRCW) +{ +#ifdef FEATURE_COMWRAPPERS + if (rcw == 0) + { + return E_INVALIDARG; + } + + SOSDacEnter(); + + if (isComWrappersRCW != NULL) + { + PTR_ExternalObjectContext pRCW(TO_TADDR(rcw)); + BOOL stillValid = TRUE; + if(pRCW->SyncBlockIndex >= SyncBlockCache::s_pSyncBlockCache->m_SyncTableSize) + { + stillValid = FALSE; + } + + PTR_SyncBlock pSyncBlk = NULL; + if (stillValid) + { + PTR_SyncTableEntry ste = PTR_SyncTableEntry(dac_cast(g_pSyncTable) + (sizeof(SyncTableEntry) * pRCW->SyncBlockIndex)); + pSyncBlk = ste->m_SyncBlock; + if(pSyncBlk == NULL) + { + stillValid = FALSE; + } + } + + PTR_InteropSyncBlockInfo pInfo = NULL; + if (stillValid) + { + pInfo = pSyncBlk->GetInteropInfoNoCreate(); + if(pInfo == NULL) + { + stillValid = FALSE; + } + } + + if (stillValid) + { + stillValid = TO_TADDR(pInfo->m_externalComObjectContext) == PTR_HOST_TO_TADDR(pRCW); + } + + *isComWrappersRCW = stillValid; + hr = *isComWrappersRCW ? S_OK : S_FALSE; + } + + SOSDacLeave(); + return hr; +#else // FEATURE_COMWRAPPERS + return E_NOTIMPL; +#endif // FEATURE_COMWRAPPERS +} + +HRESULT ClrDataAccess::GetComWrappersRCWData(CLRDATA_ADDRESS rcw, CLRDATA_ADDRESS *identity) +{ +#ifdef FEATURE_COMWRAPPERS + if (rcw == 0) + { + return E_INVALIDARG; + } + + SOSDacEnter(); + + PTR_ExternalObjectContext pEOC(TO_TADDR(rcw)); + if (identity != NULL) + { + *identity = PTR_CDADDR(pEOC->identity); + } + + SOSDacLeave(); + return hr; +#else // FEATURE_COMWRAPPERS + return E_NOTIMPL; +#endif // FEATURE_COMWRAPPERS +} diff --git a/src/coreclr/src/debug/daccess/stack.cpp b/src/coreclr/src/debug/daccess/stack.cpp index 09e16b4979ab..94ef49b972ad 100644 --- a/src/coreclr/src/debug/daccess/stack.cpp +++ b/src/coreclr/src/debug/daccess/stack.cpp @@ -1391,7 +1391,7 @@ ClrDataFrame::ValueFromDebugInfo(MetaSig* sig, // XXX Microsoft - Sometimes types can't be looked // up and this at least allows the value to be used, // but is it the right behavior? - argType = TypeHandle(MscorlibBinder::GetElementType(ELEMENT_TYPE_U8)); + argType = TypeHandle(CoreLibBinder::GetElementType(ELEMENT_TYPE_U8)); valueFlags = 0; } else diff --git a/src/coreclr/src/debug/dbgutil/CMakeLists.txt b/src/coreclr/src/debug/dbgutil/CMakeLists.txt index bee929f37982..30be04114a49 100644 --- a/src/coreclr/src/debug/dbgutil/CMakeLists.txt +++ b/src/coreclr/src/debug/dbgutil/CMakeLists.txt @@ -2,7 +2,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) endif(CLR_CMAKE_HOST_WIN32) if(CLR_CMAKE_HOST_WIN32 OR CLR_CMAKE_HOST_OSX) diff --git a/src/coreclr/src/debug/dbgutil/machoreader.cpp b/src/coreclr/src/debug/dbgutil/machoreader.cpp index 155ec15a3af0..fa94b49b8d4a 100644 --- a/src/coreclr/src/debug/dbgutil/machoreader.cpp +++ b/src/coreclr/src/debug/dbgutil/machoreader.cpp @@ -401,6 +401,7 @@ MachOReader::ReadString(const char* address, std::string& str) char c = 0; if (!ReadMemory((void*)(address + i), &c, sizeof(char))) { + Trace("ERROR: Failed to read string at %p\n", (void*)(address + i)); return false; } if (c == '\0') diff --git a/src/coreclr/src/debug/debug-pal/CMakeLists.txt b/src/coreclr/src/debug/debug-pal/CMakeLists.txt index 12a0005c0532..213fa59e784c 100644 --- a/src/coreclr/src/debug/debug-pal/CMakeLists.txt +++ b/src/coreclr/src/debug/debug-pal/CMakeLists.txt @@ -34,4 +34,6 @@ if(CLR_CMAKE_HOST_UNIX) endif(CLR_CMAKE_HOST_UNIX) -_add_library(debug-pal OBJECT ${TWO_WAY_PIPE_SOURCES}) +_add_library(debug-pal_obj OBJECT ${TWO_WAY_PIPE_SOURCES}) +add_library(debug-pal INTERFACE) +target_sources(debug-pal INTERFACE $) diff --git a/src/coreclr/src/debug/debug-pal/unix/diagnosticsipc.cpp b/src/coreclr/src/debug/debug-pal/unix/diagnosticsipc.cpp index 632ac03a44c2..2dc6c8807a65 100644 --- a/src/coreclr/src/debug/debug-pal/unix/diagnosticsipc.cpp +++ b/src/coreclr/src/debug/debug-pal/unix/diagnosticsipc.cpp @@ -61,8 +61,8 @@ IpcStream::DiagnosticsIpc *IpcStream::DiagnosticsIpc::Create(const char *const p "socket"); } - if (mode == ConnectionMode::CLIENT) - return new IpcStream::DiagnosticsIpc(-1, &serverAddress, ConnectionMode::CLIENT); + if (mode == ConnectionMode::CONNECT) + return new IpcStream::DiagnosticsIpc(-1, &serverAddress, ConnectionMode::CONNECT); #ifdef __APPLE__ mode_t prev_mask = umask(~(S_IRUSR | S_IWUSR)); // This will set the default permission bit to 600 @@ -116,8 +116,8 @@ IpcStream::DiagnosticsIpc *IpcStream::DiagnosticsIpc::Create(const char *const p bool IpcStream::DiagnosticsIpc::Listen(ErrorCallback callback) { - _ASSERTE(mode == ConnectionMode::SERVER); - if (mode != ConnectionMode::SERVER) + _ASSERTE(mode == ConnectionMode::LISTEN); + if (mode != ConnectionMode::LISTEN) { if (callback != nullptr) callback("Cannot call Listen on a client connection", -1); @@ -150,7 +150,7 @@ bool IpcStream::DiagnosticsIpc::Listen(ErrorCallback callback) IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback) { - _ASSERTE(mode == ConnectionMode::SERVER); + _ASSERTE(mode == ConnectionMode::LISTEN); _ASSERTE(_isListening); sockaddr_un from; @@ -168,7 +168,7 @@ IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback) IpcStream *IpcStream::DiagnosticsIpc::Connect(ErrorCallback callback) { - _ASSERTE(mode == ConnectionMode::CLIENT); + _ASSERTE(mode == ConnectionMode::CONNECT); sockaddr_un clientAddress{}; clientAddress.sun_family = AF_UNIX; @@ -194,7 +194,7 @@ IpcStream *IpcStream::DiagnosticsIpc::Connect(ErrorCallback callback) return nullptr; } - return new IpcStream(clientSocket, ConnectionMode::CLIENT); + return new IpcStream(clientSocket, ConnectionMode::CONNECT); } int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_t nHandles, int32_t timeoutMs, ErrorCallback callback) @@ -208,7 +208,7 @@ int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_ if (rgIpcPollHandles[i].pIpc != nullptr) { // SERVER - _ASSERTE(rgIpcPollHandles[i].pIpc->mode == ConnectionMode::SERVER); + _ASSERTE(rgIpcPollHandles[i].pIpc->mode == ConnectionMode::LISTEN); fd = rgIpcPollHandles[i].pIpc->_serverSocket; } else @@ -246,6 +246,8 @@ int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_ { if (pollfds[i].revents != 0) { + if (callback != nullptr) + callback("IpcStream::DiagnosticsIpc::Poll - poll revents", (uint32_t)pollfds[i].revents); // error check FIRST if (pollfds[i].revents & POLLHUP) { @@ -253,21 +255,22 @@ int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_ // will technically meet the requirements for POLLIN // i.e., a call to recv/read won't block rgIpcPollHandles[i].revents = (uint8_t)PollEvents::HANGUP; - delete[] pollfds; - return -1; } else if ((pollfds[i].revents & (POLLERR|POLLNVAL))) { if (callback != nullptr) callback("Poll error", (uint32_t)pollfds[i].revents); rgIpcPollHandles[i].revents = (uint8_t)PollEvents::ERR; - delete[] pollfds; - return -1; } else if (pollfds[i].revents & (POLLIN|POLLPRI)) { rgIpcPollHandles[i].revents = (uint8_t)PollEvents::SIGNALED; - break; + } + else + { + rgIpcPollHandles[i].revents = (uint8_t)PollEvents::UNKNOWN; + if (callback != nullptr) + callback("unkown poll response", (uint32_t)pollfds[i].revents); } } } @@ -341,7 +344,7 @@ bool IpcStream::Read(void *lpBuffer, const uint32_t nBytesToRead, uint32_t &nByt pfd.fd = _clientSocket; pfd.events = POLLIN; int retval = poll(&pfd, 1, timeoutMs); - if (retval <= 0 || pfd.revents != POLLIN) + if (retval <= 0 || !(pfd.revents & POLLIN)) { // timeout or error return false; @@ -382,7 +385,7 @@ bool IpcStream::Write(const void *lpBuffer, const uint32_t nBytesToWrite, uint32 pfd.fd = _clientSocket; pfd.events = POLLOUT; int retval = poll(&pfd, 1, timeoutMs); - if (retval <= 0 || pfd.revents != POLLOUT) + if (retval <= 0 || !(pfd.revents & POLLOUT)) { // timeout or error return false; diff --git a/src/coreclr/src/debug/debug-pal/win/diagnosticsipc.cpp b/src/coreclr/src/debug/debug-pal/win/diagnosticsipc.cpp index 6c1b55e31118..9a28e482342f 100644 --- a/src/coreclr/src/debug/debug-pal/win/diagnosticsipc.cpp +++ b/src/coreclr/src/debug/debug-pal/win/diagnosticsipc.cpp @@ -56,8 +56,8 @@ IpcStream::DiagnosticsIpc *IpcStream::DiagnosticsIpc::Create(const char *const p bool IpcStream::DiagnosticsIpc::Listen(ErrorCallback callback) { - _ASSERTE(mode == ConnectionMode::SERVER); - if (mode != ConnectionMode::SERVER) + _ASSERTE(mode == ConnectionMode::LISTEN); + if (mode != ConnectionMode::LISTEN) { if (callback != nullptr) callback("Cannot call Listen on a client connection", -1); @@ -119,6 +119,7 @@ bool IpcStream::DiagnosticsIpc::Listen(ErrorCallback callback) _hPipe = INVALID_HANDLE_VALUE; ::CloseHandle(_oOverlap.hEvent); _oOverlap.hEvent = INVALID_HANDLE_VALUE; + memset(&_oOverlap, 0, sizeof(OVERLAPPED)); // clear the overlapped objects state return false; } } @@ -130,7 +131,7 @@ bool IpcStream::DiagnosticsIpc::Listen(ErrorCallback callback) IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback) { _ASSERTE(_isListening); - _ASSERTE(mode == ConnectionMode::SERVER); + _ASSERTE(mode == ConnectionMode::LISTEN); DWORD dwDummy = 0; bool fSuccess = GetOverlappedResult( @@ -147,7 +148,7 @@ IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback) } // create new IpcStream using handle and reset the Server object so it can listen again - IpcStream *pStream = new IpcStream(_hPipe, ConnectionMode::SERVER); + IpcStream *pStream = new IpcStream(_hPipe, ConnectionMode::LISTEN); // reset the server _hPipe = INVALID_HANDLE_VALUE; @@ -166,8 +167,8 @@ IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback) IpcStream *IpcStream::DiagnosticsIpc::Connect(ErrorCallback callback) { - _ASSERTE(mode == ConnectionMode::CLIENT); - if (mode != ConnectionMode::CLIENT) + _ASSERTE(mode == ConnectionMode::CONNECT); + if (mode != ConnectionMode::CONNECT) { if (callback != nullptr) callback("Cannot call connect on a server connection", 0); @@ -193,27 +194,38 @@ IpcStream *IpcStream::DiagnosticsIpc::Connect(ErrorCallback callback) return new IpcStream(hPipe, mode); } -void IpcStream::DiagnosticsIpc::Close(bool isShutdown, ErrorCallback) +void IpcStream::DiagnosticsIpc::Close(bool isShutdown, ErrorCallback callback) { // don't attempt cleanup on shutdown and let the OS handle it if (isShutdown) + { + if (callback != nullptr) + callback("Closing without cleaning underlying handles", 100); return; + } if (_hPipe != INVALID_HANDLE_VALUE) { - if (mode == DiagnosticsIpc::ConnectionMode::SERVER) + if (mode == DiagnosticsIpc::ConnectionMode::LISTEN) { const BOOL fSuccessDisconnectNamedPipe = ::DisconnectNamedPipe(_hPipe); _ASSERTE(fSuccessDisconnectNamedPipe != 0); + if (fSuccessDisconnectNamedPipe != 0 && callback != nullptr) + callback("Failed to disconnect NamedPipe", ::GetLastError()); } const BOOL fSuccessCloseHandle = ::CloseHandle(_hPipe); _ASSERTE(fSuccessCloseHandle != 0); + if (fSuccessCloseHandle != 0 && callback != nullptr) + callback("Failed to close pipe handle", ::GetLastError()); } if (_oOverlap.hEvent != INVALID_HANDLE_VALUE) { - ::CloseHandle(_oOverlap.hEvent); + const BOOL fSuccessCloseEvent = ::CloseHandle(_oOverlap.hEvent); + _ASSERTE(fSuccessCloseEvent != 0); + if (fSuccessCloseEvent != 0 && callback != nullptr) + callback("Failed to close overlap event handle", ::GetLastError()); } } @@ -230,25 +242,32 @@ IpcStream::~IpcStream() Close(); } -void IpcStream::Close(ErrorCallback) +void IpcStream::Close(ErrorCallback callback) { if (_hPipe != INVALID_HANDLE_VALUE) { Flush(); - if (_mode == DiagnosticsIpc::ConnectionMode::SERVER) + if (_mode == DiagnosticsIpc::ConnectionMode::LISTEN) { const BOOL fSuccessDisconnectNamedPipe = ::DisconnectNamedPipe(_hPipe); _ASSERTE(fSuccessDisconnectNamedPipe != 0); + if (fSuccessDisconnectNamedPipe != 0 && callback != nullptr) + callback("Failed to disconnect NamedPipe", ::GetLastError()); } const BOOL fSuccessCloseHandle = ::CloseHandle(_hPipe); _ASSERTE(fSuccessCloseHandle != 0); + if (fSuccessCloseHandle != 0 && callback != nullptr) + callback("Failed to close pipe handle", ::GetLastError()); } if (_oOverlap.hEvent != INVALID_HANDLE_VALUE) { - ::CloseHandle(_oOverlap.hEvent); + const BOOL fSuccessCloseEvent = ::CloseHandle(_oOverlap.hEvent); + _ASSERTE(fSuccessCloseEvent != 0); + if (fSuccessCloseEvent != 0 && callback != nullptr) + callback("Failed to close overlapped event handle", ::GetLastError()); } } @@ -262,7 +281,7 @@ int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_ if (rgIpcPollHandles[i].pIpc != nullptr) { // SERVER - _ASSERTE(rgIpcPollHandles[i].pIpc->mode == DiagnosticsIpc::ConnectionMode::SERVER); + _ASSERTE(rgIpcPollHandles[i].pIpc->mode == DiagnosticsIpc::ConnectionMode::LISTEN); pHandles[i] = rgIpcPollHandles[i].pIpc->_oOverlap.hEvent; } else @@ -302,6 +321,11 @@ int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_ return -1; } } + else + { + // there's already data to be read + pHandles[i] = rgIpcPollHandles[i].pStream->_oOverlap.hEvent; + } } else { @@ -369,12 +393,12 @@ int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_ if (!fSuccess) { DWORD error = ::GetLastError(); - if (error == ERROR_PIPE_NOT_CONNECTED) + if (error == ERROR_PIPE_NOT_CONNECTED || error == ERROR_BROKEN_PIPE) rgIpcPollHandles[index].revents = (uint8_t)IpcStream::DiagnosticsIpc::PollEvents::HANGUP; else { if (callback != nullptr) - callback("Client connection error", -1); + callback("Client connection error", error); rgIpcPollHandles[index].revents = (uint8_t)IpcStream::DiagnosticsIpc::PollEvents::ERR; delete[] pHandles; return -1; @@ -410,39 +434,43 @@ bool IpcStream::Read(void *lpBuffer, const uint32_t nBytesToRead, uint32_t &nByt if (!fSuccess) { + // if we're waiting infinitely, only make one syscall if (timeoutMs == InfiniteTimeout) { - fSuccess = GetOverlappedResult(_hPipe, - overlap, - &nNumberOfBytesRead, - true) != 0; + fSuccess = GetOverlappedResult(_hPipe, // pipe + overlap, // overlapped + &nNumberOfBytesRead, // out actual number of bytes read + true) != 0; // block until async IO completes } else { DWORD dwError = GetLastError(); if (dwError == ERROR_IO_PENDING) { + // Wait on overlapped IO event (triggers when async IO is complete regardless of success) + // or timeout DWORD dwWait = WaitForSingleObject(_oOverlap.hEvent, (DWORD)timeoutMs); if (dwWait == WAIT_OBJECT_0) { - // get the result - fSuccess = GetOverlappedResult(_hPipe, - overlap, - &nNumberOfBytesRead, - true) != 0; + // async IO compelted, get the result + fSuccess = GetOverlappedResult(_hPipe, // pipe + overlap, // overlapped + &nNumberOfBytesRead, // out actual number of bytes read + true) != 0; // block until async IO completes } else { - // cancel IO and ensure the cancel happened - if (CancelIo(_hPipe)) + // We either timed out or something else went wrong. + // For any error, attempt to cancel IO and ensure the cancel happened + if (CancelIoEx(_hPipe, overlap) != 0) { // check if the async write beat the cancellation fSuccess = GetOverlappedResult(_hPipe, overlap, &nNumberOfBytesRead, true) != 0; + // Failure here isn't recoverable, so return as such } } } } - // TODO: Add error handling. } nBytesRead = static_cast(nNumberOfBytesRead); @@ -464,40 +492,43 @@ bool IpcStream::Write(const void *lpBuffer, const uint32_t nBytesToWrite, uint32 if (!fSuccess) { - DWORD dwError = GetLastError(); - if (dwError == ERROR_IO_PENDING) + // if we're waiting infinitely, only make one syscall + if (timeoutMs == InfiniteTimeout) { - if (timeoutMs == InfiniteTimeout) - { - // if we're waiting infinitely, don't bother with extra kernel call - fSuccess = GetOverlappedResult(_hPipe, - overlap, - &nNumberOfBytesWritten, - true) != 0; - } - else + fSuccess = GetOverlappedResult(_hPipe, // pipe + overlap, // overlapped + &nNumberOfBytesWritten, // out actual number of bytes written + true) != 0; // block until async IO completes + } + else + { + DWORD dwError = GetLastError(); + if (dwError == ERROR_IO_PENDING) { + // Wait on overlapped IO event (triggers when async IO is complete regardless of success) + // or timeout DWORD dwWait = WaitForSingleObject(_oOverlap.hEvent, (DWORD)timeoutMs); if (dwWait == WAIT_OBJECT_0) { - // get the result - fSuccess = GetOverlappedResult(_hPipe, - overlap, - &nNumberOfBytesWritten, - true) != 0; + // async IO compelted, get the result + fSuccess = GetOverlappedResult(_hPipe, // pipe + overlap, // overlapped + &nNumberOfBytesWritten, // out actual number of bytes written + true) != 0; // block until async IO completes } else { - // cancel IO and ensure the cancel happened - if (CancelIo(_hPipe)) + // We either timed out or something else went wrong. + // For any error, attempt to cancel IO and ensure the cancel happened + if (CancelIoEx(_hPipe, overlap) != 0) { // check if the async write beat the cancellation fSuccess = GetOverlappedResult(_hPipe, overlap, &nNumberOfBytesWritten, true) != 0; + // Failure here isn't recoverable, so return as such } } } } - // TODO: Add error handling. } nBytesWritten = static_cast(nNumberOfBytesWritten); diff --git a/src/coreclr/src/debug/di/CMakeLists.txt b/src/coreclr/src/debug/di/CMakeLists.txt index 6cfedda1d899..55f34bd1ce3e 100644 --- a/src/coreclr/src/debug/di/CMakeLists.txt +++ b/src/coreclr/src/debug/di/CMakeLists.txt @@ -50,7 +50,7 @@ set(CORDBDI_HEADERS if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) if (CLR_CMAKE_TARGET_ARCH_AMD64 OR ((CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARM) AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD)) @@ -59,7 +59,10 @@ if(CLR_CMAKE_HOST_WIN32) if ((CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64) AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD) convert_to_absolute_path(CORDBDI_SOURCES_ASM_FILE ${CORDBDI_SOURCES_ASM_FILE}) - preprocess_compile_asm(TARGET cordbdi ASM_FILES ${CORDBDI_SOURCES_ASM_FILE} OUTPUT_OBJECTS CORDBDI_SOURCES_ASM_FILE) + preprocess_files(CORDBDI_SOURCES_ASM_FILE ${CORDBDI_SOURCES_ASM_FILE}) + if (CMAKE_GENERATOR MATCHES "Visual Studio") + compile_asm(TARGET cordbdi ASM_FILES ${CORDBDI_SOURCES_ASM_FILE} OUTPUT_OBJECTS CORDBDI_SOURCES_ASM_FILE) + endif() endif() elseif(CLR_CMAKE_HOST_UNIX) @@ -79,5 +82,5 @@ endif (CLR_CMAKE_TARGET_WIN32) list(APPEND CORDBDI_SOURCES ${CORDBDI_SOURCES_ASM_FILE}) add_library_clr(cordbdi STATIC ${CORDBDI_SOURCES}) -target_precompile_header(TARGET cordbdi HEADER stdafx.h) +target_precompile_headers(cordbdi PRIVATE stdafx.h) add_dependencies(cordbdi eventing_headers) diff --git a/src/coreclr/src/debug/di/eventredirectionpipeline.h b/src/coreclr/src/debug/di/eventredirectionpipeline.h index f2b3c55d38ad..e219c182980a 100644 --- a/src/coreclr/src/debug/di/eventredirectionpipeline.h +++ b/src/coreclr/src/debug/di/eventredirectionpipeline.h @@ -117,7 +117,7 @@ class EventRedirectionPipeline : // Command parameters for create case. // Note that we must always physically call CreateProcess on the debuggee so that we get the proper out-parameters - // from create-processs (eg, target's handle, startup info, etc). So we always attach the auxillary debugger + // from create-process (eg, target's handle, startup info, etc). So we always attach the auxillary debugger // even in the create case. Use "-pr -pb" in Windbg to attach to a create-suspended process. // // Common Windbg options: diff --git a/src/coreclr/src/debug/di/module.cpp b/src/coreclr/src/debug/di/module.cpp index d02dfdd08146..39f306f7c0f4 100644 --- a/src/coreclr/src/debug/di/module.cpp +++ b/src/coreclr/src/debug/di/module.cpp @@ -869,7 +869,7 @@ HRESULT CordbModule::InitPublicMetaDataFromFile(const WCHAR * pszFullPathName, DWORD dwOpenFlags, bool validateFileInfo) { -#ifdef TARGET_UNIX +#ifdef HOST_UNIX // UNIXTODO: Some intricate details of file mapping don't work on Linux as on Windows. // We have to revisit this and try to fix it for POSIX system. return E_FAIL; @@ -1200,6 +1200,10 @@ HRESULT CordbModule::QueryInterface(REFIID id, void **pInterface) { *pInterface = static_cast(this); } + else if (id == IID_ICorDebugModule4) + { + *pInterface = static_cast(this); + } else if (id == IID_IUnknown) { *pInterface = static_cast(static_cast(this)); @@ -2752,6 +2756,24 @@ HRESULT CordbModule::GetJITCompilerFlags(DWORD *pdwFlags ) return hr; } +HRESULT CordbModule::IsMappedLayout(BOOL *isMapped) +{ + VALIDATE_POINTER_TO_OBJECT(isMapped, BOOL*); + FAIL_IF_NEUTERED(this); + + HRESULT hr = S_OK; + CordbProcess *pProcess = GetProcess(); + + ATT_REQUIRE_STOPPED_MAY_FAIL(pProcess); + PUBLIC_API_BEGIN(pProcess); + { + hr = pProcess->GetDAC()->IsModuleMapped(m_vmModule, isMapped); + } + PUBLIC_API_END(hr); + + return hr; +} + /* ------------------------------------------------------------------------- * * CordbCode class * ------------------------------------------------------------------------- */ diff --git a/src/coreclr/src/debug/di/platformspecific.cpp b/src/coreclr/src/debug/di/platformspecific.cpp index 07652a305641..fb2d8eb92453 100644 --- a/src/coreclr/src/debug/di/platformspecific.cpp +++ b/src/coreclr/src/debug/di/platformspecific.cpp @@ -16,10 +16,10 @@ #include "shimremotedatatarget.cpp" #include "remoteeventchannel.cpp" #elif WIN32 -#include "WindowsPipeline.cpp" -#include "EventRedirectionPipeline.cpp" -#include "ShimLocalDataTarget.cpp" -#include "LocalEventChannel.cpp" +#include "windowspipeline.cpp" +#include "eventredirectionpipeline.cpp" +#include "shimlocaldatatarget.cpp" +#include "localeventchannel.cpp" #endif #if TARGET_X86 diff --git a/src/coreclr/src/debug/di/rspriv.h b/src/coreclr/src/debug/di/rspriv.h index 1bb48df2356c..5cbba66aaf18 100644 --- a/src/coreclr/src/debug/di/rspriv.h +++ b/src/coreclr/src/debug/di/rspriv.h @@ -2533,7 +2533,7 @@ class CordbAppDomain : public CordbBase, // Unique objects that represent the use of some // basic ELEMENT_TYPE's as type parameters. These - // are shared acrosss the entire process. We could + // are shared across the entire process. We could // go and try to find the classes corresponding to these // element types but it seems simpler just to keep // them as special cases. @@ -4139,7 +4139,8 @@ class CordbProcess : class CordbModule : public CordbBase, public ICorDebugModule, public ICorDebugModule2, - public ICorDebugModule3 + public ICorDebugModule3, + public ICorDebugModule4 { public: CordbModule(CordbProcess * process, @@ -4234,6 +4235,11 @@ class CordbModule : public CordbBase, COM_METHOD CreateReaderForInMemorySymbols(REFIID riid, void** ppObj); + //----------------------------------------------------------- + // ICorDebugModule4 + //----------------------------------------------------------- + COM_METHOD IsMappedLayout(BOOL *isMapped); + //----------------------------------------------------------- // Internal members //----------------------------------------------------------- diff --git a/src/coreclr/src/debug/di/rsthread.cpp b/src/coreclr/src/debug/di/rsthread.cpp index 600cd485e22d..9f1a2374a75a 100644 --- a/src/coreclr/src/debug/di/rsthread.cpp +++ b/src/coreclr/src/debug/di/rsthread.cpp @@ -603,7 +603,7 @@ bool CordbThread::OwnsFrame(CordbFrame * pFrame) // This routine is a internal helper function for ICorDebugThread2::GetTaskId. // // Arguments: -// pHandle - return thread handle here after fetching from the left side. Can return SWITCHOUT_HANDLE_VALUE. +// pHandle - return thread handle here after fetching from the left side. // // Return Value: // hr - It can fail with CORDBG_E_THREAD_NOT_SCHEDULED. @@ -629,12 +629,6 @@ void CordbThread::RefreshHandle(HANDLE * phThread) IDacDbiInterface * pDAC = GetProcess()->GetDAC(); HANDLE hThread = pDAC->GetThreadHandle(m_vmThreadToken); - if (hThread == SWITCHOUT_HANDLE_VALUE) - { - *phThread = SWITCHOUT_HANDLE_VALUE; - ThrowHR(CORDBG_E_THREAD_NOT_SCHEDULED); - } - _ASSERTE(hThread != INVALID_HANDLE_VALUE); PREFAST_ASSUME(hThread != NULL); @@ -2254,7 +2248,7 @@ HRESULT CordbThread::HasUnhandledException() // ppStackWalk - out parameter; return the new stackwalker // // Return Value: -// Return S_OK on succcess. +// Return S_OK on success. // Return E_FAIL on error. // // Notes: diff --git a/src/coreclr/src/debug/di/rstype.cpp b/src/coreclr/src/debug/di/rstype.cpp index 36b137949664..3fcb5ee927d6 100644 --- a/src/coreclr/src/debug/di/rstype.cpp +++ b/src/coreclr/src/debug/di/rstype.cpp @@ -590,7 +590,7 @@ HRESULT CordbType::MkType(CordbAppDomain * pAppDomain, pClass->SetIsValueClass(true); pClass->SetIsValueClassKnown(true); - // drop through + FALLTHROUGH; case ELEMENT_TYPE_CLASS: { @@ -683,7 +683,7 @@ HRESULT CordbType::GetType(CorElementType *pType) // Determining if something is a VC or not can involve asking the EE. // We could do it ourselves based on the metadata but it's non-trivial // determining if a class has System.ValueType as a parent (we have - // to find and OpenScope the mscorlib.dll which we don't currently do + // to find and OpenScope the System.Private.CoreLib.dll which we don't currently do // on the right-side). But the IsValueClass call can fail if the // class is not yet loaded on the right side. In that case we // ignore the failure and return ELEMENT_TYPE_CLASS @@ -2009,6 +2009,7 @@ void CordbType::TypeToExpandedTypeData(DebuggerIPCE_ExpandedTypeData *data) } case ELEMENT_TYPE_END: _ASSERTE(!"bad element type!"); + break; default: data->elementType = m_elementType; @@ -2389,6 +2390,7 @@ HRESULT CordbType::GetTypeID(COR_TYPEID *pId) case ELEMENT_TYPE_BYREF: case ELEMENT_TYPE_FNPTR: IfFailThrow(CORDBG_E_UNSUPPORTED); + break; default: _ASSERTE(!"unexpected element type!"); IfFailThrow(CORDBG_E_UNSUPPORTED); diff --git a/src/coreclr/src/debug/di/shimremotedatatarget.cpp b/src/coreclr/src/debug/di/shimremotedatatarget.cpp index 38bf162e430f..9a01508e2115 100644 --- a/src/coreclr/src/debug/di/shimremotedatatarget.cpp +++ b/src/coreclr/src/debug/di/shimremotedatatarget.cpp @@ -68,7 +68,7 @@ class ShimRemoteDataTarget : public ShimDataTarget DbgTransportTarget * m_pProxy; DbgTransportSession * m_pTransport; #ifdef FEATURE_REMOTE_PROC_MEM - int m_fd; // /proc//mem handle + DWORD m_memoryHandle; // PAL_ReadProcessMemory handle or UINT32_MAX if fallback #endif }; @@ -106,9 +106,7 @@ ShimRemoteDataTarget::ShimRemoteDataTarget(DWORD processId, m_pContinueStatusChangedUserData = NULL; #ifdef FEATURE_REMOTE_PROC_MEM - char memPath[128]; - _snprintf_s(memPath, sizeof(memPath), sizeof(memPath), "/proc/%lu/mem", m_processId); - m_fd = _open(memPath, 0); // O_RDONLY + PAL_OpenProcessMemory(m_processId, &m_memoryHandle); #endif } @@ -135,11 +133,8 @@ ShimRemoteDataTarget::~ShimRemoteDataTarget() void ShimRemoteDataTarget::Dispose() { #ifdef FEATURE_REMOTE_PROC_MEM - if (m_fd != -1) - { - _close(m_fd); - m_fd = -1; - } + PAL_CloseProcessMemory(m_memoryHandle); + m_memoryHandle = UINT32_MAX; #endif if (m_pTransport != NULL) { @@ -269,10 +264,9 @@ ShimRemoteDataTarget::ReadVirtual( HRESULT hr = S_OK; #ifdef FEATURE_REMOTE_PROC_MEM - if (m_fd != -1) + if (m_memoryHandle != UINT32_MAX) { - read = _pread(m_fd, pBuffer, cbRequestSize, (ULONG64)address); - if (read == (size_t)-1) + if (!PAL_ReadProcessMemory(m_memoryHandle, (ULONG64)address, pBuffer, cbRequestSize, &read)) { hr = E_FAIL; } diff --git a/src/coreclr/src/debug/ee/amd64/amd64walker.cpp b/src/coreclr/src/debug/ee/amd64/amd64walker.cpp index 5af7ec728946..16807eedc1b7 100644 --- a/src/coreclr/src/debug/ee/amd64/amd64walker.cpp +++ b/src/coreclr/src/debug/ee/amd64/amd64walker.cpp @@ -580,6 +580,7 @@ static int opSize(Amd64InstrDecode::InstrForm form, int pp, bool W, bool L, bool // P_M6B_or_M4B case Amd64InstrDecode::InstrForm::MOnly_P_M6B_or_M4B: opSize = P ? 6 : 4; + break; // M4B case Amd64InstrDecode::InstrForm::M1st_M4B: case Amd64InstrDecode::InstrForm::M1st_M4B_I1B: @@ -833,7 +834,7 @@ void NativeWalker::DecodeInstructionForPatchSkip(const BYTE *address, Instructio opCodeMap = Primary; break; } - // Fall through + FALLTHROUGH; case 0xc4: // Vex 3-byte opCodeMap = (OpcodeMap)(int(address[0]) << 8 | (address[1] & 0x1f)); // W is the top bit of opcode2. @@ -965,7 +966,7 @@ void NativeWalker::DecodeInstructionForPatchSkip(const BYTE *address, Instructio case 2: case 3: pInstrAttrib->m_fIsCall = true; - // fall through + FALLTHROUGH; case 4: case 5: pInstrAttrib->m_fIsAbsBranch = true; diff --git a/src/coreclr/src/debug/ee/arm64/arm64walker.cpp b/src/coreclr/src/debug/ee/arm64/arm64walker.cpp index d46b07958b72..ae6e8c1fc293 100644 --- a/src/coreclr/src/debug/ee/arm64/arm64walker.cpp +++ b/src/coreclr/src/debug/ee/arm64/arm64walker.cpp @@ -102,6 +102,7 @@ BYTE* NativeWalker::SetupOrSimulateInstructionForPatchSkip(T_CONTEXT * context, /* + Based off ARM DDI 0487F.c (C.4.1) Modify the patchBypass if the opcode is IP-relative, otherwise return it The following are the instructions that are IP-relative : . ADR and ADRP. @@ -113,9 +114,8 @@ BYTE* NativeWalker::SetupOrSimulateInstructionForPatchSkip(T_CONTEXT * context, _ASSERTE((UINT_PTR)address == context->Pc); - if ((opcode & 0x1F000000) == 0x10000000) //ADR & ADRP + if ((opcode & 0x1F000000) == 0x10000000) //ADR & ADRP (PC-Relative) { - TADDR immhigh = ((opcode >> 5) & 0x007FFFF) << 2; TADDR immlow = (opcode & 0x60000000) >> 29; offset = immhigh | immlow; //ADR @@ -136,13 +136,10 @@ BYTE* NativeWalker::SetupOrSimulateInstructionForPatchSkip(T_CONTEXT * context, { LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x to ADR X%d %p\n", opcode, RegNum, offset)); } - - } else if ((opcode & 0x3B000000) == 0x18000000) //LDR Literal (General or SIMD) - { - + { offset = Expand19bitoffset(opcode); RegNum = (opcode & 0x1F); LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x to LDR[SW] | PRFM X%d %p\n", opcode, RegNum, offset)); @@ -187,81 +184,55 @@ BYTE* NativeWalker::SetupOrSimulateInstructionForPatchSkip(T_CONTEXT * context, { CORDbgSetInstruction((CORDB_ADDRESS_TYPE *)patchBypass, 0xd503201f); //Add Nop in buffer - PCODE RegContents; if ((opcode & 0x3B000000) == 0x18000000) //LDR Literal { - RegContents = (PCODE)GetMem(ip); - if ((opcode & 0x4000000)) //LDR literal for SIMD + bool isSimd = ((opcode & 0x4000000) != 0); //LDR literal for SIMD + NEON128 SimdRegContents = { 0 }; + short opc = (opcode >> 30); + + LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x (opc: %x, isSimd: %x)\n", opcode, opc, isSimd)); + + switch (opc) { - NEON128 SimdRegContents; - LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x to LDR V%d %p\n", opcode, RegNum, offset)); - short opc = (opcode >> 30); - switch (opc) - { - case 0: //4byte data into St - SimdRegContents.Low = 0xFFFFFFFF & RegContents; //zero the upper 32bit - SimdRegContents.High = 0; + case 0: //load 4 bytes + SimdRegContents.Low = GetMem(ip, 4, /* signExtend */ false); + SimdRegContents.High = 0; + if (isSimd) //LDR St [imm] SetSimdReg(context, RegNum, SimdRegContents); - break; - case 1: //8byte data into Dt - SimdRegContents.Low = RegContents; - SimdRegContents.High = 0; + else // LDR Wt [imm] + SetReg(context, RegNum, SimdRegContents.Low); + + break; + case 1: //load 8 bytes + SimdRegContents.Low = GetMem(ip, 8, /* signExtend */ false); + SimdRegContents.High = 0; + if (isSimd) //LDR Dt [imm] SetSimdReg(context, RegNum, SimdRegContents); - break; - case 2: //SIMD 16 byte data + else // LDR Xt [imm] + SetReg(context, RegNum, SimdRegContents.Low); + break; + case 2: //SIMD 16 byte data + if (isSimd) //LDR Qt [imm] + { SimdRegContents = GetSimdMem(ip); SetSimdReg(context, RegNum, SimdRegContents); - break; - default: - LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate Unknown opcode: %x [LDR(litera,SIMD &FP)] \n", opcode)); - _ASSERTE(!("Arm64Walker::Simulated Unknown opcode")); - } - } - else - { - short opc = (opcode >> 30); - switch (opc) + else //LDR St [imm] (sign extendeded) { - case 0: //4byte data into Wt - LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x to LDR W%d %p\n", opcode, RegNum, offset)); - RegContents = 0xFFFFFFFF & RegContents; //zero the upper 32bits - SetReg(context, RegNum, RegContents); - break; - - case 1: //8byte data into Xt - LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x to LDR X%d %p\n", opcode, RegNum, offset)); - SetReg(context, RegNum, RegContents); - break; - - case 2: //LDRSW - LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x to LDRSW X%d %p\n", opcode, RegNum, offset)); - RegContents = 0xFFFFFFFF & RegContents; - - if (RegContents & 0x80000000) //Sign extend the Word - { - RegContents = 0xFFFFFFFF00000000 | RegContents; - } - SetReg(context, RegNum, RegContents); - break; - case 3: - LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x as PRFM ,but do nothing \n", opcode)); - - break; - default: - LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate Unknown opcode: %x [LDR(literal)] \n", opcode)); - _ASSERTE(!("Arm64Walker::Simulated Unknown opcode")); - + SimdRegContents.Low = GetMem(ip, 4, /* signExtend */ true); + SetReg(context, RegNum, SimdRegContents.Low); } + break; + case 3: + LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x as PRFM ,but do nothing \n", opcode)); + break; + default: + LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate Unknown opcode: %x [LDR(litera,SIMD &FP)] \n", opcode)); + _ASSERTE(!("Arm64Walker::Simulated Unknown opcode")); } - } - else - { - RegContents = ip; - SetReg(context, RegNum, RegContents); - } + LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate loadedMemory [Hi: %ull, lo: %ull]\n", SimdRegContents.High, SimdRegContents.Low)); - LOG((LF_CORDB, LL_INFO100000, "Arm64Walker::Simulate opcode: %x to update Reg X[V]%d, as %p \n", opcode, RegNum, GetReg(context, RegNum))); + } } //else Just execute the opcodes as IS //{ diff --git a/src/coreclr/src/debug/ee/arm64/dbghelpers.S b/src/coreclr/src/debug/ee/arm64/dbghelpers.S index 8fc88fa25735..4b9504efec85 100644 --- a/src/coreclr/src/debug/ee/arm64/dbghelpers.S +++ b/src/coreclr/src/debug/ee/arm64/dbghelpers.S @@ -22,7 +22,7 @@ NESTED_ENTRY FuncEvalHijack, _TEXT, UnhandledExceptionHandlerUnix PROLOG_SAVE_REG_PAIR_INDEXED fp, lr, -32 str x0, [sp, #16] // FuncEvalHijackWorker returns the address we should jump to. - bl FuncEvalHijackWorker + bl C_FUNC(FuncEvalHijackWorker) EPILOG_STACK_FREE 32 EPILOG_BRANCH_REG x0 @@ -33,7 +33,7 @@ NESTED_END FuncEvalHijack NESTED_ENTRY ExceptionHijack, _TEXT, UnhandledExceptionHandlerUnix // make the call - bl ExceptionHijackWorker + bl C_FUNC(ExceptionHijackWorker) // effective NOP to terminate unwind mov x3, x3 diff --git a/src/coreclr/src/debug/ee/controller.cpp b/src/coreclr/src/debug/ee/controller.cpp index 81d7ad6c6042..01396cc3951d 100644 --- a/src/coreclr/src/debug/ee/controller.cpp +++ b/src/coreclr/src/debug/ee/controller.cpp @@ -5883,7 +5883,7 @@ bool DebuggerStepper::TrapStep(ControllerStackInfo *info, bool in) // the case we want to use... fIsJump = true; - // fall through... + FALLTHROUGH; case WALK_CALL: LOG((LF_CORDB,LL_INFO10000, "DC::TS:Imm:WALK_CALL ip=%p nextip=%p skipip=%p\n", walker.GetIP(), walker.GetNextIP(), walker.GetSkipIP())); diff --git a/src/coreclr/src/debug/ee/dac/CMakeLists.txt b/src/coreclr/src/debug/ee/dac/CMakeLists.txt index ffb05b56bc2b..784ed9ba2265 100644 --- a/src/coreclr/src/debug/ee/dac/CMakeLists.txt +++ b/src/coreclr/src/debug/ee/dac/CMakeLists.txt @@ -5,5 +5,5 @@ endif (CLR_CMAKE_TARGET_WIN32) add_library_clr(cordbee_dac ${CORDBEE_SOURCES_DAC}) set_target_properties(cordbee_dac PROPERTIES DAC_COMPONENT TRUE) -target_precompile_header(TARGET cordbee_dac HEADER stdafx.h) +target_precompile_headers(cordbee_dac PRIVATE [["stdafx.h"]]) add_dependencies(cordbee_dac eventing_headers) diff --git a/src/coreclr/src/debug/ee/debugger.cpp b/src/coreclr/src/debug/ee/debugger.cpp index 7b2cd48b22ed..79d8dd0e6af2 100644 --- a/src/coreclr/src/debug/ee/debugger.cpp +++ b/src/coreclr/src/debug/ee/debugger.cpp @@ -1899,7 +1899,7 @@ void Debugger::CleanupTransportSocket(void) // Initialize Left-Side debugger object // // Return Value: -// S_OK on successs. May also throw. +// S_OK on success. May also throw. // // Assumptions: // This is called in the startup path. @@ -3458,14 +3458,14 @@ void Debugger::getBoundaries(MethodDesc * md, if (pModule == SystemDomain::SystemModule()) { - // We don't look up PDBs for mscorlib. This is not quite right, but avoids + // We don't look up PDBs for CoreLib. This is not quite right, but avoids // a bootstrapping problem. When an EXE loads, it has the option of setting // the COM apartment model to STA if we need to. It is important that no // other Coinitialize happens before this. Since loading the PDB reader uses // com we can not come first. However managed code IS run before the COM // apartment model is set, and thus we have a problem since this code is // called for when JITTing managed code. We avoid the problem by just - // bailing for mscorlib. + // bailing for CoreLib. return; } @@ -7953,7 +7953,7 @@ void Debugger::ProcessAnyPendingEvals(Thread *pThread) // Now clear the bit else we'll see it again when we process the Exception notification // from this upcoming UserAbort exception. pThread->ResetThreadStateNC(Thread::TSNC_DebuggerReAbort); - pThread->UserAbort(Thread::TAR_Thread, EEPolicy::TA_Safe, INFINITE, Thread::UAC_Normal); + pThread->UserAbort(Thread::TAR_Thread, EEPolicy::TA_Safe, INFINITE); } #endif @@ -10722,6 +10722,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) // // For regular (non-jit) attach, fall through to do an async break. // + FALLTHROUGH; case DB_IPCE_ASYNC_BREAK: { @@ -12138,7 +12139,7 @@ void Debugger::TypeHandleToExpandedTypeInfo(AreValueTypesBoxed boxed, case ELEMENT_TYPE_VALUETYPE: if (boxed == OnlyPrimitivesUnboxed || boxed == AllBoxed) res->elementType = ELEMENT_TYPE_CLASS; - // drop through + FALLTHROUGH; case ELEMENT_TYPE_CLASS: { @@ -12896,7 +12897,7 @@ class EnCSequencePointHelper // EnCSequencePointHelper::EnCSequencePointHelper(DebuggerJitInfo *pJitInfo) : m_pJitInfo(pJitInfo), - m_pOffsetToHandlerInfo(NULL) + m_pOffsetToHandlerInfo(NULL) { CONTRACTL { @@ -15242,15 +15243,6 @@ HRESULT Debugger::FuncEvalSetup(DebuggerIPCE_FuncEvalInfo *pEvalInfo, return CORDBG_E_FUNC_EVAL_BAD_START_POINT; } - if (MethodDescBackpatchInfoTracker::IsLockOwnedByAnyThread()) - { - // A thread may have suspended for the debugger while holding the slot backpatching lock while trying to enter - // cooperative GC mode. If the FuncEval calls a method that is eligible for slot backpatching (virtual or interface - // methods that are eligible for tiering), the FuncEval may deadlock on trying to acquire the same lock. Fail the - // FuncEval to avoid the issue. - return CORDBG_E_FUNC_EVAL_BAD_START_POINT; - } - // Create a DebuggerEval to hold info about this eval while its in progress. Constructor copies the thread's // CONTEXT. DebuggerEval *pDE = new (interopsafe, nothrow) DebuggerEval(filterContext, pEvalInfo, fInException); @@ -15484,7 +15476,7 @@ Debugger::FuncEvalAbort( // EX_TRY { - hr = pDE->m_thread->UserAbort(Thread::TAR_FuncEval, EEPolicy::TA_Safe, (DWORD)FUNC_EVAL_DEFAULT_TIMEOUT_VALUE, Thread::UAC_Normal); + hr = pDE->m_thread->UserAbort(Thread::TAR_FuncEval, EEPolicy::TA_Safe, (DWORD)FUNC_EVAL_DEFAULT_TIMEOUT_VALUE); if (hr == HRESULT_FROM_WIN32(ERROR_TIMEOUT)) { hr = S_OK; @@ -15550,7 +15542,7 @@ Debugger::FuncEvalRudeAbort( // EX_TRY { - hr = pDE->m_thread->UserAbort(Thread::TAR_FuncEval, EEPolicy::TA_Rude, (DWORD)FUNC_EVAL_DEFAULT_TIMEOUT_VALUE, Thread::UAC_Normal); + hr = pDE->m_thread->UserAbort(Thread::TAR_FuncEval, EEPolicy::TA_Rude, (DWORD)FUNC_EVAL_DEFAULT_TIMEOUT_VALUE); if (hr == HRESULT_FROM_WIN32(ERROR_TIMEOUT)) { hr = S_OK; diff --git a/src/coreclr/src/debug/ee/debugger.h b/src/coreclr/src/debug/ee/debugger.h index 2450ab65d4f9..b149dcc94d33 100644 --- a/src/coreclr/src/debug/ee/debugger.h +++ b/src/coreclr/src/debug/ee/debugger.h @@ -725,37 +725,6 @@ class DebuggerRCThread return GetRCThreadSendBuffer(); } - DebuggerIPCEvent *GetIPCEventSendBufferContinuation( - DebuggerIPCEvent *eventCur) - { - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - PRECONDITION(eventCur != NULL); - PRECONDITION(eventCur->next == NULL); - } - CONTRACTL_END; - - DebuggerIPCEvent *dipce = (DebuggerIPCEvent *) new (nothrow) BYTE [CorDBIPC_BUFFER_SIZE]; - dipce->next = NULL; - - LOG((LF_CORDB,LL_INFO1000000, "About to GIPCESBC 0x%x\n",dipce)); - - if (dipce != NULL) - { - eventCur->next = dipce; - } -#ifdef _DEBUG - else - { - _ASSERTE( !"GetIPCEventSendBufferContinuation failed to allocate mem!" ); - } -#endif //_DEBUG - - return dipce; - } - // Send an IPCEvent once we're ready for sending. This should be done inbetween // SENDIPCEVENT_BEGIN & SENDIPCEVENT_END. See definition of SENDIPCEVENT_BEGIN // for usage pattern @@ -3392,7 +3361,7 @@ class DebuggerEvalBreakpointInfoSegment /* ------------------------------------------------------------------------ * * DebuggerEval class * - * Note that arguments get passsed in a block allocated when + * Note that arguments get passed in a block allocated when * the func-eval is set up. The setup phase passes the total count of arguments. * * In some situations type arguments must also be passed, e.g. diff --git a/src/coreclr/src/debug/ee/funceval.cpp b/src/coreclr/src/debug/ee/funceval.cpp index 0febdcbaef7f..8700b93d1318 100644 --- a/src/coreclr/src/debug/ee/funceval.cpp +++ b/src/coreclr/src/debug/ee/funceval.cpp @@ -3886,7 +3886,7 @@ void * STDCALL FuncEvalHijackWorker(DebuggerEval *pDE) FrameWithCookie FEFrame(pDE, GetIP(&pDE->m_context), false); FEFrame.Push(); - pDE->m_thread->UserAbort(pDE->m_requester, EEPolicy::TA_Safe, INFINITE, Thread::UAC_Normal); + pDE->m_thread->UserAbort(pDE->m_requester, EEPolicy::TA_Safe, INFINITE); _ASSERTE(!"Should not return from UserAbort here!"); return NULL; } diff --git a/src/coreclr/src/debug/ee/i386/dbghelpers.S b/src/coreclr/src/debug/ee/i386/dbghelpers.S index 16440fb1d0f6..5e8a2e6800d1 100644 --- a/src/coreclr/src/debug/ee/i386/dbghelpers.S +++ b/src/coreclr/src/debug/ee/i386/dbghelpers.S @@ -14,7 +14,7 @@ NESTED_ENTRY FuncEvalHijack, _TEXT, UnhandledExceptionHandlerUnix CHECK_STACK_ALIGNMENT call C_FUNC(FuncEvalHijackWorker) add esp, (4 + STK_ALIGN_PADDING) - jmp eax // return is the patch addresss to jmp to + jmp eax // return is the patch address to jmp to #undef STK_ALIGN_PADDING NESTED_END FuncEvalHijack, _TEXT diff --git a/src/coreclr/src/debug/ee/i386/dbghelpers.asm b/src/coreclr/src/debug/ee/i386/dbghelpers.asm index 7825dee6ab7e..94a1bc921e8e 100644 --- a/src/coreclr/src/debug/ee/i386/dbghelpers.asm +++ b/src/coreclr/src/debug/ee/i386/dbghelpers.asm @@ -28,7 +28,7 @@ _FuncEvalHijack@0 proc public push eax ; the ptr to the DebuggerEval call _FuncEvalHijackWorker@4 - jmp eax ; return is the patch addresss to jmp to + jmp eax ; return is the patch address to jmp to _FuncEvalHijack@0 endp diff --git a/src/coreclr/src/debug/ee/wks/CMakeLists.txt b/src/coreclr/src/debug/ee/wks/CMakeLists.txt index a6891ebb052c..ca3aca44e1ff 100644 --- a/src/coreclr/src/debug/ee/wks/CMakeLists.txt +++ b/src/coreclr/src/debug/ee/wks/CMakeLists.txt @@ -9,9 +9,12 @@ if (CLR_CMAKE_TARGET_WIN32) if(CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64) - preprocess_compile_asm(TARGET cordbee_wks ASM_FILES ${ASM_FILE} OUTPUT_OBJECTS ASM_OBJECTS) + preprocess_files(ASM_FILE ${ASM_FILE}) + if (CMAKE_GENERATOR MATCHES "Visual Studio") + compile_asm(TARGET cordbee_wks_obj ASM_FILES ${ASM_FILE} OUTPUT_OBJECTS ASM_OBJECTS) + endif() - add_library_clr(cordbee_wks OBJECT ${CORDBEE_SOURCES_WKS} ${ASM_FILE} ${ASM_OBJECTS}) + add_library_clr(cordbee_wks_obj OBJECT ${CORDBEE_SOURCES_WKS} ${ASM_FILE} ${ASM_OBJECTS}) else () @@ -23,19 +26,21 @@ if (CLR_CMAKE_TARGET_WIN32) set_source_files_properties(${ASM_FILE} PROPERTIES COMPILE_OPTIONS "${ASM_OPTIONS}") - add_library_clr(cordbee_wks OBJECT ${CORDBEE_SOURCES_WKS} ${ASM_FILE}) + add_library_clr(cordbee_wks_obj OBJECT ${CORDBEE_SOURCES_WKS} ${ASM_FILE}) endif() else () if(CLR_CMAKE_HOST_ARCH_AMD64 OR CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64 OR CLR_CMAKE_HOST_ARCH_I386) - add_library_clr(cordbee_wks OBJECT ${CORDBEE_SOURCES_WKS} ../${ARCH_SOURCES_DIR}/dbghelpers.S) + add_library_clr(cordbee_wks_obj OBJECT ${CORDBEE_SOURCES_WKS} ../${ARCH_SOURCES_DIR}/dbghelpers.S) else() message(FATAL_ERROR "Unknown platform") endif() endif (CLR_CMAKE_TARGET_WIN32) -target_precompile_header(TARGET cordbee_wks HEADER stdafx.h) -add_dependencies(cordbee_wks eventing_headers) +target_precompile_headers(cordbee_wks_obj PRIVATE [["stdafx.h"]]) +add_dependencies(cordbee_wks_obj eventing_headers) +add_library(cordbee_wks INTERFACE) +target_sources(cordbee_wks INTERFACE $) diff --git a/src/coreclr/src/debug/ildbsymlib/CMakeLists.txt b/src/coreclr/src/debug/ildbsymlib/CMakeLists.txt index b5b249228d26..4aea0cfedb4a 100644 --- a/src/coreclr/src/debug/ildbsymlib/CMakeLists.txt +++ b/src/coreclr/src/debug/ildbsymlib/CMakeLists.txt @@ -1,6 +1,6 @@ if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) endif(CLR_CMAKE_HOST_WIN32) set( ILDBSYMLIB_SOURCES @@ -10,5 +10,6 @@ set( ILDBSYMLIB_SOURCES symwrite.cpp ) -add_library_clr(ildbsymlib OBJECT ${ILDBSYMLIB_SOURCES}) - +add_library_clr(ildbsymlib_obj OBJECT ${ILDBSYMLIB_SOURCES}) +add_library(ildbsymlib INTERFACE) +target_sources(ildbsymlib INTERFACE $) diff --git a/src/coreclr/src/debug/ildbsymlib/symread.cpp b/src/coreclr/src/debug/ildbsymlib/symread.cpp index 61588f9f6849..dc12d4fd8c72 100644 --- a/src/coreclr/src/debug/ildbsymlib/symread.cpp +++ b/src/coreclr/src/debug/ildbsymlib/symread.cpp @@ -1945,7 +1945,7 @@ SymMethod::GetRanges( { // Search through all the sequence points since line might have there - // IL spread accross multiple ranges (for loops for example) + // IL spread across multiple ranges (for loops for example) if (m_pData->m_pSequencePoints[point].Document() == DocumentEntry && line >= m_pData->m_pSequencePoints[point].StartLine() && line <= m_pData->m_pSequencePoints[point].EndLine()) diff --git a/src/coreclr/src/debug/inc/dacdbiinterface.h b/src/coreclr/src/debug/inc/dacdbiinterface.h index 79405d60e3d8..1f99f5f29665 100644 --- a/src/coreclr/src/debug/inc/dacdbiinterface.h +++ b/src/coreclr/src/debug/inc/dacdbiinterface.h @@ -2733,6 +2733,9 @@ class IDacDbiInterface virtual HRESULT GetLoaderHeapMemoryRanges(OUT DacDbiArrayList *pRanges) = 0; + virtual + HRESULT IsModuleMapped(VMPTR_Module pModule, OUT BOOL *isModuleMapped) = 0; + // The following tag tells the DD-marshalling tool to stop scanning. // END_MARSHAL diff --git a/src/coreclr/src/debug/inc/dbgipcevents.h b/src/coreclr/src/debug/inc/dbgipcevents.h index eda4029c0fb1..6fd2cf197c65 100644 --- a/src/coreclr/src/debug/inc/dbgipcevents.h +++ b/src/coreclr/src/debug/inc/dbgipcevents.h @@ -848,7 +848,7 @@ typedef VMPTR_Base VMPTR_CONTEXT; #endif // DomainFile is a base-class for a CLR module, with app-domain affinity. -// For domain-neutral modules (like mscorlib), there is a DomainFile instance +// For domain-neutral modules (like CoreLib), there is a DomainFile instance // for each appdomain the module lives in. // This is the canonical handle ICorDebug uses to a CLR module. DEFINE_VMPTR(class DomainFile, PTR_DomainFile, VMPTR_DomainFile); @@ -984,20 +984,9 @@ struct MSLAYOUT IPCEventTypeNameMapping const char * eventName; }; -constexpr IPCEventTypeNameMapping DbgIPCEventTypeNames[] = -{ - #define IPC_EVENT_TYPE0(type, val) { type, #type }, - #define IPC_EVENT_TYPE1(type, val) { type, #type }, - #define IPC_EVENT_TYPE2(type, val) { type, #type }, - #include "dbgipceventtypes.h" - #undef IPC_EVENT_TYPE2 - #undef IPC_EVENT_TYPE1 - #undef IPC_EVENT_TYPE0 - { DB_IPCE_INVALID_EVENT, "DB_IPCE_Error" } -}; - -const size_t nameCount = sizeof(DbgIPCEventTypeNames) / sizeof(DbgIPCEventTypeNames[0]); +extern const IPCEventTypeNameMapping DbgIPCEventTypeNames[]; +extern const size_t nameCount; struct MSLAYOUT IPCENames // We use a class/struct so that the function can remain in a shared header file { @@ -1028,7 +1017,7 @@ struct MSLAYOUT IPCENames // We use a class/struct so that the function can rema #undef IPC_EVENT_TYPE0 }; - unsigned int i, lim; + size_t i, lim; if (eventType < DB_IPCE_DEBUGGER_FIRST) { diff --git a/src/coreclr/src/debug/inc/dbgtargetcontext.h b/src/coreclr/src/debug/inc/dbgtargetcontext.h index c4640aa64395..f96a18c008dd 100644 --- a/src/coreclr/src/debug/inc/dbgtargetcontext.h +++ b/src/coreclr/src/debug/inc/dbgtargetcontext.h @@ -60,10 +60,11 @@ #define DT_CONTEXT_SEGMENTS (DT_CONTEXT_i386 | 0x00000004L) #define DT_CONTEXT_FLOATING_POINT (DT_CONTEXT_i386 | 0x00000008L) // 387 state #define DT_CONTEXT_DEBUG_REGISTERS (DT_CONTEXT_i386 | 0x00000010L) - -#define DT_CONTEXT_FULL (DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER | DT_CONTEXT_SEGMENTS) #define DT_CONTEXT_EXTENDED_REGISTERS (DT_CONTEXT_i386 | 0x00000020L) +#define DT_CONTEXT_FULL (DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER | DT_CONTEXT_SEGMENTS) +#define DT_CONTEXT_ALL (DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER | DT_CONTEXT_SEGMENTS | DT_CONTEXT_FLOATING_POINT | DT_CONTEXT_DEBUG_REGISTERS | DT_CONTEXT_EXTENDED_REGISTERS) + #define DT_MAXIMUM_SUPPORTED_EXTENSION 512 typedef struct { diff --git a/src/coreclr/src/debug/inc/dbgtransportsession.h b/src/coreclr/src/debug/inc/dbgtransportsession.h index 6eb202039ab2..f90f4db12ca7 100644 --- a/src/coreclr/src/debug/inc/dbgtransportsession.h +++ b/src/coreclr/src/debug/inc/dbgtransportsession.h @@ -793,7 +793,7 @@ class DbgTransportSession // Upon receiving a reply message, signal the event on the message to wake up the thread waiting for // the reply message and close the handle to the event. - void SignalReplyEvent(Message * pMesssage); + void SignalReplyEvent(Message * pMessage); // Given a message ID, find the matching message in the send queue. If there is no match, return NULL. // If there is a match, remove the message from the send queue and return it. diff --git a/src/coreclr/src/debug/inc/diagnosticsipc.h b/src/coreclr/src/debug/inc/diagnosticsipc.h index 99d670ca6ca5..b5fff7afc65a 100644 --- a/src/coreclr/src/debug/inc/diagnosticsipc.h +++ b/src/coreclr/src/debug/inc/diagnosticsipc.h @@ -16,6 +16,7 @@ typedef void (*ErrorCallback)(const char *szMessage, uint32_t code); class IpcStream final { + friend class IpcStreamFactory; public: static constexpr int32_t InfiniteTimeout = -1; ~IpcStream(); @@ -26,11 +27,12 @@ class IpcStream final class DiagnosticsIpc final { + friend class IpcStreamFactory; public: enum ConnectionMode { - CLIENT, - SERVER + CONNECT, + LISTEN }; enum class PollEvents : uint8_t @@ -38,7 +40,8 @@ class IpcStream final NONE = 0x00, // no events SIGNALED = 0x01, // ready for use HANGUP = 0x02, // connection remotely closed - ERR = 0x04 // other error + ERR = 0x04, // error + UNKNOWN = 0x80 // unknown state }; // The bookeeping struct used for polling on server and client structs @@ -99,7 +102,7 @@ class IpcStream final sockaddr_un *const _pServerAddress; bool _isClosed; - DiagnosticsIpc(const int serverSocket, sockaddr_un *const pServerAddress, ConnectionMode mode = ConnectionMode::SERVER); + DiagnosticsIpc(const int serverSocket, sockaddr_un *const pServerAddress, ConnectionMode mode = ConnectionMode::LISTEN); // Used to unlink the socket so it can be removed from the filesystem // when the last reference to it is closed. @@ -110,7 +113,7 @@ class IpcStream final HANDLE _hPipe = INVALID_HANDLE_VALUE; OVERLAPPED _oOverlap = {}; - DiagnosticsIpc(const char(&namedPipeName)[MaxNamedPipeNameLength], ConnectionMode mode = ConnectionMode::SERVER); + DiagnosticsIpc(const char(&namedPipeName)[MaxNamedPipeNameLength], ConnectionMode mode = ConnectionMode::LISTEN); #endif /* TARGET_UNIX */ bool _isListening; @@ -125,13 +128,13 @@ class IpcStream final private: #ifdef TARGET_UNIX int _clientSocket = -1; - IpcStream(int clientSocket, int serverSocket, DiagnosticsIpc::ConnectionMode mode = DiagnosticsIpc::ConnectionMode::SERVER) + IpcStream(int clientSocket, DiagnosticsIpc::ConnectionMode mode = DiagnosticsIpc::ConnectionMode::LISTEN) : _clientSocket(clientSocket), _mode(mode) {} #else HANDLE _hPipe = INVALID_HANDLE_VALUE; OVERLAPPED _oOverlap = {}; BOOL _isTestReading = false; // used to check whether we are already doing a 0-byte read to test for data - IpcStream(HANDLE hPipe, DiagnosticsIpc::ConnectionMode mode = DiagnosticsIpc::ConnectionMode::SERVER); + IpcStream(HANDLE hPipe, DiagnosticsIpc::ConnectionMode mode = DiagnosticsIpc::ConnectionMode::LISTEN); #endif /* TARGET_UNIX */ DiagnosticsIpc::ConnectionMode _mode; diff --git a/src/coreclr/src/debug/runtimeinfo/CMakeLists.txt b/src/coreclr/src/debug/runtimeinfo/CMakeLists.txt index 99b8f5edd084..5f5778d1899e 100644 --- a/src/coreclr/src/debug/runtimeinfo/CMakeLists.txt +++ b/src/coreclr/src/debug/runtimeinfo/CMakeLists.txt @@ -7,5 +7,8 @@ set(RUNTIMEINFO_SOURCES add_library_clr(runtimeinfo STATIC ${RUNTIMEINFO_SOURCES}) add_dependencies(runtimeinfo coreclr_module_index_header) -add_dependencies(runtimeinfo mscordaccore_module_index_header) -add_dependencies(runtimeinfo mscordbi_module_index_header) + +if (NOT (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_ARM) AND CLR_CMAKE_HOST_ARCH_AMD64)) + add_dependencies(runtimeinfo mscordaccore_module_index_header) + add_dependencies(runtimeinfo mscordbi_module_index_header) +endif() \ No newline at end of file diff --git a/src/coreclr/src/debug/shared/utils.cpp b/src/coreclr/src/debug/shared/utils.cpp index 5363e30ee8a8..b9c7d72db3f7 100644 --- a/src/coreclr/src/debug/shared/utils.cpp +++ b/src/coreclr/src/debug/shared/utils.cpp @@ -200,3 +200,17 @@ void ExportILToNativeMap(ULONG32 cMap, // [in] Min size of mapExt, m #endif // _DEBUG } } + +const IPCEventTypeNameMapping DbgIPCEventTypeNames[] = +{ + #define IPC_EVENT_TYPE0(type, val) { type, #type }, + #define IPC_EVENT_TYPE1(type, val) { type, #type }, + #define IPC_EVENT_TYPE2(type, val) { type, #type }, + #include "dbgipceventtypes.h" + #undef IPC_EVENT_TYPE2 + #undef IPC_EVENT_TYPE1 + #undef IPC_EVENT_TYPE0 + { DB_IPCE_INVALID_EVENT, "DB_IPCE_Error" } +}; + +const size_t nameCount = sizeof(DbgIPCEventTypeNames) / sizeof(DbgIPCEventTypeNames[0]); diff --git a/src/coreclr/src/debug/shim/CMakeLists.txt b/src/coreclr/src/debug/shim/CMakeLists.txt index 6517eb73327a..2e2c923d6c49 100644 --- a/src/coreclr/src/debug/shim/CMakeLists.txt +++ b/src/coreclr/src/debug/shim/CMakeLists.txt @@ -1,6 +1,6 @@ if(CLR_CMAKE_HOST_WIN32) #use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) add_definitions(-DHOST_WINDOWS) endif(CLR_CMAKE_HOST_WIN32) diff --git a/src/coreclr/src/debug/shim/debugshim.cpp b/src/coreclr/src/debug/shim/debugshim.cpp index 25e7a25d6764..b86c8eb0cfcc 100644 --- a/src/coreclr/src/debug/shim/debugshim.cpp +++ b/src/coreclr/src/debug/shim/debugshim.cpp @@ -50,6 +50,31 @@ typedef HRESULT (STDAPICALLTYPE *OpenVirtualProcess2FnPtr)(ULONG64 clrInstanceI typedef HMODULE (STDAPICALLTYPE *LoadLibraryWFnPtr)(LPCWSTR lpLibFileName); +static bool IsTargetWindows(ICorDebugDataTarget* pDataTarget) +{ + CorDebugPlatform targetPlatform; + + HRESULT result = pDataTarget->GetPlatform(&targetPlatform); + + if(FAILED(result)) + { + _ASSERTE(!"Unexpected error"); + return false; + } + + switch (targetPlatform) + { + case CORDB_PLATFORM_WINDOWS_X86: + case CORDB_PLATFORM_WINDOWS_AMD64: + case CORDB_PLATFORM_WINDOWS_IA64: + case CORDB_PLATFORM_WINDOWS_ARM: + case CORDB_PLATFORM_WINDOWS_ARM64: + return true; + default: + return false; + } +} + // Implementation of ICLRDebugging::OpenVirtualProcess // // Arguments: @@ -212,7 +237,7 @@ STDMETHODIMP CLRDebuggingImpl::OpenVirtualProcess( _ASSERTE(pFlags == NULL || *pFlags == 0); } } -#ifdef TARGET_UNIX +#ifdef HOST_UNIX else { // On Linux/MacOS the DAC module handle needs to be re-created using the DAC PAL instance @@ -232,7 +257,7 @@ STDMETHODIMP CLRDebuggingImpl::OpenVirtualProcess( hr = E_HANDLE; } } -#endif // TARGET_UNIX +#endif // HOST_UNIX } // If no errors so far and "OpenVirtualProcessImpl2" doesn't exist @@ -277,7 +302,7 @@ STDMETHODIMP CLRDebuggingImpl::OpenVirtualProcess( if (pDacModulePath != NULL) { -#ifdef TARGET_UNIX +#ifdef HOST_UNIX free(pDacModulePath); #else CoTaskMemFree(pDacModulePath); @@ -286,7 +311,7 @@ STDMETHODIMP CLRDebuggingImpl::OpenVirtualProcess( if (pDbiModulePath != NULL) { -#ifdef TARGET_UNIX +#ifdef HOST_UNIX free(pDbiModulePath); #else CoTaskMemFree(pDbiModulePath); @@ -409,193 +434,198 @@ HRESULT CLRDebuggingImpl::GetCLRInfo(ICorDebugDataTarget* pDataTarget, __out_z __inout_ecount(dwDacNameCharCount) WCHAR* pDacName, DWORD dwDacNameCharCount) { -#ifndef TARGET_UNIX - WORD imageFileMachine = 0; - DWORD resourceSectionRVA = 0; - HRESULT hr = GetMachineAndResourceSectionRVA(pDataTarget, moduleBaseAddress, &imageFileMachine, &resourceSectionRVA); - - // We want the version resource which has type = RT_VERSION = 16, name = 1, language = 0x409 - DWORD versionResourceRVA = 0; - DWORD versionResourceSize = 0; - if(SUCCEEDED(hr)) - { - hr = GetResourceRvaFromResourceSectionRva(pDataTarget, moduleBaseAddress, resourceSectionRVA, 16, 1, 0x409, - &versionResourceRVA, &versionResourceSize); - } - - // At last we get our version info - VS_FIXEDFILEINFO fixedFileInfo = {0}; - if(SUCCEEDED(hr)) - { - // The version resource has 3 words, then the unicode string "VS_VERSION_INFO" - // (16 WCHARS including the null terminator) - // then padding to a 32-bit boundary, then the VS_FIXEDFILEINFO struct - DWORD fixedFileInfoRVA = ((versionResourceRVA + 3*2 + 16*2 + 3)/4)*4; - hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + fixedFileInfoRVA, (BYTE*)&fixedFileInfo, sizeof(fixedFileInfo)); - } - - //Verify the signature on the version resource - if(SUCCEEDED(hr) && fixedFileInfo.dwSignature != PE_FIXEDFILEINFO_SIGNATURE) - { - hr = CORDBG_E_NOT_CLR; - } - - // Record the version information - if(SUCCEEDED(hr)) - { - pVersion->wMajor = (WORD) (fixedFileInfo.dwProductVersionMS >> 16); - pVersion->wMinor = (WORD) (fixedFileInfo.dwProductVersionMS & 0xFFFF); - pVersion->wBuild = (WORD) (fixedFileInfo.dwProductVersionLS >> 16); - pVersion->wRevision = (WORD) (fixedFileInfo.dwProductVersionLS & 0xFFFF); - } - - // Now grab the special clr debug info resource - // We may need to scan a few different names searching though... - // 1) CLRDEBUGINFO where host_os = 'WINDOWS' or 'CORESYS' and host_arch = 'X86' or 'ARM' or 'AMD64' - // 2) For back-compat if the host os is windows and the host architecture matches the target then CLRDEBUGINFO is used with no suffix. - DWORD debugResourceRVA = 0; - DWORD debugResourceSize = 0; - BOOL useCrossPlatformNaming = FALSE; - if(SUCCEEDED(hr)) +#ifdef HOST_WINDOWS + if(IsTargetWindows(pDataTarget)) { - // the initial state is that we haven't found a proper resource - HRESULT hrGetResource = E_FAIL; - - // First check for the resource which has type = RC_DATA = 10, name = "CLRDEBUGINFO", language = 0 -#if defined (HOST_WINDOWS) && defined(HOST_X86) - const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSX86"); -#endif + WORD imageFileMachine = 0; + DWORD resourceSectionRVA = 0; + HRESULT hr = GetMachineAndResourceSectionRVA(pDataTarget, moduleBaseAddress, &imageFileMachine, &resourceSectionRVA); -#if !defined (HOST_WINDOWS) && defined(HOST_X86) - const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSX86"); -#endif - -#if defined (HOST_WINDOWS) && defined(HOST_AMD64) - const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSAMD64"); -#endif - -#if !defined (HOST_WINDOWS) && defined(HOST_AMD64) - const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSAMD64"); -#endif - -#if defined (HOST_WINDOWS) && defined(HOST_ARM64) - const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSARM64"); -#endif - -#if !defined (HOST_WINDOWS) && defined(HOST_ARM64) - const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSARM64"); -#endif + // We want the version resource which has type = RT_VERSION = 16, name = 1, language = 0x409 + DWORD versionResourceRVA = 0; + DWORD versionResourceSize = 0; + if(SUCCEEDED(hr)) + { + hr = GetResourceRvaFromResourceSectionRva(pDataTarget, moduleBaseAddress, resourceSectionRVA, 16, 1, 0x409, + &versionResourceRVA, &versionResourceSize); + } -#if defined (HOST_WINDOWS) && defined(HOST_ARM) - const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSARM"); -#endif + // At last we get our version info + VS_FIXEDFILEINFO fixedFileInfo = {0}; + if(SUCCEEDED(hr)) + { + // The version resource has 3 words, then the unicode string "VS_VERSION_INFO" + // (16 WCHARS including the null terminator) + // then padding to a 32-bit boundary, then the VS_FIXEDFILEINFO struct + DWORD fixedFileInfoRVA = ((versionResourceRVA + 3*2 + 16*2 + 3)/4)*4; + hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + fixedFileInfoRVA, (BYTE*)&fixedFileInfo, sizeof(fixedFileInfo)); + } -#if !defined (HOST_WINDOWS) && defined(HOST_ARM) - const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSARM"); -#endif + //Verify the signature on the version resource + if(SUCCEEDED(hr) && fixedFileInfo.dwSignature != PE_FIXEDFILEINFO_SIGNATURE) + { + hr = CORDBG_E_NOT_CLR; + } - hrGetResource = GetResourceRvaFromResourceSectionRvaByName(pDataTarget, moduleBaseAddress, resourceSectionRVA, 10, resourceName, 0, - &debugResourceRVA, &debugResourceSize); - useCrossPlatformNaming = SUCCEEDED(hrGetResource); + // Record the version information + if(SUCCEEDED(hr)) + { + pVersion->wMajor = (WORD) (fixedFileInfo.dwProductVersionMS >> 16); + pVersion->wMinor = (WORD) (fixedFileInfo.dwProductVersionMS & 0xFFFF); + pVersion->wBuild = (WORD) (fixedFileInfo.dwProductVersionLS >> 16); + pVersion->wRevision = (WORD) (fixedFileInfo.dwProductVersionLS & 0xFFFF); + } + // Now grab the special clr debug info resource + // We may need to scan a few different names searching though... + // 1) CLRDEBUGINFO where host_os = 'WINDOWS' or 'CORESYS' and host_arch = 'X86' or 'ARM' or 'AMD64' + // 2) For back-compat if the host os is windows and the host architecture matches the target then CLRDEBUGINFO is used with no suffix. + DWORD debugResourceRVA = 0; + DWORD debugResourceSize = 0; + BOOL useCrossPlatformNaming = FALSE; + if(SUCCEEDED(hr)) + { + // the initial state is that we haven't found a proper resource + HRESULT hrGetResource = E_FAIL; + + // First check for the resource which has type = RC_DATA = 10, name = "CLRDEBUGINFO", language = 0 + #if defined (HOST_WINDOWS) && defined(HOST_X86) + const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSX86"); + #endif + + #if !defined (HOST_WINDOWS) && defined(HOST_X86) + const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSX86"); + #endif + + #if defined (HOST_WINDOWS) && defined(HOST_AMD64) + const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSAMD64"); + #endif + + #if !defined (HOST_WINDOWS) && defined(HOST_AMD64) + const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSAMD64"); + #endif + + #if defined (HOST_WINDOWS) && defined(HOST_ARM64) + const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSARM64"); + #endif + + #if !defined (HOST_WINDOWS) && defined(HOST_ARM64) + const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSARM64"); + #endif + + #if defined (HOST_WINDOWS) && defined(HOST_ARM) + const WCHAR * resourceName = W("CLRDEBUGINFOWINDOWSARM"); + #endif + + #if !defined (HOST_WINDOWS) && defined(HOST_ARM) + const WCHAR * resourceName = W("CLRDEBUGINFOCORESYSARM"); + #endif + + hrGetResource = GetResourceRvaFromResourceSectionRvaByName(pDataTarget, moduleBaseAddress, resourceSectionRVA, 10, resourceName, 0, + &debugResourceRVA, &debugResourceSize); + useCrossPlatformNaming = SUCCEEDED(hrGetResource); + + + #if defined(HOST_WINDOWS) && (defined(HOST_X86) || defined(HOST_AMD64) || defined(HOST_ARM)) + #if defined(HOST_X86) + #define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_I386 + #elif defined(HOST_AMD64) + #define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_AMD64 + #elif defined(HOST_ARM) + #define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_ARMNT + #endif + + // if this is windows, and if host_arch matches target arch then we can fallback to searching for CLRDEBUGINFO on failure + if(FAILED(hrGetResource) && (imageFileMachine == _HOST_MACHINE_TYPE)) + { + hrGetResource = GetResourceRvaFromResourceSectionRvaByName(pDataTarget, moduleBaseAddress, resourceSectionRVA, 10, W("CLRDEBUGINFO"), 0, + &debugResourceRVA, &debugResourceSize); + } -#if defined(HOST_WINDOWS) && (defined(HOST_X86) || defined(HOST_AMD64) || defined(HOST_ARM)) - #if defined(HOST_X86) - #define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_I386 - #elif defined(HOST_AMD64) - #define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_AMD64 - #elif defined(HOST_ARM) - #define _HOST_MACHINE_TYPE IMAGE_FILE_MACHINE_ARMNT - #endif + #undef _HOST_MACHINE_TYPE + #endif + // if the search failed, we don't recognize the CLR + if(FAILED(hrGetResource)) + hr = CORDBG_E_NOT_CLR; + } - // if this is windows, and if host_arch matches target arch then we can fallback to searching for CLRDEBUGINFO on failure - if(FAILED(hrGetResource) && (imageFileMachine == _HOST_MACHINE_TYPE)) + CLR_DEBUG_RESOURCE debugResource; + if(SUCCEEDED(hr) && debugResourceSize != sizeof(debugResource)) { - hrGetResource = GetResourceRvaFromResourceSectionRvaByName(pDataTarget, moduleBaseAddress, resourceSectionRVA, 10, W("CLRDEBUGINFO"), 0, - &debugResourceRVA, &debugResourceSize); + hr = CORDBG_E_NOT_CLR; } - #undef _HOST_MACHINE_TYPE -#endif - // if the search failed, we don't recognize the CLR - if(FAILED(hrGetResource)) + // Get the special debug resource from the image and return the results + if(SUCCEEDED(hr)) + { + hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + debugResourceRVA, (BYTE*)&debugResource, sizeof(debugResource)); + } + if(SUCCEEDED(hr) && (debugResource.dwVersion != 0)) + { hr = CORDBG_E_NOT_CLR; - } - - CLR_DEBUG_RESOURCE debugResource; - if(SUCCEEDED(hr) && debugResourceSize != sizeof(debugResource)) - { - hr = CORDBG_E_NOT_CLR; - } - - // Get the special debug resource from the image and return the results - if(SUCCEEDED(hr)) - { - hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + debugResourceRVA, (BYTE*)&debugResource, sizeof(debugResource)); - } - if(SUCCEEDED(hr) && (debugResource.dwVersion != 0)) - { - hr = CORDBG_E_NOT_CLR; - } + } - // The signature needs to match m_skuId exactly, except for m_skuId=CLR_ID_ONECORE_CLR which is - // also compatible with the older CLR_ID_PHONE_CLR signature. - if(SUCCEEDED(hr) && - (debugResource.signature != m_skuId) && - !( (debugResource.signature == CLR_ID_PHONE_CLR) && (m_skuId == CLR_ID_ONECORE_CLR) )) - { - hr = CORDBG_E_NOT_CLR; - } + // The signature needs to match m_skuId exactly, except for m_skuId=CLR_ID_ONECORE_CLR which is + // also compatible with the older CLR_ID_PHONE_CLR signature. + if(SUCCEEDED(hr) && + (debugResource.signature != m_skuId) && + !( (debugResource.signature == CLR_ID_PHONE_CLR) && (m_skuId == CLR_ID_ONECORE_CLR) )) + { + hr = CORDBG_E_NOT_CLR; + } - if(SUCCEEDED(hr) && - (debugResource.signature != CLR_ID_ONECORE_CLR) && - useCrossPlatformNaming) - { - FormatLongDacModuleName(pDacName, dwDacNameCharCount, imageFileMachine, &fixedFileInfo); - swprintf_s(pDbiName, dwDbiNameCharCount, W("%s_%s.dll"), MAIN_DBI_MODULE_NAME_W, W("x86")); - } - else - { - if(m_skuId == CLR_ID_V4_DESKTOP) - swprintf_s(pDacName, dwDacNameCharCount, W("%s.dll"), CLR_DAC_MODULE_NAME_W); + if(SUCCEEDED(hr) && + (debugResource.signature != CLR_ID_ONECORE_CLR) && + useCrossPlatformNaming) + { + FormatLongDacModuleName(pDacName, dwDacNameCharCount, imageFileMachine, &fixedFileInfo); + swprintf_s(pDbiName, dwDbiNameCharCount, W("%s_%s.dll"), MAIN_DBI_MODULE_NAME_W, W("x86")); + } else - swprintf_s(pDacName, dwDacNameCharCount, W("%s.dll"), CORECLR_DAC_MODULE_NAME_W); - swprintf_s(pDbiName, dwDbiNameCharCount, W("%s.dll"), MAIN_DBI_MODULE_NAME_W); - } + { + if(m_skuId == CLR_ID_V4_DESKTOP) + swprintf_s(pDacName, dwDacNameCharCount, W("%s.dll"), CLR_DAC_MODULE_NAME_W); + else + swprintf_s(pDacName, dwDacNameCharCount, W("%s.dll"), CORECLR_DAC_MODULE_NAME_W); + swprintf_s(pDbiName, dwDbiNameCharCount, W("%s.dll"), MAIN_DBI_MODULE_NAME_W); + } - if(SUCCEEDED(hr)) - { - *pdwDbiTimeStamp = debugResource.dwDbiTimeStamp; - *pdwDbiSizeOfImage = debugResource.dwDbiSizeOfImage; - *pdwDacTimeStamp = debugResource.dwDacTimeStamp; - *pdwDacSizeOfImage = debugResource.dwDacSizeOfImage; - } + if(SUCCEEDED(hr)) + { + *pdwDbiTimeStamp = debugResource.dwDbiTimeStamp; + *pdwDbiSizeOfImage = debugResource.dwDbiSizeOfImage; + *pdwDacTimeStamp = debugResource.dwDacTimeStamp; + *pdwDacSizeOfImage = debugResource.dwDacSizeOfImage; + } - // any failure should be interpreted as this module not being a CLR - if(FAILED(hr)) - { - return CORDBG_E_NOT_CLR; + // any failure should be interpreted as this module not being a CLR + if(FAILED(hr)) + { + return CORDBG_E_NOT_CLR; + } + else + { + return S_OK; + } } else +#endif // !HOST_WINDOWS { - return S_OK; - } -#else - swprintf_s(pDacName, dwDacNameCharCount, W("%s"), MAKEDLLNAME_W(CORECLR_DAC_MODULE_NAME_W)); - swprintf_s(pDbiName, dwDbiNameCharCount, W("%s"), MAKEDLLNAME_W(MAIN_DBI_MODULE_NAME_W)); + swprintf_s(pDacName, dwDacNameCharCount, W("%s"), MAKEDLLNAME_W(CORECLR_DAC_MODULE_NAME_W)); + swprintf_s(pDbiName, dwDbiNameCharCount, W("%s"), MAKEDLLNAME_W(MAIN_DBI_MODULE_NAME_W)); - pVersion->wMajor = 0; - pVersion->wMinor = 0; - pVersion->wBuild = 0; - pVersion->wRevision = 0; + pVersion->wMajor = 0; + pVersion->wMinor = 0; + pVersion->wBuild = 0; + pVersion->wRevision = 0; - *pdwDbiTimeStamp = 0; - *pdwDbiSizeOfImage = 0; - *pdwDacTimeStamp = 0; - *pdwDacSizeOfImage = 0; + *pdwDbiTimeStamp = 0; + *pdwDbiSizeOfImage = 0; + *pdwDacTimeStamp = 0; + *pdwDacSizeOfImage = 0; - return S_OK; -#endif // TARGET_UNIX + return S_OK; + } } // Formats the long name for DAC diff --git a/src/coreclr/src/dlls/CMakeLists.txt b/src/coreclr/src/dlls/CMakeLists.txt index 6df11d24cd4e..6ef420d165f1 100644 --- a/src/coreclr/src/dlls/CMakeLists.txt +++ b/src/coreclr/src/dlls/CMakeLists.txt @@ -2,8 +2,10 @@ if(CLR_CMAKE_TARGET_WIN32) add_subdirectory(clretwrc) endif(CLR_CMAKE_TARGET_WIN32) add_subdirectory(dbgshim) -add_subdirectory(mscordbi) -add_subdirectory(mscordac) +if (NOT (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_ARM) AND CLR_CMAKE_HOST_ARCH_AMD64)) + add_subdirectory(mscordbi) + add_subdirectory(mscordac) +endif() add_subdirectory(mscoree) add_subdirectory(mscorpe) add_subdirectory(mscorrc) diff --git a/src/coreclr/src/dlls/clretwrc/CMakeLists.txt b/src/coreclr/src/dlls/clretwrc/CMakeLists.txt index 9935362c0c9a..d2cb5cfae98e 100644 --- a/src/coreclr/src/dlls/clretwrc/CMakeLists.txt +++ b/src/coreclr/src/dlls/clretwrc/CMakeLists.txt @@ -20,6 +20,6 @@ add_library_clr(clretwrc SHARED ) # add the install targets -install_clr(TARGETS clretwrc ADDITIONAL_DESTINATION sharedFramework) +install_clr(TARGETS clretwrc ADDITIONAL_DESTINATIONS sharedFramework) add_dependencies(clretwrc eventing_headers) diff --git a/src/coreclr/src/dlls/dbgshim/CMakeLists.txt b/src/coreclr/src/dlls/dbgshim/CMakeLists.txt index 54cedfeb2c29..12b5b64d6bc3 100644 --- a/src/coreclr/src/dlls/dbgshim/CMakeLists.txt +++ b/src/coreclr/src/dlls/dbgshim/CMakeLists.txt @@ -9,7 +9,7 @@ set(DBGSHIM_SOURCES if(CLR_CMAKE_HOST_WIN32) # Use static crt - add_definitions(-MT) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) add_definitions(-DFX_VER_INTERNALNAME_STR=dbgshim.dll) endif(CLR_CMAKE_HOST_WIN32) @@ -78,4 +78,4 @@ endif(CLR_CMAKE_HOST_WIN32) target_link_libraries(dbgshim ${DBGSHIM_LIBRARIES}) # add the install targets -install_clr(TARGETS dbgshim ADDITIONAL_DESTINATION sharedFramework) +install_clr(TARGETS dbgshim ADDITIONAL_DESTINATIONS sharedFramework) diff --git a/src/coreclr/src/dlls/mscordac/CMakeLists.txt b/src/coreclr/src/dlls/mscordac/CMakeLists.txt index 7a3e19525f2a..a66f99e4251c 100644 --- a/src/coreclr/src/dlls/mscordac/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscordac/CMakeLists.txt @@ -133,13 +133,11 @@ if(CLR_CMAKE_HOST_WIN32) # mscordac.def should be generated before mscordaccore.dll is built add_dependencies(mscordaccore mscordaccore_def) - set(MSCORDAC_OBJ_PATH "${CMAKE_CURRENT_BINARY_DIR}/mscordacobj.dir/${CMAKE_CFG_INTDIR}/mscordac.obj") - # Generate export file add_custom_command( DEPENDS mscordaccore_def "${CURRENT_BINARY_DIR_FOR_CONFIG}/mscordac.def" mscordacobj daccess OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mscordaccore.exp - COMMAND lib.exe /OUT:"${CMAKE_CURRENT_BINARY_DIR}/mscordaccore.lib" /DEF:"${CURRENT_BINARY_DIR_FOR_CONFIG}/mscordac.def" "$" $<$,$>:/LTCG> ${STATIC_LIBRARY_FLAGS} ${MSCORDAC_OBJ_PATH} + COMMAND lib.exe /OUT:"${CMAKE_CURRENT_BINARY_DIR}/mscordaccore.lib" /DEF:"${CURRENT_BINARY_DIR_FOR_CONFIG}/mscordac.def" "$" $<$,$>:/LTCG> ${STATIC_LIBRARY_FLAGS} $ COMMENT "Generating mscordaccore.exp export file" ) @@ -149,7 +147,8 @@ if(CLR_CMAKE_HOST_WIN32) ) add_custom_target(mscordaccore_exp DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mscordaccore.exp) - add_dependencies(mscordaccore mscordaccore_exp) + add_dependencies(mscordaccore_exp mscordacobj) + add_dependencies(mscordaccore mscordaccore_exp mscordacobj) set(COREDAC_LIBRARIES ${CMAKE_CURRENT_BINARY_DIR}/mscordaccore.exp # export file @@ -179,11 +178,11 @@ if(CLR_CMAKE_HOST_WIN32 AND CLR_CMAKE_TARGET_UNIX) ) endif(CLR_CMAKE_HOST_WIN32 AND CLR_CMAKE_TARGET_UNIX) -if(CLR_CMAKE_HOST_OSX) +if(CLR_CMAKE_HOST_UNIX) list(APPEND COREDAC_LIBRARIES coreclrpal_dac ) -endif(CLR_CMAKE_HOST_OSX) +endif(CLR_CMAKE_HOST_UNIX) target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES}) @@ -194,7 +193,7 @@ if(FEATURE_SINGLE_FILE_DIAGNOSTICS) endif(FEATURE_SINGLE_FILE_DIAGNOSTICS) # add the install targets -install_clr(TARGETS mscordaccore ADDITIONAL_DESTINATION sharedFramework) +install_clr(TARGETS mscordaccore ADDITIONAL_DESTINATIONS sharedFramework) if(CLR_CMAKE_HOST_WIN32) set(LONG_NAME_HOST_ARCH ${CLR_CMAKE_HOST_ARCH}) diff --git a/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src b/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src index 29c010b9e849..a7e6a8786ed7 100644 --- a/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src +++ b/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src @@ -43,6 +43,9 @@ nativeStringResourceTable_mscorrc #PAL_InitializeDLL #PAL_TerminateEx #PAL_IsDebuggerPresent +#PAL_OpenProcessMemory +#PAL_CloseProcessMemory +#PAL_ReadProcessMemory #PAL_ProbeMemory #PAL_Random #PAL_memcpy @@ -82,7 +85,6 @@ nativeStringResourceTable_mscorrc #sscanf_s #CopyFileW -#CreateFileMappingA #CreateFileMappingW #CreateFileA #CreateFileW @@ -108,7 +110,6 @@ nativeStringResourceTable_mscorrc #FreeLibrary #FileTimeToSystemTime #GetACP -#GetCPInfo #GetCurrentDirectoryW #GetCurrentProcess #GetCurrentProcessId @@ -131,13 +132,11 @@ nativeStringResourceTable_mscorrc #GetTempPathA #GetTempPathW #InitializeCriticalSection -#IsDBCSLeadByte #LeaveCriticalSection #LoadLibraryA #LoadLibraryW #LoadLibraryExW #LocalAlloc -#LocalReAlloc #LocalFree #MapViewOfFile #MoveFileExW diff --git a/src/coreclr/src/dlls/mscordbi/CMakeLists.txt b/src/coreclr/src/dlls/mscordbi/CMakeLists.txt index b87b3eadb6a1..85f6cb6a7496 100644 --- a/src/coreclr/src/dlls/mscordbi/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscordbi/CMakeLists.txt @@ -10,6 +10,8 @@ if(CORECLR_SET_RPATH) endif(CLR_CMAKE_HOST_OSX) endif(CORECLR_SET_RPATH) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(MSCORDBI_SOURCES mscordbi.cpp ) @@ -50,7 +52,7 @@ else(CLR_CMAKE_HOST_WIN32) endif(CLR_CMAKE_HOST_WIN32) add_library_clr(mscordbi SHARED ${MSCORDBI_SOURCES}) -target_precompile_header(TARGET mscordbi HEADER stdafx.h) +target_precompile_headers(mscordbi PRIVATE $<$:stdafx.h>) if(CLR_CMAKE_HOST_UNIX) add_custom_target(mscordbi_exports DEPENDS ${EXPORTS_FILE}) @@ -118,4 +120,4 @@ if(FEATURE_SINGLE_FILE_DIAGNOSTICS) endif(FEATURE_SINGLE_FILE_DIAGNOSTICS) # add the install targets -install_clr(TARGETS mscordbi ADDITIONAL_DESTINATION sharedFramework) +install_clr(TARGETS mscordbi ADDITIONAL_DESTINATIONS sharedFramework) diff --git a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt index f01133ce40ff..11dee9f699a5 100644 --- a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -10,17 +10,15 @@ if (CLR_CMAKE_HOST_WIN32) list(APPEND CLR_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/coreclr.def) - add_link_options(/ENTRY:CoreDllMain) - # Incremental linking results in the linker inserting extra padding and routing function calls via thunks that can break the # invariants (e.g. size of region between Jit_PatchedCodeLast-Jit_PatchCodeStart needs to fit in a page). - add_link_options(/INCREMENTAL:NO) + add_linker_flag("/INCREMENTAL:NO") # Delay load libraries required for WinRT as that is not supported on all platforms - add_link_options("/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll") + add_linker_flag("/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll") # Delay load version.dll so that we can specify how to search when loading it as it is not part of Windows' known DLLs - add_link_options("/DELAYLOAD:version.dll") + add_linker_flag("/DELAYLOAD:version.dll") # No library groups for Win32 set(START_LIBRARY_GROUP) @@ -33,7 +31,7 @@ else(CLR_CMAKE_HOST_WIN32) if(CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_NETBSD OR CLR_CMAKE_TARGET_SUNOS) # This option is necessary to ensure that the overloaded delete operator defined inside # of the utilcode will be used instead of the standard library delete operator. - add_link_options("LINKER:-Bsymbolic") + add_linker_flag("-Wl,-Bsymbolic") # The following linked options can be inserted into the linker libraries list to # ensure proper resolving of circular references between a subset of the libraries. @@ -127,6 +125,7 @@ if(CLR_CMAKE_TARGET_WIN32) shlwapi.lib bcrypt.lib RuntimeObject.lib + delayimp.lib ) else() list(APPEND CORECLR_LIBRARIES @@ -168,8 +167,11 @@ if(FEATURE_MERGE_JIT_AND_ENGINE) set(CLRJIT_STATIC clrjit_static) endif(FEATURE_MERGE_JIT_AND_ENGINE) -target_link_libraries(coreclr PUBLIC ${CORECLR_LIBRARIES} ${CLRJIT_STATIC} cee_wks cee_wks_core) -target_link_libraries(coreclr_static PUBLIC ${CORECLR_LIBRARIES} clrjit_static cee_wks_mergeable cee_wks_core) +target_sources(coreclr PUBLIC $) +target_link_libraries(coreclr PUBLIC ${CORECLR_LIBRARIES} ${CLRJIT_STATIC} cee_wks) +target_sources(coreclr_static PUBLIC $) +target_link_libraries(coreclr_static PUBLIC ${CORECLR_LIBRARIES} clrjit_static cee_wks_mergeable) +target_compile_definitions(coreclr_static PUBLIC CORECLR_EMBEDDED) # Create the runtime module index header file containing the coreclr build id # for xplat and the timestamp/size on Windows. @@ -178,55 +180,49 @@ if(FEATURE_SINGLE_FILE_DIAGNOSTICS) endif(FEATURE_SINGLE_FILE_DIAGNOSTICS) if(CLR_CMAKE_TARGET_WIN32) - if (NOT CMAKE_GENERATOR MATCHES "Visual Studio .*") - add_custom_target(inject_debug_resources ALL COMMAND UNABLE_TO_EMBED_DAC_ON_WINDOWS_NON_VS_GENERATOR) - add_dependencies(inject_debug_resources coreclr mscordaccore mscordbi) + # Add dac table & debug resource to coreclr + get_include_directories(INC_DIR) + get_compile_definitions(PREPROCESS_DEFINITIONS) + list(APPEND INC_DIR -I${CLR_DIR}/src/vm -I${CLR_DIR}/src/vm/${ARCH_SOURCES_DIR} -I${CLR_DIR}/src/debug/ee -I${CLR_DIR}/src/gc) + list(APPEND PREPROCESS_DEFINITIONS -DDACCESS_COMPILE -DTARGET_64BIT) + + if (CLR_CMAKE_HOST_ARCH_AMD64) + list(APPEND PREPROCESS_DEFINITIONS -DTARGET_AMD64) + elseif (CLR_CMAKE_HOST_ARCH_ARM64) + list(APPEND PREPROCESS_DEFINITIONS -DTARGET_ARM64) + elseif (CLR_CMAKE_HOST_ARCH_ARM) + list(APPEND PREPROCESS_DEFINITIONS -DTARGET_ARM) + elseif (CLR_CMAKE_HOST_ARCH_I386) + list(APPEND PREPROCESS_DEFINITIONS -DTARGET_X86) else() - # Add dac table & debug resource to coreclr - get_include_directories(INC_DIR) - get_compile_definitions(PREPROCESS_DEFINITIONS) - list(APPEND INC_DIR -I${CLR_DIR}/src/vm -I${CLR_DIR}/src/vm/${ARCH_SOURCES_DIR} -I${CLR_DIR}/src/debug/ee -I${CLR_DIR}/src/gc) - list(APPEND PREPROCESS_DEFINITIONS -DDACCESS_COMPILE -DTARGET_64BIT) - - if (CLR_CMAKE_HOST_ARCH_AMD64) - list(APPEND PREPROCESS_DEFINITIONS -DTARGET_AMD64) - elseif (CLR_CMAKE_HOST_ARCH_ARM64) - list(APPEND PREPROCESS_DEFINITIONS -DTARGET_ARM64) - elseif (CLR_CMAKE_HOST_ARCH_ARM) - list(APPEND PREPROCESS_DEFINITIONS -DTARGET_ARM) - elseif (CLR_CMAKE_HOST_ARCH_I386) - list(APPEND PREPROCESS_DEFINITIONS -DTARGET_X86) - else() - clr_unknown_arch() - endif() - - - if (CLR_CMAKE_CROSS_ARCH) + clr_unknown_arch() + endif() + + + if (CLR_CMAKE_CROSS_ARCH) include(${CMAKE_INSTALL_PREFIX}/${CLR_CMAKE_CROSS_HOST_ARCH}/dactabletools/dactabletools.cmake) - endif() - - add_custom_command( - DEPENDS coreclr mscordaccore mscordbi ${CLR_DIR}/src/debug/daccess/daccess.cpp - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp - COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp - COMMAND dactablegen /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$/coreclr.pdb /dll:$ /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin - COMMAND InjectResource /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$ - COMMAND GenClrDebugResource /dac:$ /dbi:$ /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin - COMMAND InjectResource /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$ /name:CLRDEBUGINFO - COMMAND InjectResource /bin:${CMAKE_CURRENT_SOURCE_DIR}/dump_helper_resource.bin /dll:$ /name:MINIDUMP_AUXILIARY_PROVIDER - COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp - COMMENT Add dactable, debug resources, and dump helper resources to coreclr - ) - - if(NOT DEFINED CLR_CROSS_COMPONENTS_BUILD) - add_custom_target(inject_debug_resources ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp) - endif() endif() + add_custom_command( + DEPENDS coreclr mscordaccore mscordbi ${CLR_DIR}/src/debug/daccess/daccess.cpp + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp + COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp + COMMAND ${CLR_REPO_ROOT_DIR}/dotnet.cmd exec ${CMAKE_INSTALL_PREFIX}/DacTableGen/DacTableGen.dll /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:$ /dll:$ /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin + COMMAND InjectResource /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$ + COMMAND GenClrDebugResource /dac:$ /dbi:$ /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin + COMMAND InjectResource /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$ /name:CLRDEBUGINFO + COMMAND InjectResource /bin:${CMAKE_CURRENT_SOURCE_DIR}/dump_helper_resource.bin /dll:$ /name:MINIDUMP_AUXILIARY_PROVIDER + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp + COMMENT Add dactable, debug resources, and dump helper resources to coreclr + ) + + if(NOT DEFINED CLR_CROSS_COMPONENTS_BUILD) + add_custom_target(inject_debug_resources ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp) + endif() endif(CLR_CMAKE_TARGET_WIN32) # add the install targets -install_clr(TARGETS coreclr ADDITIONAL_DESTINATION sharedFramework) +install_clr(TARGETS coreclr ADDITIONAL_DESTINATIONS sharedFramework) # publish coreclr_static lib _install(TARGETS coreclr_static DESTINATION lib) diff --git a/src/coreclr/src/dlls/mscoree/coreclr/README.md b/src/coreclr/src/dlls/mscoree/coreclr/README.md index 0e291a87a3d4..b4f3e6f8845d 100644 --- a/src/coreclr/src/dlls/mscoree/coreclr/README.md +++ b/src/coreclr/src/dlls/mscoree/coreclr/README.md @@ -4,4 +4,4 @@ but if that changes we can always create a little nicer tooling for it. dump\_helper\_resource.bin is used to populate the DUMP\_HELPER resource inside coreclr.dll on Windows. When an application crashes, Windows MinidumpWriteDump is planning to scan modules looking for this resource. The content of the resource is expected to be the name of a dll in the same folder, encoded in UTF8, null terminated, that implements the CLRDataCreateInterface function. For OS security purposes MinidumpWriteDump will do an authenticode signing check before loading the indicated binary, however if your build isn't -signed you can get around this limitation by registering it at HKLM\Software\Microsoft\WindowsNT\CurrentVersion\MiniDumpAuxilliaryDlls. \ No newline at end of file +signed you can get around this limitation by registering it at HKLM\Software\Microsoft\WindowsNT\CurrentVersion\MiniDumpAuxilliaryDlls. diff --git a/src/coreclr/src/dlls/mscoree/mscoree.cpp b/src/coreclr/src/dlls/mscoree/mscoree.cpp index 810a3e88f3fe..c610e9e91a10 100644 --- a/src/coreclr/src/dlls/mscoree/mscoree.cpp +++ b/src/coreclr/src/dlls/mscoree/mscoree.cpp @@ -17,16 +17,13 @@ #include -// Globals -extern HINSTANCE g_hThisInst; +#if !defined(CROSSGEN_COMPILE) && !defined(CORECLR_EMBEDDED) -// Locals. BOOL STDMETHODCALLTYPE EEDllMain( // TRUE on success, FALSE on error. HINSTANCE hInst, // Instance handle of the loaded module. DWORD dwReason, // Reason for loading. - LPVOID lpReserved); // Unused. + LPVOID lpReserved); // Unused. -#ifndef CROSSGEN_COMPILE //***************************************************************************** // Handle lifetime of loaded library. //***************************************************************************** @@ -34,65 +31,9 @@ BOOL STDMETHODCALLTYPE EEDllMain( // TRUE on success, FALSE on error. #include #ifdef TARGET_WINDOWS - -#include // for __security_init_cookie() - -extern "C" BOOL WINAPI _CRT_INIT(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved); extern "C" BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved); - -// For the CoreClr, this is the real DLL entrypoint. We make ourselves the first entrypoint as -// we need to capture coreclr's hInstance before the C runtime initializes. This function -// will capture hInstance, let the C runtime initialize and then invoke the "classic" -// DllMain that initializes everything else. -extern "C" BOOL WINAPI CoreDllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved) -{ - STATIC_CONTRACT_NOTHROW; - - BOOL result; - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - // Make sure the /GS security cookie is initialized before we call anything else. - // BinScope detects the call to __security_init_cookie in its "Has Non-GS-friendly - // Initialization" check and makes it pass. - __security_init_cookie(); - - // It's critical that we initialize g_hmodCoreCLR before the CRT initializes. - // We have a lot of global ctors that will break if we let the CRT initialize without - // this step having been done. - - g_hmodCoreCLR = (HINSTANCE)hInstance; - - if (!(result = _CRT_INIT(hInstance, dwReason, lpReserved))) - { - // CRT_INIT may fail to initialize the CRT heap. Make sure we don't continue - // down a path that would trigger an AV and tear down the host process - break; - } - result = DllMain(hInstance, dwReason, lpReserved); - break; - - case DLL_THREAD_ATTACH: - _CRT_INIT(hInstance, dwReason, lpReserved); - result = DllMain(hInstance, dwReason, lpReserved); - break; - - case DLL_PROCESS_DETACH: // intentional fallthru - case DLL_THREAD_DETACH: - result = DllMain(hInstance, dwReason, lpReserved); - _CRT_INIT(hInstance, dwReason, lpReserved); - break; - - default: - result = FALSE; // it'd be an OS bug if we got here - not much we can do. - break; - } - return result; -} - #endif // TARGET_WINDOWS - extern "C" #ifdef TARGET_UNIX DLLEXPORT // For Win32 PAL LoadLibrary emulation @@ -101,45 +42,13 @@ BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved) { STATIC_CONTRACT_NOTHROW; - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - { -#ifndef TARGET_WINDOWS - g_hmodCoreCLR = (HINSTANCE)hInstance; -#endif - - // Save the module handle. - g_hThisInst = (HINSTANCE)hInstance; - - // Prevent buffer-overruns - // If buffer is overrun, it is possible the saved callback has been trashed. - // The callback is unsafe. - //SetBufferOverrunHandler(); - if (!EEDllMain((HINSTANCE)hInstance, dwReason, lpReserved)) - { - return FALSE; - } - } - break; - - case DLL_PROCESS_DETACH: - { - EEDllMain((HINSTANCE)hInstance, dwReason, lpReserved); - } - break; - - case DLL_THREAD_DETACH: - { - EEDllMain((HINSTANCE)hInstance, dwReason, lpReserved); - } - break; - } - - return TRUE; + return EEDllMain((HINSTANCE)hInstance, dwReason, lpReserved); } -#endif // CROSSGEN_COMPILE +#endif // !defined(CROSSGEN_COMPILE) && !defined(CORECLR_EMBEDDED) + +// Globals +extern HINSTANCE g_hThisInst; HINSTANCE GetModuleInst() { @@ -444,7 +353,7 @@ HRESULT SetInternalSystemDirectory() } #if defined(CROSSGEN_COMPILE) -void SetMscorlibPath(LPCWSTR wzSystemDirectory) +void SetCoreLibPath(LPCWSTR wzSystemDirectory) { DWORD len = (DWORD)wcslen(wzSystemDirectory); bool appendSeparator = wzSystemDirectory[len-1] != DIRECTORY_SEPARATOR_CHAR_W; diff --git a/src/coreclr/src/dlls/mscoree/unixinterface.cpp b/src/coreclr/src/dlls/mscoree/unixinterface.cpp index def877265312..e23ece987224 100644 --- a/src/coreclr/src/dlls/mscoree/unixinterface.cpp +++ b/src/coreclr/src/dlls/mscoree/unixinterface.cpp @@ -27,6 +27,9 @@ typedef NewArrayHolder ConstWStringHolder; // Specifies whether coreclr is embedded or standalone extern bool g_coreclr_embedded; +// Specifies whether hostpolicy is embedded in executable or standalone +extern bool g_hostpolicy_embedded; + // Holder for array of wide strings class ConstWStringArrayHolder : public NewArrayHolder { @@ -116,7 +119,8 @@ static void ConvertConfigPropertiesToUnicode( int propertyCount, LPCWSTR** propertyKeysWRef, LPCWSTR** propertyValuesWRef, - BundleProbe** bundleProbe) + BundleProbe** bundleProbe, + bool* hostPolicyEmbedded) { LPCWSTR* propertyKeysW = new (nothrow) LPCWSTR[propertyCount]; ASSERTE_ALL_BUILDS(propertyKeysW != nullptr); @@ -135,6 +139,11 @@ static void ConvertConfigPropertiesToUnicode( // is passed in as the value of "BUNDLE_PROBE" property (encoded as a string). *bundleProbe = (BundleProbe*)_wcstoui64(propertyValuesW[propertyIndex], nullptr, 0); } + else if (strcmp(propertyKeys[propertyIndex], "HOSTPOLICY_EMBEDDED") == 0) + { + // The HOSTPOLICY_EMBEDDED property indicates if the executable has hostpolicy statically linked in + *hostPolicyEmbedded = (wcscmp(propertyValuesW[propertyIndex], W("true")) == 0); + } } *propertyKeysWRef = propertyKeysW; @@ -177,6 +186,7 @@ int coreclr_initialize( LPCWSTR* propertyKeysW; LPCWSTR* propertyValuesW; BundleProbe* bundleProbe = nullptr; + bool hostPolicyEmbedded = false; ConvertConfigPropertiesToUnicode( propertyKeys, @@ -184,7 +194,8 @@ int coreclr_initialize( propertyCount, &propertyKeysW, &propertyValuesW, - &bundleProbe); + &bundleProbe, + &hostPolicyEmbedded); #ifdef TARGET_UNIX DWORD error = PAL_InitializeCoreCLR(exePath, g_coreclr_embedded); @@ -198,6 +209,8 @@ int coreclr_initialize( } #endif + g_hostpolicy_embedded = hostPolicyEmbedded; + ReleaseHolder host; hr = CorHost2::CreateObject(IID_ICLRRuntimeHost4, (void**)&host); diff --git a/src/coreclr/src/dlls/mscorpe/ceefilegenwriter.cpp b/src/coreclr/src/dlls/mscorpe/ceefilegenwriter.cpp index 77afa5a83024..0fb18b0629b2 100644 --- a/src/coreclr/src/dlls/mscorpe/ceefilegenwriter.cpp +++ b/src/coreclr/src/dlls/mscorpe/ceefilegenwriter.cpp @@ -12,10 +12,168 @@ #include #include "corerror.h" -#include "stubs.h" #include #include +// The following block contains a template for the default entry point stubs of a COM+ +// IL only program. One can emit these stubs (with some fix-ups) and make +// the code supplied the entry point value for the image. The fix-ups will +// in turn cause mscoree.dll to be loaded and the correct entry point to be +// called. +// +// Note: Although these stubs contain x86 specific code, they are used +// for all platforms + + +//***************************************************************************** +// This stub is designed for a x86 Windows application. It will call the +// _CorExeMain function in mscoree.dll. This entry point will in turn load +// and run the IL program. +// +// jump _CorExeMain(); +// +// The code jumps to the imported function _CorExeMain using the iat. +// The address in the template is address of the iat entry which is +// fixed up by the loader when the image is paged in. +//***************************************************************************** + +const BYTE ExeMainX86Template[] = +{ + // Jump through IAT to _CorExeMain + 0xFF, 0x25, // jmp [iat:_CorDllMain entry] + 0x00, 0x00, 0x00, 0x00, // address to replace + +}; + +#define ExeMainX86TemplateSize sizeof(ExeMainX86Template) +#define CorExeMainX86IATOffset 2 + +//***************************************************************************** +// This stub is designed for a x86 Windows application. It will call the +// _CorDllMain function in mscoree.dll with with the base entry point for +// the loaded DLL. This entry point will in turn load and run the IL program. +// +// jump _CorDllMain +// +// The code jumps to the imported function _CorExeMain using the iat. +// The address in the template is address of the iat entry which is +// fixed up by the loader when the image is paged in. +//***************************************************************************** + +const BYTE DllMainX86Template[] = +{ + // Jump through IAT to CorDllMain + 0xFF, 0x25, // jmp [iat:_CorDllMain entry] + 0x00, 0x00, 0x00, 0x00, // address to replace +}; + +#define DllMainX86TemplateSize sizeof(DllMainX86Template) +#define CorDllMainX86IATOffset 2 + +//***************************************************************************** +// This stub is designed for a AMD64 Windows application. It will call the +// _CorExeMain function in mscoree.dll. This entry point will in turn load +// and run the IL program. +// +// mov rax, _CorExeMain(); +// jmp [rax] +// +// The code jumps to the imported function _CorExeMain using the iat. +// The address in the template is address of the iat entry which is +// fixed up by the loader when the image is paged in. +//***************************************************************************** + +const BYTE ExeMainAMD64Template[] = +{ + // Jump through IAT to _CorExeMain + 0x48, 0xA1, // rex.w rex.b mov rax,[following address] + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//address of iat:_CorExeMain entry + 0xFF, 0xE0 // jmp [rax] +}; + +#define ExeMainAMD64TemplateSize sizeof(ExeMainAMD64Template) +#define CorExeMainAMD64IATOffset 2 + +//***************************************************************************** +// This stub is designed for a AMD64 Windows application. It will call the +// _CorDllMain function in mscoree.dll with with the base entry point for +// the loaded DLL. This entry point will in turn load and run the IL program. +// +// mov rax, _CorDllMain(); +// jmp [rax] +// +// The code jumps to the imported function _CorDllMain using the iat. +// The address in the template is address of the iat entry which is +// fixed up by the loader when the image is paged in. +//***************************************************************************** + +const BYTE DllMainAMD64Template[] = +{ + // Jump through IAT to CorDllMain + 0x48, 0xA1, // rex.w rex.b mov rax,[following address] + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//address of iat:_CorDllMain entry + 0xFF, 0xE0 // jmp [rax] +}; + +#define DllMainAMD64TemplateSize sizeof(DllMainAMD64Template) +#define CorDllMainAMD64IATOffset 2 + +//***************************************************************************** +// This stub is designed for an ia64 Windows application. It will call the +// _CorExeMain function in mscoree.dll. This entry point will in turn load +// and run the IL program. +// +// jump _CorExeMain(); +// +// The code jumps to the imported function _CorExeMain using the iat. +// We set the value of gp to point at the iat table entry for _CorExeMain +//***************************************************************************** + +const BYTE ExeMainIA64Template[] = +{ + // ld8 r9 = [gp] ;; + // ld8 r10 = [r9],8 + // nop.i ;; + // ld8 gp = [r9] + // mov b6 = r10 + // br.cond.sptk.few b6 + // + 0x0B, 0x48, 0x00, 0x02, 0x18, 0x10, 0xA0, 0x40, + 0x24, 0x30, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, + 0x10, 0x08, 0x00, 0x12, 0x18, 0x10, 0x60, 0x50, + 0x04, 0x80, 0x03, 0x00, 0x60, 0x00, 0x80, 0x00 +}; + +#define ExeMainIA64TemplateSize sizeof(ExeMainIA64Template) + +//***************************************************************************** +// This stub is designed for an ia64 Windows application. It will call the +// _CorDllMain function in mscoree.dll with with the base entry point for +// the loaded DLL. This entry point will in turn load and run the IL program. +// +// jump _CorDllMain +// +// The code jumps to the imported function _CorExeMain using the iat. +// We set the value of gp to point at the iat table entry for _CorExeMain +//***************************************************************************** + +const BYTE DllMainIA64Template[] = +{ + // ld8 r9 = [gp] ;; + // ld8 r10 = [r9],8 + // nop.i ;; + // ld8 gp = [r9] + // mov b6 = r10 + // br.cond.sptk.few b6 + // + 0x0B, 0x48, 0x00, 0x02, 0x18, 0x10, 0xA0, 0x40, + 0x24, 0x30, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, + 0x10, 0x08, 0x00, 0x12, 0x18, 0x10, 0x60, 0x50, + 0x04, 0x80, 0x03, 0x00, 0x60, 0x00, 0x80, 0x00 +}; + +#define DllMainIA64TemplateSize sizeof(DllMainIA64Template) + #ifdef EMIT_FIXUPS // Emitted PEFIXUP structure looks like this diff --git a/src/coreclr/src/dlls/mscorpe/stubs.h b/src/coreclr/src/dlls/mscorpe/stubs.h deleted file mode 100644 index f0e7ce380df3..000000000000 --- a/src/coreclr/src/dlls/mscorpe/stubs.h +++ /dev/null @@ -1,168 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// Stubs.h -// -// This file contains a template for the default entry point stubs of a COM+ -// IL only program. One can emit these stubs (with some fix-ups) and make -// the code supplied the entry point value for the image. The fix-ups will -// in turn cause mscoree.dll to be loaded and the correct entry point to be -// called. -// -// Note: Although these stubs contain x86 specific code, they are used -// for all platforms -// -//***************************************************************************** -#ifndef __STUBS_H__ -#define __STUBS_H__ - -//***************************************************************************** -// This stub is designed for a x86 Windows application. It will call the -// _CorExeMain function in mscoree.dll. This entry point will in turn load -// and run the IL program. -// -// jump _CorExeMain(); -// -// The code jumps to the imported function _CorExeMain using the iat. -// The address in the template is address of the iat entry which is -// fixed up by the loader when the image is paged in. -//***************************************************************************** - -constexpr BYTE ExeMainX86Template[] = -{ - // Jump through IAT to _CorExeMain - 0xFF, 0x25, // jmp [iat:_CorDllMain entry] - 0x00, 0x00, 0x00, 0x00, // address to replace - -}; - -#define ExeMainX86TemplateSize sizeof(ExeMainX86Template) -#define CorExeMainX86IATOffset 2 - -//***************************************************************************** -// This stub is designed for a x86 Windows application. It will call the -// _CorDllMain function in mscoree.dll with with the base entry point for -// the loaded DLL. This entry point will in turn load and run the IL program. -// -// jump _CorDllMain -// -// The code jumps to the imported function _CorExeMain using the iat. -// The address in the template is address of the iat entry which is -// fixed up by the loader when the image is paged in. -//***************************************************************************** - -constexpr BYTE DllMainX86Template[] = -{ - // Jump through IAT to CorDllMain - 0xFF, 0x25, // jmp [iat:_CorDllMain entry] - 0x00, 0x00, 0x00, 0x00, // address to replace -}; - -#define DllMainX86TemplateSize sizeof(DllMainX86Template) -#define CorDllMainX86IATOffset 2 - -//***************************************************************************** -// This stub is designed for a AMD64 Windows application. It will call the -// _CorExeMain function in mscoree.dll. This entry point will in turn load -// and run the IL program. -// -// mov rax, _CorExeMain(); -// jmp [rax] -// -// The code jumps to the imported function _CorExeMain using the iat. -// The address in the template is address of the iat entry which is -// fixed up by the loader when the image is paged in. -//***************************************************************************** - -constexpr BYTE ExeMainAMD64Template[] = -{ - // Jump through IAT to _CorExeMain - 0x48, 0xA1, // rex.w rex.b mov rax,[following address] - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//address of iat:_CorExeMain entry - 0xFF, 0xE0 // jmp [rax] -}; - -#define ExeMainAMD64TemplateSize sizeof(ExeMainAMD64Template) -#define CorExeMainAMD64IATOffset 2 - -//***************************************************************************** -// This stub is designed for a AMD64 Windows application. It will call the -// _CorDllMain function in mscoree.dll with with the base entry point for -// the loaded DLL. This entry point will in turn load and run the IL program. -// -// mov rax, _CorDllMain(); -// jmp [rax] -// -// The code jumps to the imported function _CorDllMain using the iat. -// The address in the template is address of the iat entry which is -// fixed up by the loader when the image is paged in. -//***************************************************************************** - -constexpr BYTE DllMainAMD64Template[] = -{ - // Jump through IAT to CorDllMain - 0x48, 0xA1, // rex.w rex.b mov rax,[following address] - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//address of iat:_CorDllMain entry - 0xFF, 0xE0 // jmp [rax] -}; - -#define DllMainAMD64TemplateSize sizeof(DllMainAMD64Template) -#define CorDllMainAMD64IATOffset 2 - -//***************************************************************************** -// This stub is designed for an ia64 Windows application. It will call the -// _CorExeMain function in mscoree.dll. This entry point will in turn load -// and run the IL program. -// -// jump _CorExeMain(); -// -// The code jumps to the imported function _CorExeMain using the iat. -// We set the value of gp to point at the iat table entry for _CorExeMain -//***************************************************************************** - -constexpr BYTE ExeMainIA64Template[] = -{ - // ld8 r9 = [gp] ;; - // ld8 r10 = [r9],8 - // nop.i ;; - // ld8 gp = [r9] - // mov b6 = r10 - // br.cond.sptk.few b6 - // - 0x0B, 0x48, 0x00, 0x02, 0x18, 0x10, 0xA0, 0x40, - 0x24, 0x30, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x10, 0x08, 0x00, 0x12, 0x18, 0x10, 0x60, 0x50, - 0x04, 0x80, 0x03, 0x00, 0x60, 0x00, 0x80, 0x00 -}; - -#define ExeMainIA64TemplateSize sizeof(ExeMainIA64Template) - -//***************************************************************************** -// This stub is designed for an ia64 Windows application. It will call the -// _CorDllMain function in mscoree.dll with with the base entry point for -// the loaded DLL. This entry point will in turn load and run the IL program. -// -// jump _CorDllMain -// -// The code jumps to the imported function _CorExeMain using the iat. -// We set the value of gp to point at the iat table entry for _CorExeMain -//***************************************************************************** - -constexpr BYTE DllMainIA64Template[] = -{ - // ld8 r9 = [gp] ;; - // ld8 r10 = [r9],8 - // nop.i ;; - // ld8 gp = [r9] - // mov b6 = r10 - // br.cond.sptk.few b6 - // - 0x0B, 0x48, 0x00, 0x02, 0x18, 0x10, 0xA0, 0x40, - 0x24, 0x30, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x10, 0x08, 0x00, 0x12, 0x18, 0x10, 0x60, 0x50, - 0x04, 0x80, 0x03, 0x00, 0x60, 0x00, 0x80, 0x00 -}; - -#define DllMainIA64TemplateSize sizeof(DllMainIA64Template) - -#endif // __STUBS_H__ diff --git a/src/coreclr/src/dlls/mscorrc/CMakeLists.txt b/src/coreclr/src/dlls/mscorrc/CMakeLists.txt index ed5ee8876508..040b12a240a2 100644 --- a/src/coreclr/src/dlls/mscorrc/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscorrc/CMakeLists.txt @@ -15,11 +15,13 @@ if(CLR_CMAKE_HOST_WIN32) include.rc ) - install_clr(TARGETS mscorrc ADDITIONAL_DESTINATION sharedFramework) + install_clr(TARGETS mscorrc ADDITIONAL_DESTINATIONS sharedFramework) else() build_resources(${CMAKE_CURRENT_SOURCE_DIR}/include.rc mscorrc TARGET_CPP_FILE) - add_library_clr(mscorrc OBJECT + add_library_clr(mscorrc_obj OBJECT ${TARGET_CPP_FILE} ) + add_library(mscorrc INTERFACE) + target_sources(mscorrc INTERFACE $) endif(CLR_CMAKE_HOST_WIN32) diff --git a/src/coreclr/src/dlls/mscorrc/mscorrc.rc b/src/coreclr/src/dlls/mscorrc/mscorrc.rc index a50f742cef00..360442044ca4 100644 --- a/src/coreclr/src/dlls/mscorrc/mscorrc.rc +++ b/src/coreclr/src/dlls/mscorrc/mscorrc.rc @@ -182,6 +182,7 @@ BEGIN IDS_EE_NDIRECT_UNSUPPORTED_SIG "Method's type signature is not PInvoke compatible." IDS_EE_COM_UNSUPPORTED_SIG "Method's type signature is not Interop compatible." IDS_EE_COM_UNSUPPORTED_TYPE "The method returned a COM Variant type that is not Interop compatible." + IDS_EE_MULTIPLE_CALLCONV_UNSUPPORTED "Multiple unmanaged calling conventions are specified. Only a single calling convention is supported." IDS_EE_NDIRECT_BADNATL "Invalid PInvoke or UnmanagedFunctionPointer metadata format." IDS_EE_NDIRECT_BADNATL_CALLCONV "Invalid PInvoke or UnmanagedFunctionPointer calling convention." IDS_EE_NDIRECT_BADNATL_VARARGS_CALLCONV "Invalid PInvoke calling convention. Vararg functions must use the cdecl calling convention." diff --git a/src/coreclr/src/dlls/mscorrc/resource.h b/src/coreclr/src/dlls/mscorrc/resource.h index 738b751c7fae..b78c5d84c304 100644 --- a/src/coreclr/src/dlls/mscorrc/resource.h +++ b/src/coreclr/src/dlls/mscorrc/resource.h @@ -43,6 +43,7 @@ #define IDS_EE_COM_UNSUPPORTED_SIG 0x170d #define IDS_EE_NOSYNCHRONIZED 0x170f #define IDS_EE_NDIRECT_BADNATL_THISCALL 0x1710 +#define IDS_EE_MULTIPLE_CALLCONV_UNSUPPORTED 0x1711 #define IDS_EE_LOAD_BAD_MAIN_SIG 0x1712 #define IDS_EE_COM_UNSUPPORTED_TYPE 0x1713 diff --git a/src/coreclr/src/gc/CMakeLists.txt b/src/coreclr/src/gc/CMakeLists.txt index c46f46fdfbae..c68bbcefc347 100644 --- a/src/coreclr/src/gc/CMakeLists.txt +++ b/src/coreclr/src/gc/CMakeLists.txt @@ -1,11 +1,11 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) -# Local GC meta-issue: https://github.com/dotnet/coreclr/issues/11518 +# Local GC meta-issue: https://github.com/dotnet/runtime/issues/8061 -# https://github.com/dotnet/coreclr/issues/11516 +# https://github.com/dotnet/runtime/issues/8059 remove_definitions(-DSTRESS_HEAP) -# https://github.com/dotnet/coreclr/issues/11519 +# https://github.com/dotnet/runtime/issues/8062 remove_definitions(-DWRITE_BARRIER_CHECK) set( GC_SOURCES @@ -42,7 +42,7 @@ endif(CLR_CMAKE_HOST_UNIX) if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) set ( GC_SOURCES ${GC_SOURCES} - vxsort/isa_detection_dummy.cpp + vxsort/isa_detection.cpp vxsort/do_vxsort_avx2.cpp vxsort/do_vxsort_avx512.cpp vxsort/machine_traits.avx2.cpp @@ -50,6 +50,7 @@ if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp + vxsort/smallsort/avx2_load_mask_tables.cpp ) endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) @@ -112,7 +113,7 @@ target_link_libraries(clrgc ${GC_LINK_LIBRARIES}) install_clr(TARGETS clrgc) if(CLR_CMAKE_HOST_UNIX) - # dprintf causes many warnings (https://github.com/dotnet/coreclr/issues/13367) + # dprintf causes many warnings (https://github.com/dotnet/runtime/issues/8737) add_compile_options(-Wno-format) endif(CLR_CMAKE_HOST_UNIX) diff --git a/src/coreclr/src/gc/env/gcenv.ee.h b/src/coreclr/src/gc/env/gcenv.ee.h index 986acabacbec..d596575ad2b4 100644 --- a/src/coreclr/src/gc/env/gcenv.ee.h +++ b/src/coreclr/src/gc/env/gcenv.ee.h @@ -86,7 +86,7 @@ class GCToEEInterface static uint32_t GetTotalNumSizedRefHandles(); static bool AnalyzeSurvivorsRequested(int condemnedGeneration); - static void AnalyzeSurvivorsFinished(int condemnedGeneration); + static void AnalyzeSurvivorsFinished(size_t gcIndex, int condemnedGeneration, uint64_t promoted_bytes, void (*reportGenerationBounds)()); static void VerifySyncTableEntry(); static void UpdateGCEventStatus(int publicLevel, int publicKeywords, int privateLevel, int privateKeywords); diff --git a/src/coreclr/src/gc/env/gcenv.object.h b/src/coreclr/src/gc/env/gcenv.object.h index c5c6d42fd641..9bbdbe912447 100644 --- a/src/coreclr/src/gc/env/gcenv.object.h +++ b/src/coreclr/src/gc/env/gcenv.object.h @@ -164,7 +164,11 @@ class Object MethodTable * GetGCSafeMethodTable() const { +#ifdef HOST_64BIT + return (MethodTable *)((uintptr_t)m_pMethTab & ~7); +#else return (MethodTable *)((uintptr_t)m_pMethTab & ~3); +#endif //HOST_64BIT } void RawSetMethodTable(MethodTable * pMT) diff --git a/src/coreclr/src/gc/env/gcenv.os.h b/src/coreclr/src/gc/env/gcenv.os.h index 3dee37ad8e54..f8724fc8687a 100644 --- a/src/coreclr/src/gc/env/gcenv.os.h +++ b/src/coreclr/src/gc/env/gcenv.os.h @@ -290,7 +290,7 @@ class GCToOSInterface // size - size of the virtual memory range // Return: // Address of the allocated memory - static void* VirtualReserveAndCommitLargePages(size_t size); + static void* VirtualReserveAndCommitLargePages(size_t size, uint16_t node = NUMA_NODE_UNDEFINED); // Decomit virtual memory range. // Parameters: diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp index 6bf8e51a6bce..9f022df84657 100644 --- a/src/coreclr/src/gc/gc.cpp +++ b/src/coreclr/src/gc/gc.cpp @@ -53,6 +53,9 @@ BOOL bgc_heap_walk_for_etw_p = FALSE; #define MAX_PTR ((uint8_t*)(~(ptrdiff_t)0)) #define commit_min_th (16*OS_PAGE_SIZE) +#define MIN_SOH_CROSS_GEN_REFS (400) +#define MIN_LOH_CROSS_GEN_REFS (800) + static size_t smoothed_desired_per_heap = 0; #ifdef SERVER_GC @@ -197,10 +200,10 @@ gc_oh_num gen_to_oh(int gen) { switch (gen) { - case soh_gen0: + case soh_gen0: return gc_oh_num::soh; case soh_gen1: - return gc_oh_num::soh; + return gc_oh_num::soh; case soh_gen2: return gc_oh_num::soh; case loh_generation: @@ -445,7 +448,7 @@ void log_va_msg(const char *fmt, va_list args) { gc_log_lock.Enter(); - const int BUFFERSIZE = 512; + const int BUFFERSIZE = 4096; static char rgchBuffer[BUFFERSIZE]; char * pBuffer = &rgchBuffer[0]; @@ -1213,7 +1216,7 @@ class exclusive_sync void uoh_alloc_done_with_index (int index) { dprintf (3, ("uoh alloc: release lock on %Ix based on %d", (uint8_t *)alloc_objects[index], index)); - assert ((index >= 0) && (index < max_pending_allocs)); + assert ((index >= 0) && (index < max_pending_allocs)); alloc_objects[index] = (uint8_t*)0; } @@ -1984,6 +1987,8 @@ void stomp_write_barrier_resize(bool is_runtime_suspended, bool requires_upper_b void stomp_write_barrier_ephemeral(uint8_t* ephemeral_low, uint8_t* ephemeral_high) { + initGCShadow(); + WriteBarrierParameters args = {}; args.operation = WriteBarrierOp::StompEphemeral; args.is_runtime_suspended = true; @@ -2021,7 +2026,7 @@ void stomp_write_barrier_initialize(uint8_t* ephemeral_low, uint8_t* ephemeral_h // Things we need to manually initialize: // gen0 min_size - based on cache // gen0/1 max_size - based on segment size -static static_data static_data_table[latency_level_last - latency_level_first + 1][total_generation_count] = +static static_data static_data_table[latency_level_last - latency_level_first + 1][total_generation_count] = { // latency_level_memory_footprint { @@ -2089,7 +2094,7 @@ void qsort1(uint8_t** low, uint8_t** high, unsigned int depth); #endif //USE_INTROSORT void* virtual_alloc (size_t size); -void* virtual_alloc (size_t size, bool use_large_pages_p); +void* virtual_alloc (size_t size, bool use_large_pages_p, uint16_t numa_node = NUMA_NODE_UNDEFINED); /* per heap static initialization */ #if defined(BACKGROUND_GC) && !defined(MULTIPLE_HEAPS) @@ -2182,6 +2187,8 @@ size_t gc_heap::current_total_committed_bookkeeping = 0; double gc_heap::short_plugs_pad_ratio = 0; #endif //SHORT_PLUGS +int gc_heap::generation_skip_ratio_threshold = 0; + uint64_t gc_heap::suspended_start_time = 0; uint64_t gc_heap::end_gc_time = 0; uint64_t gc_heap::total_suspended_time = 0; @@ -2271,6 +2278,12 @@ uint32_t gc_heap::fgn_maxgen_percent = 0; size_t gc_heap::fgn_last_alloc = 0; int gc_heap::generation_skip_ratio = 100; +#ifdef FEATURE_CARD_MARKING_STEALING +VOLATILE(size_t) gc_heap::n_eph_soh = 0; +VOLATILE(size_t) gc_heap::n_gen_soh = 0; +VOLATILE(size_t) gc_heap::n_eph_loh = 0; +VOLATILE(size_t) gc_heap::n_gen_loh = 0; +#endif //FEATURE_CARD_MARKING_STEALING uint64_t gc_heap::loh_alloc_since_cg = 0; @@ -2285,6 +2298,9 @@ uint8_t* gc_heap::background_saved_lowest_address = 0; uint8_t* gc_heap::background_saved_highest_address = 0; uint8_t* gc_heap::next_sweep_obj = 0; uint8_t* gc_heap::current_sweep_pos = 0; +#ifdef DOUBLY_LINKED_FL +heap_segment* gc_heap::current_sweep_seg = 0; +#endif //DOUBLY_LINKED_FL exclusive_sync* gc_heap::bgc_alloc_lock; #endif //BACKGROUND_GC @@ -2597,6 +2613,11 @@ alloc_list gc_heap::loh_alloc_list [NUM_LOH_ALIST-1]; alloc_list gc_heap::gen2_alloc_list[NUM_GEN2_ALIST-1]; alloc_list gc_heap::poh_alloc_list [NUM_POH_ALIST-1]; +#ifdef DOUBLY_LINKED_FL +// size we removed with no undo; only for recording purpose +size_t gc_heap::gen2_removed_no_undo = 0; +#endif //DOUBLY_LINKED_FL + dynamic_data gc_heap::dynamic_data_table [total_generation_count]; gc_history_per_heap gc_heap::gc_data_per_heap; size_t gc_heap::maxgen_pinned_compact_before_advance = 0; @@ -3039,7 +3060,7 @@ gc_heap::dt_low_card_table_efficiency_p (gc_tuning_point tp) /* promote into max-generation if the card table has too many * generation faults besides the n -> 0 */ - ret = (generation_skip_ratio < 30); + ret = (generation_skip_ratio < generation_skip_ratio_threshold); break; } @@ -3604,10 +3625,43 @@ heap_segment* seg_mapping_table_segment_of (uint8_t* o) size_t gcard_of ( uint8_t*); #define GC_MARKED (size_t)0x1 +#ifdef DOUBLY_LINKED_FL +// This bit indicates that we'll need to set the bgc mark bit for this object during an FGC. +// We only do this when we decide to compact. +#define BGC_MARKED_BY_FGC (size_t)0x2 +#define MAKE_FREE_OBJ_IN_COMPACT (size_t)0x4 +#endif //DOUBLY_LINKED_FL + #define slot(i, j) ((uint8_t**)(i))[(j)+1] #define free_object_base_size (plug_skew + sizeof(ArrayBase)) +#define free_list_slot(x) ((uint8_t**)(x))[2] +#define free_list_undo(x) ((uint8_t**)(x))[-1] +#define UNDO_EMPTY ((uint8_t*)1) + +#ifdef DOUBLY_LINKED_FL +#define free_list_prev(x) ((uint8_t**)(x))[3] +#define PREV_EMPTY ((uint8_t*)1) + +void check_and_clear_in_free_list (uint8_t* o, size_t size) +{ + if (size >= min_free_list) + { + free_list_prev (o) = PREV_EMPTY; + } +} +// This is used when we need to clear the prev bit for a free object we made because we know +// it's not actually a free obj (it's just a temporary thing during allocation). +void clear_prev_bit (uint8_t* o, size_t size) +{ + if (size >= min_free_list) + { + free_list_prev (o) = 0; + } +} +#endif //DOUBLY_LINKED_FL + class CObjectHeader : public Object { public: @@ -3678,7 +3732,11 @@ class CObjectHeader : public Object MethodTable *GetMethodTable() const { - return( (MethodTable *) (((size_t) RawGetMethodTable()) & (~(GC_MARKED)))); + return( (MethodTable *) (((size_t) RawGetMethodTable()) & (~(GC_MARKED +#ifdef DOUBLY_LINKED_FL + | BGC_MARKED_BY_FGC | MAKE_FREE_OBJ_IN_COMPACT +#endif //DOUBLY_LINKED_FL + )))); } void SetMarked() @@ -3703,10 +3761,43 @@ class CObjectHeader : public Object return !!((((CObjectHeader*)this)->GetHeader()->GetBits()) & BIT_SBLK_GC_RESERVE); } + // Now we set more bits should actually only clear the mark bit void ClearMarked() { - RawSetMethodTable( GetMethodTable() ); +#ifdef DOUBLY_LINKED_FL + RawSetMethodTable ((MethodTable *)(((size_t) RawGetMethodTable()) & (~GC_MARKED))); +#else + RawSetMethodTable (GetMethodTable()); +#endif //DOUBLY_LINKED_FL + } + +#ifdef DOUBLY_LINKED_FL + void SetBGCMarkBit() + { + RawSetMethodTable((MethodTable *) (((size_t) RawGetMethodTable()) | BGC_MARKED_BY_FGC)); + } + BOOL IsBGCMarkBitSet() const + { + return !!(((size_t)RawGetMethodTable()) & BGC_MARKED_BY_FGC); + } + void ClearBGCMarkBit() + { + RawSetMethodTable((MethodTable *)(((size_t) RawGetMethodTable()) & (~BGC_MARKED_BY_FGC))); + } + + void SetFreeObjInCompactBit() + { + RawSetMethodTable((MethodTable *) (((size_t) RawGetMethodTable()) | MAKE_FREE_OBJ_IN_COMPACT)); + } + BOOL IsFreeObjInCompactBitSet() const + { + return !!(((size_t)RawGetMethodTable()) & MAKE_FREE_OBJ_IN_COMPACT); + } + void ClearFreeObjInCompactBit() + { + RawSetMethodTable((MethodTable *)(((size_t) RawGetMethodTable()) & (~MAKE_FREE_OBJ_IN_COMPACT))); } +#endif //DOUBLY_LINKED_FL CGCDesc *GetSlotMap () { @@ -3730,8 +3821,26 @@ class CObjectHeader : public Object //((void**) this)[-1] = 0; // clear the sync block, assert (*numComponentsPtr >= 0); if (GCConfig::GetHeapVerifyLevel() & GCConfig::HEAPVERIFY_GC) + { memset (((uint8_t*)this)+sizeof(ArrayBase), 0xcc, *numComponentsPtr); +#ifdef DOUBLY_LINKED_FL + // However, in this case we can't leave the Next field uncleared because no one will clear it + // so it remains 0xcc and that's not good for verification + if (*numComponentsPtr > 0) + { + free_list_slot (this) = 0; + } +#endif //DOUBLY_LINKED_FL + } #endif //VERIFY_HEAP + +#ifdef DOUBLY_LINKED_FL + // For background GC, we need to distinguish between a free object that's not on the free list + // and one that is. So we always set its prev to PREV_EMPTY to indicate that it's a free + // object that's not on the free list. If it should be on the free list, it will be set to the + // appropriate non zero value. + check_and_clear_in_free_list ((uint8_t*)this, size); +#endif //DOUBLY_LINKED_FL } void UnsetFree() @@ -3782,9 +3891,57 @@ class CObjectHeader : public Object #define header(i) ((CObjectHeader*)(i)) -#define free_list_slot(x) ((uint8_t**)(x))[2] -#define free_list_undo(x) ((uint8_t**)(x))[-1] -#define UNDO_EMPTY ((uint8_t*)1) +#ifdef DOUBLY_LINKED_FL +inline +BOOL is_on_free_list (uint8_t* o, size_t size) +{ + if (size >= min_free_list) + { + if (header(o)->GetMethodTable() == g_gc_pFreeObjectMethodTable) + { + return (free_list_prev (o) != PREV_EMPTY); + } + } + + return FALSE; +} + +inline +void set_plug_bgc_mark_bit (uint8_t* node) +{ + header(node)->SetBGCMarkBit(); +} + +inline +BOOL is_plug_bgc_mark_bit_set (uint8_t* node) +{ + return header(node)->IsBGCMarkBitSet(); +} + +inline +void clear_plug_bgc_mark_bit (uint8_t* node) +{ + header(node)->ClearBGCMarkBit(); +} + +inline +void set_free_obj_in_compact_bit (uint8_t* node) +{ + header(node)->SetFreeObjInCompactBit(); +} + +inline +BOOL is_free_obj_in_compact_bit_set (uint8_t* node) +{ + return header(node)->IsFreeObjInCompactBitSet(); +} + +inline +void clear_free_obj_in_compact_bit (uint8_t* node) +{ + header(node)->ClearFreeObjInCompactBit(); +} +#endif //DOUBLY_LINKED_FL #ifdef SHORT_PLUGS inline @@ -3914,6 +4071,14 @@ struct imemory_data uint8_t* memory_base; }; +struct numa_reserved_block +{ + uint8_t* memory_base; + size_t block_size; + + numa_reserved_block() : memory_base(nullptr), block_size(0) { } +}; + struct initial_memory_details { imemory_data *initial_memory; @@ -3930,12 +4095,13 @@ struct initial_memory_details int current_block_large; int current_block_pinned; - enum - { + enum + { ALLATONCE = 1, EACH_GENERATION, EACH_BLOCK, - ALLATONCE_SEPARATED_POH + ALLATONCE_SEPARATED_POH, + EACH_NUMA_NODE }; size_t allocation_pattern; @@ -3955,8 +4121,8 @@ struct initial_memory_details { switch (gen) { - case soh_gen0: - case soh_gen1: + case soh_gen0: + case soh_gen1: case soh_gen2: return initial_normal_heap[h_number].memory_base; case loh_generation: return initial_large_heap[h_number].memory_base; case poh_generation: return initial_pinned_heap[h_number].memory_base; @@ -3968,8 +4134,8 @@ struct initial_memory_details { switch (gen) { - case soh_gen0: - case soh_gen1: + case soh_gen0: + case soh_gen1: case soh_gen2: return block_size_normal; case loh_generation: return block_size_large; case poh_generation: return block_size_pinned; @@ -3977,11 +4143,13 @@ struct initial_memory_details } }; + int numa_reserved_block_count; + numa_reserved_block* numa_reserved_block_table; }; initial_memory_details memory_details; -BOOL gc_heap::reserve_initial_memory (size_t normal_size, size_t large_size, size_t pinned_size, int num_heaps, bool use_large_pages_p, bool separated_poh_p) +BOOL gc_heap::reserve_initial_memory (size_t normal_size, size_t large_size, size_t pinned_size, int num_heaps, bool use_large_pages_p, bool separated_poh_p, uint16_t* heap_no_to_numa_node) { BOOL reserve_success = FALSE; @@ -3989,7 +4157,7 @@ BOOL gc_heap::reserve_initial_memory (size_t normal_size, size_t large_size, siz assert (memory_details.initial_memory == 0); // soh + loh + poh segments * num_heaps - memory_details.initial_memory = new (nothrow) imemory_data[num_heaps * (total_generation_count - ephemeral_generation_count)]; + memory_details.initial_memory = new (nothrow) imemory_data[num_heaps * (total_generation_count - ephemeral_generation_count)]; if (memory_details.initial_memory == 0) { dprintf (2, ("failed to reserve %Id bytes for imemory_data", num_heaps * (total_generation_count - ephemeral_generation_count) * sizeof (imemory_data))); @@ -4025,127 +4193,286 @@ BOOL gc_heap::reserve_initial_memory (size_t normal_size, size_t large_size, siz return FALSE; } - size_t temp_pinned_size = (separated_poh_p ? 0 : pinned_size); - size_t separate_pinned_size = memory_details.block_count * pinned_size; - size_t requestedMemory = memory_details.block_count * (normal_size + large_size + temp_pinned_size); - - uint8_t* allatonce_block = (uint8_t*)virtual_alloc (requestedMemory, use_large_pages_p); - uint8_t* separated_poh_block = nullptr; - if (allatonce_block && separated_poh_p) + // figure out number of NUMA nodes and allocate additional table for NUMA local reservation + memory_details.numa_reserved_block_count = 0; + memory_details.numa_reserved_block_table = nullptr; + int numa_node_count = 0; + if (heap_no_to_numa_node != nullptr) { - separated_poh_block = (uint8_t*)virtual_alloc (separate_pinned_size, false); - if (!separated_poh_block) + uint16_t highest_numa_node = 0; + + // figure out the highest NUMA node + for (int heap_no = 0; heap_no < num_heaps; heap_no++) { - virtual_free (allatonce_block, requestedMemory); - allatonce_block = nullptr; + uint16_t heap_numa_node = heap_no_to_numa_node[heap_no]; + highest_numa_node = max (highest_numa_node, heap_numa_node); } - } - if (allatonce_block) - { - if (separated_poh_p) + + assert (highest_numa_node < MAX_SUPPORTED_CPUS); + + numa_node_count = highest_numa_node + 1; + memory_details.numa_reserved_block_count = numa_node_count * (1 + separated_poh_p); + memory_details.numa_reserved_block_table = new (nothrow) numa_reserved_block[memory_details.numa_reserved_block_count]; + if (memory_details.numa_reserved_block_table == nullptr) { - g_gc_lowest_address = min (allatonce_block, separated_poh_block); - g_gc_highest_address = max ((allatonce_block + requestedMemory), (separated_poh_block + separate_pinned_size)); - memory_details.allocation_pattern = initial_memory_details::ALLATONCE_SEPARATED_POH; + // we couldn't get the memory - continue as if doing the non-NUMA case + dprintf(2, ("failed to reserve %Id bytes for numa_reserved_block data", memory_details.numa_reserved_block_count * sizeof(numa_reserved_block))); + memory_details.numa_reserved_block_count = 0; } - else + } + + if (memory_details.numa_reserved_block_table != nullptr) + { + // figure out how much to reserve on each NUMA node + // note this can be very different between NUMA nodes, depending on + // which processors our heaps are associated with + size_t merged_pinned_size = separated_poh_p ? 0 : pinned_size; + for (int heap_no = 0; heap_no < num_heaps; heap_no++) { - g_gc_lowest_address = allatonce_block; - g_gc_highest_address = allatonce_block + requestedMemory; - memory_details.allocation_pattern = initial_memory_details::ALLATONCE; + uint16_t heap_numa_node = heap_no_to_numa_node[heap_no]; + + numa_reserved_block * block = &memory_details.numa_reserved_block_table[heap_numa_node]; + + // add the size required for this heap + block->block_size += normal_size + large_size + merged_pinned_size; + + if (separated_poh_p) + { + numa_reserved_block* pinned_block = &memory_details.numa_reserved_block_table[numa_node_count + heap_numa_node]; + + // add the pinned size required for this heap + pinned_block->block_size += pinned_size; + } } - for (int i = 0; i < memory_details.block_count; i++) + // reserve the appropriate size on each NUMA node + bool failure = false; + for (int block_index = 0; block_index < memory_details.numa_reserved_block_count; block_index++) { - memory_details.initial_normal_heap[i].memory_base = allatonce_block + - (i * normal_size); - memory_details.initial_large_heap[i].memory_base = allatonce_block + - (memory_details.block_count * normal_size) + (i * large_size); - if (separated_poh_p) + numa_reserved_block * block = &memory_details.numa_reserved_block_table[block_index]; + + if (block->block_size == 0) + continue; + + int numa_node = block_index % numa_node_count; + bool pinned_block = block_index >= numa_node_count; + block->memory_base = (uint8_t*)virtual_alloc (block->block_size, use_large_pages_p && !pinned_block, numa_node); + if (block->memory_base == nullptr) { - memory_details.initial_pinned_heap[i].memory_base = separated_poh_block + - (i * pinned_size); + dprintf(2, ("failed to reserve %Id bytes for on NUMA node %u", block->block_size, numa_node)); + failure = true; + break; } else { - memory_details.initial_pinned_heap[i].memory_base = allatonce_block + - (memory_details.block_count * (normal_size + large_size)) + (i * pinned_size); + g_gc_lowest_address = min(g_gc_lowest_address, block->memory_base); + g_gc_highest_address = max(g_gc_highest_address, block->memory_base + block->block_size); + } + } + + if (failure) + { + // if we had any failures, undo the work done so far + // we will instead use one of the other allocation patterns + // we could try to use what we did succeed to reserve, but that gets complicated + for (int block_index = 0; block_index < memory_details.numa_reserved_block_count; block_index++) + { + numa_reserved_block * block = &memory_details.numa_reserved_block_table[block_index]; + + if (block->memory_base != nullptr) + { + virtual_free(block->memory_base, block->block_size); + block->memory_base = nullptr; + } } + delete [] memory_details.numa_reserved_block_table; + memory_details.numa_reserved_block_table = nullptr; + memory_details.numa_reserved_block_count = 0; + } + else + { + // for each NUMA node, give out the memory to its heaps + for (uint16_t numa_node = 0; numa_node < numa_node_count; numa_node++) + { + numa_reserved_block * block = &memory_details.numa_reserved_block_table[numa_node]; + + numa_reserved_block* pinned_block = separated_poh_p ? &memory_details.numa_reserved_block_table[numa_node_count + numa_node] : nullptr; + + // if the block's size is 0, there can be no heaps on this NUMA node + if (block->block_size == 0) + { + assert((pinned_block == nullptr) || (pinned_block->block_size == 0)); + continue; + } + + uint8_t* memory_base = block->memory_base; + uint8_t* pinned_memory_base = ((pinned_block == nullptr) ? nullptr : pinned_block->memory_base); + for (int heap_no = 0; heap_no < num_heaps; heap_no++) + { + uint16_t heap_numa_node = heap_no_to_numa_node[heap_no]; + + if (heap_numa_node != numa_node) + { + // this heap is on another NUMA node + continue; + } + + memory_details.initial_normal_heap[heap_no].memory_base = memory_base; + memory_base += normal_size; + memory_details.initial_large_heap[heap_no].memory_base = memory_base; + memory_base += large_size; + + if (separated_poh_p) + { + memory_details.initial_pinned_heap[heap_no].memory_base = pinned_memory_base; + pinned_memory_base += pinned_size; + } + else + { + memory_details.initial_pinned_heap[heap_no].memory_base = memory_base; + memory_base += pinned_size; + } + } + // sanity check - we should be at the end of the memory block for this NUMA node + assert (memory_base == block->memory_base + block->block_size); + assert ((pinned_block == nullptr) || (pinned_memory_base == pinned_block->memory_base + pinned_block->block_size)); + } + memory_details.allocation_pattern = initial_memory_details::EACH_NUMA_NODE; reserve_success = TRUE; } } - else + + if (!reserve_success) { - // try to allocate 3 blocks - uint8_t* b1 = (uint8_t*)virtual_alloc (memory_details.block_count * normal_size, use_large_pages_p); - uint8_t* b2 = (uint8_t*)virtual_alloc (memory_details.block_count * large_size, use_large_pages_p); - uint8_t* b3 = (uint8_t*)virtual_alloc (memory_details.block_count * pinned_size, use_large_pages_p && !separated_poh_p); + size_t temp_pinned_size = (separated_poh_p ? 0 : pinned_size); + size_t separate_pinned_size = memory_details.block_count * pinned_size; + size_t requestedMemory = memory_details.block_count * (normal_size + large_size + temp_pinned_size); - if (b1 && b2 && b3) + uint8_t* allatonce_block = (uint8_t*)virtual_alloc(requestedMemory, use_large_pages_p); + uint8_t* separated_poh_block = nullptr; + if (allatonce_block && separated_poh_p) + { + separated_poh_block = (uint8_t*)virtual_alloc(separate_pinned_size, false); + if (!separated_poh_block) + { + virtual_free(allatonce_block, requestedMemory); + allatonce_block = nullptr; + } + } + if (allatonce_block) { - memory_details.allocation_pattern = initial_memory_details::EACH_GENERATION; - g_gc_lowest_address = min (b1, min(b2, b3)); - g_gc_highest_address = max (b1 + memory_details.block_count * normal_size, - max (b2 + memory_details.block_count * large_size, - b3 + memory_details.block_count * pinned_size)); + if (separated_poh_p) + { + g_gc_lowest_address = min(allatonce_block, separated_poh_block); + g_gc_highest_address = max((allatonce_block + requestedMemory), (separated_poh_block + separate_pinned_size)); + memory_details.allocation_pattern = initial_memory_details::ALLATONCE_SEPARATED_POH; + } + else + { + g_gc_lowest_address = allatonce_block; + g_gc_highest_address = allatonce_block + requestedMemory; + memory_details.allocation_pattern = initial_memory_details::ALLATONCE; + } for (int i = 0; i < memory_details.block_count; i++) { - memory_details.initial_normal_heap[i].memory_base = b1 + (i * normal_size); - memory_details.initial_large_heap[i].memory_base = b2 + (i * large_size); - memory_details.initial_pinned_heap[i].memory_base = b3 + (i * pinned_size); + memory_details.initial_normal_heap[i].memory_base = allatonce_block + + (i * normal_size); + memory_details.initial_large_heap[i].memory_base = allatonce_block + + (memory_details.block_count * normal_size) + (i * large_size); + if (separated_poh_p) + { + memory_details.initial_pinned_heap[i].memory_base = separated_poh_block + + (i * pinned_size); + } + else + { + memory_details.initial_pinned_heap[i].memory_base = allatonce_block + + (memory_details.block_count * (normal_size + large_size)) + (i * pinned_size); + } } - reserve_success = TRUE; } else { - // allocation failed, we'll go on to try allocating each block. - // We could preserve the b1 alloc, but code complexity increases - if (b1) - virtual_free (b1, memory_details.block_count * normal_size); - if (b2) - virtual_free (b2, memory_details.block_count * large_size); - if (b3) - virtual_free (b3, memory_details.block_count * pinned_size); - } + // try to allocate 3 blocks + uint8_t* b1 = (uint8_t*)virtual_alloc(memory_details.block_count * normal_size, use_large_pages_p); + uint8_t* b2 = (uint8_t*)virtual_alloc(memory_details.block_count * large_size, use_large_pages_p); + uint8_t* b3 = (uint8_t*)virtual_alloc(memory_details.block_count * pinned_size, use_large_pages_p && !separated_poh_p); - if ((b2 == NULL) && (memory_details.block_count > 1)) - { - memory_details.allocation_pattern = initial_memory_details::EACH_BLOCK; + if (b1 && b2 && b3) + { + memory_details.allocation_pattern = initial_memory_details::EACH_GENERATION; + g_gc_lowest_address = min(b1, min(b2, b3)); + g_gc_highest_address = max(b1 + memory_details.block_count * normal_size, + max(b2 + memory_details.block_count * large_size, + b3 + memory_details.block_count * pinned_size)); - imemory_data* current_block = memory_details.initial_memory; - for (int i = 0; i < (memory_details.block_count * (total_generation_count - ephemeral_generation_count)); i++, current_block++) + for (int i = 0; i < memory_details.block_count; i++) + { + memory_details.initial_normal_heap[i].memory_base = b1 + (i * normal_size); + memory_details.initial_large_heap[i].memory_base = b2 + (i * large_size); + memory_details.initial_pinned_heap[i].memory_base = b3 + (i * pinned_size); + } + + reserve_success = TRUE; + } + else { - size_t block_size = memory_details.block_size (i); - current_block->memory_base = - (uint8_t*)virtual_alloc (block_size, use_large_pages_p); - if (current_block->memory_base == 0) - { - // Free the blocks that we've allocated so far - current_block = memory_details.initial_memory; - for (int j = 0; j < i; j++, current_block++) { - if (current_block->memory_base != 0) { - block_size = memory_details.block_size (i); - virtual_free (current_block->memory_base, block_size); + // allocation failed, we'll go on to try allocating each block. + // We could preserve the b1 alloc, but code complexity increases + if (b1) + virtual_free(b1, memory_details.block_count * normal_size); + if (b2) + virtual_free(b2, memory_details.block_count * large_size); + if (b3) + virtual_free(b3, memory_details.block_count * pinned_size); + } + + if ((b2 == NULL) && (memory_details.block_count > 1)) + { + memory_details.allocation_pattern = initial_memory_details::EACH_BLOCK; + + imemory_data* current_block = memory_details.initial_memory; + for (int i = 0; i < (memory_details.block_count * (total_generation_count - ephemeral_generation_count)); i++, current_block++) + { + size_t block_size = memory_details.block_size(i); + uint16_t numa_node = NUMA_NODE_UNDEFINED; + if (heap_no_to_numa_node != nullptr) + { + int heap_no = i % memory_details.block_count; + numa_node = heap_no_to_numa_node[heap_no]; + } + current_block->memory_base = + (uint8_t*)virtual_alloc(block_size, use_large_pages_p, numa_node); + if (current_block->memory_base == 0) + { + // Free the blocks that we've allocated so far + current_block = memory_details.initial_memory; + for (int j = 0; j < i; j++, current_block++) { + if (current_block->memory_base != 0) { + block_size = memory_details.block_size(i); + virtual_free(current_block->memory_base, block_size); + } } + reserve_success = FALSE; + break; } - reserve_success = FALSE; - break; - } - else - { - if (current_block->memory_base < g_gc_lowest_address) - g_gc_lowest_address = current_block->memory_base; - if (((uint8_t*)current_block->memory_base + block_size) > g_gc_highest_address) - g_gc_highest_address = (current_block->memory_base + block_size); + else + { + if (current_block->memory_base < g_gc_lowest_address) + g_gc_lowest_address = current_block->memory_base; + if (((uint8_t*)current_block->memory_base + block_size) > g_gc_highest_address) + g_gc_highest_address = (current_block->memory_base + block_size); + } + reserve_success = TRUE; } - reserve_success = TRUE; } } } + return reserve_success; } @@ -4153,36 +4480,37 @@ void gc_heap::destroy_initial_memory() { if (memory_details.initial_memory != NULL) { - if (memory_details.allocation_pattern == initial_memory_details::ALLATONCE) + switch (memory_details.allocation_pattern) { - virtual_free(memory_details.initial_memory[0].memory_base, + case initial_memory_details::ALLATONCE: + virtual_free (memory_details.initial_memory[0].memory_base, memory_details.block_count*(memory_details.block_size_normal + memory_details.block_size_large + memory_details.block_size_pinned)); - } - else if (memory_details.allocation_pattern == initial_memory_details::ALLATONCE_SEPARATED_POH) - { + break; + + case initial_memory_details::ALLATONCE_SEPARATED_POH: virtual_free(memory_details.initial_memory[0].memory_base, - memory_details.block_count*(memory_details.block_size_normal + - memory_details.block_size_large)); + memory_details.block_count * (memory_details.block_size_normal + + memory_details.block_size_large)); virtual_free(memory_details.initial_pinned_heap[0].memory_base, - memory_details.block_count*(memory_details.block_size_pinned)); - } - else if (memory_details.allocation_pattern == initial_memory_details::EACH_GENERATION) - { + memory_details.block_count * (memory_details.block_size_pinned)); + break; + + case initial_memory_details::EACH_GENERATION: virtual_free (memory_details.initial_normal_heap[0].memory_base, memory_details.block_count*memory_details.block_size_normal); virtual_free (memory_details.initial_large_heap[0].memory_base, memory_details.block_count*memory_details.block_size_large); - virtual_free (memory_details.initial_pinned_heap[0].memory_base, + virtual_free (memory_details.initial_pinned_heap[0].memory_base, memory_details.block_count*memory_details.block_size_pinned); - } - else + break; + + case initial_memory_details::EACH_BLOCK: { - assert (memory_details.allocation_pattern == initial_memory_details::EACH_BLOCK); - imemory_data *current_block = memory_details.initial_memory; - for (int i = 0; i < (memory_details.block_count*(total_generation_count - ephemeral_generation_count)); i++, current_block++) + imemory_data* current_block = memory_details.initial_memory; + for (int i = 0; i < (memory_details.block_count * (total_generation_count - ephemeral_generation_count)); i++, current_block++) { size_t block_size = memory_details.block_size (i); if (current_block->memory_base != NULL) @@ -4190,6 +4518,24 @@ void gc_heap::destroy_initial_memory() virtual_free (current_block->memory_base, block_size); } } + break; + } + case initial_memory_details::EACH_NUMA_NODE: + for (int block_index = 0; block_index < memory_details.numa_reserved_block_count; block_index++) + { + numa_reserved_block * block = &memory_details.numa_reserved_block_table[block_index]; + + if (block->memory_base != nullptr) + { + virtual_free (block->memory_base, block->block_size); + } + } + delete [] memory_details.numa_reserved_block_table; + break; + + default: + assert (!"unexpected allocation_pattern"); + break; } delete [] memory_details.initial_memory; @@ -4215,7 +4561,7 @@ void* virtual_alloc (size_t size) return virtual_alloc(size, false); } -void* virtual_alloc (size_t size, bool use_large_pages_p) +void* virtual_alloc (size_t size, bool use_large_pages_p, uint16_t numa_node) { size_t requested_size = size; @@ -4238,8 +4584,8 @@ void* virtual_alloc (size_t size, bool use_large_pages_p) #endif // !FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP void* prgmem = use_large_pages_p ? - GCToOSInterface::VirtualReserveAndCommitLargePages(requested_size) : - GCToOSInterface::VirtualReserve(requested_size, card_size * card_word_width, flags); + GCToOSInterface::VirtualReserveAndCommitLargePages(requested_size, numa_node) : + GCToOSInterface::VirtualReserve(requested_size, card_size * card_word_width, flags, numa_node); void *aligned_mem = prgmem; // We don't want (prgmem + size) to be right at the end of the address space @@ -4817,10 +5163,45 @@ class heap_select memset(sniff_buffer, 0, sniff_buf_size*sizeof(uint8_t)); } - //can not enable gc numa aware, force all heaps to be in - //one numa node by filling the array with all 0s - if (!GCToOSInterface::CanEnableGCNumaAware()) - memset(heap_no_to_numa_node, 0, sizeof (heap_no_to_numa_node)); + bool do_numa = GCToOSInterface::CanEnableGCNumaAware(); + + // we want to assign heap indices such that there is a contiguous + // range of heap numbers for each numa node + + // we do this in two passes: + // 1. gather processor numbers and numa node numbers for all heaps + // 2. assign heap numbers for each numa node + + // Pass 1: gather processor numbers and numa node numbers + uint16_t proc_no[MAX_SUPPORTED_CPUS]; + uint16_t node_no[MAX_SUPPORTED_CPUS]; + uint16_t max_node_no = 0; + for (int i = 0; i < n_heaps; i++) + { + if (!GCToOSInterface::GetProcessorForHeap (i, &proc_no[i], &node_no[i])) + break; + if (!do_numa || node_no[i] == NUMA_NODE_UNDEFINED) + node_no[i] = 0; + max_node_no = max(max_node_no, node_no[i]); + } + + // Pass 2: assign heap numbers by numa node + int cur_heap_no = 0; + for (uint16_t cur_node_no = 0; cur_node_no <= max_node_no; cur_node_no++) + { + for (int i = 0; i < n_heaps; i++) + { + if (node_no[i] != cur_node_no) + continue; + + // we found a heap on cur_node_no + heap_no_to_proc_no[cur_heap_no] = proc_no[i]; + heap_no_to_numa_node[cur_heap_no] = cur_node_no; + proc_no_to_numa_node[proc_no[i]] = cur_node_no; + + cur_heap_no++; + } + } return TRUE; } @@ -5021,6 +5402,9 @@ class heap_select uint16_t numa_node = heap_no_to_numa_node[hn]; *start = (int)numa_node_to_heap_map[numa_node]; *end = (int)(numa_node_to_heap_map[numa_node+1]); +#ifdef HEAP_BALANCE_INSTRUMENTATION + dprintf(HEAP_BALANCE_TEMP_LOG, ("TEMPget_heap_range: %d is in numa node %d, start = %d, end = %d", hn, numa_node, *start, *end)); +#endif //HEAP_BALANCE_INSTRUMENTATION } // This gets the next valid numa node index starting at current_index+1. @@ -5206,7 +5590,7 @@ void add_to_hb_numa ( (hb_info_proc->index)++; } -const int hb_log_buffer_size = 1024; +const int hb_log_buffer_size = 4096; static char hb_log_buffer[hb_log_buffer_size]; int last_hb_recorded_gc_index = -1; #endif //HEAP_BALANCE_INSTRUMENTATION @@ -5421,24 +5805,6 @@ void gc_heap::destroy_thread_support () } } -bool get_proc_and_numa_for_heap (int heap_number) -{ - uint16_t proc_no; - uint16_t node_no; - - bool res = GCToOSInterface::GetProcessorForHeap (heap_number, &proc_no, &node_no); - if (res) - { - heap_select::set_proc_no_for_heap (heap_number, proc_no); - if (node_no != NUMA_NODE_UNDEFINED) - { - heap_select::set_numa_node_for_heap_and_proc (heap_number, proc_no, node_no); - } - } - - return res; -} - void set_thread_affinity_for_heap (int heap_number, uint16_t proc_no) { if (!GCToOSInterface::SetThreadAffinity (proc_no)) @@ -5483,6 +5849,7 @@ void gc_heap::gc_thread_function () END_TIMING(suspend_ee_during_log); proceed_with_gc_p = TRUE; + gradual_decommit_in_progress_p = FALSE; if (!should_proceed_with_gc()) { @@ -5622,7 +5989,7 @@ bool gc_heap::virtual_commit (void* address, size_t size, gc_oh_num oh, int h_nu check_commit_cs.Enter(); bool exceeded_p = false; - if (heap_hard_limit_oh[0] != 0) + if (heap_hard_limit_oh[soh] != 0) { if ((oh != gc_oh_num::none) && (committed_by_oh[oh] + size) > heap_hard_limit_oh[oh]) { @@ -5669,7 +6036,7 @@ bool gc_heap::virtual_commit (void* address, size_t size, gc_oh_num oh, int h_nu { check_commit_cs.Enter(); committed_by_oh[oh] -= size; - + dprintf (1, ("commit failed, updating %Id to %Id", current_total_committed, (current_total_committed - size))); current_total_committed -= size; @@ -5893,8 +6260,13 @@ class mark // We should think about whether it's really necessary to have to copy back the pre plug // info since it was already copied during compacting plugs. But if a plug doesn't move // by >= 3 ptr size (the size of gap_reloc_pair), it means we'd have to recover pre plug info. - void recover_plug_info() + size_t recover_plug_info() { + // We need to calculate the size for sweep case in order to correctly record the + // free_obj_space - sweep would've made these artifical gaps into free objects and + // we would need to deduct the size because now we are writing into those free objects. + size_t recovered_sweep_size = 0; + if (saved_pre_p) { if (gc_heap::settings.compaction) @@ -5912,6 +6284,7 @@ class mark &saved_pre_plug, (first - sizeof (plug_and_gap)))); memcpy ((first - sizeof (plug_and_gap)), &saved_pre_plug, sizeof (saved_pre_plug)); + recovered_sweep_size += sizeof (saved_pre_plug); } } @@ -5932,8 +6305,11 @@ class mark &saved_post_plug, saved_post_plug_info_start)); memcpy (saved_post_plug_info_start, &saved_post_plug, sizeof (saved_post_plug)); + recovered_sweep_size += sizeof (saved_post_plug); } } + + return recovered_sweep_size; } }; @@ -6053,7 +6429,7 @@ void gc_heap::fix_uoh_allocation_area() #endif // _DEBUG generation_alloc_context (generation_of (i)); assert (acontext->alloc_ptr == 0); - assert (acontext->alloc_limit == 0); + assert (acontext->alloc_limit == 0); #if 0 dprintf (3, ("UOH alloc context: gen: %Ix, ptr: %Ix, limit %Ix", @@ -8282,44 +8658,16 @@ static void do_vxsort (uint8_t** item_array, ptrdiff_t item_count, uint8_t* rang if (IsSupportedInstructionSet (InstructionSet::AVX2) && (item_count > AVX2_THRESHOLD_SIZE)) { - // is the range small enough for a 32-bit sort? - // the 32-bit sort is almost twice as fast - ptrdiff_t range = range_high - range_low; - assert(sizeof(uint8_t*) == (1 << 3)); - ptrdiff_t scaled_range = range >> 3; - if ((uint32_t)scaled_range == scaled_range) - { - dprintf (3, ("Sorting mark lists as 32-bit offsets")); - - do_pack_avx2 (item_array, item_count, range_low); - - int32_t* item_array_32 = (int32_t*)item_array; - - // use AVX512F only if the list is large enough to pay for downclocking impact - if (IsSupportedInstructionSet (InstructionSet::AVX512F) && (item_count > AVX512F_THRESHOLD_SIZE)) - { - do_vxsort_avx512 (item_array_32, &item_array_32[item_count - 1]); - } - else - { - do_vxsort_avx2 (item_array_32, &item_array_32[item_count - 1]); - } + dprintf(3, ("Sorting mark lists")); - do_unpack_avx2 (item_array_32, item_count, range_low); + // use AVX512F only if the list is large enough to pay for downclocking impact + if (IsSupportedInstructionSet (InstructionSet::AVX512F) && (item_count > AVX512F_THRESHOLD_SIZE)) + { + do_vxsort_avx512 (item_array, &item_array[item_count - 1], range_low, range_high); } else { - dprintf(3, ("Sorting mark lists")); - - // use AVX512F only if the list is large enough to pay for downclocking impact - if (IsSupportedInstructionSet (InstructionSet::AVX512F) && (item_count > AVX512F_THRESHOLD_SIZE)) - { - do_vxsort_avx512 (item_array, &item_array[item_count - 1]); - } - else - { - do_vxsort_avx2 (item_array, &item_array[item_count - 1]); - } + do_vxsort_avx2 (item_array, &item_array[item_count - 1], range_low, range_high); } } else @@ -8347,6 +8695,8 @@ void gc_heap::sort_mark_list() { if (settings.condemned_generation >= max_generation) { + // fake a mark list overflow so merge_mark_lists knows to quit early + mark_list_index = mark_list_end + 1; return; } @@ -8397,7 +8747,7 @@ void gc_heap::sort_mark_list() high = max (high, heap_segment_allocated (hp->ephemeral_heap_segment)); } - // give up if this is not an ephemeral GC or the mark list size is unreasonably large + // give up if the mark list size is unreasonably large if (total_mark_list_size > (total_ephemeral_size / 256)) { mark_list_index = mark_list_end + 1; @@ -9494,7 +9844,7 @@ int gc_heap::object_gennum_plan (uint8_t* o) heap_segment* gc_heap::make_heap_segment (uint8_t* new_pages, size_t size, gc_oh_num oh, int h_number) { - assert(oh != gc_oh_num::none); + assert(oh != gc_oh_num::none); size_t initial_commit = SEGMENT_INITIAL_COMMIT; if (!virtual_commit (new_pages, initial_commit, oh, h_number)) @@ -10053,11 +10403,11 @@ void gc_heap::make_generation (int gen_num, heap_segment* seg, uint8_t* start) gen->allocation_segment = seg; gen->plan_allocation_start = 0; gen->free_list_space = 0; - gen->pinned_allocated = 0; - gen->free_list_allocated = 0; + gen->pinned_allocated = 0; + gen->free_list_allocated = 0; gen->end_seg_allocated = 0; - gen->condemned_allocated = 0; - gen->sweep_allocated = 0; + gen->condemned_allocated = 0; + gen->sweep_allocated = 0; gen->free_obj_space = 0; gen->allocation_size = 0; gen->pinned_allocation_sweep_size = 0; @@ -10065,6 +10415,10 @@ void gc_heap::make_generation (int gen_num, heap_segment* seg, uint8_t* start) gen->allocate_end_seg_p = FALSE; gen->free_list_allocator.clear(); +#ifdef DOUBLY_LINKED_FL + gen->set_bgc_mark_bit_p = FALSE; +#endif //DOUBLY_LINKED_FL + #ifdef FREE_USAGE_STATS memset (gen->gen_free_spaces, 0, sizeof (gen.gen_free_spaces)); memset (gen->gen_current_pinned_free_spaces, 0, sizeof (gen.gen_current_pinned_free_spaces)); @@ -10097,9 +10451,10 @@ FILE* CreateLogFile(const GCConfigStringHolder& temp_logfile_name, bool is_confi } char logfile_name[MAX_LONGPATH+1]; - uint32_t pid = GCToOSInterface::GetCurrentProcessId(); + //uint32_t pid = GCToOSInterface::GetCurrentProcessId(); const char* suffix = is_config ? ".config.log" : ".log"; - _snprintf_s(logfile_name, MAX_LONGPATH+1, _TRUNCATE, "%s.%d%s", temp_logfile_name.Get(), pid, suffix); + //_snprintf_s(logfile_name, MAX_LONGPATH+1, _TRUNCATE, "%s.%d%s", temp_logfile_name.Get(), pid, suffix); + _snprintf_s(logfile_name, MAX_LONGPATH+1, _TRUNCATE, "%s%s", temp_logfile_name.Get(), suffix); logFile = fopen(logfile_name, "wb"); return logFile; } @@ -10250,8 +10605,13 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size, reserved_memory = 0; size_t initial_heap_size = soh_segment_size + loh_segment_size + poh_segment_size; + uint16_t* heap_no_to_numa_node = nullptr; #ifdef MULTIPLE_HEAPS reserved_memory_limit = initial_heap_size * number_of_heaps; + if (!heap_select::init(number_of_heaps)) + return E_OUTOFMEMORY; + if (GCToOSInterface::CanEnableGCNumaAware()) + heap_no_to_numa_node = heap_select::heap_no_to_numa_node; #else //MULTIPLE_HEAPS reserved_memory_limit = initial_heap_size; int number_of_heaps = 1; @@ -10262,8 +10622,8 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size, check_commit_cs.Initialize(); } - bool separated_poh_p = use_large_pages_p && heap_hard_limit_oh[0] && (GCConfig::GetGCHeapHardLimitPOH() == 0) && (GCConfig::GetGCHeapHardLimitPOHPercent() == 0); - if (!reserve_initial_memory (soh_segment_size, loh_segment_size, poh_segment_size, number_of_heaps, use_large_pages_p, separated_poh_p)) + bool separated_poh_p = use_large_pages_p && heap_hard_limit_oh[soh] && (GCConfig::GetGCHeapHardLimitPOH() == 0) && (GCConfig::GetGCHeapHardLimitPOHPercent() == 0); + if (!reserve_initial_memory (soh_segment_size, loh_segment_size, poh_segment_size, number_of_heaps, use_large_pages_p, separated_poh_p, heap_no_to_numa_node)) return E_OUTOFMEMORY; #ifdef CARD_BUNDLE @@ -10331,9 +10691,6 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size, if (!create_thread_support (number_of_heaps)) return E_OUTOFMEMORY; - if (!heap_select::init (number_of_heaps)) - return E_OUTOFMEMORY; - #endif //MULTIPLE_HEAPS #ifdef MULTIPLE_HEAPS @@ -10562,6 +10919,8 @@ gc_heap::init_semi_shared() short_plugs_pad_ratio = (double)DESIRED_PLUG_LENGTH / (double)(DESIRED_PLUG_LENGTH - Align (min_obj_size)); #endif //SHORT_PLUGS + generation_skip_ratio_threshold = (int)GCConfig::GetGCLowSkipRatio(); + ret = 1; cleanup: @@ -10803,6 +11162,12 @@ gc_heap::init_gc_heap (int h_number) generation_skip_ratio = 100; +#ifdef FEATURE_CARD_MARKING_STEALING + n_eph_soh = 0; + n_gen_soh = 0; + n_eph_loh = 0; + n_gen_loh = 0; +#endif //FEATURE_CARD_MARKING_STEALING mark_stack_tos = 0; mark_stack_bos = 0; @@ -10955,7 +11320,7 @@ gc_heap::init_gc_heap (int h_number) heap_segment_allocated (pseg) = heap_segment_mem (pseg) + Align (min_obj_size, get_alignment_constant (FALSE)); heap_segment_used (pseg) = heap_segment_allocated (pseg) - plug_skew; - generation_of (max_generation)->free_list_allocator = allocator(NUM_GEN2_ALIST, BASE_GEN2_ALIST_BITS, gen2_alloc_list); + generation_of (max_generation)->free_list_allocator = allocator(NUM_GEN2_ALIST, BASE_GEN2_ALIST_BITS, gen2_alloc_list, max_generation); generation_of (loh_generation)->free_list_allocator = allocator(NUM_LOH_ALIST, BASE_LOH_ALIST_BITS, loh_alloc_list); generation_of (poh_generation)->free_list_allocator = allocator(NUM_POH_ALIST, BASE_POH_ALIST_BITS, poh_alloc_list); @@ -11030,7 +11395,6 @@ gc_heap::init_gc_heap (int h_number) } #ifdef MULTIPLE_HEAPS - get_proc_and_numa_for_heap (heap_number); if (!create_gc_thread ()) return 0; @@ -11107,6 +11471,11 @@ gc_heap::init_gc_heap (int h_number) bgc_overflow_count = 0; end_loh_size = dd_min_size (dynamic_data_of (loh_generation)); end_poh_size = dd_min_size (dynamic_data_of (poh_generation)); + + current_sweep_pos = 0; +#ifdef DOUBLY_LINKED_FL + current_sweep_seg = 0; +#endif //DOUBLY_LINKED_FL #endif //BACKGROUND_GC #ifdef GC_CONFIG_DRIVEN @@ -11301,6 +11670,15 @@ BOOL gc_heap::grow_heap_segment (heap_segment* seg, uint8_t* high_address, bool* assert (heap_segment_committed (seg) <= heap_segment_reserved (seg)); assert (high_address <= heap_segment_committed (seg)); + +#ifdef MULTIPLE_HEAPS + // we should never increase committed beyond decommit target when gradual + // decommit is in progress - if we do, this means commit and decommit are + // going on at the same time. + assert (!gradual_decommit_in_progress_p || + (seg != ephemeral_heap_segment) || + (heap_segment_committed (seg) <= heap_segment_decommit_target (seg))); +#endif // MULTIPLE_HEAPS } return !!ret; @@ -11329,6 +11707,52 @@ int gc_heap::grow_heap_segment (heap_segment* seg, uint8_t* allocated, uint8_t* #endif // FEATURE_STRUCTALIGN } +// thread this object to the front of gen's free list and update stats. +void gc_heap::thread_free_item_front (generation* gen, uint8_t* free_start, size_t free_size) +{ + make_unused_array (free_start, free_size); + generation_free_list_space (gen) += free_size; + generation_allocator(gen)->thread_item_front (free_start, free_size); + add_gen_free (gen->gen_num, free_size); + + if (gen->gen_num == max_generation) + { + dprintf (2, ("AO h%d: gen2F+: %Ix(%Id)->%Id, FO: %Id", + heap_number, free_start, free_size, + generation_free_list_space (gen), generation_free_obj_space (gen))); + } +} + +#ifdef DOUBLY_LINKED_FL +void gc_heap::thread_item_front_added (generation* gen, uint8_t* free_start, size_t free_size) +{ + make_unused_array (free_start, free_size); + generation_free_list_space (gen) += free_size; + int bucket_index = generation_allocator(gen)->thread_item_front_added (free_start, free_size); + + if (gen->gen_num == max_generation) + { + dprintf (2, ("AO [h%d] gen2FL+: %Ix(%Id)->%Id", + heap_number, free_start, free_size, generation_free_list_space (gen))); + } + + add_gen_free (gen->gen_num, free_size); +} +#endif //DOUBLY_LINKED_FL + +// this is for free objects that are not on the free list; also update stats. +void gc_heap::make_free_obj (generation* gen, uint8_t* free_start, size_t free_size) +{ + make_unused_array (free_start, free_size); + generation_free_obj_space (gen) += free_size; + + if (gen->gen_num == max_generation) + { + dprintf (2, ("AO [h%d] gen2FO+: %Ix(%Id)->%Id", + heap_number, free_start, free_size, generation_free_obj_space (gen))); + } +} + //used only in older generation allocation (i.e during gc). void gc_heap::adjust_limit (uint8_t* start, size_t limit_size, generation* gen) { @@ -11351,41 +11775,83 @@ void gc_heap::adjust_limit (uint8_t* start, size_t limit_size, generation* gen) { dprintf (3, ("filling up hole: %Ix, size %Ix", hole, size)); size_t allocated_size = generation_allocation_pointer (gen) - generation_allocation_context_start_region (gen); - if (size >= Align (min_free_list)) +#ifdef DOUBLY_LINKED_FL + if (gen->gen_num == max_generation) { - if (allocated_size < min_free_list) + // For BGC since we need to thread the max_gen's free list as a doubly linked list we need to preserve 5 ptr-sized + // words: SB | MT | Len | Next | Prev + // This means we cannot simply make a filler free object right after what's allocated in this alloc context if + // that's < 5-ptr sized. + // + if (allocated_size < min_free_item_no_prev) { + // We can't make the free object just yet. Need to record the size. + size_t* filler_free_obj_size_location = (size_t*)(generation_allocation_context_start_region (gen) + min_free_item_no_prev); + size_t filler_free_obj_size = 0; if (size >= (Align (min_free_list) + Align (min_obj_size))) { - //split hole into min obj + threadable free item - make_unused_array (hole, min_obj_size); - generation_free_obj_space (gen) += Align (min_obj_size); - make_unused_array (hole + Align (min_obj_size), size - Align (min_obj_size)); - generation_free_list_space (gen) += size - Align (min_obj_size); - generation_allocator(gen)->thread_item_front (hole + Align (min_obj_size), - size - Align (min_obj_size)); - add_gen_free (gen->gen_num, (size - Align (min_obj_size))); + + filler_free_obj_size = Align (min_obj_size); + size_t fl_size = size - filler_free_obj_size; + thread_item_front_added (gen, (hole + filler_free_obj_size), fl_size); } else { - dprintf (3, ("allocated size too small, can't put back rest on free list %Ix", allocated_size)); - make_unused_array (hole, size); - generation_free_obj_space (gen) += size; + filler_free_obj_size = size; } + + generation_free_obj_space (gen) += filler_free_obj_size; + *filler_free_obj_size_location = filler_free_obj_size; + uint8_t* old_loc = generation_last_free_list_allocated (gen); + set_free_obj_in_compact_bit (old_loc); + + dprintf (3333, ("[h%d] ac: %Ix->%Ix((%Id < %Id), Pset %Ix s->%Id", heap_number, + generation_allocation_context_start_region (gen), generation_allocation_pointer (gen), + allocated_size, min_free_item_no_prev, filler_free_obj_size_location, filler_free_obj_size)); } else { - dprintf (3, ("threading hole in front of free list")); - make_unused_array (hole, size); - generation_free_list_space (gen) += size; - generation_allocator(gen)->thread_item_front (hole, size); - add_gen_free (gen->gen_num, size); + if (size >= Align (min_free_list)) + { + thread_item_front_added (gen, hole, size); + } + else + { + make_free_obj (gen, hole, size); + } } } else +#endif //DOUBLY_LINKED_FL { - make_unused_array (hole, size); - generation_free_obj_space (gen) += size; + // TODO: this should be written the same way as the above, ie, it should check allocated_size first, + // but it doesn't need to do MAKE_FREE_OBJ_IN_COMPACT related things. + if (size >= Align (min_free_list)) + { + if (allocated_size < min_free_item_no_prev) + { + if (size >= (Align (min_free_list) + Align (min_obj_size))) + { + //split hole into min obj + threadable free item + make_free_obj (gen, hole, min_obj_size); + thread_free_item_front (gen, hole + Align (min_obj_size), size - Align (min_obj_size)); + } + else + { + dprintf (3, ("allocated size too small, can't put back rest on free list %Ix", allocated_size)); + make_free_obj (gen, hole, size); + } + } + else + { + dprintf (3, ("threading hole in front of free list")); + thread_free_item_front (gen, hole, size); + } + } + else + { + make_free_obj (gen, hole, size); + } } } } @@ -11524,12 +11990,13 @@ void gc_heap::check_batch_mark_array_bits (uint8_t* start, uint8_t* end) } #endif //VERIFY_HEAP && BACKGROUND_GC -allocator::allocator (unsigned int num_b, int fbb, alloc_list* b) +allocator::allocator (unsigned int num_b, int fbb, alloc_list* b, int gen) { assert (num_b < MAX_BUCKET_COUNT); num_buckets = num_b; first_bucket_bits = fbb; buckets = b; + gen_number = gen; } alloc_list& allocator::alloc_list_of (unsigned int bn) @@ -11552,8 +12019,16 @@ size_t& allocator::alloc_list_damage_count_of (unsigned int bn) void allocator::unlink_item (unsigned int bn, uint8_t* item, uint8_t* prev_item, BOOL use_undo_p) { - //unlink the free_item alloc_list* al = &alloc_list_of (bn); + uint8_t* next_item = free_list_slot(item); + +#ifdef DOUBLY_LINKED_FL + // if repair_list is TRUE yet use_undo_p is FALSE, it means we do need to make sure + // this item does not look like it's on the free list as we will not have a chance to + // do that later. + BOOL repair_list = !discard_if_no_fit_p (); +#endif //DOUBLY_LINKED_FL + if (prev_item) { if (use_undo_p && (free_list_undo (prev_item) == UNDO_EMPTY)) @@ -11562,18 +12037,199 @@ void allocator::unlink_item (unsigned int bn, uint8_t* item, uint8_t* prev_item, free_list_undo (prev_item) = item; alloc_list_damage_count_of (bn)++; } - free_list_slot (prev_item) = free_list_slot(item); + + free_list_slot (prev_item) = next_item; + } + else + { + al->alloc_list_head() = next_item; + } + if (al->alloc_list_tail() == item) + { + al->alloc_list_tail() = prev_item; + } + +#ifdef DOUBLY_LINKED_FL + if (repair_list) + { + if (!use_undo_p) + { + free_list_prev (item) = PREV_EMPTY; + } + } + + if (gen_number == max_generation) + { + dprintf (3, ("[g%2d, b%2d]UL: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)", + gen_number, bn, free_list_prev (item), item, free_list_slot (item), + al->alloc_list_head(), al->alloc_list_tail())); + dprintf (3, ("[g%2d, b%2d]UL: exit, h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix", + gen_number, bn, + (al->alloc_list_head() ? free_list_slot (al->alloc_list_head()) : 0), + (al->alloc_list_head() ? free_list_prev (al->alloc_list_head()) : 0), + (al->alloc_list_tail() ? free_list_slot (al->alloc_list_tail()) : 0), + (al->alloc_list_tail() ? free_list_prev (al->alloc_list_tail()) : 0))); + } +#endif //DOUBLY_LINKED_FL +} + +#ifdef DOUBLY_LINKED_FL +void allocator::unlink_item_no_undo (unsigned int bn, uint8_t* item, size_t size) +{ + alloc_list* al = &alloc_list_of (bn); + + uint8_t* next_item = free_list_slot (item); + uint8_t* prev_item = free_list_prev (item); + +#ifdef FL_VERIFICATION + { + uint8_t* start = al->alloc_list_head(); + BOOL found_p = FALSE; + while (start) + { + if (start == item) + { + found_p = TRUE; + break; + } + + start = free_list_slot (start); + } + + if (!found_p) + { + dprintf (1, ("could not find %Ix in b%d!!!", item, a_l_number)); + FATAL_GC_ERROR(); + } + } +#endif //FL_VERIFICATION + + if (prev_item) + { + free_list_slot (prev_item) = next_item; } else { - al->alloc_list_head() = (uint8_t*)free_list_slot(item); + al->alloc_list_head() = next_item; } + + if (next_item) + { + free_list_prev (next_item) = prev_item; + } + if (al->alloc_list_tail() == item) { al->alloc_list_tail() = prev_item; } + + free_list_prev (item) = PREV_EMPTY; + + if (gen_number == max_generation) + { + dprintf (3, ("[g%2d, b%2d]ULN: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)", + gen_number, bn, free_list_prev (item), item, free_list_slot (item), + al->alloc_list_head(), al->alloc_list_tail())); + dprintf (3, ("[g%2d, b%2d]ULN: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix", + gen_number, bn, + (al->alloc_list_head() ? free_list_slot (al->alloc_list_head()) : 0), + (al->alloc_list_head() ? free_list_prev (al->alloc_list_head()) : 0), + (al->alloc_list_tail() ? free_list_slot (al->alloc_list_tail()) : 0), + (al->alloc_list_tail() ? free_list_prev (al->alloc_list_tail()) : 0))); + } } +void allocator::unlink_item_no_undo (uint8_t* item, size_t size) +{ + unsigned int bn = first_suitable_bucket (size); + unlink_item_no_undo (bn, item, size); +} + +void allocator::unlink_item_no_undo_added (unsigned int bn, uint8_t* item, uint8_t* previous_item) +{ + alloc_list* al = &alloc_list_of (bn); + + uint8_t* next_item = free_list_slot (item); + uint8_t* prev_item = free_list_prev (item); + + assert (prev_item == previous_item); + + if (prev_item) + { + free_list_slot (prev_item) = next_item; + } + else + { + al->added_alloc_list_head() = next_item; + } + + if (next_item) + { + free_list_prev (next_item) = prev_item; + } + + if (al->added_alloc_list_tail() == item) + { + al->added_alloc_list_tail() = prev_item; + } + + free_list_prev (item) = PREV_EMPTY; + + if (gen_number == max_generation) + { + dprintf (3333, ("[g%2d, b%2d]ULNA: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)", + gen_number, bn, free_list_prev (item), item, free_list_slot (item), + al->added_alloc_list_head(), al->added_alloc_list_tail())); + dprintf (3333, ("[g%2d, b%2d]ULNA: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix", + gen_number, bn, + (al->added_alloc_list_head() ? free_list_slot (al->added_alloc_list_head()) : 0), + (al->added_alloc_list_head() ? free_list_prev (al->added_alloc_list_head()) : 0), + (al->added_alloc_list_tail() ? free_list_slot (al->added_alloc_list_tail()) : 0), + (al->added_alloc_list_tail() ? free_list_prev (al->added_alloc_list_tail()) : 0))); + } +} + +int allocator::thread_item_front_added (uint8_t* item, size_t size) +{ + unsigned int a_l_number = first_suitable_bucket (size); + alloc_list* al = &alloc_list_of (a_l_number); + + free_list_slot (item) = al->added_alloc_list_head(); + free_list_prev (item) = 0; + // this list's UNDO is not useful. + free_list_undo (item) = UNDO_EMPTY; + + if (al->added_alloc_list_head() != 0) + { + uint8_t* head_prev = free_list_prev (al->added_alloc_list_head()); + free_list_prev (al->added_alloc_list_head()) = item; + } + + al->added_alloc_list_head() = item; + + if (al->added_alloc_list_tail() == 0) + { + al->added_alloc_list_tail() = item; + } + + if (gen_number == max_generation) + { + dprintf (3333, ("[g%2d, b%2d]TFFA: exit: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)", + gen_number, a_l_number, + free_list_prev (item), item, free_list_slot (item), + al->added_alloc_list_head(), al->added_alloc_list_tail())); + dprintf (3333, ("[g%2d, b%2d]TFFA: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix", + gen_number, a_l_number, + (al->added_alloc_list_head() ? free_list_slot (al->added_alloc_list_head()) : 0), + (al->added_alloc_list_head() ? free_list_prev (al->added_alloc_list_head()) : 0), + (al->added_alloc_list_tail() ? free_list_slot (al->added_alloc_list_tail()) : 0), + (al->added_alloc_list_tail() ? free_list_prev (al->added_alloc_list_tail()) : 0))); + } + + return a_l_number; +} +#endif //DOUBLY_LINKED_FL + void allocator::clear() { for (unsigned int i = 0; i < num_buckets; i++) @@ -11586,7 +12242,7 @@ void allocator::clear() //always thread to the end. void allocator::thread_item (uint8_t* item, size_t size) { - unsigned int a_l_number = first_suitable_bucket(size); + unsigned int a_l_number = first_suitable_bucket (size); alloc_list* al = &alloc_list_of (a_l_number); uint8_t*& head = al->alloc_list_head(); uint8_t*& tail = al->alloc_list_tail(); @@ -11595,6 +12251,13 @@ void allocator::thread_item (uint8_t* item, size_t size) free_list_undo (item) = UNDO_EMPTY; assert (item != head); +#ifdef DOUBLY_LINKED_FL + if (gen_number == max_generation) + { + free_list_prev (item) = tail; + } +#endif //DOUBLY_LINKED_FL + if (head == 0) { head = item; @@ -11609,6 +12272,22 @@ void allocator::thread_item (uint8_t* item, size_t size) } tail = item; + +#ifdef DOUBLY_LINKED_FL + if (gen_number == max_generation) + { + dprintf (3333, ("[g%2d, b%2d]TFE: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)", + gen_number, a_l_number, + free_list_prev (item), item, free_list_slot (item), + al->alloc_list_head(), al->alloc_list_tail())); + dprintf (3333, ("[g%2d, b%2d]TFE: exit: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix", + gen_number, a_l_number, + (al->alloc_list_head() ? free_list_slot (al->alloc_list_head()) : 0), + (al->alloc_list_head() ? free_list_prev (al->alloc_list_head()) : 0), + (al->alloc_list_tail() ? free_list_slot (al->alloc_list_tail()) : 0), + (al->alloc_list_tail() ? free_list_prev (al->alloc_list_tail()) : 0))); + } +#endif //DOUBLY_LINKED_FL } void allocator::thread_item_front (uint8_t* item, size_t size) @@ -11621,13 +12300,43 @@ void allocator::thread_item_front (uint8_t* item, size_t size) if (al->alloc_list_tail() == 0) { + assert (al->alloc_list_head() == 0); al->alloc_list_tail() = al->alloc_list_head(); } + +#ifdef DOUBLY_LINKED_FL + if (gen_number == max_generation) + { + if (al->alloc_list_head() != 0) + { + free_list_prev (al->alloc_list_head()) = item; + } + } +#endif //DOUBLY_LINKED_FL + al->alloc_list_head() = item; if (al->alloc_list_tail() == 0) { al->alloc_list_tail() = item; } + +#ifdef DOUBLY_LINKED_FL + if (gen_number == max_generation) + { + free_list_prev (item) = 0; + + dprintf (3333, ("[g%2d, b%2d]TFF: exit: %Ix->%Ix->%Ix (h: %Ix, t: %Ix)", + gen_number, a_l_number, + free_list_prev (item), item, free_list_slot (item), + al->alloc_list_head(), al->alloc_list_tail())); + dprintf (3333, ("[g%2d, b%2d]TFF: h->N: %Ix, h->P: %Ix, t->N: %Ix, t->P: %Ix", + gen_number, a_l_number, + (al->alloc_list_head() ? free_list_slot (al->alloc_list_head()) : 0), + (al->alloc_list_head() ? free_list_prev (al->alloc_list_head()) : 0), + (al->alloc_list_tail() ? free_list_slot (al->alloc_list_tail()) : 0), + (al->alloc_list_tail() ? free_list_prev (al->alloc_list_tail()) : 0))); + } +#endif //DOUBLY_LINKED_FL } void allocator::copy_to_alloc_list (alloc_list* toalist) @@ -11636,6 +12345,11 @@ void allocator::copy_to_alloc_list (alloc_list* toalist) { toalist [i] = alloc_list_of (i); #ifdef FL_VERIFICATION + size_t damage_count = alloc_list_damage_count_of (i); + // We are only calling this method to copy to an empty list + // so damage count is always 0 + assert (damage_count == 0); + uint8_t* free_item = alloc_list_head_of (i); size_t count = 0; while (free_item) @@ -11652,9 +12366,37 @@ void allocator::copy_to_alloc_list (alloc_list* toalist) void allocator::copy_from_alloc_list (alloc_list* fromalist) { BOOL repair_list = !discard_if_no_fit_p (); - for (unsigned int i = 0; i < num_buckets; i++) +#ifdef DOUBLY_LINKED_FL + BOOL bgc_repair_p = FALSE; + if (gen_number == max_generation) + { + bgc_repair_p = TRUE; + + if (alloc_list_damage_count_of (0) != 0) + { + GCToOSInterface::DebugBreak(); + } + + uint8_t* b0_head = alloc_list_head_of (0); + if (b0_head) + { + free_list_prev (b0_head) = 0; + } + + added_alloc_list_head_of (0) = 0; + added_alloc_list_tail_of (0) = 0; + } + + unsigned int start_index = (bgc_repair_p ? 1 : 0); +#else + unsigned int start_index = 0; + +#endif //DOUBLY_LINKED_FL + + for (unsigned int i = start_index; i < num_buckets; i++) { size_t count = alloc_list_damage_count_of (i); + alloc_list_of (i) = fromalist [i]; assert (alloc_list_damage_count_of (i) == 0); @@ -11664,12 +12406,14 @@ void allocator::copy_from_alloc_list (alloc_list* fromalist) //new items may have been added during the plan phase //items may have been unlinked. uint8_t* free_item = alloc_list_head_of (i); + while (free_item && count) { assert (((CObjectHeader*)free_item)->IsFree()); if ((free_list_undo (free_item) != UNDO_EMPTY)) { count--; + free_list_slot (free_item) = free_list_undo (free_item); free_list_undo (free_item) = UNDO_EMPTY; } @@ -11677,6 +12421,14 @@ void allocator::copy_from_alloc_list (alloc_list* fromalist) free_item = free_list_slot (free_item); } +#ifdef DOUBLY_LINKED_FL + if (bgc_repair_p) + { + added_alloc_list_head_of (i) = 0; + added_alloc_list_tail_of (i) = 0; + } +#endif //DOUBLY_LINKED_FL + #ifdef FL_VERIFICATION free_item = alloc_list_head_of (i); size_t item_count = 0; @@ -11689,6 +12441,7 @@ void allocator::copy_from_alloc_list (alloc_list* fromalist) assert (item_count == alloc_list_of (i).item_count); #endif //FL_VERIFICATION } + #ifdef DEBUG uint8_t* tail_item = alloc_list_tail_of (i); assert ((tail_item == 0) || (free_list_slot (tail_item) == 0)); @@ -11699,13 +12452,37 @@ void allocator::copy_from_alloc_list (alloc_list* fromalist) void allocator::commit_alloc_list_changes() { BOOL repair_list = !discard_if_no_fit_p (); +#ifdef DOUBLY_LINKED_FL + BOOL bgc_repair_p = FALSE; + if (gen_number == max_generation) + { + bgc_repair_p = TRUE; + } +#endif //DOUBLY_LINKED_FL + if (repair_list) { for (unsigned int i = 0; i < num_buckets; i++) { //remove the undo info from list. uint8_t* free_item = alloc_list_head_of (i); + +#ifdef DOUBLY_LINKED_FL + if (bgc_repair_p) + { + dprintf (3, ("C[b%2d] ENTRY: h: %Ix t: %Ix", i, + alloc_list_head_of (i), alloc_list_tail_of (i))); + } + + if (free_item && bgc_repair_p) + { + if (free_list_prev (free_item) != 0) + free_list_prev (free_item) = 0; + } +#endif //DOUBLY_LINKED_FL + size_t count = alloc_list_damage_count_of (i); + while (free_item && count) { assert (((CObjectHeader*)free_item)->IsFree()); @@ -11713,6 +12490,16 @@ void allocator::commit_alloc_list_changes() if (free_list_undo (free_item) != UNDO_EMPTY) { free_list_undo (free_item) = UNDO_EMPTY; + +#ifdef DOUBLY_LINKED_FL + if (bgc_repair_p) + { + uint8_t* next_item = free_list_slot (free_item); + if (next_item && (free_list_prev (next_item) != free_item)) + free_list_prev (next_item) = free_item; + } +#endif //DOUBLY_LINKED_FL + count--; } @@ -11720,6 +12507,41 @@ void allocator::commit_alloc_list_changes() } alloc_list_damage_count_of (i) = 0; + +#ifdef DOUBLY_LINKED_FL + if (bgc_repair_p) + { + uint8_t* head = alloc_list_head_of (i); + uint8_t* tail_added = added_alloc_list_tail_of (i); + + if (tail_added) + { + assert (free_list_slot (tail_added) == 0); + + if (head) + { + free_list_slot (tail_added) = head; + free_list_prev (head) = tail_added; + } + } + + uint8_t* head_added = added_alloc_list_head_of (i); + + if (head_added) + { + alloc_list_head_of (i) = head_added; + uint8_t* final_head = alloc_list_head_of (i); + + if (alloc_list_tail_of (i) == 0) + { + alloc_list_tail_of (i) = tail_added; + } + } + + added_alloc_list_head_of (i) = 0; + added_alloc_list_tail_of (i) = 0; + } +#endif //DOUBLY_LINKED_FL } } } @@ -12013,7 +12835,7 @@ void gc_heap::check_for_full_gc (int gen_num, size_t size) { return; } - + if (gen_num < max_generation) { gen_num = max_generation; @@ -12334,7 +13156,7 @@ BOOL gc_heap::a_fit_free_list_p (int gen_number, #ifdef BACKGROUND_GC void gc_heap::bgc_uoh_alloc_clr (uint8_t* alloc_start, - size_t size, + size_t size, alloc_context* acontext, uint32_t flags, int align_const, @@ -12343,6 +13165,9 @@ void gc_heap::bgc_uoh_alloc_clr (uint8_t* alloc_start, heap_segment* seg) { make_unused_array (alloc_start, size); +#ifdef DOUBLY_LINKED_FL + clear_prev_bit (alloc_start, size); +#endif //DOUBLY_LINKED_FL size_t size_of_array_base = sizeof(ArrayBase); @@ -12414,7 +13239,7 @@ void gc_heap::bgc_uoh_alloc_clr (uint8_t* alloc_start, BOOL gc_heap::a_fit_free_list_uoh_p (size_t size, alloc_context* acontext, - uint32_t flags, + uint32_t flags, int align_const, int gen_number) { @@ -12454,8 +13279,8 @@ BOOL gc_heap::a_fit_free_list_uoh_p (size_t size, bgc_track_uoh_alloc(); #endif //BACKGROUND_GC - //unlink the free_item allocator->unlink_item (a_l_idx, free_list, prev_free_item, FALSE); + remove_gen_free (gen_number, free_list_size); // Substract min obj size because limit_from_size adds it. Not needed for LOH size_t limit = limit_from_size (size - Align(min_obj_size, align_const), flags, free_list_size, @@ -12481,6 +13306,7 @@ BOOL gc_heap::a_fit_free_list_uoh_p (size_t size, if (remain_size >= Align(min_free_list, align_const)) { loh_thread_gap_front (remain, remain_size, gen); + add_gen_free (gen_number, remain_size); assert (remain_size >= Align (min_obj_size, align_const)); } else @@ -12488,6 +13314,8 @@ BOOL gc_heap::a_fit_free_list_uoh_p (size_t size, generation_free_obj_space (gen) += remain_size; } generation_free_list_space (gen) -= free_list_size; + generation_free_list_allocated (gen) += limit; + dprintf (3, ("found fit on loh at %Ix", free_list)); #ifdef BACKGROUND_GC if (cookie != -1) @@ -12668,7 +13496,9 @@ BOOL gc_heap::uoh_a_fit_segment_end_p (int gen_number, oom_reason* oom_r) { *commit_failed_p = FALSE; - heap_segment* seg = generation_allocation_segment (generation_of (gen_number)); + + generation* gen = generation_of (gen_number); + heap_segment* seg = generation_allocation_segment (gen); BOOL can_allocate_p = FALSE; while (seg) @@ -12699,6 +13529,11 @@ BOOL gc_heap::uoh_a_fit_segment_end_p (int gen_number, seg = heap_segment_next_rw (seg); } + if (can_allocate_p) + { + generation_end_seg_allocated (gen) += size; + } + return can_allocate_p; } @@ -13449,7 +14284,7 @@ allocation_state gc_heap::allocate_uoh (int gen_number, can_use_existing_p = uoh_try_fit (gen_number, size, acontext, flags, align_const, &commit_failed_p, &oom_r); uoh_alloc_state = (can_use_existing_p ? - a_state_can_allocate : + a_state_can_allocate : (commit_failed_p ? a_state_trigger_full_compact_gc : a_state_acquire_seg)); @@ -13461,7 +14296,7 @@ allocation_state gc_heap::allocate_uoh (int gen_number, BOOL commit_failed_p = FALSE; BOOL can_use_existing_p = FALSE; - can_use_existing_p = uoh_try_fit (gen_number, size, acontext, flags, + can_use_existing_p = uoh_try_fit (gen_number, size, acontext, flags, align_const, &commit_failed_p, &oom_r); // Even after we got a new seg it doesn't necessarily mean we can allocate, // another LOH allocating thread could have beat us to acquire the msl so @@ -13510,9 +14345,9 @@ allocation_state gc_heap::allocate_uoh (int gen_number, current_full_compact_gc_count = get_full_compact_gc_count(); can_get_new_seg_p = uoh_get_new_seg (gen_number, size, &did_full_compacting_gc, &oom_r); - uoh_alloc_state = (can_get_new_seg_p ? - a_state_try_fit_new_seg : - (did_full_compacting_gc ? + uoh_alloc_state = (can_get_new_seg_p ? + a_state_try_fit_new_seg : + (did_full_compacting_gc ? a_state_check_retry_seg : a_state_check_and_wait_for_bgc)); break; @@ -13528,8 +14363,8 @@ allocation_state gc_heap::allocate_uoh (int gen_number, // Since we release the msl before we try to allocate a seg, other // threads could have allocated a bunch of segments before us so // we might need to retry. - uoh_alloc_state = (can_get_new_seg_p ? - a_state_try_fit_after_cg : + uoh_alloc_state = (can_get_new_seg_p ? + a_state_try_fit_after_cg : a_state_check_retry_seg); break; } @@ -13540,10 +14375,10 @@ allocation_state gc_heap::allocate_uoh (int gen_number, current_full_compact_gc_count = get_full_compact_gc_count(); - can_get_new_seg_p = uoh_get_new_seg (gen_number, size, &did_full_compacting_gc, &oom_r); - uoh_alloc_state = (can_get_new_seg_p ? - a_state_try_fit_new_seg : - (did_full_compacting_gc ? + can_get_new_seg_p = uoh_get_new_seg (gen_number, size, &did_full_compacting_gc, &oom_r); + uoh_alloc_state = (can_get_new_seg_p ? + a_state_try_fit_new_seg : + (did_full_compacting_gc ? a_state_check_retry_seg : a_state_trigger_full_compact_gc)); assert ((uoh_alloc_state != a_state_cant_allocate) || (oom_r != oom_no_failure)); @@ -13556,8 +14391,8 @@ allocation_state gc_heap::allocate_uoh (int gen_number, bgc_in_progress_p = check_and_wait_for_bgc (awr_loh_oos_bgc, &did_full_compacting_gc, true); uoh_alloc_state = (!bgc_in_progress_p ? - a_state_trigger_full_compact_gc : - (did_full_compacting_gc ? + a_state_trigger_full_compact_gc : + (did_full_compacting_gc ? a_state_try_fit_after_cg : a_state_try_fit_after_bgc)); break; @@ -13590,9 +14425,9 @@ allocation_state gc_heap::allocate_uoh (int gen_number, should_retry_get_seg = TRUE; } } - - uoh_alloc_state = (should_retry_gc ? - a_state_trigger_full_compact_gc : + + uoh_alloc_state = (should_retry_gc ? + a_state_trigger_full_compact_gc : (should_retry_get_seg ? a_state_try_fit_after_cg : a_state_cant_allocate)); @@ -13860,7 +14695,7 @@ void gc_heap::balance_heaps (alloc_context* acontext) home_hp = acontext->get_home_heap ()->pGenGCHeap; proc_hp_num = heap_select::select_heap (acontext); - if (acontext->get_home_heap () != GCHeap::GetHeap (proc_hp_num)) + if (home_hp != gc_heap::g_heaps[proc_hp_num]) { #ifdef HEAP_BALANCE_INSTRUMENTATION alloc_count_p = false; @@ -13869,10 +14704,6 @@ void gc_heap::balance_heaps (alloc_context* acontext) } else if ((acontext->alloc_count & 15) == 0) set_home_heap = TRUE; - - if (set_home_heap) - { - } } else { @@ -13924,84 +14755,153 @@ void gc_heap::balance_heaps (alloc_context* acontext) return; } +#ifdef HEAP_BALANCE_INSTRUMENTATION + proc_no = GCToOSInterface::GetCurrentProcessorNumber (); + if (proc_no != last_proc_no) + { + dprintf (HEAP_BALANCE_TEMP_LOG, ("TEMPSP: %d->%d", last_proc_no, proc_no)); + multiple_procs_p = true; + last_proc_no = proc_no; + } + + int new_home_hp_num = heap_select::proc_no_to_heap_no[proc_no]; +#else + int new_home_hp_num = heap_select::select_heap(acontext); +#endif //HEAP_BALANCE_INSTRUMENTATION + gc_heap* new_home_hp = gc_heap::g_heaps[new_home_hp_num]; + acontext->set_home_heap (new_home_hp->vm_heap); + int start, end, finish; - heap_select::get_heap_range_for_heap (org_hp->heap_number, &start, &end); + heap_select::get_heap_range_for_heap (new_home_hp_num, &start, &end); finish = start + n_heaps; -try_again: - gc_heap* new_home_hp = 0; - do { max_hp = org_hp; max_hp_num = org_hp_num; max_size = org_size + delta; -#ifdef HEAP_BALANCE_INSTRUMENTATION - proc_no = GCToOSInterface::GetCurrentProcessorNumber (); - if (proc_no != last_proc_no) - { - dprintf (HEAP_BALANCE_TEMP_LOG, ("TEMPSP: %d->%d", last_proc_no, proc_no)); - multiple_procs_p = true; - last_proc_no = proc_no; - } - - int current_hp_num = heap_select::proc_no_to_heap_no[proc_no]; - acontext->set_home_heap (GCHeap::GetHeap (current_hp_num)); -#else - acontext->set_home_heap (GCHeap::GetHeap (heap_select::select_heap (acontext))); -#endif //HEAP_BALANCE_INSTRUMENTATION - new_home_hp = acontext->get_home_heap ()->pGenGCHeap; + org_alloc_context_count = org_hp->alloc_context_count; + max_alloc_context_count = org_alloc_context_count; if (org_hp == new_home_hp) max_size = max_size + delta; - org_alloc_context_count = org_hp->alloc_context_count; - max_alloc_context_count = org_alloc_context_count; if (max_alloc_context_count > 1) max_size /= max_alloc_context_count; - int actual_start = start; - int actual_end = (end - 1); - - for (int i = start; i < end; i++) + // check if the new home heap has more space + if (org_hp != new_home_hp) { - gc_heap* hp = GCHeap::GetHeap (i % n_heaps)->pGenGCHeap; - dd = hp->dynamic_data_of (0); - ptrdiff_t size = dd_new_allocation (dd); + dd = new_home_hp->dynamic_data_of(0); + ptrdiff_t size = dd_new_allocation(dd); - if (hp == new_home_hp) - { - size = size + delta; - } - int hp_alloc_context_count = hp->alloc_context_count; + // favor new home heap over org heap + size += delta * 2; + + int new_home_hp_alloc_context_count = new_home_hp->alloc_context_count; + if (new_home_hp_alloc_context_count > 0) + size /= (new_home_hp_alloc_context_count + 1); - if (hp_alloc_context_count > 0) - { - size /= (hp_alloc_context_count + 1); - } if (size > max_size) { #ifdef HEAP_BALANCE_INSTRUMENTATION - dprintf (HEAP_BALANCE_TEMP_LOG, ("TEMPorg h%d(%dmb), m h%d(%dmb)", + dprintf(HEAP_BALANCE_TEMP_LOG, ("TEMPorg h%d(%dmb), m h%d(%dmb)", org_hp_num, (max_size / 1024 / 1024), - hp->heap_number, (size / 1024 / 1024))); + new_home_hp_num, (size / 1024 / 1024))); #endif //HEAP_BALANCE_INSTRUMENTATION - max_hp = hp; + max_hp = new_home_hp; max_size = size; - max_hp_num = max_hp->heap_number; - max_alloc_context_count = hp_alloc_context_count; + max_hp_num = new_home_hp_num; + max_alloc_context_count = new_home_hp_alloc_context_count; } } - } - while (org_alloc_context_count != org_hp->alloc_context_count || - max_alloc_context_count != max_hp->alloc_context_count); - if ((max_hp == org_hp) && (end < finish)) - { - start = end; end = finish; - delta = local_delta * 2; // Make it twice as hard to balance to remote nodes on NUMA. - goto try_again; + // consider heaps both inside our local NUMA node, + // and outside, but with different thresholds + enum + { + LOCAL_NUMA_NODE, + REMOTE_NUMA_NODE + }; + + for (int pass = LOCAL_NUMA_NODE; pass <= REMOTE_NUMA_NODE; pass++) + { + int count = end - start; + int max_tries = min(count, 4); + + // we will consider max_tries consecutive (in a circular sense) + // other heaps from a semi random starting point + + // alloc_count often increases by multiples of 16 (due to logic at top of routine), + // and we want to advance the starting point by 4 between successive calls, + // therefore the shift right by 2 bits + int heap_num = start + ((acontext->alloc_count >> 2) + new_home_hp_num) % count; + +#ifdef HEAP_BALANCE_INSTRUMENTATION + dprintf(HEAP_BALANCE_TEMP_LOG, ("TEMP starting at h%d (home_heap_num = %d, alloc_count = %d)", heap_num, new_home_hp_num, acontext->alloc_count)); +#endif //HEAP_BALANCE_INSTRUMENTATION + + for (int tries = max_tries; --tries >= 0; heap_num++) + { + // wrap around if we hit the end of our range + if (heap_num >= end) + heap_num -= count; + // wrap around if we hit the end of the heap numbers + if (heap_num >= n_heaps) + heap_num -= n_heaps; + + assert (heap_num < n_heaps); + gc_heap* hp = gc_heap::g_heaps[heap_num]; + dd = hp->dynamic_data_of(0); + ptrdiff_t size = dd_new_allocation(dd); + +#ifdef HEAP_BALANCE_INSTRUMENTATION + dprintf(HEAP_BALANCE_TEMP_LOG, ("TEMP looking at h%d(%dmb)", + heap_num, (size / 1024 / 1024))); +#endif //HEAP_BALANCE_INSTRUMENTATION + // if the size is not bigger than what we already have, + // give up immediately, as it can't be a winner... + // this is a micro-optimization to avoid fetching the + // alloc_context_count and possibly dividing by it + if (size <= max_size) + continue; + + int hp_alloc_context_count = hp->alloc_context_count; + + if (hp_alloc_context_count > 0) + { + size /= (hp_alloc_context_count + 1); + } + + if (size > max_size) + { +#ifdef HEAP_BALANCE_INSTRUMENTATION + dprintf(HEAP_BALANCE_TEMP_LOG, ("TEMPorg h%d(%dmb), m h%d(%dmb)", + org_hp_num, (max_size / 1024 / 1024), + hp->heap_number, (size / 1024 / 1024))); +#endif //HEAP_BALANCE_INSTRUMENTATION + + max_hp = hp; + max_size = size; + max_hp_num = max_hp->heap_number; + max_alloc_context_count = hp_alloc_context_count; + } + } + + if ((max_hp == org_hp) && (end < finish)) + { + start = end; end = finish; + delta = local_delta * 2; // Make it twice as hard to balance to remote nodes on NUMA. + } + else + { + // we already found a better heap, or there are no remote NUMA nodes + break; + } + } } + while (org_alloc_context_count != org_hp->alloc_context_count || + max_alloc_context_count != max_hp->alloc_context_count); #ifdef HEAP_BALANCE_INSTRUMENTATION uint16_t ideal_proc_no_before_set_ideal = 0; @@ -14121,7 +15021,7 @@ gc_heap* gc_heap::balance_heaps_uoh (alloc_context* acontext, size_t alloc_size, if (max_hp != home_hp) { - dprintf (3, ("uoh: %d(%Id)->%d(%Id)", + dprintf (3, ("uoh: %d(%Id)->%d(%Id)", home_hp->heap_number, dd_new_allocation (home_hp->dynamic_data_of (generation_num)), max_hp->heap_number, dd_new_allocation (max_hp->dynamic_data_of (generation_num)))); } @@ -14256,10 +15156,17 @@ void gc_heap::leave_allocation_segment (generation* gen) void gc_heap::init_free_and_plug() { #ifdef FREE_USAGE_STATS - for (int i = 0; i <= settings.condemned_generation; i++) + int i = (settings.concurrent ? max_generation : 0); + + for (; i <= settings.condemned_generation; i++) { generation* gen = generation_of (i); +#ifdef DOUBLY_LINKED_FL + print_free_and_plug ("BGC"); +#else memset (gen->gen_free_spaces, 0, sizeof (gen->gen_free_spaces)); +#endif //DOUBLY_LINKED_FL + memset (gen->gen_plugs_allocated_in_free, 0, sizeof (gen->gen_plugs_allocated_in_free)); memset (gen->gen_plugs, 0, sizeof (gen->gen_plugs)); memset (gen->gen_current_pinned_free_spaces, 0, sizeof (gen->gen_current_pinned_free_spaces)); } @@ -14301,23 +15208,32 @@ void gc_heap::print_free_and_plug (const char* msg) #endif //FREE_USAGE_STATS && SIMPLE_DPRINTF } -void gc_heap::add_gen_plug (int gen_number, size_t plug_size) +// replace with allocator::first_suitable_bucket +int gc_heap::find_bucket (size_t size) { -#ifdef FREE_USAGE_STATS - dprintf (3, ("adding plug size %Id to gen%d", plug_size, gen_number)); - generation* gen = generation_of (gen_number); size_t sz = BASE_GEN_SIZE; int i = 0; - for (; i < NUM_GEN_POWER2; i++) + for (; i < (NUM_GEN_POWER2 - 1); i++) { - if (plug_size < sz) + if (size < sz) { break; } sz = sz * 2; } + return i; +} + +void gc_heap::add_gen_plug (int gen_number, size_t plug_size) +{ +#ifdef FREE_USAGE_STATS + dprintf (3, ("adding plug size %Id to gen%d", plug_size, gen_number)); + generation* gen = generation_of (gen_number); + size_t sz = BASE_GEN_SIZE; + int i = find_bucket (plug_size); + (gen->gen_plugs[i])++; #else UNREFERENCED_PARAMETER(gen_number); @@ -14330,16 +15246,7 @@ void gc_heap::add_item_to_current_pinned_free (int gen_number, size_t free_size) #ifdef FREE_USAGE_STATS generation* gen = generation_of (gen_number); size_t sz = BASE_GEN_SIZE; - int i = 0; - - for (; i < NUM_GEN_POWER2; i++) - { - if (free_size < sz) - { - break; - } - sz = sz * 2; - } + int i = find_bucket (free_size); (gen->gen_current_pinned_free_spaces[i])++; generation_pinned_free_obj_space (gen) += free_size; @@ -14353,24 +15260,25 @@ void gc_heap::add_item_to_current_pinned_free (int gen_number, size_t free_size) #endif //FREE_USAGE_STATS } +// This is only for items large enough to be on the FL +// Ideally we should keep track of smaller ones too but for now +// it's easier to make the accounting right void gc_heap::add_gen_free (int gen_number, size_t free_size) { #ifdef FREE_USAGE_STATS dprintf (3, ("adding free size %Id to gen%d", free_size, gen_number)); + if (free_size < min_free_list) + return; + generation* gen = generation_of (gen_number); size_t sz = BASE_GEN_SIZE; - int i = 0; + int i = find_bucket (free_size); - for (; i < NUM_GEN_POWER2; i++) + (gen->gen_free_spaces[i])++; + if (gen_number == max_generation) { - if (free_size < sz) - { - break; - } - sz = sz * 2; + //dprintf (2, ("Mb b%d: f+ %Id (%Id->%Id)", i, free_size, (gen->gen_free_spaces[i]).num_items, (gen->gen_free_spaces[i]).total_size)); } - - (gen->gen_free_spaces[i])++; #else UNREFERENCED_PARAMETER(gen_number); UNREFERENCED_PARAMETER(free_size); @@ -14381,29 +15289,82 @@ void gc_heap::remove_gen_free (int gen_number, size_t free_size) { #ifdef FREE_USAGE_STATS dprintf (3, ("removing free %Id from gen%d", free_size, gen_number)); + if (free_size < min_free_list) + return; + generation* gen = generation_of (gen_number); size_t sz = BASE_GEN_SIZE; - int i = 0; + int i = find_bucket (free_size); - for (; i < NUM_GEN_POWER2; i++) + (gen->gen_free_spaces[i])--; + if (gen_number == max_generation) { - if (free_size < sz) - { - break; - } - sz = sz * 2; + //dprintf (2, ("Mb b%d: f- %Id (%Id->%Id)", i, free_size, (gen->gen_free_spaces[i]).num_items, (gen->gen_free_spaces[i]).total_size)); } - - (gen->gen_free_spaces[i])--; #else UNREFERENCED_PARAMETER(gen_number); UNREFERENCED_PARAMETER(free_size); #endif //FREE_USAGE_STATS } +#ifdef DOUBLY_LINKED_FL +// This is only called on free spaces. +BOOL gc_heap::should_set_bgc_mark_bit (uint8_t* o) +{ + if (!current_sweep_seg) + { + assert (current_bgc_state == bgc_not_in_process); + return FALSE; + } + + // This is cheaper so I am doing this comparision first before having to get the seg for o. + if (in_range_for_segment (o, current_sweep_seg)) + { + // The current sweep seg could have free spaces beyond its background_allocated so we need + // to check for that. + if ((o >= current_sweep_pos) && (o < heap_segment_background_allocated (current_sweep_seg))) + { + if (current_sweep_seg == saved_sweep_ephemeral_seg) + return (o < saved_sweep_ephemeral_start); + else + return TRUE; + } + else + return FALSE; + } + else + { + // We can have segments outside the BGC range that were allocated during mark - and we + // wouldn't have committed the mark array for them and their background_allocated would be + // non-zero. Don't set mark bits for those. + // The ones allocated during BGC sweep would have their background_allocated as 0. + if ((o >= background_saved_lowest_address) && (o < background_saved_highest_address)) + { + heap_segment* seg = seg_mapping_table_segment_of (o); + // if bgc_allocated is 0 it means it was allocated during bgc sweep, + // and everything on it should be considered live. + uint8_t* background_allocated = heap_segment_background_allocated (seg); + if (background_allocated == 0) + return FALSE; + // During BGC sweep gen1 GCs could add some free spaces in gen2. + // If we use those, we should not set the mark bits on them. + // They could either be a newly allocated seg which is covered by the + // above case; or they are on a seg that's seen but beyond what BGC mark + // saw. + else if (o >= background_allocated) + return FALSE; + else + return (!heap_segment_swept_p (seg)); + } + else + return FALSE; + } +} +#endif //DOUBLY_LINKED_FL + uint8_t* gc_heap::allocate_in_older_generation (generation* gen, size_t size, - int from_gen_number, - uint8_t* old_loc REQD_ALIGN_AND_OFFSET_DCL) + int from_gen_number, + uint8_t* old_loc REQD_ALIGN_AND_OFFSET_DCL) { size = Align (size); assert (size >= Align (min_obj_size)); @@ -14411,6 +15372,14 @@ uint8_t* gc_heap::allocate_in_older_generation (generation* gen, size_t size, assert (from_gen_number >= 0); assert (generation_of (from_gen_number + 1) == gen); +#ifdef DOUBLY_LINKED_FL + BOOL consider_bgc_mark_p = FALSE; + BOOL check_current_sweep_p = FALSE; + BOOL check_saved_sweep_p = FALSE; + BOOL try_added_list_p = (gen->gen_num == max_generation); + BOOL record_free_list_allocated_p = ((gen->gen_num == max_generation) && (current_c_gc_state == c_gc_state_planning)); +#endif //DOUBLY_LINKED_FL + allocator* gen_allocator = generation_allocator (gen); BOOL discard_p = gen_allocator->discard_if_no_fit_p (); #ifdef SHORT_PLUGS @@ -14432,8 +15401,71 @@ uint8_t* gc_heap::allocate_in_older_generation (generation* gen, size_t size, { for (unsigned int a_l_idx = gen_allocator->first_suitable_bucket(real_size * 2); a_l_idx < gen_allocator->number_of_buckets(); a_l_idx++) { - uint8_t* free_list = gen_allocator->alloc_list_head_of (a_l_idx); + uint8_t* free_list = 0; uint8_t* prev_free_item = 0; + + BOOL use_undo_p = !discard_p; + +#ifdef DOUBLY_LINKED_FL + if (a_l_idx == 0) + { + use_undo_p = FALSE; + } + + if (try_added_list_p) + { + free_list = gen_allocator->added_alloc_list_head_of (a_l_idx); + while (free_list != 0) + { + dprintf (3, ("considering free list in added list%Ix", (size_t)free_list)); + + size_t free_list_size = unused_array_size (free_list); + + if (size_fit_p (size REQD_ALIGN_AND_OFFSET_ARG, free_list, (free_list + free_list_size), + old_loc, USE_PADDING_TAIL | pad_in_front)) + { + dprintf (4, ("F:%Ix-%Id", + (size_t)free_list, free_list_size)); + + gen_allocator->unlink_item_no_undo_added (a_l_idx, free_list, prev_free_item); + generation_free_list_space (gen) -= free_list_size; + + remove_gen_free (gen->gen_num, free_list_size); + + if (record_free_list_allocated_p) + { + generation_set_bgc_mark_bit_p (gen) = should_set_bgc_mark_bit (free_list); + dprintf (3333, ("SFA: %Ix->%Ix(%d)", free_list, (free_list + free_list_size), + (generation_set_bgc_mark_bit_p (gen) ? 1 : 0))); + } + adjust_limit (free_list, free_list_size, gen); + generation_allocate_end_seg_p (gen) = FALSE; + + goto finished; + } + // We do first fit on bucket 0 because we are not guaranteed to find a fit there. + else if (a_l_idx == 0) + { + dprintf (3, ("couldn't use this free area, discarding")); + generation_free_obj_space (gen) += free_list_size; + + gen_allocator->unlink_item_no_undo_added (a_l_idx, free_list, prev_free_item); + generation_free_list_space (gen) -= free_list_size; + + remove_gen_free (gen->gen_num, free_list_size); + } + else + { + prev_free_item = free_list; + } + free_list = free_list_slot (free_list); + } + } +#endif //DOUBLY_LINKED_FL + + free_list = gen_allocator->alloc_list_head_of (a_l_idx); + prev_free_item = 0; + while (free_list != 0) { dprintf (3, ("considering free list %Ix", (size_t)free_list)); @@ -14446,10 +15478,25 @@ uint8_t* gc_heap::allocate_in_older_generation (generation* gen, size_t size, dprintf (4, ("F:%Ix-%Id", (size_t)free_list, free_list_size)); - gen_allocator->unlink_item (a_l_idx, free_list, prev_free_item, !discard_p); + gen_allocator->unlink_item (a_l_idx, free_list, prev_free_item, use_undo_p); generation_free_list_space (gen) -= free_list_size; remove_gen_free (gen->gen_num, free_list_size); +#ifdef DOUBLY_LINKED_FL + if (!discard_p && !use_undo_p) + { + gen2_removed_no_undo += free_list_size; + dprintf (3, ("h%d: remove with no undo %Id = %Id", + heap_number, free_list_size, gen2_removed_no_undo)); + } + + if (record_free_list_allocated_p) + { + generation_set_bgc_mark_bit_p (gen) = should_set_bgc_mark_bit (free_list); + dprintf (3333, ("SF: %Ix(%d)", free_list, (generation_set_bgc_mark_bit_p (gen) ? 1 : 0))); + } +#endif //DOUBLY_LINKED_FL + adjust_limit (free_list, free_list_size, gen); generation_allocate_end_seg_p (gen) = FALSE; goto finished; @@ -14463,6 +15510,15 @@ uint8_t* gc_heap::allocate_in_older_generation (generation* gen, size_t size, gen_allocator->unlink_item (a_l_idx, free_list, prev_free_item, FALSE); generation_free_list_space (gen) -= free_list_size; remove_gen_free (gen->gen_num, free_list_size); + +#ifdef DOUBLY_LINKED_FL + if (!discard_p) + { + gen2_removed_no_undo += free_list_size; + dprintf (3, ("h%d: b0 remove with no undo %Id = %Id", + heap_number, free_list_size, gen2_removed_no_undo)); + } +#endif //DOUBLY_LINKED_FL } else { @@ -14582,12 +15638,28 @@ uint8_t* gc_heap::allocate_in_older_generation (generation* gen, size_t size, generation_allocation_pointer (gen) += size + pad; assert (generation_allocation_pointer (gen) <= generation_allocation_limit (gen)); + + generation_free_obj_space (gen) += pad; + if (generation_allocate_end_seg_p (gen)) { generation_end_seg_allocated (gen) += size; } else { +#ifdef DOUBLY_LINKED_FL + if (generation_set_bgc_mark_bit_p (gen)) + { + dprintf (2, ("IOM: %Ix(->%Ix(%Id) (%Ix-%Ix)", old_loc, result, pad, + (size_t)(&mark_array [mark_word_of (result)]), + (size_t)(mark_array [mark_word_of (result)]))); + + set_plug_bgc_mark_bit (old_loc); + } + + generation_last_free_list_allocated (gen) = old_loc; +#endif //DOUBLY_LINKED_FL + generation_free_list_allocated (gen) += size; } generation_allocation_size (gen) += size; @@ -14596,7 +15668,7 @@ uint8_t* gc_heap::allocate_in_older_generation (generation* gen, size_t size, generation_allocation_pointer (gen), generation_allocation_limit (gen), generation_allocation_context_start_region (gen))); - return result + pad;; + return (result + pad); } } @@ -15122,6 +16194,11 @@ uint8_t* gc_heap::allocate_in_condemned_generations (generation* gen, generation_allocation_pointer (gen) += size + pad; assert (generation_allocation_pointer (gen) <= generation_allocation_limit (gen)); + if ((pad > 0) && (to_gen_number >= 0)) + { + generation_free_obj_space (generation_of (to_gen_number)) += pad; + } + #ifdef FREE_USAGE_STATS generation_allocated_since_last_pin (gen) += size; #endif //FREE_USAGE_STATS @@ -15262,7 +16339,7 @@ int gc_heap::joined_generation_to_condemn (BOOL should_evaluate_elevation, else if ((current_total_committed * 10) >= (heap_hard_limit * 9)) { size_t loh_frag = get_total_gen_fragmentation (loh_generation); - + // If the LOH frag is >= 1/8 it's worth compacting it if ((loh_frag * 8) >= heap_hard_limit) { @@ -15666,8 +16743,8 @@ int gc_heap::generation_to_condemn (int n_initial, for (int i = uoh_start_generation; i < total_generation_count; i++) { - dd_fragmentation (dynamic_data_of (i)) = - generation_free_list_space (generation_of (i)) + + dd_fragmentation (dynamic_data_of (i)) = + generation_free_list_space (generation_of (i)) + generation_free_obj_space (generation_of (i)); } @@ -16091,8 +17168,8 @@ int gc_heap::generation_to_condemn (int n_initial, #ifdef MULTIPLE_HEAPS for (int i = 0; i < n_heaps; i++) { - if (((g_heaps[i]->current_generation_size (max_generation)) > bgc_min_per_heap) || - ((g_heaps[i]->current_generation_size (loh_generation)) > bgc_min_per_heap) || + if (((g_heaps[i]->current_generation_size (max_generation)) > bgc_min_per_heap) || + ((g_heaps[i]->current_generation_size (loh_generation)) > bgc_min_per_heap) || ((g_heaps[i]->current_generation_size (poh_generation)) > bgc_min_per_heap)) { bgc_heap_too_small = FALSE; @@ -16100,8 +17177,8 @@ int gc_heap::generation_to_condemn (int n_initial, } } #else //MULTIPLE_HEAPS - if ((current_generation_size (max_generation) > bgc_min_per_heap) || - (current_generation_size (loh_generation) > bgc_min_per_heap) || + if ((current_generation_size (max_generation) > bgc_min_per_heap) || + (current_generation_size (loh_generation) > bgc_min_per_heap) || (current_generation_size (poh_generation) > bgc_min_per_heap)) { bgc_heap_too_small = FALSE; @@ -16207,6 +17284,10 @@ void gc_heap::init_background_gc () PREFIX_ASSUME(generation_allocation_segment(gen) != NULL); +#ifdef DOUBLY_LINKED_FL + generation_set_bgc_mark_bit_p (gen) = FALSE; +#endif //DOUBLY_LINKED_FL + //reset the plan allocation for each segment for (heap_segment* seg = generation_allocation_segment (gen); seg != ephemeral_heap_segment; seg = heap_segment_next_rw (seg)) @@ -16750,7 +17831,7 @@ void gc_heap::gc1() #endif // HOST_64BIT gc_data_global.final_youngest_desired = desired_per_heap; } -#if 1 //subsumed by the linear allocation model +#if 1 //subsumed by the linear allocation model if (gen >= uoh_start_generation) { // to avoid spikes in mem usage due to short terms fluctuations in survivorship, @@ -17074,7 +18155,7 @@ BOOL gc_heap::loh_allocated_for_no_gc() return FALSE; heap_segment* seg = generation_allocation_segment (generation_of (loh_generation)); - do + do { if (seg == saved_loh_segment_no_gc) { @@ -18066,8 +19147,8 @@ gc_heap* gc_heap::heap_of_gc (uint8_t* o) // will find all heap objects (large and small) // // Callers of this method need to guarantee the interior pointer is within the heap range. -// -// If you need it to be stricter, eg if you only want to find an object in ephemeral range, +// +// If you need it to be stricter, eg if you only want to find an object in ephemeral range, // you should make sure interior is within that range before calling this method. uint8_t* gc_heap::find_object (uint8_t* interior) { @@ -18088,12 +19169,12 @@ uint8_t* gc_heap::find_object (uint8_t* interior) { // this is a pointer to a UOH object heap_segment* seg = find_segment (interior, FALSE); - if (seg + if (seg) + { #ifdef FEATURE_CONSERVATIVE_GC - && (GCConfig::GetConservativeGC() || interior <= heap_segment_allocated(seg)) + if (interior >= heap_segment_allocated(seg)) + return 0; #endif - ) - { // If interior falls within the first free object at the beginning of a generation, // we don't have brick entry for it, and we may incorrectly treat it as on large object heap. int align_const = get_alignment_constant (heap_segment_read_only_p (seg) @@ -19687,7 +20768,7 @@ void gc_heap::background_process_mark_overflow_internal (int condemned_gen_numbe while (seg) { uint8_t* o = hp->background_first_overflow (min_add, seg, concurrent_p, small_object_segments); - + while ((o < hp->background_seg_end (seg, concurrent_p)) && (o <= max_add)) { dprintf (3, ("considering %Ix", (size_t)o)); @@ -19986,7 +21067,7 @@ size_t gc_heap::committed_size() for (int i = max_generation; i < total_generation_count; i++) { generation* gen = generation_of (i); - heap_segment* seg = heap_segment_rw (generation_start_segment (gen)); + heap_segment* seg = heap_segment_rw (generation_start_segment (gen)); while (seg) { @@ -20512,6 +21593,13 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) if (!full_p) { +#ifdef FEATURE_CARD_MARKING_STEALING + n_eph_soh = 0; + n_gen_soh = 0; + n_eph_loh = 0; + n_gen_loh = 0; +#endif //FEATURE_CARD_MARKING_STEALING + #ifdef CARD_BUNDLE #ifdef MULTIPLE_HEAPS if (gc_t_join.r_join(this, gc_r_join_update_card_bundle)) @@ -20634,9 +21722,19 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) if (gc_t_join.joined()) #endif //MULTIPLE_HEAPS { + uint64_t promoted_bytes_global = 0; #ifdef HEAP_ANALYZE heap_analyze_enabled = FALSE; - GCToEEInterface::AnalyzeSurvivorsFinished(condemned_gen_number); +#ifdef MULTIPLE_HEAPS + for (int i = 0; i < n_heaps; i++) + { + promoted_bytes_global += promoted_bytes (i); + } +#else + promoted_bytes_global = promoted_bytes (0); +#endif //MULTIPLE_HEAPS + + GCToEEInterface::AnalyzeSurvivorsFinished (settings.gc_index, condemned_gen_number, promoted_bytes_global, GCHeap::ReportGenerationBounds); #endif // HEAP_ANALYZE GCToEEInterface::AfterGcScanRoots (condemned_gen_number, max_generation, &sc); @@ -20654,6 +21752,18 @@ void gc_heap::mark_phase (int condemned_gen_number, BOOL mark_only_p) #ifdef FEATURE_CARD_MARKING_STEALING reset_card_marking_enumerators(); + + if (!full_p) + { + int generation_skip_ratio_soh = ((n_eph_soh > MIN_SOH_CROSS_GEN_REFS) ? + (int)(((float)n_gen_soh / (float)n_eph_soh) * 100) : 100); + int generation_skip_ratio_loh = ((n_eph_loh > MIN_LOH_CROSS_GEN_REFS) ? + (int)(((float)n_gen_loh / (float)n_eph_loh) * 100) : 100); + + generation_skip_ratio = min (generation_skip_ratio_soh, generation_skip_ratio_loh); + dprintf (2, ("h%d skip ratio soh: %d, loh: %d", heap_number, + generation_skip_ratio_soh, generation_skip_ratio_loh)); + } #endif // FEATURE_CARD_MARKING_STEALING // null out the target of short weakref that were not promoted. @@ -21790,8 +22900,8 @@ BOOL gc_heap::plan_loh() heap_segment* seg = start_seg; uint8_t* o = generation_allocation_start (gen); - dprintf (1235, ("before GC LOH size: %Id, free list: %Id, free obj: %Id\n", - generation_size (loh_generation), + dprintf (1235, ("before GC LOH size: %Id, free list: %Id, free obj: %Id\n", + generation_size (loh_generation), generation_free_list_space (gen), generation_free_obj_space (gen))); @@ -22035,8 +23145,8 @@ void gc_heap::compact_loh() assert (loh_pinned_plug_que_empty_p()); - dprintf (1235, ("after GC LOH size: %Id, free list: %Id, free obj: %Id\n\n", - generation_size (loh_generation), + dprintf (1235, ("after GC LOH size: %Id, free list: %Id, free obj: %Id\n\n", + generation_size (loh_generation), generation_free_list_space (gen), generation_free_obj_space (gen))); } @@ -22091,8 +23201,8 @@ void gc_heap::relocate_in_loh_compact() } } - dprintf (1235, ("after GC LOH size: %Id, free list: %Id, free obj: %Id\n\n", - generation_size (loh_generation), + dprintf (1235, ("after GC LOH size: %Id, free list: %Id, free obj: %Id\n\n", + generation_size (loh_generation), generation_free_list_space (gen), generation_free_obj_space (gen))); } @@ -22476,6 +23586,15 @@ void gc_heap::plan_phase (int condemned_gen_number) memcpy (r_older_gen_free_space, older_gen->gen_free_spaces, sizeof (r_older_gen_free_space)); #endif //FREE_USAGE_STATS generation_allocate_end_seg_p (older_gen) = FALSE; + +#ifdef DOUBLY_LINKED_FL + if (older_gen->gen_num == max_generation) + { + generation_set_bgc_mark_bit_p (older_gen) = FALSE; + generation_last_free_list_allocated (older_gen) = 0; + } +#endif //DOUBLY_LINKED_FL + r_older_gen_free_list_allocated = generation_free_list_allocated (older_gen); r_older_gen_condemned_allocated = generation_condemned_allocated (older_gen); r_older_gen_end_seg_allocated = generation_end_seg_allocated (older_gen); @@ -22597,6 +23716,10 @@ void gc_heap::plan_phase (int condemned_gen_number) BOOL fire_pinned_plug_events_p = EVENT_ENABLED(PinPlugAtGCTime); size_t last_plug_len = 0; +#ifdef DOUBLY_LINKED_FL + gen2_removed_no_undo = 0; +#endif //DOUBLY_LINKED_FL + while (1) { if (x >= end) @@ -23347,7 +24470,8 @@ void gc_heap::plan_phase (int condemned_gen_number) } } - if (maxgen_size_inc_p && provisional_mode_triggered) + if (maxgen_size_inc_p && provisional_mode_triggered && + !(background_running_p() || (current_bgc_state == bgc_initialized))) { pm_trigger_full_gc = true; dprintf (GTC_LOG, ("in PM: maxgen size inc, doing a sweeping gen1 and trigger NGC2")); @@ -23458,7 +24582,8 @@ void gc_heap::plan_phase (int condemned_gen_number) rearrange_uoh_segments (); } - if (maxgen_size_inc_p && provisional_mode_triggered) + if (maxgen_size_inc_p && provisional_mode_triggered && + !(background_running_p() || (current_bgc_state == bgc_initialized))) { pm_trigger_full_gc = true; dprintf (GTC_LOG, ("in PM: maxgen size inc, doing a sweeping gen1 and trigger NGC2")); @@ -23495,7 +24620,8 @@ void gc_heap::plan_phase (int condemned_gen_number) if (!pm_trigger_full_gc && pm_stress_on && provisional_mode_triggered) { if ((settings.condemned_generation == (max_generation - 1)) && - ((settings.gc_index % 5) == 0)) + ((settings.gc_index % 5) == 0) && + !(background_running_p() || (current_bgc_state == bgc_initialized))) { pm_trigger_full_gc = true; } @@ -23747,9 +24873,28 @@ void gc_heap::plan_phase (int condemned_gen_number) if ((condemned_gen_number < max_generation)) { +#ifdef FREE_USAGE_STATS + memcpy (older_gen->gen_free_spaces, r_older_gen_free_space, sizeof (r_older_gen_free_space)); +#endif //FREE_USAGE_STATS generation_allocator (older_gen)->copy_from_alloc_list (r_free_list); generation_free_list_space (older_gen) = r_free_list_space; generation_free_obj_space (older_gen) = r_free_obj_space; + +#ifdef DOUBLY_LINKED_FL + if (condemned_gen_number == (max_generation - 1)) + { + dprintf (2, ("[h%d] no undo, FL %Id-%Id -> %Id, FO %Id+%Id=%Id", + heap_number, + generation_free_list_space (older_gen), gen2_removed_no_undo, + (generation_free_list_space (older_gen) - gen2_removed_no_undo), + generation_free_obj_space (older_gen), gen2_removed_no_undo, + (generation_free_obj_space (older_gen) + gen2_removed_no_undo))); + + generation_free_list_space (older_gen) -= gen2_removed_no_undo; + generation_free_obj_space (older_gen) += gen2_removed_no_undo; + } +#endif //DOUBLY_LINKED_FL + generation_free_list_allocated (older_gen) = r_older_gen_free_list_allocated; generation_end_seg_allocated (older_gen) = r_older_gen_end_seg_allocated; generation_condemned_allocated (older_gen) = r_older_gen_condemned_allocated; @@ -23770,7 +24915,14 @@ void gc_heap::plan_phase (int condemned_gen_number) gen0_big_free_spaces = 0; make_free_lists (condemned_gen_number); - recover_saved_pinned_info(); + size_t total_recovered_sweep_size = recover_saved_pinned_info(); + if (total_recovered_sweep_size > 0) + { + generation_free_obj_space (generation_of (max_generation)) -= total_recovered_sweep_size; + dprintf (2, ("h%d: deduct %Id for pin, fo->%Id", + heap_number, total_recovered_sweep_size, + generation_free_obj_space (generation_of (max_generation)))); + } #ifdef FEATURE_PREMORTEM_FINALIZATION finalize_queue->UpdatePromotedGenerations (condemned_gen_number, TRUE); @@ -23849,8 +25001,13 @@ void gc_heap::fix_generation_bounds (int condemned_gen_number, dprintf(3,("Fixing generation pointers for %Ix", gen_number)); if ((gen_number < max_generation) && ephemeral_promotion) { + size_t saved_eph_start_size = saved_ephemeral_plan_start_size[gen_number]; + make_unused_array (saved_ephemeral_plan_start[gen_number], - saved_ephemeral_plan_start_size[gen_number]); + saved_eph_start_size); + generation_free_obj_space (generation_of (max_generation)) += saved_eph_start_size; + dprintf (2, ("[h%d] EP %Ix(%Id)", heap_number, saved_ephemeral_plan_start[gen_number], + saved_ephemeral_plan_start_size[gen_number])); } reset_allocation_pointers (gen, generation_plan_allocation_start (gen)); make_unused_array (generation_allocation_start (gen), generation_plan_allocation_start_size (gen)); @@ -24090,6 +25247,21 @@ void gc_heap::make_free_list_in_brick (uint8_t* tree, make_free_args* args) clear_plug_padded (plug); } #endif //SHORT_PLUGS + +#ifdef DOUBLY_LINKED_FL + // These 2 checks should really just be merged into one. + if (is_plug_bgc_mark_bit_set (plug)) + { + dprintf (3333, ("cbgcm: %Ix", plug)); + clear_plug_bgc_mark_bit (plug); + } + if (is_free_obj_in_compact_bit_set (plug)) + { + dprintf (3333, ("cfoc: %Ix", plug)); + clear_free_obj_in_compact_bit (plug); + } +#endif //DOUBLY_LINKED_FL + gen_crossing: { if ((args->current_gen_limit == MAX_PTR) || @@ -25425,9 +26597,61 @@ void gc_heap::gcmemcopy (uint8_t* dest, uint8_t* src, size_t len, BOOL copy_car copy_mark_bits_for_addresses (dest, src, len); } #endif //BACKGROUND_GC + +#ifdef DOUBLY_LINKED_FL + BOOL set_bgc_mark_bits_p = is_plug_bgc_mark_bit_set (src); + if (set_bgc_mark_bits_p) + { + clear_plug_bgc_mark_bit (src); + } + + BOOL make_free_obj_p = FALSE; + if (len < min_free_item_no_prev) + { + make_free_obj_p = is_free_obj_in_compact_bit_set (src); + + if (make_free_obj_p) + { + clear_free_obj_in_compact_bit (src); + } + } +#endif //DOUBLY_LINKED_FL + //dprintf(3,(" Memcopy [%Ix->%Ix, %Ix->%Ix[", (size_t)src, (size_t)dest, (size_t)src+len, (size_t)dest+len)); dprintf(3,(" mc: [%Ix->%Ix, %Ix->%Ix[", (size_t)src, (size_t)dest, (size_t)src+len, (size_t)dest+len)); memcopy (dest - plug_skew, src - plug_skew, len); + +#ifdef DOUBLY_LINKED_FL + if (set_bgc_mark_bits_p) + { + uint8_t* dest_o = dest; + uint8_t* dest_end_o = dest + len; + while (dest_o < dest_end_o) + { + uint8_t* next_o = dest_o + Align (size (dest_o)); + background_mark (dest_o, background_saved_lowest_address, background_saved_highest_address); + + dest_o = next_o; + } + dprintf (3333, ("[h%d] GM: %Ix(%Ix-%Ix)->%Ix(%Ix-%Ix)", + heap_number, dest, + (size_t)(&mark_array [mark_word_of (dest)]), + (size_t)(mark_array [mark_word_of (dest)]), + dest_end_o, + (size_t)(&mark_array [mark_word_of (dest_o)]), + (size_t)(mark_array [mark_word_of (dest_o)]))); + } + + if (make_free_obj_p) + { + size_t* filler_free_obj_size_location = (size_t*)(dest + min_free_item_no_prev); + size_t filler_free_obj_size = *filler_free_obj_size_location; + make_unused_array ((dest + len), filler_free_obj_size); + dprintf (3333, ("[h%d] smallobj, %Ix(%Id): %Ix->%Ix", heap_number, + filler_free_obj_size_location, filler_free_obj_size, (dest + len), (dest + len + filler_free_obj_size))); + } +#endif //DOUBLY_LINKED_FL + #ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP if (SoftwareWriteWatch::IsEnabledForGCHeap()) { @@ -25673,14 +26897,27 @@ void gc_heap::compact_in_brick (uint8_t* tree, compact_args* args) } } -void gc_heap::recover_saved_pinned_info() +// This returns the recovered size for gen2 plugs as that's what we need +// mostly - would be nice to make it work for all generations. +size_t gc_heap::recover_saved_pinned_info() { reset_pinned_queue_bos(); + size_t total_recovered_sweep_size = 0; while (!(pinned_plug_que_empty_p())) { mark* oldest_entry = oldest_pin(); - oldest_entry->recover_plug_info(); + size_t recovered_sweep_size = oldest_entry->recover_plug_info(); + + if (recovered_sweep_size > 0) + { + uint8_t* plug = pinned_plug (oldest_entry); + if (object_gennum (plug) == max_generation) + { + dprintf (3, ("recovered %Ix(%Id) from pin", plug, recovered_sweep_size)); + total_recovered_sweep_size += recovered_sweep_size; + } + } #ifdef GC_CONFIG_DRIVEN if (oldest_entry->has_pre_plug_info() && oldest_entry->has_post_plug_info()) record_interesting_data_point (idp_pre_and_post_pin); @@ -25692,6 +26929,8 @@ void gc_heap::recover_saved_pinned_info() deque_pinned_plug(); } + + return total_recovered_sweep_size; } void gc_heap::compact_phase (int condemned_gen_number, @@ -25835,7 +27074,7 @@ void gc_heap::gc_thread_stub (void* arg) // server GC threads run at a higher priority than normal. GCToOSInterface::BoostThreadPriority(); - _alloca (256*heap->heap_number); + void* tmp = _alloca (256*heap->heap_number); heap->gc_thread_function(); } #ifdef _MSC_VER @@ -26280,7 +27519,7 @@ BOOL gc_heap::commit_mark_array_bgc_init() if (!(seg->flags & heap_segment_flags_ma_committed)) { // For ro segments they could always be only partially in range so we'd - // be calling this at the beginning of every BGC. We are not making this + // be calling this at the beginning of every BGC. We are not making this // more efficient right now - ro segments are currently only used by redhawk. if (heap_segment_read_only_p (seg)) { @@ -26312,7 +27551,7 @@ BOOL gc_heap::commit_mark_array_bgc_init() } else { - // For normal segments they are by design completely in range so just + // For normal segments they are by design completely in range so just // commit the whole mark array for each seg. if (commit_mark_array_by_seg (seg, mark_array)) { @@ -26942,9 +28181,9 @@ void gc_heap::background_mark_phase () gen0_bricks_cleared = FALSE; - dprintf (2, ("end of bgc mark: loh: %d, poh: %d, soh: %d", - generation_size (loh_generation), - generation_size (poh_generation), + dprintf (2, ("end of bgc mark: loh: %d, poh: %d, soh: %d", + generation_size (loh_generation), + generation_size (poh_generation), generation_sizes (generation_of (max_generation)))); for (int gen_idx = max_generation; gen_idx < total_generation_count; gen_idx++) @@ -26981,9 +28220,10 @@ void gc_heap::background_mark_phase () heap_segment_background_allocated (seg) = heap_segment_allocated (seg); } - dprintf (2, ("seg %Ix background allocated is %Ix", - heap_segment_mem (seg), - heap_segment_background_allocated (seg))); + dprintf (3333, ("h%d seg %Ix background allocated is %Ix", + heap_number, + (size_t)(seg), + heap_segment_background_allocated (seg))); seg = heap_segment_next_rw (seg); } @@ -27274,7 +28514,7 @@ void gc_heap::revisit_written_pages (BOOL concurrent_p, BOOL reset_only_p) if ((heap_segment_mem (seg) >= background_saved_lowest_address) || (heap_segment_reserved (seg) <= background_saved_highest_address)) { - dprintf (3, ("h%d: sseg: %Ix(-%Ix)", heap_number, + dprintf (3, ("h%d: sseg: %Ix(-%Ix)", heap_number, heap_segment_mem (seg), heap_segment_reserved (seg))); skip_seg_p = TRUE; } @@ -27290,7 +28530,7 @@ void gc_heap::revisit_written_pages (BOOL concurrent_p, BOOL reset_only_p) dprintf (3, ("h%d: reset only starting %Ix", heap_number, base_address)); } - dprintf (3, ("h%d: starting: %Ix, seg %Ix-%Ix", heap_number, base_address, + dprintf (3, ("h%d: starting: %Ix, seg %Ix-%Ix", heap_number, base_address, heap_segment_mem (seg), heap_segment_reserved (seg))); @@ -27338,7 +28578,7 @@ void gc_heap::revisit_written_pages (BOOL concurrent_p, BOOL reset_only_p) { total_dirtied_pages += bcount; - dprintf (3, ("Found %d pages [%Ix, %Ix[", + dprintf (3, ("Found %d pages [%Ix, %Ix[", bcount, (size_t)base_address, (size_t)high_address)); } @@ -27347,7 +28587,7 @@ void gc_heap::revisit_written_pages (BOOL concurrent_p, BOOL reset_only_p) for (unsigned i = 0; i < bcount; i++) { uint8_t* page = (uint8_t*)background_written_addresses[i]; - dprintf (3, ("looking at page %d at %Ix(h: %Ix)", i, + dprintf (3, ("looking at page %d at %Ix(h: %Ix)", i, (size_t)page, (size_t)high_address)); if (page < high_address) { @@ -27381,7 +28621,7 @@ void gc_heap::revisit_written_pages (BOOL concurrent_p, BOOL reset_only_p) } if (i < loh_generation) - { + { if (!reset_only_p) { dprintf (GTC_LOG, ("h%d: SOH: dp:%Id; mo: %Id", heap_number, total_dirtied_pages, total_marked_objects)); @@ -27563,7 +28803,7 @@ BOOL gc_heap::create_bgc_thread(gc_heap* gh) //dprintf (2, ("Creating BGC thread")); - gh->bgc_thread_running = GCToEEInterface::CreateThread(gh->bgc_thread_stub, gh, true, ".NET Background GC"); + gh->bgc_thread_running = GCToEEInterface::CreateThread(gh->bgc_thread_stub, gh, true, ".NET BGC"); return gh->bgc_thread_running; } @@ -27802,7 +29042,9 @@ void gc_heap::bgc_thread_function() gc1(); +#ifndef DOUBLY_LINKED_FL current_bgc_state = bgc_not_in_process; +#endif //!DOUBLY_LINKED_FL enable_preemptive (); #ifdef MULTIPLE_HEAPS @@ -28122,7 +29364,7 @@ void gc_heap::bgc_tuning::record_bgc_start() // Note that younger gen's collection count is always updated with older gen's collections. // So to calcuate the actual # of gen1 occurred we really should take the # of gen2s into - // acccount (and deduct from gen1's collection count). But right now I am using it for stats. + // account (and deduct from gen1's collection count). But right now I am using it for stats. size_t current_gen1_index = get_current_gc_index (max_generation - 1); dprintf (BGC_TUNING_LOG, ("BTL: g2t[st][g1 %Id]: %0.3f minutes", @@ -29468,7 +30710,6 @@ gc_heap::compute_next_boundary (int gen_number, assert (gen_number > settings.condemned_generation); return generation_allocation_start (generation_of (gen_number - 1 )); } - } inline void @@ -29543,7 +30784,6 @@ gc_heap::mark_through_cards_helper (uint8_t** poo, size_t& n_gen, cg_pointers_found ++; dprintf (4, ("cg pointer %Ix found, %Id so far", (size_t)*poo, cg_pointers_found )); - } } @@ -30011,9 +31251,20 @@ void gc_heap::mark_through_cards_for_segments (card_fn fn, BOOL relocating CARD_ // compute the efficiency ratio of the card table if (!relocating) { - generation_skip_ratio = ((n_eph > 400)? (int)(((float)n_gen / (float)n_eph) * 100) : 100); - dprintf (3, ("Msoh: cross: %Id, useful: %Id, cards set: %Id, cards cleared: %Id, ratio: %d", - n_eph, n_gen , n_card_set, total_cards_cleared, generation_skip_ratio)); +#ifdef FEATURE_CARD_MARKING_STEALING + Interlocked::ExchangeAddPtr(&n_eph_soh, n_eph); + Interlocked::ExchangeAddPtr(&n_gen_soh, n_gen); + dprintf (3, ("h%d marking h%d Msoh: cross: %Id, useful: %Id, cards set: %Id, cards cleared: %Id, ratio: %d", + hpt->heap_number, heap_number, n_eph, n_gen, n_card_set, total_cards_cleared, + (n_eph ? (int)(((float)n_gen / (float)n_eph) * 100) : 0))); + dprintf (3, ("h%d marking h%d Msoh: total cross %Id, useful: %Id, running ratio: %d", + hpt->heap_number, heap_number, n_eph_soh, n_gen_soh, + (n_eph_soh ? (int)(((float)n_gen_soh / (float)n_eph_soh) * 100) : 0))); +#else + generation_skip_ratio = ((n_eph > MIN_SOH_CROSS_GEN_REFS) ? (int)(((float)n_gen / (float)n_eph) * 100) : 100); + dprintf (3, ("marking h%d Msoh: cross: %Id, useful: %Id, cards set: %Id, cards cleared: %Id, ratio: %d", + heap_number, n_eph, n_gen, n_card_set, total_cards_cleared, generation_skip_ratio)); +#endif //FEATURE_CARD_MARKING_STEALING } else { @@ -31374,6 +32625,23 @@ generation* gc_heap::expand_heap (int condemned_generation, get_gc_data_per_heap()->set_mechanism (gc_heap_expand, expand_new_seg_ep); dprintf (2, ("promoting ephemeral")); save_ephemeral_generation_starts(); + + // We also need to adjust free_obj_space (due to padding) here because now young gens' free_obj_space will + // belong to gen2. + generation* max_gen = generation_of (max_generation); + for (int i = 1; i < max_generation; i++) + { + generation_free_obj_space (max_gen) += + generation_free_obj_space (generation_of (i)); + dprintf (2, ("[h%d] maxgen freeobj + %Id=%Id", + heap_number, generation_free_obj_space (generation_of (i)), + generation_free_obj_space (max_gen))); + } + + // TODO: This is actually insufficient - if BACKGROUND_GC is not defined we'd need to commit more + // in order to accommodate eph gen starts. Also in the no_gc we should make sure used + // is updated correctly. + heap_segment_used (new_seg) = heap_segment_committed (new_seg); } else { @@ -31724,8 +32992,8 @@ size_t gc_heap::desired_new_allocation (dynamic_data* dd, { size_t allocated = 0; size_t committed = uoh_committed_size (gen_number, &allocated); - dprintf (1, ("GC#%Id h%d, GMI: UOH budget, UOH commit %Id (obj %Id, frag %Id), total commit: %Id (recorded: %Id)", - (size_t)settings.gc_index, heap_number, + dprintf (1, ("GC#%Id h%d, GMI: UOH budget, UOH commit %Id (obj %Id, frag %Id), total commit: %Id (recorded: %Id)", + (size_t)settings.gc_index, heap_number, committed, allocated, dd_fragmentation (dynamic_data_of (gen_number)), get_total_committed_size(), (current_total_committed - current_total_committed_bookkeeping))); @@ -32136,7 +33404,7 @@ void gc_heap::trim_youngest_desired_low_memory() { if (g_low_memory_status) { - size_t committed_mem = committed_size(); + size_t committed_mem = committed_size(); dynamic_data* dd = dynamic_data_of (0); size_t current = dd_desired_allocation (dd); size_t candidate = max (Align ((committed_mem / 10), get_alignment_constant(FALSE)), dd_min_size (dd)); @@ -32147,7 +33415,7 @@ void gc_heap::trim_youngest_desired_low_memory() void gc_heap::decommit_ephemeral_segment_pages() { - if (settings.concurrent || use_large_pages_p) + if (settings.concurrent || use_large_pages_p || (settings.pause_mode == pause_no_gc)) { return; } @@ -32186,7 +33454,7 @@ void gc_heap::decommit_ephemeral_segment_pages() decommit_target += target_decrease * 2 / 3; } - heap_segment_decommit_target(ephemeral_heap_segment) = decommit_target; + heap_segment_decommit_target (ephemeral_heap_segment) = decommit_target; #ifdef MULTIPLE_HEAPS if (decommit_target < heap_segment_committed (ephemeral_heap_segment)) @@ -33047,8 +34315,8 @@ void gc_heap::generation_delete_heap_segment (generation* gen, { dprintf (3, ("Preparing empty large segment %Ix for deletion", (size_t)seg)); - // We cannot thread segs in here onto freeable_uoh_segment because - // grow_brick_card_tables could be committing mark array which needs to read + // We cannot thread segs in here onto freeable_uoh_segment because + // grow_brick_card_tables could be committing mark array which needs to read // the seg list. So we delay it till next time we suspend EE. seg->flags |= heap_segment_flags_uoh_delete; // Since we will be decommitting the seg, we need to prevent heap verification @@ -33057,12 +34325,14 @@ void gc_heap::generation_delete_heap_segment (generation* gen, } else { - if (seg == ephemeral_heap_segment) - { - FATAL_GC_ERROR(); - } + assert (seg != ephemeral_heap_segment); +#ifdef DOUBLY_LINKED_FL + // For doubly linked list we go forward for SOH + heap_segment_next (prev_seg) = next_seg; +#else //DOUBLY_LINKED_FL heap_segment_next (next_seg) = prev_seg; +#endif //DOUBLY_LINKED_FL dprintf (3, ("Preparing empty small segment %Ix for deletion", (size_t)seg)); heap_segment_next (seg) = freeable_soh_segment; @@ -33076,18 +34346,19 @@ void gc_heap::generation_delete_heap_segment (generation* gen, } void gc_heap::process_background_segment_end (heap_segment* seg, - generation* gen, - uint8_t* last_plug_end, - heap_segment* start_seg, - BOOL* delete_p) + generation* gen, + uint8_t* last_plug_end, + heap_segment* start_seg, + BOOL* delete_p, + size_t free_obj_size_last_gap) { *delete_p = FALSE; uint8_t* allocated = heap_segment_allocated (seg); uint8_t* background_allocated = heap_segment_background_allocated (seg); BOOL uoh_p = heap_segment_uoh_p (seg); - dprintf (3, ("Processing end of background segment [%Ix, %Ix[(%Ix[)", - (size_t)heap_segment_mem (seg), background_allocated, allocated)); + dprintf (3, ("EoS [%Ix, %Ix[(%Ix[), last: %Ix(%Id)", + (size_t)heap_segment_mem (seg), background_allocated, allocated, last_plug_end, free_obj_size_last_gap)); if (!uoh_p && (allocated != background_allocated)) { @@ -33095,15 +34366,20 @@ void gc_heap::process_background_segment_end (heap_segment* seg, dprintf (3, ("Make a free object before newly promoted objects [%Ix, %Ix[", (size_t)last_plug_end, background_allocated)); - thread_gap (last_plug_end, background_allocated - last_plug_end, generation_of (max_generation)); + size_t last_gap = background_allocated - last_plug_end; + if (last_gap > 0) + { + thread_gap (last_plug_end, last_gap, generation_of (max_generation)); + add_gen_free (max_generation, last_gap); - fix_brick_to_highest (last_plug_end, background_allocated); + fix_brick_to_highest (last_plug_end, background_allocated); - // When we allowed fgc's during going through gaps, we could have erased the brick - // that corresponds to bgc_allocated 'cause we had to update the brick there, - // recover it here. - fix_brick_to_highest (background_allocated, background_allocated); + // When we allowed fgc's during going through gaps, we could have erased the brick + // that corresponds to bgc_allocated 'cause we had to update the brick there, + // recover it here. + fix_brick_to_highest (background_allocated, background_allocated); + } } else { @@ -33134,7 +34410,10 @@ void gc_heap::process_background_segment_end (heap_segment* seg, } else { - dprintf (3, ("Trimming seg to %Ix[", (size_t)last_plug_end)); + dprintf (3, ("[h%d] seg %Ix alloc %Ix->%Ix", + heap_number, (size_t)seg, + heap_segment_allocated (seg), + (size_t)last_plug_end)); heap_segment_allocated (seg) = last_plug_end; set_mem_verify (heap_segment_allocated (seg) - plug_skew, heap_segment_used (seg), 0xbb); @@ -33142,6 +34421,13 @@ void gc_heap::process_background_segment_end (heap_segment* seg, } } + if (free_obj_size_last_gap) + { + generation_free_obj_space (gen) -= free_obj_size_last_gap; + dprintf (2, ("[h%d] PS: gen2FO-: %Id->%Id", + heap_number, free_obj_size_last_gap, generation_free_obj_space (gen))); + } + dprintf (3, ("verifying seg %Ix's mark array was completely cleared", seg)); bgc_verify_mark_array_cleared (seg); } @@ -33224,6 +34510,10 @@ void gc_heap::should_check_bgc_mark (heap_segment* seg, { dprintf (3, ("seg %Ix is already swept by bgc", seg)); } + else if (heap_segment_background_allocated (seg) == 0) + { + dprintf (3, ("seg %Ix newly alloc during bgc")); + } else { *consider_bgc_mark_p = TRUE; @@ -33380,9 +34670,22 @@ void gc_heap::background_sweep() for (int i = 0; i <= max_generation; i++) { generation* gen_to_reset = generation_of (i); - generation_allocator (gen_to_reset)->clear(); - generation_free_list_space (gen_to_reset) = 0; - generation_free_obj_space (gen_to_reset) = 0; +#ifdef DOUBLY_LINKED_FL + if (i == max_generation) + { + dprintf (2, ("h%d: gen2 still has FL: %Id, FO: %Id", + heap_number, + generation_free_list_space (gen_to_reset), + generation_free_obj_space (gen_to_reset))); + } + else +#endif //DOUBLY_LINKED_FL + { + generation_allocator (gen_to_reset)->clear(); + generation_free_list_space (gen_to_reset) = 0; + generation_free_obj_space (gen_to_reset) = 0; + } + generation_free_list_allocated (gen_to_reset) = 0; generation_end_seg_allocated (gen_to_reset) = 0; generation_condemned_allocated (gen_to_reset) = 0; @@ -33396,6 +34699,9 @@ void gc_heap::background_sweep() FIRE_EVENT(BGC2ndNonConEnd); uoh_alloc_thread_count = 0; + + init_free_and_plug(); + current_bgc_state = bgc_sweep_soh; verify_soh_segment_list(); @@ -33408,7 +34714,6 @@ void gc_heap::background_sweep() } #endif // FEATURE_BASICFREEZE - //TODO BACKGROUND_GC: can we move this to where we switch to the LOH? if (current_c_gc_state != c_gc_state_planning) { current_c_gc_state = c_gc_state_planning; @@ -33486,40 +34791,57 @@ void gc_heap::background_sweep() heap_segment* next_seg = 0; heap_segment* prev_seg; heap_segment* start_seg; - int align_const; + int align_const = get_alignment_constant (i == max_generation); +#ifndef DOUBLY_LINKED_FL if (i == max_generation) { // start with saved ephemeral segment - // we are no longer holding gc_lock, so a new ephemeral segment could be added, we want the saved one. + // we are no longer holding gc_lock, so a new ephemeral segment could be added, we want the saved one. start_seg = saved_sweep_ephemeral_seg; prev_seg = heap_segment_next(start_seg); - align_const = get_alignment_constant (TRUE); } else +#endif //!DOUBLY_LINKED_FL { + // If we use doubly linked FL we don't need to go backwards as we are maintaining the free list. start_seg = gen_start_seg; prev_seg = NULL; - align_const = get_alignment_constant (FALSE); - - // UOH allocations are possible while sweeping SOH, so - // we defer clearing UOH free lists until we start sweeping them - generation_allocator (gen)->clear(); - generation_free_list_space (gen) = 0; - generation_free_obj_space (gen) = 0; - generation_free_list_allocated (gen) = 0; - generation_end_seg_allocated (gen) = 0; - generation_condemned_allocated (gen) = 0; - generation_sweep_allocated (gen) = 0; - generation_allocation_pointer (gen)= 0; - generation_allocation_limit (gen) = 0; - generation_allocation_segment (gen) = heap_segment_rw (generation_start_segment (gen)); + + if (i > max_generation) + { + // UOH allocations are allowed while sweeping SOH, so + // we defer clearing UOH free lists until we start sweeping them + generation_allocator (gen)->clear(); + generation_free_list_space (gen) = 0; + generation_free_obj_space (gen) = 0; + generation_free_list_allocated (gen) = 0; + generation_end_seg_allocated (gen) = 0; + generation_condemned_allocated (gen) = 0; + generation_sweep_allocated (gen) = 0; + generation_allocation_pointer (gen)= 0; + generation_allocation_limit (gen) = 0; + generation_allocation_segment (gen) = heap_segment_rw (generation_start_segment (gen)); + } + else + { + dprintf (3333, ("h%d: SOH sweep start on seg %Ix: total FL: %Id, FO: %Id", + heap_number, (size_t)start_seg, + generation_free_list_space (gen), + generation_free_obj_space (gen))); + } } PREFIX_ASSUME(start_seg != NULL); heap_segment* seg = start_seg; dprintf (2, ("bgs: sweeping gen %Ix objects", gen->gen_num)); - while (seg) + while (seg +#ifdef DOUBLY_LINKED_FL + // We no longer go backwards in segment list for SOH so we need to bail when we see + // segments newly allocated during bgc sweep. + && !((heap_segment_background_allocated (seg) == 0) && (gen != large_object_generation)) +#endif //DOUBLY_LINKED_FL + ) { uint8_t* o = heap_segment_mem (seg); if (seg == gen_start_seg) @@ -33532,10 +34854,18 @@ void gc_heap::background_sweep() uint8_t* plug_end = o; current_sweep_pos = o; next_sweep_obj = o; +#ifdef DOUBLY_LINKED_FL + current_sweep_seg = seg; +#endif //DOUBLY_LINKED_FL + + // This records the total size of free objects (including the ones on and not on FL) + // in the gap and it gets set to 0 when we encounter a plug. If the last gap we saw + // on a seg is unmarked, we will process this in process_background_segment_end. + size_t free_obj_size_last_gap = 0; allow_fgc(); uint8_t* end = background_next_end (seg, (i > max_generation)); - dprintf (2, ("bgs: seg: %Ix, [%Ix, %Ix[%Ix", (size_t)seg, + dprintf (3333, ("bgs: seg: %Ix, [%Ix, %Ix[%Ix", (size_t)seg, (size_t)heap_segment_mem (seg), (size_t)heap_segment_allocated (seg), (size_t)heap_segment_background_allocated (seg))); @@ -33554,6 +34884,18 @@ void gc_heap::background_sweep() if (i == max_generation) { add_gen_free (max_generation, plug_start-plug_end); + +#ifdef DOUBLY_LINKED_FL + if (free_obj_size_last_gap) + { + generation_free_obj_space (gen) -= free_obj_size_last_gap; + dprintf (3333, ("[h%d] LG: gen2FO-: %Id->%Id", + heap_number, free_obj_size_last_gap, generation_free_obj_space (gen))); + + free_obj_size_last_gap = 0; + } +#endif //DOUBLY_LINKED_FL + fix_brick_to_highest (plug_end, plug_start); // we need to fix the brick for the next plug here 'cause an FGC can // happen and can't read a stale brick. @@ -33562,14 +34904,15 @@ void gc_heap::background_sweep() do { - o = o + Align (size (o), align_const); + next_sweep_obj = o + Align (size (o), align_const); current_num_objs++; if (current_num_objs >= num_objs) { - current_sweep_pos = o; + current_sweep_pos = next_sweep_obj; allow_fgc(); current_num_objs = 0; } + o = next_sweep_obj; } while ((o < end) && background_object_marked(o, TRUE)); plug_end = o; @@ -33583,7 +34926,50 @@ void gc_heap::background_sweep() while ((o < end) && !background_object_marked (o, FALSE)) { - o = o + Align (size (o), align_const);; + size_t size_o = Align(size (o), align_const); + next_sweep_obj = o + size_o; + +#ifdef DOUBLY_LINKED_FL + if (gen != large_object_generation) + { + if (method_table (o) == g_gc_pFreeObjectMethodTable) + { + free_obj_size_last_gap += size_o; + + if (is_on_free_list (o, size_o)) + { + generation_allocator (gen)->unlink_item_no_undo (o, size_o); + generation_free_list_space (gen) -= size_o; + generation_free_obj_space (gen) += size_o; + + dprintf (3333, ("[h%d] gen2F-: %Ix->%Ix(%Id) FL: %Id", + heap_number, o, (o + size_o), size_o, + generation_free_list_space (gen))); + dprintf (3333, ("h%d: gen2FO+: %Ix(%Id)->%Id (g: %Id)", + heap_number, o, size_o, + generation_free_obj_space (gen), + free_obj_size_last_gap)); + remove_gen_free (max_generation, size_o); + } + else + { + // this was not on the free list so it was already part of + // free_obj_space, so no need to substract from it. However, + // we do need to keep track in this gap's FO space. + dprintf (3333, ("h%d: gen2FO: %Ix(%Id)->%Id (g: %Id)", + heap_number, o, size_o, + generation_free_obj_space (gen), free_obj_size_last_gap)); + } + + dprintf (3333, ("h%d: total FO: %Ix->%Ix FL: %Id, FO: %Id (g: %Id)", + heap_number, plug_end, next_sweep_obj, + generation_free_list_space (gen), + generation_free_obj_space (gen), + free_obj_size_last_gap)); + } + } +#endif //DOUBLY_LINKED_FL + current_num_objs++; if (current_num_objs >= num_objs) { @@ -33592,9 +34978,14 @@ void gc_heap::background_sweep() allow_fgc(); current_num_objs = 0; } + + o = next_sweep_obj; } } +#ifdef DOUBLY_LINKED_FL + next_seg = heap_segment_next (seg); +#else //DOUBLY_LINKED_FL if (i > max_generation) { next_seg = heap_segment_next (seg); @@ -33604,6 +34995,7 @@ void gc_heap::background_sweep() // For SOH segments we go backwards. next_seg = heap_segment_prev (gen_start_seg, seg); } +#endif //DOUBLY_LINKED_FL BOOL delete_p = FALSE; if (!heap_segment_read_only_p (seg)) @@ -33615,13 +35007,13 @@ void gc_heap::background_sweep() // because we don't allow UOH allocations during bgc // sweep anyway - the UOH segments can't change. process_background_segment_end (seg, gen, plug_end, - start_seg, &delete_p); + start_seg, &delete_p, 0); } else { assert (heap_segment_background_allocated (seg) != 0); process_background_segment_end (seg, gen, plug_end, - start_seg, &delete_p); + start_seg, &delete_p, free_obj_size_last_gap); assert (next_seg || !delete_p); } @@ -33640,6 +35032,14 @@ void gc_heap::background_sweep() verify_soh_segment_list(); +#ifdef DOUBLY_LINKED_FL + while (next_seg && heap_segment_background_allocated (next_seg) == 0) + { + dprintf (2, ("[h%d] skip new %Ix ", heap_number, next_seg)); + next_seg = heap_segment_next (next_seg); + } +#endif //DOUBLY_LINKED_FL + seg = next_seg; dprintf (GTC_LOG, ("seg: %Ix, next_seg: %Ix, prev_seg: %Ix", seg, next_seg, prev_seg)); } @@ -33679,12 +35079,12 @@ void gc_heap::background_sweep() generation_free_list_space (generation_of (max_generation)), generation_free_obj_space (generation_of (max_generation)))); - dprintf (GTC_LOG, ("h%d: end of bgc sweep: loh FL: %Id, FO: %Id", + dprintf (GTC_LOG, ("h%d: end of bgc sweep: loh FL: %Id, FO: %Id", heap_number, generation_free_list_space (generation_of (loh_generation)), generation_free_obj_space (generation_of (loh_generation)))); - dprintf (GTC_LOG, ("h%d: end of bgc sweep: poh FL: %Id, FO: %Id", + dprintf (GTC_LOG, ("h%d: end of bgc sweep: poh FL: %Id, FO: %Id", heap_number, generation_free_list_space (generation_of (poh_generation)), generation_free_obj_space (generation_of (poh_generation)))); @@ -33708,6 +35108,15 @@ void gc_heap::background_sweep() // be accurate. compute_new_dynamic_data (max_generation); +#ifdef DOUBLY_LINKED_FL + current_bgc_state = bgc_not_in_process; + + // We can have an FGC triggered before we set the global state to free + // so we need to not have left over current_sweep_seg that point to + // a segment that might've been deleted at the beginning of an FGC. + current_sweep_seg = 0; +#endif //DOUBLY_LINKED_FL + enable_preemptive (); #ifdef MULTIPLE_HEAPS @@ -33769,10 +35178,10 @@ void gc_heap::sweep_uoh_objects (int gen_num) generation_allocator (gen)->clear(); generation_free_list_space (gen) = 0; generation_free_obj_space (gen) = 0; - + generation_free_list_allocated (gen) = 0; dprintf (3, ("sweeping uoh objects")); - dprintf (3, ("seg: %Ix, [%Ix, %Ix[, starting from %Ix", + dprintf (3, ("seg: %Ix, [%Ix, %Ix[, starting from %Ix", (size_t)seg, (size_t)heap_segment_mem (seg), (size_t)heap_segment_allocated (seg), @@ -33933,8 +35342,8 @@ void gc_heap::mark_through_cards_for_uoh_objects (card_fn fn, size_t total_cards_cleared = 0; #ifdef FEATURE_CARD_MARKING_STEALING - VOLATILE(uint32_t)* chunk_index = (VOLATILE(uint32_t)*) &(gen_num == loh_generation ? - card_mark_chunk_index_loh : + VOLATILE(uint32_t)* chunk_index = (VOLATILE(uint32_t)*) &(gen_num == loh_generation ? + card_mark_chunk_index_loh : card_mark_chunk_index_poh); card_marking_enumerator card_mark_enumerator(seg, low, chunk_index); @@ -34147,12 +35556,22 @@ void gc_heap::mark_through_cards_for_uoh_objects (card_fn fn, // compute the efficiency ratio of the card table if (!relocating) { - generation_skip_ratio = min (((n_eph > 800) ? - (int)(((float)n_gen / (float)n_eph) * 100) : 100), - generation_skip_ratio); - - dprintf (3, ("Mloh: cross: %Id, useful: %Id, cards cleared: %Id, cards set: %Id, ratio: %d", - n_eph, n_gen, total_cards_cleared, n_card_set, generation_skip_ratio)); +#ifdef FEATURE_CARD_MARKING_STEALING + Interlocked::ExchangeAddPtr(&n_eph_loh, n_eph); + Interlocked::ExchangeAddPtr(&n_gen_loh, n_gen); + dprintf (3, ("h%d marking h%d Mloh: cross: %Id, useful: %Id, cards set: %Id, cards cleared: %Id, ratio: %d", + hpt->heap_number, heap_number, n_eph, n_gen, n_card_set, total_cards_cleared, + (n_eph ? (int)(((float)n_gen / (float)n_eph) * 100) : 0))); + dprintf (3, ("h%d marking h%d Mloh: total cross %Id, useful: %Id, running ratio: %d", + hpt->heap_number, heap_number, n_eph_loh, n_gen_loh, + (n_eph_loh ? (int)(((float)n_gen_loh / (float)n_eph_loh) * 100) : 0))); +#else + generation_skip_ratio = min (((n_eph > MIN_LOH_CROSS_GEN_REFS) ? + (int)(((float)n_gen / (float)n_eph) * 100) : 100), + generation_skip_ratio); + dprintf (3, ("marking h%d Mloh: cross: %Id, useful: %Id, cards cleared: %Id, cards set: %Id, ratio: %d", + heap_number, n_eph, n_gen, total_cards_cleared, n_card_set, generation_skip_ratio)); +#endif //FEATURE_CARD_MARKING_STEALING } else { @@ -34519,7 +35938,7 @@ BOOL gc_heap::bgc_mark_array_range (heap_segment* seg, void gc_heap::bgc_verify_mark_array_cleared (heap_segment* seg) { #ifdef VERIFY_HEAP - if (gc_heap::background_running_p() && + if (gc_heap::background_running_p() && (GCConfig::GetHeapVerifyLevel() & GCConfig::HEAPVERIFY_GC)) { uint8_t* range_beg = 0; @@ -34662,7 +36081,7 @@ void gc_heap::clear_all_mark_array() void gc_heap::verify_mark_array_cleared() { #ifdef VERIFY_HEAP - if (gc_heap::background_running_p() && + if (gc_heap::background_running_p() && (GCConfig::GetHeapVerifyLevel() & GCConfig::HEAPVERIFY_GC)) { for (int i = max_generation; i < total_generation_count; i++) @@ -34823,6 +36242,18 @@ gc_heap::verify_free_lists () FATAL_GC_ERROR(); } +#ifdef DOUBLY_LINKED_FL + uint8_t* prev_free_item = free_list_prev (free_list); + if (gen_num == max_generation) + { + if (prev_free_item != prev) + { + dprintf (1, ("%Ix prev should be: %Ix, actual: %Ix", free_list, prev_free_item, prev)); + FATAL_GC_ERROR(); + } + } +#endif //DOUBLY_LINKED_FL + prev = free_list; free_list = free_list_slot (free_list); } @@ -34852,7 +36283,7 @@ void gc_heap::verify_heap (BOOL begin_gc_p) { int heap_verify_level = static_cast(GCConfig::GetHeapVerifyLevel()); - + #ifdef MULTIPLE_HEAPS t_join* current_join = &gc_t_join; #ifdef BACKGROUND_GC @@ -35437,25 +36868,21 @@ HRESULT GCHeap::Initialize() #ifdef HOST_64BIT gc_heap::heap_hard_limit = (size_t)GCConfig::GetGCHeapHardLimit(); - gc_heap::heap_hard_limit_oh[0] = (size_t)GCConfig::GetGCHeapHardLimitSOH(); - gc_heap::heap_hard_limit_oh[1] = (size_t)GCConfig::GetGCHeapHardLimitLOH(); - gc_heap::heap_hard_limit_oh[2] = (size_t)GCConfig::GetGCHeapHardLimitPOH(); + gc_heap::heap_hard_limit_oh[soh] = (size_t)GCConfig::GetGCHeapHardLimitSOH(); + gc_heap::heap_hard_limit_oh[loh] = (size_t)GCConfig::GetGCHeapHardLimitLOH(); + gc_heap::heap_hard_limit_oh[poh] = (size_t)GCConfig::GetGCHeapHardLimitPOH(); - if (gc_heap::heap_hard_limit_oh[0] || gc_heap::heap_hard_limit_oh[1] || gc_heap::heap_hard_limit_oh[2]) + if (gc_heap::heap_hard_limit_oh[soh] || gc_heap::heap_hard_limit_oh[loh] || gc_heap::heap_hard_limit_oh[poh]) { - if (!gc_heap::heap_hard_limit_oh[0]) + if (!gc_heap::heap_hard_limit_oh[soh]) { return E_INVALIDARG; } - if (!gc_heap::heap_hard_limit_oh[1]) + if (!gc_heap::heap_hard_limit_oh[loh]) { return E_INVALIDARG; } - if (gc_heap::heap_hard_limit_oh[2] < min_segment_size_hard_limit) - { - gc_heap::heap_hard_limit_oh[2] = min_segment_size_hard_limit; - } - gc_heap::heap_hard_limit = gc_heap::heap_hard_limit_oh[0] + gc_heap::heap_hard_limit_oh[1] + gc_heap::heap_hard_limit_oh[2]; + gc_heap::heap_hard_limit = gc_heap::heap_hard_limit_oh[soh] + gc_heap::heap_hard_limit_oh[loh] + gc_heap::heap_hard_limit_oh[poh]; } else { @@ -35480,17 +36907,10 @@ HRESULT GCHeap::Initialize() { return E_INVALIDARG; } - gc_heap::heap_hard_limit_oh[0] = (size_t)(gc_heap::total_physical_mem * (uint64_t)percent_of_mem_soh / (uint64_t)100); - gc_heap::heap_hard_limit_oh[1] = (size_t)(gc_heap::total_physical_mem * (uint64_t)percent_of_mem_loh / (uint64_t)100); - if (percent_of_mem_poh == 0) - { - gc_heap::heap_hard_limit_oh[2] = min_segment_size_hard_limit; - } - else - { - gc_heap::heap_hard_limit_oh[2] = (size_t)(gc_heap::total_physical_mem * (uint64_t)percent_of_mem_poh / (uint64_t)100); - } - gc_heap::heap_hard_limit = gc_heap::heap_hard_limit_oh[0] + gc_heap::heap_hard_limit_oh[1] + gc_heap::heap_hard_limit_oh[2]; + gc_heap::heap_hard_limit_oh[soh] = (size_t)(gc_heap::total_physical_mem * (uint64_t)percent_of_mem_soh / (uint64_t)100); + gc_heap::heap_hard_limit_oh[loh] = (size_t)(gc_heap::total_physical_mem * (uint64_t)percent_of_mem_loh / (uint64_t)100); + gc_heap::heap_hard_limit_oh[poh] = (size_t)(gc_heap::total_physical_mem * (uint64_t)percent_of_mem_poh / (uint64_t)100); + gc_heap::heap_hard_limit = gc_heap::heap_hard_limit_oh[soh] + gc_heap::heap_hard_limit_oh[loh] + gc_heap::heap_hard_limit_oh[poh]; } } @@ -35584,13 +37004,18 @@ HRESULT GCHeap::Initialize() if (gc_heap::heap_hard_limit) { gc_heap::use_large_pages_p = GCConfig::GetGCLargePages(); - if (gc_heap::heap_hard_limit_oh[0]) + if (gc_heap::heap_hard_limit_oh[soh]) { #ifdef MULTIPLE_HEAPS if (nhp_from_config == 0) { for (int i = 0; i < (total_oh_count - 1); i++) { + if (i == poh && gc_heap::heap_hard_limit_oh[poh] == 0) + { + // if size 0 was specified for POH, ignore it for the nhp computation + continue; + } uint32_t nhp_oh = (uint32_t)(gc_heap::heap_hard_limit_oh[i] / min_segment_size_hard_limit); nhp = min (nhp, nhp_oh); } @@ -35600,9 +37025,9 @@ HRESULT GCHeap::Initialize() } } #endif - seg_size = gc_heap::heap_hard_limit_oh[0] / nhp; - large_seg_size = gc_heap::heap_hard_limit_oh[1] / nhp; - pin_seg_size = gc_heap::heap_hard_limit_oh[2] / nhp; + seg_size = gc_heap::heap_hard_limit_oh[soh] / nhp; + large_seg_size = gc_heap::heap_hard_limit_oh[loh] / nhp; + pin_seg_size = (gc_heap::heap_hard_limit_oh[poh] != 0) ? (gc_heap::heap_hard_limit_oh[2] / nhp) : min_segment_size_hard_limit; size_t aligned_seg_size = align_on_segment_hard_limit (seg_size); size_t aligned_large_seg_size = align_on_segment_hard_limit (large_seg_size); @@ -36237,6 +37662,13 @@ bool GCHeap::StressHeap(gc_alloc_context * context) unsigned sizeToNextObj = (unsigned)Align(size(str)); uint8_t* freeObj = ((uint8_t*) str) + sizeToNextObj - sizeOfNewObj; pGenGCHeap->make_unused_array (freeObj, sizeOfNewObj); + +#if !defined(TARGET_AMD64) && !defined(TARGET_X86) + // ensure that the write to the new free object is seen by + // background GC *before* the write to the string length below + MemoryBarrier(); +#endif + str->SetStringLength(str->GetStringLength() - (sizeOfNewObj / sizeof(WCHAR))); } else @@ -37094,11 +38526,6 @@ void gc_heap::update_recorded_gen_data (last_recorded_gc_info* gc_info) void gc_heap::do_post_gc() { - if (!settings.concurrent) - { - initGCShadow(); - } - #ifdef MULTIPLE_HEAPS gc_heap* hp = g_heaps[0]; #else @@ -37540,15 +38967,26 @@ size_t GCHeap::ApproxTotalBytesInUse(BOOL small_heap_only) size_t totsize = 0; enter_spin_lock (&pGenGCHeap->gc_lock); - heap_segment* eph_seg = generation_allocation_segment (pGenGCHeap->generation_of (0)); - // Get small block heap size info - totsize = (pGenGCHeap->alloc_allocated - heap_segment_mem (eph_seg)); - heap_segment* seg1 = generation_start_segment (pGenGCHeap->generation_of (max_generation)); - while (seg1 != eph_seg) + // the complication with the following code is that background GC may + // remove the ephemeral segment while we are iterating + // if so, we retry a couple times and ultimately may report a slightly wrong result + for (int tries = 1; tries <= 3; tries++) { - totsize += heap_segment_allocated (seg1) - - heap_segment_mem (seg1); - seg1 = heap_segment_next (seg1); + heap_segment* eph_seg = generation_allocation_segment (pGenGCHeap->generation_of (0)); + // Get small block heap size info + totsize = (pGenGCHeap->alloc_allocated - heap_segment_mem (eph_seg)); + heap_segment* seg1 = generation_start_segment (pGenGCHeap->generation_of (max_generation)); + while ((seg1 != eph_seg) && (seg1 != nullptr) && (seg1 != pGenGCHeap->freeable_soh_segment)) + { + if (!heap_segment_decommitted_p (seg1)) + { + totsize += heap_segment_allocated (seg1) - + heap_segment_mem (seg1); + } + seg1 = heap_segment_next (seg1); + } + if (seg1 == eph_seg) + break; } //discount the fragmentation @@ -38607,8 +40045,8 @@ void gc_heap::walk_heap_per_heap (walk_fn fn, void* context, int gen_number, BOO generation_allocation_start (gen)); uint8_t* end = heap_segment_allocated (seg); - BOOL small_object_segments = TRUE; - int align_const = get_alignment_constant (small_object_segments); + int align_const = get_alignment_constant (TRUE); + BOOL walk_pinned_object_heap = walk_large_object_heap_p; while (1) @@ -38623,20 +40061,25 @@ void gc_heap::walk_heap_per_heap (walk_fn fn, void* context, int gen_number, BOO } else { - if (small_object_segments && walk_large_object_heap_p) - + if (walk_large_object_heap_p) { - small_object_segments = FALSE; - align_const = get_alignment_constant (small_object_segments); + walk_large_object_heap_p = FALSE; seg = generation_start_segment (large_object_generation); - x = heap_segment_mem (seg); - end = heap_segment_allocated (seg); - continue; + } + else if (walk_pinned_object_heap) + { + walk_pinned_object_heap = FALSE; + seg = generation_start_segment (pinned_object_generation); } else { break; } + + align_const = get_alignment_constant (FALSE); + x = heap_segment_mem (seg); + end = heap_segment_allocated (seg); + continue; } } diff --git a/src/coreclr/src/gc/gcconfig.h b/src/coreclr/src/gc/gcconfig.h index 085562f56dd4..62ea34f3659e 100644 --- a/src/coreclr/src/gc/gcconfig.h +++ b/src/coreclr/src/gc/gcconfig.h @@ -75,7 +75,7 @@ class GCConfigStringHolder BOOL_CONFIG (LogEnabled, "GCLogEnabled", NULL, false, "Specifies if you want to turn on logging in GC") \ BOOL_CONFIG (ConfigLogEnabled, "GCConfigLogEnabled", NULL, false, "Specifies the name of the GC config log file") \ BOOL_CONFIG (GCNumaAware, "GCNumaAware", NULL, true, "Enables numa allocations in the GC") \ - BOOL_CONFIG (GCCpuGroup, "GCCpuGroup", NULL, false, "Enables CPU groups in the GC") \ + BOOL_CONFIG (GCCpuGroup, "GCCpuGroup", "System.GC.CpuGroup", false, "Enables CPU groups in the GC") \ BOOL_CONFIG (GCLargePages, "GCLargePages", "System.GC.LargePages", false, "Enables using Large Pages in the GC") \ INT_CONFIG (HeapVerifyLevel, "HeapVerify", NULL, HEAPVERIFY_NONE, "When set verifies the integrity of the managed heap on entry and exit of each GC") \ INT_CONFIG (LOHCompactionMode, "GCLOHCompact", NULL, 0, "Specifies the LOH compaction mode") \ @@ -83,7 +83,7 @@ class GCConfigStringHolder INT_CONFIG (BGCSpinCount, "BGCSpinCount", NULL, 140, "Specifies the bgc spin count") \ INT_CONFIG (BGCSpin, "BGCSpin", NULL, 2, "Specifies the bgc spin time") \ INT_CONFIG (HeapCount, "GCHeapCount", "System.GC.HeapCount", 0, "Specifies the number of server GC heaps") \ - INT_CONFIG (Gen0Size, "GCgen0size", NULL, 0, "Specifies the smallest gen0 size") \ + INT_CONFIG (Gen0Size, "GCgen0size", NULL, 0, "Specifies the smallest gen0 budget") \ INT_CONFIG (SegmentSize, "GCSegmentSize", NULL, 0, "Specifies the managed heap segment size") \ INT_CONFIG (LatencyMode, "GCLatencyMode", NULL, -1, "Specifies the GC latency mode - batch, interactive or low latency (note that the same " \ "thing can be specified via API which is the supported way") \ @@ -92,13 +92,14 @@ class GCConfigStringHolder INT_CONFIG (LogFileSize, "GCLogFileSize", NULL, 0, "Specifies the GC log file size") \ INT_CONFIG (CompactRatio, "GCCompactRatio", NULL, 0, "Specifies the ratio compacting GCs vs sweeping") \ INT_CONFIG (GCHeapAffinitizeMask, "GCHeapAffinitizeMask", "System.GC.HeapAffinitizeMask", 0, "Specifies processor mask for Server GC threads") \ - STRING_CONFIG(GCHeapAffinitizeRanges, "GCHeapAffinitizeRanges", NULL, "Specifies list of processors for Server GC threads. The format is a comma separated " \ + STRING_CONFIG(GCHeapAffinitizeRanges, "GCHeapAffinitizeRanges", "System.GC.HeapAffinitizeRanges", "Specifies list of processors for Server GC threads. The format is a comma separated " \ "list of processor numbers or ranges of processor numbers. On Windows, each entry is " \ "prefixed by the CPU group number. Example: Unix - 1,3,5,7-9,12, Windows - 0:1,1:7-9") \ - INT_CONFIG (GCHighMemPercent, "GCHighMemPercent", NULL, 0, "The percent for GC to consider as high memory") \ + INT_CONFIG (GCHighMemPercent, "GCHighMemPercent", "System.GC.HighMemoryPercent", 0, "The percent for GC to consider as high memory") \ INT_CONFIG (GCProvModeStress, "GCProvModeStress", NULL, 0, "Stress the provisional modes") \ INT_CONFIG (GCGen0MaxBudget, "GCGen0MaxBudget", NULL, 0, "Specifies the largest gen0 allocation budget") \ - INT_CONFIG (GCHeapHardLimit, "GCHeapHardLimit", NULL, 0, "Specifies a hard limit for the GC heap") \ + INT_CONFIG (GCLowSkipRatio, "GCLowSkipRatio", NULL, 30, "Specifies the low generation skip ratio") \ + INT_CONFIG (GCHeapHardLimit, "GCHeapHardLimit", "System.GC.HeapHardLimit", 0, "Specifies a hard limit for the GC heap") \ INT_CONFIG (GCHeapHardLimitPercent, "GCHeapHardLimitPercent", "System.GC.HeapHardLimitPercent", 0, "Specifies the GC heap usage as a percentage of the total memory") \ INT_CONFIG (GCTotalPhysicalMemory, "GCTotalPhysicalMemory", NULL, 0, "Specifies what the GC should consider to be total physical memory") \ STRING_CONFIG(LogFile, "GCLogFile", NULL, "Specifies the name of the GC log file") \ @@ -122,13 +123,13 @@ class GCConfigStringHolder INT_CONFIG (BGCFLEnableTBH, "BGCFLEnableTBH", NULL, 0, "Enables TBH") \ INT_CONFIG (BGCFLEnableFF, "BGCFLEnableFF", NULL, 0, "Enables FF") \ INT_CONFIG (BGCG2RatioStep, "BGCG2RatioStep", NULL, 5, "Ratio correction factor for ML loop") \ - INT_CONFIG (GCHeapHardLimitSOH, "GCHeapHardLimitSOH", NULL, 0, "Specifies a hard limit for the GC heap SOH") \ - INT_CONFIG (GCHeapHardLimitLOH, "GCHeapHardLimitLOH", NULL, 0, "Specifies a hard limit for the GC heap LOH") \ - INT_CONFIG (GCHeapHardLimitPOH, "GCHeapHardLimitPOH", NULL, 0, "Specifies a hard limit for the GC heap POH") \ - INT_CONFIG (GCHeapHardLimitSOHPercent, "GCHeapHardLimitSOHPercent", NULL, 0, "Specifies the GC heap SOH usage as a percentage of the total memory") \ - INT_CONFIG (GCHeapHardLimitLOHPercent, "GCHeapHardLimitLOHPercent", NULL, 0, "Specifies the GC heap LOH usage as a percentage of the total memory") \ - INT_CONFIG (GCHeapHardLimitPOHPercent, "GCHeapHardLimitPOHPercent", NULL, 0, "Specifies the GC heap POH usage as a percentage of the total memory") \ - INT_CONFIG (GCEnabledInstructionSets, "GCEnabledInstructionSets", NULL, -1, "Specifies whether GC can use AVX2 or AVX512F - 0 for neither, 1 for AVX2, 3 for AVX512F")\ + INT_CONFIG (GCHeapHardLimitSOH, "GCHeapHardLimitSOH", "System.GC.HeapHardLimitSOH", 0, "Specifies a hard limit for the GC heap SOH") \ + INT_CONFIG (GCHeapHardLimitLOH, "GCHeapHardLimitLOH", "System.GC.HeapHardLimitLOH", 0, "Specifies a hard limit for the GC heap LOH") \ + INT_CONFIG (GCHeapHardLimitPOH, "GCHeapHardLimitPOH", "System.GC.HeapHardLimitPOH", 0, "Specifies a hard limit for the GC heap POH") \ + INT_CONFIG (GCHeapHardLimitSOHPercent, "GCHeapHardLimitSOHPercent", "System.GC.HeapHardLimitSOHPercent", 0, "Specifies the GC heap SOH usage as a percentage of the total memory") \ + INT_CONFIG (GCHeapHardLimitLOHPercent, "GCHeapHardLimitLOHPercent", "System.GC.HeapHardLimitLOHPercent", 0, "Specifies the GC heap LOH usage as a percentage of the total memory") \ + INT_CONFIG (GCHeapHardLimitPOHPercent, "GCHeapHardLimitPOHPercent", "System.GC.HeapHardLimitPOHPercent", 0, "Specifies the GC heap POH usage as a percentage of the total memory") \ + INT_CONFIG (GCEnabledInstructionSets, "GCEnabledInstructionSets", NULL, -1, "Specifies whether GC can use AVX2 or AVX512F - 0 for neither, 1 for AVX2, 3 for AVX512F")\ // This class is responsible for retreiving configuration information // for how the GC should operate. diff --git a/src/coreclr/src/gc/gcee.cpp b/src/coreclr/src/gc/gcee.cpp index 2964b14190e9..4912f2e86691 100644 --- a/src/coreclr/src/gc/gcee.cpp +++ b/src/coreclr/src/gc/gcee.cpp @@ -53,6 +53,11 @@ void GCHeap::UpdatePreGCCounters() #endif // BACKGROUND_GC FIRE_EVENT(GCStart_V2, count, depth, reason, static_cast(type)); + ReportGenerationBounds(); +} + +void GCHeap::ReportGenerationBounds() +{ g_theGCHeap->DiagDescrGenerations([](void*, int generation, uint8_t* rangeStart, uint8_t* rangeEnd, uint8_t* rangeEndReserved) { uint64_t range = static_cast(rangeEnd - rangeStart); @@ -148,12 +153,7 @@ void GCHeap::UpdatePostGCCounters() #endif //FEATURE_EVENT_TRACE #ifdef FEATURE_EVENT_TRACE - g_theGCHeap->DiagDescrGenerations([](void*, int generation, uint8_t* rangeStart, uint8_t* rangeEnd, uint8_t* rangeEndReserved) - { - uint64_t range = static_cast(rangeEnd - rangeStart); - uint64_t rangeReserved = static_cast(rangeEndReserved - rangeStart); - FIRE_EVENT(GCGenerationRange, generation, rangeStart, range, rangeReserved); - }, nullptr); + ReportGenerationBounds(); FIRE_EVENT(GCEnd_V1, static_cast(pSettings->gc_index), condemned_gen); diff --git a/src/coreclr/src/gc/gcenv.ee.standalone.inl b/src/coreclr/src/gc/gcenv.ee.standalone.inl index 650812644b01..f14b327a31e1 100644 --- a/src/coreclr/src/gc/gcenv.ee.standalone.inl +++ b/src/coreclr/src/gc/gcenv.ee.standalone.inl @@ -274,10 +274,10 @@ inline bool GCToEEInterface::AnalyzeSurvivorsRequested(int condemnedGeneration) return g_theGCToCLR->AnalyzeSurvivorsRequested(condemnedGeneration); } -inline void GCToEEInterface::AnalyzeSurvivorsFinished(int condemnedGeneration) +inline void GCToEEInterface::AnalyzeSurvivorsFinished(size_t gcIndex, int condemnedGeneration, uint64_t promoted_bytes, void (*reportGenerationBounds)()) { assert(g_theGCToCLR != nullptr); - g_theGCToCLR->AnalyzeSurvivorsFinished(condemnedGeneration); + g_theGCToCLR->AnalyzeSurvivorsFinished(gcIndex, condemnedGeneration, promoted_bytes, reportGenerationBounds); } inline void GCToEEInterface::VerifySyncTableEntry() diff --git a/src/coreclr/src/gc/gcimpl.h b/src/coreclr/src/gc/gcimpl.h index d1f062efb44c..b1c8cb91a7b6 100644 --- a/src/coreclr/src/gc/gcimpl.h +++ b/src/coreclr/src/gc/gcimpl.h @@ -31,7 +31,7 @@ inline void deleteGCShadow() {} inline void checkGCWriteBarrier() {} #endif -void GCProfileWalkHeap(); +void GCProfileWalkHeap(bool etwOnly); class gc_heap; class CFinalize; @@ -57,7 +57,7 @@ class GCHeap : public IGCHeapInternal friend void EnterAllocLock(); friend void LeaveAllocLock(); friend void ProfScanRootsHelper(Object** object, ScanContext *pSC, uint32_t dwFlags); - friend void GCProfileWalkHeap(); + friend void GCProfileWalkHeap(bool etwOnly); public: //In order to keep gc.cpp cleaner, ugly EE specific code is relegated to methods. @@ -315,6 +315,8 @@ class GCHeap : public IGCHeapInternal size_t GetLastGCGenerationSize(int gen); virtual void Shutdown(); + + static void ReportGenerationBounds(); }; #endif // GCIMPL_H_ diff --git a/src/coreclr/src/gc/gcinterface.ee.h b/src/coreclr/src/gc/gcinterface.ee.h index 158da1867dbb..f61fdf5c5e65 100644 --- a/src/coreclr/src/gc/gcinterface.ee.h +++ b/src/coreclr/src/gc/gcinterface.ee.h @@ -414,7 +414,7 @@ class IGCToCLR { bool AnalyzeSurvivorsRequested(int condemnedGeneration) = 0; virtual - void AnalyzeSurvivorsFinished(int condemnedGeneration) = 0; + void AnalyzeSurvivorsFinished(size_t gcIndex, int condemnedGeneration, uint64_t promoted_bytes, void (*reportGenerationBounds)()) = 0; virtual void VerifySyncTableEntry() = 0; diff --git a/src/coreclr/src/gc/gcinterface.h b/src/coreclr/src/gc/gcinterface.h index 331f8e122108..bfe02b7db9da 100644 --- a/src/coreclr/src/gc/gcinterface.h +++ b/src/coreclr/src/gc/gcinterface.h @@ -396,7 +396,7 @@ typedef enum * They are currently used for EnC for adding new field members to existing instantiations under EnC modes where * the primary object is the original instantiation and the secondary represents the added field. * - * They are also used to implement the ConditionalWeakTable class in mscorlib.dll. If you want to use + * They are also used to implement the managed ConditionalWeakTable class. If you want to use * these from managed code, they are exposed to BCL through the managed DependentHandle class. * * @@ -587,7 +587,7 @@ class IGCHeap { /* =========================================================================== - BCL routines. These are routines that are directly exposed by mscorlib + BCL routines. These are routines that are directly exposed by CoreLib as a part of the `System.GC` class. These routines behave in the same manner as the functions on `System.GC`. =========================================================================== @@ -640,14 +640,14 @@ class IGCHeap { virtual int GetGcLatencyMode() = 0; // Sets the current GC latency mode. newLatencyMode has already been - // verified by mscorlib to be valid. + // verified by CoreLib to be valid. virtual int SetGcLatencyMode(int newLatencyMode) = 0; // Gets the current LOH compaction mode. virtual int GetLOHCompactionMode() = 0; // Sets the current LOH compaction mode. newLOHCompactionMode has - // already been verified by mscorlib to be valid. + // already been verified by CoreLib to be valid. virtual void SetLOHCompactionMode(int newLOHCompactionMode) = 0; // Registers for a full GC notification, raising a notification if the gen 2 or diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h index 0606b57d7279..189ad57bc069 100644 --- a/src/coreclr/src/gc/gcpriv.h +++ b/src/coreclr/src/gc/gcpriv.h @@ -63,6 +63,12 @@ inline void FATAL_GC_ERROR() #define FEATURE_PREMORTEM_FINALIZATION #define GC_HISTORY +// We need the lower 3 bits in the MT to do our bookkeeping so doubly linked free list is only for 64-bit +#ifdef HOST_64BIT +// To be enabled. +//#define DOUBLY_LINKED_FL +#endif //HOST_64BIT + #ifndef FEATURE_REDHAWK #define HEAP_ANALYZE #define COLLECTIBLE_CLASS @@ -233,7 +239,7 @@ const int policy_expand = 2; #ifdef SIMPLE_DPRINTF void GCLog (const char *fmt, ... ); -#define dprintf(l,x) {if ((l <= 1) || (l == GTC_LOG)) {GCLog x;}} +#define dprintf(l,x) {if ((l == 1) || (l == GTC_LOG)) {GCLog x;}} #else //SIMPLE_DPRINTF // Nobody used the logging mechanism that used to be here. If we find ourselves // wanting to inspect GC logs on unmodified builds, we can use this define here @@ -583,6 +589,11 @@ typedef DPTR(class CFinalize) PTR_CFinalize; #define MAX_BUCKET_COUNT (20)//Max number of buckets. class alloc_list { +#ifdef DOUBLY_LINKED_FL + uint8_t* added_head; + uint8_t* added_tail; +#endif //DOUBLY_LINKED_FL + uint8_t* head; uint8_t* tail; @@ -592,11 +603,20 @@ class alloc_list size_t item_count; #endif //FL_VERIFICATION +#ifdef DOUBLY_LINKED_FL + uint8_t*& added_alloc_list_head () { return added_head;} + uint8_t*& added_alloc_list_tail () { return added_tail;} +#endif //DOUBLY_LINKED_FL + uint8_t*& alloc_list_head () { return head;} uint8_t*& alloc_list_tail () { return tail;} size_t& alloc_list_damage_count(){ return damage_count; } alloc_list() { +#ifdef DOUBLY_LINKED_FL + added_head = 0; + added_tail = 0; +#endif //DOUBLY_LINKED_FL head = 0; tail = 0; damage_count = 0; @@ -610,16 +630,21 @@ class allocator unsigned int num_buckets; alloc_list first_bucket; alloc_list* buckets; + int gen_number; alloc_list& alloc_list_of (unsigned int bn); size_t& alloc_list_damage_count_of (unsigned int bn); + void thread_free_item_end (uint8_t* free_item, uint8_t*& head, uint8_t*& tail, int bn); public: - allocator (unsigned int num_b, int fbb, alloc_list* b); + allocator (unsigned int num_b, int fbb, alloc_list* b, int gen=-1); allocator() { num_buckets = 1; first_bucket_bits = sizeof(size_t) * 8 - 1; + // for young gens we just set it to 0 since we don't treat + // them differently from each other + gen_number = 0; } unsigned int number_of_buckets() @@ -629,7 +654,7 @@ class allocator // skip buckets that cannot possibly fit "size" and return the next one // there is always such bucket since the last one fits everything - unsigned int first_suitable_bucket(size_t size) + unsigned int first_suitable_bucket (size_t size) { // sizes taking first_bucket_bits or less are mapped to bucket 0 // others are mapped to buckets 0, 1, 2 respectively @@ -642,7 +667,7 @@ class allocator BitScanReverse(&highest_set_bit_index, size); #endif - return min ((unsigned int)highest_set_bit_index, num_buckets - 1); + return min ((unsigned int)highest_set_bit_index, (num_buckets - 1)); } size_t first_bucket_size() @@ -660,6 +685,17 @@ class allocator return alloc_list_of (bn).alloc_list_tail(); } +#ifdef DOUBLY_LINKED_FL + uint8_t*& added_alloc_list_head_of (unsigned int bn) + { + return alloc_list_of (bn).added_alloc_list_head(); + } + uint8_t*& added_alloc_list_tail_of (unsigned int bn) + { + return alloc_list_of (bn).added_alloc_list_tail(); + } +#endif //DOUBLY_LINKED_FL + void clear(); BOOL discard_if_no_fit_p() @@ -689,9 +725,16 @@ class allocator } } - void unlink_item (unsigned int bucket_number, uint8_t* item, uint8_t* previous_item, BOOL use_undo_p); + void unlink_item (unsigned int bn, uint8_t* item, uint8_t* previous_item, BOOL use_undo_p); void thread_item (uint8_t* item, size_t size); void thread_item_front (uint8_t* itme, size_t size); +#ifdef DOUBLY_LINKED_FL + int thread_item_front_added (uint8_t* itme, size_t size); + void unlink_item_no_undo (uint8_t* item, size_t size); + void unlink_item_no_undo (unsigned int bn, uint8_t* item, size_t size); + void unlink_item_no_undo_added (unsigned int bn, uint8_t* item, uint8_t* previous_item); +#endif //DOUBLY_LINKED_FL + void copy_to_alloc_list (alloc_list* toalist); void copy_from_alloc_list (alloc_list* fromalist); void commit_alloc_list_changes(); @@ -729,6 +772,11 @@ class generation size_t pinned_allocation_sweep_size; int gen_num; +#ifdef DOUBLY_LINKED_FL + BOOL set_bgc_mark_bit_p; + uint8_t* last_free_list_allocated; +#endif //DOUBLY_LINKED_FL + #ifdef FREE_USAGE_STATS size_t gen_free_spaces[NUM_GEN_POWER2]; // these are non pinned plugs only @@ -1220,7 +1268,7 @@ class gc_heap void balance_heaps (alloc_context* acontext); PER_HEAP ptrdiff_t get_balance_heaps_uoh_effective_budget (int generation_num); - static + static gc_heap* balance_heaps_uoh (alloc_context* acontext, size_t size, int generation_num); // Unlike balance_heaps_uoh, this may return nullptr if we failed to change heaps. static @@ -1233,7 +1281,7 @@ class gc_heap // context - we don't actually use the ptr/limit from it so I am // making this explicit by not passing in the alloc_context. // Note: This are instance methods, but the heap instance is only used for - // lowest_address and highest_address, which are currently the same accross all heaps. + // lowest_address and highest_address, which are currently the same across all heaps. PER_HEAP CObjectHeader* allocate_uoh_object (size_t size, uint32_t flags, int gen_num, int64_t& alloc_bytes); @@ -1318,7 +1366,7 @@ class gc_heap protected: PER_HEAP_ISOLATED - BOOL reserve_initial_memory (size_t normal_size, size_t large_size, size_t pinned_size, int num_heaps, bool use_large_pages_p, bool separated_poh_p); + BOOL reserve_initial_memory (size_t normal_size, size_t large_size, size_t pinned_size, int num_heaps, bool use_large_pages_p, bool separated_poh_p, uint16_t* heap_no_to_numa_node); PER_HEAP_ISOLATED void destroy_initial_memory(); @@ -1548,7 +1596,7 @@ class gc_heap PER_HEAP BOOL a_fit_free_list_uoh_p (size_t size, alloc_context* acontext, - uint32_t flags, + uint32_t flags, int align_const, int gen_number); @@ -1603,7 +1651,7 @@ class gc_heap BOOL* short_seg_end_p); PER_HEAP BOOL uoh_try_fit (int gen_number, - size_t size, + size_t size, alloc_context* acontext, uint32_t flags, int align_const, @@ -1899,15 +1947,32 @@ class gc_heap PER_HEAP void add_gen_plug (int gen_number, size_t plug_size); + PER_HEAP_ISOLATED + int find_bucket (size_t size); + PER_HEAP void add_gen_free (int gen_number, size_t free_size); + PER_HEAP + void add_gen_plug_allocated_in_free (int gen_number, size_t plug_size); + PER_HEAP void add_item_to_current_pinned_free (int gen_number, size_t free_size); PER_HEAP void remove_gen_free (int gen_number, size_t free_size); + PER_HEAP + void thread_free_item_front (generation* gen, uint8_t* free_start, size_t free_size); + +#ifdef DOUBLY_LINKED_FL + PER_HEAP + void thread_item_front_added (generation* gen, uint8_t* free_start, size_t free_size); +#endif //DOUBLY_LINKED_FL + + PER_HEAP + void make_free_obj (generation* gen, uint8_t* free_start, size_t free_size); + PER_HEAP uint8_t* allocate_in_older_generation (generation* gen, size_t size, int from_gen_number, @@ -2058,7 +2123,9 @@ class gc_heap void set_mem_verify (uint8_t*, uint8_t*, uint8_t); PER_HEAP void process_background_segment_end (heap_segment*, generation*, uint8_t*, - heap_segment*, BOOL*); + heap_segment*, BOOL* delete_p, + size_t free_obj_size_last_gap); + PER_HEAP BOOL fgc_should_consider_object (uint8_t* o, heap_segment* seg, @@ -2070,6 +2137,12 @@ class gc_heap BOOL* consider_bgc_mark_p, BOOL* check_current_sweep_p, BOOL* check_saved_sweep_p); + +#ifdef DOUBLY_LINKED_FL + PER_HEAP + BOOL should_set_bgc_mark_bit (uint8_t* o); +#endif //DOUBLY_LINKED_FL + PER_HEAP void background_ephemeral_sweep(); PER_HEAP @@ -2637,7 +2710,7 @@ class gc_heap mark* get_oldest_pinned_entry (BOOL* has_pre_plug_info_p, BOOL* has_post_plug_info_p); PER_HEAP - void recover_saved_pinned_info(); + size_t recover_saved_pinned_info(); PER_HEAP void compact_phase (int condemned_gen_number, uint8_t* @@ -2941,7 +3014,7 @@ class gc_heap uint8_t* high_page (heap_segment* seg, BOOL concurrent_p); PER_HEAP - void revisit_written_page (uint8_t* page, uint8_t* end, + void revisit_written_page (uint8_t* page, uint8_t* end, BOOL concurrent_p, uint8_t*& last_page, uint8_t*& last_object, BOOL large_objects_p, size_t& num_marked_objects); @@ -3335,7 +3408,7 @@ class gc_heap // because it's very short and by the time we are calling it // the settings may have changed and we'd have to do more work // to figure out the right GC to record info of. - // + // // The complications are the GCs triggered without their own // SuspendEE, in which case we will record that GC's duration // as its pause duration and the rest toward the GC that @@ -4009,7 +4082,16 @@ class gc_heap PER_HEAP alloc_list poh_alloc_list[NUM_POH_ALIST-1]; -//------------------------------------------ +#ifdef DOUBLY_LINKED_FL + // For bucket 0 added list, we don't want to have to go through + // it to count how many bytes it has so we keep a record here. + // If we need to sweep in gen1, we discard this added list and + // need to deduct the size from free_list_space. + // Note that we should really move this and the free_list_space + // accounting into the alloc_list class. + PER_HEAP + size_t gen2_removed_no_undo; +#endif //DOUBLY_LINKED_FL PER_HEAP dynamic_data dynamic_data_table [total_generation_count]; @@ -4039,6 +4121,20 @@ class gc_heap PER_HEAP int generation_skip_ratio;//in % +#ifdef FEATURE_CARD_MARKING_STEALING + PER_HEAP + VOLATILE(size_t) n_eph_soh; + PER_HEAP + VOLATILE(size_t) n_gen_soh; + PER_HEAP + VOLATILE(size_t) n_eph_loh; + PER_HEAP + VOLATILE(size_t) n_gen_loh; +#endif //FEATURE_CARD_MARKING_STEALING + + PER_HEAP_ISOLATED + int generation_skip_ratio_threshold; + PER_HEAP BOOL gen0_bricks_cleared; PER_HEAP @@ -4134,6 +4230,10 @@ class gc_heap PER_HEAP uint8_t* current_sweep_pos; +#ifdef DOUBLY_LINKED_FL + PER_HEAP + heap_segment* current_sweep_seg; +#endif //DOUBLY_LINKED_FL #endif //BACKGROUND_GC PER_HEAP @@ -4674,6 +4774,18 @@ size_t& generation_sweep_allocated (generation* inst) { return inst->sweep_allocated; } +#ifdef DOUBLY_LINKED_FL +inline +BOOL& generation_set_bgc_mark_bit_p (generation* inst) +{ + return inst->set_bgc_mark_bit_p; +} +inline +uint8_t*& generation_last_free_list_allocated (generation* inst) +{ + return inst->last_free_list_allocated; +} +#endif //DOUBLY_LINKED_FL #ifdef FREE_USAGE_STATS inline size_t& generation_pinned_free_obj_space (generation* inst) @@ -4691,6 +4803,7 @@ size_t& generation_allocated_since_last_pin (generation* inst) return inst->allocated_since_last_pin; } #endif //FREE_USAGE_STATS + inline float generation_allocator_efficiency (generation* inst) { @@ -4712,6 +4825,7 @@ size_t generation_unusable_fragmentation (generation* inst) // We always use USE_PADDING_TAIL when fitting so items on the free list should be // twice the min_obj_size. #define min_free_list (2*min_obj_size) +#define min_free_item_no_prev (min_obj_size+sizeof(uint8_t*)) struct plug { uint8_t * skew[plug_skew / sizeof(uint8_t *)]; @@ -4918,6 +5032,11 @@ BOOL heap_segment_decommitted_p (heap_segment * inst) { return !!(inst->flags & heap_segment_flags_decommitted); } +inline +BOOL heap_segment_swept_p (heap_segment * inst) +{ + return !!(inst->flags & heap_segment_flags_swept); +} #endif //BACKGROUND_GC inline diff --git a/src/coreclr/src/gc/sample/CMakeLists.txt b/src/coreclr/src/gc/sample/CMakeLists.txt index 40bb0b5dcd54..88dae6fc03d7 100644 --- a/src/coreclr/src/gc/sample/CMakeLists.txt +++ b/src/coreclr/src/gc/sample/CMakeLists.txt @@ -27,7 +27,7 @@ set(SOURCES if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) set ( SOURCES ${SOURCES} - ../vxsort/isa_detection_dummy.cpp + ../vxsort/isa_detection.cpp ../vxsort/do_vxsort_avx2.cpp ../vxsort/do_vxsort_avx512.cpp ../vxsort/machine_traits.avx2.cpp @@ -35,6 +35,7 @@ if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) ../vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp ../vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp ../vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp + ../vxsort/smallsort/avx2_load_mask_tables.cpp ) endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) diff --git a/src/coreclr/src/gc/sample/gcenv.ee.cpp b/src/coreclr/src/gc/sample/gcenv.ee.cpp index 4ed20f07786e..1480e62c23b4 100644 --- a/src/coreclr/src/gc/sample/gcenv.ee.cpp +++ b/src/coreclr/src/gc/sample/gcenv.ee.cpp @@ -339,7 +339,7 @@ inline bool GCToEEInterface::AnalyzeSurvivorsRequested(int condemnedGeneration) return false; } -inline void GCToEEInterface::AnalyzeSurvivorsFinished(int condemnedGeneration) +inline void GCToEEInterface::AnalyzeSurvivorsFinished(size_t gcIndex, int condemnedGeneration, uint64_t promoted_bytes, void (*reportGenerationBounds)()) { } diff --git a/src/coreclr/src/gc/unix/config.gc.h.in b/src/coreclr/src/gc/unix/config.gc.h.in index 954176f74a34..e633193218a2 100644 --- a/src/coreclr/src/gc/unix/config.gc.h.in +++ b/src/coreclr/src/gc/unix/config.gc.h.in @@ -16,9 +16,10 @@ #cmakedefine01 HAVE_SWAPCTL #cmakedefine01 HAVE_SYSCTLBYNAME #cmakedefine01 HAVE_PTHREAD_CONDATTR_SETCLOCK -#cmakedefine01 HAVE_MACH_ABSOLUTE_TIME +#cmakedefine01 HAVE_CLOCK_GETTIME_NSEC_NP #cmakedefine01 HAVE_SCHED_GETAFFINITY -#cmakedefine01 HAVE_PTHREAD_GETAFFINITY_NP +#cmakedefine01 HAVE_SCHED_SETAFFINITY +#cmakedefine01 HAVE_PTHREAD_SETAFFINITY_NP #cmakedefine01 HAVE_PTHREAD_NP_H #cmakedefine01 HAVE_CPUSET_T #cmakedefine01 HAVE__SC_AVPHYS_PAGES diff --git a/src/coreclr/src/gc/unix/configure.cmake b/src/coreclr/src/gc/unix/configure.cmake index cc7fb90265d8..99f848c997b7 100644 --- a/src/coreclr/src/gc/unix/configure.cmake +++ b/src/coreclr/src/gc/unix/configure.cmake @@ -71,21 +71,13 @@ check_cxx_source_runs(" check_library_exists(pthread pthread_condattr_setclock "" HAVE_PTHREAD_CONDATTR_SETCLOCK) -check_cxx_source_runs(" - #include - #include - int main() - { - int ret; - mach_timebase_info_data_t timebaseInfo; - ret = mach_timebase_info(&timebaseInfo); - mach_absolute_time(); - exit(ret); - } - " HAVE_MACH_ABSOLUTE_TIME) - +check_symbol_exists( + clock_gettime_nsec_np + time.h + HAVE_CLOCK_GETTIME_NSEC_NP) check_library_exists(c sched_getaffinity "" HAVE_SCHED_GETAFFINITY) +check_library_exists(c sched_setaffinity "" HAVE_SCHED_SETAFFINITY) check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD) if (HAVE_LIBPTHREAD) @@ -94,7 +86,7 @@ elseif (HAVE_PTHREAD_IN_LIBC) set(PTHREAD_LIBRARY c) endif() -check_library_exists(${PTHREAD_LIBRARY} pthread_getaffinity_np "" HAVE_PTHREAD_GETAFFINITY_NP) +check_library_exists(${PTHREAD_LIBRARY} pthread_setaffinity_np "" HAVE_PTHREAD_SETAFFINITY_NP) check_cxx_symbol_exists(_SC_PHYS_PAGES unistd.h HAVE__SC_PHYS_PAGES) check_cxx_symbol_exists(_SC_AVPHYS_PAGES unistd.h HAVE__SC_AVPHYS_PAGES) diff --git a/src/coreclr/src/gc/unix/events.cpp b/src/coreclr/src/gc/unix/events.cpp index 88797741fa7e..7cc55680aaf2 100644 --- a/src/coreclr/src/gc/unix/events.cpp +++ b/src/coreclr/src/gc/unix/events.cpp @@ -16,10 +16,6 @@ #include "gcenv.os.h" #include "globals.h" -#if HAVE_MACH_ABSOLUTE_TIME -mach_timebase_info_data_t g_TimebaseInfo; -#endif // MACH_ABSOLUTE_TIME - namespace { @@ -37,7 +33,7 @@ void TimeSpecAdd(timespec* time, uint32_t milliseconds) } #endif // HAVE_PTHREAD_CONDATTR_SETCLOCK -#if HAVE_MACH_ABSOLUTE_TIME +#if HAVE_CLOCK_GETTIME_NSEC_NP // Convert nanoseconds to the timespec structure // Parameters: // nanoseconds - time in nanoseconds to convert @@ -47,7 +43,7 @@ void NanosecondsToTimeSpec(uint64_t nanoseconds, timespec* t) t->tv_sec = nanoseconds / tccSecondsToNanoSeconds; t->tv_nsec = nanoseconds % tccSecondsToNanoSeconds; } -#endif // HAVE_PTHREAD_CONDATTR_SETCLOCK +#endif // HAVE_CLOCK_GETTIME_NSEC_NP } // anonymous namespace @@ -81,7 +77,7 @@ class GCEvent::Impl // TODO(segilles) implement this for CoreCLR //PthreadCondAttrHolder attrsHolder(&attrs); -#if HAVE_PTHREAD_CONDATTR_SETCLOCK && !HAVE_MACH_ABSOLUTE_TIME +#if HAVE_PTHREAD_CONDATTR_SETCLOCK && !HAVE_CLOCK_GETTIME_NSEC_NP // Ensure that the pthread_cond_timedwait will use CLOCK_MONOTONIC st = pthread_condattr_setclock(&attrs, CLOCK_MONOTONIC); if (st != 0) @@ -89,7 +85,7 @@ class GCEvent::Impl assert(!"Failed to set UnixEvent condition variable wait clock"); return false; } -#endif // HAVE_PTHREAD_CONDATTR_SETCLOCK && !HAVE_MACH_ABSOLUTE_TIME +#endif // HAVE_PTHREAD_CONDATTR_SETCLOCK && !HAVE_CLOCK_GETTIME_NSEC_NP st = pthread_mutex_init(&m_mutex, NULL); if (st != 0) @@ -130,13 +126,12 @@ class GCEvent::Impl UNREFERENCED_PARAMETER(alertable); timespec endTime; -#if HAVE_MACH_ABSOLUTE_TIME +#if HAVE_CLOCK_GETTIME_NSEC_NP uint64_t endMachTime; if (milliseconds != INFINITE) { uint64_t nanoseconds = (uint64_t)milliseconds * tccMilliSecondsToNanoSeconds; - NanosecondsToTimeSpec(nanoseconds, &endTime); - endMachTime = mach_absolute_time() + nanoseconds * g_TimebaseInfo.denom / g_TimebaseInfo.numer; + endMachTime = clock_gettime_nsec_np(CLOCK_UPTIME_RAW) + nanoseconds; } #elif HAVE_PTHREAD_CONDATTR_SETCLOCK if (milliseconds != INFINITE) @@ -159,17 +154,17 @@ class GCEvent::Impl } else { -#if HAVE_MACH_ABSOLUTE_TIME +#if HAVE_CLOCK_GETTIME_NSEC_NP // Since OSX doesn't support CLOCK_MONOTONIC, we use relative variant of the // timed wait and we need to handle spurious wakeups properly. st = pthread_cond_timedwait_relative_np(&m_condition, &m_mutex, &endTime); if ((st == 0) && !m_state) { - uint64_t machTime = mach_absolute_time(); + uint64_t machTime = clock_gettime_nsec_np(CLOCK_UPTIME_RAW); if (machTime < endMachTime) { // The wake up was spurious, recalculate the relative endTime - uint64_t remainingNanoseconds = (endMachTime - machTime) * g_TimebaseInfo.numer / g_TimebaseInfo.denom; + uint64_t remainingNanoseconds = endMachTime - machTime; NanosecondsToTimeSpec(remainingNanoseconds, &endTime); } else @@ -180,9 +175,9 @@ class GCEvent::Impl st = ETIMEDOUT; } } -#else // HAVE_MACH_ABSOLUTE_TIME +#else // HAVE_CLOCK_GETTIME_NSEC_NP st = pthread_cond_timedwait(&m_condition, &m_mutex, &endTime); -#endif // HAVE_MACH_ABSOLUTE_TIME +#endif // HAVE_CLOCK_GETTIME_NSEC_NP // Verify that if the wait timed out, the event was not set assert((st != ETIMEDOUT) || !m_state); } diff --git a/src/coreclr/src/gc/unix/gcenv.unix.cpp b/src/coreclr/src/gc/unix/gcenv.unix.cpp index e7a122498699..e6b4fc744341 100644 --- a/src/coreclr/src/gc/unix/gcenv.unix.cpp +++ b/src/coreclr/src/gc/unix/gcenv.unix.cpp @@ -28,6 +28,12 @@ #undef min #undef max +#if __has_cpp_attribute(fallthrough) +#define FALLTHROUGH [[fallthrough]] +#else +#define FALLTHROUGH +#endif + #include #if HAVE_SYS_TIME_H @@ -366,14 +372,6 @@ bool GCToOSInterface::Initialize() } } -#if HAVE_MACH_ABSOLUTE_TIME - kern_return_t machRet; - if ((machRet = mach_timebase_info(&g_TimebaseInfo)) != KERN_SUCCESS) - { - return false; - } -#endif // HAVE_MACH_ABSOLUTE_TIME - InitializeCGroup(); #if HAVE_SCHED_GETAFFINITY @@ -646,7 +644,7 @@ bool GCToOSInterface::VirtualRelease(void* address, size_t size) // size - size of the virtual memory range // Return: // Starting virtual address of the committed range -void* GCToOSInterface::VirtualReserveAndCommitLargePages(size_t size) +void* GCToOSInterface::VirtualReserveAndCommitLargePages(size_t size, uint16_t node) { #if HAVE_MAP_HUGETLB uint32_t largePagesFlag = MAP_HUGETLB; @@ -657,7 +655,7 @@ void* GCToOSInterface::VirtualReserveAndCommitLargePages(size_t size) #endif void* pRetVal = VirtualReserveInner(size, OS_PAGE_SIZE, 0, largePagesFlag); - if (VirtualCommit(pRetVal, size, NUMA_NODE_UNDEFINED)) + if (VirtualCommit(pRetVal, size, node)) { return pRetVal; } @@ -800,8 +798,10 @@ bool ReadMemoryValueFromFile(const char* filename, uint64_t* val) { case 'g': case 'G': multiplier = 1024; + FALLTHROUGH; case 'm': case 'M': multiplier = multiplier * 1024; + FALLTHROUGH; case 'k': case 'K': multiplier = multiplier * 1024; } @@ -834,9 +834,14 @@ static size_t GetLogicalProcessorCacheSizeFromOS() cacheSize = std::max(cacheSize, ( size_t) sysconf(_SC_LEVEL4_CACHE_SIZE)); #endif -#if defined(HOST_ARM64) +#if defined(TARGET_LINUX) && !defined(HOST_ARM) if (cacheSize == 0) { + // + // Fallback to retrieve cachesize via /sys/.. if sysconf was not available + // for the platform. Currently musl and arm64 should be only cases to use + // this method to determine cache size. + // size_t size; if (ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index0/size", &size)) @@ -850,7 +855,9 @@ static size_t GetLogicalProcessorCacheSizeFromOS() if (ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index4/size", &size)) cacheSize = std::max(cacheSize, size); } +#endif +#if defined(HOST_ARM64) && !defined(TARGET_OSX) if (cacheSize == 0) { // It is currently expected to be missing cache size info @@ -985,19 +992,32 @@ size_t GCToOSInterface::GetCacheSizePerLogicalCpu(bool trueSize) // true if setting the affinity was successful, false otherwise. bool GCToOSInterface::SetThreadAffinity(uint16_t procNo) { -#if HAVE_PTHREAD_GETAFFINITY_NP +#if HAVE_SCHED_SETAFFINITY || HAVE_PTHREAD_SETAFFINITY_NP cpu_set_t cpuSet; CPU_ZERO(&cpuSet); CPU_SET((int)procNo, &cpuSet); + // Snap's default strict confinement does not allow sched_setaffinity(, ...) without manually connecting the + // process-control plug. sched_setaffinity(, ...) is also currently not allowed, only + // sched_setaffinity(0, ...). pthread_setaffinity_np(pthread_self(), ...) seems to call + // sched_setaffinity(, ...) in at least one implementation, and does not work. To work around those + // issues, use sched_setaffinity(0, ...) if available and only otherwise fall back to pthread_setaffinity_np(). See the + // following for more information: + // - https://github.com/dotnet/runtime/pull/38795 + // - https://github.com/dotnet/runtime/issues/1634 + // - https://forum.snapcraft.io/t/requesting-autoconnect-for-interfaces-in-pigmeat-process-control-home/17987/13 +#if HAVE_SCHED_SETAFFINITY + int st = sched_setaffinity(0, sizeof(cpu_set_t), &cpuSet); +#else int st = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuSet); +#endif return (st == 0); -#else // HAVE_PTHREAD_GETAFFINITY_NP +#else // !(HAVE_SCHED_SETAFFINITY || HAVE_PTHREAD_SETAFFINITY_NP) // There is no API to manage thread affinity, so let's ignore the request return false; -#endif // HAVE_PTHREAD_GETAFFINITY_NP +#endif // HAVE_SCHED_SETAFFINITY || HAVE_PTHREAD_SETAFFINITY_NP } // Boosts the calling thread's thread priority to a level higher than the default diff --git a/src/coreclr/src/gc/unix/globals.h b/src/coreclr/src/gc/unix/globals.h index fe0d76a36a4c..aca43064f28c 100644 --- a/src/coreclr/src/gc/unix/globals.h +++ b/src/coreclr/src/gc/unix/globals.h @@ -4,10 +4,6 @@ #ifndef __GLOBALS_H__ #define __GLOBALS_H__ -#if HAVE_MACH_ABSOLUTE_TIME -#include -#endif // HAVE_MACH_ABSOLUTE_TIME - const int tccSecondsToMilliSeconds = 1000; // The number of microseconds in a second. @@ -22,8 +18,4 @@ const int tccMilliSecondsToMicroSeconds = 1000; // The number of nanoseconds in a millisecond. const int tccMilliSecondsToNanoSeconds = 1000000; -#if HAVE_MACH_ABSOLUTE_TIME -extern mach_timebase_info_data_t g_TimebaseInfo; -#endif // HAVE_MACH_ABSOLUTE_TIME - #endif // __GLOBALS_H__ diff --git a/src/coreclr/src/gc/vxsort/alignment.h b/src/coreclr/src/gc/vxsort/alignment.h index df61c3a30f41..a32261be951f 100644 --- a/src/coreclr/src/gc/vxsort/alignment.h +++ b/src/coreclr/src/gc/vxsort/alignment.h @@ -4,8 +4,6 @@ #ifndef VXSORT_ALIGNNMENT_H #define VXSORT_ALIGNNMENT_H -//#include - namespace vxsort { using namespace std; diff --git a/src/coreclr/src/gc/vxsort/defs.h b/src/coreclr/src/gc/vxsort/defs.h index 628315e5110a..0cc72b23fa24 100644 --- a/src/coreclr/src/gc/vxsort/defs.h +++ b/src/coreclr/src/gc/vxsort/defs.h @@ -45,4 +45,45 @@ #define NOINLINE __attribute__((noinline)) #endif +namespace std { +template +class numeric_limits { + public: + static constexpr _Ty Max() { static_assert(sizeof(_Ty) != sizeof(_Ty), "func must be specialized!"); return _Ty(); } + static constexpr _Ty Min() { static_assert(sizeof(_Ty) != sizeof(_Ty), "func must be specialized!"); return _Ty(); } +}; + +template <> +class numeric_limits { +public: + static constexpr int32_t Max() { return 0x7fffffff; } + static constexpr int32_t Min() { return -0x7fffffff - 1; } +}; + +template <> +class numeric_limits { +public: + static constexpr uint32_t Max() { return 0xffffffff; } + static constexpr uint32_t Min() { return 0; } +}; + +template <> +class numeric_limits { + public: + static constexpr int64_t Max() { return 0x7fffffffffffffffi64; } + + static constexpr int64_t Min() { return -0x7fffffffffffffffi64 - 1; } +}; +} // namespace std + +#ifndef max +template +T max(T a, T b) { + if (a > b) + return a; + else + return b; +} +#endif + #endif // VXSORT_DEFS_H diff --git a/src/coreclr/src/gc/vxsort/do_vxsort.h b/src/coreclr/src/gc/vxsort/do_vxsort.h index 50a5e1ef77a7..edd803f310f4 100644 --- a/src/coreclr/src/gc/vxsort/do_vxsort.h +++ b/src/coreclr/src/gc/vxsort/do_vxsort.h @@ -11,14 +11,6 @@ enum class InstructionSet void InitSupportedInstructionSet (int32_t configSetting); bool IsSupportedInstructionSet (InstructionSet instructionSet); -void do_vxsort_avx2 (uint8_t** low, uint8_t** high); -void do_vxsort_avx2 (int32_t* low, int32_t* high); +void do_vxsort_avx2 (uint8_t** low, uint8_t** high, uint8_t *range_low, uint8_t *range_high); -void do_pack_avx2 (uint8_t** mem, size_t len, uint8_t* base); -void do_unpack_avx2 (int32_t* mem, size_t len, uint8_t* base); - -void do_vxsort_avx512 (uint8_t** low, uint8_t** high); -void do_vxsort_avx512 (int32_t* low, int32_t* high); - -void do_pack_avx512 (uint8_t** mem, size_t len, uint8_t* base); -void do_unpack_avx512 (int32_t* mem, size_t len, uint8_t* base); +void do_vxsort_avx512 (uint8_t** low, uint8_t** high, uint8_t* range_low, uint8_t* range_high); diff --git a/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp b/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp index 3e4fd10d15f4..1f097ede355d 100644 --- a/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp +++ b/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp @@ -5,82 +5,15 @@ #include "vxsort_targets_enable_avx2.h" -namespace std -{ - template - class numeric_limits - { - public: - static _Ty Max() - { - return _Ty(); - } - static _Ty Min() - { - return _Ty(); - } - }; - template <> - class numeric_limits - { - public: - static int32_t Max() - { - return 0x7fffffff; - } - static int32_t Min() - { - return -0x7fffffff-1; - } - }; - template <> - class numeric_limits - { - public: - static int64_t Max() - { - return 0x7fffffffffffffffi64; - } - - static int64_t Min() - { - return -0x7fffffffffffffffi64-1; - } - }; -} - -#ifndef max -template -T max (T a, T b) -{ - if (a > b) return a; else return b; -} -#endif #include "vxsort.h" #include "machine_traits.avx2.h" #include "packer.h" -void do_vxsort_avx2 (uint8_t** low, uint8_t** high) -{ - auto sorter = vxsort::vxsort(); - sorter.sort ((int64_t*)low, (int64_t*)high); -} - -void do_vxsort_avx2 (int32_t* low, int32_t* high) -{ - auto sorter = vxsort::vxsort(); - sorter.sort (low, high); -} - -void do_pack_avx2 (uint8_t** mem, size_t len, uint8_t* base) -{ - auto packer = vxsort::packer(); - packer.pack ((int64_t*)mem, len, (int64_t)base); -} - -void do_unpack_avx2 (int32_t* mem, size_t len, uint8_t* base) +void do_vxsort_avx2 (uint8_t** low, uint8_t** high, uint8_t* range_low, uint8_t* range_high) { - auto packer = vxsort::packer(); - packer.unpack (mem, len, (int64_t)base); + const int shift = 3; + assert((1 << shift) == sizeof(size_t)); + auto sorter = vxsort::vxsort(); + sorter.sort ((int64_t*)low, (int64_t*)high, (int64_t)range_low, (int64_t)(range_high+sizeof(uint8_t*))); } #include "vxsort_targets_disable.h" diff --git a/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp b/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp index aa0a8f99442e..792492046fd9 100644 --- a/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp +++ b/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp @@ -5,71 +5,14 @@ #include "vxsort_targets_enable_avx512.h" -namespace std -{ - template - class numeric_limits - { - public: - static _Ty Max() - { - return _Ty(); - } - static _Ty Min() - { - return _Ty(); - } - }; - template <> - class numeric_limits - { - public: - static int32_t Max() - { - return 0x7fffffff; - } - static int32_t Min() - { - return -0x7fffffff - 1; - } - }; - template <> - class numeric_limits - { - public: - static int64_t Max() - { - return 0x7fffffffffffffffi64; - } - - static int64_t Min() - { - return -0x7fffffffffffffffi64 - 1; - } - }; -} - -#ifndef max -template -T max (T a, T b) -{ - if (a > b) return a; else return b; -} -#endif - #include "vxsort.h" #include "machine_traits.avx512.h" -void do_vxsort_avx512 (uint8_t** low, uint8_t** high) +void do_vxsort_avx512 (uint8_t** low, uint8_t** high, uint8_t* range_low, uint8_t* range_high) { - auto sorter = vxsort::vxsort(); - sorter.sort ((int64_t*)low, (int64_t*)high); + const int shift = 3; + assert((1 << shift) == sizeof(size_t)); + auto sorter = vxsort::vxsort(); + sorter.sort ((int64_t*)low, (int64_t*)high, (int64_t)range_low, (int64_t)(range_high+sizeof(uint8_t*))); } - -void do_vxsort_avx512 (int32_t* low, int32_t* high) -{ - auto sorter = vxsort::vxsort(); - sorter.sort (low, high); -} - #include "vxsort_targets_disable.h" diff --git a/src/coreclr/src/gc/vxsort/isa_detection.cpp b/src/coreclr/src/gc/vxsort/isa_detection.cpp index ac469a615dde..2a60ea01207a 100644 --- a/src/coreclr/src/gc/vxsort/isa_detection.cpp +++ b/src/coreclr/src/gc/vxsort/isa_detection.cpp @@ -2,7 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "common.h" + +#ifdef TARGET_WINDOWS #include +#include +#endif #include "do_vxsort.h" @@ -17,13 +21,11 @@ enum class SupportedISA static DWORD64 GetEnabledXStateFeaturesHelper() { - LIMITED_METHOD_CONTRACT; - // On Windows we have an api(GetEnabledXStateFeatures) to check if AVX is supported typedef DWORD64(WINAPI* PGETENABLEDXSTATEFEATURES)(); PGETENABLEDXSTATEFEATURES pfnGetEnabledXStateFeatures = NULL; - HMODULE hMod = WszLoadLibraryEx(WINDOWS_KERNEL32_DLLNAME_W, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); + HMODULE hMod = LoadLibraryExW(L"kernel32.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); if (hMod == NULL) return 0; @@ -54,10 +56,11 @@ SupportedISA DetermineSupportedISA() // bit definitions to make code more readable enum bits { - OCXSAVE = 1<<27, - AVX = 1<<28, - AVX2 = 1<<5, - AVX512F=1<<16, + OCXSAVE = 1<<27, + AVX = 1<<28, + AVX2 = 1<< 5, + AVX512F = 1<<16, + AVX512DQ = 1<<17, }; int reg[COUNT]; @@ -80,8 +83,8 @@ SupportedISA DetermineSupportedISA() // get processor extended feature flag info __cpuid(reg, 7); - // check if both AVX2 and AVX512F are supported by both processor and OS - if ((reg[EBX] & (AVX2 | AVX512F)) == (AVX2 | AVX512F) && + // check if all of AVX2, AVX512F and AVX512DQ are supported by both processor and OS + if ((reg[EBX] & (AVX2 | AVX512F | AVX512DQ)) == (AVX2 | AVX512F | AVX512DQ) && (xcr0 & 0xe6) == 0xe6 && (FeatureMask & (XSTATE_MASK_AVX | XSTATE_MASK_AVX512)) == (XSTATE_MASK_AVX | XSTATE_MASK_AVX512)) { diff --git a/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp b/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp deleted file mode 100644 index e277a7675a9a..000000000000 --- a/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// 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 "do_vxsort.h" - -#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) - -void InitSupportedInstructionSet (int32_t) -{ -} - -bool IsSupportedInstructionSet (InstructionSet) -{ - return false; -} -#endif // defined(TARGET_AMD64) && defined(TARGET_WINDOWS) - diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp b/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp index d693d08ea414..e4e86d4b239c 100644 --- a/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp +++ b/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp @@ -2,8 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "common.h" -//#include - #include "machine_traits.avx2.h" namespace vxsort { diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx2.h b/src/coreclr/src/gc/vxsort/machine_traits.avx2.h index 1944b57a18f1..3720e78668e4 100644 --- a/src/coreclr/src/gc/vxsort/machine_traits.avx2.h +++ b/src/coreclr/src/gc/vxsort/machine_traits.avx2.h @@ -11,9 +11,8 @@ #include "vxsort_targets_enable_avx2.h" #include -//#include #include - +#include #include "defs.h" #include "machine_traits.h" @@ -37,16 +36,24 @@ static void not_supported() // in _DEBUG, we #define return to be something more complicated, // containing a statement, so #define away constexpr for _DEBUG #define constexpr -#endif //_DEBUG +#endif //_DEBUG template <> class vxsort_machine_traits { public: + typedef int32_t T; typedef __m256i TV; typedef uint32_t TMASK; + typedef int32_t TPACK; + typedef typename std::make_unsigned::type TU; static constexpr bool supports_compress_writes() { return false; } + static constexpr bool supports_packing() { return false; } + + template + static constexpr bool can_pack(T span) { return false; } + static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); } static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); } @@ -56,7 +63,7 @@ class vxsort_machine_traits { static INLINE TV partition_vector(TV v, int mask) { assert(mask >= 0); assert(mask <= 255); - return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8))))); + return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8))))); } static INLINE TV broadcast(int32_t pivot) { return _mm256_set1_epi32(pivot); } @@ -67,82 +74,47 @@ class vxsort_machine_traits { static INLINE TV add(TV a, TV b) { return _mm256_add_epi32(a, b); } static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi32(a, b); }; -}; - -template <> -class vxsort_machine_traits { - public: - typedef __m256i TV; - typedef uint32_t TMASK; - - static constexpr bool supports_compress_writes() { return false; } - - static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); } - static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); } - - static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } + static INLINE TV pack_ordered(TV a, TV b) { return a; } + static INLINE TV pack_unordered(TV a, TV b) { return a; } + static INLINE void unpack_ordered(TV p, TV& u1, TV& u2) { } - static INLINE TV partition_vector(TV v, int mask) { - assert(mask >= 0); - assert(mask <= 255); - return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8))))); + template + static T shift_n_sub(T v, T sub) { + if (Shift > 0) + v >>= Shift; + v -= sub; + return v; } - static INLINE TV broadcast(uint32_t pivot) { return _mm256_set1_epi32(pivot); } - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - __m256i top_bit = _mm256_set1_epi32(1U << 31); - return _mm256_movemask_ps(i2s(_mm256_cmpgt_epi32(_mm256_xor_si256(top_bit, a), _mm256_xor_si256(top_bit, b)))); + template + static T unshift_and_add(TPACK from, T add) { + add += from; + if (Shift > 0) + add = (T) (((TU) add) << Shift); + return add; } - - static TV shift_right(TV v, int i) { return _mm256_srli_epi32(v, i); } - static TV shift_left(TV v, int i) { return _mm256_slli_epi32(v, i); } - - static INLINE TV add(TV a, TV b) { return _mm256_add_epi32(a, b); } - static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi32(a, b); }; }; template <> -class vxsort_machine_traits { +class vxsort_machine_traits { public: - typedef __m256 TV; + typedef int64_t T; + typedef __m256i TV; typedef uint32_t TMASK; + typedef int32_t TPACK; + typedef typename std::make_unsigned::type TU; static constexpr bool supports_compress_writes() { return false; } - static INLINE TV load_vec(TV* p) { return _mm256_loadu_ps((float*)p); } + static constexpr bool supports_packing() { return true; } - static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_ps((float*)ptr, v); } - - static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } - - static INLINE TV partition_vector(TV v, int mask) { - assert(mask >= 0); - assert(mask <= 255); - return _mm256_permutevar8x32_ps(v, _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8)))); - } - - static INLINE TV broadcast(float pivot) { return _mm256_set1_ps(pivot); } - - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - /// 0x0E: Greater-than (ordered, signaling) \n - /// 0x1E: Greater-than (ordered, non-signaling) - return _mm256_movemask_ps(_mm256_cmp_ps(a, b, _CMP_GT_OS)); + template + static constexpr bool can_pack(T span) { + const auto PACK_LIMIT = (((TU) std::numeric_limits::Max() + 1)) << Shift; + return ((TU) span) < PACK_LIMIT; } - static INLINE TV add(TV a, TV b) { return _mm256_add_ps(a, b); } - static INLINE TV sub(TV a, TV b) { return _mm256_sub_ps(a, b); }; - -}; - -template <> -class vxsort_machine_traits { - public: - typedef __m256i TV; - typedef uint32_t TMASK; - - static constexpr bool supports_compress_writes() { return false; } - static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); } static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); } @@ -164,8 +136,6 @@ class vxsort_machine_traits { static INLINE TV add(TV a, TV b) { return _mm256_add_epi64(a, b); } static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi64(a, b); }; - - static INLINE TV pack_ordered(TV a, TV b) { a = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(a, _MM_PERM_DBCA), _MM_PERM_DBCA); b = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(b, _MM_PERM_DBCA), _MM_PERM_CADB); @@ -177,106 +147,31 @@ class vxsort_machine_traits { return _mm256_blend_epi32(a, b, 0b10101010); } - static INLINE void unpack_ordered_signed(TV p, TV& u1, TV& u2) { + static INLINE void unpack_ordered(TV p, TV& u1, TV& u2) { auto p01 = _mm256_extracti128_si256(p, 0); auto p02 = _mm256_extracti128_si256(p, 1); u1 = _mm256_cvtepi32_epi64(p01); u2 = _mm256_cvtepi32_epi64(p02); - - } - - static INLINE void unpack_ordered_unsigned(TV p, TV& u1, TV& u2) { - auto p01 = _mm256_extracti128_si256(p, 0); - auto p02 = _mm256_extracti128_si256(p, 1); - - u1 = _mm256_cvtepu32_epi64(p01); - u2 = _mm256_cvtepu32_epi64(p02); - } -/* - template<> - static INLINE TV pack_ordered(TV a, TV b) { - a = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(a, _MM_PERM_DBCA), _MM_PERM_DBCA); - b = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(b, _MM_PERM_DBCA), _MM_PERM_CADB); - return _mm256_blend_epi32(a, b, 0b11110000); + template + static T shift_n_sub(T v, T sub) { + if (Shift > 0) + v >>= Shift; + v -= sub; + return v; } - template<> - static INLINE typename vxsort_machine_traits::TV pack_unordered(TV a, TV b) { - b = _mm256_shuffle_epi32(b, _MM_PERM_CDAB); - return _mm256_blend_epi32(a, b, 0b10101010); + template + static T unshift_and_add(TPACK from, T add) { + add += from; + if (Shift > 0) + add = (T) (((TU) add) << Shift); + return add; } - - */ - - - }; -template <> -class vxsort_machine_traits { - public: - typedef __m256i TV; - typedef uint32_t TMASK; - - static constexpr bool supports_compress_writes() { return false; } - - static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); } - - static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); } - - static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } - - static INLINE TV partition_vector(TV v, int mask) { - assert(mask >= 0); - assert(mask <= 15); - return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_64 + mask * 8))))); - } - static INLINE TV broadcast(int64_t pivot) { return _mm256_set1_epi64x(pivot); } - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - __m256i top_bit = _mm256_set1_epi64x(1LLU << 63); - return _mm256_movemask_pd(i2d(_mm256_cmpgt_epi64(_mm256_xor_si256(top_bit, a), _mm256_xor_si256(top_bit, b)))); - } - - static INLINE TV shift_right(TV v, int i) { return _mm256_srli_epi64(v, i); } - static INLINE TV shift_left(TV v, int i) { return _mm256_slli_epi64(v, i); } - - static INLINE TV add(TV a, TV b) { return _mm256_add_epi64(a, b); } - static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi64(a, b); }; -}; - -template <> -class vxsort_machine_traits { - public: - typedef __m256d TV; - typedef uint32_t TMASK; - - static constexpr bool supports_compress_writes() { return false; } - - static INLINE TV load_vec(TV* p) { return _mm256_loadu_pd((double*)p); } - - static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_pd((double*)ptr, v); } - - static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); } - - static INLINE TV partition_vector(TV v, int mask) { - assert(mask >= 0); - assert(mask <= 15); - return s2d(_mm256_permutevar8x32_ps(d2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_64 + mask * 8))))); - } - - static INLINE TV broadcast(double pivot) { return _mm256_set1_pd(pivot); } - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - /// 0x0E: Greater-than (ordered, signaling) \n - /// 0x1E: Greater-than (ordered, non-signaling) - return _mm256_movemask_pd(_mm256_cmp_pd(a, b, _CMP_GT_OS)); - } - - static INLINE TV add(TV a, TV b) { return _mm256_add_pd(a, b); } - static INLINE TV sub(TV a, TV b) { return _mm256_sub_pd(a, b); }; -}; } diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx512.h b/src/coreclr/src/gc/vxsort/machine_traits.avx512.h index 443654a39b60..8df8660aa13a 100644 --- a/src/coreclr/src/gc/vxsort/machine_traits.avx512.h +++ b/src/coreclr/src/gc/vxsort/machine_traits.avx512.h @@ -18,205 +18,137 @@ // in _DEBUG, we #define return to be something more complicated, // containing a statement, so #define away constexpr for _DEBUG #define constexpr -#endif //_DEBUG +#endif //_DEBUG namespace vxsort { template <> class vxsort_machine_traits { - public: - typedef __m512i TV; - typedef __mmask16 TMASK; - - static constexpr bool supports_compress_writes() { return true; } + public: + typedef int32_t T; + typedef __m512i TV; + typedef __mmask16 TMASK; + typedef int32_t TPACK; + typedef typename std::make_unsigned::type TU; - static INLINE TV load_vec(TV* p) { - return _mm512_loadu_si512(p); - } + static constexpr bool supports_compress_writes() { return true; } - static INLINE void store_vec(TV* ptr, TV v) { - _mm512_storeu_si512(ptr, v); - } + static constexpr bool supports_packing() { return false; } - // Will never be called - static INLINE TV partition_vector(TV v, int mask) { return v; } + template + static constexpr bool can_pack(T span) { return false; } + static INLINE TV load_vec(TV* p) { return _mm512_loadu_si512(p); } - static void store_compress_vec(TV *ptr, TV v, TMASK mask) { - _mm512_mask_compressstoreu_epi32(ptr, mask, v); - } + static INLINE void store_vec(TV* ptr, TV v) { _mm512_storeu_si512(ptr, v); } - static INLINE TV broadcast(int32_t pivot) { - return _mm512_set1_epi32(pivot); - } + // Will never be called + static INLINE TV partition_vector(TV v, int mask) { return v; } - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - return _mm512_cmp_epi32_mask(a, b, _MM_CMPINT_GT); - } -}; + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { _mm512_mask_compressstoreu_epi32(ptr, mask, v); } -template <> -class vxsort_machine_traits { - public: - typedef __m512i TV; - typedef __mmask16 TMASK; + static INLINE TV broadcast(int32_t pivot) { return _mm512_set1_epi32(pivot); } - static constexpr bool supports_compress_writes() { return true; } + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { return _mm512_cmp_epi32_mask(a, b, _MM_CMPINT_GT); } - static INLINE TV load_vec(TV* p) { - return _mm512_loadu_si512(p); - } + static TV shift_right(TV v, int i) { return _mm512_srli_epi32(v, i); } + static TV shift_left(TV v, int i) { return _mm512_slli_epi32(v, i); } - static INLINE void store_vec(TV* ptr, TV v) { - _mm512_storeu_si512(ptr, v); - } + static INLINE TV add(TV a, TV b) { return _mm512_add_epi32(a, b); } + static INLINE TV sub(TV a, TV b) { return _mm512_sub_epi32(a, b); }; - // Will never be called - static INLINE TV partition_vector(TV v, int mask) { return v; } + static INLINE TV pack_ordered(TV a, TV b) { return a; } + static INLINE TV pack_unordered(TV a, TV b) { return a; } + static INLINE void unpack_ordered(TV p, TV& u1, TV& u2) { } + template + static T shift_n_sub(T v, T sub) { + if (Shift > 0) + v >>= Shift; + v -= sub; + return v; + } - static void store_compress_vec(TV *ptr, TV v, TMASK mask) { - _mm512_mask_compressstoreu_epi32(ptr, mask, v); - } - - static INLINE TV broadcast(uint32_t pivot) { - return _mm512_set1_epi32(pivot); - } - - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - return _mm512_cmp_epu32_mask(a, b, _MM_CMPINT_GT); - } -}; - -template <> -class vxsort_machine_traits { - public: - typedef __m512 TV; - typedef __mmask16 TMASK; - - static constexpr bool supports_compress_writes() { return true; } - - static INLINE TV load_vec(TV* p) { - return _mm512_loadu_ps(p); - } - - static INLINE void store_vec(TV* ptr, TV v) { - _mm512_storeu_ps(ptr, v); - } - - // Will never be called - static INLINE TV partition_vector(TV v, int mask) { return v; } - - - static void store_compress_vec(TV *ptr, TV v, TMASK mask) { - _mm512_mask_compressstoreu_ps(ptr, mask, v); - } - - static INLINE TV broadcast(float pivot) { - return _mm512_set1_ps(pivot); - } - - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - return _mm512_cmp_ps_mask(a, b, _CMP_GT_OS); - } + template + static T unshift_and_add(TPACK from, T add) { + add += from; + if (Shift > 0) + add = (T) (((TU) add) << Shift); + return add; + } }; template <> class vxsort_machine_traits { - public: - typedef __m512i TV; - typedef __mmask8 TMASK; - - static bool supports_compress_writes() { return true; } + public: + typedef int64_t T; + typedef __m512i TV; + typedef __mmask8 TMASK; + typedef int32_t TPACK; + typedef typename std::make_unsigned::type TU; - static INLINE TV load_vec(TV* p) { - return _mm512_loadu_si512(p); - } + static constexpr bool supports_compress_writes() { return true; } - static INLINE void store_vec(TV* ptr, TV v) { - _mm512_storeu_si512(ptr, v); - } + static constexpr bool supports_packing() { return true; } - // Will never be called - static INLINE TV partition_vector(TV v, int mask) { return v; } + template + static constexpr bool can_pack(T span) { + const auto PACK_LIMIT = (((TU) std::numeric_limits::Max() + 1)) << Shift; + return ((TU) span) < PACK_LIMIT; + } + static INLINE TV load_vec(TV* p) { return _mm512_loadu_si512(p); } - static void store_compress_vec(TV *ptr, TV v, TMASK mask) { - _mm512_mask_compressstoreu_epi64(ptr, mask, v); - } + static INLINE void store_vec(TV* ptr, TV v) { _mm512_storeu_si512(ptr, v); } - static INLINE TV broadcast(int64_t pivot) { - return _mm512_set1_epi64(pivot); - } + // Will never be called + static INLINE TV partition_vector(TV v, int mask) { return v; } - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - return _mm512_cmp_epi64_mask(a, b, _MM_CMPINT_GT); - } -}; - -template <> -class vxsort_machine_traits { - public: - typedef __m512i TV; - typedef __mmask8 TMASK; + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { _mm512_mask_compressstoreu_epi64(ptr, mask, v); } - static constexpr bool supports_compress_writes() { return true; } + static INLINE TV broadcast(int64_t pivot) { return _mm512_set1_epi64(pivot); } - static INLINE TV load_vec(TV* p) { - return _mm512_loadu_si512(p); - } + static INLINE TMASK get_cmpgt_mask(TV a, TV b) { return _mm512_cmp_epi64_mask(a, b, _MM_CMPINT_GT); } - static INLINE void store_vec(TV* ptr, TV v) { - _mm512_storeu_si512(ptr, v); - } + static TV shift_right(TV v, int i) { return _mm512_srli_epi64(v, i); } + static TV shift_left(TV v, int i) { return _mm512_slli_epi64(v, i); } - // Will never be called - static INLINE TV partition_vector(TV v, int mask) { return v; } + static INLINE TV add(TV a, TV b) { return _mm512_add_epi64(a, b); } + static INLINE TV sub(TV a, TV b) { return _mm512_sub_epi64(a, b); }; + static INLINE TV pack_ordered(TV a, TV b) { + a = _mm512_permutex_epi64(_mm512_shuffle_epi32(a, _MM_PERM_DBCA), _MM_PERM_DBCA); + b = _mm512_permutex_epi64(_mm512_shuffle_epi32(b, _MM_PERM_DBCA), _MM_PERM_CADB); + return _mm512_shuffle_i64x2(a, b, _MM_PERM_DBCA); + } - static void store_compress_vec(TV *ptr, TV v, TMASK mask) { - _mm512_mask_compressstoreu_epi64(ptr, mask, v); - } - - static INLINE TV broadcast(uint64_t pivot) { - return _mm512_set1_epi64(pivot); - } - - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - return _mm512_cmp_epu64_mask(a, b, _MM_CMPINT_GT); - } -}; - -template <> -class vxsort_machine_traits { - public: - typedef __m512d TV; - typedef __mmask8 TMASK; - - static constexpr bool supports_compress_writes() { return true; } + static INLINE TV pack_unordered(TV a, TV b) { return _mm512_mask_shuffle_epi32(a, 0b1010101010101010, b, _MM_PERM_CDAB); } - static INLINE TV load_vec(TV* p) { - return _mm512_loadu_pd(p); - } + static INLINE void unpack_ordered(TV p, TV& u1, TV& u2) { + auto p01 = _mm512_extracti32x8_epi32(p, 0); + auto p02 = _mm512_extracti32x8_epi32(p, 1); - static INLINE void store_vec(TV* ptr, TV v) { - _mm512_storeu_pd(ptr, v); - } + u1 = _mm512_cvtepi32_epi64(p01); + u2 = _mm512_cvtepi32_epi64(p02); + } - // Will never be called - static INLINE TV partition_vector(TV v, int mask) { return v; } + template + static T shift_n_sub(T v, T sub) { + if (Shift > 0) + v >>= Shift; + v -= sub; + return v; + } + template + static T unshift_and_add(TPACK from, T add) { + add += from; - static void store_compress_vec(TV *ptr, TV v, TMASK mask) { - _mm512_mask_compressstoreu_pd(ptr, mask, v); - } + if (Shift > 0) + add = (T) (((TU) add) << Shift); - static INLINE TV broadcast(double pivot) { - return _mm512_set1_pd(pivot); - } + return add; + } - static INLINE TMASK get_cmpgt_mask(TV a, TV b) { - return _mm512_cmp_pd_mask(a, b, _CMP_GT_OS); - } }; } diff --git a/src/coreclr/src/gc/vxsort/machine_traits.h b/src/coreclr/src/gc/vxsort/machine_traits.h index cd31ed365777..7862d4b0d9ea 100644 --- a/src/coreclr/src/gc/vxsort/machine_traits.h +++ b/src/coreclr/src/gc/vxsort/machine_traits.h @@ -8,8 +8,6 @@ #ifndef VXSORT_MACHINE_TRAITS_H #define VXSORT_MACHINE_TRAITS_H -//#include - namespace vxsort { enum vector_machine { @@ -22,14 +20,35 @@ enum vector_machine { template struct vxsort_machine_traits { public: - typedef int TV; - typedef int TMASK; + typedef T TV; + typedef T TMASK; + typedef T TPACK; + + static constexpr bool supports_compress_writes() { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + return false; + } + + static constexpr bool supports_packing() { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + return false; + } - static constexpr bool supports_compress_writes(); + template + static constexpr bool can_pack(T span) { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + return false; + } - static TV load_vec(TV* ptr); - static void store_vec(TV* ptr, TV v); - static void store_compress_vec(TV* ptr, TV v, TMASK mask); + static TV load_vec(TV* ptr) { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + } + static void store_vec(TV* ptr, TV v) { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + } + static void store_compress_vec(TV* ptr, TV v, TMASK mask) { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + } static TV partition_vector(TV v, int mask); static TV broadcast(T pivot); static TMASK get_cmpgt_mask(TV a, TV b); @@ -43,11 +62,25 @@ struct vxsort_machine_traits { static TV pack_ordered(TV a, TV b); static TV pack_unordered(TV a, TV b); - static void unpack_ordered_signed(TV p, TV& u1, TV& u2); - static void unpack_ordered_unsigned(TV p, TV& u1, TV& u2); + static void unpack_ordered(TV p, TV& u1, TV& u2) { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + } + template + static T shift_n_sub(T v, T sub) { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + return v; + } + template + static T unshift_and_add(TPACK from, T add) { + static_assert(sizeof(TV) != sizeof(TV), "func must be specialized!"); + return add; + } }; + } + + #endif // VXSORT_MACHINE_TRAITS_H diff --git a/src/coreclr/src/gc/vxsort/packer.h b/src/coreclr/src/gc/vxsort/packer.h index 4c7257a58f17..be50b7d5fb41 100644 --- a/src/coreclr/src/gc/vxsort/packer.h +++ b/src/coreclr/src/gc/vxsort/packer.h @@ -4,196 +4,259 @@ #ifndef VXSORT_PACKER_H #define VXSORT_PACKER_H -#include "vxsort_targets_enable_avx2.h" - -//#include -//#include -//#include -#//include +#include "defs.h" #include "alignment.h" #include "machine_traits.h" -#include "machine_traits.avx2.h" -#include "machine_traits.avx512.h" #include -//#include namespace vxsort { -template +template class packer { - static_assert(Shift <= 31, "Shift must be in the range 0..31"); - using MT = vxsort_machine_traits; - typedef typename MT::TV TV; - typedef typename std::make_unsigned::type TU; - static const int N = sizeof(TV) / sizeof(TFrom); - typedef alignment_hint AH; - - static const size_t ALIGN = AH::ALIGN; - static const size_t ALIGN_MASK = ALIGN - 1; - - static INLINE void pack_scalar(const TFrom offset, TFrom*& mem_read, TTo*& mem_write) { - auto d = *(mem_read++); - if (Shift > 0) - d >>= Shift; - d -= offset; - *(mem_write++) = (TTo) d; - } - - static INLINE void unpack_scalar(const TFrom offset, TTo*& mem_read, TFrom*& mem_write) { - TFrom d = *(--mem_read); - - d += offset; - - if (Shift > 0) - d = (TFrom) (((TU) d) << Shift); - - *(--mem_write) = d; - } - - public: - - static void pack(TFrom *mem, size_t len, TFrom base) { - TFrom offset = (base >> Shift) - std::numeric_limits::Min(); - auto baseVec = MT::broadcast(offset); - - auto pre_aligned_mem = reinterpret_cast(reinterpret_cast(mem) & ~ALIGN_MASK); - - auto mem_read = mem; - auto mem_write = (TTo *) mem; - - // Include a "special" pass to handle very short scalar - // passes - if (MinLength < N && len < N) { - while (len--) { - pack_scalar(offset, mem_read, mem_write); - } - return; + static_assert(Shift <= 31, "Shift must be in the range 0..31"); + static_assert(Unroll >= 1, "Unroll can be in the range 1..4"); + static_assert(Unroll <= 4, "Unroll can be in the range 1..4"); + + using MT = vxsort_machine_traits; + typedef typename MT::TV TV; + static const int N = sizeof(TV) / sizeof(TFrom); + typedef alignment_hint AH; + + static const size_t ALIGN = AH::ALIGN; + static const size_t ALIGN_MASK = ALIGN - 1; + + + static INLINE TV pack_vectorized(const TV baseVec, TV d01, TV d02) { + if (Shift > 0) { // This is statically compiled in/out + d01 = MT::shift_right(d01, Shift); + d02 = MT::shift_right(d02, Shift); + } + d01 = MT::sub(d01, baseVec); + d02 = MT::sub(d02, baseVec); + + auto packed_data = RespectPackingOrder ? + MT::pack_ordered(d01, d02) : + MT::pack_unordered(d01, d02); + return packed_data; } - // We have at least - // one vector worth of data to handle - // Let's try to align to vector size first - - if (pre_aligned_mem < mem) { - const auto alignment_point = pre_aligned_mem + N; - len -= (alignment_point - mem_read); - while (mem_read < alignment_point) { - pack_scalar(offset, mem_read, mem_write); - } - } - - assert(AH::is_aligned(mem_read)); - - auto memv_read = (TV *) mem_read; - auto memv_write = (TV *) mem_write; + static NOINLINE void unpack_vectorized(const TV baseVec, TV d01, TV& u01, TV& u02) { + MT::unpack_ordered(d01, u01, u02); - auto lenv = len / N; - len -= (lenv * N); + u01 = MT::add(u01, baseVec); + u02 = MT::add(u02, baseVec); - while (lenv >= 2) { - assert(memv_read >= memv_write); - - auto d01 = MT::load_vec(memv_read); - auto d02 = MT::load_vec(memv_read + 1); - if (Shift > 0) { // This is statically compiled in/out - d01 = MT::shift_right(d01, Shift); - d02 = MT::shift_right(d02, Shift); - } - d01 = MT::sub(d01, baseVec); - d02 = MT::sub(d02, baseVec); - - auto packed_data = RespectPackingOrder ? - MT::pack_ordered(d01, d02) : - MT::pack_unordered(d01, d02); - - MT::store_vec(memv_write, packed_data); - - memv_read += 2; - memv_write++; - lenv -= 2; + if (Shift > 0) { // This is statically compiled in/out + u01 = MT::shift_left(u01, Shift); + u02 = MT::shift_left(u02, Shift); + } } - len += lenv * N; - - mem_read = (TFrom *) memv_read; - mem_write = (TTo *) memv_write; - - while (len-- > 0) { - pack_scalar(offset, mem_read, mem_write); - } - } - - static void unpack(TTo *mem, size_t len, TFrom base) { - TFrom offset = (base >> Shift) - std::numeric_limits::Min(); - auto baseVec = MT::broadcast(offset); - - auto mem_read = mem + len; - auto mem_write = ((TFrom *) mem) + len; - - - // Include a "special" pass to handle very short scalar - // passers - if (MinLength < 2*N && len < 2*N) { - while (len--) { - unpack_scalar(offset, mem_read, mem_write); - } - return; - } - - auto pre_aligned_mem = reinterpret_cast(reinterpret_cast(mem_read) & ~ALIGN_MASK); - - if (pre_aligned_mem < mem_read) { - len -= (mem_read - pre_aligned_mem); - while (mem_read > pre_aligned_mem) { - unpack_scalar(offset, mem_read, mem_write); - } - } - - assert(AH::is_aligned(mem_read)); - - auto lenv = len / (N*2); - auto memv_read = ((TV *) mem_read) - 1; - auto memv_write = ((TV *) mem_write) - 2; - len -= lenv * N * 2; - - while (lenv > 0) { - assert(memv_read <= memv_write); - TV d01, d02; - - if (std::numeric_limits::Min() < 0) - MT::unpack_ordered_signed(MT::load_vec(memv_read), d01, d02); - else - MT::unpack_ordered_unsigned(MT::load_vec(memv_read), d01, d02); - - d01 = MT::add(d01, baseVec); - d02 = MT::add(d02, baseVec); - - if (Shift > 0) { // This is statically compiled in/out - d01 = MT::shift_left(d01, Shift); - d02 = MT::shift_left(d02, Shift); - } - - MT::store_vec(memv_write, d01); - MT::store_vec(memv_write + 1, d02); - - memv_read -= 1; - memv_write -= 2; - lenv--; + public: + + static void pack(TFrom *mem, size_t len, TFrom base) { + TFrom offset = MT::template shift_n_sub(base, (TFrom) std::numeric_limits::Min()); + auto baseVec = MT::broadcast(offset); + + auto pre_aligned_mem = reinterpret_cast(reinterpret_cast(mem) & ~ALIGN_MASK); + + auto mem_read = mem; + auto mem_write = (TTo *) mem; + + // Include a "special" pass to handle very short scalar + // passes + if (MinLength < N && len < N) { + while (len--) { + *(mem_write++) = (TTo) MT::template shift_n_sub(*(mem_read++), offset); + } + return; + } + + // We have at least + // one vector worth of data to handle + // Let's try to align to vector size first + + if (pre_aligned_mem < mem) { + const auto alignment_point = pre_aligned_mem + N; + len -= (alignment_point - mem_read); + while (mem_read < alignment_point) { + *(mem_write++) = (TTo) MT::template shift_n_sub(*(mem_read++), offset); + } + } + + assert(AH::is_aligned(mem_read)); + + auto memv_read = (TV *) mem_read; + auto memv_write = (TV *) mem_write; + + auto lenv = len / N; + len -= (lenv * N); + + while (lenv >= 2 * Unroll) { + assert(memv_read >= memv_write); + + TV d01, d02, d03, d04, d05, d06, d07, d08; + + do { + d01 = MT::load_vec(memv_read + 0); + d02 = MT::load_vec(memv_read + 1); + if (Unroll == 1) break; + d03 = MT::load_vec(memv_read + 2); + d04 = MT::load_vec(memv_read + 3); + if (Unroll == 2) break; + d05 = MT::load_vec(memv_read + 4); + d06 = MT::load_vec(memv_read + 5); + if (Unroll == 3) break; + d07 = MT::load_vec(memv_read + 6); + d08 = MT::load_vec(memv_read + 7); + break; + } while (true); + + do { + MT::store_vec(memv_write + 0, pack_vectorized(baseVec, d01, d02)); + if (Unroll == 1) break; + MT::store_vec(memv_write + 1, pack_vectorized(baseVec, d03, d04)); + if (Unroll == 2) break; + MT::store_vec(memv_write + 2, pack_vectorized(baseVec, d05, d06)); + if (Unroll == 3) break; + MT::store_vec(memv_write + 3, pack_vectorized(baseVec, d07, d08)); + break; + } while(true); + + memv_read += 2*Unroll; + memv_write += Unroll; + lenv -= 2*Unroll; + } + + if (Unroll > 1) { + while (lenv >= 2) { + assert(memv_read >= memv_write); + TV d01, d02; + + d01 = MT::load_vec(memv_read + 0); + d02 = MT::load_vec(memv_read + 1); + + MT::store_vec(memv_write + 0, pack_vectorized(baseVec, d01, d02)); + memv_read += 2; + memv_write++; + lenv -= 2; + } + } + + len += lenv * N; + + mem_read = (TFrom *) memv_read; + mem_write = (TTo *) memv_write; + + while (len-- > 0) { + *(mem_write++) = (TTo) MT::template shift_n_sub(*(mem_read++), offset); + } } - mem_read = (TTo *) (memv_read + 1); - mem_write = (TFrom *) (memv_write + 2); - while (len-- > 0) { - unpack_scalar(offset, mem_read, mem_write); + static void unpack(TTo *mem, size_t len, TFrom base) { + TFrom offset = MT::template shift_n_sub(base, (TFrom) std::numeric_limits::Min()); + auto baseVec = MT::broadcast(offset); + + auto mem_read = mem + len; + auto mem_write = ((TFrom *) mem) + len; + + + // Include a "special" pass to handle very short scalar + // passers + if (MinLength < 2 * N && len < 2 * N) { + while (len--) { + *(--mem_write) = MT::template unshift_and_add(*(--mem_read), offset); + } + return; + } + + auto pre_aligned_mem = reinterpret_cast(reinterpret_cast(mem_read) & ~ALIGN_MASK); + + if (pre_aligned_mem < mem_read) { + len -= (mem_read - pre_aligned_mem); + while (mem_read > pre_aligned_mem) { + *(--mem_write) = MT::template unshift_and_add(*(--mem_read), offset); + } + } + + assert(AH::is_aligned(mem_read)); + + auto lenv = len / (N * 2); + auto memv_read = ((TV *) mem_read) - 1; + auto memv_write = ((TV *) mem_write) - 2; + len -= lenv * N * 2; + + while (lenv >= Unroll) { + assert(memv_read <= memv_write); + + TV d01, d02, d03, d04; + TV u01, u02, u03, u04, u05, u06, u07, u08; + + do { + d01 = MT::load_vec(memv_read + 0); + if (Unroll == 1) break; + d02 = MT::load_vec(memv_read - 1); + if (Unroll == 2) break; + d03 = MT::load_vec(memv_read - 2); + if (Unroll == 3) break; + d04 = MT::load_vec(memv_read - 3); + break; + } while(true); + + do { + unpack_vectorized(baseVec, d01, u01, u02); + MT::store_vec(memv_write + 0, u01); + MT::store_vec(memv_write + 1, u02); + if (Unroll == 1) break; + unpack_vectorized(baseVec, d02, u03, u04); + MT::store_vec(memv_write - 2, u03); + MT::store_vec(memv_write - 1, u04); + if (Unroll == 2) break; + unpack_vectorized(baseVec, d03, u05, u06); + MT::store_vec(memv_write - 4, u05); + MT::store_vec(memv_write - 3, u06); + if (Unroll == 3) break; + unpack_vectorized(baseVec, d04, u07, u08); + MT::store_vec(memv_write - 6, u07); + MT::store_vec(memv_write - 5, u08); + break; + } while(true); + + memv_read -= Unroll; + memv_write -= 2 * Unroll; + lenv -= Unroll; + } + + if (Unroll > 1) { + while (lenv >= 1) { + assert(memv_read <= memv_write); + + TV d01; + TV u01, u02; + + d01 = MT::load_vec(memv_read + 0); + + unpack_vectorized(baseVec, d01, u01, u02); + MT::store_vec(memv_write + 0, u01); + MT::store_vec(memv_write + 1, u02); + + memv_read--; + memv_write -= 2; + lenv--; + } + } + + mem_read = (TTo *) (memv_read + 1); + mem_write = (TFrom *) (memv_write + 2); + + while (len-- > 0) { + *(--mem_write) = MT::template unshift_and_add(*(--mem_read), offset); + } } - } }; - } -#include "vxsort_targets_disable.h" - #endif // VXSORT_PACKER_H diff --git a/src/coreclr/src/gc/vxsort/smallsort/avx2_load_mask_tables.cpp b/src/coreclr/src/gc/vxsort/smallsort/avx2_load_mask_tables.cpp new file mode 100644 index 000000000000..8f2f24f7d5c1 --- /dev/null +++ b/src/coreclr/src/gc/vxsort/smallsort/avx2_load_mask_tables.cpp @@ -0,0 +1,41 @@ +// 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 "bitonic_sort.h" + +namespace vxsort { + namespace smallsort { + + extern "C" alignas(16) const uint8_t mask_table_4[M4_SIZE] = { + 0xFF, 0xFF, 0xFF, 0xFF, // 0b0000 (0) + 0xFF, 0x00, 0x00, 0x00, // 0b0001 (1) + 0xFF, 0xFF, 0x00, 0x00, // 0b0011 (3) + 0xFF, 0xFF, 0xFF, 0x00, // 0b0111 (7) + #if defined(__has_feature) + #if __has_feature(address_sanitizer) + 0xCC, 0xCC, 0xCC, 0xCC, // Garbage to make ASAN happy + 0xCC, 0xCC, 0xCC, 0xCC, // Garbage to make ASAN happy + 0xCC, 0xCC, 0xCC, 0xCC, // Garbage to make ASAN happy + #endif + #endif + }; + + extern "C" alignas(128) const uint8_t mask_table_8[M8_SIZE] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 0b00000000 ( 0) + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0b00000001 ( 1) + 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0b00000011 ( 3) + 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 0b00000111 ( 7) + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, // 0b00001111 ( 15) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, // 0b00011111 ( 31) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, // 0b00111111 ( 63) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, // 0b01111111 (127) + #if defined(__has_feature) + #if __has_feature(address_sanitizer) + 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, // Garbage to make ASAN happy + #endif + #endif + }; + } +} diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp index 17ddcd815057..b72cecf4536c 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp @@ -7,24 +7,25 @@ using namespace vxsort; void vxsort::smallsort::bitonic::sort(int32_t *ptr, size_t length) { - const int N = 8; - - switch(length / N) { - case 1: sort_01v(ptr); break; - case 2: sort_02v(ptr); break; - case 3: sort_03v(ptr); break; - case 4: sort_04v(ptr); break; - case 5: sort_05v(ptr); break; - case 6: sort_06v(ptr); break; - case 7: sort_07v(ptr); break; - case 8: sort_08v(ptr); break; - case 9: sort_09v(ptr); break; - case 10: sort_10v(ptr); break; - case 11: sort_11v(ptr); break; - case 12: sort_12v(ptr); break; - case 13: sort_13v(ptr); break; - case 14: sort_14v(ptr); break; - case 15: sort_15v(ptr); break; - case 16: sort_16v(ptr); break; + const auto fullvlength = length / N; + const int remainder = (int) (length - fullvlength * N); + const auto v = fullvlength + ((remainder > 0) ? 1 : 0); + switch(v) { + case 1: sort_01v_alt(ptr, remainder); break; + case 2: sort_02v_alt(ptr, remainder); break; + case 3: sort_03v_alt(ptr, remainder); break; + case 4: sort_04v_alt(ptr, remainder); break; + case 5: sort_05v_alt(ptr, remainder); break; + case 6: sort_06v_alt(ptr, remainder); break; + case 7: sort_07v_alt(ptr, remainder); break; + case 8: sort_08v_alt(ptr, remainder); break; + case 9: sort_09v_alt(ptr, remainder); break; + case 10: sort_10v_alt(ptr, remainder); break; + case 11: sort_11v_alt(ptr, remainder); break; + case 12: sort_12v_alt(ptr, remainder); break; + case 13: sort_13v_alt(ptr, remainder); break; + case 14: sort_14v_alt(ptr, remainder); break; + case 15: sort_15v_alt(ptr, remainder); break; + case 16: sort_16v_alt(ptr, remainder); break; } } diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h index 79bdbcc870d4..8557cf462033 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h @@ -3,7 +3,7 @@ ///////////////////////////////////////////////////////////////////////////// //// -// This file was auto-generated by a tool at 2020-06-22 05:27:48 +// This file was auto-generated by a tool at 2020-07-21 14:05:39 // // It is recommended you DO NOT directly edit this file but instead edit // the code-generator that generated this source file instead. @@ -33,7 +33,13 @@ namespace vxsort { namespace smallsort { + +extern "C" const uint8_t mask_table_4[16]; +extern "C" const uint8_t mask_table_8[64]; + template<> struct bitonic { + static const int N = 8; + static constexpr int32_t MAX = std::numeric_limits::Max(); public: static INLINE void sort_01v_ascending(__m256i& d01) { @@ -252,7 +258,7 @@ template<> struct bitonic { sort_02v_merge_descending(d01, d02); sort_01v_merge_descending(d03); } - static INLINE void sort_04v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + static NOINLINE void sort_04v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { __m256i tmp; sort_02v_ascending(d01, d02); @@ -271,7 +277,7 @@ template<> struct bitonic { sort_02v_merge_ascending(d01, d02); sort_02v_merge_ascending(d03, d04); } - static INLINE void sort_04v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + static NOINLINE void sort_04v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { __m256i tmp; sort_02v_descending(d01, d02); @@ -290,7 +296,7 @@ template<> struct bitonic { sort_02v_merge_descending(d01, d02); sort_02v_merge_descending(d03, d04); } - static INLINE void sort_04v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + static NOINLINE void sort_04v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { __m256i tmp; tmp = d01; @@ -308,7 +314,7 @@ template<> struct bitonic { sort_02v_merge_ascending(d01, d02); sort_02v_merge_ascending(d03, d04); } - static INLINE void sort_04v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + static NOINLINE void sort_04v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { __m256i tmp; tmp = d01; @@ -548,7 +554,7 @@ template<> struct bitonic { sort_04v_merge_descending(d01, d02, d03, d04); sort_03v_merge_descending(d05, d06, d07); } - static INLINE void sort_08v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + static NOINLINE void sort_08v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { __m256i tmp; sort_04v_ascending(d01, d02, d03, d04); @@ -577,7 +583,7 @@ template<> struct bitonic { sort_04v_merge_ascending(d01, d02, d03, d04); sort_04v_merge_ascending(d05, d06, d07, d08); } - static INLINE void sort_08v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + static NOINLINE void sort_08v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { __m256i tmp; sort_04v_descending(d01, d02, d03, d04); @@ -606,7 +612,7 @@ template<> struct bitonic { sort_04v_merge_descending(d01, d02, d03, d04); sort_04v_merge_descending(d05, d06, d07, d08); } - static INLINE void sort_08v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + static NOINLINE void sort_08v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { __m256i tmp; tmp = d01; @@ -636,7 +642,7 @@ template<> struct bitonic { sort_04v_merge_ascending(d01, d02, d03, d04); sort_04v_merge_ascending(d05, d06, d07, d08); } - static INLINE void sort_08v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + static NOINLINE void sort_08v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { __m256i tmp; tmp = d01; @@ -780,7 +786,7 @@ template<> struct bitonic { sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); sort_03v_merge_descending(d09, d10, d11); } - static INLINE void sort_12v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { + static NOINLINE void sort_12v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { __m256i tmp; sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -809,7 +815,7 @@ template<> struct bitonic { sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); sort_04v_merge_ascending(d09, d10, d11, d12); } - static INLINE void sort_12v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { + static NOINLINE void sort_12v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { __m256i tmp; sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -1072,7 +1078,7 @@ template<> struct bitonic { sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15); } - static INLINE void sort_16v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { + static NOINLINE void sort_16v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { __m256i tmp; sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -1121,7 +1127,7 @@ template<> struct bitonic { sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16); } - static INLINE void sort_16v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { + static NOINLINE void sort_16v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { __m256i tmp; sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -1171,80 +1177,94 @@ template<> struct bitonic { sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16); } - static NOINLINE void sort_01v(int32_t *ptr) { - __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + static NOINLINE void sort_01v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); + + __m256i d01 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 0), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_01v_ascending(d01); - _mm256_storeu_si256((__m256i *) ptr + 0, d01); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 0), mask, d01); + } + + static NOINLINE void sort_02v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_02v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; - __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d02 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 1), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_02v_ascending(d01, d02); _mm256_storeu_si256((__m256i *) ptr + 0, d01); - _mm256_storeu_si256((__m256i *) ptr + 1, d02); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 1), mask, d02); + } + + static NOINLINE void sort_03v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_03v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; - __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d03 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 2), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_03v_ascending(d01, d02, d03); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); - _mm256_storeu_si256((__m256i *) ptr + 2, d03); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 2), mask, d03); + } + + static NOINLINE void sort_04v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_04v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; - __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d04 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 3), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_04v_ascending(d01, d02, d03, d04); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); _mm256_storeu_si256((__m256i *) ptr + 2, d03); - _mm256_storeu_si256((__m256i *) ptr + 3, d04); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 3), mask, d04); + } + + static NOINLINE void sort_05v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_05v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; - __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d05 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 4), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_05v_ascending(d01, d02, d03, d04, d05); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); _mm256_storeu_si256((__m256i *) ptr + 2, d03); _mm256_storeu_si256((__m256i *) ptr + 3, d04); - _mm256_storeu_si256((__m256i *) ptr + 4, d05); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 4), mask, d05); + } + + static NOINLINE void sort_06v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_06v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; - __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d06 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 5), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_06v_ascending(d01, d02, d03, d04, d05, d06); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); _mm256_storeu_si256((__m256i *) ptr + 2, d03); _mm256_storeu_si256((__m256i *) ptr + 3, d04); _mm256_storeu_si256((__m256i *) ptr + 4, d05); - _mm256_storeu_si256((__m256i *) ptr + 5, d06); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 5), mask, d06); + } + + static NOINLINE void sort_07v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_07v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; - __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d07 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 6), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1252,10 +1272,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 3, d04); _mm256_storeu_si256((__m256i *) ptr + 4, d05); _mm256_storeu_si256((__m256i *) ptr + 5, d06); - _mm256_storeu_si256((__m256i *) ptr + 6, d07); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 6), mask, d07); + } + + static NOINLINE void sort_08v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_08v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1263,7 +1285,7 @@ template<> struct bitonic { __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; - __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d08 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 7), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1272,10 +1294,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 4, d05); _mm256_storeu_si256((__m256i *) ptr + 5, d06); _mm256_storeu_si256((__m256i *) ptr + 6, d07); - _mm256_storeu_si256((__m256i *) ptr + 7, d08); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 7), mask, d08); + } + + static NOINLINE void sort_09v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_09v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1284,7 +1308,7 @@ template<> struct bitonic { __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; - __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d09 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 8), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1294,10 +1318,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 5, d06); _mm256_storeu_si256((__m256i *) ptr + 6, d07); _mm256_storeu_si256((__m256i *) ptr + 7, d08); - _mm256_storeu_si256((__m256i *) ptr + 8, d09); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 8), mask, d09); + } + + static NOINLINE void sort_10v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_10v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1307,7 +1333,7 @@ template<> struct bitonic { __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; - __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d10 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 9), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1318,10 +1344,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 6, d07); _mm256_storeu_si256((__m256i *) ptr + 7, d08); _mm256_storeu_si256((__m256i *) ptr + 8, d09); - _mm256_storeu_si256((__m256i *) ptr + 9, d10); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 9), mask, d10); + } + + static NOINLINE void sort_11v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_11v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1332,7 +1360,7 @@ template<> struct bitonic { __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; - __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d11 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 10), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1344,10 +1372,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 7, d08); _mm256_storeu_si256((__m256i *) ptr + 8, d09); _mm256_storeu_si256((__m256i *) ptr + 9, d10); - _mm256_storeu_si256((__m256i *) ptr + 10, d11); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 10), mask, d11); + } + + static NOINLINE void sort_12v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_12v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1359,7 +1389,7 @@ template<> struct bitonic { __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; - __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d12 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 11), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1372,10 +1402,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 8, d09); _mm256_storeu_si256((__m256i *) ptr + 9, d10); _mm256_storeu_si256((__m256i *) ptr + 10, d11); - _mm256_storeu_si256((__m256i *) ptr + 11, d12); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 11), mask, d12); + } + + static NOINLINE void sort_13v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_13v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1388,7 +1420,7 @@ template<> struct bitonic { __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; - __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + __m256i d13 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 12), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1402,10 +1434,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 9, d10); _mm256_storeu_si256((__m256i *) ptr + 10, d11); _mm256_storeu_si256((__m256i *) ptr + 11, d12); - _mm256_storeu_si256((__m256i *) ptr + 12, d13); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 12), mask, d13); + } + + static NOINLINE void sort_14v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_14v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1419,7 +1453,7 @@ template<> struct bitonic { __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; - __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; + __m256i d14 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 13), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1434,10 +1468,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 10, d11); _mm256_storeu_si256((__m256i *) ptr + 11, d12); _mm256_storeu_si256((__m256i *) ptr + 12, d13); - _mm256_storeu_si256((__m256i *) ptr + 13, d14); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 13), mask, d14); + } + + static NOINLINE void sort_15v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_15v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1452,7 +1488,7 @@ template<> struct bitonic { __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; - __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);; + __m256i d15 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 14), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1468,10 +1504,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 11, d12); _mm256_storeu_si256((__m256i *) ptr + 12, d13); _mm256_storeu_si256((__m256i *) ptr + 13, d14); - _mm256_storeu_si256((__m256i *) ptr + 14, d15); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 14), mask, d15); + } + + static NOINLINE void sort_16v_alt(int32_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi32(_mm_loadu_si128((__m128i*)(mask_table_8 + remainder * N))); - static NOINLINE void sort_16v(int32_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1487,7 +1525,7 @@ template<> struct bitonic { __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);; - __m256i d16 = _mm256_lddqu_si256((__m256i const *) ptr + 15);; + __m256i d16 = _mm256_or_si256(_mm256_maskload_epi32((int32_t const *) ((__m256i const *) ptr + 15), mask), _mm256_andnot_si256(mask, _mm256_set1_epi32(MAX))); sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1504,8 +1542,8 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 12, d13); _mm256_storeu_si256((__m256i *) ptr + 13, d14); _mm256_storeu_si256((__m256i *) ptr + 14, d15); - _mm256_storeu_si256((__m256i *) ptr + 15, d16); -} + _mm256_maskstore_epi32((int32_t *) ((__m256i *) ptr + 15), mask, d16); + } static void sort(int32_t *ptr, size_t length); }; diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp index 00360ae70f0c..b74e0d5c2671 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp @@ -7,24 +7,25 @@ using namespace vxsort; void vxsort::smallsort::bitonic::sort(int64_t *ptr, size_t length) { - const int N = 4; - - switch(length / N) { - case 1: sort_01v(ptr); break; - case 2: sort_02v(ptr); break; - case 3: sort_03v(ptr); break; - case 4: sort_04v(ptr); break; - case 5: sort_05v(ptr); break; - case 6: sort_06v(ptr); break; - case 7: sort_07v(ptr); break; - case 8: sort_08v(ptr); break; - case 9: sort_09v(ptr); break; - case 10: sort_10v(ptr); break; - case 11: sort_11v(ptr); break; - case 12: sort_12v(ptr); break; - case 13: sort_13v(ptr); break; - case 14: sort_14v(ptr); break; - case 15: sort_15v(ptr); break; - case 16: sort_16v(ptr); break; + const auto fullvlength = length / N; + const int remainder = (int) (length - fullvlength * N); + const auto v = fullvlength + ((remainder > 0) ? 1 : 0); + switch(v) { + case 1: sort_01v_alt(ptr, remainder); break; + case 2: sort_02v_alt(ptr, remainder); break; + case 3: sort_03v_alt(ptr, remainder); break; + case 4: sort_04v_alt(ptr, remainder); break; + case 5: sort_05v_alt(ptr, remainder); break; + case 6: sort_06v_alt(ptr, remainder); break; + case 7: sort_07v_alt(ptr, remainder); break; + case 8: sort_08v_alt(ptr, remainder); break; + case 9: sort_09v_alt(ptr, remainder); break; + case 10: sort_10v_alt(ptr, remainder); break; + case 11: sort_11v_alt(ptr, remainder); break; + case 12: sort_12v_alt(ptr, remainder); break; + case 13: sort_13v_alt(ptr, remainder); break; + case 14: sort_14v_alt(ptr, remainder); break; + case 15: sort_15v_alt(ptr, remainder); break; + case 16: sort_16v_alt(ptr, remainder); break; } } diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h index 5e9d2fea0dcf..475fac681b1b 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h @@ -3,7 +3,7 @@ ///////////////////////////////////////////////////////////////////////////// //// -// This file was auto-generated by a tool at 2020-06-22 05:27:48 +// This file was auto-generated by a tool at 2020-07-21 14:05:39 // // It is recommended you DO NOT directly edit this file but instead edit // the code-generator that generated this source file instead. @@ -33,7 +33,13 @@ namespace vxsort { namespace smallsort { + +extern "C" const uint8_t mask_table_4[16]; +extern "C" const uint8_t mask_table_8[64]; + template<> struct bitonic { + static const int N = 4; + static constexpr int64_t MAX = std::numeric_limits::Max(); public: static INLINE void sort_01v_ascending(__m256i& d01) { @@ -212,7 +218,7 @@ template<> struct bitonic { sort_02v_merge_descending(d01, d02); sort_01v_merge_descending(d03); } - static INLINE void sort_04v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + static NOINLINE void sort_04v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { __m256i tmp, cmp; sort_02v_ascending(d01, d02); @@ -231,7 +237,7 @@ template<> struct bitonic { sort_02v_merge_ascending(d01, d02); sort_02v_merge_ascending(d03, d04); } - static INLINE void sort_04v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + static NOINLINE void sort_04v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { __m256i tmp, cmp; sort_02v_descending(d01, d02); @@ -250,7 +256,7 @@ template<> struct bitonic { sort_02v_merge_descending(d01, d02); sort_02v_merge_descending(d03, d04); } - static INLINE void sort_04v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + static NOINLINE void sort_04v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { __m256i tmp, cmp; tmp = d01; @@ -268,7 +274,7 @@ template<> struct bitonic { sort_02v_merge_ascending(d01, d02); sort_02v_merge_ascending(d03, d04); } - static INLINE void sort_04v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { + static NOINLINE void sort_04v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) { __m256i tmp, cmp; tmp = d01; @@ -508,7 +514,7 @@ template<> struct bitonic { sort_04v_merge_descending(d01, d02, d03, d04); sort_03v_merge_descending(d05, d06, d07); } - static INLINE void sort_08v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + static NOINLINE void sort_08v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { __m256i tmp, cmp; sort_04v_ascending(d01, d02, d03, d04); @@ -537,7 +543,7 @@ template<> struct bitonic { sort_04v_merge_ascending(d01, d02, d03, d04); sort_04v_merge_ascending(d05, d06, d07, d08); } - static INLINE void sort_08v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + static NOINLINE void sort_08v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { __m256i tmp, cmp; sort_04v_descending(d01, d02, d03, d04); @@ -566,7 +572,7 @@ template<> struct bitonic { sort_04v_merge_descending(d01, d02, d03, d04); sort_04v_merge_descending(d05, d06, d07, d08); } - static INLINE void sort_08v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + static NOINLINE void sort_08v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { __m256i tmp, cmp; tmp = d01; @@ -596,7 +602,7 @@ template<> struct bitonic { sort_04v_merge_ascending(d01, d02, d03, d04); sort_04v_merge_ascending(d05, d06, d07, d08); } - static INLINE void sort_08v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { + static NOINLINE void sort_08v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) { __m256i tmp, cmp; tmp = d01; @@ -740,7 +746,7 @@ template<> struct bitonic { sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); sort_03v_merge_descending(d09, d10, d11); } - static INLINE void sort_12v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { + static NOINLINE void sort_12v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { __m256i tmp, cmp; sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -769,7 +775,7 @@ template<> struct bitonic { sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); sort_04v_merge_ascending(d09, d10, d11, d12); } - static INLINE void sort_12v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { + static NOINLINE void sort_12v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) { __m256i tmp, cmp; sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -1032,7 +1038,7 @@ template<> struct bitonic { sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15); } - static INLINE void sort_16v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { + static NOINLINE void sort_16v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { __m256i tmp, cmp; sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -1081,7 +1087,7 @@ template<> struct bitonic { sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16); } - static INLINE void sort_16v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { + static NOINLINE void sort_16v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) { __m256i tmp, cmp; sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -1131,80 +1137,94 @@ template<> struct bitonic { sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16); } - static NOINLINE void sort_01v(int64_t *ptr) { - __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; + static NOINLINE void sort_01v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); + + __m256i d01 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 0), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_01v_ascending(d01); - _mm256_storeu_si256((__m256i *) ptr + 0, d01); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 0), mask, d01); + } + + static NOINLINE void sort_02v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_02v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; - __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; + __m256i d02 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 1), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_02v_ascending(d01, d02); _mm256_storeu_si256((__m256i *) ptr + 0, d01); - _mm256_storeu_si256((__m256i *) ptr + 1, d02); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 1), mask, d02); + } + + static NOINLINE void sort_03v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_03v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; - __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; + __m256i d03 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 2), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_03v_ascending(d01, d02, d03); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); - _mm256_storeu_si256((__m256i *) ptr + 2, d03); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 2), mask, d03); + } + + static NOINLINE void sort_04v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_04v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; - __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; + __m256i d04 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 3), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_04v_ascending(d01, d02, d03, d04); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); _mm256_storeu_si256((__m256i *) ptr + 2, d03); - _mm256_storeu_si256((__m256i *) ptr + 3, d04); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 3), mask, d04); + } + + static NOINLINE void sort_05v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_05v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; - __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; + __m256i d05 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 4), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_05v_ascending(d01, d02, d03, d04, d05); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); _mm256_storeu_si256((__m256i *) ptr + 2, d03); _mm256_storeu_si256((__m256i *) ptr + 3, d04); - _mm256_storeu_si256((__m256i *) ptr + 4, d05); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 4), mask, d05); + } + + static NOINLINE void sort_06v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_06v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; - __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; + __m256i d06 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 5), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_06v_ascending(d01, d02, d03, d04, d05, d06); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); _mm256_storeu_si256((__m256i *) ptr + 2, d03); _mm256_storeu_si256((__m256i *) ptr + 3, d04); _mm256_storeu_si256((__m256i *) ptr + 4, d05); - _mm256_storeu_si256((__m256i *) ptr + 5, d06); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 5), mask, d06); + } + + static NOINLINE void sort_07v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_07v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);; __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; - __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; + __m256i d07 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 6), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1212,10 +1232,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 3, d04); _mm256_storeu_si256((__m256i *) ptr + 4, d05); _mm256_storeu_si256((__m256i *) ptr + 5, d06); - _mm256_storeu_si256((__m256i *) ptr + 6, d07); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 6), mask, d07); + } + + static NOINLINE void sort_08v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_08v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1223,7 +1245,7 @@ template<> struct bitonic { __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);; __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; - __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; + __m256i d08 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 7), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1232,10 +1254,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 4, d05); _mm256_storeu_si256((__m256i *) ptr + 5, d06); _mm256_storeu_si256((__m256i *) ptr + 6, d07); - _mm256_storeu_si256((__m256i *) ptr + 7, d08); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 7), mask, d08); + } + + static NOINLINE void sort_09v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_09v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1244,7 +1268,7 @@ template<> struct bitonic { __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);; __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; - __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; + __m256i d09 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 8), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1254,10 +1278,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 5, d06); _mm256_storeu_si256((__m256i *) ptr + 6, d07); _mm256_storeu_si256((__m256i *) ptr + 7, d08); - _mm256_storeu_si256((__m256i *) ptr + 8, d09); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 8), mask, d09); + } + + static NOINLINE void sort_10v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_10v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1267,7 +1293,7 @@ template<> struct bitonic { __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);; __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; - __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; + __m256i d10 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 9), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1278,10 +1304,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 6, d07); _mm256_storeu_si256((__m256i *) ptr + 7, d08); _mm256_storeu_si256((__m256i *) ptr + 8, d09); - _mm256_storeu_si256((__m256i *) ptr + 9, d10); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 9), mask, d10); + } + + static NOINLINE void sort_11v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_11v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1292,7 +1320,7 @@ template<> struct bitonic { __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);; __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; - __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; + __m256i d11 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 10), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1304,10 +1332,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 7, d08); _mm256_storeu_si256((__m256i *) ptr + 8, d09); _mm256_storeu_si256((__m256i *) ptr + 9, d10); - _mm256_storeu_si256((__m256i *) ptr + 10, d11); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 10), mask, d11); + } + + static NOINLINE void sort_12v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_12v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1319,7 +1349,7 @@ template<> struct bitonic { __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);; __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; - __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; + __m256i d12 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 11), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1332,10 +1362,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 8, d09); _mm256_storeu_si256((__m256i *) ptr + 9, d10); _mm256_storeu_si256((__m256i *) ptr + 10, d11); - _mm256_storeu_si256((__m256i *) ptr + 11, d12); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 11), mask, d12); + } + + static NOINLINE void sort_13v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_13v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1348,7 +1380,7 @@ template<> struct bitonic { __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);; __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; - __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; + __m256i d13 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 12), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1362,10 +1394,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 9, d10); _mm256_storeu_si256((__m256i *) ptr + 10, d11); _mm256_storeu_si256((__m256i *) ptr + 11, d12); - _mm256_storeu_si256((__m256i *) ptr + 12, d13); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 12), mask, d13); + } + + static NOINLINE void sort_14v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_14v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1379,7 +1413,7 @@ template<> struct bitonic { __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);; __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; - __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; + __m256i d14 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 13), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1394,10 +1428,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 10, d11); _mm256_storeu_si256((__m256i *) ptr + 11, d12); _mm256_storeu_si256((__m256i *) ptr + 12, d13); - _mm256_storeu_si256((__m256i *) ptr + 13, d14); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 13), mask, d14); + } + + static NOINLINE void sort_15v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_15v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1412,7 +1448,7 @@ template<> struct bitonic { __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);; __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; - __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);; + __m256i d15 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 14), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1428,10 +1464,12 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 11, d12); _mm256_storeu_si256((__m256i *) ptr + 12, d13); _mm256_storeu_si256((__m256i *) ptr + 13, d14); - _mm256_storeu_si256((__m256i *) ptr + 14, d15); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 14), mask, d15); + } + + static NOINLINE void sort_16v_alt(int64_t *ptr, int remainder) { + const auto mask = _mm256_cvtepi8_epi64(_mm_loadu_si128((__m128i*)(mask_table_4 + remainder * N))); - static NOINLINE void sort_16v(int64_t *ptr) { __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);; __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);; __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);; @@ -1447,7 +1485,7 @@ template<> struct bitonic { __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);; __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);; __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);; - __m256i d16 = _mm256_lddqu_si256((__m256i const *) ptr + 15);; + __m256i d16 = _mm256_or_si256(_mm256_maskload_epi64((long long const *) ((__m256i const *) ptr + 15), mask), _mm256_andnot_si256(mask, _mm256_set1_epi64x(MAX))); sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16); _mm256_storeu_si256((__m256i *) ptr + 0, d01); _mm256_storeu_si256((__m256i *) ptr + 1, d02); @@ -1464,8 +1502,8 @@ template<> struct bitonic { _mm256_storeu_si256((__m256i *) ptr + 12, d13); _mm256_storeu_si256((__m256i *) ptr + 13, d14); _mm256_storeu_si256((__m256i *) ptr + 14, d15); - _mm256_storeu_si256((__m256i *) ptr + 15, d16); -} + _mm256_maskstore_epi64((long long *) ((__m256i *) ptr + 15), mask, d16); + } static void sort(int64_t *ptr, size_t length); }; diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp index 9efdf598ea49..28c2ee4b807c 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp @@ -7,24 +7,25 @@ using namespace vxsort; void vxsort::smallsort::bitonic::sort(int32_t *ptr, size_t length) { - const int N = 16; - - switch(length / N) { - case 1: sort_01v(ptr); break; - case 2: sort_02v(ptr); break; - case 3: sort_03v(ptr); break; - case 4: sort_04v(ptr); break; - case 5: sort_05v(ptr); break; - case 6: sort_06v(ptr); break; - case 7: sort_07v(ptr); break; - case 8: sort_08v(ptr); break; - case 9: sort_09v(ptr); break; - case 10: sort_10v(ptr); break; - case 11: sort_11v(ptr); break; - case 12: sort_12v(ptr); break; - case 13: sort_13v(ptr); break; - case 14: sort_14v(ptr); break; - case 15: sort_15v(ptr); break; - case 16: sort_16v(ptr); break; + const auto fullvlength = length / N; + const int remainder = (int) (length - fullvlength * N); + const auto v = fullvlength + ((remainder > 0) ? 1 : 0); + switch(v) { + case 1: sort_01v_alt(ptr, remainder); break; + case 2: sort_02v_alt(ptr, remainder); break; + case 3: sort_03v_alt(ptr, remainder); break; + case 4: sort_04v_alt(ptr, remainder); break; + case 5: sort_05v_alt(ptr, remainder); break; + case 6: sort_06v_alt(ptr, remainder); break; + case 7: sort_07v_alt(ptr, remainder); break; + case 8: sort_08v_alt(ptr, remainder); break; + case 9: sort_09v_alt(ptr, remainder); break; + case 10: sort_10v_alt(ptr, remainder); break; + case 11: sort_11v_alt(ptr, remainder); break; + case 12: sort_12v_alt(ptr, remainder); break; + case 13: sort_13v_alt(ptr, remainder); break; + case 14: sort_14v_alt(ptr, remainder); break; + case 15: sort_15v_alt(ptr, remainder); break; + case 16: sort_16v_alt(ptr, remainder); break; } } diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h index 21c992c3e0df..1b1843ec093c 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h @@ -3,7 +3,7 @@ ///////////////////////////////////////////////////////////////////////////// //// -// This file was auto-generated by a tool at 2020-06-22 05:27:48 +// This file was auto-generated by a tool at 2020-07-21 14:05:39 // // It is recommended you DO NOT directly edit this file but instead edit // the code-generator that generated this source file instead. @@ -35,6 +35,8 @@ namespace vxsort { namespace smallsort { template<> struct bitonic { + static const int N = 16; + static constexpr int32_t MAX = std::numeric_limits::Max(); public: static INLINE void sort_01v_ascending(__m512i& d01) { @@ -253,7 +255,7 @@ template<> struct bitonic { sort_02v_merge_descending(d01, d02); sort_01v_merge_descending(d03); } - static INLINE void sort_04v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + static NOINLINE void sort_04v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { __m512i tmp; sort_02v_ascending(d01, d02); @@ -270,7 +272,7 @@ template<> struct bitonic { sort_02v_merge_ascending(d01, d02); sort_02v_merge_ascending(d03, d04); } - static INLINE void sort_04v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + static NOINLINE void sort_04v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { __m512i tmp; sort_02v_descending(d01, d02); @@ -287,7 +289,7 @@ template<> struct bitonic { sort_02v_merge_descending(d01, d02); sort_02v_merge_descending(d03, d04); } - static INLINE void sort_04v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + static NOINLINE void sort_04v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { __m512i tmp; tmp = d01; @@ -301,7 +303,7 @@ template<> struct bitonic { sort_02v_merge_ascending(d01, d02); sort_02v_merge_ascending(d03, d04); } - static INLINE void sort_04v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + static NOINLINE void sort_04v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { __m512i tmp; tmp = d01; @@ -501,7 +503,7 @@ template<> struct bitonic { sort_04v_merge_descending(d01, d02, d03, d04); sort_03v_merge_descending(d05, d06, d07); } - static INLINE void sort_08v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + static NOINLINE void sort_08v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { __m512i tmp; sort_04v_ascending(d01, d02, d03, d04); @@ -526,7 +528,7 @@ template<> struct bitonic { sort_04v_merge_ascending(d01, d02, d03, d04); sort_04v_merge_ascending(d05, d06, d07, d08); } - static INLINE void sort_08v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + static NOINLINE void sort_08v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { __m512i tmp; sort_04v_descending(d01, d02, d03, d04); @@ -551,7 +553,7 @@ template<> struct bitonic { sort_04v_merge_descending(d01, d02, d03, d04); sort_04v_merge_descending(d05, d06, d07, d08); } - static INLINE void sort_08v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + static NOINLINE void sort_08v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { __m512i tmp; tmp = d01; @@ -573,7 +575,7 @@ template<> struct bitonic { sort_04v_merge_ascending(d01, d02, d03, d04); sort_04v_merge_ascending(d05, d06, d07, d08); } - static INLINE void sort_08v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + static NOINLINE void sort_08v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { __m512i tmp; tmp = d01; @@ -697,7 +699,7 @@ template<> struct bitonic { sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); sort_03v_merge_descending(d09, d10, d11); } - static INLINE void sort_12v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { + static NOINLINE void sort_12v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { __m512i tmp; sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -722,7 +724,7 @@ template<> struct bitonic { sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); sort_04v_merge_ascending(d09, d10, d11, d12); } - static INLINE void sort_12v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { + static NOINLINE void sort_12v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { __m512i tmp; sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -945,7 +947,7 @@ template<> struct bitonic { sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15); } - static INLINE void sort_16v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { + static NOINLINE void sort_16v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { __m512i tmp; sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -986,7 +988,7 @@ template<> struct bitonic { sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16); } - static INLINE void sort_16v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { + static NOINLINE void sort_16v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { __m512i tmp; sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -1028,80 +1030,108 @@ template<> struct bitonic { sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16); } - static NOINLINE void sort_01v(int32_t *ptr) { - __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + static NOINLINE void sort_01v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); + + __m512i d01 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 0)); sort_01v_ascending(d01); - _mm512_storeu_si512((__m512i *) ptr + 0, d01); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 0, mask, d01); + } + + static NOINLINE void sort_02v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_02v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; - __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d02 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 1)); sort_02v_ascending(d01, d02); _mm512_storeu_si512((__m512i *) ptr + 0, d01); - _mm512_storeu_si512((__m512i *) ptr + 1, d02); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 1, mask, d02); + } + + static NOINLINE void sort_03v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_03v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; - __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d03 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 2)); sort_03v_ascending(d01, d02, d03); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); - _mm512_storeu_si512((__m512i *) ptr + 2, d03); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 2, mask, d03); + } + + static NOINLINE void sort_04v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_04v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; - __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d04 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 3)); sort_04v_ascending(d01, d02, d03, d04); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); _mm512_storeu_si512((__m512i *) ptr + 2, d03); - _mm512_storeu_si512((__m512i *) ptr + 3, d04); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 3, mask, d04); + } + + static NOINLINE void sort_05v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_05v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; - __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d05 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 4)); sort_05v_ascending(d01, d02, d03, d04, d05); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); _mm512_storeu_si512((__m512i *) ptr + 2, d03); _mm512_storeu_si512((__m512i *) ptr + 3, d04); - _mm512_storeu_si512((__m512i *) ptr + 4, d05); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 4, mask, d05); + } + + static NOINLINE void sort_06v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_06v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; - __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d06 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 5)); sort_06v_ascending(d01, d02, d03, d04, d05, d06); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); _mm512_storeu_si512((__m512i *) ptr + 2, d03); _mm512_storeu_si512((__m512i *) ptr + 3, d04); _mm512_storeu_si512((__m512i *) ptr + 4, d05); - _mm512_storeu_si512((__m512i *) ptr + 5, d06); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 5, mask, d06); + } + + static NOINLINE void sort_07v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_07v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; - __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d07 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 6)); sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1109,10 +1139,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 3, d04); _mm512_storeu_si512((__m512i *) ptr + 4, d05); _mm512_storeu_si512((__m512i *) ptr + 5, d06); - _mm512_storeu_si512((__m512i *) ptr + 6, d07); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 6, mask, d07); + } + + static NOINLINE void sort_08v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_08v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1120,7 +1152,9 @@ template<> struct bitonic { __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; - __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d08 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 7)); sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1129,10 +1163,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 4, d05); _mm512_storeu_si512((__m512i *) ptr + 5, d06); _mm512_storeu_si512((__m512i *) ptr + 6, d07); - _mm512_storeu_si512((__m512i *) ptr + 7, d08); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 7, mask, d08); + } + + static NOINLINE void sort_09v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_09v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1141,7 +1177,9 @@ template<> struct bitonic { __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; - __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d09 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 8)); sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1151,10 +1189,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 5, d06); _mm512_storeu_si512((__m512i *) ptr + 6, d07); _mm512_storeu_si512((__m512i *) ptr + 7, d08); - _mm512_storeu_si512((__m512i *) ptr + 8, d09); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 8, mask, d09); + } + + static NOINLINE void sort_10v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_10v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1164,7 +1204,9 @@ template<> struct bitonic { __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; - __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d10 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 9)); sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1175,10 +1217,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 6, d07); _mm512_storeu_si512((__m512i *) ptr + 7, d08); _mm512_storeu_si512((__m512i *) ptr + 8, d09); - _mm512_storeu_si512((__m512i *) ptr + 9, d10); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 9, mask, d10); + } + + static NOINLINE void sort_11v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_11v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1189,7 +1233,9 @@ template<> struct bitonic { __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; - __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d11 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 10)); sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1201,10 +1247,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 7, d08); _mm512_storeu_si512((__m512i *) ptr + 8, d09); _mm512_storeu_si512((__m512i *) ptr + 9, d10); - _mm512_storeu_si512((__m512i *) ptr + 10, d11); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 10, mask, d11); + } + + static NOINLINE void sort_12v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_12v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1216,7 +1264,9 @@ template<> struct bitonic { __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; - __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d12 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 11)); sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1229,10 +1279,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 8, d09); _mm512_storeu_si512((__m512i *) ptr + 9, d10); _mm512_storeu_si512((__m512i *) ptr + 10, d11); - _mm512_storeu_si512((__m512i *) ptr + 11, d12); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 11, mask, d12); + } + + static NOINLINE void sort_13v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_13v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1245,7 +1297,9 @@ template<> struct bitonic { __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; - __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + __m512i d13 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 12)); sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1259,10 +1313,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 9, d10); _mm512_storeu_si512((__m512i *) ptr + 10, d11); _mm512_storeu_si512((__m512i *) ptr + 11, d12); - _mm512_storeu_si512((__m512i *) ptr + 12, d13); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 12, mask, d13); + } + + static NOINLINE void sort_14v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_14v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1276,7 +1332,9 @@ template<> struct bitonic { __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; - __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; + __m512i d14 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 13)); sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1291,10 +1349,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 10, d11); _mm512_storeu_si512((__m512i *) ptr + 11, d12); _mm512_storeu_si512((__m512i *) ptr + 12, d13); - _mm512_storeu_si512((__m512i *) ptr + 13, d14); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 13, mask, d14); + } + + static NOINLINE void sort_15v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_15v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1309,7 +1369,9 @@ template<> struct bitonic { __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; - __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);; + __m512i d15 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 14)); sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1325,10 +1387,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 11, d12); _mm512_storeu_si512((__m512i *) ptr + 12, d13); _mm512_storeu_si512((__m512i *) ptr + 13, d14); - _mm512_storeu_si512((__m512i *) ptr + 14, d15); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 14, mask, d15); + } + + static NOINLINE void sort_16v_alt(int32_t *ptr, int remainder) { + const auto mask = 0xFFFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_16v(int32_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1344,7 +1408,9 @@ template<> struct bitonic { __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);; - __m512i d16 = _mm512_loadu_si512((__m512i const *) ptr + 15);; + __m512i d16 = _mm512_mask_loadu_epi32(_mm512_set1_epi32(MAX), + mask, + (int32_t const *) ((__m512i const *) ptr + 15)); sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1361,8 +1427,8 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 12, d13); _mm512_storeu_si512((__m512i *) ptr + 13, d14); _mm512_storeu_si512((__m512i *) ptr + 14, d15); - _mm512_storeu_si512((__m512i *) ptr + 15, d16); -} + _mm512_mask_storeu_epi32((__m512i *) ptr + 15, mask, d16); + } static void sort(int32_t *ptr, size_t length); }; diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp index cf8b62809b36..20648e786d11 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp @@ -7,24 +7,25 @@ using namespace vxsort; void vxsort::smallsort::bitonic::sort(int64_t *ptr, size_t length) { - const int N = 8; - - switch(length / N) { - case 1: sort_01v(ptr); break; - case 2: sort_02v(ptr); break; - case 3: sort_03v(ptr); break; - case 4: sort_04v(ptr); break; - case 5: sort_05v(ptr); break; - case 6: sort_06v(ptr); break; - case 7: sort_07v(ptr); break; - case 8: sort_08v(ptr); break; - case 9: sort_09v(ptr); break; - case 10: sort_10v(ptr); break; - case 11: sort_11v(ptr); break; - case 12: sort_12v(ptr); break; - case 13: sort_13v(ptr); break; - case 14: sort_14v(ptr); break; - case 15: sort_15v(ptr); break; - case 16: sort_16v(ptr); break; + const auto fullvlength = length / N; + const int remainder = (int) (length - fullvlength * N); + const auto v = fullvlength + ((remainder > 0) ? 1 : 0); + switch(v) { + case 1: sort_01v_alt(ptr, remainder); break; + case 2: sort_02v_alt(ptr, remainder); break; + case 3: sort_03v_alt(ptr, remainder); break; + case 4: sort_04v_alt(ptr, remainder); break; + case 5: sort_05v_alt(ptr, remainder); break; + case 6: sort_06v_alt(ptr, remainder); break; + case 7: sort_07v_alt(ptr, remainder); break; + case 8: sort_08v_alt(ptr, remainder); break; + case 9: sort_09v_alt(ptr, remainder); break; + case 10: sort_10v_alt(ptr, remainder); break; + case 11: sort_11v_alt(ptr, remainder); break; + case 12: sort_12v_alt(ptr, remainder); break; + case 13: sort_13v_alt(ptr, remainder); break; + case 14: sort_14v_alt(ptr, remainder); break; + case 15: sort_15v_alt(ptr, remainder); break; + case 16: sort_16v_alt(ptr, remainder); break; } } diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h index 483cf5a1e158..b7f16d607373 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h @@ -3,7 +3,7 @@ ///////////////////////////////////////////////////////////////////////////// //// -// This file was auto-generated by a tool at 2020-06-22 05:27:48 +// This file was auto-generated by a tool at 2020-07-21 14:05:39 // // It is recommended you DO NOT directly edit this file but instead edit // the code-generator that generated this source file instead. @@ -35,6 +35,8 @@ namespace vxsort { namespace smallsort { template<> struct bitonic { + static const int N = 8; + static constexpr int64_t MAX = std::numeric_limits::Max(); public: static INLINE void sort_01v_ascending(__m512i& d01) { @@ -213,7 +215,7 @@ template<> struct bitonic { sort_02v_merge_descending(d01, d02); sort_01v_merge_descending(d03); } - static INLINE void sort_04v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + static NOINLINE void sort_04v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { __m512i tmp; sort_02v_ascending(d01, d02); @@ -230,7 +232,7 @@ template<> struct bitonic { sort_02v_merge_ascending(d01, d02); sort_02v_merge_ascending(d03, d04); } - static INLINE void sort_04v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + static NOINLINE void sort_04v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { __m512i tmp; sort_02v_descending(d01, d02); @@ -247,7 +249,7 @@ template<> struct bitonic { sort_02v_merge_descending(d01, d02); sort_02v_merge_descending(d03, d04); } - static INLINE void sort_04v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + static NOINLINE void sort_04v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { __m512i tmp; tmp = d01; @@ -261,7 +263,7 @@ template<> struct bitonic { sort_02v_merge_ascending(d01, d02); sort_02v_merge_ascending(d03, d04); } - static INLINE void sort_04v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { + static NOINLINE void sort_04v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) { __m512i tmp; tmp = d01; @@ -461,7 +463,7 @@ template<> struct bitonic { sort_04v_merge_descending(d01, d02, d03, d04); sort_03v_merge_descending(d05, d06, d07); } - static INLINE void sort_08v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + static NOINLINE void sort_08v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { __m512i tmp; sort_04v_ascending(d01, d02, d03, d04); @@ -486,7 +488,7 @@ template<> struct bitonic { sort_04v_merge_ascending(d01, d02, d03, d04); sort_04v_merge_ascending(d05, d06, d07, d08); } - static INLINE void sort_08v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + static NOINLINE void sort_08v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { __m512i tmp; sort_04v_descending(d01, d02, d03, d04); @@ -511,7 +513,7 @@ template<> struct bitonic { sort_04v_merge_descending(d01, d02, d03, d04); sort_04v_merge_descending(d05, d06, d07, d08); } - static INLINE void sort_08v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + static NOINLINE void sort_08v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { __m512i tmp; tmp = d01; @@ -533,7 +535,7 @@ template<> struct bitonic { sort_04v_merge_ascending(d01, d02, d03, d04); sort_04v_merge_ascending(d05, d06, d07, d08); } - static INLINE void sort_08v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { + static NOINLINE void sort_08v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) { __m512i tmp; tmp = d01; @@ -657,7 +659,7 @@ template<> struct bitonic { sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); sort_03v_merge_descending(d09, d10, d11); } - static INLINE void sort_12v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { + static NOINLINE void sort_12v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { __m512i tmp; sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -682,7 +684,7 @@ template<> struct bitonic { sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); sort_04v_merge_ascending(d09, d10, d11, d12); } - static INLINE void sort_12v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { + static NOINLINE void sort_12v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) { __m512i tmp; sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -905,7 +907,7 @@ template<> struct bitonic { sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08); sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15); } - static INLINE void sort_16v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { + static NOINLINE void sort_16v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { __m512i tmp; sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -946,7 +948,7 @@ template<> struct bitonic { sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08); sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16); } - static INLINE void sort_16v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { + static NOINLINE void sort_16v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) { __m512i tmp; sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08); @@ -988,80 +990,108 @@ template<> struct bitonic { sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16); } - static NOINLINE void sort_01v(int64_t *ptr) { - __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; + static NOINLINE void sort_01v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); + + __m512i d01 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 0)); sort_01v_ascending(d01); - _mm512_storeu_si512((__m512i *) ptr + 0, d01); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 0, mask, d01); + } + + static NOINLINE void sort_02v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_02v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; - __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; + __m512i d02 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 1)); sort_02v_ascending(d01, d02); _mm512_storeu_si512((__m512i *) ptr + 0, d01); - _mm512_storeu_si512((__m512i *) ptr + 1, d02); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 1, mask, d02); + } + + static NOINLINE void sort_03v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_03v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; - __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; + __m512i d03 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 2)); sort_03v_ascending(d01, d02, d03); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); - _mm512_storeu_si512((__m512i *) ptr + 2, d03); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 2, mask, d03); + } + + static NOINLINE void sort_04v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_04v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; - __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; + __m512i d04 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 3)); sort_04v_ascending(d01, d02, d03, d04); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); _mm512_storeu_si512((__m512i *) ptr + 2, d03); - _mm512_storeu_si512((__m512i *) ptr + 3, d04); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 3, mask, d04); + } + + static NOINLINE void sort_05v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_05v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; - __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; + __m512i d05 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 4)); sort_05v_ascending(d01, d02, d03, d04, d05); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); _mm512_storeu_si512((__m512i *) ptr + 2, d03); _mm512_storeu_si512((__m512i *) ptr + 3, d04); - _mm512_storeu_si512((__m512i *) ptr + 4, d05); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 4, mask, d05); + } + + static NOINLINE void sort_06v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_06v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; - __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; + __m512i d06 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 5)); sort_06v_ascending(d01, d02, d03, d04, d05, d06); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); _mm512_storeu_si512((__m512i *) ptr + 2, d03); _mm512_storeu_si512((__m512i *) ptr + 3, d04); _mm512_storeu_si512((__m512i *) ptr + 4, d05); - _mm512_storeu_si512((__m512i *) ptr + 5, d06); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 5, mask, d06); + } + + static NOINLINE void sort_07v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_07v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);; __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; - __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; + __m512i d07 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 6)); sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1069,10 +1099,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 3, d04); _mm512_storeu_si512((__m512i *) ptr + 4, d05); _mm512_storeu_si512((__m512i *) ptr + 5, d06); - _mm512_storeu_si512((__m512i *) ptr + 6, d07); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 6, mask, d07); + } + + static NOINLINE void sort_08v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_08v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1080,7 +1112,9 @@ template<> struct bitonic { __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);; __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; - __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; + __m512i d08 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 7)); sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1089,10 +1123,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 4, d05); _mm512_storeu_si512((__m512i *) ptr + 5, d06); _mm512_storeu_si512((__m512i *) ptr + 6, d07); - _mm512_storeu_si512((__m512i *) ptr + 7, d08); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 7, mask, d08); + } + + static NOINLINE void sort_09v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_09v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1101,7 +1137,9 @@ template<> struct bitonic { __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);; __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; - __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; + __m512i d09 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 8)); sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1111,10 +1149,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 5, d06); _mm512_storeu_si512((__m512i *) ptr + 6, d07); _mm512_storeu_si512((__m512i *) ptr + 7, d08); - _mm512_storeu_si512((__m512i *) ptr + 8, d09); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 8, mask, d09); + } + + static NOINLINE void sort_10v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_10v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1124,7 +1164,9 @@ template<> struct bitonic { __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);; __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; - __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; + __m512i d10 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 9)); sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1135,10 +1177,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 6, d07); _mm512_storeu_si512((__m512i *) ptr + 7, d08); _mm512_storeu_si512((__m512i *) ptr + 8, d09); - _mm512_storeu_si512((__m512i *) ptr + 9, d10); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 9, mask, d10); + } + + static NOINLINE void sort_11v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_11v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1149,7 +1193,9 @@ template<> struct bitonic { __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);; __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; - __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; + __m512i d11 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 10)); sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1161,10 +1207,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 7, d08); _mm512_storeu_si512((__m512i *) ptr + 8, d09); _mm512_storeu_si512((__m512i *) ptr + 9, d10); - _mm512_storeu_si512((__m512i *) ptr + 10, d11); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 10, mask, d11); + } + + static NOINLINE void sort_12v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_12v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1176,7 +1224,9 @@ template<> struct bitonic { __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);; __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; - __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; + __m512i d12 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 11)); sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1189,10 +1239,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 8, d09); _mm512_storeu_si512((__m512i *) ptr + 9, d10); _mm512_storeu_si512((__m512i *) ptr + 10, d11); - _mm512_storeu_si512((__m512i *) ptr + 11, d12); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 11, mask, d12); + } + + static NOINLINE void sort_13v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_13v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1205,7 +1257,9 @@ template<> struct bitonic { __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);; __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; - __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; + __m512i d13 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 12)); sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1219,10 +1273,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 9, d10); _mm512_storeu_si512((__m512i *) ptr + 10, d11); _mm512_storeu_si512((__m512i *) ptr + 11, d12); - _mm512_storeu_si512((__m512i *) ptr + 12, d13); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 12, mask, d13); + } + + static NOINLINE void sort_14v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_14v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1236,7 +1292,9 @@ template<> struct bitonic { __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);; __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; - __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; + __m512i d14 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 13)); sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1251,10 +1309,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 10, d11); _mm512_storeu_si512((__m512i *) ptr + 11, d12); _mm512_storeu_si512((__m512i *) ptr + 12, d13); - _mm512_storeu_si512((__m512i *) ptr + 13, d14); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 13, mask, d14); + } + + static NOINLINE void sort_15v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_15v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1269,7 +1329,9 @@ template<> struct bitonic { __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);; __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; - __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);; + __m512i d15 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 14)); sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1285,10 +1347,12 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 11, d12); _mm512_storeu_si512((__m512i *) ptr + 12, d13); _mm512_storeu_si512((__m512i *) ptr + 13, d14); - _mm512_storeu_si512((__m512i *) ptr + 14, d15); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 14, mask, d15); + } + + static NOINLINE void sort_16v_alt(int64_t *ptr, int remainder) { + const auto mask = 0xFF >> ((N - remainder) & (N-1)); - static NOINLINE void sort_16v(int64_t *ptr) { __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);; __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);; __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);; @@ -1304,7 +1368,9 @@ template<> struct bitonic { __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);; __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);; __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);; - __m512i d16 = _mm512_loadu_si512((__m512i const *) ptr + 15);; + __m512i d16 = _mm512_mask_loadu_epi64(_mm512_set1_epi64(MAX), + mask, + (int64_t const *) ((__m512i const *) ptr + 15)); sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16); _mm512_storeu_si512((__m512i *) ptr + 0, d01); _mm512_storeu_si512((__m512i *) ptr + 1, d02); @@ -1321,8 +1387,8 @@ template<> struct bitonic { _mm512_storeu_si512((__m512i *) ptr + 12, d13); _mm512_storeu_si512((__m512i *) ptr + 13, d14); _mm512_storeu_si512((__m512i *) ptr + 14, d15); - _mm512_storeu_si512((__m512i *) ptr + 15, d16); -} + _mm512_mask_storeu_epi64((__m512i *) ptr + 15, mask, d16); + } static void sort(int64_t *ptr, size_t length); }; diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h index 0e87b3742266..ba5635d4d945 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h +++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h @@ -4,16 +4,39 @@ #ifndef BITONIC_SORT_H #define BITONIC_SORT_H -#include #include "../defs.h" #include "../machine_traits.h" namespace vxsort { namespace smallsort { +using namespace std; + +// * We might read the last 4 bytes into a 128-bit vector for 64-bit element masking +// * We might read the last 8 bytes into a 128-bit vector for 32-bit element masking +// This mostly applies to debug mode, since without optimizations, most compilers +// actually execute the instruction stream _mm256_cvtepi8_epiNN + _mm_loadu_si128 as they are given. +// In contract, release/optimizing compilers, turn that very specific instruction pair to +// a more reasonable: vpmovsxbq ymm0, dword [rax*4 + mask_table_4], eliminating the 128-bit +// load completely and effectively reading 4/8 (depending if the instruction is vpmovsxb[q,d] +#if !defined(__has_feature) +#define __has_feature(a) (0) +#endif +#if !__has_feature(address_sanitizer) +const int M4_SIZE = 16; +const int M8_SIZE = 64; +#else +const int M4_SIZE = 16 + 12; +const int M8_SIZE = 64 + 8; +#endif + +extern "C" const uint8_t mask_table_4[M4_SIZE]; +extern "C" const uint8_t mask_table_8[M8_SIZE]; + template struct bitonic { public: static void sort(T* ptr, size_t length); + static void sort_alt(T* ptr, size_t length); }; } // namespace smallsort } // namespace gcsort diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py index 5f941d37ff1e..7bf5b86f0413 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py +++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py @@ -201,6 +201,33 @@ def get_load_intrinsic(self, v, offset): return f"_mm256_loadu_ps(({t} const *) ((__m256 const *) {v} + {offset}))" return f"_mm256_lddqu_si256((__m256i const *) {v} + {offset});" + def get_mask_load_intrinsic(self, v, offset, mask): + t = self.type + + if self.vector_size() == 4: + int_suffix = "epi64" + max_value = f"_mm256_andnot_si256({mask}, _mm256_set1_epi64x(MAX))" + elif self.vector_size() == 8: + int_suffix = "epi32" + max_value = f"_mm256_andnot_si256({mask}, _mm256_set1_epi32(MAX))" + + if t == "double": + max_value = f"_mm256_andnot_pd(i2d(mask), _mm256_set1_pd(MAX))" + load = f"_mm256_maskload_pd(({t} const *) ((__m256d const *) {v} + {offset}), {mask})" + return f"_mm256_or_pd({load}, {max_value})" + if t == "float": + max_value = f"_mm256_andnot_ps(i2s(mask), _mm256_set1_ps(MAX))" + load = f"_mm256_maskload_ps(({t} const *) ((__m256 const *) {v} + {offset}), {mask})" + return f"_mm256_or_ps({load}, {max_value})" + + + if t == "int64_t" or t == "uint64_t": + it = "long long" + else: + it = t[1:] if t[0] == 'u' else t + + load = f"_mm256_maskload_{int_suffix}(({it} const *) ((__m256i const *) {v} + {offset}), {mask})" + return f"_mm256_or_si256({load}, {max_value})" def get_store_intrinsic(self, ptr, offset, value): t = self.type @@ -210,6 +237,26 @@ def get_store_intrinsic(self, ptr, offset, value): return f"_mm256_storeu_ps(({t} *) ((__m256 *) {ptr} + {offset}), {value})" return f"_mm256_storeu_si256((__m256i *) {ptr} + {offset}, {value})" + def get_mask_store_intrinsic(self, ptr, offset, value, mask): + t = self.type + + if self.vector_size() == 4: + int_suffix = "epi64" + elif self.vector_size() == 8: + int_suffix = "epi32" + + if t == "double": + return f"_mm256_maskstore_pd(({t} *) ((__m256d *) {ptr} + {offset}), {mask}, {value})" + if t == "float": + return f"_mm256_maskstore_ps(({t} *) ((__m256 *) {ptr} + {offset}), {mask}, {value})" + + if t == "int64_t" or t == "uint64_t": + it = "long long" + else: + it = t[1:] if t[0] == 'u' else t; + return f"_mm256_maskstore_{int_suffix}(({it} *) ((__m256i *) {ptr} + {offset}), {mask}, {value})" + + def autogenerated_blabber(self): return f"""///////////////////////////////////////////////////////////////////////////// //// @@ -235,6 +282,7 @@ def generate_prologue(self, f): #endif #endif +#include #include #include "bitonic_sort.h" @@ -247,7 +295,13 @@ def generate_prologue(self, f): namespace vxsort {{ namespace smallsort {{ + +extern "C" const uint8_t mask_table_4[16]; +extern "C" const uint8_t mask_table_8[64]; + template<> struct bitonic<{t}, AVX2> {{ + static const int N = {self.vector_size()}; + static constexpr {t} MAX = std::numeric_limits<{t}>::max(); public: """ print(s, file=f) @@ -416,7 +470,7 @@ def generate_compounded_merger(self, f, width, ascending, inline): suffix = "ascending" if ascending else "descending" rev_suffix = "descending" if ascending else "ascending" - + inl = "INLINE" if inline else "NOINLINE" s = f""" static {inl} void sort_{width:02d}v_merge_{suffix}({g.generate_param_def_list(width)}) {{ @@ -440,12 +494,12 @@ def generate_compounded_merger(self, f, width, ascending, inline): print(" }", file=f) - def generate_entry_points(self, f): + def generate_entry_points_old(self, f): type = self.type g = self for m in range(1, g.max_bitonic_sort_vectors() + 1): s = f""" - static NOINLINE void sort_{m:02d}v({type} *ptr) {{""" + static NOINLINE void sort_{m:02d}v_old({type} *ptr) {{""" print(s, file=f) for l in range(0, m): @@ -459,7 +513,34 @@ def generate_entry_points(self, f): s = f" {g.get_store_intrinsic('ptr', l, f'd{l + 1:02d}')};" print(s, file=f) - print("}", file=f) + print(" }", file=f) + + def generate_entry_points(self, f): + type = self.type + g = self + for m in range(1, g.max_bitonic_sort_vectors() + 1): + s = f""" + static NOINLINE void sort_{m:02d}v_alt({type} *ptr, int remainder) {{ + const auto mask = _mm256_cvtepi8_epi{int(256 / self.vector_size())}(_mm_loadu_si128((__m128i*)(mask_table_{self.vector_size()} + remainder * N))); +""" + print(s, file=f) + + for l in range(0, m-1): + s = f" {g.vector_type()} d{l + 1:02d} = {g.get_load_intrinsic('ptr', l)};" + print(s, file=f) + s = f" {g.vector_type()} d{m:02d} = {g.get_mask_load_intrinsic('ptr', m - 1, 'mask')};" + print(s, file=f) + + s = f" sort_{m:02d}v_ascending({g.generate_param_list(1, m)});" + print(s, file=f) + + for l in range(0, m-1): + s = f" {g.get_store_intrinsic('ptr', l, f'd{l + 1:02d}')};" + print(s, file=f) + s = f" {g.get_mask_store_intrinsic('ptr', m - 1, f'd{m:02d}', 'mask')};" + print(s, file=f) + + print(" }", file=f) def generate_master_entry_point(self, f_header, f_src): @@ -473,18 +554,34 @@ def generate_master_entry_point(self, f_header, f_src): t = self.type g = self + # s = f""" static void sort_old({t} *ptr, size_t length);""" + # print(s, file=f_header) + s = f""" static void sort({t} *ptr, size_t length);""" print(s, file=f_header) - s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX2 >::sort({t} *ptr, size_t length) {{ - const int N = {g.vector_size()}; - switch(length / N) {{""" + # s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX2 >::sort({t} *ptr, size_t length) {{ + # switch(length / N) {{""" + # print(s, file=f_src) + # + # for m in range(1, self.max_bitonic_sort_vectors() + 1): + # s = f" case {m}: sort_{m:02d}v(ptr); break;" + # print(s, file=f_src) + # print(" }", file=f_src) + # print("}", file=f_src) + + s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX2 >::sort({t} *ptr, size_t length) {{ + const auto fullvlength = length / N; + const int remainder = (int) (length - fullvlength * N); + const auto v = fullvlength + ((remainder > 0) ? 1 : 0); + switch(v) {{""" print(s, file=f_src) for m in range(1, self.max_bitonic_sort_vectors() + 1): - s = f" case {m}: sort_{m:02d}v(ptr); break;" + s = f" case {m}: sort_{m:02d}v_alt(ptr, remainder); break;" print(s, file=f_src) print(" }", file=f_src) print("}", file=f_src) + pass diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py index f08fda8a4445..6cb6e9048356 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py +++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py @@ -210,6 +210,29 @@ def get_load_intrinsic(self, v, offset): return f"_mm512_loadu_ps(({t} const *) ((__m512 const *) {v} + {offset}))" return f"_mm512_loadu_si512((__m512i const *) {v} + {offset});" + def get_mask_load_intrinsic(self, v, offset, mask): + t = self.type + + if self.vector_size() == 8: + int_suffix = "epi64" + max_value = f"_mm512_set1_epi64(MAX)" + elif self.vector_size() == 16: + int_suffix = "epi32" + max_value = f"_mm512_set1_epi32(MAX)" + + if t == "double": + return f"""_mm512_mask_loadu_pd(_mm512_set1_pd(MAX), + {mask}, + ({t} const *) ((__m512d const *) {v} + {offset}))""" + elif t == "float": + return f"""_mm512_mask_loadu_ps(_mm512_set1_ps(MAX), + {mask}, + ({t} const *) ((__m512 const *) {v} + {offset}))""" + + return f"""_mm512_mask_loadu_{int_suffix}({max_value}, + {mask}, + ({t} const *) ((__m512i const *) {v} + {offset}))""" + def get_store_intrinsic(self, ptr, offset, value): t = self.type @@ -219,6 +242,20 @@ def get_store_intrinsic(self, ptr, offset, value): return f"_mm512_storeu_ps(({t} *) ((__m512 *) {ptr} + {offset}), {value})" return f"_mm512_storeu_si512((__m512i *) {ptr} + {offset}, {value})" + def get_mask_store_intrinsic(self, ptr, offset, value, mask): + t = self.type + + if self.vector_size() == 8: + int_suffix = "epi64" + elif self.vector_size() == 16: + int_suffix = "epi32" + + if t == "double": + return f"_mm512_mask_storeu_pd(({t} *) ((__m512d *) {ptr} + {offset}), {mask}, {value})" + if t == "float": + return f"_mm512_mask_storeu_ps(({t} *) ((__m512 *) {ptr} + {offset}), {mask}, {value})" + return f"_mm512_mask_storeu_{int_suffix}((__m512i *) {ptr} + {offset}, {mask}, {value})" + def autogenerated_blabber(self): return f"""///////////////////////////////////////////////////////////////////////////// //// @@ -245,6 +282,7 @@ def generate_prologue(self, f): #endif #endif +#include #include #include "bitonic_sort.h" @@ -258,6 +296,8 @@ def generate_prologue(self, f): namespace vxsort {{ namespace smallsort {{ template<> struct bitonic<{t}, AVX512> {{ + static const int N = {self.vector_size()}; + static constexpr {t} MAX = std::numeric_limits<{t}>::max(); public: """ print(s, file=f) @@ -440,12 +480,12 @@ def generate_compounded_merger(self, f, width, ascending, inline): print(" }", file=f) - def generate_entry_points(self, f): + def generate_entry_points_old(self, f): type = self.type g = self for m in range(1, g.max_bitonic_sort_vectors() + 1): s = f""" - static NOINLINE void sort_{m:02d}v({type} *ptr) {{""" + static NOINLINE void sort_{m:02d}v_old({type} *ptr) {{""" print(s, file=f) for l in range(0, m): @@ -459,7 +499,34 @@ def generate_entry_points(self, f): s = f" {g.get_store_intrinsic('ptr', l, f'd{l + 1:02d}')};" print(s, file=f) - print("}", file=f) + print(" }", file=f) + + def generate_entry_points(self, f): + type = self.type + g = self + for m in range(1, g.max_bitonic_sort_vectors() + 1): + s = f""" + static NOINLINE void sort_{m:02d}v_alt({type} *ptr, int remainder) {{ + const auto mask = 0x{((1 << self.vector_size()) - 1):X} >> ((N - remainder) & (N-1)); +""" + print(s, file=f) + + for l in range(0, m-1): + s = f" {g.vector_type()} d{l + 1:02d} = {g.get_load_intrinsic('ptr', l)};" + print(s, file=f) + s = f" {g.vector_type()} d{m:02d} = {g.get_mask_load_intrinsic('ptr', m - 1, 'mask')};" + print(s, file=f) + + s = f" sort_{m:02d}v_ascending({g.generate_param_list(1, m)});" + print(s, file=f) + + for l in range(0, m-1): + s = f" {g.get_store_intrinsic('ptr', l, f'd{l + 1:02d}')};" + print(s, file=f) + s = f" {g.get_mask_store_intrinsic('ptr', m - 1, f'd{m:02d}', 'mask')};" + print(s, file=f) + + print(" }", file=f) def generate_master_entry_point(self, f_header, f_src): @@ -473,18 +540,35 @@ def generate_master_entry_point(self, f_header, f_src): t = self.type g = self + # s = f""" static void sort_old({t} *ptr, size_t length);""" + # print(s, file=f_header) + s = f""" static void sort({t} *ptr, size_t length);""" print(s, file=f_header) - s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX512 >::sort({t} *ptr, size_t length) {{ - const int N = {g.vector_size()}; - switch(length / N) {{""" + # s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX512 >::sort_old({t} *ptr, size_t length) {{ + # switch(length / N) {{""" + # print(s, file=f_src) + # + # for m in range(1, self.max_bitonic_sort_vectors() + 1): + # s = f" case {m}: sort_{m:02d}v(ptr); break;" + # print(s, file=f_src) + # print(" }", file=f_src) + # print("}", file=f_src) + + + s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX512 >::sort({t} *ptr, size_t length) {{ + const auto fullvlength = length / N; + const int remainder = (int) (length - fullvlength * N); + const auto v = fullvlength + ((remainder > 0) ? 1 : 0); + switch(v) {{""" print(s, file=f_src) for m in range(1, self.max_bitonic_sort_vectors() + 1): - s = f" case {m}: sort_{m:02d}v(ptr); break;" + s = f" case {m}: sort_{m:02d}v_alt(ptr, remainder); break;" print(s, file=f_src) print(" }", file=f_src) + print("}", file=f_src) pass diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py index 4681e4986c3f..55ef7bbc0f4c 100644 --- a/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py +++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py @@ -10,8 +10,8 @@ # usage: bitonic_gen.py [-h] [--vector-isa VECTOR_ISA [VECTOR_ISA ...]] # [--break-inline BREAK_INLINE] [--output-dir OUTPUT_DIR] # -# the files in src/coreclr/src/gc/vxsort/smallsort checked in can be generated with: -# python bitonic_gen.py --output-dir c:\temp --vector-isa AVX2 AVX512 +# the files in src/coreclr/src/gc/vxsort/smallsort that are currently checked in can be generated with: +# python bitonic_gen.py --output-dir c:\temp --vector-isa AVX2 AVX512 --break-inline 4 # import argparse import os @@ -55,7 +55,7 @@ def generate_per_type(f_header, f_src, type, vector_isa, break_inline): for width in range(2, g.max_bitonic_sort_vectors() + 1): # Allow breaking the inline chain once in a while (configurable) - if break_inline == 0 or width & break_inline != 0: + if break_inline == 0 or width % break_inline != 0: inline = True else: inline = False @@ -65,6 +65,7 @@ def generate_per_type(f_header, f_src, type, vector_isa, break_inline): g.generate_compounded_merger(f_header, width, ascending=True, inline=inline) g.generate_compounded_merger(f_header, width, ascending=False, inline=inline) + #g.generate_entry_points_old(f_header) g.generate_entry_points(f_header) g.generate_master_entry_point(f_header, f_src) g.generate_epilogue(f_header) diff --git a/src/coreclr/src/gc/vxsort/vxsort.h b/src/coreclr/src/gc/vxsort/vxsort.h index 35812d9356f3..b8eaac51f421 100644 --- a/src/coreclr/src/gc/vxsort/vxsort.h +++ b/src/coreclr/src/gc/vxsort/vxsort.h @@ -17,22 +17,28 @@ #include #include - #include "defs.h" -//#include "isa_detection.h" #include "alignment.h" #include "machine_traits.h" +#ifdef VXSORT_STATS +#include "vxsort_stats.h" +#endif //VXSORT_STATS +#include "packer.h" #include "smallsort/bitonic_sort.h" -//#include -//#include -//#include - namespace vxsort { using vxsort::smallsort::bitonic; - -template +/** + * sort primitives, quickly + * @tparam T The primitive type being sorted + * @tparam M The vector machine model/ISA (e.g. AVX2, AVX512 etc.) + * @tparam Unroll The unroll factor, controls to some extent, the code-bloat/speedup ration at the call site + * Defaults to 1 + * @tparam Shift Optional; specify how many LSB bits are known to be zero in the original input. Can be used + * to further speed up sorting. + */ +template class vxsort { static_assert(Unroll >= 1, "Unroll can be in the range 1..12"); static_assert(Unroll <= 12, "Unroll can be in the range 1..12"); @@ -40,6 +46,7 @@ class vxsort { private: using MT = vxsort_machine_traits; typedef typename MT::TV TV; + typedef typename MT::TPACK TPACK; typedef alignment_hint AH; static const int ELEMENT_ALIGN = sizeof(T) - 1; @@ -64,6 +71,18 @@ class vxsort { static const int PARTITION_TMP_SIZE_IN_ELEMENTS = (2 * SLACK_PER_SIDE_IN_ELEMENTS + N + 4*N); + void reset(T* start, T* end) { + _depth = 0; + _startPtr = start; + _endPtr = end; + } + + T* _startPtr = nullptr; + T* _endPtr = nullptr; + + T _temp[PARTITION_TMP_SIZE_IN_ELEMENTS]; + int _depth = 0; + static int floor_log2_plus_one(size_t n) { auto result = 0; while (n >= 1) { @@ -83,18 +102,6 @@ class vxsort { swap(left, right); } - static void insertion_sort(T* lo, T* hi) { - for (auto i = lo + 1; i <= hi; i++) { - auto j = i; - auto t = *i; - while ((j > lo) && (t < *(j - 1))) { - *j = *(j - 1); - j--; - } - *j = t; - } - } - static void heap_sort(T* lo, T* hi) { size_t n = hi - lo + 1; for (size_t i = n / 2; i >= 1; i--) { @@ -122,18 +129,6 @@ class vxsort { *(lo + i - 1) = d; } - void reset(T* start, T* end) { - _depth = 0; - _startPtr = start; - _endPtr = end; - } - - T* _startPtr = nullptr; - T* _endPtr = nullptr; - - T _temp[PARTITION_TMP_SIZE_IN_ELEMENTS]; - int _depth = 0; - NOINLINE T* align_left_scalar_uncommon(T* read_left, T pivot, T*& tmp_left, T*& tmp_right) { @@ -172,8 +167,8 @@ class vxsort { return readRight; } - void sort(T* left, T* right, AH realignHint, - int depthLimit) { + void sort(T* left, T* right, T left_hint, T right_hint, AH realignHint, + int depth_limit) { auto length = (size_t)(right - left + 1); T* mid; @@ -194,16 +189,11 @@ class vxsort { // Go to insertion sort below this threshold if (length <= SMALL_SORT_THRESHOLD_ELEMENTS) { - - auto nextLength = (length & (N-1)) > 0 ? (length + N) & ~(N-1) : length; - - auto extraSpaceNeeded = nextLength - length; - auto fakeLeft = left - extraSpaceNeeded; - if (fakeLeft >= _startPtr) { - bitonic::sort(fakeLeft, nextLength); - } else { - insertion_sort(left, right); - } +#ifdef VXSORT_STATS + vxsort_stats::bump_small_sorts(); + vxsort_stats::record_small_sort_size(length); +#endif + bitonic::sort(left, length); return; } @@ -211,12 +201,24 @@ class vxsort { // will not do well: // 1. Reverse sorted array // 2. High degree of repeated values (dutch flag problem, one value) - if (depthLimit == 0) { + if (depth_limit == 0) { heap_sort(left, right); _depth--; return; } - depthLimit--; + + depth_limit--; + + + if (MT::supports_packing()) { + if (MT::template can_pack(right_hint - left_hint)) { + packer::pack(left, length, left_hint); + auto packed_sorter = vxsort(); + packed_sorter.sort((TPACK *) left, ((TPACK *) left) + length - 1); + packer::unpack((TPACK *) left, length, left_hint); + return; + } + } // This is going to be a bit weird: // Pre/Post alignment calculations happen here: we prepare hints to the @@ -274,11 +276,9 @@ class vxsort { vectorized_partition(left, right, realignHint) : vectorized_partition(left, right, realignHint); - - _depth++; - sort(left, sep - 2, realignHint.realign_right(), depthLimit); - sort(sep, right, realignHint.realign_left(), depthLimit); + sort(left, sep - 2, left_hint, *sep, realignHint.realign_right(), depth_limit); + sort(sep, right, *(sep - 2), right_hint, realignHint.realign_left(), depth_limit); _depth--; } @@ -287,6 +287,10 @@ class vxsort { const TV& P, T*& left, T*& right) { +#ifdef VXSORT_STATS + vxsort_stats::bump_vec_loads(); + vxsort_stats::bump_vec_stores(2); +#endif if (MT::supports_compress_writes()) { partition_block_with_compress(dataVec, P, left, right); } else { @@ -298,6 +302,9 @@ class vxsort { const TV& P, T*& left, T*& right) { +#ifdef VXSORT_STATS + vxsort_stats::bump_perms(); +#endif auto mask = MT::get_cmpgt_mask(dataVec, P); dataVec = MT::partition_vector(dataVec, mask); MT::store_vec(reinterpret_cast(left), dataVec); @@ -325,6 +332,10 @@ class vxsort { assert((reinterpret_cast(left) & ELEMENT_ALIGN) == 0); assert((reinterpret_cast(right) & ELEMENT_ALIGN) == 0); +#ifdef VXSORT_STATS + vxsort_stats::bump_partitions((right - left) + 1); +#endif + // Vectorized double-pumped (dual-sided) partitioning: // We start with picking a pivot using the media-of-3 "method" // Once we have sensible pivot stored as the last element of the array @@ -505,7 +516,7 @@ class vxsort { *writeLeft++ = pivot; assert(writeLeft > left); - assert(writeLeft <= right); + assert(writeLeft <= right+1); return writeLeft; } @@ -526,6 +537,11 @@ class vxsort { const auto preAlignedLeft = (TV*) (left + leftAlign); const auto preAlignedRight = (TV*) (right + rightAlign - N); +#ifdef VXSORT_STATS + vxsort_stats::bump_vec_loads(2); + vxsort_stats::bump_vec_stores(4); +#endif + // Alignment with vectorization is tricky, so read carefully before changing code: // 1. We load data, which we might need to align, if the alignment hints // mean pre-alignment (or overlapping alignment) @@ -565,6 +581,9 @@ class vxsort { tmpStartRight -= rightAlign & rai; } else { +#ifdef VXSORT_STATS + vxsort_stats::bump_perms(2); +#endif RT0 = MT::partition_vector(RT0, rtMask); LT0 = MT::partition_vector(LT0, ltMask); MT::store_vec((TV*) tmpRight, RT0); @@ -588,10 +607,27 @@ class vxsort { } public: - NOINLINE void sort(T* left, T* right) { + /** + * Sort a given range + * @param left The left edge of the range, including + * @param right The right edge of the range, including + * @param left_hint Optional; A hint, Use to speed up the sorting operation, describing a single value that is known to be + * smaller-than, or equalt to all values contained within the provided array. + * @param right_hint Optional; A hint, Use to speed up the sorting operation, describing a single value that is known to be + * larger-than than all values contained within the provided array. + */ + NOINLINE void sort(T* left, T* right, + T left_hint = std::numeric_limits::Min(), + T right_hint = std::numeric_limits::Max()) + { +// init_isa_detection(); + +#ifdef VXSORT_STATS + vxsort_stats::bump_sorts((right - left) + 1); +#endif reset(left, right); auto depthLimit = 2 * floor_log2_plus_one(right + 1 - left); - sort(left, right, AH(), depthLimit); + sort(left, right, left_hint, right_hint, AH(), depthLimit); } }; diff --git a/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h index c5bfe4998a8f..38b0728d4217 100644 --- a/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h +++ b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h @@ -3,9 +3,9 @@ #ifdef __GNUC__ #ifdef __clang__ -#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function)) +#pragma clang attribute push (__attribute__((target("avx512f,avx512dq"))), apply_to = any(function)) #else #pragma GCC push_options -#pragma GCC target("avx512f") +#pragma GCC target("avx512f,avx512dq") #endif #endif diff --git a/src/coreclr/src/gc/windows/gcenv.windows.cpp b/src/coreclr/src/gc/windows/gcenv.windows.cpp index 4b44ca9e8d5b..53b868df6820 100644 --- a/src/coreclr/src/gc/windows/gcenv.windows.cpp +++ b/src/coreclr/src/gc/windows/gcenv.windows.cpp @@ -692,14 +692,14 @@ void* GCToOSInterface::VirtualReserve(size_t size, size_t alignment, uint32_t fl assert((alignment & (alignment - 1)) == 0); assert(alignment <= 0x10000); + DWORD memFlags = (flags & VirtualReserveFlags::WriteWatch) ? (MEM_RESERVE | MEM_WRITE_WATCH) : MEM_RESERVE; if (node == NUMA_NODE_UNDEFINED) { - DWORD memFlags = (flags & VirtualReserveFlags::WriteWatch) ? (MEM_RESERVE | MEM_WRITE_WATCH) : MEM_RESERVE; return ::VirtualAlloc (nullptr, size, memFlags, PAGE_READWRITE); } else { - return ::VirtualAllocExNuma (::GetCurrentProcess (), NULL, size, MEM_RESERVE, PAGE_READWRITE, node); + return ::VirtualAllocExNuma (::GetCurrentProcess (), NULL, size, memFlags, PAGE_READWRITE, node); } } @@ -719,7 +719,7 @@ bool GCToOSInterface::VirtualRelease(void* address, size_t size) // size - size of the virtual memory range // Return: // Starting virtual address of the committed range -void* GCToOSInterface::VirtualReserveAndCommitLargePages(size_t size) +void* GCToOSInterface::VirtualReserveAndCommitLargePages(size_t size, uint16_t node) { void* pRetVal = nullptr; @@ -736,7 +736,14 @@ void* GCToOSInterface::VirtualReserveAndCommitLargePages(size_t size) SIZE_T largePageMinimum = GetLargePageMinimum(); size = (size + (largePageMinimum - 1)) & ~(largePageMinimum - 1); - return ::VirtualAlloc(nullptr, size, MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE); + if (node == NUMA_NODE_UNDEFINED) + { + return ::VirtualAlloc(nullptr, size, MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE); + } + else + { + return ::VirtualAllocExNuma(::GetCurrentProcess(), NULL, size, MEM_RESERVE | MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE, node); + } } // Commit virtual memory range. It must be part of a range reserved using VirtualReserve. diff --git a/src/coreclr/src/gcdump/gcdump.cpp b/src/coreclr/src/gcdump/gcdump.cpp index 04faf7819daf..84cb0beed9cc 100644 --- a/src/coreclr/src/gcdump/gcdump.cpp +++ b/src/coreclr/src/gcdump/gcdump.cpp @@ -34,7 +34,7 @@ GCDump::GCDump(UINT32 gcInfoVer, bool encBytes, unsigned maxEncBytes, bool dumpC * Display the byte encodings for the given range of the GC tables. */ -PTR_CBYTE GCDump::DumpEncoding(PTR_CBYTE gcInfoBlock, int cDumpBytes) +PTR_CBYTE GCDump::DumpEncoding(PTR_CBYTE gcInfoBlock, size_t cDumpBytes) { _ASSERTE((cDumpBytes >= 0) && (cMaxEncBytes < 256)); @@ -42,7 +42,7 @@ PTR_CBYTE GCDump::DumpEncoding(PTR_CBYTE gcInfoBlock, int cDumpBytes) { PTR_CBYTE pCurPos; unsigned count; - int cBytesLeft; + size_t cBytesLeft; for (count = cMaxEncBytes, cBytesLeft = cDumpBytes, pCurPos = gcInfoBlock; count > 0; diff --git a/src/coreclr/src/gcdump/i386/gcdumpx86.cpp b/src/coreclr/src/gcdump/i386/gcdumpx86.cpp index 0d221e1918db..92b64430aece 100644 --- a/src/coreclr/src/gcdump/i386/gcdumpx86.cpp +++ b/src/coreclr/src/gcdump/i386/gcdumpx86.cpp @@ -61,10 +61,10 @@ const char * CalleeSavedRegName(unsigned reg) /*****************************************************************************/ -unsigned GCDump::DumpInfoHdr (PTR_CBYTE gcInfoBlock, - InfoHdr* header, - unsigned * methodSize, - bool verifyGCTables) +size_t GCDump::DumpInfoHdr (PTR_CBYTE gcInfoBlock, + InfoHdr* header, + unsigned * methodSize, + bool verifyGCTables) { unsigned count; PTR_CBYTE table = gcInfoBlock; @@ -185,11 +185,11 @@ unsigned GCDump::DumpInfoHdr (PTR_CBYTE gcInfoBlock, } { - unsigned cur = 0; - unsigned last = table-bp; + size_t cur = 0; + size_t last = table-bp; while (cur < last) { - unsigned amount = last - cur; + size_t amount = last - cur; if (amount>5) amount = 5; diff --git a/src/coreclr/src/gcinfo/CMakeLists.txt b/src/coreclr/src/gcinfo/CMakeLists.txt index 3862de8633d0..895ad0c0c98e 100644 --- a/src/coreclr/src/gcinfo/CMakeLists.txt +++ b/src/coreclr/src/gcinfo/CMakeLists.txt @@ -1,26 +1,37 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) -set( GCINFO_SOURCES +set( GCINFO_ALLARCH_SOURCES arraylist.cpp gcinfoencoder.cpp + simplerhash.cpp +) + +set( GCINFO_I386_SOURCES + ../gcdump/gcdump.cpp + ../gcdump/i386/gcdumpx86.cpp ) +convert_to_absolute_path(GCINFO_ALLARCH_SOURCES ${GCINFO_ALLARCH_SOURCES}) +convert_to_absolute_path(GCINFO_I386_SOURCES ${GCINFO_I386_SOURCES}) +set( GCINFO_SOURCES + ${GCINFO_ALLARCH_SOURCES} + ) if(CLR_CMAKE_TARGET_ARCH_I386) list(APPEND GCINFO_SOURCES - ../gcdump/gcdump.cpp - ../gcdump/${ARCH_SOURCES_DIR}/gcdumpx86.cpp + ${GCINFO_I386_SOURCES} ) endif(CLR_CMAKE_TARGET_ARCH_I386) -convert_to_absolute_path(GCINFO_SOURCES ${GCINFO_SOURCES}) - -add_library_clr(gcinfo +add_library_clr(gcinfo_obj OBJECT ${GCINFO_SOURCES} ) +add_library(gcinfo INTERFACE) +target_sources(gcinfo INTERFACE $) + add_library_clr(gcinfo_crossgen STATIC ${GCINFO_SOURCES} @@ -28,21 +39,54 @@ add_library_clr(gcinfo_crossgen set_target_properties(gcinfo_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) +_install (FILES gcinfoencoder.cpp + DESTINATION gcinfo) -if (CLR_CMAKE_HOST_ARCH_I386) - # On x86, build RyuJIT/ARM32 cross-compiling altjit. - add_subdirectory(gcinfo_arm) -endif () +function(create_gcinfo_lib) -if (CLR_CMAKE_HOST_ARCH_I386 AND CLR_CMAKE_TARGET_WIN32) - # On x86, build Linux x86 cross-compiling altjit. - add_subdirectory(gcinfo_linuxx86) -endif () + set(oneValueArgs TARGET OS ARCH) + cmake_parse_arguments(TARGETDETAILS "${options}" "${oneValueArgs}" "" ${ARGN}) -if (CLR_CMAKE_HOST_ARCH_AMD64) - # On amd64, build RyuJIT/ARM64 cross-compiling altjit. - add_subdirectory(gcinfo_arm64) -endif () + set( GCINFO_SOURCES + ${GCINFO_ALLARCH_SOURCES} + ) -_install (FILES gcinfoencoder.cpp - DESTINATION gcinfo) + if(TARGETDETAILS_ARCH STREQUAL "x86") + list(APPEND GCINFO_SOURCES + ${GCINFO_I386_SOURCES} + ) + endif(TARGETDETAILS_ARCH STREQUAL "x86") + + add_library_clr("${TARGETDETAILS_TARGET}" + STATIC + ${GCINFO_SOURCES} + ) + + set_target_definitions_to_custom_os_and_arch(${ARGN}) +endfunction() + +if (CLR_CMAKE_TARGET_UNIX) +set(TARGET_OS_NAME unix) +else() +set(TARGET_OS_NAME win) +endif() + +if (CLR_CMAKE_BUILD_SUBSET_ALLJITS AND NOT CLR_CROSS_COMPONENTS_BUILD) + if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) + create_gcinfo_lib(TARGET gcinfo_unix_arm64 OS unix ARCH arm64) + create_gcinfo_lib(TARGET gcinfo_unix_x64 OS unix ARCH x64) + create_gcinfo_lib(TARGET gcinfo_win_arm64 OS win ARCH arm64) + create_gcinfo_lib(TARGET gcinfo_win_x64 OS win ARCH x64) + endif (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) + + create_gcinfo_lib(TARGET gcinfo_unix_arm OS unix ARCH arm) + create_gcinfo_lib(TARGET gcinfo_win_arm OS win ARCH arm) + create_gcinfo_lib(TARGET gcinfo_win_x86 OS win ARCH x86) +else() + create_gcinfo_lib(TARGET gcinfo_${TARGET_OS_NAME}_${ARCH_TARGET_NAME} OS ${TARGET_OS_NAME} ARCH ${ARCH_TARGET_NAME}) + + if (CLR_CMAKE_HOST_ARCH_I386 AND NOT ((TARGET_OS_NAME STREQUAL unix) AND (ARCH_TARGET_NAME STREQUAL "arm"))) + # On x86, build gcinfo for RyuJIT/ARM32 cross-compiling altjit for ARM_SOFTFP (armel). + create_gcinfo_lib(TARGET gcinfo_unix_arm OS unix ARCH arm) + endif() +endif (CLR_CMAKE_BUILD_SUBSET_ALLJITS AND NOT CLR_CROSS_COMPONENTS_BUILD) diff --git a/src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt b/src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt deleted file mode 100644 index 3dd25ee3057c..000000000000 --- a/src/coreclr/src/gcinfo/gcinfo_arm/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -remove_definitions(-DTARGET_X86) -add_definitions(-DTARGET_ARM) - -add_library_clr(gcinfo_arm - STATIC - ${GCINFO_SOURCES} -) diff --git a/src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt b/src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt deleted file mode 100644 index 11069b52f2f2..000000000000 --- a/src/coreclr/src/gcinfo/gcinfo_arm64/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -remove_definitions(-DTARGET_AMD64) -add_definitions(-DTARGET_ARM64) - -add_library_clr(gcinfo_arm64 - STATIC - ${GCINFO_SOURCES} -) diff --git a/src/coreclr/src/gcinfo/gcinfo_linuxx86/CMakeLists.txt b/src/coreclr/src/gcinfo/gcinfo_linuxx86/CMakeLists.txt deleted file mode 100644 index 149f493e22f6..000000000000 --- a/src/coreclr/src/gcinfo/gcinfo_linuxx86/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_definitions(-DUNIX_X86_ABI) - -add_library_clr(gcinfo_linuxx86 - STATIC - ${GCINFO_SOURCES} -) diff --git a/src/coreclr/src/gcinfo/gcinfoencoder.cpp b/src/coreclr/src/gcinfo/gcinfoencoder.cpp index ab89b90e5288..b906c3e147a7 100644 --- a/src/coreclr/src/gcinfo/gcinfoencoder.cpp +++ b/src/coreclr/src/gcinfo/gcinfoencoder.cpp @@ -22,6 +22,7 @@ #include "simplerhash.h" #include "bitposition.h" #endif +#include "../jit/jitstd/algorithm.h" #ifdef MEASURE_GCINFO #define GCINFO_WRITE(writer, val, numBits, counter) \ @@ -791,88 +792,93 @@ struct GcSlotDescAndId UINT32 m_SlotId; }; -int __cdecl CompareSlotDescAndIdBySlotDesc(const void* p1, const void* p2) +struct CompareSlotDescAndIdBySlotDesc { - const GcSlotDesc* pFirst = &reinterpret_cast(p1)->m_SlotDesc; - const GcSlotDesc* pSecond = &reinterpret_cast(p2)->m_SlotDesc; - - int firstFlags = pFirst->Flags ^ GC_SLOT_UNTRACKED; - int secondFlags = pSecond->Flags ^ GC_SLOT_UNTRACKED; - - // All registers come before all stack slots - // All untracked come last - // Then sort them by flags, ensuring that the least-frequent interior/pinned flag combinations are first - // This is accomplished in the comparison of flags, since we encode IsRegister in the highest flag bit - // And we XOR the UNTRACKED flag to place them last in the second highest flag bit - if( firstFlags > secondFlags ) return -1; - if( firstFlags < secondFlags ) return 1; - - // Then sort them by slot - if( pFirst->IsRegister() ) - { - _ASSERTE( pSecond->IsRegister() ); - if( pFirst->Slot.RegisterNumber < pSecond->Slot.RegisterNumber ) return -1; - if( pFirst->Slot.RegisterNumber > pSecond->Slot.RegisterNumber ) return 1; - } - else + bool operator()(const GcSlotDescAndId& first, const GcSlotDescAndId& second) { - _ASSERTE( !pSecond->IsRegister() ); - if( pFirst->Slot.Stack.SpOffset < pSecond->Slot.Stack.SpOffset ) return -1; - if( pFirst->Slot.Stack.SpOffset > pSecond->Slot.Stack.SpOffset ) return 1; + const GcSlotDesc* pFirst = &first.m_SlotDesc; + const GcSlotDesc* pSecond = &second.m_SlotDesc; - // This is arbitrary, but we want to make sure they are considered separate slots - if( pFirst->Slot.Stack.Base < pSecond->Slot.Stack.Base ) return -1; - if( pFirst->Slot.Stack.Base > pSecond->Slot.Stack.Base ) return 1; - } - - // If we get here, the slots are identical - _ASSERTE(!"Duplicate slots definitions found in GC information!"); - return 0; -} + int firstFlags = pFirst->Flags ^ GC_SLOT_UNTRACKED; + int secondFlags = pSecond->Flags ^ GC_SLOT_UNTRACKED; + // All registers come before all stack slots + // All untracked come last + // Then sort them by flags, ensuring that the least-frequent interior/pinned flag combinations are first + // This is accomplished in the comparison of flags, since we encode IsRegister in the highest flag bit + // And we XOR the UNTRACKED flag to place them last in the second highest flag bit + if( firstFlags != secondFlags ) + return firstFlags > secondFlags; -int __cdecl CompareLifetimeTransitionsByOffsetThenSlot(const void* p1, const void* p2) -{ - const GcInfoEncoder::LifetimeTransition* pFirst = (const GcInfoEncoder::LifetimeTransition*) p1; - const GcInfoEncoder::LifetimeTransition* pSecond = (const GcInfoEncoder::LifetimeTransition*) p2; + // Then sort them by slot + if( pFirst->IsRegister() ) + { + _ASSERTE( pSecond->IsRegister() ); + if( pFirst->Slot.RegisterNumber != pSecond->Slot.RegisterNumber ) + return pFirst->Slot.RegisterNumber < pSecond->Slot.RegisterNumber; + } + else + { + _ASSERTE( !pSecond->IsRegister() ); + if( pFirst->Slot.Stack.SpOffset != pSecond->Slot.Stack.SpOffset ) + return pFirst->Slot.Stack.SpOffset < pSecond->Slot.Stack.SpOffset; - UINT32 firstOffset = pFirst->CodeOffset; - UINT32 secondOffset = pSecond->CodeOffset; + // This is arbitrary, but we want to make sure they are considered separate slots + if( pFirst->Slot.Stack.Base != pSecond->Slot.Stack.Base ) + return pFirst->Slot.Stack.Base < pSecond->Slot.Stack.Base; + } - if (firstOffset == secondOffset) - { - return pFirst->SlotId - pSecond->SlotId; + // If we get here, the slots are identical + _ASSERTE(!"Duplicate slots definitions found in GC information!"); + return false; } - else +}; + +struct CompareLifetimeTransitionsByOffsetThenSlot +{ + bool operator()(const GcInfoEncoder::LifetimeTransition& first, const GcInfoEncoder::LifetimeTransition& second) { - return firstOffset - secondOffset; - } -} + UINT32 firstOffset = first.CodeOffset; + UINT32 secondOffset = second.CodeOffset; + if (firstOffset == secondOffset) + { + return first.SlotId < second.SlotId; + } + else + { + return firstOffset < secondOffset; + } + } +}; -int __cdecl CompareLifetimeTransitionsBySlot(const void* p1, const void* p2) +struct CompareLifetimeTransitionsBySlot { - const GcInfoEncoder::LifetimeTransition* pFirst = (const GcInfoEncoder::LifetimeTransition*) p1; - const GcInfoEncoder::LifetimeTransition* pSecond = (const GcInfoEncoder::LifetimeTransition*) p2; - - UINT32 firstOffset = pFirst->CodeOffset; - UINT32 secondOffset = pSecond->CodeOffset; + bool operator()(const GcInfoEncoder::LifetimeTransition& first, const GcInfoEncoder::LifetimeTransition& second) + { + UINT32 firstOffset = first.CodeOffset; + UINT32 secondOffset = second.CodeOffset; - _ASSERTE(GetNormCodeOffsetChunk(firstOffset) == GetNormCodeOffsetChunk(secondOffset)); + _ASSERTE(GetNormCodeOffsetChunk(firstOffset) == GetNormCodeOffsetChunk(secondOffset)); - // Sort them by slot - if( pFirst->SlotId < pSecond->SlotId ) return -1; - if( pFirst->SlotId > pSecond->SlotId ) return 1; + // Sort them by slot + if( first.SlotId != second.SlotId) + { + return first.SlotId < second.SlotId; + } - // Then sort them by code offset - if( firstOffset < secondOffset ) - return -1; - else - { - _ASSERTE(( firstOffset > secondOffset ) && "Redundant transitions found in GC info!"); - return 1; + // Then sort them by code offset + if( firstOffset < secondOffset ) + { + return true; + } + else + { + _ASSERTE(( firstOffset > secondOffset ) && "Redundant transitions found in GC info!"); + return false; + } } -} +}; BitStreamWriter::MemoryBlockList::MemoryBlockList() : m_head(nullptr), @@ -1284,11 +1290,10 @@ void GcInfoEncoder::Build() //----------------------------------------------------------------- // Don't use the CQuickSort algorithm, it's prone to stack overflows - qsort( + jitstd::sort( pTransitions, - numTransitions, - sizeof(LifetimeTransition), - CompareLifetimeTransitionsByOffsetThenSlot + pTransitions + numTransitions, + CompareLifetimeTransitionsByOffsetThenSlot() ); // Eliminate transitions outside the method @@ -1322,7 +1327,7 @@ void GcInfoEncoder::Build() sortedSlots[i].m_SlotId = i; } - qsort(sortedSlots, m_NumSlots, sizeof(GcSlotDescAndId), CompareSlotDescAndIdBySlotDesc); + jitstd::sort(sortedSlots, sortedSlots + m_NumSlots, CompareSlotDescAndIdBySlotDesc()); for(UINT32 i = 0; i < m_NumSlots; i++) { @@ -2089,11 +2094,10 @@ void GcInfoEncoder::Build() _ASSERTE(numTransitionsInCurrentChunk > 0); // Sort the transitions in this chunk by slot - qsort( + jitstd::sort( pCurrent - numTransitionsInCurrentChunk, - numTransitionsInCurrentChunk, - sizeof(LifetimeTransition), - CompareLifetimeTransitionsBySlot + pCurrent, + CompareLifetimeTransitionsBySlot() ); // Save chunk pointer diff --git a/src/coreclr/src/gcinfo/simplerhash.cpp b/src/coreclr/src/gcinfo/simplerhash.cpp new file mode 100644 index 000000000000..1233b91538c2 --- /dev/null +++ b/src/coreclr/src/gcinfo/simplerhash.cpp @@ -0,0 +1,41 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "simplerhash.h" + +// Table of primes and their magic-number-divide constant. +// For more info see the book "Hacker's Delight" chapter 10.9 "Unsigned Division by Divisors >= 1" +// These were selected by looking for primes, each roughly twice as big as the next, having +// 32-bit magic numbers, (because the algorithm for using 33-bit magic numbers is slightly slower). +// + +const PrimeInfo primeInfo[] = +{ + PrimeInfo(9, 0x38e38e39, 1), + PrimeInfo(23, 0xb21642c9, 4), + PrimeInfo(59, 0x22b63cbf, 3), + PrimeInfo(131, 0xfa232cf3, 7), + PrimeInfo(239, 0x891ac73b, 7), + PrimeInfo(433, 0x975a751, 4), + PrimeInfo(761, 0x561e46a5, 8), + PrimeInfo(1399, 0xbb612aa3, 10), + PrimeInfo(2473, 0x6a009f01, 10), + PrimeInfo(4327, 0xf2555049, 12), + PrimeInfo(7499, 0x45ea155f, 11), + PrimeInfo(12973, 0x1434f6d3, 10), + PrimeInfo(22433, 0x2ebe18db, 12), + PrimeInfo(46559, 0xb42bebd5, 15), + PrimeInfo(96581, 0xadb61b1b, 16), + PrimeInfo(200341, 0x29df2461, 15), + PrimeInfo(415517, 0xa181c46d, 18), + PrimeInfo(861719, 0x4de0bde5, 18), + PrimeInfo(1787021, 0x9636c46f, 20), + PrimeInfo(3705617, 0x4870adc1, 20), + PrimeInfo(7684087, 0x8bbc5b83, 22), + PrimeInfo(15933877, 0x86c65361, 23), + PrimeInfo(33040633, 0x40fec79b, 23), + PrimeInfo(68513161, 0x7d605cd1, 25), + PrimeInfo(142069021, 0xf1da390b, 27), + PrimeInfo(294594427, 0x74a2507d, 27), + PrimeInfo(733045421, 0x5dbec447, 28), +}; diff --git a/src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp b/src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp index b95903062f37..5971175804d9 100644 --- a/src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp +++ b/src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp @@ -365,7 +365,7 @@ int ExecuteManagedAssembly( // libunwind library is used to unwind stack frame, but libunwind for ARM // does not support ARM vfpv3/NEON registers in DWARF format correctly. // Therefore let's disable stack unwinding using DWARF information - // See https://github.com/dotnet/coreclr/issues/6698 + // See https://github.com/dotnet/runtime/issues/6479 // // libunwind use following methods to unwind stack frame. // UNW_ARM_METHOD_ALL 0xFF diff --git a/src/coreclr/src/ilasm/CMakeLists.txt b/src/coreclr/src/ilasm/CMakeLists.txt index 13e7467e0b1e..3e6c15b657ab 100644 --- a/src/coreclr/src/ilasm/CMakeLists.txt +++ b/src/coreclr/src/ilasm/CMakeLists.txt @@ -48,7 +48,7 @@ endif(CLR_CMAKE_TARGET_WIN32) if(CLR_CMAKE_HOST_UNIX) # Need generate a right form of asmparse.cpp to avoid the following options. # Clang also produces a bad-codegen on this prebuilt file with optimization. - # https://github.com/dotnet/coreclr/issues/2305 + # https://github.com/dotnet/runtime/issues/4776 add_compile_options("$<$:-Wno-register>") add_compile_options(-Wno-array-bounds) add_compile_options(-Wno-unused-label) diff --git a/src/coreclr/src/ilasm/asmman.cpp b/src/coreclr/src/ilasm/asmman.cpp index 4abb780e4be1..dc45b8f9f019 100644 --- a/src/coreclr/src/ilasm/asmman.cpp +++ b/src/coreclr/src/ilasm/asmman.cpp @@ -964,8 +964,10 @@ HRESULT AsmMan::EmitManifest() for(j=0; (hFile == INVALID_HANDLE_VALUE)&&(pwzInputFiles[j] != NULL); j++) { wcscpy_s(wzFileName,2048,pwzInputFiles[j]); - pwz = wcsrchr(wzFileName,'\\'); + pwz = wcsrchr(wzFileName,DIRECTORY_SEPARATOR_CHAR_A); +#ifdef TARGET_WINDOWS if(pwz == NULL) pwz = wcsrchr(wzFileName,':'); +#endif if(pwz == NULL) pwz = &wzFileName[0]; else pwz++; wcscpy_s(pwz,2048-(pwz-wzFileName),wzUniBuf); diff --git a/src/coreclr/src/ilasm/asmparse.h b/src/coreclr/src/ilasm/asmparse.h index 7585ec69f720..ef377b5e430d 100644 --- a/src/coreclr/src/ilasm/asmparse.h +++ b/src/coreclr/src/ilasm/asmparse.h @@ -214,7 +214,6 @@ typedef LIFO ARG_NAME_LIST_STACK; /*--------------------------------------------------------------------------*/ typedef char*(*PFN_NEXTCHAR)(char*); -char* nextcharA(__in __nullterminated char* pos); char* nextcharU(__in __nullterminated char* pos); char* nextcharW(__in __nullterminated char* pos); @@ -292,7 +291,7 @@ class AsmParse : public ErrorReporter ARG_NAME_LIST_STACK m_ANSFirst; ARG_NAME_LIST_STACK m_ANSLast; PARSING_ENVIRONMENT *penv; - PARSING_ENVIRONMENT_STACK PEStack; + PARSING_ENVIRONMENT_STACK PEStack; private: BinStr* MakeSig(unsigned callConv, BinStr* retType, BinStr* args, int ntyargs = 0); @@ -300,9 +299,8 @@ class AsmParse : public ErrorReporter BinStr* MakeTypeArray(CorElementType kind, BinStr* elemType, BinStr* bounds); char* fillBuff(__in_opt __nullterminated char* curPos); // refill the input buffer - DWORD IsItUnicode(CONST LPVOID pBuff, int cb, LPINT lpi); - HANDLE hstdout; - HANDLE hstderr; + HANDLE hstdout; + HANDLE hstderr; private: friend void yyerror(__in __nullterminated const char* str); diff --git a/src/coreclr/src/ilasm/assem.cpp b/src/coreclr/src/ilasm/assem.cpp index 7ded7ca981d9..bfe765c5499d 100644 --- a/src/coreclr/src/ilasm/assem.cpp +++ b/src/coreclr/src/ilasm/assem.cpp @@ -1611,16 +1611,26 @@ unsigned hash( switch(len) /* all the case statements fall through */ { case 11: c+=((unsigned)k[10] << 24); + FALLTHROUGH; case 10: c+=((unsigned)k[9] << 16); + FALLTHROUGH; case 9 : c+=((unsigned)k[8] << 8); + FALLTHROUGH; /* the first byte of c is reserved for the length */ case 8 : b+=((unsigned)k[7] << 24); + FALLTHROUGH; case 7 : b+=((unsigned)k[6] << 16); + FALLTHROUGH; case 6 : b+=((unsigned)k[5] << 8); + FALLTHROUGH; case 5 : b+=k[4]; + FALLTHROUGH; case 4 : a+=((unsigned)k[3] << 24); + FALLTHROUGH; case 3 : a+=((unsigned)k[2] << 16); + FALLTHROUGH; case 2 : a+=((unsigned)k[1] << 8); + FALLTHROUGH; case 1 : a+=k[0]; /* case 0: nothing left to add */ } diff --git a/src/coreclr/src/ilasm/assembler.cpp b/src/coreclr/src/ilasm/assembler.cpp index 9a418e0fd44b..9748bf70488d 100644 --- a/src/coreclr/src/ilasm/assembler.cpp +++ b/src/coreclr/src/ilasm/assembler.cpp @@ -1578,6 +1578,7 @@ void Assembler::EmitInstrVarByName(Instr* instr, __in __nullterminated char* lab case CEE_STARG: case CEE_STARG_S: nArgVarFlag++; + FALLTHROUGH; case CEE_LDLOCA: case CEE_LDLOCA_S: case CEE_LDLOC: diff --git a/src/coreclr/src/ilasm/grammar_after.cpp b/src/coreclr/src/ilasm/grammar_after.cpp index dc4c8497e818..1fcb1bf90496 100644 --- a/src/coreclr/src/ilasm/grammar_after.cpp +++ b/src/coreclr/src/ilasm/grammar_after.cpp @@ -76,11 +76,6 @@ static Keywords keywords[] = { /********************************************************************************/ /* File encoding-dependent functions */ /*--------------------------------------------------------------------------*/ -char* nextcharA(__in __nullterminated char* pos) -{ - return (*pos > 0) ? ++pos : (char *)_mbsinc((const unsigned char *)pos); -} - char* nextcharU(__in __nullterminated char* pos) { return ++pos; @@ -848,7 +843,11 @@ int yylex() if(wzFile != NULL) { if((parser->wzIncludePath != NULL) - &&(wcschr(wzFile,'\\')==NULL)&&(wcschr(wzFile,':')==NULL)) + &&(wcschr(wzFile,DIRECTORY_SEPARATOR_CHAR_A)==NULL) +#ifdef TARGET_WINDOWS + &&(wcschr(wzFile,':')==NULL) +#endif + ) { PathString wzFullName; @@ -929,14 +928,6 @@ int yylex() tok = parse_literal(curSym, curPos, FALSE); if(tok == QSTRING) { - // if not ANSI, then string is in UTF-8, - // insert prefix - if(nextchar != nextcharA) - { - yylval.binstr->insertInt8(0xEF); - yylval.binstr->insertInt8(0xBB); - yylval.binstr->insertInt8(0xBF); - } yylval.binstr->appendInt8(' '); DefineVar(newstr, yylval.binstr); } @@ -1487,12 +1478,6 @@ AsmParse::~AsmParse() while(m_ANSLast.POP()); } -/**************************************************************************/ -DWORD AsmParse::IsItUnicode(CONST LPVOID pBuff, int cb, LPINT lpi) -{ - return IsTextUnicode(pBuff,cb,lpi); -} - /**************************************************************************/ void AsmParse::CreateEnvironment(ReadStream* stream) { @@ -1520,19 +1505,21 @@ void AsmParse::ParseFile(ReadStream* stream) char* AsmParse::fillBuff(__in_opt __nullterminated char* pos) { int iPutToBuffer; - int iOptions = IS_TEXT_UNICODE_UNICODE_MASK; - g_uCodePage = CP_ACP; + g_uCodePage = CP_UTF8; iPutToBuffer = (int)penv->in->getAll(&(penv->curPos)); penv->endPos = penv->curPos + iPutToBuffer; if(iPutToBuffer > 128) iPutToBuffer = 128; - if(IsItUnicode(penv->curPos,iPutToBuffer,&iOptions)) + if(iPutToBuffer >= 4 && (penv->curPos[0] & 0xFF) == 0xFF && (penv->curPos[1] & 0xFF) == 0xFE) { - g_uCodePage = CP_UTF8; - if(iOptions & IS_TEXT_UNICODE_SIGNATURE) + // U+FFFE followed by U+0000 is UTF-32 LE, any other value than 0 is a true UTF-16 LE + if((penv->curPos[2] & 0xFF) == 0x00 && (penv->curPos[3] & 0xFF) == 0x00) { - penv->curPos += 2; + error("UTF-32 LE is not supported\n\n"); + return NULL; } + + penv->curPos += 2; // skip signature if(assem->m_fReportProgress) printf("Source file is UNICODE\n\n"); penv->pfn_Sym = SymW; penv->pfn_nextchar = nextcharW; @@ -1542,18 +1529,13 @@ char* AsmParse::fillBuff(__in_opt __nullterminated char* pos) } else { - if(((penv->curPos[0]&0xFF)==0xEF)&&((penv->curPos[1]&0xFF)==0xBB)&&((penv->curPos[2]&0xFF)==0xBF)) + if((penv->curPos[0] & 0xFF) == 0xEF && (penv->curPos[1] & 0xFF) == 0xBB && (penv->curPos[2] & 0xFF) == 0xBF) { - g_uCodePage = CP_UTF8; penv->curPos += 3; - if(assem->m_fReportProgress) printf("Source file is UTF-8\n\n"); - penv->pfn_nextchar = nextcharU; - } - else - { - if(assem->m_fReportProgress) printf("Source file is ANSI\n\n"); - penv->pfn_nextchar = nextcharA; } + + if(assem->m_fReportProgress) printf("Source file is UTF-8\n\n"); + penv->pfn_nextchar = nextcharU; penv->pfn_Sym = SymAU; penv->pfn_NewStrFromToken = NewStrFromTokenAU; penv->pfn_NewStaticStrFromToken = NewStaticStrFromTokenAU; diff --git a/src/coreclr/src/ilasm/ilasmpch.cpp b/src/coreclr/src/ilasm/ilasmpch.cpp deleted file mode 100644 index 282910d0f45d..000000000000 --- a/src/coreclr/src/ilasm/ilasmpch.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include "ilasmpch.h" diff --git a/src/coreclr/src/ilasm/ilasmpch.h b/src/coreclr/src/ilasm/ilasmpch.h index d5f8cc2b158b..ece4130ae571 100644 --- a/src/coreclr/src/ilasm/ilasmpch.h +++ b/src/coreclr/src/ilasm/ilasmpch.h @@ -18,7 +18,6 @@ #include "specstrings.h" #include // for strcmp -#include // for _mbsinc #include // for isspace #include "openum.h" // for CEE_* #include // for vararg macros diff --git a/src/coreclr/src/ilasm/main.cpp b/src/coreclr/src/ilasm/main.cpp index 9eec9a853277..82a93d7eb52f 100644 --- a/src/coreclr/src/ilasm/main.cpp +++ b/src/coreclr/src/ilasm/main.cpp @@ -66,7 +66,7 @@ void MakeProperSourceFileName(__in __nullterminated WCHAR* wzOrigName, { j--; if(wzProperName[j] == '.') break; - if((wzProperName[j] == '\\')||(j == 0)) + if((wzProperName[j] == DIRECTORY_SEPARATOR_CHAR_A)||(j == 0)) { wcscat_s(wzProperName,MAX_FILENAME_LENGTH,W(".il")); break; @@ -639,7 +639,7 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv) if (bGeneratePdb && CLASSIC == pdbFormat) { // Classic PDB format is not supported on CoreCLR - // https://github.com/dotnet/coreclr/issues/2982 + // https://github.com/dotnet/runtime/issues/5051 printf("WARNING: Classic PDB format is not supported on CoreCLR.\n"); printf("Use '/PDBFMT=PORTABLE' option in order to generate portable PDB format. \n"); diff --git a/src/coreclr/src/ilasm/portable_pdb.cpp b/src/coreclr/src/ilasm/portable_pdb.cpp index f283ad05ec3d..8da13f2e5d8e 100644 --- a/src/coreclr/src/ilasm/portable_pdb.cpp +++ b/src/coreclr/src/ilasm/portable_pdb.cpp @@ -1,6 +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. #include "portable_pdb.h" #include diff --git a/src/coreclr/src/ilasm/portable_pdb.h b/src/coreclr/src/ilasm/portable_pdb.h index 0685842069b4..46bd1f149207 100644 --- a/src/coreclr/src/ilasm/portable_pdb.h +++ b/src/coreclr/src/ilasm/portable_pdb.h @@ -1,6 +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. #ifndef PORTABLE_PDB_H #define PORTABLE_PDB_H diff --git a/src/coreclr/src/ilasm/prebuilt/asmparse.cpp b/src/coreclr/src/ilasm/prebuilt/asmparse.cpp index bae2b0488be2..4e7131a90a72 100644 --- a/src/coreclr/src/ilasm/prebuilt/asmparse.cpp +++ b/src/coreclr/src/ilasm/prebuilt/asmparse.cpp @@ -2019,6 +2019,7 @@ YYLOCAL YYNEAR YYPASCAL YYPARSER() yyerrlab: ++yynerrs; + FALLTHROUGH; case 1: case 2: /* incompletely recovered error ... try again */ diff --git a/src/coreclr/src/ilasm/writer.cpp b/src/coreclr/src/ilasm/writer.cpp index dc3df055470b..0bff54b603dd 100644 --- a/src/coreclr/src/ilasm/writer.cpp +++ b/src/coreclr/src/ilasm/writer.cpp @@ -378,8 +378,10 @@ HRESULT Assembler::CreateExportDirectory() char* szOutputFileName = new char[Ldllname]; memset(szOutputFileName,0,wcslen(m_wzOutputFileName)*3+3); WszWideCharToMultiByte(CP_ACP,0,m_wzOutputFileName,-1,szOutputFileName,Ldllname,NULL,NULL); - pszDllName = strrchr(szOutputFileName,'\\'); + pszDllName = strrchr(szOutputFileName,DIRECTORY_SEPARATOR_CHAR_A); +#ifdef TARGET_WINDOWS if(pszDllName == NULL) pszDllName = strrchr(szOutputFileName,':'); +#endif if(pszDllName == NULL) pszDllName = szOutputFileName; Ldllname = (unsigned)strlen(pszDllName)+1; @@ -1146,8 +1148,10 @@ HRESULT Assembler::CreatePEFile(__in __nullterminated WCHAR *pwzOutputFilename) else { WCHAR* pwc; - if ((pwc = wcsrchr(m_wzOutputFileName, '\\')) != NULL) pwc++; + if ((pwc = wcsrchr(m_wzOutputFileName, DIRECTORY_SEPARATOR_CHAR_A)) != NULL) pwc++; +#ifdef TARGET_WINDOWS else if ((pwc = wcsrchr(m_wzOutputFileName, ':')) != NULL) pwc++; +#endif else pwc = m_wzOutputFileName; wcsncpy_s(wzScopeName, MAX_SCOPE_LENGTH, pwc, _TRUNCATE); diff --git a/src/coreclr/src/ildasm/dasm.cpp b/src/coreclr/src/ildasm/dasm.cpp index da3d12f0f336..f147b4cb3e91 100644 --- a/src/coreclr/src/ildasm/dasm.cpp +++ b/src/coreclr/src/ildasm/dasm.cpp @@ -2008,6 +2008,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr, break; case ELEMENT_TYPE_CLASS : typePtr += CorSigUncompressToken(typePtr, &tk); //skip the following token + FALLTHROUGH; case SERIALIZATION_TYPE_TYPE : appendStr(out,KEYWORD("type")); appendStr(out,appendix); @@ -2668,6 +2669,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void break; } //else fall thru to default case, to report the error + FALLTHROUGH; default: szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr),ERRORMSG(" /* ILLEGAL CONSTANT type:0x%02X, size:%d bytes, blob: "),MDDV.m_bType,MDDV.m_cbSize); @@ -3300,7 +3302,9 @@ void DumpGenericParsCA(mdToken tok, void* GUICookie/*=NULL*/) } //end if(g_fShowCA) } -// Sets *pbOverridingTypeSpec to TRUE if we are overriding a method declared by a type spec. +// Sets *pbOverridingTypeSpec to TRUE if we are overriding a method declared by a type spec or +// if the method has a signature which does not exactly match between the overrider and overridee. +// That case is commonly caused by covariant overrides. // In that case the syntax is slightly different (there are additional 'method' keywords). // Refer to Expert .NET 2.0 IL Assembler page 242. void PrettyPrintOverrideDecl(ULONG i, __inout __nullterminated char* szString, void* GUICookie, mdToken tkOverrider, @@ -3320,6 +3324,11 @@ void PrettyPrintOverrideDecl(ULONG i, __inout __nullterminated char* szString, v if(g_pImport->IsValidToken(tkDecl)) { + bool needsFullTokenPrint = false; + bool hasTkDeclParent = false; + + // Determine if the decl is a typespec method, in which case the "method" syntax + full token print + // must be used to generate the disassembly. if(SUCCEEDED(g_pImport->GetParentToken(tkDecl,&tkDeclParent))) { if(g_pImport->IsValidToken(tkDeclParent)) @@ -3334,20 +3343,99 @@ void PrettyPrintOverrideDecl(ULONG i, __inout __nullterminated char* szString, v { if(TypeFromToken(tkDeclParent)==mdtTypeSpec) { - szptr += sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), " %s ",KEYWORD("method")); - PrettyPrintToken(szString,tkDecl,g_pImport,GUICookie,tkOverrider); - - *pbOverridingTypeSpec = TRUE; - return; + needsFullTokenPrint = true; } - PrettyPrintToken(szString, tkDeclParent, g_pImport,GUICookie,tkOverrider); - strcat_s(szString, SZSTRING_SIZE,"::"); - szptr = &szString[strlen(szString)]; + hasTkDeclParent = true; } } else szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr),"%s",ERRORMSG("INVALID OVERRIDDEN METHOD'S PARENT TOKEN")); } + + // Determine if the sig of the decl does not match the sig of the body + // In that case the full "method" syntax must be used + if ((TypeFromToken(tkOverrider) == mdtMethodDef) && !needsFullTokenPrint) + { + PCCOR_SIGNATURE pComSigDecl; + ULONG cComSigDecl; + mdToken tkDeclSigTok = tkDecl; + bool successfullyGotDeclSig = false; + bool successfullyGotBodySig = false; + + if (TypeFromToken(tkDeclSigTok) == mdtMethodSpec) + { + mdToken meth=0; + if (SUCCEEDED(g_pImport->GetMethodSpecProps(tkDeclSigTok, &meth, NULL, NULL))) + { + tkDeclSigTok = meth; + } + } + + if (TypeFromToken(tkDeclSigTok) == mdtMethodDef) + { + if (SUCCEEDED(g_pImport->GetSigOfMethodDef(tkDeclSigTok, &cComSigDecl, &pComSigDecl))) + { + successfullyGotDeclSig = true; + } + } + else if (TypeFromToken(tkDeclSigTok) == mdtMemberRef) + { + const char *pszMemberNameUnused; + if (SUCCEEDED(g_pImport->GetNameAndSigOfMemberRef( + tkDeclSigTok, + &pComSigDecl, + &cComSigDecl, + &pszMemberNameUnused))) + { + successfullyGotDeclSig = true; + } + } + + PCCOR_SIGNATURE pComSigBody; + ULONG cComSigBody; + if (SUCCEEDED(g_pImport->GetSigOfMethodDef(tkOverrider, &cComSigBody, &pComSigBody))) + { + successfullyGotBodySig = true; + } + + if (successfullyGotDeclSig && successfullyGotBodySig) + { + if (cComSigBody != cComSigDecl) + { + needsFullTokenPrint = true; + } + else if (memcmp(pComSigBody, pComSigDecl, cComSigBody) != 0) + { + needsFullTokenPrint = true; + } + + // Signature are binary identical, full sig printing not needed + } + else + { + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr),"%s",ERRORMSG("INVALID BODY OR DECL SIG")); + } + } + + if (needsFullTokenPrint) + { + // In this case, the shortcut syntax cannot be used, and a full token must be printed. + // Print the full token and return. + szptr += sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), " %s ",KEYWORD("method")); + PrettyPrintToken(szString,tkDecl,g_pImport,GUICookie,tkOverrider); + + *pbOverridingTypeSpec = TRUE; + return; + } + + if (hasTkDeclParent) + { + // If the tkDeclParent was successfully retrieved during parent discovery print it here. + PrettyPrintToken(szString, tkDeclParent, g_pImport,GUICookie,tkOverrider); + strcat_s(szString, SZSTRING_SIZE,"::"); + szptr = &szString[strlen(szString)]; + } + if(TypeFromToken(tkDecl) == mdtMethodSpec) { mdToken meth=0; diff --git a/src/coreclr/src/ildasm/dasm_sz.cpp b/src/coreclr/src/ildasm/dasm_sz.cpp index 17b54951f84b..ddfb68efb749 100644 --- a/src/coreclr/src/ildasm/dasm_sz.cpp +++ b/src/coreclr/src/ildasm/dasm_sz.cpp @@ -211,6 +211,7 @@ unsigned SizeOfField(PCCOR_SIGNATURE *ppSig, ULONG cSig, IMDInternalImport* pImp case ELEMENT_TYPE_CMOD_OPT : case ELEMENT_TYPE_CMOD_REQD : *ppSig += CorSigUncompressToken(*ppSig, &tk); + FALLTHROUGH; case ELEMENT_TYPE_PINNED : case ELEMENT_TYPE_SZARRAY : // uElementNumber doesn't change if(*ppSig < pSigEnd) Reiterate = TRUE; diff --git a/src/coreclr/src/ildasm/dis.cpp b/src/coreclr/src/ildasm/dis.cpp index e14e3c6f5315..91f37422d76c 100644 --- a/src/coreclr/src/ildasm/dis.cpp +++ b/src/coreclr/src/ildasm/dis.cpp @@ -1448,9 +1448,9 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md case InlineVar: { - if(g_fShowBytes) + if(g_fShowBytes) { - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X ", pCode[PC], pCode[PC+1]); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X ", pCode[PC+1], pCode[PC]); Len += 5; PadTheString; } @@ -1509,7 +1509,8 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md DWORD v = pCode[PC] + (pCode[PC+1] << 8) + (pCode[PC+2] << 16) + (pCode[PC+3] << 24); if(g_fShowBytes) { - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3]); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); Len += 9; PadTheString; } @@ -1533,8 +1534,8 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md { szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X", - pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3], - pCode[PC+4], pCode[PC+5], pCode[PC+6], pCode[PC+7]); + pCode[PC+7], pCode[PC+6], pCode[PC+5], pCode[PC+4], + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); Len += 8*2; PadTheString; } @@ -1555,7 +1556,8 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md if(g_fShowBytes) { - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3]); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); Len += 9; PadTheString; } @@ -1594,8 +1596,8 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md { szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X", - pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3], - pCode[PC+4], pCode[PC+5], pCode[PC+6], pCode[PC+7]); + pCode[PC+7], pCode[PC+6], pCode[PC+5], pCode[PC+4], + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); Len += 8*2; PadTheString; } @@ -1610,8 +1612,10 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md if (((__int64&)df == v)&&!IsSpecialNumber(szf)) szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%-10s %s", pszInstrName, szf); else - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%-10s (%2.2X %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X)", - pszInstrName, pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3], + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), + "%-10s (%2.2X %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X %2.2X)", + pszInstrName, + pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3], pCode[PC+4], pCode[PC+5], pCode[PC+6], pCode[PC+7]); PC += 8; break; @@ -1642,7 +1646,8 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md if(g_fShowBytes) { - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3]); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); Len += 9; PadTheString; } @@ -1659,7 +1664,8 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md if(g_fShowBytes) { - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3]); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); Len += 9; PadTheString; } @@ -1676,8 +1682,9 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr),"%s ",g_szAsmCodeIndent); //indent+label if(g_fShowBytes) { - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr),"/* | %2.2X%2.2X%2.2X%2.2X ", // comment - pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3]); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), + "/* | %2.2X%2.2X%2.2X%2.2X ", // comment + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); Len = 9; PadTheString; } @@ -1699,9 +1706,9 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md { szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X", cases); Len += 2; - for(i=0; i < cases*2; i++) + for(i=cases*2; i > 0; i--) { - szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X", pCode[PC+1+i]); + szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X", pCode[PC+i]); Len += 2; } PadTheString; @@ -1733,7 +1740,7 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md if(g_fShowBytes) { szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", - pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3]); + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); Len += 9; PadTheString; } @@ -1821,7 +1828,7 @@ BOOL Disassemble(IMDInternalImport *pImport, BYTE *ILHeader, void *GUICookie, md if(g_fShowBytes) { szptr+=sprintf_s(szptr,SZSTRING_REMAINING_SIZE(szptr), "%2.2X%2.2X%2.2X%2.2X ", - pCode[PC], pCode[PC+1], pCode[PC+2], pCode[PC+3]); + pCode[PC+3], pCode[PC+2], pCode[PC+1], pCode[PC]); // output the offset and the raw bytes Len += 9; PadTheString; diff --git a/src/coreclr/src/inc/CMakeLists.txt b/src/coreclr/src/inc/CMakeLists.txt index 817622012516..456cdf909653 100644 --- a/src/coreclr/src/inc/CMakeLists.txt +++ b/src/coreclr/src/inc/CMakeLists.txt @@ -29,7 +29,7 @@ if(CLR_CMAKE_HOST_WIN32) set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c) list(APPEND CORGUIDS_SOURCES ${OUT_NAME}) add_custom_command(OUTPUT ${OUT_NAME} - COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} + COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /no_stamp /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} COMMENT "Compiling ${GENERATE_IDL}") endforeach(GENERATE_IDL) @@ -58,7 +58,9 @@ if(FEATURE_JIT_PITCHING) endif(FEATURE_JIT_PITCHING) # Compile *_i.cpp to lib -_add_library(corguids OBJECT ${CORGUIDS_SOURCES}) +_add_library(corguids_obj OBJECT ${CORGUIDS_SOURCES}) +add_library(corguids INTERFACE) +target_sources(corguids INTERFACE $) # Binplace the inc files for packaging later. @@ -75,4 +77,3 @@ _install (FILES cfi.h gcinfoencoder.h gcinfotypes.h DESTINATION inc) -_install (TARGETS corguids DESTINATION lib) diff --git a/src/coreclr/src/inc/clr_std/type_traits b/src/coreclr/src/inc/clr_std/type_traits index 47d4f241639c..1650b2bc7cbb 100644 --- a/src/coreclr/src/inc/clr_std/type_traits +++ b/src/coreclr/src/inc/clr_std/type_traits @@ -198,7 +198,7 @@ namespace std typedef unsigned int type; }; -#ifndef TARGET_UNIX +#ifndef HOST_UNIX template<> struct make_unsigned @@ -206,7 +206,7 @@ namespace std typedef unsigned long type; }; -#endif // !TARGET_UNIX +#endif // !HOST_UNIX template<> struct make_unsigned<__int64> @@ -233,7 +233,7 @@ namespace std typedef signed int type; }; -#ifndef TARGET_UNIX +#ifndef HOST_UNIX template<> struct make_signed @@ -241,7 +241,7 @@ namespace std typedef signed long type; }; -#endif // !TARGET_UNIX +#endif // !HOST_UNIX template<> struct make_signed @@ -358,7 +358,7 @@ namespace std // On Unix 'long' is a 64-bit type (same as __int64) and the following two definitions // conflict with _Is_integral and _Is_integral. -#ifndef TARGET_UNIX +#ifndef HOST_UNIX template<> struct _Is_integral : true_type @@ -370,7 +370,7 @@ namespace std : true_type { // determine whether _Ty is integral }; -#endif /* TARGET_UNIX */ +#endif /* HOST_UNIX */ #if _HAS_CHAR16_T_LANGUAGE_SUPPORT template<> @@ -426,7 +426,7 @@ namespace std // In PAL, we define long as int and so this becomes int double, // which is a nonsense -#ifndef TARGET_UNIX +#ifndef HOST_UNIX template<> struct _Is_floating_point : true_type diff --git a/src/coreclr/src/inc/clrconfig.h b/src/coreclr/src/inc/clrconfig.h index 7ffa85435351..bd5e41cdbc0a 100644 --- a/src/coreclr/src/inc/clrconfig.h +++ b/src/coreclr/src/inc/clrconfig.h @@ -41,16 +41,6 @@ class CLRConfig IgnoreEnv = 0x1, // If set, do not prepend "COMPlus_" when doing environment variable lookup. DontPrependCOMPlus_ = 0x2, - // If set, don't look in HKLM in the registry. - IgnoreHKLM = 0x4, - // If set, don't look in HKCU in the registry. - IgnoreHKCU = 0x8, - // If set, look only in the system config file, ignoring other config files. - // (This option does not affect environment variable and registry lookups) - ConfigFile_SystemOnly = 0x40, - // If set, reverse the order of config file lookups (application config file first). - // (This option does not affect environment variable and registry lookups) - ConfigFile_ApplicationFirst = 0x80, // Remove any whitespace at beginning and end of value. (Only applicable for // *string* configuration values.) TrimWhiteSpaceFromStringValue = 0x100, diff --git a/src/coreclr/src/inc/clrconfigvalues.h b/src/coreclr/src/inc/clrconfigvalues.h index ddb1db3ce647..fb0d859f8db8 100644 --- a/src/coreclr/src/inc/clrconfigvalues.h +++ b/src/coreclr/src/inc/clrconfigvalues.h @@ -8,6 +8,17 @@ // Unified method of accessing configuration values from environment variables, // registry and config file. // +// Given any config knob below that looks like this example: +// RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_LogEnable, W("LogEnable"), "Turns on the traditional CLR log.") +// --------- +// | +// -------------------- +// | +// V +// You can set an environment variable COMPlus_LogEnable=1 to enable it. +// +// See below for more details +// //***************************************************************************** // IMPORTANT: Before adding a new config value, please read up on naming conventions (see @@ -269,7 +280,6 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcServer, W("gcServer"), 0, "Enables server CONFIG_STRING_INFO(INTERNAL_GcCoverage, W("GcCoverage"), "Specify a method or regular expression of method names to run with GCStress") CONFIG_STRING_INFO(INTERNAL_SkipGCCoverage, W("SkipGcCoverage"), "Specify a list of assembly names to skip with GC Coverage") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StatsUpdatePeriod, W("StatsUpdatePeriod"), 60, "Specifies the interval, in seconds, at which to update the statistics") -RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCPollType, W("GCPollType"), "") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCRetainVM, W("GCRetainVM"), 0, "When set we put the segments that should be deleted on a standby list (instead of releasing them back to the OS) which will be considered to satisfy new segment requests (note that the same thing can be specified via API which is the supported way)") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCLOHThreshold, W("GCLOHThreshold"), 0, "Specifies the size that will make objects go on LOH") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_gcAllowVeryLargeObjects, W("gcAllowVeryLargeObjects"), 1, "Allow allocation of 2GB+ objects on GC heap") @@ -553,10 +563,13 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadSuspendInjection, W("INTERNAL_ThreadSusp RETAIL_CONFIG_DWORD_INFO(INTERNAL_DefaultStackSize, W("DefaultStackSize"), 0, "Stack size to use for new VM threads when thread is created with default stack size (dwStackSize == 0).") RETAIL_CONFIG_DWORD_INFO(INTERNAL_Thread_DeadThreadCountThresholdForGCTrigger, W("Thread_DeadThreadCountThresholdForGCTrigger"), 75, "In the heuristics to clean up dead threads, this threshold must be reached before triggering a GC will be considered. Set to 0 to disable triggering a GC based on dead threads.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_Thread_DeadThreadGCTriggerPeriodMilliseconds, W("Thread_DeadThreadGCTriggerPeriodMilliseconds"), 1000 * 60 * 30, "In the heuristics to clean up dead threads, this much time must have elapsed since the previous max-generation GC before triggering another GC will be considered") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Thread_UseAllCpuGroups, W("Thread_UseAllCpuGroups"), 0, "Specifies whether to query and use CPU group information for determining the processor count.") +RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Thread_AssignCpuGroups, W("Thread_AssignCpuGroups"), 1, "Specifies whether to automatically distribute threads created by the CLR across CPU Groups. Effective only when Thread_UseAllCpuGroups and GCCpuGroup are enabled.") /// /// Threadpool /// +RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UsePortableThreadPool, W("ThreadPool_UsePortableThreadPool"), 1, "Uses the managed portable thread pool implementation instead of the unmanaged one.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_ForceMinWorkerThreads, W("ThreadPool_ForceMinWorkerThreads"), 0, "Overrides the MinThreads setting for the ThreadPool worker pool") RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_ForceMaxWorkerThreads, W("ThreadPool_ForceMaxWorkerThreads"), 0, "Overrides the MaxThreads setting for the ThreadPool worker pool") RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_DisableStarvationDetection, W("ThreadPool_DisableStarvationDetection"), 0, "Disables the ThreadPool feature that forces new threads to be added when workitems run for too long") @@ -568,9 +581,6 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UnfairSemaphoreSpinLimit, W("Thread #else // !TARGET_ARM64 RETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UnfairSemaphoreSpinLimit, W("ThreadPool_UnfairSemaphoreSpinLimit"), 0x46, "Maximum number of spins a thread pool worker thread performs before waiting for work") #endif // TARGET_ARM64 -RETAIL_CONFIG_DWORD_INFO(EXTERNAL_Thread_UseAllCpuGroups, W("Thread_UseAllCpuGroups"), 0, "Specifies if to automatically distribute thread across CPU Groups") - -CONFIG_DWORD_INFO(INTERNAL_ThreadpoolTickCountAdjustment, W("ThreadpoolTickCountAdjustment"), 0, "") RETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_Disable, W("HillClimbing_Disable"), 0, "Disables hill climbing for thread adjustments in the thread pool"); RETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_WavePeriod, W("HillClimbing_WavePeriod"), 4, ""); @@ -691,7 +701,6 @@ RETAIL_CONFIG_STRING_INFO(INTERNAL_EventNameFilter, W("EventNameFilter"), "") /// Interop /// CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_ExposeExceptionsInCOM, W("ExposeExceptionsInCOM"), "") -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_PInvokeInline, W("PInvokeInline"), "", CLRConfig::EEConfig_default) RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_InteropValidatePinnedObjects, W("InteropValidatePinnedObjects"), 0, "After returning from a managed-to-unmanaged interop call, validate GC heap around objects pinned by IL stubs.") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_InteropLogArguments, W("InteropLogArguments"), 0, "Log all pinned arguments passed to an interop call") RETAIL_CONFIG_STRING_INFO(UNSUPPORTED_LogCCWRefCountChange, W("LogCCWRefCountChange"), "Outputs debug information and calls LogCCWRefCountChange_BREAKPOINT when AddRef or Release is called on a CCW.") @@ -709,11 +718,19 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeRundown, W("EventPipeRundown"), 1, "E RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeCircularMB, W("EventPipeCircularMB"), 1024, "The EventPipe circular buffer size in megabytes.") RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeProcNumbers, W("EventPipeProcNumbers"), 0, "Enable/disable capturing processor numbers in EventPipe event headers") +// +// Generational Aware Analysis +// +RETAIL_CONFIG_DWORD_INFO(INTERNAL_GCGenAnalysisGen, W("GCGenAnalysisGen"), 0, "The generation to trigger generational aware analysis") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_GCGenAnalysisBytes, W("GCGenAnalysisBytes"), 0, "The number of bytes to trigger generational aware analysis") +RETAIL_CONFIG_DWORD_INFO(INTERNAL_GCGenAnalysisIndex, W("GCGenAnalysisIndex"), 0, "The gc index to trigger generational aware analysis") +RETAIL_CONFIG_STRING_INFO(INTERNAL_GCGenAnalysisCmd, W("GCGenAnalysisCmd"), "An optional filter to match with the command line used to spawn the process") + // -// Diagnostics Server +// Diagnostics Ports // -RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticsMonitorAddress, W("DOTNET_DiagnosticsMonitorAddress"), "NamedPipe path without '\\\\.\\pipe\\' on Windows; Full path of Unix Domain Socket on Linux/Unix. Used for Diagnostics Monitoring Agents.", CLRConfig::DontPrependCOMPlus_); -RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DOTNET_DiagnosticsMonitorPauseOnStart, W("DOTNET_DiagnosticsMonitorPauseOnStart"), 1, "If DOTNET_DiagnosticsMonitorAddress is set, this will cause the runtime to pause during startup. Resume using the Diagnostics IPC ResumeStartup command.", CLRConfig::DontPrependCOMPlus_); +RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DOTNET_DefaultDiagnosticPortSuspend, W("DOTNET_DefaultDiagnosticPortSuspend"), 0, "This sets the deafult diagnostic port to suspend causing the runtime to pause during startup before major subsystems are started. Resume using the Diagnostics IPC ResumeStartup command on the default diagnostic port.", CLRConfig::DontPrependCOMPlus_); +RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticPorts, W("DOTNET_DiagnosticPorts"), "A semicolon delimited list of additional Diagnostic Ports, where a Diagnostic Port is a NamedPipe path without '\\\\.\\pipe\\' on Windows or the full path of Unix Domain Socket on Linux/Unix followed by optional tags, e.g., ',connect,nosuspend;'", CLRConfig::DontPrependCOMPlus_); // // LTTng @@ -762,7 +779,6 @@ CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_GenerateLongJumpDispatchStubRatio, W("G CONFIG_DWORD_INFO_EX(INTERNAL_HashStack, W("HashStack"), 0, "", CLRConfig::EEConfig_default) CONFIG_DWORD_INFO(INTERNAL_HostManagerConfig, W("HostManagerConfig"), (DWORD)-1, "") CONFIG_DWORD_INFO(INTERNAL_HostTestThreadAbort, W("HostTestThreadAbort"), 0, "") -RETAIL_CONFIG_DWORD_INFO_EX(UNSUPPORTED_IgnoreDllMainReturn, W("IgnoreDllMainReturn"), 0, "Don't check the return value of DllMain if this is set", CLRConfig::ConfigFile_ApplicationFirst) CONFIG_STRING_INFO(INTERNAL_InvokeHalt, W("InvokeHalt"), "Throws an assert when the given method is invoked through reflection.") CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_MaxStackDepth, W("MaxStackDepth"), "") CONFIG_DWORD_INFO_DIRECT_ACCESS(INTERNAL_MaxStubUnwindInfoSegmentSize, W("MaxStubUnwindInfoSegmentSize"), "") diff --git a/src/coreclr/src/inc/clrnt.h b/src/coreclr/src/inc/clrnt.h index 1a1999938ead..a833da67bcc9 100644 --- a/src/coreclr/src/inc/clrnt.h +++ b/src/coreclr/src/inc/clrnt.h @@ -837,6 +837,7 @@ RtlVirtualUnwind_Unsafe( // // x86 ABI does not define RUNTIME_FUNCTION. Define our own to allow unification between x86 and other platforms. // +#ifdef HOST_X86 typedef struct _RUNTIME_FUNCTION { DWORD BeginAddress; DWORD UnwindData; @@ -845,7 +846,7 @@ typedef struct _RUNTIME_FUNCTION { typedef struct _DISPATCHER_CONTEXT { _EXCEPTION_REGISTRATION_RECORD* RegistrationPointer; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; - +#endif // HOST_X86 #endif // !TARGET_UNIX #define RUNTIME_FUNCTION__BeginAddress(prf) (prf)->BeginAddress @@ -872,6 +873,7 @@ RtlpGetFunctionEndAddress ( #define RUNTIME_FUNCTION__GetUnwindInfoAddress(prf) (prf)->UnwindData #define RUNTIME_FUNCTION__SetUnwindInfoAddress(prf, addr) do { (prf)->UnwindData = (addr); } while(0) +#ifdef HOST_X86 EXTERN_C NTSYSAPI PEXCEPTION_ROUTINE @@ -886,6 +888,7 @@ RtlVirtualUnwind ( __out PDWORD EstablisherFrame, __inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers ); +#endif // HOST_X86 #endif // FEATURE_EH_FUNCLETS #endif // TARGET_X86 @@ -933,7 +936,7 @@ typedef struct _UNWIND_INFO { // dummy } UNWIND_INFO, *PUNWIND_INFO; -#if defined(TARGET_UNIX) || defined(HOST_X86) +#if defined(HOST_UNIX) || defined(HOST_X86) EXTERN_C NTSYSAPI @@ -949,7 +952,7 @@ RtlVirtualUnwind ( __out PDWORD EstablisherFrame, __inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers ); -#endif // TARGET_UNIX || HOST_X86 +#endif // HOST_UNIX || HOST_X86 #define UNW_FLAG_NHANDLER 0x0 diff --git a/src/coreclr/src/inc/cor.h b/src/coreclr/src/inc/cor.h index 8d2b63294602..7b9bf9c4ff17 100644 --- a/src/coreclr/src/inc/cor.h +++ b/src/coreclr/src/inc/cor.h @@ -143,8 +143,6 @@ typedef UNALIGNED void const *UVCP_CONSTANT; #define TARGET_MAIN_CLR_DLL_NAME_W MAKE_TARGET_DLLNAME_W(MAIN_CLR_MODULE_NAME_W) #define TARGET_MAIN_CLR_DLL_NAME_A MAKE_TARGET_DLLNAME_A(MAIN_CLR_MODULE_NAME_A) -#define SWITCHOUT_HANDLE_VALUE ((HANDLE)(LONG_PTR)-2) - //***************************************************************************** //***************************************************************************** // @@ -2093,7 +2091,11 @@ inline ULONG CorSigUncompressData( // return number of bytes of that compre } -constexpr mdToken g_tkCorEncodeToken[4] ={mdtTypeDef, mdtTypeRef, mdtTypeSpec, mdtBaseType}; +FORCEINLINE mdToken CorSigDecodeTokenType(int encoded) +{ + static const mdToken s_tableTokenTypes[] = {mdtTypeDef, mdtTypeRef, mdtTypeSpec, mdtBaseType}; + return s_tableTokenTypes[encoded]; +} // uncompress a token inline mdToken CorSigUncompressToken( // return the token. @@ -2103,7 +2105,7 @@ inline mdToken CorSigUncompressToken( // return the token. mdToken tkType; tk = CorSigUncompressData(pData); - tkType = g_tkCorEncodeToken[tk & 0x3]; + tkType = CorSigDecodeTokenType(tk & 0x3); tk = TokenFromRid(tk >> 2, tkType); return tk; } @@ -2118,7 +2120,7 @@ inline ULONG CorSigUncompressToken( // return number of bytes of that compressed mdToken tkType; cb = CorSigUncompressData(pData, (ULONG *)&tk); - tkType = g_tkCorEncodeToken[tk & 0x3]; + tkType = CorSigDecodeTokenType(tk & 0x3); tk = TokenFromRid(tk >> 2, tkType); *pToken = tk; return cb; @@ -2137,7 +2139,7 @@ inline HRESULT CorSigUncompressToken( if (SUCCEEDED(hr)) { - tkType = g_tkCorEncodeToken[tk & 0x3]; + tkType = CorSigDecodeTokenType(tk & 0x3); tk = TokenFromRid(tk >> 2, tkType); *pToken = tk; } @@ -2290,17 +2292,17 @@ inline ULONG CorSigCompressToken( // return number of bytes that compressed fo // TypeSpec is encoded with low bits 10 // BaseType is encoded with low bit 11 // - if (ulTyp == g_tkCorEncodeToken[1]) + if (ulTyp == CorSigDecodeTokenType(1)) { // make the last two bits 01 rid |= 0x1; } - else if (ulTyp == g_tkCorEncodeToken[2]) + else if (ulTyp == CorSigDecodeTokenType(2)) { // make last two bits 0 rid |= 0x2; } - else if (ulTyp == g_tkCorEncodeToken[3]) + else if (ulTyp == CorSigDecodeTokenType(3)) { rid |= 0x3; } diff --git a/src/coreclr/src/inc/corcompile.h b/src/coreclr/src/inc/corcompile.h index f02a7a1475d0..38e837a4ad53 100644 --- a/src/coreclr/src/inc/corcompile.h +++ b/src/coreclr/src/inc/corcompile.h @@ -59,7 +59,14 @@ typedef DPTR(RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION; // Chained unwind info. Used for cold methods. +#ifdef HOST_X86 #define RUNTIME_FUNCTION_INDIRECT 0x80000000 +#else +// If not hosted on X86, undefine RUNTIME_FUNCTION_INDIRECT as it likely isn't correct +#ifdef RUNTIME_FUNCTION_INDIRECT +#undef RUNTIME_FUNCTION_INDIRECT +#endif // RUNTIME_FUNCTION_INDIRECT +#endif // HOST_X86 #endif // TARGET_X86 @@ -1412,7 +1419,7 @@ class ICorCompileInfo // So, the host must call StartupAsCompilationProcess before compiling // any code, and Shutdown after finishing. // - // The arguments control which native image of mscorlib to use. + // The arguments control which native image of CoreLib to use. // This matters for hardbinding. // @@ -1548,8 +1555,8 @@ class ICorCompileInfo mdFieldDef *token ) = 0; - // Get the loader module for mscorlib - virtual CORINFO_MODULE_HANDLE GetLoaderModuleForMscorlib() = 0; + // Get the loader module for CoreLib + virtual CORINFO_MODULE_HANDLE GetLoaderModuleForCoreLib() = 0; // Get the loader module for a type (where the type is regarded as // living for the purposes of loading, unloading, and ngen). diff --git a/src/coreclr/src/inc/cordebug.idl b/src/coreclr/src/inc/cordebug.idl index 7ab2867d9f28..efecf3b55063 100644 --- a/src/coreclr/src/inc/cordebug.idl +++ b/src/coreclr/src/inc/cordebug.idl @@ -2361,7 +2361,7 @@ interface ICorDebugAppDomain4 : IUnknown * Assembly interface * An ICorDebugAssembly instance corresponds to a a managed assembly loaded * into a specific AppDomain in the CLR. For assemblies shared between multiple - * AppDomains (eg. mscorlib), there will be a separate ICorDebugAssembly instance + * AppDomains (eg. CoreLib), there will be a separate ICorDebugAssembly instance * per AppDomain in which it is used. * ------------------------------------------------------------------------- */ [ @@ -5173,6 +5173,30 @@ interface ICorDebugModule3 : IUnknown [out][iid_is(riid)] void **ppObj); } +/* + * ICorDebugModule4 is a logical extension to ICorDebugModule. + */ +[ + object, + local, + uuid(FF8B8EAF-25CD-4316-8859-84416DE4402E), + pointer_default(unique) +] +interface ICorDebugModule4 : IUnknown +{ + /* + * Query to see if the module is loaded into memory in mapped/hydrated format + * + * Arguments: + * pIsMapped - BOOL to store mapping information. TRUE will represent mapped + format while FALSE represents flat format. + * Return Value: + * S_OK in successful case. + * Notes: + */ + HRESULT IsMappedLayout([out] BOOL *pIsMapped); +} + /* * ICorDebugRuntimeUnwindableFrame is a specialized interface of ICorDebugFrame for unmanaged methods * which requires special knowledge to unwind. They are not jitted code. When the debugger sees this type @@ -5196,7 +5220,7 @@ interface ICorDebugRuntimeUnwindableFrame : ICorDebugFrame * specific AppDomain. Normally this is an executable or a DLL, but it may also be * some other file of a multi-module assembly. There is an ICorDebugModule instance * for each AppDomain a module is loaded into, even in the case of shared modules like - * mscorlib. + * CoreLib. */ [ diff --git a/src/coreclr/src/inc/cordebuginfo.h b/src/coreclr/src/inc/cordebuginfo.h index ae08b2a88545..66b0d50b875b 100644 --- a/src/coreclr/src/inc/cordebuginfo.h +++ b/src/coreclr/src/inc/cordebuginfo.h @@ -251,7 +251,7 @@ class ICorDebugInfo }; // VLT_STK2 -- Any 64 bit value which is on the stack, - // in 2 successsive DWords. + // in 2 successive DWords. // eg 2 DWords at [ESP+0x10] struct vlStk2 diff --git a/src/coreclr/src/inc/corerror.xml b/src/coreclr/src/inc/corerror.xml index 94fe6a1ddcea..b1a0b5b53ca0 100644 --- a/src/coreclr/src/inc/corerror.xml +++ b/src/coreclr/src/inc/corerror.xml @@ -2201,12 +2201,6 @@ File is PE32 - - NGEN_E_SYS_ASM_NI_MISSING - "NGen cannot proceed because Mscorlib.dll does not have a native image" - Compiling any assembly other than mscorlib in the absence of mscorlib.ni.dll is not allowed. - - CLDB_E_INTERNALERROR @@ -2249,8 +2243,8 @@ CLR_E_BIND_SYS_ASM_NI_MISSING - "Could not use native image because Mscorlib.dll is missing a native image" - Returned when loading an assembly that only has a native image and no IL and cannot hardbind to mscorlib.ni.dll. + "Could not use native image because System.Private.CoreLib.dll is missing a native image" + Returned when loading an assembly that only has a native image and no IL and cannot hardbind to System.Private.CoreLib.ni.dll. diff --git a/src/coreclr/src/inc/corexcep.h b/src/coreclr/src/inc/corexcep.h index faca6b49c593..e1c00b50b321 100644 --- a/src/coreclr/src/inc/corexcep.h +++ b/src/coreclr/src/inc/corexcep.h @@ -13,7 +13,7 @@ // All COM+ exceptions are expressed as a RaiseException with this exception // code. If you change this value, you must also change -// mscorlib\src\system\Exception.cs's _COMPlusExceptionCode value. +// Exception.cs's _COMPlusExceptionCode value. #define EXCEPTION_MSVC 0xe06d7363 // 0xe0000000 | 'msc' diff --git a/src/coreclr/src/inc/corhlprpriv.h b/src/coreclr/src/inc/corhlprpriv.h index 056bca27f442..03ded5be2876 100644 --- a/src/coreclr/src/inc/corhlprpriv.h +++ b/src/coreclr/src/inc/corhlprpriv.h @@ -13,7 +13,7 @@ #include "corhlpr.h" #include "fstring.h" -#if defined(_MSC_VER) && defined(TARGET_X86) +#if defined(_MSC_VER) && defined(HOST_X86) #pragma optimize("y", on) // If routines don't get inlined, don't pay the EBP frame penalty #endif diff --git a/src/coreclr/src/inc/corinfo.h b/src/coreclr/src/inc/corinfo.h index e93f59b0da41..e1ddd1719574 100644 --- a/src/coreclr/src/inc/corinfo.h +++ b/src/coreclr/src/inc/corinfo.h @@ -208,11 +208,11 @@ TODO: Talk about initializing strutures before use // ////////////////////////////////////////////////////////////////////////////////////////////////////////// -constexpr GUID JITEEVersionIdentifier = { /* 7af97117-55be-4c76-afb2-e26261cb140e */ - 0x7af97117, - 0x55be, - 0x4c76, - { 0xaf, 0xb2, 0xe2, 0x62, 0x61, 0xcb, 0x14, 0x0e } +constexpr GUID JITEEVersionIdentifier = { /* 062114d0-bd20-483f-8a3e-c4ee39706ae8 */ + 0x062114d0, + 0xbd20, + 0x483f, + {0x8a, 0x3e, 0xc4, 0xee, 0x39, 0x70, 0x6a, 0xe8} }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -891,28 +891,6 @@ enum CorInfoException enum CorInfoIntrinsics { - CORINFO_INTRINSIC_Sin, - CORINFO_INTRINSIC_Cos, - CORINFO_INTRINSIC_Cbrt, - CORINFO_INTRINSIC_Sqrt, - CORINFO_INTRINSIC_Abs, - CORINFO_INTRINSIC_Round, - CORINFO_INTRINSIC_Cosh, - CORINFO_INTRINSIC_Sinh, - CORINFO_INTRINSIC_Tan, - CORINFO_INTRINSIC_Tanh, - CORINFO_INTRINSIC_Asin, - CORINFO_INTRINSIC_Asinh, - CORINFO_INTRINSIC_Acos, - CORINFO_INTRINSIC_Acosh, - CORINFO_INTRINSIC_Atan, - CORINFO_INTRINSIC_Atan2, - CORINFO_INTRINSIC_Atanh, - CORINFO_INTRINSIC_Log10, - CORINFO_INTRINSIC_Pow, - CORINFO_INTRINSIC_Exp, - CORINFO_INTRINSIC_Ceiling, - CORINFO_INTRINSIC_Floor, CORINFO_INTRINSIC_GetChar, // fetch character out of string CORINFO_INTRINSIC_Array_GetDimLength, // Get number of elements in a given dimension of an array CORINFO_INTRINSIC_Array_Get, // Get the value of an element in an array diff --git a/src/coreclr/src/inc/corjit.h b/src/coreclr/src/inc/corjit.h index 06948e953430..609bfc64b893 100644 --- a/src/coreclr/src/inc/corjit.h +++ b/src/coreclr/src/inc/corjit.h @@ -45,6 +45,7 @@ enum CorJitResult CORJIT_INTERNALERROR = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 3), CORJIT_SKIPPED = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 4), CORJIT_RECOVERABLEERROR = MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 5), + CORJIT_IMPLLIMITATION= MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 6), }; /*****************************************************************************/ diff --git a/src/coreclr/src/inc/corjitflags.h b/src/coreclr/src/inc/corjitflags.h index 7ec09408b3da..5cd57af5a94e 100644 --- a/src/coreclr/src/inc/corjitflags.h +++ b/src/coreclr/src/inc/corjitflags.h @@ -32,7 +32,7 @@ class CORJIT_FLAGS CORJIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode CORJIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necesarily debuggable code) - CORJIT_FLAG_GCPOLL_CALLS = 6, // Emit calls to JIT_POLLGC for thread suspension. + CORJIT_FLAG_UNUSED1 = 6, CORJIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete #if defined(TARGET_X86) @@ -44,11 +44,11 @@ class CORJIT_FLAGS #else // !defined(TARGET_X86) - CORJIT_FLAG_UNUSED1 = 8, - CORJIT_FLAG_UNUSED2 = 9, - CORJIT_FLAG_UNUSED3 = 10, - CORJIT_FLAG_UNUSED4 = 11, - CORJIT_FLAG_UNUSED5 = 12, + CORJIT_FLAG_UNUSED2 = 8, + CORJIT_FLAG_UNUSED3 = 9, + CORJIT_FLAG_UNUSED4 = 10, + CORJIT_FLAG_UNUSED5 = 11, + CORJIT_FLAG_UNUSED6 = 12, #endif // !defined(TARGET_X86) @@ -81,43 +81,43 @@ class CORJIT_FLAGS CORJIT_FLAG_FRAMED = 31, // All methods have an EBP frame CORJIT_FLAG_ALIGN_LOOPS = 32, // add NOPs before loops to align them at 16 byte boundaries CORJIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - CORJIT_FLAG_GCPOLL_INLINE = 34, // JIT must inline calls to GCPoll when possible + CORJIT_FLAG_UNUSED11 = 34, CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - // CORJIT_FLAG_UNUSED = 38, + CORJIT_FLAG_UNUSED12 = 38, CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code #if defined(TARGET_ARM) CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records #else // !defined(TARGET_ARM) - CORJIT_FLAG_UNUSED11 = 41, + CORJIT_FLAG_UNUSED13 = 41, #endif // !defined(TARGET_ARM) CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method - CORJIT_FLAG_UNUSED12 = 43, - CORJIT_FLAG_UNUSED13 = 44, - CORJIT_FLAG_UNUSED14 = 45, - CORJIT_FLAG_UNUSED15 = 46, - CORJIT_FLAG_UNUSED16 = 47, - CORJIT_FLAG_UNUSED17 = 48, - CORJIT_FLAG_UNUSED18 = 49, - CORJIT_FLAG_UNUSED19 = 50, - CORJIT_FLAG_UNUSED20 = 51, - CORJIT_FLAG_UNUSED21 = 52, - CORJIT_FLAG_UNUSED22 = 53, - CORJIT_FLAG_UNUSED23 = 54, - CORJIT_FLAG_UNUSED24 = 55, - CORJIT_FLAG_UNUSED25 = 56, - CORJIT_FLAG_UNUSED26 = 57, - CORJIT_FLAG_UNUSED27 = 58, - CORJIT_FLAG_UNUSED28 = 59, - CORJIT_FLAG_UNUSED29 = 60, - CORJIT_FLAG_UNUSED30 = 61, - CORJIT_FLAG_UNUSED31 = 62, - CORJIT_FLAG_UNUSED32 = 63 + CORJIT_FLAG_UNUSED14 = 43, + CORJIT_FLAG_UNUSED15 = 44, + CORJIT_FLAG_UNUSED16 = 45, + CORJIT_FLAG_UNUSED17 = 46, + CORJIT_FLAG_UNUSED18 = 47, + CORJIT_FLAG_UNUSED19 = 48, + CORJIT_FLAG_UNUSED20 = 49, + CORJIT_FLAG_UNUSED21 = 50, + CORJIT_FLAG_UNUSED22 = 51, + CORJIT_FLAG_UNUSED23 = 52, + CORJIT_FLAG_UNUSED24 = 53, + CORJIT_FLAG_UNUSED25 = 54, + CORJIT_FLAG_UNUSED26 = 55, + CORJIT_FLAG_UNUSED27 = 56, + CORJIT_FLAG_UNUSED28 = 57, + CORJIT_FLAG_UNUSED29 = 58, + CORJIT_FLAG_UNUSED30 = 59, + CORJIT_FLAG_UNUSED31 = 60, + CORJIT_FLAG_UNUSED32 = 61, + CORJIT_FLAG_UNUSED33 = 62, + CORJIT_FLAG_UNUSED34 = 63 }; CORJIT_FLAGS() diff --git a/src/coreclr/src/inc/corpriv.h b/src/coreclr/src/inc/corpriv.h index 52cf63a0ee07..fb0b39924cc8 100644 --- a/src/coreclr/src/inc/corpriv.h +++ b/src/coreclr/src/inc/corpriv.h @@ -235,7 +235,7 @@ typedef enum CorElementTypeZapSig // where the encoding/decoding takes place. ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG = 0x3d, - ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for [mscorlib]System.__Canon + ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for System.__Canon ELEMENT_TYPE_MODULE_ZAPSIG = 0x3f, // zapsig encoding for external module id# } CorElementTypeZapSig; diff --git a/src/coreclr/src/inc/crosscomp.h b/src/coreclr/src/inc/crosscomp.h index 5b6e932fd24f..e942db59e4a6 100644 --- a/src/coreclr/src/inc/crosscomp.h +++ b/src/coreclr/src/inc/crosscomp.h @@ -43,10 +43,12 @@ #define CONTEXT_UNWOUND_TO_CALL 0x20000000 +#if !defined(HOST_ARM64) typedef struct _NEON128 { ULONGLONG Low; LONGLONG High; } NEON128, *PNEON128; +#endif // !defined(HOST_ARM64) typedef struct DECLSPEC_ALIGN(8) _T_CONTEXT { // @@ -152,13 +154,14 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS { // // Define dynamic function table entry. // - +#if defined(HOST_X86) typedef PT_RUNTIME_FUNCTION (*PGET_RUNTIME_FUNCTION_CALLBACK) ( IN DWORD64 ControlPc, IN PVOID Context ); +#endif // defined(HOST_X86) typedef struct _T_DISPATCHER_CONTEXT { ULONG ControlPc; @@ -294,6 +297,17 @@ typedef struct _T_RUNTIME_FUNCTION { } T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION; +#ifdef HOST_UNIX + +typedef +EXCEPTION_DISPOSITION +(*PEXCEPTION_ROUTINE) ( + PEXCEPTION_RECORD ExceptionRecord, + ULONG64 EstablisherFrame, + PCONTEXT ContextRecord, + PVOID DispatcherContext + ); +#endif // // Define exception dispatch context structure. // @@ -345,6 +359,27 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS { } T_KNONVOLATILE_CONTEXT_POINTERS, *PT_KNONVOLATILE_CONTEXT_POINTERS; +#if defined(HOST_UNIX) && defined(TARGET_ARM64) && !defined(HOST_ARM64) +enum +{ + UNW_AARCH64_X19 = 19, + UNW_AARCH64_X20 = 20, + UNW_AARCH64_X21 = 21, + UNW_AARCH64_X22 = 22, + UNW_AARCH64_X23 = 23, + UNW_AARCH64_X24 = 24, + UNW_AARCH64_X25 = 25, + UNW_AARCH64_X26 = 26, + UNW_AARCH64_X27 = 27, + UNW_AARCH64_X28 = 28, + UNW_AARCH64_X29 = 29, + UNW_AARCH64_X30 = 30, + UNW_AARCH64_SP = 31, + UNW_AARCH64_PC = 32 +}; + +#endif // TARGET_ARM64 && !HOST_ARM64 + #else #define T_CONTEXT CONTEXT diff --git a/src/coreclr/src/inc/daccess.h b/src/coreclr/src/inc/daccess.h index 02aad3f7baff..b0269592c9ef 100644 --- a/src/coreclr/src/inc/daccess.h +++ b/src/coreclr/src/inc/daccess.h @@ -2464,7 +2464,7 @@ typedef DPTR(PTR_PCODE) PTR_PTR_PCODE; // We add a simple macro here which defines DAC_ALIGNAS to the C++11 alignas operator // This helps force the alignment of the next member // For most cross compilation cases the layout of types simply works -// There are a few cases (where this macro is helpful) which are not consistent accross platforms: +// There are a few cases (where this macro is helpful) which are not consistent across platforms: // - Base class whose size is padded to its align size. On Linux the gcc/clang // layouts will reuse this padding in the derived class for the first member // - Class with an vtable pointer and an alignment greater than the pointer size. diff --git a/src/coreclr/src/inc/dacvars.h b/src/coreclr/src/inc/dacvars.h index f480851e1b27..92f3edf77855 100644 --- a/src/coreclr/src/inc/dacvars.h +++ b/src/coreclr/src/inc/dacvars.h @@ -144,7 +144,7 @@ DEFINE_DACVAR(ULONG, PTR_GcNotification, dac__g_pGcNotificationTable, ::g_pGcNot DEFINE_DACVAR(ULONG, PTR_EEConfig, dac__g_pConfig, ::g_pConfig) -DEFINE_DACVAR(ULONG, MscorlibBinder, dac__g_Mscorlib, ::g_Mscorlib) +DEFINE_DACVAR(ULONG, CoreLibBinder, dac__g_CoreLib, ::g_CoreLib) #if defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA) DEFINE_DACVAR(ULONG, ProfControlBlock, dac__g_profControlBlock, ::g_profControlBlock) diff --git a/src/coreclr/src/inc/dbgconfigstrings.h b/src/coreclr/src/inc/dbgconfigstrings.h deleted file mode 100644 index 1c576c9d029b..000000000000 --- a/src/coreclr/src/inc/dbgconfigstrings.h +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -// This header lists the names of the string resources used by the Windows portion of Mac CoreCLR debugging -// configuration. It's designed to be included multiple times with different definitions of CORECLR_STRING_DEF -// to build either enumerated integer values for each key or a table mapping enum values to key names. -// - -CORECLR_STRING_DEF(CreateFile) -CORECLR_STRING_DEF(WriteFile) -CORECLR_STRING_DEF(CreateDir) -CORECLR_STRING_DEF(InternalError) -CORECLR_STRING_DEF(DecryptFailure) -CORECLR_STRING_DEF(OutOfMemory) -CORECLR_STRING_DEF(Success) -CORECLR_STRING_DEF(DialogTitleMain) -CORECLR_STRING_DEF(DialogTitleInfo) -CORECLR_STRING_DEF(DialogTitleError) -CORECLR_STRING_DEF(OKButton) -CORECLR_STRING_DEF(CancelButton) -CORECLR_STRING_DEF(HeaderText) diff --git a/src/coreclr/src/inc/delayloadhelpers.h b/src/coreclr/src/inc/delayloadhelpers.h deleted file mode 100644 index 160a9da30680..000000000000 --- a/src/coreclr/src/inc/delayloadhelpers.h +++ /dev/null @@ -1,112 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// Contains convenience functionality for lazily loading modules -// and getting entrypoints within them. -// - -#ifndef DelayLoadHelpers_h -#define DelayLoadHelpers_h - -#include "volatile.h" - -namespace DelayLoad -{ - //================================================================================================================= - // Contains information needed to load and cache a module. Use through - // the DELAY_LOADED_MODULE macro defined below. - struct Module - { - LPCWSTR const m_wzDllName; - HMODULE m_hMod; - HRESULT m_hr; - Volatile m_fInitialized; - - // Returns a non-ref-counted HMODULE; will load the module if necessary. - // Do not FreeLibrary the returned value. - HRESULT GetValue(HMODULE *pHMODULE); - }; -} - -//===================================================================================================================== -// Use at global scope to declare a delay loaded module represented as a -// DelayLoad::Module instance. The module may then be accessed as -// 'DelayLoad::Modules::DLL_NAME'. -// -// Parameters: -// DLL_NAME - the simple name (without extension) of the DLL. -// -// Example: -// DELAY_LOADED_MODULE(Kernel32); -// void Foo() { -// HMODULE hModKernel32 = nullptr; -// IfFailThrow(DelayLoad::Modules::Kernel32.GetValue(&hModKernel32)); -// // Use hModKernel32 as needed. Do not FreeLibrary the value! -// } - -#define DELAY_LOADED_MODULE(DLL_NAME) \ - namespace DelayLoad { \ - namespace Modules { \ - constexpr Module DLL_NAME = { L#DLL_NAME W(".dll"), nullptr, S_OK, false }; \ - } \ - } - -namespace DelayLoad -{ - //================================================================================================================= - // Contains information needed to load a function pointer from a DLL. Builds - // on the DelayLoad::Module functionality, and should be used through - // the DELAY_LOADED_FUNCTION macro defined below. - struct Function - { - Module * const m_pModule; - LPCSTR const m_szFunctionName; - PVOID m_pvFunction; - HRESULT m_hr; - Volatile m_fInitialized; - - // On success, ppvFunc is set to point to the entrypoint corresponding to - // m_szFunctionName as exported from m_pModule. - HRESULT GetValue(LPVOID * ppvFunc); - - // Convenience function that does the necessary casting for you. - template inline - HRESULT GetValue(FnT ** ppFunc) - { - return GetValue(reinterpret_cast(ppFunc)); - } - }; -} - -//===================================================================================================================== -// Use at global scope to declare a delay loaded function and its associated module, -// represented as DelayLoad::Function and DelayLoad::Module instances, respectively. -// The function may then be accessed as 'DelayLoad::DLL_NAME::FUNC_NAME', and the -// module may be access as described in DELAY_LOADED_MODULE's comment. -// -// Parameters: -// DLL_NAME - unquoted simple name (without extension) of the DLL containing -// the function. -// FUNC_NAME - unquoted entrypoint name exported from the DLL. -// -// Example: -// DELAY_LOADED_FUNCTION(MyDll, MyFunction); -// HRESULT Foo(...) { -// typedef HRESULT MyFunction_t(); -// MyFunction_t * pFunc = nullptr; -// IfFailRet(DelayLoad::WinTypes::RoResolveNamespace.GetValue(&pFunc)); -// return (*pFunc)(...); -// } - -#define DELAY_LOADED_FUNCTION(DLL_NAME, FUNC_NAME) \ - DELAY_LOADED_MODULE(DLL_NAME) \ - namespace DelayLoad { \ - namespace DLL_NAME { \ - constexpr Function FUNC_NAME = { &Modules::##DLL_NAME, #FUNC_NAME, nullptr, S_OK, false }; \ - } \ - } - -#endif // DelayLoadHelpers_h - diff --git a/src/coreclr/src/inc/eventtrace.h b/src/coreclr/src/inc/eventtrace.h index ef999a716c69..1a930deebfa3 100644 --- a/src/coreclr/src/inc/eventtrace.h +++ b/src/coreclr/src/inc/eventtrace.h @@ -172,6 +172,8 @@ namespace ETW static void Cleanup(); static VOID DeleteTypeHashNoLock(AllLoggedTypes **ppAllLoggedTypes); static VOID FlushObjectAllocationEvents(); + static UINT32 TypeLoadBegin(); + static VOID TypeLoadEnd(UINT32 typeLoad, TypeHandle th, UINT16 loadLevel); private: static BOOL ShouldLogType(TypeHandle th); diff --git a/src/coreclr/src/inc/eventtracebase.h b/src/coreclr/src/inc/eventtracebase.h index 771460b2db14..ab599a9ea5b9 100644 --- a/src/coreclr/src/inc/eventtracebase.h +++ b/src/coreclr/src/inc/eventtracebase.h @@ -918,21 +918,23 @@ namespace ETW static const UINT8 MethodFlagsJitOptimizationTierShift = 7; static const unsigned int MethodFlagsJitOptimizationTierLowMask = 0x7; + static VOID GetR2RGetEntryPointStart(MethodDesc *pMethodDesc); static VOID GetR2RGetEntryPoint(MethodDesc *pMethodDesc, PCODE pEntryPoint); static VOID MethodJitting(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature); static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature, PCODE pNativeCodeStartAddress, PrepareCodeConfig *pConfig); static VOID StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pHelperName); - static VOID StubsInitialized(PVOID *pHelperStartAddresss, PVOID *pHelperNames, LONG ulNoOfHelpers); + static VOID StubsInitialized(PVOID *pHelperStartAddress, PVOID *pHelperNames, LONG ulNoOfHelpers); static VOID MethodRestored(MethodDesc * pMethodDesc); static VOID MethodTableRestored(MethodTable * pMethodTable); static VOID DynamicMethodDestroyed(MethodDesc *pMethodDesc); #else // FEATURE_EVENT_TRACE public: + static VOID GetR2RGetEntryPointStart(MethodDesc *pMethodDesc) {}; static VOID GetR2RGetEntryPoint(MethodDesc *pMethodDesc, PCODE pEntryPoint) {}; static VOID MethodJitting(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature); static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature, PCODE pNativeCodeStartAddress, PrepareCodeConfig *pConfig); static VOID StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pHelperName) {}; - static VOID StubsInitialized(PVOID *pHelperStartAddresss, PVOID *pHelperNames, LONG ulNoOfHelpers) {}; + static VOID StubsInitialized(PVOID *pHelperStartAddress, PVOID *pHelperNames, LONG ulNoOfHelpers) {}; static VOID MethodRestored(MethodDesc * pMethodDesc) {}; static VOID MethodTableRestored(MethodTable * pMethodTable) {}; static VOID DynamicMethodDestroyed(MethodDesc *pMethodDesc) {}; diff --git a/src/coreclr/src/inc/gcdecoder.cpp b/src/coreclr/src/inc/gcdecoder.cpp index 765cd098aedf..3d929ec7e114 100644 --- a/src/coreclr/src/inc/gcdecoder.cpp +++ b/src/coreclr/src/inc/gcdecoder.cpp @@ -87,8 +87,10 @@ size_t FASTCALL decodeSigned(PTR_CBYTE src, int* val) /*****************************************************************************/ #if defined(_MSC_VER) +#ifdef HOST_X86 #pragma optimize("tgy", on) #endif +#endif PTR_CBYTE FASTCALL decodeHeader(PTR_CBYTE table, UINT32 version, InfoHdr* header) { @@ -316,7 +318,7 @@ const InfoHdrSmall infoHdrShortcut[128] = { // | | | | | | | | | | | | | | | | | | | returnKind // | | | | | | | | | | | | | | | | | | | | // | | | | | | | | | | | | | | | | | | | | Arg count -// | | | | | | | | | | | | | | | | | | | | | Counted occurences +// | | | | | | | | | | | | | | | | | | | | | Counted occurrences // | | | | | | | | | | | | | | | | | | | | | Frame size | // | | | | | | | | | | | | | | | | | | | | | | | // | | | | | | | | | | | | | | | | | | | | | | untrackedCnt | Header encoding @@ -529,7 +531,7 @@ const unsigned callCommonDelta[4] = { 6,8,10,12 }; * EDI = 0x1, ESI = 0x2, EBX = 0x4, EBP = 0x8 * */ -const unsigned callPatternTable[80] = { // # of occurences +const unsigned callPatternTable[80] = { // # of occurrences 0x0a000200, // 30109 0x0c000200, // 22970 0x0c000201, // 19005 diff --git a/src/coreclr/src/inc/gcdump.h b/src/coreclr/src/inc/gcdump.h index 49bc61e5bff2..7c7f559a5ac9 100644 --- a/src/coreclr/src/inc/gcdump.h +++ b/src/coreclr/src/inc/gcdump.h @@ -44,10 +44,10 @@ class GCDump * Return value : Size in bytes of the header encoding */ - unsigned FASTCALL DumpInfoHdr (PTR_CBYTE gcInfoBlock, - InfoHdr * header, /* OUT */ - unsigned * methodSize, /* OUT */ - bool verifyGCTables = false); + size_t FASTCALL DumpInfoHdr (PTR_CBYTE gcInfoBlock, + InfoHdr * header, /* OUT */ + unsigned * methodSize, /* OUT */ + bool verifyGCTables = false); #endif /*------------------------------------------------------------------------- @@ -90,7 +90,7 @@ class GCDump /* Helper methods */ PTR_CBYTE DumpEncoding(PTR_CBYTE gcInfoBlock, - int cDumpBytes); + size_t cDumpBytes); void DumpOffset (unsigned o); void DumpOffsetEx(unsigned o); diff --git a/src/coreclr/src/inc/gcinfodecoder.h b/src/coreclr/src/inc/gcinfodecoder.h index 3eeeb005b1bd..576b5201623d 100644 --- a/src/coreclr/src/inc/gcinfodecoder.h +++ b/src/coreclr/src/inc/gcinfodecoder.h @@ -42,8 +42,6 @@ typedef ArrayDPTR(const uint8_t) PTR_CBYTE; #define VALIDATE_ROOT(isInterior, hCallBack, pObjRef) -#define _ASSERTE(x) assert(x) - #define UINT32 UInt32 #define INT32 Int32 #define UINT16 UInt16 @@ -56,6 +54,18 @@ typedef void * OBJECTREF; #define GET_CALLER_SP(pREGDISPLAY) ((TADDR)0) +struct GCInfoToken +{ + PTR_VOID Info; + UINT32 Version; + + GCInfoToken(PTR_VOID info) + { + Info = info; + Version = 2; + } +}; + #else // FEATURE_REDHAWK // Stuff from cgencpu.h: diff --git a/src/coreclr/src/inc/gcinfoencoder.h b/src/coreclr/src/inc/gcinfoencoder.h index c914b71452d4..559a211d8eeb 100644 --- a/src/coreclr/src/inc/gcinfoencoder.h +++ b/src/coreclr/src/inc/gcinfoencoder.h @@ -468,8 +468,8 @@ class GcInfoEncoder private: - friend int __cdecl CompareLifetimeTransitionsByOffsetThenSlot(const void*, const void*); - friend int CompareLifetimeTransitionsByChunk(const void*, const void*); + friend struct CompareLifetimeTransitionsByOffsetThenSlot; + friend struct CompareLifetimeTransitionsByChunk; struct InterruptibleRange diff --git a/src/coreclr/src/inc/holder.h b/src/coreclr/src/inc/holder.h index b0d7351ae707..20f6aeb96461 100644 --- a/src/coreclr/src/inc/holder.h +++ b/src/coreclr/src/inc/holder.h @@ -115,6 +115,8 @@ struct AutoExpVisibleValue template class HolderBase { + friend class ClrDataAccess; + protected: TYPE m_value; @@ -227,6 +229,7 @@ template > class BaseHolder : protected BASE { + friend class ClrDataAccess; protected: BOOL m_acquired; // Have we acquired the resource? @@ -695,6 +698,7 @@ FORCEINLINE void SafeArrayDoNothing(SAFEARRAY* p) template class FunctionBase : protected HolderBase { + friend class ClrDataAccess; protected: FORCEINLINE FunctionBase(TYPE value) diff --git a/src/coreclr/src/inc/loaderheap.h b/src/coreclr/src/inc/loaderheap.h index 8008a3a829b8..68d50f6d637d 100644 --- a/src/coreclr/src/inc/loaderheap.h +++ b/src/coreclr/src/inc/loaderheap.h @@ -549,6 +549,9 @@ class LoaderHeap : public UnlockedLoaderHeap, public ILoaderHeapBackout { WRAPPER_NO_CONTRACT; +#if defined(HOST_OSX) && defined(HOST_ARM64) + auto jitWriteEnableHolder = PAL_JITWriteEnable(true); +#endif // defined(HOST_OSX) && defined(HOST_ARM64) void *pResult; TaggedMemAllocPtr tmap; @@ -568,6 +571,7 @@ class LoaderHeap : public UnlockedLoaderHeap, public ILoaderHeapBackout tmap.m_szFile = szFile; tmap.m_lineNum = lineNum; #endif + return tmap; } @@ -625,6 +629,10 @@ class LoaderHeap : public UnlockedLoaderHeap, public ILoaderHeapBackout { WRAPPER_NO_CONTRACT; +#if defined(HOST_OSX) && defined(HOST_ARM64) + auto jitWriteEnableHolder = PAL_JITWriteEnable(true); +#endif // defined(HOST_OSX) && defined(HOST_ARM64) + CRITSEC_Holder csh(m_CriticalSection); diff --git a/src/coreclr/src/inc/longfilepathwrappers.h b/src/coreclr/src/inc/longfilepathwrappers.h index c4c7700d704b..76aec1a86594 100644 --- a/src/coreclr/src/inc/longfilepathwrappers.h +++ b/src/coreclr/src/inc/longfilepathwrappers.h @@ -49,7 +49,7 @@ FindFirstFileExWrapper( _In_ DWORD dwAdditionalFlags ); -#ifndef TARGET_UNIX +#ifndef HOST_UNIX BOOL CopyFileExWrapper( _In_ LPCWSTR lpExistingFileName, @@ -60,7 +60,7 @@ CopyFileExWrapper( _Inout_opt_ LPBOOL pbCancel, _In_ DWORD dwCopyFlags ); -#endif //TARGET_UNIX +#endif //HOST_UNIX BOOL MoveFileExWrapper( diff --git a/src/coreclr/src/inc/palclr_win.h b/src/coreclr/src/inc/palclr_win.h index be0b725e1a68..a9ee78e32f42 100644 --- a/src/coreclr/src/inc/palclr_win.h +++ b/src/coreclr/src/inc/palclr_win.h @@ -140,4 +140,8 @@ typedef HMODULE NATIVE_LIBRARY_HANDLE; #endif // HOST_WINDOWS +#ifndef FALLTHROUGH +#define FALLTHROUGH __fallthrough +#endif // FALLTHROUGH + #endif // __PALCLR_WIN_H__ diff --git a/src/coreclr/src/inc/random.h b/src/coreclr/src/inc/random.h index 53cc17d64908..f2501c356832 100644 --- a/src/coreclr/src/inc/random.h +++ b/src/coreclr/src/inc/random.h @@ -5,8 +5,7 @@ // // -// Defines a random number generator, initially from the System.Random code in the BCL. If you notice any problems, -// please compare to the implementation in src\mscorlib\src\system\random.cs. +// Defines a random number generator, initially from the System.Random code in the BCL. // // Main advantages over rand() are: // diff --git a/src/coreclr/src/inc/rangetree.h b/src/coreclr/src/inc/rangetree.h deleted file mode 100644 index 85a2d5ebad6b..000000000000 --- a/src/coreclr/src/inc/rangetree.h +++ /dev/null @@ -1,140 +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 _RANGETREE_ -#define _RANGETREE_ - -#include "utilcode.h" -#include "memorypool.h" - -// -// A RangeTree is a self-balancing binary tree of non-overlapping -// ranges [start-end), which provides log N operation time for -// lookup, insertion, and deletion of nodes. -// -// The tree is always balanced in the sense that the left and right -// sides of a node have the same amount of address space allocated to -// them - (for worst case data, the nodes of the tree might actually -// not be balanced). -// -// This address-space balancing means that if all the ranges cover a -// contiguous range of memory, and if lookup occur uniformly throughout -// the overall range covered, the tree provides optimal lookup -// structure. -// -// Another interesting property is that the same set of -// ranges always produces the same tree layout, regardless of -// the order the nodes are added in. -// -// Each node represents a range of the address space (in binary) -// from m0...0 to m1...1, where m is any number of 31 bits or -// less. -// -// Each node has 3 components: -// * a range -// * a 0-child, -// * a 1-child -// -// The range is the numeric range [start,end), -// represented by the node. A range is always assigned to the -// widest possible node (i.e. most bits in m) possible. Thus the -// bits of start and end share the same prefix string m, and -// differ in the next bit after m: the start bound will have a 0 -// and the end bound will have a 1 in that position. -// -// Note that any other range which is represented by the same node -// must necessarily intersect the node. Thus, if no overlaps are -// possible, each node can only contain a single range. (To help -// see why this must be, it helps to realize that the node -// represents the transition from m01...1 to m10...0, which any -// range represented by this node must contain.) -// -// All range nodes represented by the form m0... are contained in -// the 0-child subtree, and all nodes represented by the form -// m1... are contained in the 1-child subtree. Either child can -// of course be null. -// - -class RangeTree -{ - public: - - // - // Imbed the RangeTreeNode structure in your data structure - // in order to place it into a RangeTree. - // - - struct Node - { - friend class RangeTree; - - private: - // start & end (exclusive) of range - SIZE_T start; - SIZE_T end; - // mask of high-order bits which are the same in start & end - SIZE_T mask; - // We could steal a bit from mask or children[] for isIntermediate - BOOL isIntermediate; -#ifdef _DEBUG - // ordinal of when this node was created - DWORD ordinal; -#endif - - Node *children[2]; - - void Init (SIZE_T rangeStart, SIZE_T rangeEnd - DEBUGARG(DWORD ord)); - - Node** Child(SIZE_T address) - { - LIMITED_METHOD_CONTRACT; - - return &children[ ! ! (address & ((~mask>>1)+1))]; - } - - public: - BOOL IsIntermediate() { return isIntermediate; } - void IsIntermediate(BOOL value) { isIntermediate = value; } - SIZE_T GetStart() { return start; } - SIZE_T GetEnd() { return end; } - }; - - friend struct Node; - - RangeTree(); - - Node *Lookup(SIZE_T address) const; - Node *LookupEndInclusive(SIZE_T nonStartingAddress); - BOOL Overlaps(SIZE_T start, SIZE_T end); - HRESULT AddNode(Node *addNode, SIZE_T start, SIZE_T end); - HRESULT RemoveNode(Node *removeNode); - void RemoveRange(SIZE_T start, SIZE_T end); - - typedef void (*IterationCallback)(Node *next, void *context); - - void Iterate(IterationCallback pCallback, void *context = NULL); - void IterateRange(SIZE_T start, SIZE_T end, IterationCallback pCallback, void *context = NULL); - - private: - - Node * m_root; - MemoryPool m_pool; -#ifdef _DEBUG - DWORD m_nodeCount; -#endif - - Node *AddIntermediateNode(Node *node0, Node *node1); - Node *AllocateIntermediate(); - void FreeIntermediate(Node *node); - - void IterateNode(Node *node, IterationCallback pCallback, void *context); - void IterateRangeNode(Node *node, SIZE_T start, SIZE_T end, SIZE_T mask, IterationCallback pCallback, void *context); - BOOL OverlapsNode(Node *node, SIZE_T start, SIZE_T end, SIZE_T mask); - void RemoveRangeNode(Node **nodePtr, SIZE_T start, SIZE_T end, SIZE_T mask); - - static SIZE_T GetRangeCommonMask(SIZE_T start, SIZE_T end); -}; - -#endif // _RANGETREE_ diff --git a/src/coreclr/src/inc/readme.md b/src/coreclr/src/inc/readme.md index 1e7754ea5e07..e8f3405859e0 100644 --- a/src/coreclr/src/inc/readme.md +++ b/src/coreclr/src/inc/readme.md @@ -9,4 +9,4 @@ for midl.exe which did that conversion so we work around the issue by doing: - If needed, adjust any of the .cpp files in src\pal\prebuilt\idl\ by hand, using the corresponding artifacts\obj\Windows_NT.x64.Debug\src\inc\idls_out\*_i.c as a guide. Typically this is just adding MIDL_DEFINE_GUID(...) for any new classes/interfaces that have been added to the idl file. -Include these src changes with the remainder of your work when you submit a PR. \ No newline at end of file +Include these src changes with the remainder of your work when you submit a PR. diff --git a/src/coreclr/src/inc/readytorun.h b/src/coreclr/src/inc/readytorun.h index b883f4b558e9..9f79c89f81f6 100644 --- a/src/coreclr/src/inc/readytorun.h +++ b/src/coreclr/src/inc/readytorun.h @@ -14,9 +14,12 @@ #define READYTORUN_SIGNATURE 0x00525452 // 'RTR' +// Keep these in sync with src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs #define READYTORUN_MAJOR_VERSION 0x0004 -#define READYTORUN_MINOR_VERSION 0x0001 +#define READYTORUN_MINOR_VERSION 0x0002 + #define MINIMUM_READYTORUN_MAJOR_VERSION 0x003 + // R2R Version 2.1 adds the InliningInfo section // R2R Version 2.2 adds the ProfileDataInfo section // R2R Version 3.0 changes calling conventions to correctly handle explicit structures to spec. @@ -395,4 +398,13 @@ enum ReadyToRunRuntimeConstants : DWORD READYTORUN_ReversePInvokeTransitionFrameSizeInPointerUnits = 2 }; +enum ReadyToRunHFAElemType : DWORD +{ + READYTORUN_HFA_ELEMTYPE_None = 0, + READYTORUN_HFA_ELEMTYPE_Float32 = 1, + READYTORUN_HFA_ELEMTYPE_Float64 = 2, + READYTORUN_HFA_ELEMTYPE_Vector64 = 3, + READYTORUN_HFA_ELEMTYPE_Vector128 = 4, +}; + #endif // __READYTORUN_H__ diff --git a/src/coreclr/src/inc/readytorunhelpers.h b/src/coreclr/src/inc/readytorunhelpers.h index 8c6e537def01..465b603ad186 100644 --- a/src/coreclr/src/inc/readytorunhelpers.h +++ b/src/coreclr/src/inc/readytorunhelpers.h @@ -119,7 +119,7 @@ HELPER(READYTORUN_HELPER_ReversePInvokeExit, CORINFO_HELP_JIT_REVERSE_PIN HELPER(READYTORUN_HELPER_MonitorEnter, CORINFO_HELP_MON_ENTER, ) HELPER(READYTORUN_HELPER_MonitorExit, CORINFO_HELP_MON_EXIT, ) -#if defined(TARGET_X86) || defined(TARGET_AMD64) +#ifndef TARGET_ARM64 HELPER(READYTORUN_HELPER_StackProbe, CORINFO_HELP_STACK_PROBE, ) #endif diff --git a/src/coreclr/src/inc/regex_base.h b/src/coreclr/src/inc/regex_base.h index 49384541d66a..3afa5398be2d 100644 --- a/src/coreclr/src/inc/regex_base.h +++ b/src/coreclr/src/inc/regex_base.h @@ -550,7 +550,7 @@ class NullGroupContainer // *? matches zero or more occurrences of the previous item conservatively // + matches 1 or more occurrences of the previous item eagerly // +? matches 1 or more occurrences of the previous item conservatively -// ? matches 0 or 1 occurences of the previous item +// ? matches 0 or 1 occurrences of the previous item // ( starts a grouping // ) ends a grouping // diff --git a/src/coreclr/src/inc/safemath.h b/src/coreclr/src/inc/safemath.h index 84ea377c54b8..d93e4a57011e 100644 --- a/src/coreclr/src/inc/safemath.h +++ b/src/coreclr/src/inc/safemath.h @@ -154,8 +154,7 @@ inline bool DoubleFitsInIntType(double val) //----------------------------------------------------------------------------- // -// Liberally lifted from the Office example on MSDN and modified. -// http://msdn.microsoft.com/library/en-us/dncode/html/secure01142004.asp +// Liberally lifted from https://github.com/dcleblanc/SafeInt and modified. // // Modified to track an overflow bit instead of throwing exceptions. In most // cases the Visual C++ optimizer (Whidbey beta1 - v14.00.40607) is able to diff --git a/src/coreclr/src/inc/shim/locationinfo.h b/src/coreclr/src/inc/shim/locationinfo.h deleted file mode 100644 index e4f1a0d5558b..000000000000 --- a/src/coreclr/src/inc/shim/locationinfo.h +++ /dev/null @@ -1,41 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -// locationinfo.h -// -// Enum describing different types of locations for coreCLR -// -// Note: must be platform independent -// -// ====================================================================================== - - -#ifndef LOCATIONINFO_H -#define LOCATIONINFO_H - - -// in order of preference, smaller is better -enum LocationInfo -{ - Loc_System=1, - Loc_Machine=2, - Loc_User=3, - Loc_Network=4, - Loc_Undefined =0xffff -}; - -// Returns the more preferred of two locations -// -// Assumptions: LocationInfo is defined in a manner that a smaller value is better -// -// Input: -// locations to compare -// -// Output: -// the preferred location -inline LocationInfo BetterLocation(LocationInfo l1, LocationInfo l2) -{ - return l1 version.Major()) - return 1; - if (Major() < version.Major()) - return -1; - if (Minor() > version.Minor()) - return 1; - if (Minor() < version.Minor()) - return -1; - if (Build() > version.Build()) - return 1; - if (Build() < version.Build()) - return -1; - if (Revision() > version.Revision()) - return 1; - if (Revision() < version.Revision()) - return -1; - return 0; -} - - -// Parses the given string into VersionInfo -// -// Input: -// szString - the string to parse, "x.x.x.x" -// -// Output: -// return value: count of fields parsed (<=4) or -1 if an error -inline int VersionInfo::Parse(LPCTSTR szString, VersionInfo* result) -{ - // sscanf is nice but we need an exact format match and no 0s - size_t iLen = _tcslen(szString); - - unsigned short wVersion[4] = {0}; - int iVerIdx = 0; - unsigned int dwCurrentValue = 0; - bool bFirstChar = true; - - for (size_t i=0; i<= iLen; i++) - { - if(szString[i] == _T('\0')) - { - if(!bFirstChar) - wVersion[iVerIdx++] = (unsigned short)(dwCurrentValue & 0xffff); - break; - } - else - if (szString[i] == _T('.') ) - { - if(bFirstChar) - return -1; - - // fill in - wVersion[iVerIdx++] = (unsigned short)(dwCurrentValue & 0xffff); - - //check for extra characters - if (iVerIdx > sizeof(wVersion)/sizeof(wVersion[0])) - { - if (szString[i+1] == _T('\0')) - break; - else - return -1; - } - - //reset - dwCurrentValue=0; - bFirstChar=true; - continue; - } - else - if (szString[i] < _T('0')) - { - return -1; - } - else - if (szString[i] > _T('9')) - { - return -1; - } - else - if (szString[i] == _T('0') && bFirstChar && szString[i+1]!= _T('.') && szString[i+1]!= _T('\0') ) - { - return -1; - } - - // the character is a digit - dwCurrentValue=dwCurrentValue*10+szString[i]-_T('0'); - if(dwCurrentValue > 0xffff) - return -1; - - bFirstChar=false; - - } - - //successfully parsed - *result = VersionInfo(wVersion[0], wVersion[1], wVersion[2], wVersion[3]); - return iVerIdx; - -} - diff --git a/src/coreclr/src/inc/simplerhash.inl b/src/coreclr/src/inc/simplerhash.inl index 309778e91791..6694ab61212b 100644 --- a/src/coreclr/src/inc/simplerhash.inl +++ b/src/coreclr/src/inc/simplerhash.inl @@ -303,36 +303,7 @@ void SimplerHashTable::Reallocate(unsigned newTable // 32-bit magic numbers, (because the algorithm for using 33-bit magic numbers is slightly slower). // -constexpr PrimeInfo primeInfo[] = -{ - PrimeInfo(9, 0x38e38e39, 1), - PrimeInfo(23, 0xb21642c9, 4), - PrimeInfo(59, 0x22b63cbf, 3), - PrimeInfo(131, 0xfa232cf3, 7), - PrimeInfo(239, 0x891ac73b, 7), - PrimeInfo(433, 0x975a751, 4), - PrimeInfo(761, 0x561e46a5, 8), - PrimeInfo(1399, 0xbb612aa3, 10), - PrimeInfo(2473, 0x6a009f01, 10), - PrimeInfo(4327, 0xf2555049, 12), - PrimeInfo(7499, 0x45ea155f, 11), - PrimeInfo(12973, 0x1434f6d3, 10), - PrimeInfo(22433, 0x2ebe18db, 12), - PrimeInfo(46559, 0xb42bebd5, 15), - PrimeInfo(96581, 0xadb61b1b, 16), - PrimeInfo(200341, 0x29df2461, 15), - PrimeInfo(415517, 0xa181c46d, 18), - PrimeInfo(861719, 0x4de0bde5, 18), - PrimeInfo(1787021, 0x9636c46f, 20), - PrimeInfo(3705617, 0x4870adc1, 20), - PrimeInfo(7684087, 0x8bbc5b83, 22), - PrimeInfo(15933877, 0x86c65361, 23), - PrimeInfo(33040633, 0x40fec79b, 23), - PrimeInfo(68513161, 0x7d605cd1, 25), - PrimeInfo(142069021, 0xf1da390b, 27), - PrimeInfo(294594427, 0x74a2507d, 27), - PrimeInfo(733045421, 0x5dbec447, 28), -}; +extern const PrimeInfo primeInfo[27]; template PrimeInfo SimplerHashTable::NextPrime(unsigned number) diff --git a/src/coreclr/src/inc/sospriv.idl b/src/coreclr/src/inc/sospriv.idl index 770d5b56f749..dae0a4ff5208 100644 --- a/src/coreclr/src/inc/sospriv.idl +++ b/src/coreclr/src/inc/sospriv.idl @@ -424,3 +424,17 @@ interface ISOSDacInterface9 : IUnknown { HRESULT GetBreakingChangeVersion(int* pVersion); } + +[ + object, + local, + uuid(90B8FCC3-7251-4B0A-AE3D-5C13A67EC9AA) +] +interface ISOSDacInterface10 : IUnknown +{ + HRESULT GetObjectComWrappersData(CLRDATA_ADDRESS objAddr, CLRDATA_ADDRESS *rcw, unsigned int count, CLRDATA_ADDRESS *mowList, unsigned int *pNeeded); + HRESULT IsComWrappersCCW(CLRDATA_ADDRESS ccw, BOOL *isComWrappersCCW); + HRESULT GetComWrappersCCWData(CLRDATA_ADDRESS ccw, CLRDATA_ADDRESS *managedObject, int *refCount); + HRESULT IsComWrappersRCW(CLRDATA_ADDRESS rcw, BOOL *isComWrappersRCW); + HRESULT GetComWrappersRCWData(CLRDATA_ADDRESS rcw, CLRDATA_ADDRESS *identity); +} diff --git a/src/coreclr/src/inc/sstring.h b/src/coreclr/src/inc/sstring.h index 6f041658b8bf..99a521923957 100644 --- a/src/coreclr/src/inc/sstring.h +++ b/src/coreclr/src/inc/sstring.h @@ -257,7 +257,7 @@ class EMPTY_BASES_DECL SString : private SBuffer // Start searching for a match of the given string, starting at // the given iterator point. // If a match exists, move the iterator to point to the nearest - // occurence of s in the string and return TRUE. + // occurrence of s in the string and return TRUE. // If no match exists, return FALSE and leave the iterator unchanged. BOOL Find(CIterator &i, const SString &s) const; BOOL Find(CIterator &i, const WCHAR *s) const; diff --git a/src/coreclr/src/inc/stacktrace.h b/src/coreclr/src/inc/stacktrace.h index 65f4d4cc481f..445937308e19 100644 --- a/src/coreclr/src/inc/stacktrace.h +++ b/src/coreclr/src/inc/stacktrace.h @@ -73,7 +73,7 @@ void GetStringFromStackLevels(UINT ifrStart, UINT cfrTotal, __out_ecount(cchMaxA ******************************************************************** robch */ void GetStringFromAddr(DWORD_PTR dwAddr, __out_ecount(cchMaxAssertStackLevelStringLen) LPSTR szString); -#if defined(TARGET_X86) && !defined(TARGET_UNIX) +#if defined(HOST_X86) && !defined(TARGET_UNIX) /**************************************************************************** * ClrCaptureContext * *-------------------* @@ -82,9 +82,9 @@ void GetStringFromAddr(DWORD_PTR dwAddr, __out_ecount(cchMaxAssertStackLevelStri * support this, so we need it for CoreCLR 4, if we require Win2K support ****************************************************************************/ extern "C" void __stdcall ClrCaptureContext(__out PCONTEXT ctx); -#else // TARGET_X86 && !TARGET_UNIX +#else // HOST_X86 && !TARGET_UNIX #define ClrCaptureContext RtlCaptureContext -#endif // TARGET_X86 && !TARGET_UNIX +#endif // HOST_X86 && !TARGET_UNIX #endif diff --git a/src/coreclr/src/inc/switches.h b/src/coreclr/src/inc/switches.h index c334512e9572..f22f3e2d4503 100644 --- a/src/coreclr/src/inc/switches.h +++ b/src/coreclr/src/inc/switches.h @@ -81,9 +81,6 @@ #define ALLOW_SXS_JIT #define ALLOW_SXS_JIT_NGEN -//master switch for gc suspension not based on hijacking -#define FEATURE_ENABLE_GCPOLL - #if !defined(TARGET_UNIX) // PLATFORM_SUPPORTS_THREADSUSPEND is defined for platforms where it is safe to call // SuspendThread. This API is dangerous on non-Windows platforms, as it can lead to diff --git a/src/coreclr/src/inc/utilcode.h b/src/coreclr/src/inc/utilcode.h index f411acb7e66a..56bbd0dd2bac 100644 --- a/src/coreclr/src/inc/utilcode.h +++ b/src/coreclr/src/inc/utilcode.h @@ -746,6 +746,8 @@ class CCompRC } private: +// String resouces packaged as PE files only exist on Windows +#ifdef HOST_WINDOWS HRESULT GetLibrary(LocaleID langId, HRESOURCEDLL* phInst); #ifndef DACCESS_COMPILE HRESULT LoadLibraryHelper(HRESOURCEDLL *pHInst, @@ -753,7 +755,8 @@ class CCompRC HRESULT LoadLibraryThrows(HRESOURCEDLL * pHInst); HRESULT LoadLibrary(HRESOURCEDLL * pHInst); HRESULT LoadResourceFile(HRESOURCEDLL * pHInst, LPCWSTR lpFileName); -#endif +#endif // DACCESS_COMPILE +#endif // HOST_WINDOWS // We do not have global constructors any more static LONG m_dwDefaultInitialized; @@ -1272,6 +1275,7 @@ class CPUGroupInfo static WORD m_nProcessors; static BOOL m_enableGCCPUGroups; static BOOL m_threadUseAllCpuGroups; + static BOOL m_threadAssignCpuGroups; static WORD m_initialGroup; static CPU_Group_Info *m_CPUGroupInfoArray; static bool s_hadSingleProcessorAtStartup; @@ -1285,6 +1289,7 @@ class CPUGroupInfo static void EnsureInitialized(); static BOOL CanEnableGCCPUGroups(); static BOOL CanEnableThreadUseAllCpuGroups(); + static BOOL CanAssignCpuGroupsToThreads(); static WORD GetNumActiveProcessors(); static void GetGroupForProcessor(WORD processor_number, WORD *group_number, WORD *group_processor_number); @@ -4071,13 +4076,14 @@ HRESULT GetImageRuntimeVersionString(PVOID pMetaData, LPCSTR* pString); // The registry keys and values that contain the information regarding // the default registered unmanaged debugger. //***************************************************************************** -constexpr WCHAR kDebugApplicationsPoliciesKey[] = W("SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Error Reporting\\DebugApplications"); -constexpr WCHAR kDebugApplicationsKey[] = W("SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\DebugApplications"); -constexpr WCHAR kUnmanagedDebuggerKey[] = W("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug"); -constexpr WCHAR kUnmanagedDebuggerValue[] = W("Debugger"); -constexpr WCHAR kUnmanagedDebuggerAutoValue[] = W("Auto"); -constexpr WCHAR kUnmanagedDebuggerAutoExclusionListKey[] = W("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug\\AutoExclusionList"); +#define kDebugApplicationsPoliciesKey W("SOFTWARE\\Policies\\Microsoft\\Windows\\Windows Error Reporting\\DebugApplications") +#define kDebugApplicationsKey W("SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\DebugApplications") + +#define kUnmanagedDebuggerKey W("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug") +#define kUnmanagedDebuggerValue W("Debugger") +#define kUnmanagedDebuggerAutoValue W("Auto") +#define kUnmanagedDebuggerAutoExclusionListKey W("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug\\AutoExclusionList") BOOL GetRegistryLongValue(HKEY hKeyParent, // Parent key. LPCWSTR szKey, // Key name to look at. diff --git a/src/coreclr/src/inc/winwrap.h b/src/coreclr/src/inc/winwrap.h index 69dc19a5d413..1ece44791b44 100644 --- a/src/coreclr/src/inc/winwrap.h +++ b/src/coreclr/src/inc/winwrap.h @@ -179,7 +179,6 @@ #define WszRegQueryValueExTrue RegQueryValueExW #define WszRegQueryStringValueEx RegQueryValueExW - #define WszRegQueryInfoKey RegQueryInfoKeyW #define WszRegEnumValue RegEnumValueW #define WszRegEnumKeyEx RegEnumKeyExW @@ -189,16 +188,11 @@ #define WszLCMapString LCMapStringW #define WszMultiByteToWideChar MultiByteToWideChar #define WszWideCharToMultiByte WideCharToMultiByte -#define WszCreateSemaphore CreateSemaphoreW - +#define WszCreateSemaphore(_secattr, _count, _maxcount, _name) CreateSemaphoreExW((_secattr), (_count), (_maxcount), (_name), 0, MAXIMUM_ALLOWED | SYNCHRONIZE | SEMAPHORE_MODIFY_STATE) #ifdef FEATURE_CORESYSTEM -// CoreSystem has CreateSemaphoreExW but not CreateSemaphoreW. -#undef WszCreateSemaphore -#define WszCreateSemaphore(_secattr, _count, _maxcount, _name) CreateSemaphoreExW((_secattr), (_count), (_maxcount), (_name), 0, MAXIMUM_ALLOWED | SYNCHRONIZE | SEMAPHORE_MODIFY_STATE) - -// Same deal as above for GetFileVersionInfo/GetFileVersionInfoSize. +// CoreSystem has GetFileVersionInfo{Size}Ex but not GetFileVersionInfoSize{Size} #undef GetFileVersionInfo #define GetFileVersionInfo(_filename, _handle, _len, _data) GetFileVersionInfoEx(0, (_filename), (_handle), (_len), (_data)) #undef GetFileVersionInfoSize diff --git a/src/coreclr/src/inc/zapper.h b/src/coreclr/src/inc/zapper.h index ba4f65b15dd9..b88d4d51b676 100644 --- a/src/coreclr/src/inc/zapper.h +++ b/src/coreclr/src/inc/zapper.h @@ -285,7 +285,7 @@ class Zapper ~Zapper(); - // The arguments control which native image of mscorlib to use. + // The arguments control which native image of CoreLib to use. // This matters for hardbinding. void InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument); void LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJit, OUT ICorJitCompiler** ppICorJitCompiler); diff --git a/src/coreclr/src/interop/CMakeLists.txt b/src/coreclr/src/interop/CMakeLists.txt index b8a0e769318d..1642f55a04da 100644 --- a/src/coreclr/src/interop/CMakeLists.txt +++ b/src/coreclr/src/interop/CMakeLists.txt @@ -30,7 +30,10 @@ endif(WIN32) convert_to_absolute_path(INTEROP_SOURCES ${INTEROP_SOURCES}) -add_library_clr(interop +add_library_clr(interop_obj OBJECT ${INTEROP_SOURCES} ) + +add_library(interop INTERFACE) +target_sources(interop INTERFACE $) \ No newline at end of file diff --git a/src/coreclr/src/interop/comwrappers.hpp b/src/coreclr/src/interop/comwrappers.hpp index 8535bd9f18e9..3ae91d8a88c7 100644 --- a/src/coreclr/src/interop/comwrappers.hpp +++ b/src/coreclr/src/interop/comwrappers.hpp @@ -34,6 +34,7 @@ namespace ABI // Class for wrapping a managed object and projecting it in a non-managed environment class ManagedObjectWrapper { + friend constexpr size_t RefCountOffset(); public: Volatile Target; @@ -118,6 +119,18 @@ class ManagedObjectWrapper ULONG Release(void); }; +// The Target and _refCount fields are used by the DAC, any changes to the layout must be updated on the DAC side (request.cpp) +static constexpr size_t DACTargetOffset = 0; +static_assert(offsetof(ManagedObjectWrapper, Target) == DACTargetOffset, "Keep in sync with DAC interfaces"); +static constexpr size_t DACRefCountOffset = (4 * sizeof(intptr_t)) + (2 * sizeof(int32_t)); +static constexpr size_t RefCountOffset() +{ + // _refCount is a private field and offsetof won't let you look at private fields. To overcome + // this RefCountOffset() is a friend function. + return offsetof(ManagedObjectWrapper, _refCount); +} +static_assert(RefCountOffset() == DACRefCountOffset, "Keep in sync with DAC interfaces"); + // ABI contract. This below offset is assumed in managed code. ABI_ASSERT(offsetof(ManagedObjectWrapper, Target) == 0); diff --git a/src/coreclr/src/jit/CMakeLists.txt b/src/coreclr/src/jit/CMakeLists.txt index 15aa4d59b63c..33057b1004f2 100644 --- a/src/coreclr/src/jit/CMakeLists.txt +++ b/src/coreclr/src/jit/CMakeLists.txt @@ -10,9 +10,55 @@ endif() add_compile_options($<$:-W4>) +function(create_standalone_jit) + + set(oneValueArgs TARGET OS ARCH) + set(multiValueArgs ADDITIONAL_DESTINATIONS) + set(options NOALTJIT) + cmake_parse_arguments(TARGETDETAILS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + set(JIT_ARCH_LINK_LIBRARIES gcinfo_${TARGETDETAILS_OS}_${TARGETDETAILS_ARCH}) + + if(TARGETDETAILS_ARCH STREQUAL "x64") + set(JIT_ARCH_SOURCES ${JIT_AMD64_SOURCES}) + elseif(TARGETDETAILS_ARCH STREQUAL "arm") + set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES}) + elseif(TARGETDETAILS_ARCH STREQUAL "x86") + set(JIT_ARCH_SOURCES ${JIT_I386_SOURCES}) + elseif(TARGETDETAILS_ARCH STREQUAL "arm64") + set(JIT_ARCH_SOURCES ${JIT_ARM64_SOURCES}) + else() + clr_unknown_arch() + endif() + + if (TARGETDETAILS_ADDITIONAL_DESTINATIONS STREQUAL "") + add_jit(${TARGETDETAILS_TARGET}) + else() + add_jit(${TARGETDETAILS_TARGET} ADDITIONAL_DESTINATIONS "${TARGETDETAILS_ADDITIONAL_DESTINATIONS}") + endif() + + set_target_definitions_to_custom_os_and_arch(${ARGN}) + set_target_properties(${TARGETDETAILS_TARGET} PROPERTIES IGNORE_FEATURE_MERGE_JIT_AND_ENGINE TRUE) + + if (NOT TARGETDETAILS_NOALTJIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE ALT_JIT) + endif (NOT TARGETDETAILS_NOALTJIT) + + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_NO_HOST) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE SELF_NO_HOST) + if(FEATURE_READYTORUN) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_READYTORUN_COMPILER) + endif(FEATURE_READYTORUN) + + if ((TARGETDETAILS_ARCH STREQUAL "x64") OR (TARGETDETAILS_ARCH STREQUAL "arm64") OR ((TARGETDETAILS_ARCH STREQUAL "x86") AND NOT (TARGETDETAILS_OS STREQUAL "unix"))) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_SIMD) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_HW_INTRINSICS) + endif () +endfunction() + if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR (CLR_CMAKE_TARGET_ARCH_I386 AND NOT CLR_CMAKE_HOST_UNIX)) - add_definitions(-DFEATURE_SIMD) - add_definitions(-DFEATURE_HW_INTRINSICS) + add_compile_definitions($<$>>:FEATURE_SIMD>) + add_compile_definitions($<$>>:FEATURE_HW_INTRINSICS>) endif () # JIT_BUILD disables certain PAL_TRY debugging features @@ -54,6 +100,7 @@ set( JIT_SOURCES instr.cpp jitconfig.cpp jiteh.cpp + jithashtable.cpp jittelemetry.cpp lclmorph.cpp lclvars.cpp @@ -365,11 +412,8 @@ else() endif(CLR_CMAKE_HOST_UNIX) # Shared function for generating JIT -# optional arguments: ADDITIONAL_DESTINATION path +# optional arguments: ADDITIONAL_DESTINATIONS path function(add_jit jitName) - if(CLR_CMAKE_TARGET_WIN32) - add_definitions(-DFX_VER_INTERNALNAME_STR=${jitName}.dll) - endif(CLR_CMAKE_TARGET_WIN32) set_source_files_properties(${JIT_EXPORTS_FILE} PROPERTIES GENERATED TRUE) @@ -381,7 +425,12 @@ function(add_jit jitName) ${JIT_DLL_MAIN_FILE} ) - target_precompile_header(TARGET ${jitName} HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR}) + if(CLR_CMAKE_TARGET_WIN32) + target_compile_definitions(${jitName} PRIVATE FX_VER_INTERNALNAME_STR=${jitName}.dll) + endif(CLR_CMAKE_TARGET_WIN32) + + target_include_directories(${jitName} PRIVATE ${JIT_SOURCE_DIR}) + target_precompile_headers(${jitName} PRIVATE "$<$:jitpch.h>") add_dependencies(${jitName} jit_exports) @@ -406,22 +455,37 @@ endif (FEATURE_MERGE_JIT_AND_ENGINE) # Creates a static library "clrjit_static" to link into the VM. add_subdirectory(static) -add_subdirectory(standalone) +if (CLR_CMAKE_TARGET_UNIX) +set(TARGET_OS_NAME unix) +else() +set(TARGET_OS_NAME win) +endif() + +create_standalone_jit(TARGET clrjit OS ${TARGET_OS_NAME} ARCH ${ARCH_TARGET_NAME} NOALTJIT ADDITIONAL_DESTINATIONS sharedFramework) + +# Enable profile guided optimization +add_pgo(clrjit) -if (CLR_CMAKE_HOST_ARCH_I386 OR CLR_CMAKE_HOST_ARCH_AMD64) - # On x86, build RyuJIT/ARM32 cross-compiling altjit. - # On amd64, build RyuJIT/ARM64 cross-compiling altjit. - add_subdirectory(protononjit) -endif () if (CLR_CMAKE_HOST_ARCH_I386) # On x86, build RyuJIT/ARM32 cross-compiling altjit for ARM_SOFTFP (armel). - add_subdirectory(armelnonjit) + create_standalone_jit(TARGET clrjit_unix_armel_${ARCH_HOST_NAME} OS unix ARCH arm) + target_compile_definitions(clrjit_unix_armel_${ARCH_HOST_NAME} PRIVATE ARM_SOFTFP) endif () -if ((CLR_CMAKE_HOST_ARCH_I386 OR CLR_CMAKE_HOST_ARCH_AMD64) AND CLR_CMAKE_TARGET_WIN32) - # On Windows, build altjit that targets the Linux ABI: - # On x86, build Linux/x86 altjit. This enables UNIX_X86_ABI. - # On amd64, build Linux/AMD64 altjit. This enables UNIX_AMD64_ABI. - add_subdirectory(linuxnonjit) -endif () +if (CLR_CMAKE_BUILD_SUBSET_ALLJITS AND NOT CLR_CROSS_COMPONENTS_BUILD) + if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) + create_standalone_jit(TARGET clrjit_unix_arm64_${ARCH_HOST_NAME} OS unix ARCH arm64) + create_standalone_jit(TARGET clrjit_unix_x64_${ARCH_HOST_NAME} OS unix ARCH x64) + create_standalone_jit(TARGET clrjit_win_arm64_${ARCH_HOST_NAME} OS win ARCH arm64) + create_standalone_jit(TARGET clrjit_win_x64_${ARCH_HOST_NAME} OS win ARCH x64) + endif (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) + + create_standalone_jit(TARGET clrjit_unix_arm_${ARCH_HOST_NAME} OS unix ARCH arm) + create_standalone_jit(TARGET clrjit_win_arm_${ARCH_HOST_NAME} OS win ARCH arm) + create_standalone_jit(TARGET clrjit_win_x86_${ARCH_HOST_NAME} OS win ARCH x86) +else() + if (CLR_CMAKE_TARGET_UNIX) + create_standalone_jit(TARGET clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} OS unix ARCH ${ARCH_TARGET_NAME}) + endif(CLR_CMAKE_TARGET_UNIX) +endif (CLR_CMAKE_BUILD_SUBSET_ALLJITS AND NOT CLR_CROSS_COMPONENTS_BUILD) \ No newline at end of file diff --git a/src/coreclr/src/jit/_typeinfo.h b/src/coreclr/src/jit/_typeinfo.h index 4bc90e50dbe6..26173db3fae4 100644 --- a/src/coreclr/src/jit/_typeinfo.h +++ b/src/coreclr/src/jit/_typeinfo.h @@ -42,7 +42,7 @@ enum ti_types namespace { #endif // _MSC_VER -constexpr char* g_ti_type_names_map[] = { +const char* g_ti_type_names_map[] = { #define DEF_TI(ti, nm) nm, #include "titypes.h" #undef DEF_TI @@ -57,7 +57,7 @@ constexpr char* g_ti_type_names_map[] = { namespace { #endif // _MSC_VER -constexpr ti_types g_jit_types_map[] = { +const ti_types g_jit_types_map[] = { #define DEF_TP(tn, nm, jitType, verType, sz, sze, asze, st, al, tf, howUsed) verType, #include "typelist.h" #undef DEF_TP @@ -92,7 +92,7 @@ inline ti_types varType2tiType(var_types type) namespace { #endif // _MSC_VER -constexpr ti_types g_ti_types_map[CORINFO_TYPE_COUNT] = { +const ti_types g_ti_types_map[CORINFO_TYPE_COUNT] = { // see the definition of enum CorInfoType in file inc/corinfo.h TI_ERROR, // CORINFO_TYPE_UNDEF = 0x0, TI_ERROR, // CORINFO_TYPE_VOID = 0x1, diff --git a/src/coreclr/src/jit/armelnonjit/CMakeLists.txt b/src/coreclr/src/jit/armelnonjit/CMakeLists.txt deleted file mode 100644 index 9a9995a7af72..000000000000 --- a/src/coreclr/src/jit/armelnonjit/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -project(armelnonjit) - -add_definitions(-DALT_JIT) -add_definitions(-DFEATURE_NO_HOST) -add_definitions(-DSELF_NO_HOST) -remove_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE) - -remove_definitions(-DFEATURE_SIMD) -remove_definitions(-DFEATURE_HW_INTRINSICS) - -if(FEATURE_READYTORUN) - add_definitions(-DFEATURE_READYTORUN_COMPILER) -endif(FEATURE_READYTORUN) - -if (CLR_CMAKE_HOST_ARCH_I386) - remove_definitions(-DTARGET_X86) - add_definitions(-DTARGET_ARM) - add_definitions(-DARM_SOFTFP) - add_definitions(-DFEATURE_EH_FUNCLETS) - set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES}) - set(JIT_ARCH_LINK_LIBRARIES gcinfo_arm) -elseif(CLR_CMAKE_HOST_ARCH_AMD64) - remove_definitions(-DTARGET_AMD64) - add_definitions(-DTARGET_ARM64) - set(JIT_ARCH_SOURCES ${JIT_ARM64_SOURCES}) - set(JIT_ARCH_LINK_LIBRARIES gcinfo_arm64) -else() - clr_unknown_arch() -endif() - -if (NOT CLR_CMAKE_HOST_WIN32) - if (CLR_CMAKE_HOST_ARCH_I386) - remove_definitions(-DUNIX_X86_ABI) - elseif(CLR_CMAKE_HOST_ARCH_AMD64) - remove_definitions(-DUNIX_AMD64_ABI) - else() - clr_unknown_arch() - endif() -endif(NOT CLR_CMAKE_HOST_WIN32) - -add_jit(armelnonjit) diff --git a/src/coreclr/src/jit/armelnonjit/SOURCES b/src/coreclr/src/jit/armelnonjit/SOURCES deleted file mode 100644 index 094977091803..000000000000 --- a/src/coreclr/src/jit/armelnonjit/SOURCES +++ /dev/null @@ -1,9 +0,0 @@ - -# -# DO NOT EDIT THIS FILE!!! Modify the project file in this directory -# This file merely allows the MSBuild project file in this directory to be integrated with Build.Exe -# -TARGETTYPE=NOTARGET -CLR_TARGETTYPE=DLL -MSBuildProjectFile=armelnonjit.nativeproj -SOURCES= diff --git a/src/coreclr/src/jit/armelnonjit/armelnonjit.def b/src/coreclr/src/jit/armelnonjit/armelnonjit.def deleted file mode 100644 index 0afb54dca77d..000000000000 --- a/src/coreclr/src/jit/armelnonjit/armelnonjit.def +++ /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. -EXPORTS - getJit - jitStartup diff --git a/src/coreclr/src/jit/armelnonjit/makefile b/src/coreclr/src/jit/armelnonjit/makefile deleted file mode 100644 index bf27e8c84b05..000000000000 --- a/src/coreclr/src/jit/armelnonjit/makefile +++ /dev/null @@ -1,7 +0,0 @@ - -# -# DO NOT EDIT THIS FILE!!! Modify the project file in this directory -# This file merely allows the MSBuild project file in this directory to be integrated with Build.Exe -# - -!INCLUDE $(NTMAKEENV)\devdiv.def diff --git a/src/coreclr/src/jit/assertionprop.cpp b/src/coreclr/src/jit/assertionprop.cpp index 7bac5584bf92..de6439fc0d8d 100644 --- a/src/coreclr/src/jit/assertionprop.cpp +++ b/src/coreclr/src/jit/assertionprop.cpp @@ -1625,7 +1625,6 @@ void Compiler::optDebugCheckAssertion(AssertionDsc* assertion) assert(assertion->op2.u1.iconFlags != 0); break; case O1K_LCLVAR: - case O1K_ARR_BND: assert((lvaTable[assertion->op1.lcl.lclNum].lvType != TYP_REF) || (assertion->op2.u1.iconVal == 0)); break; case O1K_VALUE_NUMBER: @@ -1959,12 +1958,58 @@ AssertionInfo Compiler::optAssertionGenJtrue(GenTree* tree) { std::swap(op1, op2); } + + ValueNum op1VN = vnStore->VNConservativeNormalValue(op1->gtVNPair); + ValueNum op2VN = vnStore->VNConservativeNormalValue(op2->gtVNPair); // If op1 is lcl and op2 is const or lcl, create assertion. if ((op1->gtOper == GT_LCL_VAR) && ((op2->OperKind() & GTK_CONST) || (op2->gtOper == GT_LCL_VAR))) // Fix for Dev10 851483 { return optCreateJtrueAssertions(op1, op2, assertionKind); } + else if (vnStore->IsVNCheckedBound(op1VN) && vnStore->IsVNInt32Constant(op2VN)) + { + assert(relop->OperIs(GT_EQ, GT_NE)); + + int con = vnStore->ConstantValue(op2VN); + if (con >= 0) + { + AssertionDsc dsc; + + // For arr.Length != 0, we know that 0 is a valid index + // For arr.Length == con, we know that con - 1 is the greatest valid index + if (con == 0) + { + dsc.assertionKind = OAK_NOT_EQUAL; + dsc.op1.bnd.vnIdx = vnStore->VNForIntCon(0); + } + else + { + dsc.assertionKind = OAK_EQUAL; + dsc.op1.bnd.vnIdx = vnStore->VNForIntCon(con - 1); + } + + dsc.op1.vn = op1VN; + dsc.op1.kind = O1K_ARR_BND; + dsc.op1.bnd.vnLen = op1VN; + dsc.op2.vn = vnStore->VNConservativeNormalValue(op2->gtVNPair); + dsc.op2.kind = O2K_CONST_INT; + dsc.op2.u1.iconFlags = 0; + dsc.op2.u1.iconVal = 0; + + // when con is not zero, create an assertion on the arr.Length == con edge + // when con is zero, create an assertion on the arr.Length != 0 edge + AssertionIndex index = optAddAssertion(&dsc); + if (relop->OperIs(GT_NE) != (con == 0)) + { + return AssertionInfo::ForNextEdge(index); + } + else + { + return index; + } + } + } // Check op1 and op2 for an indirection of a GT_LCL_VAR and keep it in op1. if (((op1->gtOper != GT_IND) || (op1->AsOp()->gtOp1->gtOper != GT_LCL_VAR)) && @@ -2683,7 +2728,7 @@ GenTree* Compiler::optConstantAssertionProp(AssertionDsc* curAssertion, var_types simdType = tree->TypeGet(); assert(varDsc->TypeGet() == simdType); var_types baseType = varDsc->lvBaseType; - newTree = gtGetSIMDZero(simdType, baseType, varDsc->lvVerTypeInfo.GetClassHandle()); + newTree = gtGetSIMDZero(simdType, baseType, varDsc->GetStructHnd()); if (newTree == nullptr) { return nullptr; @@ -4501,7 +4546,7 @@ void Compiler::optImpliedByCopyAssertion(AssertionDsc* copyAssertion, AssertionD // This is the ngen case where we have an indirection of an address. noway_assert((impAssertion->op1.kind == O1K_EXACT_TYPE) || (impAssertion->op1.kind == O1K_SUBTYPE)); - __fallthrough; + FALLTHROUGH; case O2K_CONST_INT: usable = op1MatchesCopy && (impAssertion->op2.u1.iconVal == depAssertion->op2.u1.iconVal); diff --git a/src/coreclr/src/jit/block.cpp b/src/coreclr/src/jit/block.cpp index d8ca31c6662c..3c6fd6297dfe 100644 --- a/src/coreclr/src/jit/block.cpp +++ b/src/coreclr/src/jit/block.cpp @@ -277,10 +277,6 @@ void BasicBlock::dspFlags() { printf("try "); } - if (bbFlags & BBF_NEEDS_GCPOLL) - { - printf("poll "); - } if (bbFlags & BBF_RUN_RARELY) { printf("rare "); diff --git a/src/coreclr/src/jit/block.h b/src/coreclr/src/jit/block.h index 26ccbd80a42a..949b2460c6b1 100644 --- a/src/coreclr/src/jit/block.h +++ b/src/coreclr/src/jit/block.h @@ -380,72 +380,74 @@ struct BasicBlock : private LIR::Range unsigned bbRefs; // number of blocks that can reach here, either by fall-through or a branch. If this falls to zero, // the block is unreachable. +#define MAKE_BBFLAG(bit) (1ULL << (bit)) + // clang-format off -#define BBF_VISITED 0x00000001 // BB visited during optimizations -#define BBF_MARKED 0x00000002 // BB marked during optimizations -#define BBF_CHANGED 0x00000004 // input/output of this block has changed -#define BBF_REMOVED 0x00000008 // BB has been removed from bb-list - -#define BBF_DONT_REMOVE 0x00000010 // BB should not be removed during flow graph optimizations -#define BBF_IMPORTED 0x00000020 // BB byte-code has been imported -#define BBF_INTERNAL 0x00000040 // BB has been added by the compiler -#define BBF_FAILED_VERIFICATION 0x00000080 // BB has verification exception - -#define BBF_TRY_BEG 0x00000100 // BB starts a 'try' block -#define BBF_FUNCLET_BEG 0x00000200 // BB is the beginning of a funclet -#define BBF_HAS_NULLCHECK 0x00000400 // BB contains a null check -#define BBF_NEEDS_GCPOLL 0x00000800 // This BB is the source of a back edge and needs a GC Poll - -#define BBF_RUN_RARELY 0x00001000 // BB is rarely run (catch clauses, blocks with throws etc) -#define BBF_LOOP_HEAD 0x00002000 // BB is the head of a loop -#define BBF_LOOP_CALL0 0x00004000 // BB starts a loop that sometimes won't call -#define BBF_LOOP_CALL1 0x00008000 // BB starts a loop that will always call - -#define BBF_HAS_LABEL 0x00010000 // BB needs a label -#define BBF_JMP_TARGET 0x00020000 // BB is a target of an implicit/explicit jump -#define BBF_HAS_JMP 0x00040000 // BB executes a JMP instruction (instead of return) -#define BBF_GC_SAFE_POINT 0x00080000 // BB has a GC safe point (a call). More abstractly, BB does not require a - // (further) poll -- this may be because this BB has a call, or, in some - // cases, because the BB occurs in a loop, and we've determined that all - // paths in the loop body leading to BB include a call. - -#define BBF_HAS_VTABREF 0x00100000 // BB contains reference of vtable -#define BBF_HAS_IDX_LEN 0x00200000 // BB contains simple index or length expressions on an array local var. -#define BBF_HAS_NEWARRAY 0x00400000 // BB contains 'new' of an array -#define BBF_HAS_NEWOBJ 0x00800000 // BB contains 'new' of an object type. +#define BBF_VISITED MAKE_BBFLAG( 0) // BB visited during optimizations +#define BBF_MARKED MAKE_BBFLAG( 1) // BB marked during optimizations +#define BBF_CHANGED MAKE_BBFLAG( 2) // input/output of this block has changed +#define BBF_REMOVED MAKE_BBFLAG( 3) // BB has been removed from bb-list + +#define BBF_DONT_REMOVE MAKE_BBFLAG( 4) // BB should not be removed during flow graph optimizations +#define BBF_IMPORTED MAKE_BBFLAG( 5) // BB byte-code has been imported +#define BBF_INTERNAL MAKE_BBFLAG( 6) // BB has been added by the compiler +#define BBF_FAILED_VERIFICATION MAKE_BBFLAG( 7) // BB has verification exception + +#define BBF_TRY_BEG MAKE_BBFLAG( 8) // BB starts a 'try' block +#define BBF_FUNCLET_BEG MAKE_BBFLAG( 9) // BB is the beginning of a funclet +#define BBF_HAS_NULLCHECK MAKE_BBFLAG(10) // BB contains a null check +#define BBF_HAS_SUPPRESSGC_CALL MAKE_BBFLAG(11) // BB contains a call to a method with SuppressGCTransitionAttribute + +#define BBF_RUN_RARELY MAKE_BBFLAG(12) // BB is rarely run (catch clauses, blocks with throws etc) +#define BBF_LOOP_HEAD MAKE_BBFLAG(13) // BB is the head of a loop +#define BBF_LOOP_CALL0 MAKE_BBFLAG(14) // BB starts a loop that sometimes won't call +#define BBF_LOOP_CALL1 MAKE_BBFLAG(15) // BB starts a loop that will always call + +#define BBF_HAS_LABEL MAKE_BBFLAG(16) // BB needs a label +#define BBF_JMP_TARGET MAKE_BBFLAG(17) // BB is a target of an implicit/explicit jump +#define BBF_HAS_JMP MAKE_BBFLAG(18) // BB executes a JMP instruction (instead of return) +#define BBF_GC_SAFE_POINT MAKE_BBFLAG(19) // BB has a GC safe point (a call). More abstractly, BB does not require a + // (further) poll -- this may be because this BB has a call, or, in some + // cases, because the BB occurs in a loop, and we've determined that all + // paths in the loop body leading to BB include a call. + +#define BBF_HAS_VTABREF MAKE_BBFLAG(20) // BB contains reference of vtable +#define BBF_HAS_IDX_LEN MAKE_BBFLAG(21) // BB contains simple index or length expressions on an array local var. +#define BBF_HAS_NEWARRAY MAKE_BBFLAG(22) // BB contains 'new' of an array +#define BBF_HAS_NEWOBJ MAKE_BBFLAG(23) // BB contains 'new' of an object type. #if defined(FEATURE_EH_FUNCLETS) && defined(TARGET_ARM) -#define BBF_FINALLY_TARGET 0x01000000 // BB is the target of a finally return: where a finally will return during - // non-exceptional flow. Because the ARM calling sequence for calling a - // finally explicitly sets the return address to the finally target and jumps - // to the finally, instead of using a call instruction, ARM needs this to - // generate correct code at the finally target, to allow for proper stack - // unwind from within a non-exceptional call to a finally. +#define BBF_FINALLY_TARGET MAKE_BBFLAG(24) // BB is the target of a finally return: where a finally will return during + // non-exceptional flow. Because the ARM calling sequence for calling a + // finally explicitly sets the return address to the finally target and jumps + // to the finally, instead of using a call instruction, ARM needs this to + // generate correct code at the finally target, to allow for proper stack + // unwind from within a non-exceptional call to a finally. #endif // defined(FEATURE_EH_FUNCLETS) && defined(TARGET_ARM) -#define BBF_BACKWARD_JUMP 0x02000000 // BB is surrounded by a backward jump/switch arc -#define BBF_RETLESS_CALL 0x04000000 // BBJ_CALLFINALLY that will never return (and therefore, won't need a paired - // BBJ_ALWAYS); see isBBCallAlwaysPair(). -#define BBF_LOOP_PREHEADER 0x08000000 // BB is a loop preheader block - -#define BBF_COLD 0x10000000 // BB is cold -#define BBF_PROF_WEIGHT 0x20000000 // BB weight is computed from profile data -#define BBF_IS_LIR 0x40000000 // Set if the basic block contains LIR (as opposed to HIR) -#define BBF_KEEP_BBJ_ALWAYS 0x80000000 // A special BBJ_ALWAYS block, used by EH code generation. Keep the jump kind - // as BBJ_ALWAYS. Used for the paired BBJ_ALWAYS block following the - // BBJ_CALLFINALLY block, as well as, on x86, the final step block out of a - // finally. - -#define BBF_CLONED_FINALLY_BEGIN 0x100000000 // First block of a cloned finally region -#define BBF_CLONED_FINALLY_END 0x200000000 // Last block of a cloned finally region -#define BBF_HAS_CALL 0x400000000 // BB contains a call -#define BBF_DOMINATED_BY_EXCEPTIONAL_ENTRY 0x800000000 // Block is dominated by exceptional entry. -#define BBF_BACKWARD_JUMP_TARGET 0x1000000000 // Block is a target of a backward jump -#define BBF_PATCHPOINT 0x2000000000 // Block is a patchpoint -#define BBF_HAS_SUPPRESSGC_CALL 0x4000000000 // BB contains a call to a method with SuppressGCTransitionAttribute +#define BBF_BACKWARD_JUMP MAKE_BBFLAG(25) // BB is surrounded by a backward jump/switch arc +#define BBF_RETLESS_CALL MAKE_BBFLAG(26) // BBJ_CALLFINALLY that will never return (and therefore, won't need a paired + // BBJ_ALWAYS); see isBBCallAlwaysPair(). +#define BBF_LOOP_PREHEADER MAKE_BBFLAG(27) // BB is a loop preheader block + +#define BBF_COLD MAKE_BBFLAG(28) // BB is cold +#define BBF_PROF_WEIGHT MAKE_BBFLAG(29) // BB weight is computed from profile data +#define BBF_IS_LIR MAKE_BBFLAG(30) // Set if the basic block contains LIR (as opposed to HIR) +#define BBF_KEEP_BBJ_ALWAYS MAKE_BBFLAG(31) // A special BBJ_ALWAYS block, used by EH code generation. Keep the jump kind + // as BBJ_ALWAYS. Used for the paired BBJ_ALWAYS block following the + // BBJ_CALLFINALLY block, as well as, on x86, the final step block out of a + // finally. + +#define BBF_CLONED_FINALLY_BEGIN MAKE_BBFLAG(32) // First block of a cloned finally region +#define BBF_CLONED_FINALLY_END MAKE_BBFLAG(33) // Last block of a cloned finally region +#define BBF_HAS_CALL MAKE_BBFLAG(34) // BB contains a call +#define BBF_DOMINATED_BY_EXCEPTIONAL_ENTRY MAKE_BBFLAG(35) // Block is dominated by exceptional entry. + +#define BBF_BACKWARD_JUMP_TARGET MAKE_BBFLAG(36) // Block is a target of a backward jump +#define BBF_PATCHPOINT MAKE_BBFLAG(37) // Block is a patchpoint // clang-format on @@ -465,8 +467,8 @@ struct BasicBlock : private LIR::Range // Flags to update when two blocks are compacted #define BBF_COMPACT_UPD \ - (BBF_CHANGED | BBF_GC_SAFE_POINT | BBF_HAS_JMP | BBF_NEEDS_GCPOLL | BBF_HAS_IDX_LEN | BBF_BACKWARD_JUMP | \ - BBF_HAS_NEWARRAY | BBF_HAS_NEWOBJ | BBF_HAS_NULLCHECK | BBF_HAS_VTABREF) + (BBF_CHANGED | BBF_GC_SAFE_POINT | BBF_HAS_JMP | BBF_HAS_IDX_LEN | BBF_BACKWARD_JUMP | BBF_HAS_NEWARRAY | \ + BBF_HAS_NEWOBJ | BBF_HAS_NULLCHECK | BBF_HAS_VTABREF) // Flags a block should not have had before it is split. @@ -566,47 +568,37 @@ struct BasicBlock : private LIR::Range } // this block will inherit the same weight and relevant bbFlags as bSrc + // void inheritWeight(BasicBlock* bSrc) { - this->bbWeight = bSrc->bbWeight; - - if (bSrc->hasProfileWeight()) - { - this->bbFlags |= BBF_PROF_WEIGHT; - } - else - { - this->bbFlags &= ~BBF_PROF_WEIGHT; - } - - if (this->bbWeight == 0) - { - this->bbFlags |= BBF_RUN_RARELY; - } - else - { - this->bbFlags &= ~BBF_RUN_RARELY; - } + inheritWeightPercentage(bSrc, 100); } // Similar to inheritWeight(), but we're splitting a block (such as creating blocks for qmark removal). - // So, specify a percentage (0 to 99; if it's 100, just use inheritWeight()) of the weight that we're - // going to inherit. Since the number isn't exact, clear the BBF_PROF_WEIGHT flag. + // So, specify a percentage (0 to 100) of the weight the block should inherit. + // void inheritWeightPercentage(BasicBlock* bSrc, unsigned percentage) { - assert(0 <= percentage && percentage < 100); + assert(0 <= percentage && percentage <= 100); // Check for overflow - if (bSrc->bbWeight * 100 <= bSrc->bbWeight) + if ((bSrc->bbWeight * 100) <= bSrc->bbWeight) { this->bbWeight = bSrc->bbWeight; } else { - this->bbWeight = bSrc->bbWeight * percentage / 100; + this->bbWeight = (bSrc->bbWeight * percentage) / 100; } - this->bbFlags &= ~BBF_PROF_WEIGHT; + if (bSrc->hasProfileWeight()) + { + this->bbFlags |= BBF_PROF_WEIGHT; + } + else + { + this->bbFlags &= ~BBF_PROF_WEIGHT; + } if (this->bbWeight == 0) { diff --git a/src/coreclr/src/jit/codegen.h b/src/coreclr/src/jit/codegen.h index d6e14d7a308c..6c244284aadf 100644 --- a/src/coreclr/src/jit/codegen.h +++ b/src/coreclr/src/jit/codegen.h @@ -341,12 +341,12 @@ class CodeGen final : public CodeGenInterface void genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowestCalleeSavedOffset, int spDelta); void genRestoreCalleeSavedRegistersHelp(regMaskTP regsToRestoreMask, int lowestCalleeSavedOffset, int spDelta); - void genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegModified); + void genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegZeroed); #else void genPushCalleeSavedRegisters(); #endif - void genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pInitRegModified, regMaskTP maskArgRegsLiveIn); + void genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pInitRegZeroed, regMaskTP maskArgRegsLiveIn); #if defined(TARGET_ARM) @@ -434,18 +434,18 @@ class CodeGen final : public CodeGenInterface void genZeroInitFltRegs(const regMaskTP& initFltRegs, const regMaskTP& initDblRegs, const regNumber& initReg); - regNumber genGetZeroReg(regNumber initReg, bool* pInitRegModified); + regNumber genGetZeroReg(regNumber initReg, bool* pInitRegZeroed); - void genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, bool* pInitRegModified); + void genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, bool* pInitRegZeroed); - void genReportGenericContextArg(regNumber initReg, bool* pInitRegModified); + void genReportGenericContextArg(regNumber initReg, bool* pInitRegZeroed); - void genSetGSSecurityCookie(regNumber initReg, bool* pInitRegModified); + void genSetGSSecurityCookie(regNumber initReg, bool* pInitRegZeroed); void genFinalizeFrame(); #ifdef PROFILING_SUPPORTED - void genProfilingEnterCallback(regNumber initReg, bool* pInitRegModified); + void genProfilingEnterCallback(regNumber initReg, bool* pInitRegZeroed); void genProfilingLeaveCallback(unsigned helper); #endif // PROFILING_SUPPORTED @@ -511,7 +511,7 @@ class CodeGen final : public CodeGenInterface void genFuncletEpilog(); void genCaptureFuncletPrologEpilogInfo(); - void genSetPSPSym(regNumber initReg, bool* pInitRegModified); + void genSetPSPSym(regNumber initReg, bool* pInitRegZeroed); void genUpdateCurrentFunclet(BasicBlock* block); #if defined(TARGET_ARM) @@ -1393,8 +1393,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX emitAttr size, insFlags flags = INS_FLAGS_DONT_CARE); - void inst_IV(instruction ins, int val); - void inst_IV_handle(instruction ins, int val); + void inst_IV(instruction ins, cnsval_ssize_t val); + void inst_IV_handle(instruction ins, cnsval_ssize_t val); void inst_RV_IV( instruction ins, regNumber reg, target_ssize_t val, emitAttr size, insFlags flags = INS_FLAGS_DONT_CARE); diff --git a/src/coreclr/src/jit/codegenarm.cpp b/src/coreclr/src/jit/codegenarm.cpp index 0407c710e404..ccfda4a5c29a 100644 --- a/src/coreclr/src/jit/codegenarm.cpp +++ b/src/coreclr/src/jit/codegenarm.cpp @@ -45,7 +45,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // if caller knows for certain the constant will fit. // // Return Value: -// returns true if the immediate was too large and tmpReg was used and modified. +// returns true if the immediate was small enough to be encoded inside instruction. If not, +// returns false meaning the immediate was too large and tmpReg was used and modified. // bool CodeGen::genInstrWithConstant( instruction ins, emitAttr attr, regNumber reg1, regNumber reg2, ssize_t imm, insFlags flags, regNumber tmpReg) @@ -60,7 +61,7 @@ bool CodeGen::genInstrWithConstant( { case INS_add: case INS_sub: - immFitsInIns = validImmForInstr(ins, imm, flags); + immFitsInIns = validImmForInstr(ins, (target_ssize_t)imm, flags); break; default: @@ -71,7 +72,7 @@ bool CodeGen::genInstrWithConstant( if (immFitsInIns) { // generate a single instruction that encodes the immediate directly - GetEmitter()->emitIns_R_R_I(ins, attr, reg1, reg2, imm); + GetEmitter()->emitIns_R_R_I(ins, attr, reg1, reg2, (target_ssize_t)imm); } else { @@ -100,7 +101,8 @@ bool CodeGen::genInstrWithConstant( // tmpReg - an available temporary register // // Return Value: -// true if `tmpReg` was used. +// returns true if the immediate was small enough to be encoded inside instruction. If not, +// returns false meaning the immediate was too large and tmpReg was used and modified. // bool CodeGen::genStackPointerAdjustment(ssize_t spDelta, regNumber tmpReg) { @@ -1650,14 +1652,14 @@ void CodeGen::genCodeForMulLong(GenTreeMultiRegOp* node) // genProfilingEnterCallback: Generate the profiling function enter callback. // // Arguments: -// initReg - register to use as scratch register -// pInitRegModified - OUT parameter. *pInitRegModified set to 'true' if and only if -// this call sets 'initReg' to a non-zero value. +// initReg - register to use as scratch register +// pInitRegZeroed - OUT parameter. *pInitRegZeroed set to 'false' if 'initReg' is +// not zero after this call. // // Return Value: // None // -void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModified) +void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegZeroed) { assert(compiler->compGeneratingProlog); @@ -1690,7 +1692,7 @@ void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModifie if (initReg == argReg) { - *pInitRegModified = true; + *pInitRegZeroed = false; } } @@ -1820,17 +1822,14 @@ void CodeGen::genProfilingLeaveCallback(unsigned helper) // Arguments: // frameSize - the size of the stack frame being allocated. // initReg - register to use as a scratch register. -// pInitRegModified - OUT parameter. *pInitRegModified is set to 'true' if and only if +// pInitRegZeroed - OUT parameter. *pInitRegZeroed is set to 'false' if and only if // this call sets 'initReg' to a non-zero value. // maskArgRegsLiveIn - incoming argument registers that are currently live. // // Return value: // None // -void CodeGen::genAllocLclFrame(unsigned frameSize, - regNumber initReg, - bool* pInitRegModified, - regMaskTP maskArgRegsLiveIn) +void CodeGen::genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pInitRegZeroed, regMaskTP maskArgRegsLiveIn) { assert(compiler->compGeneratingProlog); @@ -1860,7 +1859,7 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, } regSet.verifyRegUsed(initReg); - *pInitRegModified = true; + *pInitRegZeroed = false; // The initReg does not contain zero instGen_Set_Reg_To_Imm(EA_PTRSIZE, initReg, frameSize); compiler->unwindPadding(); @@ -1880,7 +1879,7 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, if ((genRegMask(initReg) & (RBM_STACK_PROBE_HELPER_ARG | RBM_STACK_PROBE_HELPER_CALL_TARGET | RBM_STACK_PROBE_HELPER_TRASH)) != RBM_NONE) { - *pInitRegModified = true; + *pInitRegZeroed = false; } } diff --git a/src/coreclr/src/jit/codegenarm64.cpp b/src/coreclr/src/jit/codegenarm64.cpp index 2edf42d8580e..a2e907db09d1 100644 --- a/src/coreclr/src/jit/codegenarm64.cpp +++ b/src/coreclr/src/jit/codegenarm64.cpp @@ -156,7 +156,9 @@ void CodeGen::genStackPointerAdjustment(ssize_t spDelta, regNumber tmpReg, bool* // Even though INS_add is specified here, the encoder will choose either // an INS_add or an INS_sub and encode the immediate as a positive value // - if (genInstrWithConstant(INS_add, EA_PTRSIZE, REG_SPBASE, REG_SPBASE, spDelta, tmpReg, true)) + bool wasTempRegisterUsedForImm = + !genInstrWithConstant(INS_add, EA_PTRSIZE, REG_SPBASE, REG_SPBASE, spDelta, tmpReg, true); + if (wasTempRegisterUsedForImm) { if (pTmpRegIsZero != nullptr) { @@ -242,6 +244,13 @@ void CodeGen::genPrologSaveRegPair(regNumber reg1, assert(spOffset <= 504); GetEmitter()->emitIns_R_R_R_I(INS_stp, EA_PTRSIZE, reg1, reg2, REG_SPBASE, spOffset); +#if defined(TARGET_UNIX) + if (compiler->generateCFIUnwindCodes()) + { + useSaveNextPair = false; + } +#endif // TARGET_UNIX + if (useSaveNextPair) { // This works as long as we've only been saving pairs, in order, and we've saved the previous one just @@ -370,6 +379,13 @@ void CodeGen::genEpilogRestoreRegPair(regNumber reg1, { GetEmitter()->emitIns_R_R_R_I(INS_ldp, EA_PTRSIZE, reg1, reg2, REG_SPBASE, spOffset); +#if defined(TARGET_UNIX) + if (compiler->generateCFIUnwindCodes()) + { + useSaveNextPair = false; + } +#endif // TARGET_UNIX + if (useSaveNextPair) { compiler->unwindSaveNext(); @@ -613,7 +629,7 @@ void CodeGen::genSaveCalleeSavedRegisterGroup(regMaskTP regsMask, int spDelta, i // The caller can tell us to fold in a stack pointer adjustment, which we will do with the first instruction. // Note that the stack pointer adjustment must be by a multiple of 16 to preserve the invariant that the // stack pointer is always 16 byte aligned. If we are saving an odd number of callee-saved -// registers, though, we will have an empty aligment slot somewhere. It turns out we will put +// registers, though, we will have an empty alignment slot somewhere. It turns out we will put // it below (at a lower address) the callee-saved registers, as that is currently how we // do frame layout. This means that the first stack offset will be 8 and the stack pointer // adjustment must be done by a SUB, and not folded in to a pre-indexed store. @@ -1443,7 +1459,7 @@ void CodeGen::genCaptureFuncletPrologEpilogInfo() genFuncletInfo.fiSaveRegs = rsMaskSaveRegs; genFuncletInfo.fiSP_to_FPLR_save_delta = SP_to_FPLR_save_delta; genFuncletInfo.fiSP_to_PSP_slot_delta = SP_to_PSP_slot_delta; - genFuncletInfo.fiSP_to_CalleeSave_delta = SP_to_PSP_slot_delta + REGSIZE_BYTES; + genFuncletInfo.fiSP_to_CalleeSave_delta = SP_to_PSP_slot_delta + PSPSize; genFuncletInfo.fiCallerSP_to_PSP_slot_delta = CallerSP_to_PSP_slot_delta; #ifdef DEBUG @@ -2974,7 +2990,7 @@ void CodeGen::genCodeForCmpXchg(GenTreeCmpXchg* treeNode) gcInfo.gcMarkRegPtrVal(addrReg, addr->TypeGet()); // TODO-ARM64-CQ Use ARMv8.1 atomics if available - // https://github.com/dotnet/coreclr/issues/11881 + // https://github.com/dotnet/runtime/issues/8225 // Emit code like this: // retry: @@ -4810,14 +4826,14 @@ void CodeGen::genStoreLclTypeSIMD12(GenTree* treeNode) // genProfilingEnterCallback: Generate the profiling function enter callback. // // Arguments: -// initReg - register to use as scratch register -// pInitRegModified - OUT parameter. *pInitRegModified set to 'true' if 'initReg' is -// not zero after this call. +// initReg - register to use as scratch register +// pInitRegZeroed - OUT parameter. *pInitRegZeroed set to 'false' if 'initReg' is +// set to non-zero value after this call. // // Return Value: // None // -void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModified) +void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegZeroed) { assert(compiler->compGeneratingProlog); @@ -4845,7 +4861,7 @@ void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModifie if ((genRegMask(initReg) & RBM_PROFILER_ENTER_TRASH) != RBM_NONE) { - *pInitRegModified = true; + *pInitRegZeroed = false; } } @@ -9592,19 +9608,16 @@ void CodeGen::genArm64EmitterUnitTests() // on Windows as well just to be consistent, even though it should not be necessary. // // Arguments: -// frameSize - the size of the stack frame being allocated. -// initReg - register to use as a scratch register. -// pInitRegModified - OUT parameter. *pInitRegModified is set to 'true' if and only if -// this call sets 'initReg' to a non-zero value. -// maskArgRegsLiveIn - incoming argument registers that are currently live. +// frameSize - the size of the stack frame being allocated. +// initReg - register to use as a scratch register. +// pInitRegZeroed - OUT parameter. *pInitRegZeroed is set to 'false' if and only if +// this call sets 'initReg' to a non-zero value. Otherwise, it is unchanged. +// maskArgRegsLiveIn - incoming argument registers that are currently live. // // Return value: // None // -void CodeGen::genAllocLclFrame(unsigned frameSize, - regNumber initReg, - bool* pInitRegModified, - regMaskTP maskArgRegsLiveIn) +void CodeGen::genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pInitRegZeroed, regMaskTP maskArgRegsLiveIn) { assert(compiler->compGeneratingProlog); @@ -9641,7 +9654,7 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, instGen_Set_Reg_To_Imm(EA_PTRSIZE, initReg, -(ssize_t)probeOffset); GetEmitter()->emitIns_R_R_R(INS_ldr, EA_4BYTE, REG_ZR, REG_SPBASE, initReg); regSet.verifyRegUsed(initReg); - *pInitRegModified = true; + *pInitRegZeroed = false; // The initReg does not contain zero lastTouchDelta -= pageSize; } @@ -9701,7 +9714,7 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, GetEmitter()->emitIns_R_R(INS_cmp, EA_PTRSIZE, rLimit, rOffset); // If equal, we need to probe again GetEmitter()->emitIns_J(INS_bls, NULL, -4); - *pInitRegModified = true; + *pInitRegZeroed = false; // The initReg does not contain zero compiler->unwindPadding(); @@ -9716,7 +9729,7 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, compiler->unwindPadding(); regSet.verifyRegUsed(initReg); - *pInitRegModified = true; + *pInitRegZeroed = false; // The initReg does not contain zero } } diff --git a/src/coreclr/src/jit/codegenarmarch.cpp b/src/coreclr/src/jit/codegenarmarch.cpp index a2d881588ab5..6e987ec52f13 100644 --- a/src/coreclr/src/jit/codegenarmarch.cpp +++ b/src/coreclr/src/jit/codegenarmarch.cpp @@ -39,7 +39,7 @@ void CodeGen::genStackPointerConstantAdjustment(ssize_t spDelta) // function that does a probe, which will in turn call this function. assert((target_size_t)(-spDelta) <= compiler->eeGetPageSize()); - inst_RV_IV(INS_sub, REG_SPBASE, -spDelta, EA_PTRSIZE); + inst_RV_IV(INS_sub, REG_SPBASE, (target_ssize_t)-spDelta, EA_PTRSIZE); } //------------------------------------------------------------------------ @@ -207,7 +207,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) case GT_AND: assert(varTypeIsIntegralOrI(treeNode)); - __fallthrough; + FALLTHROUGH; #if !defined(TARGET_64BIT) case GT_ADD_LO: @@ -561,14 +561,14 @@ void CodeGen::genSetRegToIcon(regNumber reg, ssize_t val, var_types type, insFla // genSetGSSecurityCookie: Set the "GS" security cookie in the prolog. // // Arguments: -// initReg - register to use as a scratch register -// pInitRegModified - OUT parameter. *pInitRegModified is set to 'true' if and only if -// this call sets 'initReg' to a non-zero value. +// initReg - register to use as a scratch register +// pInitRegZeroed - OUT parameter. *pInitRegZeroed is set to 'false' if and only if +// this call sets 'initReg' to a non-zero value. // // Return Value: // None // -void CodeGen::genSetGSSecurityCookie(regNumber initReg, bool* pInitRegModified) +void CodeGen::genSetGSSecurityCookie(regNumber initReg, bool* pInitRegZeroed) { assert(compiler->compGeneratingProlog); @@ -593,7 +593,7 @@ void CodeGen::genSetGSSecurityCookie(regNumber initReg, bool* pInitRegModified) GetEmitter()->emitIns_S_R(INS_str, EA_PTRSIZE, initReg, compiler->lvaGSSecurityCookie, 0); } - *pInitRegModified = true; + *pInitRegZeroed = false; } //--------------------------------------------------------------------- @@ -616,31 +616,31 @@ void CodeGen::genIntrinsic(GenTree* treeNode) // Right now only Abs/Ceiling/Floor/Round/Sqrt are treated as math intrinsics. // - switch (treeNode->AsIntrinsic()->gtIntrinsicId) + switch (treeNode->AsIntrinsic()->gtIntrinsicName) { - case CORINFO_INTRINSIC_Abs: + case NI_System_Math_Abs: genConsumeOperands(treeNode->AsOp()); GetEmitter()->emitInsBinary(INS_ABS, emitActualTypeSize(treeNode), treeNode, srcNode); break; #ifdef TARGET_ARM64 - case CORINFO_INTRINSIC_Ceiling: + case NI_System_Math_Ceiling: genConsumeOperands(treeNode->AsOp()); GetEmitter()->emitInsBinary(INS_frintp, emitActualTypeSize(treeNode), treeNode, srcNode); break; - case CORINFO_INTRINSIC_Floor: + case NI_System_Math_Floor: genConsumeOperands(treeNode->AsOp()); GetEmitter()->emitInsBinary(INS_frintm, emitActualTypeSize(treeNode), treeNode, srcNode); break; - case CORINFO_INTRINSIC_Round: + case NI_System_Math_Round: genConsumeOperands(treeNode->AsOp()); GetEmitter()->emitInsBinary(INS_frintn, emitActualTypeSize(treeNode), treeNode, srcNode); break; #endif // TARGET_ARM64 - case CORINFO_INTRINSIC_Sqrt: + case NI_System_Math_Sqrt: genConsumeOperands(treeNode->AsOp()); GetEmitter()->emitInsBinary(INS_SQRT, emitActualTypeSize(treeNode), treeNode, srcNode); break; @@ -815,11 +815,15 @@ void CodeGen::genPutArgStk(GenTreePutArgStk* treeNode) // so update 'source' to point this GT_LCL_VAR_ADDR node // and continue to the codegen for the LCL_VAR node below // + assert(addrNode->isContained()); varNode = addrNode->AsLclVarCommon(); addrNode = nullptr; } else // addrNode is used { + // TODO-Cleanup: `Lowering::NewPutArg` marks only `LCL_VAR_ADDR` as contained nowadays, + // but we use `genConsumeAddress` as a precaution, use `genConsumeReg()` instead. + assert(!addrNode->isContained()); // Generate code to load the address that we need into a register genConsumeAddress(addrNode); addrReg = addrNode->GetRegNum(); @@ -1253,6 +1257,7 @@ void CodeGen::genPutArgSplit(GenTreePutArgSplit* treeNode) if (varNode != nullptr) { + assert(varNode->isContained()); srcVarNum = varNode->GetLclNum(); assert(srcVarNum < compiler->lvaCount); @@ -1270,6 +1275,9 @@ void CodeGen::genPutArgSplit(GenTreePutArgSplit* treeNode) else // addrNode is used { assert(addrNode != nullptr); + // TODO-Cleanup: `Lowering::NewPutArg` marks only `LCL_VAR_ADDR` as contained nowadays, + // but we use `genConsumeAddress` as a precaution, use `genConsumeReg()` instead. + assert(!addrNode->isContained()); // Generate code to load the address that we need into a register genConsumeAddress(addrNode); @@ -3273,7 +3281,7 @@ void CodeGen::genCreateAndStoreGCInfo(unsigned codeSize, unsigned reversePInvokeFrameVarNumber = compiler->lvaReversePInvokeFrameVar; assert(reversePInvokeFrameVarNumber != BAD_VAR_NUM && reversePInvokeFrameVarNumber < compiler->lvaRefCount); LclVarDsc& reversePInvokeFrameVar = compiler->lvaTable[reversePInvokeFrameVarNumber]; - gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar.lvStkOffs); + gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar.GetStackOffset()); } gcInfoEncoder->Build(); diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp index ccfd7567f46a..ec19e5c005d7 100644 --- a/src/coreclr/src/jit/codegencommon.cpp +++ b/src/coreclr/src/jit/codegencommon.cpp @@ -1421,7 +1421,7 @@ bool CodeGen::genCreateAddrMode(GenTree* addr, return false; // Need overflow check } - __fallthrough; + FALLTHROUGH; case GT_LSH: @@ -1486,7 +1486,7 @@ bool CodeGen::genCreateAddrMode(GenTree* addr, break; } - __fallthrough; + FALLTHROUGH; case GT_LSH: @@ -1568,7 +1568,7 @@ bool CodeGen::genCreateAddrMode(GenTree* addr, break; } - __fallthrough; + FALLTHROUGH; case GT_LSH: @@ -2271,6 +2271,7 @@ void CodeGen::genEmitMachineCode() GetEmitter()->emitComputeCodeSizes(); #ifdef DEBUG + unsigned instrCount; // Code to test or stress our ability to run a fallback compile. // We trigger the fallback here, before asking the VM for any memory, @@ -2319,7 +2320,7 @@ void CodeGen::genEmitMachineCode() codeSize = GetEmitter()->emitEndCodeGen(compiler, trackedStackPtrsContig, GetInterruptible(), IsFullPtrRegMapRequired(), compiler->compHndBBtabCount, &prologSize, - &epilogSize, codePtr, &coldCodePtr, &consPtr); + &epilogSize, codePtr, &coldCodePtr, &consPtr DEBUGARG(&instrCount)); #ifdef DEBUG assert(compiler->compCodeGenDone == false); @@ -2339,8 +2340,9 @@ void CodeGen::genEmitMachineCode() #ifdef DEBUG if (compiler->opts.disAsm || verbose) { - printf("\n; Total bytes of code %d, prolog size %d, PerfScore %.2f, (MethodHash=%08x) for method %s\n", - codeSize, prologSize, compiler->info.compPerfScore, compiler->info.compMethodHash(), + printf("\n; Total bytes of code %d, prolog size %d, PerfScore %.2f, instruction count %d (MethodHash=%08x) for " + "method %s\n", + codeSize, prologSize, compiler->info.compPerfScore, instrCount, compiler->info.compMethodHash(), compiler->info.compFullName); printf("; ============================================================\n\n"); printf(""); // in our logic this causes a flush @@ -2353,25 +2355,25 @@ void CodeGen::genEmitMachineCode() } #endif -#if EMIT_TRACK_STACK_DEPTH +#if EMIT_TRACK_STACK_DEPTH && defined(DEBUG) && !defined(OSX_ARM64_ABI) // Check our max stack level. Needed for fgAddCodeRef(). // We need to relax the assert as our estimation won't include code-gen // stack changes (which we know don't affect fgAddCodeRef()). // NOTE: after emitEndCodeGen (including here), emitMaxStackDepth is a // count of DWORD-sized arguments, NOT argument size in bytes. { - unsigned maxAllowedStackDepth = compiler->fgPtrArgCntMax + // Max number of pointer-sized stack arguments. - compiler->compHndBBtabCount + // Return address for locally-called finallys - genTypeStSz(TYP_LONG) + // longs/doubles may be transferred via stack, etc + unsigned maxAllowedStackDepth = compiler->fgGetPtrArgCntMax() + // Max number of pointer-sized stack arguments. + compiler->compHndBBtabCount + // Return address for locally-called finallys + genTypeStSz(TYP_LONG) + // longs/doubles may be transferred via stack, etc (compiler->compTailCallUsed ? 4 : 0); // CORINFO_HELP_TAILCALL args #if defined(UNIX_X86_ABI) // Convert maxNestedAlignment to DWORD count before adding to maxAllowedStackDepth. assert(maxNestedAlignment % sizeof(int) == 0); maxAllowedStackDepth += maxNestedAlignment / sizeof(int); #endif - noway_assert(GetEmitter()->emitMaxStackDepth <= maxAllowedStackDepth); + assert(GetEmitter()->emitMaxStackDepth <= maxAllowedStackDepth); } -#endif // EMIT_TRACK_STACK_DEPTH +#endif // EMIT_TRACK_STACK_DEPTH && DEBUG *nativeSizeOfCode = codeSize; compiler->info.compNativeCodeSize = (UNATIVE_OFFSET)codeSize; @@ -3373,8 +3375,6 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere if (promotionType == Compiler::PROMOTION_TYPE_INDEPENDENT) { - noway_assert(parentVarDsc->lvFieldCnt == 1); // We only handle one field here - // For register arguments that are independent promoted structs we put the promoted field varNum in the // regArgTab[] if (varDsc->lvPromoted) @@ -3423,7 +3423,7 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere #if defined(UNIX_AMD64_ABI) if (varTypeIsStruct(varDsc)) { - CORINFO_CLASS_HANDLE typeHnd = varDsc->lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE typeHnd = varDsc->GetStructHnd(); assert(typeHnd != nullptr); SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR structDesc; compiler->eeGetSystemVAmd64PassStructInRegisterDescriptor(typeHnd, &structDesc); @@ -3728,11 +3728,33 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere regNumber regNum = genMapRegArgNumToRegNum(argNum, regType); regNumber destRegNum = REG_NA; - if (regArgTab[argNum].slot == 1) + if (varTypeIsStruct(varDsc) && + (compiler->lvaGetPromotionType(varDsc) == Compiler::PROMOTION_TYPE_INDEPENDENT)) + { + assert(regArgTab[argNum].slot <= varDsc->lvFieldCnt); + LclVarDsc* fieldVarDsc = compiler->lvaGetDesc(varDsc->lvFieldLclStart + regArgTab[argNum].slot - 1); + destRegNum = fieldVarDsc->GetRegNum(); + } + else if (regArgTab[argNum].slot == 1) { destRegNum = varDsc->GetRegNum(); } -#if FEATURE_MULTIREG_ARGS && defined(FEATURE_SIMD) && defined(TARGET_64BIT) +#if defined(TARGET_ARM64) && defined(FEATURE_SIMD) + else if (varDsc->lvIsHfa()) + { + // This must be a SIMD type that's fully enregistered, but is passed as an HFA. + // Each field will be inserted into the same destination register. + assert(varTypeIsSIMD(varDsc) && + !compiler->isOpaqueSIMDType(varDsc->lvVerTypeInfo.GetClassHandle())); + assert(regArgTab[argNum].slot <= (int)varDsc->lvHfaSlots()); + assert(argNum > 0); + assert(regArgTab[argNum - 1].varNum == varNum); + regArgMaskLive &= ~genRegMask(regNum); + regArgTab[argNum].circular = false; + change = true; + continue; + } +#elif defined(UNIX_AMD64_ABI) && defined(FEATURE_SIMD) else { assert(regArgTab[argNum].slot == 2); @@ -3745,7 +3767,8 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere change = true; continue; } -#elif !defined(TARGET_64BIT) +#endif // defined(UNIX_AMD64_ABI) && defined(FEATURE_SIMD) +#if !defined(TARGET_64BIT) else if (regArgTab[argNum].slot == 2 && genActualType(varDsc->TypeGet()) == TYP_LONG) { destRegNum = varDsc->GetOtherReg(); @@ -4445,23 +4468,55 @@ void CodeGen::genFnPrologCalleeRegArgs(regNumber xtraReg, bool* pXtraRegClobbere destRegNum = regNum; } #endif // defined(UNIX_AMD64_ABI) && defined(FEATURE_SIMD) -#if defined(TARGET_ARM64) && defined(FEATURE_SIMD) - if (varTypeIsSIMD(varDsc) && argNum < (argMax - 1) && regArgTab[argNum + 1].slot == 2) +#ifdef TARGET_ARMARCH + if (varDsc->lvIsHfa()) { - // For a SIMD type that is passed in two integer registers, - // Code above copies the first integer argument register into the lower 8 bytes - // of the target register. Here we must handle the second 8 bytes of the slot pair by - // inserting the second integer register into the upper 8 bytes of the target - // SIMD floating point register. - argRegCount = 2; - int nextArgNum = argNum + 1; - regNumber nextRegNum = genMapRegArgNumToRegNum(nextArgNum, regArgTab[nextArgNum].getRegType(compiler)); - noway_assert(regArgTab[nextArgNum].varNum == varNum); - noway_assert(genIsValidIntReg(nextRegNum)); - noway_assert(genIsValidFloatReg(destRegNum)); - GetEmitter()->emitIns_R_R_I(INS_mov, EA_8BYTE, destRegNum, nextRegNum, 1); - } + // This includes both fixed-size SIMD types that are independently promoted, as well + // as other HFA structs. + argRegCount = varDsc->lvHfaSlots(); + if (argNum < (argMax - argRegCount + 1)) + { + if (compiler->lvaGetPromotionType(varDsc) == Compiler::PROMOTION_TYPE_INDEPENDENT) + { + // For an HFA type that is passed in multiple registers and promoted, we copy each field to its + // destination register. + for (int i = 0; i < argRegCount; i++) + { + int nextArgNum = argNum + i; + LclVarDsc* fieldVarDsc = compiler->lvaGetDesc(varDsc->lvFieldLclStart + i); + regNumber nextRegNum = + genMapRegArgNumToRegNum(nextArgNum, regArgTab[nextArgNum].getRegType(compiler)); + destRegNum = fieldVarDsc->GetRegNum(); + noway_assert(regArgTab[nextArgNum].varNum == varNum); + noway_assert(genIsValidFloatReg(nextRegNum)); + noway_assert(genIsValidFloatReg(destRegNum)); + GetEmitter()->emitIns_R_R(INS_mov, EA_8BYTE, destRegNum, nextRegNum); + } + } +#if defined(TARGET_ARM64) && defined(FEATURE_SIMD) + else + { + // For a SIMD type that is passed in multiple registers but enregistered as a vector, + // the code above copies the first argument register into the lower 4 or 8 bytes + // of the target register. Here we must handle the subsequent fields by + // inserting them into the upper bytes of the target SIMD floating point register. + argRegCount = varDsc->lvHfaSlots(); + for (int i = 1; i < argRegCount; i++) + { + int nextArgNum = argNum + i; + regArgElem* nextArgElem = ®ArgTab[nextArgNum]; + var_types nextArgType = nextArgElem->getRegType(compiler); + regNumber nextRegNum = genMapRegArgNumToRegNum(nextArgNum, nextArgType); + noway_assert(nextArgElem->varNum == varNum); + noway_assert(genIsValidFloatReg(nextRegNum)); + noway_assert(genIsValidFloatReg(destRegNum)); + GetEmitter()->emitIns_R_R_I_I(INS_mov, EA_4BYTE, destRegNum, nextRegNum, i, 0); + } + } #endif // defined(TARGET_ARM64) && defined(FEATURE_SIMD) + } + } +#endif // TARGET_ARMARCH // Mark the rest of the argument registers corresponding to this multi-reg type as // being processed and no longer live. @@ -4582,10 +4637,8 @@ void CodeGen::genCheckUseBlockInit() { assert(!compiler->compGeneratingProlog); - unsigned initStkLclCnt = 0; // The number of int-sized stack local variables that need to be initialized (variables - // larger than int count for more than 1). - unsigned largeGcStructs = 0; // The number of "large" structs with GC pointers. Used as part of the heuristic to - // determine whether to use block init. + unsigned initStkLclCnt = 0; // The number of int-sized stack local variables that need to be initialized (variables + // larger than int count for more than 1). unsigned varNum; LclVarDsc* varDsc; @@ -4686,55 +4739,7 @@ void CodeGen::genCheckUseBlockInit() counted = true; } } - - continue; - } - - /* Ignore if not a pointer variable or value class with a GC field */ - - if (!varDsc->HasGCPtr()) - { - continue; - } - -// TODO-Review: The code below is currently unreachable. We are guaranteed to execute one of the -// 'continue' statements above. -#if 0 - /* If we don't know lifetimes of variables, must be conservative */ - if (!compiler->backendRequiresLocalVarLifetimes()) - { - varDsc->lvMustInit = true; - noway_assert(!varDsc->lvRegister); } - else - { - if (!varDsc->lvTracked) - { - varDsc->lvMustInit = true; - } - } - - /* Is this a 'must-init' stack pointer local? */ - - if (varDsc->lvMustInit && varDsc->lvOnFrame && !counted) - { - if (varDsc->TypeGet() == TYP_STRUCT) - { - initStkLclCnt += varDsc->GetLayout()->GetGCPtrCount(); - } - else - { - assert(varTypeIsGC(varDsc->TypeGet())); - initStkLclCnt += 1; - } - counted = true; - } - - if ((compiler->lvaLclSize(varNum) > (3 * TARGET_POINTER_SIZE)) && (largeGcStructs <= 4)) - { - largeGcStructs++; - } -#endif } /* Don't forget about spill temps that hold pointers */ @@ -4760,10 +4765,9 @@ void CodeGen::genCheckUseBlockInit() // Current heuristic is to use block init when more than 4 stores // are required. // - // Secondary factor is the presence of large structs that - // potentially only need some fields set to zero. We likely don't - // model this very well, but have left the logic as is for now. - + // TODO: Consider taking into account the presence of large structs that + // potentially only need some fields set to zero. + // // Compiler::fgVarNeedsExplicitZeroInit relies on this logic to // find structs that are guaranteed to be block initialized. // If this logic changes, Compiler::fgVarNeedsExplicitZeroInit needs @@ -4775,15 +4779,15 @@ void CodeGen::genCheckUseBlockInit() // We can clear using aligned SIMD so the threshold is lower, // and clears in order which is better for auto-prefetching - genUseBlockInit = (genInitStkLclCnt > (largeGcStructs + 4)); + genUseBlockInit = (genInitStkLclCnt > 4); #else // !defined(TARGET_AMD64) - genUseBlockInit = (genInitStkLclCnt > (largeGcStructs + 8)); + genUseBlockInit = (genInitStkLclCnt > 8); #endif #else - genUseBlockInit = (genInitStkLclCnt > (largeGcStructs + 4)); + genUseBlockInit = (genInitStkLclCnt > 4); #endif // TARGET_64BIT @@ -4821,7 +4825,7 @@ void CodeGen::genCheckUseBlockInit() */ #if defined(TARGET_ARM64) -void CodeGen::genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegModified) +void CodeGen::genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegZeroed) #else void CodeGen::genPushCalleeSavedRegisters() #endif @@ -4873,7 +4877,7 @@ void CodeGen::genPushCalleeSavedRegisters() // - Generate fully interruptible code for loops that contains calls // - Generate fully interruptible code for leaf methods // - // Given the limited benefit from this optimization (<10k for mscorlib NGen image), the extra complexity + // Given the limited benefit from this optimization (<10k for CoreLib NGen image), the extra complexity // is not worth it. // rsPushRegs |= RBM_LR; // We must save the return address (in the LR register) @@ -5310,8 +5314,7 @@ void CodeGen::genPushCalleeSavedRegisters() JITDUMP(" spAdjustment2=%d\n", spAdjustment2); - genPrologSaveRegPair(REG_FP, REG_LR, alignmentAdjustment2, -spAdjustment2, false, initReg, - pInitRegModified); + genPrologSaveRegPair(REG_FP, REG_LR, alignmentAdjustment2, -spAdjustment2, false, initReg, pInitRegZeroed); offset += spAdjustment2; // Now subtract off the #outsz (or the rest of the #outsz if it was unaligned, and the above "sub" @@ -5331,13 +5334,13 @@ void CodeGen::genPushCalleeSavedRegisters() // We've already established the frame pointer, so no need to report the stack pointer change to unwind // info. - genStackPointerAdjustment(-spAdjustment3, initReg, pInitRegModified, /* reportUnwindData */ false); + genStackPointerAdjustment(-spAdjustment3, initReg, pInitRegZeroed, /* reportUnwindData */ false); offset += spAdjustment3; } else { genPrologSaveRegPair(REG_FP, REG_LR, compiler->lvaOutgoingArgSpaceSize, -remainingFrameSz, false, initReg, - pInitRegModified); + pInitRegZeroed); offset += remainingFrameSz; offsetSpToSavedFp = compiler->lvaOutgoingArgSpaceSize; @@ -5369,7 +5372,7 @@ void CodeGen::genPushCalleeSavedRegisters() JITDUMP(" remainingFrameSz=%d\n", remainingFrameSz); // We've already established the frame pointer, so no need to report the stack pointer change to unwind info. - genStackPointerAdjustment(-remainingFrameSz, initReg, pInitRegModified, /* reportUnwindData */ false); + genStackPointerAdjustment(-remainingFrameSz, initReg, pInitRegZeroed, /* reportUnwindData */ false); offset += remainingFrameSz; } else @@ -6098,17 +6101,17 @@ void CodeGen::genPopCalleeSavedRegisters(bool jmpEpilog) #endif // TARGET* -// We need a register with value zero. Zero the initReg, if necessary, and set *pInitRegModified if so. +// We need a register with value zero. Zero the initReg, if necessary, and set *pInitRegZeroed if so. // Return the register to use. On ARM64, we never touch the initReg, and always just return REG_ZR. -regNumber CodeGen::genGetZeroReg(regNumber initReg, bool* pInitRegModified) +regNumber CodeGen::genGetZeroReg(regNumber initReg, bool* pInitRegZeroed) { #ifdef TARGET_ARM64 return REG_ZR; #else // !TARGET_ARM64 - if (*pInitRegModified) + if (*pInitRegZeroed == false) { instGen_Set_Reg_To_Zero(EA_PTRSIZE, initReg); - *pInitRegModified = false; + *pInitRegZeroed = true; } return initReg; #endif // !TARGET_ARM64 @@ -6118,14 +6121,14 @@ regNumber CodeGen::genGetZeroReg(regNumber initReg, bool* pInitRegModified) // genZeroInitFrame: Zero any untracked pointer locals and/or initialize memory for locspace // // Arguments: -// untrLclHi - (Untracked locals High-Offset) The upper bound offset at which the zero init -// code will end initializing memory (not inclusive). -// untrLclLo - (Untracked locals Low-Offset) The lower bound at which the zero init code will -// start zero initializing memory. -// initReg - A scratch register (that gets set to zero on some platforms). -// pInitRegModified - Sets a flag that tells the callee whether or not the initReg register got zeroed. -// -void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, bool* pInitRegModified) +// untrLclHi - (Untracked locals High-Offset) The upper bound offset at which the zero init +// code will end initializing memory (not inclusive). +// untrLclLo - (Untracked locals Low-Offset) The lower bound at which the zero init code will +// start zero initializing memory. +// initReg - A scratch register (that gets set to zero on some platforms). +// pInitRegZeroed - OUT parameter. *pInitRegZeroed is set to 'true' if this method sets initReg register to zero, +// 'false' if initReg was set to a non-zero value, and left unchanged if initReg was not touched. +void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, bool* pInitRegZeroed) { assert(compiler->compGeneratingProlog); @@ -6200,8 +6203,8 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, #else // !define(TARGET_ARM) - rAddr = initReg; - *pInitRegModified = true; + rAddr = initReg; + *pInitRegZeroed = false; #endif // !defined(TARGET_ARM) @@ -6242,7 +6245,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, // Load immediate into the InitReg register instGen_Set_Reg_To_Imm(EA_PTRSIZE, initReg, (ssize_t)untrLclLo); GetEmitter()->emitIns_R_R_R(INS_add, EA_PTRSIZE, rAddr, genFramePointerReg(), initReg); - *pInitRegModified = true; + *pInitRegZeroed = false; } if (useLoop) @@ -6254,7 +6257,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, } #if defined(TARGET_ARM) - rZero1 = genGetZeroReg(initReg, pInitRegModified); + rZero1 = genGetZeroReg(initReg, pInitRegZeroed); instGen_Set_Reg_To_Zero(EA_PTRSIZE, rZero2); target_ssize_t stmImm = (target_ssize_t)(genRegMask(rZero1) | genRegMask(rZero2)); #endif // TARGET_ARM @@ -6343,7 +6346,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, #endif if (blkSize < minSimdSize) { - zeroReg = genGetZeroReg(initReg, pInitRegModified); + zeroReg = genGetZeroReg(initReg, pInitRegZeroed); int i = 0; for (; i + REGSIZE_BYTES <= blkSize; i += REGSIZE_BYTES) @@ -6405,7 +6408,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, assert(alignmentLoBlkSize < XMM_REGSIZE_BYTES); assert((alignedLclLo - alignmentLoBlkSize) == untrLclLo); - zeroReg = genGetZeroReg(initReg, pInitRegModified); + zeroReg = genGetZeroReg(initReg, pInitRegZeroed); int i = 0; for (; i + REGSIZE_BYTES <= alignmentLoBlkSize; i += REGSIZE_BYTES) @@ -6513,7 +6516,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, emit->emitIns_J(INS_jne, nullptr, -5); // initReg will be zero at end of the loop - *pInitRegModified = false; + *pInitRegZeroed = true; } if (untrLclHi != alignedLclHi) @@ -6522,7 +6525,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, assert(alignmentHiBlkSize < XMM_REGSIZE_BYTES); assert((alignedLclHi + alignmentHiBlkSize) == untrLclHi); - zeroReg = genGetZeroReg(initReg, pInitRegModified); + zeroReg = genGetZeroReg(initReg, pInitRegZeroed); int i = 0; for (; i + REGSIZE_BYTES <= alignmentHiBlkSize; i += REGSIZE_BYTES) @@ -6589,13 +6592,13 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, if (layout->IsGCPtr(i)) { GetEmitter()->emitIns_S_R(ins_Store(TYP_I_IMPL), EA_PTRSIZE, - genGetZeroReg(initReg, pInitRegModified), varNum, i * REGSIZE_BYTES); + genGetZeroReg(initReg, pInitRegZeroed), varNum, i * REGSIZE_BYTES); } } } else { - regNumber zeroReg = genGetZeroReg(initReg, pInitRegModified); + regNumber zeroReg = genGetZeroReg(initReg, pInitRegZeroed); // zero out the whole thing rounded up to a single stack slot size unsigned lclSize = roundUp(compiler->lvaLclSize(varNum), (unsigned)sizeof(int)); @@ -6627,7 +6630,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, // printf("initialize untracked spillTmp [EBP-%04X]\n", stkOffs); - inst_ST_RV(ins_Store(TYP_I_IMPL), tempThis, 0, genGetZeroReg(initReg, pInitRegModified), TYP_I_IMPL); + inst_ST_RV(ins_Store(TYP_I_IMPL), tempThis, 0, genGetZeroReg(initReg, pInitRegZeroed), TYP_I_IMPL); } } @@ -6762,7 +6765,7 @@ void CodeGen::genZeroInitFrame(int untrLclHi, int untrLclLo, regNumber initReg, * ICodeManager::GetParamTypeArg(). */ -void CodeGen::genReportGenericContextArg(regNumber initReg, bool* pInitRegModified) +void CodeGen::genReportGenericContextArg(regNumber initReg, bool* pInitRegZeroed) { // For OSR the original method has set this up for us. if (compiler->opts.IsOSR()) @@ -6813,25 +6816,26 @@ void CodeGen::genReportGenericContextArg(regNumber initReg, bool* pInitRegModifi if (isFramePointerUsed()) { #if defined(TARGET_ARM) - // lvStkOffs is always valid for incoming stack-arguments, even if the argument + // GetStackOffset() is always valid for incoming stack-arguments, even if the argument // will become enregistered. // On Arm compiler->compArgSize doesn't include r11 and lr sizes and hence we need to add 2*REGSIZE_BYTES - noway_assert((2 * REGSIZE_BYTES <= varDsc->lvStkOffs) && - (size_t(varDsc->lvStkOffs) < compiler->compArgSize + 2 * REGSIZE_BYTES)); + noway_assert((2 * REGSIZE_BYTES <= varDsc->GetStackOffset()) && + (size_t(varDsc->GetStackOffset()) < compiler->compArgSize + 2 * REGSIZE_BYTES)); #else - // lvStkOffs is always valid for incoming stack-arguments, even if the argument + // GetStackOffset() is always valid for incoming stack-arguments, even if the argument // will become enregistered. - noway_assert((0 < varDsc->lvStkOffs) && (size_t(varDsc->lvStkOffs) < compiler->compArgSize)); + noway_assert((0 < varDsc->GetStackOffset()) && (size_t(varDsc->GetStackOffset()) < compiler->compArgSize)); #endif } // We will just use the initReg since it is an available register // and we are probably done using it anyway... - reg = initReg; - *pInitRegModified = true; + reg = initReg; + *pInitRegZeroed = false; // mov reg, [compiler->info.compTypeCtxtArg] - GetEmitter()->emitIns_R_AR(ins_Load(TYP_I_IMPL), EA_PTRSIZE, reg, genFramePointerReg(), varDsc->lvStkOffs); + GetEmitter()->emitIns_R_AR(ins_Load(TYP_I_IMPL), EA_PTRSIZE, reg, genFramePointerReg(), + varDsc->GetStackOffset()); regSet.verifyRegUsed(reg); } @@ -7509,8 +7513,8 @@ void CodeGen::genFnProlog() continue; } - signed int loOffs = varDsc->lvStkOffs; - signed int hiOffs = varDsc->lvStkOffs + compiler->lvaLclSize(varNum); + signed int loOffs = varDsc->GetStackOffset(); + signed int hiOffs = varDsc->GetStackOffset() + compiler->lvaLclSize(varNum); /* We need to know the offset range of tracked stack GC refs */ /* We assume that the GC reference can be anywhere in the TYP_STRUCT */ @@ -7672,9 +7676,13 @@ void CodeGen::genFnProlog() /* Choose the register to use for zero initialization */ - regNumber initReg = REG_SCRATCH; // Unless we find a better register below - bool initRegModified = true; - regMaskTP excludeMask = intRegState.rsCalleeRegArgMaskLiveIn; + regNumber initReg = REG_SCRATCH; // Unless we find a better register below + + // Track if initReg holds non-zero value. Start conservative and assume it has non-zero value. + // If initReg is ever set to zero, this variable is set to true and zero initializing initReg + // will be skipped. + bool initRegZeroed = false; + regMaskTP excludeMask = intRegState.rsCalleeRegArgMaskLiveIn; regMaskTP tempMask; // We should not use the special PINVOKE registers as the initReg @@ -7807,11 +7815,11 @@ void CodeGen::genFnProlog() // been calculated to be one of the callee-saved registers (say, if all the integer argument registers are // in use, and perhaps with other conditions being satisfied). This is ok in other cases, after the callee-saved // registers have been saved. So instead of letting genAllocLclFrame use initReg as a temporary register, - // always use REG_SCRATCH. We don't care if it trashes it, so ignore the initRegModified output argument. - bool ignoreInitRegModified = true; - genAllocLclFrame(compiler->compLclFrameSize, REG_SCRATCH, &ignoreInitRegModified, + // always use REG_SCRATCH. We don't care if it trashes it, so ignore the initRegZeroed output argument. + bool ignoreInitRegZeroed = false; + genAllocLclFrame(compiler->compLclFrameSize, REG_SCRATCH, &ignoreInitRegZeroed, intRegState.rsCalleeRegArgMaskLiveIn); - genPushCalleeSavedRegisters(initReg, &initRegModified); + genPushCalleeSavedRegisters(initReg, &initRegZeroed); #else // !TARGET_ARM64 genPushCalleeSavedRegisters(); #endif // !TARGET_ARM64 @@ -7855,7 +7863,7 @@ void CodeGen::genFnProlog() if (maskStackAlloc == RBM_NONE) { - genAllocLclFrame(compiler->compLclFrameSize, initReg, &initRegModified, intRegState.rsCalleeRegArgMaskLiveIn); + genAllocLclFrame(compiler->compLclFrameSize, initReg, &initRegZeroed, intRegState.rsCalleeRegArgMaskLiveIn); } #endif // !TARGET_ARM64 @@ -7906,7 +7914,7 @@ void CodeGen::genFnProlog() #else // mov [lvaStubArgumentVar], EAX GetEmitter()->emitIns_AR_R(ins_Store(TYP_I_IMPL), EA_PTRSIZE, REG_SECRET_STUB_PARAM, genFramePointerReg(), - compiler->lvaTable[compiler->lvaStubArgumentVar].lvStkOffs); + compiler->lvaTable[compiler->lvaStubArgumentVar].GetStackOffset()); #endif assert(intRegState.rsCalleeRegArgMaskLiveIn & RBM_SECRET_STUB_PARAM); @@ -7918,11 +7926,11 @@ void CodeGen::genFnProlog() // Zero out the frame as needed // - genZeroInitFrame(untrLclHi, untrLclLo, initReg, &initRegModified); + genZeroInitFrame(untrLclHi, untrLclLo, initReg, &initRegZeroed); #if defined(FEATURE_EH_FUNCLETS) - genSetPSPSym(initReg, &initRegModified); + genSetPSPSym(initReg, &initRegZeroed); #else // !FEATURE_EH_FUNCLETS @@ -7935,10 +7943,10 @@ void CodeGen::genFnProlog() // Zero out the slot for nesting level 0 unsigned firstSlotOffs = filterEndOffsetSlotOffs - TARGET_POINTER_SIZE; - if (initRegModified) + if (!initRegZeroed) { instGen_Set_Reg_To_Zero(EA_PTRSIZE, initReg); - initRegModified = false; + initRegZeroed = true; } GetEmitter()->emitIns_S_R(ins_Store(TYP_I_IMPL), EA_PTRSIZE, initReg, compiler->lvaShadowSPslotsVar, @@ -7947,7 +7955,7 @@ void CodeGen::genFnProlog() #endif // !FEATURE_EH_FUNCLETS - genReportGenericContextArg(initReg, &initRegModified); + genReportGenericContextArg(initReg, &initRegZeroed); #ifdef JIT32_GCENCODER // Initialize the LocalAllocSP slot if there is localloc in the function. @@ -7959,7 +7967,7 @@ void CodeGen::genFnProlog() // Set up the GS security cookie - genSetGSSecurityCookie(initReg, &initRegModified); + genSetGSSecurityCookie(initReg, &initRegZeroed); #ifdef PROFILING_SUPPORTED @@ -7967,7 +7975,7 @@ void CodeGen::genFnProlog() // OSR methods aren't called, so don't have enter hooks. if (!compiler->opts.IsOSR()) { - genProfilingEnterCallback(initReg, &initRegModified); + genProfilingEnterCallback(initReg, &initRegZeroed); } #endif // PROFILING_SUPPORTED @@ -8029,15 +8037,15 @@ void CodeGen::genFnProlog() } else { - xtraReg = REG_SCRATCH; - initRegModified = true; + xtraReg = REG_SCRATCH; + initRegZeroed = false; } genFnPrologCalleeRegArgs(xtraReg, &xtraRegClobbered, regState); if (xtraRegClobbered) { - initRegModified = true; + initRegZeroed = false; } } } @@ -8057,7 +8065,7 @@ void CodeGen::genFnProlog() if (regMask & initRegs) { // Check if we have already zeroed this register - if ((reg == initReg) && !initRegModified) + if ((reg == initReg) && initRegZeroed) { continue; } @@ -8066,7 +8074,7 @@ void CodeGen::genFnProlog() instGen_Set_Reg_To_Zero(EA_PTRSIZE, reg); if (reg == initReg) { - initRegModified = false; + initRegZeroed = true; } } } @@ -8078,17 +8086,17 @@ void CodeGen::genFnProlog() // If initReg is not in initRegs then we will use REG_SCRATCH if ((genRegMask(initReg) & initRegs) == 0) { - initReg = REG_SCRATCH; - initRegModified = true; + initReg = REG_SCRATCH; + initRegZeroed = false; } #ifdef TARGET_ARM // This is needed only for Arm since it can use a zero initialized int register // to initialize vfp registers. - if (initRegModified) + if (!initRegZeroed) { instGen_Set_Reg_To_Zero(EA_PTRSIZE, initReg); - initRegModified = false; + initRegZeroed = true; } #endif // TARGET_ARM @@ -8155,7 +8163,7 @@ void CodeGen::genFnProlog() LclVarDsc* lastArg = &compiler->lvaTable[compiler->info.compArgsCount - 1]; noway_assert(!lastArg->lvRegister); - signed offset = lastArg->lvStkOffs; + signed offset = lastArg->GetStackOffset(); assert(offset != BAD_STK_OFFS); noway_assert(lastArg->lvFramePointerBased); @@ -8393,7 +8401,7 @@ void CodeGen::genFnEpilog(BasicBlock* block) // otherwise the target address doesn't fit in an immediate // so we have to burn a register... - __fallthrough; + FALLTHROUGH; case IAT_PVALUE: // Load the address into a register, load indirect and call through a register @@ -9095,12 +9103,12 @@ void CodeGen::genFuncletProlog(BasicBlock* block) maskArgRegsLiveIn = RBM_R0; } - regNumber initReg = REG_R3; // R3 is never live on entry to a funclet, so it can be trashed - bool initRegModified = true; + regNumber initReg = REG_R3; // R3 is never live on entry to a funclet, so it can be trashed + bool initRegZeroed = false; if (maskStackAlloc == RBM_NONE) { - genAllocLclFrame(genFuncletInfo.fiSpDelta, initReg, &initRegModified, maskArgRegsLiveIn); + genAllocLclFrame(genFuncletInfo.fiSpDelta, initReg, &initRegZeroed, maskArgRegsLiveIn); } // This is the end of the OS-reported prolog for purposes of unwinding @@ -9397,10 +9405,10 @@ void CodeGen::genFuncletProlog(BasicBlock* block) maskArgRegsLiveIn = RBM_ARG_0 | RBM_ARG_2; } - regNumber initReg = REG_EBP; // We already saved EBP, so it can be trashed - bool initRegModified = true; + regNumber initReg = REG_EBP; // We already saved EBP, so it can be trashed + bool initRegZeroed = false; - genAllocLclFrame(genFuncletInfo.fiSpDelta, initReg, &initRegModified, maskArgRegsLiveIn); + genAllocLclFrame(genFuncletInfo.fiSpDelta, initReg, &initRegZeroed, maskArgRegsLiveIn); // Callee saved float registers are copied to stack in their assigned stack slots // after allocating space for them as part of funclet frame. @@ -9739,7 +9747,7 @@ void CodeGen::genCaptureFuncletPrologEpilogInfo() * correctly reported, the PSPSym could be omitted in some cases.) *********************************** */ -void CodeGen::genSetPSPSym(regNumber initReg, bool* pInitRegModified) +void CodeGen::genSetPSPSym(regNumber initReg, bool* pInitRegZeroed) { assert(compiler->compGeneratingProlog); @@ -9785,8 +9793,8 @@ void CodeGen::genSetPSPSym(regNumber initReg, bool* pInitRegModified) // We will just use the initReg since it is an available register // and we are probably done using it anyway... - regNumber regTmp = initReg; - *pInitRegModified = true; + regNumber regTmp = initReg; + *pInitRegZeroed = false; GetEmitter()->emitIns_R_R_I(INS_add, EA_PTRSIZE, regTmp, regBase, callerSPOffs); GetEmitter()->emitIns_S_R(INS_str, EA_PTRSIZE, regTmp, compiler->lvaPSPSym, 0); @@ -9797,8 +9805,8 @@ void CodeGen::genSetPSPSym(regNumber initReg, bool* pInitRegModified) // We will just use the initReg since it is an available register // and we are probably done using it anyway... - regNumber regTmp = initReg; - *pInitRegModified = true; + regNumber regTmp = initReg; + *pInitRegZeroed = false; GetEmitter()->emitIns_R_R_Imm(INS_add, EA_PTRSIZE, regTmp, REG_SPBASE, SPtoCallerSPdelta); GetEmitter()->emitIns_S_R(INS_str, EA_PTRSIZE, regTmp, compiler->lvaPSPSym, 0); @@ -10103,7 +10111,7 @@ var_types Compiler::GetHfaType(GenTree* tree) unsigned Compiler::GetHfaCount(GenTree* tree) { - return GetHfaCount(gtGetStructHandleIfPresent(tree)); + return GetHfaCount(gtGetStructHandle(tree)); } var_types Compiler::GetHfaType(CORINFO_CLASS_HANDLE hClass) @@ -10663,8 +10671,8 @@ 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].lvStkOffs; - unsigned varOffset = compiler->lvaTable[varNum].lvStkOffs; + unsigned cookieOffset = compiler->lvaTable[compiler->lvaVarargsHandleArg].GetStackOffset(); + unsigned varOffset = compiler->lvaTable[varNum].GetStackOffset(); noway_assert(cookieOffset < varOffset); unsigned offset = varOffset - cookieOffset; @@ -11646,7 +11654,7 @@ void CodeGen::genStructReturn(GenTree* treeNode) if (actualOp1->OperIs(GT_LCL_VAR)) { varDsc = compiler->lvaGetDesc(actualOp1->AsLclVar()->GetLclNum()); - retTypeDesc.InitializeStructReturnType(compiler, varDsc->lvVerTypeInfo.GetClassHandle()); + retTypeDesc.InitializeStructReturnType(compiler, varDsc->GetStructHnd()); assert(varDsc->lvIsMultiRegRet); } else @@ -11831,13 +11839,17 @@ void CodeGen::genMultiRegStoreToLocal(GenTreeLclVar* lclNode) fieldVarDsc->SetRegNum(varReg); } else + { + varReg = REG_STK; + } + if ((varReg == REG_STK) || fieldVarDsc->lvLiveInOutOfHndlr) { if (!lclNode->AsLclVar()->IsLastUse(i)) { GetEmitter()->emitIns_S_R(ins_Store(type), emitTypeSize(type), reg, fieldLclNum, 0); } - fieldVarDsc->SetRegNum(REG_STK); } + fieldVarDsc->SetRegNum(varReg); } else { diff --git a/src/coreclr/src/jit/codegeninterface.h b/src/coreclr/src/jit/codegeninterface.h index ec0090467836..43782ef96c0c 100644 --- a/src/coreclr/src/jit/codegeninterface.h +++ b/src/coreclr/src/jit/codegeninterface.h @@ -490,7 +490,7 @@ class CodeGenInterface regNumber vlsrReg; } vlStkReg; - // VLT_STK2 -- Any 64 bit value which is on the stack, in 2 successsive DWords + // VLT_STK2 -- Any 64 bit value which is on the stack, in 2 successive DWords // eg 2 DWords at [ESP+0x10] struct diff --git a/src/coreclr/src/jit/codegenlinear.cpp b/src/coreclr/src/jit/codegenlinear.cpp index 5ce369b52424..f3f52e7fb77b 100644 --- a/src/coreclr/src/jit/codegenlinear.cpp +++ b/src/coreclr/src/jit/codegenlinear.cpp @@ -344,7 +344,6 @@ void CodeGen::genCodeForBBlist() needLabel = true; } -#if defined(DEBUG) || defined(LATE_DISASM) // We also want to start a new Instruction group by calling emitAddLabel below, // when we need accurate bbWeights for this block in the emitter. We force this // whenever our previous block was a BBJ_COND and it has a different weight than us. @@ -356,7 +355,6 @@ void CodeGen::genCodeForBBlist() { needLabel = true; } -#endif // DEBUG || LATE_DISASM if (needLabel) { @@ -722,7 +720,7 @@ void CodeGen::genCodeForBBlist() case BBJ_EHCATCHRET: genEHCatchRet(block); - __fallthrough; + FALLTHROUGH; case BBJ_EHFINALLYRET: case BBJ_EHFILTERRET: @@ -733,6 +731,7 @@ void CodeGen::genCodeForBBlist() case BBJ_EHCATCHRET: noway_assert(!"Unexpected BBJ_EHCATCHRET"); // not used on x86 + break; case BBJ_EHFINALLYRET: case BBJ_EHFILTERRET: @@ -1824,7 +1823,7 @@ void CodeGen::genPutArgStkFieldList(GenTreePutArgStk* putArgStk, unsigned outArg // We can't write beyond the arg area unless this is a tail call, in which case we use // the first stack arg as the base of the incoming arg area. #ifdef DEBUG - size_t areaSize = compiler->lvaLclSize(outArgVarNum); + unsigned areaSize = compiler->lvaLclSize(outArgVarNum); #if FEATURE_FASTTAILCALL if (putArgStk->gtCall->IsFastTailCall()) { diff --git a/src/coreclr/src/jit/codegenxarch.cpp b/src/coreclr/src/jit/codegenxarch.cpp index e65dda6b46c7..259f33147023 100644 --- a/src/coreclr/src/jit/codegenxarch.cpp +++ b/src/coreclr/src/jit/codegenxarch.cpp @@ -53,14 +53,14 @@ void CodeGen::genSetRegToIcon(regNumber reg, ssize_t val, var_types type, insFla // genSetGSSecurityCookie: Set the "GS" security cookie in the prolog. // // Arguments: -// initReg - register to use as a scratch register -// pInitRegModified - OUT parameter. *pInitRegModified is set to 'true' if and only if -// this call sets 'initReg' to a non-zero value. +// initReg - register to use as a scratch register +// pInitRegZeroed - OUT parameter. *pInitRegZeroed is set to 'false' if and only if +// this call sets 'initReg' to a non-zero value. // // Return Value: // None // -void CodeGen::genSetGSSecurityCookie(regNumber initReg, bool* pInitRegModified) +void CodeGen::genSetGSSecurityCookie(regNumber initReg, bool* pInitRegZeroed) { assert(compiler->compGeneratingProlog); @@ -84,7 +84,7 @@ void CodeGen::genSetGSSecurityCookie(regNumber initReg, bool* pInitRegModified) // initReg = #GlobalSecurityCookieVal64; [frame.GSSecurityCookie] = initReg genSetRegToIcon(initReg, compiler->gsGlobalSecurityCookieVal, TYP_I_IMPL); GetEmitter()->emitIns_S_R(INS_mov, EA_PTRSIZE, initReg, compiler->lvaGSSecurityCookie, 0); - *pInitRegModified = true; + *pInitRegZeroed = false; } else #endif @@ -105,7 +105,7 @@ void CodeGen::genSetGSSecurityCookie(regNumber initReg, bool* pInitRegModified) GetEmitter()->emitIns_S_R(INS_mov, EA_PTRSIZE, REG_EAX, compiler->lvaGSSecurityCookie, 0); if (initReg == REG_EAX) { - *pInitRegModified = true; + *pInitRegZeroed = false; } } } @@ -788,7 +788,8 @@ void CodeGen::genCodeForDivMod(GenTreeOp* treeNode) genCopyRegIfNeeded(dividend, REG_RAX); // zero or sign extend rax to rdx - if (oper == GT_UMOD || oper == GT_UDIV) + if (oper == GT_UMOD || oper == GT_UDIV || + (dividend->IsIntegralConst() && (dividend->AsIntConCommon()->IconValue() > 0))) { instGen_Set_Reg_To_Zero(EA_PTRSIZE, REG_EDX); } @@ -1480,7 +1481,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) #ifdef TARGET_X86 assert(!treeNode->IsIconHandle(GTF_ICON_TLS_HDL)); #endif // TARGET_X86 - __fallthrough; + FALLTHROUGH; case GT_CNS_DBL: genSetRegToConst(targetReg, targetType, treeNode); @@ -1503,7 +1504,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) genCodeForBinary(treeNode->AsOp()); break; } - __fallthrough; + FALLTHROUGH; case GT_MOD: case GT_UMOD: case GT_UDIV: @@ -1515,7 +1516,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) case GT_AND: assert(varTypeIsIntegralOrI(treeNode)); - __fallthrough; + FALLTHROUGH; #if !defined(TARGET_64BIT) case GT_ADD_LO: @@ -1769,7 +1770,7 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) // Have to clear the ShadowSP of the nesting level which encloses the finally. Generates: // mov dword ptr [ebp-0xC], 0 // for some slot of the ShadowSP local var - unsigned finallyNesting; + size_t finallyNesting; finallyNesting = treeNode->AsVal()->gtVal1; noway_assert(treeNode->AsVal()->gtVal1 < compiler->compHndBBtabCount); noway_assert(finallyNesting < compiler->compHndBBtabCount); @@ -1781,9 +1782,10 @@ void CodeGen::genCodeForTreeNode(GenTree* treeNode) filterEndOffsetSlotOffs = (unsigned)(compiler->lvaLclSize(compiler->lvaShadowSPslotsVar) - TARGET_POINTER_SIZE); - unsigned curNestingSlotOffs; + size_t curNestingSlotOffs; curNestingSlotOffs = filterEndOffsetSlotOffs - ((finallyNesting + 1) * TARGET_POINTER_SIZE); - GetEmitter()->emitIns_S_I(INS_mov, EA_PTRSIZE, compiler->lvaShadowSPslotsVar, curNestingSlotOffs, 0); + GetEmitter()->emitIns_S_I(INS_mov, EA_PTRSIZE, compiler->lvaShadowSPslotsVar, (unsigned)curNestingSlotOffs, + 0); break; #endif // !FEATURE_EH_FUNCLETS @@ -1950,19 +1952,16 @@ void CodeGen::genMultiRegStoreToSIMDLocal(GenTreeLclVar* lclNode) // genAllocLclFrame: Probe the stack and allocate the local stack frame - subtract from SP. // // Arguments: -// frameSize - the size of the stack frame being allocated. -// initReg - register to use as a scratch register. -// pInitRegModified - OUT parameter. *pInitRegModified is set to 'true' if and only if -// this call sets 'initReg' to a non-zero value. -// maskArgRegsLiveIn - incoming argument registers that are currently live. +// frameSize - the size of the stack frame being allocated. +// initReg - register to use as a scratch register. +// pInitRegZeroed - OUT parameter. *pInitRegZeroed is set to 'false' if and only if +// this call sets 'initReg' to a non-zero value. +// maskArgRegsLiveIn - incoming argument registers that are currently live. // // Return value: // None // -void CodeGen::genAllocLclFrame(unsigned frameSize, - regNumber initReg, - bool* pInitRegModified, - regMaskTP maskArgRegsLiveIn) +void CodeGen::genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pInitRegZeroed, regMaskTP maskArgRegsLiveIn) { assert(compiler->compGeneratingProlog); @@ -2046,7 +2045,7 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, if (initReg == REG_DEFAULT_HELPER_CALL_TARGET) { - *pInitRegModified = true; + *pInitRegZeroed = false; } static_assert_no_msg((RBM_STACK_PROBE_HELPER_TRASH & RBM_STACK_PROBE_HELPER_ARG) == RBM_NONE); @@ -2056,7 +2055,7 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, if (initReg == REG_STACK_PROBE_HELPER_ARG) { - *pInitRegModified = true; + *pInitRegZeroed = false; } } @@ -2109,13 +2108,13 @@ void CodeGen::genStackPointerConstantAdjustment(ssize_t spDelta, regNumber regTm // creating a way to temporarily turn off the emitter's tracking of ESP, maybe marking instrDescs as "don't // track". inst_RV_RV(INS_mov, regTmp, REG_SPBASE, TYP_I_IMPL); - inst_RV_IV(INS_sub, regTmp, -spDelta, EA_PTRSIZE); + inst_RV_IV(INS_sub, regTmp, (target_ssize_t)-spDelta, EA_PTRSIZE); inst_RV_RV(INS_mov, REG_SPBASE, regTmp, TYP_I_IMPL); } else #endif // TARGET_X86 { - inst_RV_IV(INS_sub, REG_SPBASE, -spDelta, EA_PTRSIZE); + inst_RV_IV(INS_sub, REG_SPBASE, (target_ssize_t)-spDelta, EA_PTRSIZE); } } @@ -3690,18 +3689,28 @@ void CodeGen::genRangeCheck(GenTree* oper) noway_assert(oper->OperIsBoundsCheck()); GenTreeBoundsChk* bndsChk = oper->AsBoundsChk(); - GenTree* arrIndex = bndsChk->gtIndex; - GenTree* arrLen = bndsChk->gtArrLen; - GenTree* arrRef = nullptr; - int lenOffset = 0; + GenTree* arrIndex = bndsChk->gtIndex; + GenTree* arrLen = bndsChk->gtArrLen; GenTree * src1, *src2; emitJumpKind jmpKind; + instruction cmpKind; genConsumeRegs(arrIndex); genConsumeRegs(arrLen); - if (arrIndex->isContainedIntOrIImmed()) + if (arrIndex->IsIntegralConst(0) && arrLen->isUsedFromReg()) + { + // arrIndex is 0 and arrLen is in a reg. In this case + // we can generate + // test reg, reg + // since arrLen is non-negative + src1 = arrLen; + src2 = arrLen; + jmpKind = EJ_je; + cmpKind = INS_test; + } + else if (arrIndex->isContainedIntOrIImmed()) { // arrIndex is a contained constant. In this case // we will generate one of the following @@ -3714,6 +3723,7 @@ void CodeGen::genRangeCheck(GenTree* oper) src1 = arrLen; src2 = arrIndex; jmpKind = EJ_jbe; + cmpKind = INS_cmp; } else { @@ -3722,7 +3732,7 @@ void CodeGen::genRangeCheck(GenTree* oper) // cmp [mem], immed (if arrLen is a constant) // cmp [mem], reg (if arrLen is in a reg) // cmp reg, immed (if arrIndex is in a reg) - // cmp reg1, reg2 (if arraIndex is in reg1) + // cmp reg1, reg2 (if arrIndex is in reg1) // cmp reg, [mem] (if arrLen is a memory op) // // That is only one of arrIndex or arrLen can be a memory op. @@ -3731,6 +3741,7 @@ void CodeGen::genRangeCheck(GenTree* oper) src1 = arrIndex; src2 = arrLen; jmpKind = EJ_jae; + cmpKind = INS_cmp; } var_types bndsChkType = src2->TypeGet(); @@ -3742,7 +3753,7 @@ void CodeGen::genRangeCheck(GenTree* oper) assert(emitTypeSize(bndsChkType) >= emitTypeSize(src1->TypeGet())); #endif // DEBUG - GetEmitter()->emitInsBinary(INS_cmp, emitTypeSize(bndsChkType), src1, src2); + GetEmitter()->emitInsBinary(cmpKind, emitTypeSize(bndsChkType), src1, src2); genJumpToThrowHlpBlk(jmpKind, bndsChk->gtThrowKind, bndsChk->gtIndRngFailBB); } @@ -4069,10 +4080,11 @@ void CodeGen::genCodeForShift(GenTree* tree) if (shiftBy->isContainedIntOrIImmed()) { + emitAttr size = emitTypeSize(tree); + // Optimize "X<<1" to "lea [reg+reg]" or "add reg, reg" if (tree->OperIs(GT_LSH) && !tree->gtOverflowEx() && !tree->gtSetFlags() && shiftBy->IsIntegralConst(1)) { - emitAttr size = emitTypeSize(tree); if (tree->GetRegNum() == operandReg) { GetEmitter()->emitIns_R_R(INS_add, size, tree->GetRegNum(), operandReg); @@ -4084,6 +4096,21 @@ void CodeGen::genCodeForShift(GenTree* tree) } else { + int shiftByValue = (int)shiftBy->AsIntConCommon()->IconValue(); + +#if defined(TARGET_64BIT) + // Try to emit rorx if BMI2 is available instead of mov+rol + // it makes sense only for 64bit integers + if ((genActualType(targetType) == TYP_LONG) && (tree->GetRegNum() != operandReg) && + compiler->compOpportunisticallyDependsOn(InstructionSet_BMI2) && tree->OperIs(GT_ROL, GT_ROR) && + (shiftByValue > 0) && (shiftByValue < 64)) + { + const int value = tree->OperIs(GT_ROL) ? (64 - shiftByValue) : shiftByValue; + GetEmitter()->emitIns_R_R_I(INS_rorx, size, tree->GetRegNum(), operandReg, value); + genProduceReg(tree); + return; + } +#endif // First, move the operand to the destination register and // later on perform the shift in-place. // (LSRA will try to avoid this situation through preferencing.) @@ -4091,9 +4118,7 @@ void CodeGen::genCodeForShift(GenTree* tree) { inst_RV_RV(INS_mov, tree->GetRegNum(), operandReg, targetType); } - - int shiftByValue = (int)shiftBy->AsIntConCommon()->IconValue(); - inst_RV_SH(ins, emitTypeSize(tree), tree->GetRegNum(), shiftByValue); + inst_RV_SH(ins, size, tree->GetRegNum(), shiftByValue); } } else @@ -4159,7 +4184,7 @@ void CodeGen::genCodeForShiftLong(GenTree* tree) assert(shiftBy->isContainedIntOrIImmed()); - unsigned int count = shiftBy->AsIntConCommon()->IconValue(); + unsigned int count = (unsigned int)shiftBy->AsIntConCommon()->IconValue(); regNumber regResult = (oper == GT_LSH_HI) ? regHi : regLo; @@ -5017,7 +5042,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) #if defined(TARGET_X86) || defined(UNIX_AMD64_ABI) // The call will pop its arguments. // for each putarg_stk: - ssize_t stackArgBytes = 0; + target_ssize_t stackArgBytes = 0; for (GenTreeCall::Use& use : call->Args()) { GenTree* arg = use.GetNode(); @@ -5163,7 +5188,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call) // adjust its stack level accordingly. // If the caller needs to explicitly pop its arguments, we must pass a negative value, and then do the // pop when we're done. - ssize_t argSizeForEmitter = stackArgBytes; + target_ssize_t argSizeForEmitter = stackArgBytes; if (fCallerPop) { argSizeForEmitter = -stackArgBytes; @@ -5636,7 +5661,7 @@ void CodeGen::genJmpMethod(GenTree* jmp) #if defined(UNIX_AMD64_ABI) if (varTypeIsStruct(varDsc)) { - CORINFO_CLASS_HANDLE typeHnd = varDsc->lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE typeHnd = varDsc->GetStructHnd(); assert(typeHnd != nullptr); SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR structDesc; @@ -5932,6 +5957,27 @@ void CodeGen::genCompareInt(GenTree* treeNode) } else if (op1->isUsedFromReg() && op2->IsIntegralConst(0)) { + emitAttr targetSize = emitActualTypeSize(op1->TypeGet()); + emitAttr op1Size = emitActualTypeSize(op1->TypeGet()); + + // Optimize "x<0" and "x>=0" to "x>>31" if "x" is not a jump condition and in a reg. + // Morph/Lowering are responsible to rotate "00" so we won't handle it here. + if ((targetSize >= 4) && (op1Size >= 4) && (targetReg != REG_NA) && tree->OperIs(GT_LT, GT_GE)) + { + if (targetReg != op1->GetRegNum()) + { + inst_RV_RV(INS_mov, targetReg, op1->GetRegNum(), op1->TypeGet()); + } + if (tree->OperIs(GT_GE)) + { + // emit "not" for "x>=0" case + inst_RV(INS_not, targetReg, tree->TypeGet(), op1Size); + } + inst_RV_IV(INS_shr_N, targetReg, (int)op1Size * 8 - 1, op1Size); + genProduceReg(tree); + return; + } + if (compiler->opts.OptimizationEnabled()) { canReuseFlags = true; @@ -6744,105 +6790,47 @@ int CodeGenInterface::genCallerSPtoInitialSPdelta() const void CodeGen::genSSE2BitwiseOp(GenTree* treeNode) { regNumber targetReg = treeNode->GetRegNum(); - var_types targetType = treeNode->TypeGet(); - assert(varTypeIsFloating(targetType)); - - float f; - double d; - CORINFO_FIELD_HANDLE* bitMask = nullptr; - instruction ins = INS_invalid; - void* cnsAddr = nullptr; - bool dblAlign = false; - - switch (treeNode->OperGet()) - { - case GT_NEG: - // Neg(x) = flip the sign bit. - // Neg(f) = f ^ 0x80000000 - // Neg(d) = d ^ 0x8000000000000000 - ins = INS_xorps; - if (targetType == TYP_FLOAT) - { - bitMask = &negBitmaskFlt; - - static_assert_no_msg(sizeof(float) == sizeof(int)); - *((int*)&f) = 0x80000000; - cnsAddr = &f; - } - else - { - bitMask = &negBitmaskDbl; - - static_assert_no_msg(sizeof(double) == sizeof(__int64)); - *((__int64*)&d) = 0x8000000000000000LL; - cnsAddr = &d; - dblAlign = true; - } - break; - - case GT_INTRINSIC: - assert(treeNode->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Abs); - - // Abs(x) = set sign-bit to zero - // Abs(f) = f & 0x7fffffff - // Abs(d) = d & 0x7fffffffffffffff - ins = INS_andps; - if (targetType == TYP_FLOAT) - { - bitMask = &absBitmaskFlt; + regNumber operandReg = genConsumeReg(treeNode->gtGetOp1()); + emitAttr size = emitTypeSize(treeNode); - static_assert_no_msg(sizeof(float) == sizeof(int)); - *((int*)&f) = 0x7fffffff; - cnsAddr = &f; - } - else - { - bitMask = &absBitmaskDbl; + assert(varTypeIsFloating(treeNode->TypeGet())); + assert(treeNode->gtGetOp1()->isUsedFromReg()); - static_assert_no_msg(sizeof(double) == sizeof(__int64)); - *((__int64*)&d) = 0x7fffffffffffffffLL; - cnsAddr = &d; - dblAlign = true; - } - break; + CORINFO_FIELD_HANDLE* maskFld = nullptr; + UINT64 mask = 0; + instruction ins = INS_invalid; - default: - assert(!"genSSE2: unsupported oper"); - unreached(); - break; + if (treeNode->OperIs(GT_NEG)) + { + // Neg(x) = flip the sign bit. + // Neg(f) = f ^ 0x80000000 x4 (packed) + // Neg(d) = d ^ 0x8000000000000000 x2 (packed) + ins = INS_xorps; + mask = treeNode->TypeIs(TYP_FLOAT) ? 0x8000000080000000UL : 0x8000000000000000UL; + maskFld = treeNode->TypeIs(TYP_FLOAT) ? &negBitmaskFlt : &negBitmaskDbl; } - - if (*bitMask == nullptr) + else if (treeNode->OperIs(GT_INTRINSIC)) { - assert(cnsAddr != nullptr); - - UNATIVE_OFFSET cnsSize = genTypeSize(targetType); - UNATIVE_OFFSET cnsAlign = (compiler->compCodeOpt() != Compiler::SMALL_CODE) ? cnsSize : 1; - - *bitMask = GetEmitter()->emitAnyConst(cnsAddr, cnsSize, cnsAlign); + assert(treeNode->AsIntrinsic()->gtIntrinsicName == NI_System_Math_Abs); + // Abs(x) = set sign-bit to zero + // Abs(f) = f & 0x7fffffff x4 (packed) + // Abs(d) = d & 0x7fffffffffffffff x2 (packed) + ins = INS_andps; + mask = treeNode->TypeIs(TYP_FLOAT) ? 0x7fffffff7fffffffUL : 0x7fffffffffffffffUL; + maskFld = treeNode->TypeIs(TYP_FLOAT) ? &absBitmaskFlt : &absBitmaskDbl; } - - // We need an additional register for bitmask. - regNumber tmpReg = treeNode->GetSingleTempReg(); - - // Move operand into targetReg only if the reg reserved for - // internal purpose is not the same as targetReg. - GenTree* op1 = treeNode->AsOp()->gtOp1; - assert(op1->isUsedFromReg()); - regNumber operandReg = genConsumeReg(op1); - if (tmpReg != targetReg) + else { - if (operandReg != targetReg) - { - inst_RV_RV(ins_Copy(targetType), targetReg, operandReg, targetType); - } + assert(!"genSSE2BitwiseOp: unsupported oper"); + } - operandReg = tmpReg; + if (*maskFld == nullptr) + { + UINT64 maskPack[] = {mask, mask}; + *maskFld = GetEmitter()->emitBlkConst(&maskPack, 16, 16, treeNode->TypeGet()); } - GetEmitter()->emitIns_R_C(ins_Load(targetType, false), emitTypeSize(targetType), tmpReg, *bitMask, 0); - assert(ins != INS_invalid); - inst_RV_RV(ins, targetReg, operandReg, targetType); + GetEmitter()->emitIns_SIMD_R_R_C(ins, size, targetReg, operandReg, *maskFld, 0); } //----------------------------------------------------------------------------------------- @@ -6859,7 +6847,7 @@ void CodeGen::genSSE2BitwiseOp(GenTree* treeNode) // ii) treeNode oper is a GT_INTRINSIC // iii) treeNode type is a floating point type // iv) treeNode is not used from memory -// v) tree oper is CORINFO_INTRINSIC_Round, _Ceiling, or _Floor +// v) tree oper is NI_System_Math{F}_Round, _Ceiling, or _Floor // vi) caller of this routine needs to call genProduceReg() void CodeGen::genSSE41RoundOp(GenTreeOp* treeNode) { @@ -6887,18 +6875,18 @@ void CodeGen::genSSE41RoundOp(GenTreeOp* treeNode) unsigned ival = 0; - // v) tree oper is CORINFO_INTRINSIC_Round, _Ceiling, or _Floor - switch (treeNode->AsIntrinsic()->gtIntrinsicId) + // v) tree oper is NI_System_Math{F}_Round, _Ceiling, or _Floor + switch (treeNode->AsIntrinsic()->gtIntrinsicName) { - case CORINFO_INTRINSIC_Round: + case NI_System_Math_Round: ival = 4; break; - case CORINFO_INTRINSIC_Ceiling: + case NI_System_Math_Ceiling: ival = 10; break; - case CORINFO_INTRINSIC_Floor: + case NI_System_Math_Floor: ival = 9; break; @@ -6934,9 +6922,11 @@ void CodeGen::genSSE41RoundOp(GenTreeOp* treeNode) switch (memBase->OperGet()) { case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: { + assert(memBase->isContained()); varNum = memBase->AsLclVarCommon()->GetLclNum(); - offset = 0; + offset = memBase->AsLclVarCommon()->GetLclOffs(); // Ensure that all the GenTreeIndir values are set to their defaults. assert(memBase->GetRegNum() == REG_NA); @@ -7020,9 +7010,9 @@ void CodeGen::genSSE41RoundOp(GenTreeOp* treeNode) void CodeGen::genIntrinsic(GenTree* treeNode) { // Right now only Sqrt/Abs are treated as math intrinsics. - switch (treeNode->AsIntrinsic()->gtIntrinsicId) + switch (treeNode->AsIntrinsic()->gtIntrinsicName) { - case CORINFO_INTRINSIC_Sqrt: + case NI_System_Math_Sqrt: { // Both operand and its result must be of the same floating point type. GenTree* srcNode = treeNode->AsOp()->gtOp1; @@ -7034,13 +7024,13 @@ void CodeGen::genIntrinsic(GenTree* treeNode) break; } - case CORINFO_INTRINSIC_Abs: + case NI_System_Math_Abs: genSSE2BitwiseOp(treeNode); break; - case CORINFO_INTRINSIC_Round: - case CORINFO_INTRINSIC_Ceiling: - case CORINFO_INTRINSIC_Floor: + case NI_System_Math_Round: + case NI_System_Math_Ceiling: + case NI_System_Math_Floor: genSSE41RoundOp(treeNode->AsOp()); break; @@ -8121,13 +8111,13 @@ void* CodeGen::genCreateAndStoreGCInfoJIT32(unsigned codeSize, if (0) { - BYTE* temp = (BYTE*)infoPtr; - unsigned size = compiler->compInfoBlkAddr - temp; - BYTE* ptab = temp + headerSize; + BYTE* temp = (BYTE*)infoPtr; + size_t size = compiler->compInfoBlkAddr - temp; + BYTE* ptab = temp + headerSize; noway_assert(size == headerSize + ptrMapSize); - printf("Method info block - header [%u bytes]:", headerSize); + printf("Method info block - header [%zu bytes]:", headerSize); for (unsigned i = 0; i < size; i++) { @@ -8155,7 +8145,7 @@ void* CodeGen::genCreateAndStoreGCInfoJIT32(unsigned codeSize, if (compiler->opts.dspGCtbls) { const BYTE* base = (BYTE*)infoPtr; - unsigned size; + size_t size; unsigned methodSize; InfoHdr dumpHeader; @@ -8237,7 +8227,7 @@ void CodeGen::genCreateAndStoreGCInfoX64(unsigned codeSize, unsigned prologSize unsigned reversePInvokeFrameVarNumber = compiler->lvaReversePInvokeFrameVar; assert(reversePInvokeFrameVarNumber != BAD_VAR_NUM && reversePInvokeFrameVarNumber < compiler->lvaRefCount); LclVarDsc& reversePInvokeFrameVar = compiler->lvaTable[reversePInvokeFrameVarNumber]; - gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar.lvStkOffs); + gcInfoEncoder->SetReversePInvokeFrameSlot(reversePInvokeFrameVar.GetStackOffset()); } gcInfoEncoder->Build(); @@ -8450,9 +8440,8 @@ void CodeGen::genAmd64EmitterUnitTests() // genProfilingEnterCallback: Generate the profiling function enter callback. // // Arguments: -// initReg - register to use as scratch register -// pInitRegModified - OUT parameter. *pInitRegModified set to 'true' if 'initReg' is -// not zero after this call. +// initReg - register to use as scratch register +// pInitRegZeroed - OUT parameter. This variable remains unchanged. // // Return Value: // None @@ -8471,7 +8460,7 @@ void CodeGen::genAmd64EmitterUnitTests() // 4. All registers are preserved. // 5. The helper pops the FunctionIDOrClientID argument from the stack. // -void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModified) +void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegZeroed) { assert(compiler->compGeneratingProlog); @@ -8514,7 +8503,7 @@ void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModifie EA_UNKNOWN); // retSize // Check that we have place for the push. - assert(compiler->fgPtrArgCntMax >= 1); + assert(compiler->fgGetPtrArgCntMax() >= 1); #if defined(UNIX_X86_ABI) // Restoring alignment manually. This is similar to CodeGen::genRemoveAlignmentAfterCall @@ -8595,7 +8584,7 @@ void CodeGen::genProfilingLeaveCallback(unsigned helper) genEmitHelperCall(helper, argSize, EA_UNKNOWN /* retSize */); // Check that we have place for the push. - assert(compiler->fgPtrArgCntMax >= 1); + assert(compiler->fgGetPtrArgCntMax() >= 1); #if defined(UNIX_X86_ABI) // Restoring alignment manually. This is similar to CodeGen::genRemoveAlignmentAfterCall @@ -8616,14 +8605,14 @@ void CodeGen::genProfilingLeaveCallback(unsigned helper) // genProfilingEnterCallback: Generate the profiling function enter callback. // // Arguments: -// initReg - register to use as scratch register -// pInitRegModified - OUT parameter. *pInitRegModified set to 'true' if 'initReg' is -// not zero after this call. +// initReg - register to use as scratch register +// pInitRegZeroed - OUT parameter. *pInitRegZeroed is set to 'false' if and only if +// this call sets 'initReg' to a non-zero value. // // Return Value: // None // -void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModified) +void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegZeroed) { assert(compiler->compGeneratingProlog); @@ -8760,7 +8749,7 @@ void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModifie // If initReg is one of RBM_CALLEE_TRASH, then it needs to be zero'ed before using. if ((RBM_CALLEE_TRASH & genRegMask(initReg)) != 0) { - *pInitRegModified = true; + *pInitRegZeroed = false; } #else // !defined(UNIX_AMD64_ABI) @@ -8809,7 +8798,7 @@ void CodeGen::genProfilingEnterCallback(regNumber initReg, bool* pInitRegModifie // If initReg is one of RBM_CALLEE_TRASH, then it needs to be zero'ed before using. if ((RBM_CALLEE_TRASH & genRegMask(initReg)) != 0) { - *pInitRegModified = true; + *pInitRegZeroed = false; } #endif // !defined(UNIX_AMD64_ABI) diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index c78ee4477e0d..0c6ef1ddd1a7 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -22,6 +22,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #include "stacklevelsetter.h" #include "jittelemetry.h" #include "patchpointinfo.h" +#include "jitstd/algorithm.h" #if defined(DEBUG) // Column settings for COMPlus_JitDumpIR. We could(should) make these programmable. @@ -1112,7 +1113,7 @@ var_types Compiler::getReturnTypeForStruct(CORINFO_CLASS_HANDLE clsHnd, /////////////////////////////////////////////////////////////////////////////// // -// MEASURE_NOWAY: code to measure and rank dynamic occurences of noway_assert. +// MEASURE_NOWAY: code to measure and rank dynamic occurrences of noway_assert. // (Just the appearances of noway_assert, whether the assert is true or false.) // This might help characterize the cost of noway_assert in non-DEBUG builds, // or determine which noway_assert should be simple DEBUG-only asserts. @@ -1207,12 +1208,13 @@ struct NowayAssertCountMap { } - static int __cdecl compare(const void* elem1, const void* elem2) + struct compare { - NowayAssertCountMap* e1 = (NowayAssertCountMap*)elem1; - NowayAssertCountMap* e2 = (NowayAssertCountMap*)elem2; - return (int)((ssize_t)e2->count - (ssize_t)e1->count); // sort in descending order - } + bool operator()(const NowayAssertCountMap& elem1, const NowayAssertCountMap& elem2) + { + return (ssize_t)elem2.count < (ssize_t)elem1.count; // sort in descending order + } + }; }; void DisplayNowayAssertMap() @@ -1249,7 +1251,7 @@ void DisplayNowayAssertMap() ++i; } - qsort(nacp, count, sizeof(nacp[0]), NowayAssertCountMap::compare); + jitstd::sort(nacp, nacp + count, NowayAssertCountMap::compare()); if (fout == jitstdout) { @@ -1689,6 +1691,7 @@ void Compiler::compShutdown() fprintf(fout, "---------------------------------------------------\n"); fprintf(fout, " badCode: %u\n", fatal_badCode); fprintf(fout, " noWay: %u\n", fatal_noWay); + fprintf(fout, " implLimitation: %u\n", fatal_implLimitation); fprintf(fout, " NOMEM: %u\n", fatal_NOMEM); fprintf(fout, " noWayAssertBody: %u\n", fatal_noWayAssertBody); #ifdef DEBUG @@ -1764,6 +1767,10 @@ void Compiler::compInit(ArenaAllocator* pAlloc, info.compPerfScore = 0.0; #endif // defined(DEBUG) || defined(LATE_DISASM) +#if defined(DEBUG) || defined(INLINE_DATA) + info.compMethodHashPrivate = 0; +#endif // defined(DEBUG) || defined(INLINE_DATA) + #ifdef DEBUG // Opt-in to jit stress based on method hash ranges. // @@ -1872,7 +1879,6 @@ void Compiler::compInit(ArenaAllocator* pAlloc, #ifdef DEBUG compCodeGenDone = false; - compRegSetCheckLevel = 0; opts.compMinOptsIsUsed = false; #endif opts.compMinOptsIsSet = false; @@ -2270,7 +2276,7 @@ void Compiler::compSetProcessor() instructionSetFlags.RemoveInstructionSet(InstructionSet_PCLMULQDQ); } - // We need to additionaly check that COMPlus_EnableSSE3_4 is set, as that + // We need to additionally check that COMPlus_EnableSSE3_4 is set, as that // is a prexisting config flag that controls the SSE3+ ISAs if (!JitConfig.EnableSSE3() || !JitConfig.EnableSSE3_4()) { @@ -2481,7 +2487,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags) { // The following flags are lost when inlining. (They are removed in // Compiler::fgInvokeInlineeCompiler().) - assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_BBOPT)); assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_BBINSTR)); assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_PROF_ENTERLEAVE)); assert(!jitFlags->IsSet(JitFlags::JIT_FLAG_DEBUG_EnC)); @@ -2736,6 +2741,49 @@ void Compiler::compInitOptions(JitFlags* jitFlags) opts.compFastTailCalls = true; #endif // FEATURE_FASTTAILCALL + // Profile data + // + fgBlockCounts = nullptr; + fgProfileData_ILSizeMismatch = false; + fgNumProfileRuns = 0; + if (jitFlags->IsSet(JitFlags::JIT_FLAG_BBOPT)) + { + HRESULT hr; + hr = info.compCompHnd->getMethodBlockCounts(info.compMethodHnd, &fgBlockCountsCount, &fgBlockCounts, + &fgNumProfileRuns); + + JITDUMP("BBOPT set -- VM query for profile data for %s returned: hr=%0x; counts at %p, %d blocks, %d runs\n", + info.compFullName, hr, fgBlockCounts, fgBlockCountsCount, fgNumProfileRuns); + + // a failed result that also has a non-NULL fgBlockCounts + // indicates that the ILSize for the method no longer matches + // the ILSize for the method when profile data was collected. + // + // We will discard the IBC data in this case + // + if (FAILED(hr) && (fgBlockCounts != nullptr)) + { + fgProfileData_ILSizeMismatch = true; + fgBlockCounts = nullptr; + } +#ifdef DEBUG + // A successful result implies a non-NULL fgBlockCounts + // + if (SUCCEEDED(hr)) + { + assert(fgBlockCounts != nullptr); + } + + // A failed result implies a NULL fgBlockCounts + // see implementation of Compiler::fgHaveProfileData() + // + if (FAILED(hr)) + { + assert(fgBlockCounts == nullptr); + } +#endif + } + if (compIsForInlining()) { return; @@ -2767,13 +2815,13 @@ void Compiler::compInitOptions(JitFlags* jitFlags) #ifdef DEBUG opts.dspInstrs = false; - opts.dspEmit = false; opts.dspLines = false; opts.varNames = false; opts.dmpHex = false; opts.disAsm = false; opts.disAsmSpilled = false; opts.disDiffable = false; + opts.disAddr = false; opts.dspCode = false; opts.dspEHTable = false; opts.dspDebugInfo = false; @@ -2899,6 +2947,10 @@ void Compiler::compInitOptions(JitFlags* jitFlags) } } } + if (opts.disAsm && JitConfig.JitDisasmWithGC()) + { + opts.disasmWithGC = true; + } #ifdef LATE_DISASM if (JitConfig.JitLateDisasm().contains(info.compMethodName, info.compClassName, &info.compMethodInfo->args)) @@ -2912,6 +2964,12 @@ void Compiler::compInitOptions(JitFlags* jitFlags) opts.dspDiffable = true; } + // This one applies to both Ngen/Jit Disasm output: COMPlus_JitDasmWithAddress=1 + if (JitConfig.JitDasmWithAddress() != 0) + { + opts.disAddr = true; + } + if (JitConfig.JitLongAddress() != 0) { opts.compLongAddress = true; @@ -3143,45 +3201,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags) #endif } - fgBlockCounts = nullptr; - fgProfileData_ILSizeMismatch = false; - fgNumProfileRuns = 0; - if (jitFlags->IsSet(JitFlags::JIT_FLAG_BBOPT)) - { - assert(!compIsForInlining()); - HRESULT hr; - hr = info.compCompHnd->getMethodBlockCounts(info.compMethodHnd, &fgBlockCountsCount, &fgBlockCounts, - &fgNumProfileRuns); - - // a failed result that also has a non-NULL fgBlockCounts - // indicates that the ILSize for the method no longer matches - // the ILSize for the method when profile data was collected. - // - // We will discard the IBC data in this case - // - if (FAILED(hr) && (fgBlockCounts != nullptr)) - { - fgProfileData_ILSizeMismatch = true; - fgBlockCounts = nullptr; - } -#ifdef DEBUG - // A successful result implies a non-NULL fgBlockCounts - // - if (SUCCEEDED(hr)) - { - assert(fgBlockCounts != nullptr); - } - - // A failed result implies a NULL fgBlockCounts - // see implementation of Compiler::fgHaveProfileData() - // - if (FAILED(hr)) - { - assert(fgBlockCounts == nullptr); - } -#endif - } - #ifdef DEBUG // Now, set compMaxUncheckedOffsetForNullObject for STRESS_NULL_OBJECT_CHECK if (compStressCompile(STRESS_NULL_OBJECT_CHECK, 30)) @@ -3250,18 +3269,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags) } #endif - opts.compGCPollType = GCPOLL_NONE; - if (jitFlags->IsSet(JitFlags::JIT_FLAG_GCPOLL_CALLS)) - { - opts.compGCPollType = GCPOLL_CALL; - } - else if (jitFlags->IsSet(JitFlags::JIT_FLAG_GCPOLL_INLINE)) - { - // make sure that the EE didn't set both flags. - assert(opts.compGCPollType == GCPOLL_NONE); - opts.compGCPollType = GCPOLL_INLINE; - } - #ifdef PROFILING_SUPPORTED #ifdef UNIX_AMD64_ABI if (compIsProfilerHookNeeded()) @@ -3320,7 +3327,7 @@ const LPCWSTR Compiler::s_compStressModeNames[STRESS_COUNT + 1] = { //------------------------------------------------------------------------ // compStressCompile: determine if a stress mode should be enabled // -// Argumemnts: +// Arguments: // stressArea - stress mode to possibly enable // weight - percent of time this mode should be turned on // (range 0 to 100); weight 0 effectively disables @@ -3371,7 +3378,7 @@ bool Compiler::compStressCompile(compStressArea stressArea, unsigned weight) //------------------------------------------------------------------------ // compStressCompileHelper: helper to determine if a stress mode should be enabled // -// Argumemnts: +// Arguments: // stressArea - stress mode to possibly enable // weight - percent of time this mode should be turned on // (range 0 to 100); weight 0 effectively disables @@ -4019,29 +4026,39 @@ bool Compiler::compRsvdRegCheck(FrameLayoutState curState) // compGetTieringName: get a string describing tiered compilation settings // for this method // +// Arguments: +// wantShortName - true if a short name is ok (say for using in file names) +// // Returns: // String describing tiering decisions for this method, including cases // where the jit codegen will differ from what the runtime requested. // -const char* Compiler::compGetTieringName() const +const char* Compiler::compGetTieringName(bool wantShortName) const { - bool tier0 = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0); - bool tier1 = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER1); + const bool tier0 = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0); + const bool tier1 = opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER1); assert(!tier0 || !tier1); // We don't expect multiple TIER flags to be set at one time. if (tier0) { - return "Tier-0"; + return "Tier0"; } else if (tier1) { - return "Tier-1"; + if (opts.jitFlags->IsSet(JitFlags::JIT_FLAG_OSR)) + { + return "Tier1-OSR"; + } + else + { + return "Tier1"; + } } else if (opts.OptimizationEnabled()) { if (compSwitchedToOptimized) { - return "Tier-0 switched to FullOpts"; + return wantShortName ? "Tier0-FullOpts" : "Tier-0 switched to FullOpts"; } else { @@ -4054,11 +4071,11 @@ const char* Compiler::compGetTieringName() const { if (compSwitchedToOptimized) { - return "Tier-0 switched to FullOpts, then to MinOpts"; + return wantShortName ? "Tier0-FullOpts-MinOpts" : "Tier-0 switched to FullOpts, then to MinOpts"; } else { - return "Tier-1/FullOpts switched to MinOpts"; + return wantShortName ? "Tier0-MinOpts" : "Tier-0 switched MinOpts"; } } else @@ -4072,7 +4089,7 @@ const char* Compiler::compGetTieringName() const } else { - return "Unknown optimization level"; + return wantShortName ? "Unknown" : "Unknown optimization level"; } } @@ -4200,9 +4217,7 @@ void Compiler::EndPhase(Phases phase) pCompJitTimer->EndPhase(this, phase); } #endif -#if DUMP_FLOWGRAPHS - fgDumpFlowGraph(phase); -#endif // DUMP_FLOWGRAPHS + mostRecentlyActivePhase = phase; } @@ -4220,7 +4235,7 @@ void Compiler::EndPhase(Phases phase) // code:CILJit::compileMethod function. // // For an overview of the structure of the JIT, see: -// https://github.com/dotnet/runtime/blob/master/docs/design/coreclr/botr/ryujit-overview.md +// https://github.com/dotnet/runtime/blob/master/docs/design/coreclr/jit/ryujit-overview.md // // Also called for inlinees, though they will only be run through the first few phases. // @@ -4530,7 +4545,11 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags // Compute bbNum, bbRefs and bbPreds // - // This is the first time full (not cheap) preds will be computed + // This is the first time full (not cheap) preds will be computed. + // And, if we have profile data, we can now check integrity. + // + // From this point on the flowgraph information such as bbNum, + // bbRefs or bbPreds has to be kept updated. // auto computePredsPhase = [this]() { JITDUMP("\nRenumbering the basic blocks for fgComputePred\n"); @@ -4557,9 +4576,6 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags DoPhase(this, PHASE_EARLY_UPDATE_FLOW_GRAPH, earlyUpdateFlowGraphPhase); } - // From this point on the flowgraph information such as bbNum, - // bbRefs or bbPreds has to be kept updated - // // Promote struct locals // auto promoteStructsPhase = [this]() { @@ -4590,6 +4606,7 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags // Morph the trees in all the blocks of the method // auto morphGlobalPhase = [this]() { + unsigned prevBBCount = fgBBcount; fgMorphBlocks(); // Fix any LclVar annotations on discarded struct promotion temps for implicit by-ref args @@ -4614,6 +4631,12 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags compCurBB = nullptr; #endif // DEBUG + // If we needed to create any new BasicBlocks then renumber the blocks + if (fgBBcount > prevBBCount) + { + fgRenumberBlocks(); + } + // We can now enable all phase checking activePhaseChecks = PhaseChecks::CHECK_ALL; }; @@ -4622,6 +4645,7 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags // GS security checks for unsafe buffers // auto gsPhase = [this]() { + unsigned prevBBCount = fgBBcount; if (getNeedsGSSecurityCookie()) { gsGSChecksInitCookie(); @@ -4630,6 +4654,12 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags { gsCopyShadowParams(); } + + // If we needed to create any new BasicBlocks then renumber the blocks + if (fgBBcount > prevBBCount) + { + fgRenumberBlocks(); + } } else { @@ -4638,18 +4668,6 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags }; DoPhase(this, PHASE_GS_COOKIE, gsPhase); - // If we need to emit GC Poll calls, mark the blocks that need them now. - // This is conservative and can be optimized later. - // - // GC Poll marking assumes block bbnums match lexical block order, - // so make sure this is the case. - // - auto gcPollPhase = [this]() { - fgRenumberBlocks(); - fgMarkGCPollBlocks(); - }; - DoPhase(this, PHASE_MARK_GC_POLL_BLOCKS, gcPollPhase); - // Compute the block and edge weights // DoPhase(this, PHASE_COMPUTE_EDGE_WEIGHTS, &Compiler::fgComputeBlockAndEdgeWeights); @@ -4913,10 +4931,13 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags m_pLowering = new (this, CMK_LSRA) Lowering(this, m_pLinearScan); // PHASE_LOWERING m_pLowering->Run(); - // Set stack levels - // +#if !defined(OSX_ARM64_ABI) + // Set stack levels; this information is necessary for x86 + // but on other platforms it is used only in asserts. + // TODO: do not run it in release on other platforms, see https://github.com/dotnet/runtime/issues/42673. StackLevelSetter stackLevelSetter(this); stackLevelSetter.Run(); +#endif // !OSX_ARM64_ABI // We can not add any new tracked variables after this point. lvaTrackedFixed = true; @@ -4945,6 +4966,8 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags { #if MEASURE_CLRAPI_CALLS EndPhase(PHASE_CLR_API); +#else + EndPhase(PHASE_POST_EMIT); #endif pCompJitTimer->Terminate(this, CompTimeSummaryInfo::s_compTimeSummary, true); } @@ -5018,7 +5041,7 @@ void Compiler::generatePatchpointInfo() assert(varDsc->lvFramePointerBased); // Record FramePtr relative offset (no localloc yet) - patchpointInfo->SetOffset(lclNum, varDsc->lvStkOffs); + patchpointInfo->SetOffset(lclNum, varDsc->GetStackOffset()); // Note if IL stream contained an address-of that potentially leads to exposure. // This bit of IL may be skipped by OSR partial importation. @@ -5051,7 +5074,7 @@ void Compiler::generatePatchpointInfo() { assert(lvaGSSecurityCookie != BAD_VAR_NUM); LclVarDsc* const varDsc = lvaGetDesc(lvaGSSecurityCookie); - patchpointInfo->SetSecurityCookieOffset(varDsc->lvStkOffs); + patchpointInfo->SetSecurityCookieOffset(varDsc->GetStackOffset()); JITDUMP("--OSR-- security cookie V%02u offset is FP %d\n", lvaGSSecurityCookie, patchpointInfo->SecurityCookieOffset()); } @@ -5287,10 +5310,6 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr, verbose = compIsForInlining() ? impInlineInfo->InlinerCompiler->verbose : false; #endif -#if defined(DEBUG) || defined(INLINE_DATA) - info.compMethodHashPrivate = 0; -#endif // defined(DEBUG) || defined(INLINE_DATA) - #if FUNC_INFO_LOGGING LPCWSTR tmpJitFuncInfoFilename = JitConfig.JitFuncInfoFile(); @@ -5304,9 +5323,9 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr, compJitFuncInfoFile = _wfopen(compJitFuncInfoFilename, W("a")); if (compJitFuncInfoFile == nullptr) { -#if defined(DEBUG) && !defined(TARGET_UNIX) // no 'perror' in the PAL +#if defined(DEBUG) && !defined(HOST_UNIX) // no 'perror' in the PAL perror("Failed to open JitFuncInfoLogFile"); -#endif // defined(DEBUG) && !defined(TARGET_UNIX) +#endif // defined(DEBUG) && !defined(HOST_UNIX) } } } @@ -6091,7 +6110,7 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr, #ifdef DEBUG /* Give the function a unique number */ - if (opts.disAsm || opts.dspEmit || verbose) + if (opts.disAsm || verbose) { compMethodID = ~info.compMethodHash() & 0xffff; } @@ -6322,15 +6341,21 @@ void Compiler::compInitVarScopeMap() } } -int __cdecl genCmpLocalVarLifeBeg(const void* elem1, const void* elem2) +struct genCmpLocalVarLifeBeg { - return (*((VarScopeDsc**)elem1))->vsdLifeBeg - (*((VarScopeDsc**)elem2))->vsdLifeBeg; -} + bool operator()(const VarScopeDsc* elem1, const VarScopeDsc* elem2) + { + return elem1->vsdLifeBeg < elem2->vsdLifeBeg; + } +}; -int __cdecl genCmpLocalVarLifeEnd(const void* elem1, const void* elem2) +struct genCmpLocalVarLifeEnd { - return (*((VarScopeDsc**)elem1))->vsdLifeEnd - (*((VarScopeDsc**)elem2))->vsdLifeEnd; -} + bool operator()(const VarScopeDsc* elem1, const VarScopeDsc* elem2) + { + return elem1->vsdLifeEnd < elem2->vsdLifeEnd; + } +}; inline void Compiler::compInitScopeLists() { @@ -6350,8 +6375,8 @@ inline void Compiler::compInitScopeLists() compEnterScopeList[i] = compExitScopeList[i] = &info.compVarScopes[i]; } - qsort(compEnterScopeList, info.compVarScopesCount, sizeof(*compEnterScopeList), genCmpLocalVarLifeBeg); - qsort(compExitScopeList, info.compVarScopesCount, sizeof(*compExitScopeList), genCmpLocalVarLifeEnd); + jitstd::sort(compEnterScopeList, compEnterScopeList + info.compVarScopesCount, genCmpLocalVarLifeBeg()); + jitstd::sort(compExitScopeList, compExitScopeList + info.compVarScopesCount, genCmpLocalVarLifeEnd()); } void Compiler::compResetScopeLists() @@ -6809,7 +6834,9 @@ int jitNativeCode(CORINFO_METHOD_HANDLE methodHnd, result = param.result; - if (!inlineInfo && (result == CORJIT_INTERNALERROR || result == CORJIT_RECOVERABLEERROR) && !jitFallbackCompile) + if (!inlineInfo && + (result == CORJIT_INTERNALERROR || result == CORJIT_RECOVERABLEERROR || result == CORJIT_IMPLLIMITATION) && + !jitFallbackCompile) { // If we failed the JIT, reattempt with debuggable code. jitFallbackCompile = true; @@ -8726,7 +8753,7 @@ void cTreeFlags(Compiler* comp, GenTree* tree) { chars += printf("[INX_STRING_LAYOUT]"); } - __fallthrough; + FALLTHROUGH; case GT_INDEX_ADDR: if (tree->gtFlags & GTF_INX_RNGCHK) { @@ -8885,14 +8912,14 @@ void cTreeFlags(Compiler* comp, GenTree* tree) chars += printf("[ICON_STR_HDL]"); break; - case GTF_ICON_PSTR_HDL: + case GTF_ICON_CONST_PTR: - chars += printf("[ICON_PSTR_HDL]"); + chars += printf("[ICON_CONST_PTR]"); break; - case GTF_ICON_PTR_HDL: + case GTF_ICON_GLOBAL_PTR: - chars += printf("[ICON_PTR_HDL]"); + chars += printf("[ICON_GLOBAL_PTR]"); break; case GTF_ICON_VARG_HDL: @@ -8944,7 +8971,7 @@ void cTreeFlags(Compiler* comp, GenTree* tree) { chars += printf("[BLK_HASGCPTR]"); } - __fallthrough; + FALLTHROUGH; case GT_BLK: case GT_DYN_BLK: @@ -9285,3 +9312,24 @@ bool Compiler::lvaIsOSRLocal(unsigned varNum) return false; } + +//------------------------------------------------------------------------------ +// gtChangeOperToNullCheck: helper to change tree oper to a NULLCHECK. +// +// Arguments: +// tree - the node to change; +// basicBlock - basic block of the node. +// +// Notes: +// the function should not be called after lowering for platforms that do not support +// emitting NULLCHECK nodes, like arm32. Use `Lowering::TransformUnusedIndirection` +// that handles it and calls this function when appropriate. +// +void Compiler::gtChangeOperToNullCheck(GenTree* tree, BasicBlock* block) +{ + assert(tree->OperIs(GT_FIELD, GT_IND, GT_OBJ, GT_BLK, GT_DYN_BLK)); + tree->ChangeOper(GT_NULLCHECK); + tree->ChangeType(TYP_INT); + block->bbFlags |= BBF_HAS_NULLCHECK; + optMethodFlags |= OMF_HAS_NULLCHECK; +} diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index c5f571838d4b..05743b159c28 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -380,11 +380,14 @@ class LclVarDsc _lvOtherArgReg(REG_STK) , #endif // FEATURE_MULTIREG_ARGS + lvClassHnd(NO_CLASS_HANDLE) + , #if ASSERTION_PROP lvRefBlks(BlockSetOps::UninitVal()) , #endif // ASSERTION_PROP lvPerSsaData() + { } @@ -802,7 +805,20 @@ class LclVarDsc void incLvRefCntWtd(BasicBlock::weight_t delta, RefCountState state = RCS_NORMAL); void setLvRefCntWtd(BasicBlock::weight_t newValue, RefCountState state = RCS_NORMAL); - int lvStkOffs; // stack offset of home +private: + int lvStkOffs; // stack offset of home in bytes. + +public: + int GetStackOffset() const + { + return lvStkOffs; + } + + void SetStackOffset(int offset) + { + lvStkOffs = offset; + } + unsigned lvExactSize; // (exact) size of the type in bytes // Is this a promoted struct? @@ -858,7 +874,29 @@ class LclVarDsc typeInfo lvVerTypeInfo; // type info needed for verification - CORINFO_CLASS_HANDLE lvClassHnd; // class handle for the local, or null if not known + // class handle for the local or null if not known or not a class, + // for a struct handle use `GetStructHnd()`. + CORINFO_CLASS_HANDLE lvClassHnd; + + // Get class handle for a struct local or implicitByRef struct local. + CORINFO_CLASS_HANDLE GetStructHnd() const + { +#ifdef FEATURE_SIMD + if (lvSIMDType && (m_layout == nullptr)) + { + return NO_CLASS_HANDLE; + } +#endif + assert(m_layout != nullptr); +#if defined(TARGET_AMD64) || defined(TARGET_ARM64) + assert(varTypeIsStruct(TypeGet()) || (lvIsImplicitByRef && (TypeGet() == TYP_BYREF))); +#else + assert(varTypeIsStruct(TypeGet())); +#endif + CORINFO_CLASS_HANDLE structHnd = m_layout->GetClassHandle(); + assert(structHnd != NO_CLASS_HANDLE); + return structHnd; + } CORINFO_FIELD_HANDLE lvFieldHnd; // field handle for promoted struct fields @@ -942,6 +980,7 @@ class LclVarDsc void SetLayout(ClassLayout* layout) { assert(varTypeIsStruct(lvType)); + assert((m_layout == nullptr) || ClassLayout::AreCompatible(m_layout, layout)); m_layout = layout; } @@ -1420,11 +1459,28 @@ struct fgArgTabEntry unsigned structFloatRegs; #endif // UNIX_AMD64_ABI +#if defined(DEBUG_ARG_SLOTS) + // These fields were used to calculate stack size in stack slots for arguments + // but now they are replaced by precise `m_byteOffset/m_byteSize` because of + // arm64 apple abi requirements. + // A slot is a pointer sized region in the OutArg area. unsigned slotNum; // When an argument is passed in the OutArg area this is the slot number in the OutArg area unsigned numSlots; // Count of number of slots that this argument uses +#endif // DEBUG_ARG_SLOTS + + // Return number of stack slots that this argument is taking. + // TODO-Cleanup: this function does not align with arm64 apple model, + // delete it. In most cases we just want to know if we it is using stack or not + // but in some cases we are checking if it is a multireg arg, like: + // `numRegs + GetStackSlotsNumber() > 1` that is harder to replace. + // + unsigned GetStackSlotsNumber() const + { + return roundUp(GetStackByteSize(), TARGET_POINTER_SIZE) / TARGET_POINTER_SIZE; + } - unsigned alignment; // 1 or 2 (slots/registers) + unsigned byteAlignment; // usually 8 or 16 bytes (slots/registers). private: unsigned _lateArgInx; // index into gtCallLateArgs list; UINT_MAX if this is not a late arg. public: @@ -1452,13 +1508,13 @@ struct fgArgTabEntry CorInfoHFAElemType _hfaElemKind : 3; // What kind of an HFA this is (CORINFO_HFA_ELEM_NONE if it is not an HFA). #endif - bool isLateArg() + bool isLateArg() const { bool isLate = (_lateArgInx != UINT_MAX); return isLate; } - unsigned GetLateArgInx() + unsigned GetLateArgInx() const { assert(isLateArg()); return _lateArgInx; @@ -1467,12 +1523,12 @@ struct fgArgTabEntry { _lateArgInx = inx; } - regNumber GetRegNum() + regNumber GetRegNum() const { return (regNumber)regNums[0]; } - regNumber GetOtherRegNum() + regNumber GetOtherRegNum() const { return (regNumber)regNums[1]; } @@ -1492,7 +1548,7 @@ struct fgArgTabEntry return (regNumber)regNums[i]; } - bool IsSplit() + bool IsSplit() const { #ifdef FEATURE_ARG_SPLIT return _isSplit; @@ -1507,7 +1563,7 @@ struct fgArgTabEntry #endif } - bool IsVararg() + bool IsVararg() const { #ifdef FEATURE_VARARG return _isVararg; @@ -1522,7 +1578,7 @@ struct fgArgTabEntry #endif // FEATURE_VARARG } - bool IsHfaArg() + bool IsHfaArg() const { #ifdef FEATURE_HFA return IsHfa(_hfaElemKind); @@ -1531,7 +1587,7 @@ struct fgArgTabEntry #endif } - bool IsHfaRegArg() + bool IsHfaRegArg() const { #ifdef FEATURE_HFA return IsHfa(_hfaElemKind) && isPassedInRegisters(); @@ -1540,7 +1596,7 @@ struct fgArgTabEntry #endif } - unsigned intRegCount() + unsigned intRegCount() const { #if defined(UNIX_AMD64_ABI) if (this->isStruct) @@ -1557,7 +1613,7 @@ struct fgArgTabEntry return 0; } - unsigned floatRegCount() + unsigned floatRegCount() const { #if defined(UNIX_AMD64_ABI) if (this->isStruct) @@ -1574,12 +1630,22 @@ struct fgArgTabEntry return 0; } - unsigned stackSize() + // Get the number of bytes that this argument is occupying on the stack. + unsigned GetStackByteSize() const { - return (TARGET_POINTER_SIZE * this->numSlots); + if (!IsSplit() && numRegs > 0) + { + return 0; + } + + assert(!IsHfaArg() || !IsSplit()); + + assert(GetByteSize() > TARGET_POINTER_SIZE * numRegs); + unsigned stackByteSize = GetByteSize() - TARGET_POINTER_SIZE * numRegs; + return GetByteSize() - TARGET_POINTER_SIZE * numRegs; } - var_types GetHfaType() + var_types GetHfaType() const { #ifdef FEATURE_HFA return HfaTypeFromElemKind(_hfaElemKind); @@ -1594,7 +1660,7 @@ struct fgArgTabEntry if (type != TYP_UNDEF) { // We must already have set the passing mode. - assert(numRegs != 0 || numSlots != 0); + assert(numRegs != 0 || GetStackByteSize() != 0); // We originally set numRegs according to the size of the struct, but if the size of the // hfaType is not the same as the pointer size, we need to correct it. // Note that hfaSlots is the number of registers we will use. For ARM, that is twice @@ -1655,12 +1721,12 @@ struct fgArgTabEntry } #endif // !TARGET_ARM - bool isPassedInRegisters() + bool isPassedInRegisters() const { return !IsSplit() && (numRegs != 0); } - bool isPassedInFloatRegisters() + bool isPassedInFloatRegisters() const { #ifdef TARGET_X86 return false; @@ -1669,14 +1735,16 @@ struct fgArgTabEntry #endif } - bool isSingleRegOrSlot() + // Can we replace the struct type of this node with a primitive type for argument passing? + bool TryPassAsPrimitive() const { - return !IsSplit() && ((numRegs == 1) || (numSlots == 1)); + return !IsSplit() && ((numRegs == 1) || (m_byteSize <= TARGET_POINTER_SIZE)); } +#if defined(DEBUG_ARG_SLOTS) // Returns the number of "slots" used, where for this purpose a // register counts as a slot. - unsigned getSlotCount() + unsigned getSlotCount() const { if (isBackFilled) { @@ -1694,10 +1762,12 @@ struct fgArgTabEntry } return numSlots + numRegs; } +#endif +#if defined(DEBUG_ARG_SLOTS) // Returns the size as a multiple of pointer-size. // For targets without HFAs, this is the same as getSlotCount(). - unsigned getSize() + unsigned getSize() const { unsigned size = getSlotCount(); #ifdef FEATURE_HFA @@ -1730,6 +1800,43 @@ struct fgArgTabEntry return size; } +#endif // DEBUG && !OSX_ARM64_ABI + +private: + unsigned m_byteOffset; + unsigned m_byteSize; + +public: + void SetByteOffset(unsigned byteOffset) + { + DEBUG_ARG_SLOTS_ASSERT(byteOffset / TARGET_POINTER_SIZE == slotNum); + m_byteOffset = byteOffset; + } + + unsigned GetByteOffset() const + { + DEBUG_ARG_SLOTS_ASSERT(m_byteOffset / TARGET_POINTER_SIZE == slotNum); + return m_byteOffset; + } + + void SetByteSize(unsigned byteSize) + { +#if defined(DEBUG_ARG_SLOTS) + assert(byteAlignment != 0); + if (!isStruct) + { + const unsigned alignedByteSize = roundUp(byteSize, byteAlignment); + assert(alignedByteSize == getSlotCount() * TARGET_POINTER_SIZE); + } +#endif + m_byteSize = byteSize; + } + + unsigned GetByteSize() const + { + return m_byteSize; + } + // Set the register numbers for a multireg argument. // There's nothing to do on x64/Ux because the structDesc has already been used to set the // register numbers. @@ -1759,6 +1866,7 @@ struct fgArgTabEntry #endif // FEATURE_MULTIREG_ARGS && !defined(UNIX_AMD64_ABI) } +#ifdef DEBUG // Check that the value of 'isStruct' is consistent. // A struct arg must be one of the following: // - A node of struct type, @@ -1766,7 +1874,7 @@ struct fgArgTabEntry // - A node of a scalar type, passed in a single register or slot // (or two slots in the case of a struct pass on the stack as TYP_DOUBLE). // - void checkIsStruct() + void checkIsStruct() const { GenTree* node = GetNode(); if (isStruct) @@ -1776,7 +1884,8 @@ struct fgArgTabEntry // This is the case where we are passing a struct as a primitive type. // On most targets, this is always a single register or slot. // However, on ARM this could be two slots if it is TYP_DOUBLE. - bool isPassedAsPrimitiveType = ((numRegs == 1) || ((numRegs == 0) && (numSlots == 1))); + bool isPassedAsPrimitiveType = + ((numRegs == 1) || ((numRegs == 0) && (GetByteSize() <= TARGET_POINTER_SIZE))); #ifdef TARGET_ARM if (!isPassedAsPrimitiveType) { @@ -1795,8 +1904,7 @@ struct fgArgTabEntry } } -#ifdef DEBUG - void Dump(); + void Dump() const; #endif }; @@ -1808,11 +1916,14 @@ struct fgArgTabEntry class fgArgInfo { - Compiler* compiler; // Back pointer to the compiler instance so that we can allocate memory - GenTreeCall* callTree; // Back pointer to the GT_CALL node for this fgArgInfo - unsigned argCount; // Updatable arg count value - unsigned nextSlotNum; // Updatable slot count value - unsigned stkLevel; // Stack depth when we make this call (for x86) + Compiler* compiler; // Back pointer to the compiler instance so that we can allocate memory + GenTreeCall* callTree; // Back pointer to the GT_CALL node for this fgArgInfo + unsigned argCount; // Updatable arg count value +#if defined(DEBUG_ARG_SLOTS) + unsigned nextSlotNum; // Updatable slot count value +#endif + unsigned nextStackByteOffset; + unsigned stkLevel; // Stack depth when we make this call (for x86) #if defined(UNIX_X86_ABI) bool alignmentDone; // Updateable flag, set to 'true' after we've done any required alignment. @@ -1847,7 +1958,8 @@ class fgArgInfo GenTreeCall::Use* use, regNumber regNum, unsigned numRegs, - unsigned alignment, + unsigned byteSize, + unsigned byteAlignment, bool isStruct, bool isVararg = false); @@ -1857,7 +1969,8 @@ class fgArgInfo GenTreeCall::Use* use, regNumber regNum, unsigned numRegs, - unsigned alignment, + unsigned byteSize, + unsigned byteAlignment, const bool isStruct, const bool isVararg, const regNumber otherRegNum, @@ -1870,7 +1983,8 @@ class fgArgInfo GenTree* node, GenTreeCall::Use* use, unsigned numSlots, - unsigned alignment, + unsigned byteSize, + unsigned byteAlignment, bool isStruct, bool isVararg = false); @@ -1888,27 +2002,36 @@ class fgArgInfo void EvalArgsToTemps(); - unsigned ArgCount() + unsigned ArgCount() const { return argCount; } - fgArgTabEntry** ArgTable() + fgArgTabEntry** ArgTable() const { return argTable; } - unsigned GetNextSlotNum() + +#if defined(DEBUG_ARG_SLOTS) + unsigned GetNextSlotNum() const { return nextSlotNum; } - bool HasRegArgs() +#endif + + unsigned GetNextSlotByteOffset() const + { + return nextStackByteOffset; + } + + bool HasRegArgs() const { return hasRegArgs; } - bool NeedsTemps() + bool NeedsTemps() const { return needsTemps; } - bool HasStackArgs() + bool HasStackArgs() const { return hasStackArgs; } @@ -1933,7 +2056,7 @@ class fgArgInfo padStkAlign = AlignmentPad(curStackLevelInBytes, STACK_ALIGN); } - unsigned GetStkAlign() + unsigned GetStkAlign() const { return padStkAlign; } @@ -1960,7 +2083,7 @@ class fgArgInfo #endif // defined(UNIX_X86_ABI) // Get the fgArgTabEntry for the arg at position argNum. - fgArgTabEntry* GetArgEntry(unsigned argNum, bool reMorphing = true) + fgArgTabEntry* GetArgEntry(unsigned argNum, bool reMorphing = true) const { fgArgTabEntry* curArgTabEntry = nullptr; @@ -1986,12 +2109,12 @@ class fgArgInfo // Get the node for the arg at position argIndex. // Caller must ensure that this index is a valid arg index. - GenTree* GetArgNode(unsigned argIndex) + GenTree* GetArgNode(unsigned argIndex) const { return GetArgEntry(argIndex)->GetNode(); } - void Dump(Compiler* compiler); + void Dump(Compiler* compiler) const; }; #ifdef DEBUG @@ -2701,6 +2824,8 @@ class Compiler GenTree* gtNewNullCheck(GenTree* addr, BasicBlock* basicBlock); + void gtChangeOperToNullCheck(GenTree* tree, BasicBlock* block); + GenTreeArgList* gtNewArgList(GenTree* op); GenTreeArgList* gtNewArgList(GenTree* op1, GenTree* op2); GenTreeArgList* gtNewArgList(GenTree* op1, GenTree* op2, GenTree* op3); @@ -2933,6 +3058,9 @@ class Compiler void gtDispConst(GenTree* tree); void gtDispLeaf(GenTree* tree, IndentStack* indentStack); void gtDispNodeName(GenTree* tree); +#if FEATURE_MULTIREG_RET + unsigned gtDispRegCount(GenTree* tree); +#endif void gtDispRegVal(GenTree* tree); void gtDispZeroFieldSeq(GenTree* tree); void gtDispVN(GenTree* tree); @@ -3170,6 +3298,12 @@ class Compiler unsigned lvaOutgoingArgSpaceVar; // dummy TYP_LCLBLK var for fixed outgoing argument space PhasedVar lvaOutgoingArgSpaceSize; // size of fixed outgoing argument space #endif // FEATURE_FIXED_OUT_ARGS + + static unsigned GetOutgoingArgByteSize(unsigned sizeWithoutPadding) + { + return roundUp(sizeWithoutPadding, TARGET_POINTER_SIZE); + } + // Variable representing the return address. The helper-based tailcall // mechanism passes the address of the return address to a runtime helper // where it is used to detect tail-call chains. @@ -3321,7 +3455,7 @@ class Compiler return &lvaTable[lclNum]; } - LclVarDsc* lvaGetDesc(GenTreeLclVarCommon* lclVar) + LclVarDsc* lvaGetDesc(const GenTreeLclVarCommon* lclVar) { assert(lclVar->GetLclNum() < lvaCount); return &lvaTable[lclVar->GetLclNum()]; @@ -3457,7 +3591,10 @@ class Compiler } }; - static int __cdecl lvaFieldOffsetCmp(const void* field1, const void* field2); + struct lvaFieldOffsetCmp + { + bool operator()(const lvaStructFieldInfo& field1, const lvaStructFieldInfo& field2); + }; // This class is responsible for checking validity and profitability of struct promotion. // If it is both legal and profitable, then TryPromoteStructVar promotes the struct and initializes @@ -3726,6 +3863,7 @@ class Compiler void impImportLeave(BasicBlock* block); void impResetLeaveBlock(BasicBlock* block, unsigned jmpAddr); + GenTree* impTypeIsAssignable(GenTree* typeTo, GenTree* typeFrom); GenTree* impIntrinsic(GenTree* newobjThis, CORINFO_CLASS_HANDLE clsHnd, CORINFO_METHOD_HANDLE method, @@ -3741,7 +3879,7 @@ class Compiler GenTree* impMathIntrinsic(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* sig, var_types callType, - CorInfoIntrinsics intrinsicID, + NamedIntrinsic intrinsicName, bool tailCall); NamedIntrinsic lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method); GenTree* impUnsupportedNamedIntrinsic(unsigned helper, @@ -3937,9 +4075,9 @@ class Compiler bool VarTypeIsMultiByteAndCanEnreg( var_types type, CORINFO_CLASS_HANDLE typeClass, unsigned* typeSize, bool forReturn, bool isVarArg); - bool IsIntrinsicImplementedByUserCall(CorInfoIntrinsics intrinsicId); - bool IsTargetIntrinsic(CorInfoIntrinsics intrinsicId); - bool IsMathIntrinsic(CorInfoIntrinsics intrinsicId); + bool IsIntrinsicImplementedByUserCall(NamedIntrinsic intrinsicName); + bool IsTargetIntrinsic(NamedIntrinsic intrinsicName); + bool IsMathIntrinsic(NamedIntrinsic intrinsicName); bool IsMathIntrinsic(GenTree* tree); private: @@ -4047,6 +4185,7 @@ class Compiler BasicBlock* impPushCatchArgOnStack(BasicBlock* hndBlk, CORINFO_CLASS_HANDLE clsHnd, bool isSingleBlockFilter); + bool impBlockIsInALoop(BasicBlock* block); void impImportBlockCode(BasicBlock* block); void impReimportMarkBlock(BasicBlock* block); @@ -4633,6 +4772,9 @@ class Compiler void fgComputeLifeLIR(VARSET_TP& life, BasicBlock* block, VARSET_VALARG_TP volatileVars); + bool fgTryRemoveNonLocal(GenTree* node, LIR::Range* blockRange); + + void fgRemoveDeadStoreLIR(GenTree* store, BasicBlock* block); bool fgRemoveDeadStore(GenTree** pTree, LclVarDsc* varDsc, VARSET_VALARG_TP life, @@ -4964,7 +5106,7 @@ class Compiler // When the flow graph changes, we need to update the block numbers, predecessor lists, reachability sets, and // dominators. - void fgUpdateChangedFlowGraph(); + void fgUpdateChangedFlowGraph(bool computeDoms = true); public: // Compute the predecessors of the blocks in the control flow graph. @@ -4993,10 +5135,6 @@ class Compiler // Initialize the per-block variable sets (used for liveness analysis). void fgInitBlockVarSets(); - // true if we've gone through and created GC Poll calls. - bool fgGCPollsCreated; - void fgMarkGCPollBlocks(); - void fgCreateGCPolls(); PhaseStatus fgInsertGCPolls(); BasicBlock* fgCreateGCPoll(GCPollType pollType, BasicBlock* block); @@ -5263,8 +5401,10 @@ class Compiler void fgDebugCheckNodesUniqueness(); void fgDebugCheckFlags(GenTree* tree); + void fgDebugCheckDispFlags(GenTree* tree, unsigned dispFlags, unsigned debugFlags); void fgDebugCheckFlagsHelper(GenTree* tree, unsigned treeFlags, unsigned chkFlags); void fgDebugCheckTryFinallyExits(); + void fgDebugCheckProfileData(); #endif static GenTree* fgGetFirstNode(GenTree* tree); @@ -5378,6 +5518,7 @@ class Compiler } bool fgHaveProfileData(); + void fgComputeProfileScale(); bool fgGetProfileWeightForBasicBlock(IL_OFFSET offset, unsigned* weight); void fgInstrumentMethod(); @@ -5571,7 +5712,6 @@ class Compiler GenTree* fgCreateCallDispatcherAndGetResult(GenTreeCall* origCall, CORINFO_METHOD_HANDLE callTargetStubHnd, CORINFO_METHOD_HANDLE dispatcherHnd); - GenTree* getMethodPointerTree(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_CALL_INFO* pCallInfo); GenTree* getLookupTree(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_LOOKUP* pLookup, unsigned handleFlags, @@ -5623,6 +5763,7 @@ class Compiler GenTree* fgMorphConst(GenTree* tree); GenTreeLclVar* fgMorphTryFoldObjAsLclVar(GenTreeObj* obj); + GenTree* fgMorphCommutative(GenTreeOp* tree); public: GenTree* fgMorphTree(GenTree* tree, MorphAddrContext* mac = nullptr); @@ -5679,8 +5820,8 @@ class Compiler SpecialCodeKind acdKind; // what kind of a special block is this? #if !FEATURE_FIXED_OUT_ARGS bool acdStkLvlInit; // has acdStkLvl value been already set? - unsigned acdStkLvl; -#endif // !FEATURE_FIXED_OUT_ARGS + unsigned acdStkLvl; // stack level in stack slots. +#endif // !FEATURE_FIXED_OUT_ARGS }; private: @@ -6021,12 +6162,12 @@ class Compiler int lpHoistedExprCount; // The register count for the non-FP expressions from inside this loop that have been // hoisted int lpLoopVarCount; // The register count for the non-FP LclVars that are read/written inside this loop - int lpVarInOutCount; // The register count for the non-FP LclVars that are alive inside or accross this loop + int lpVarInOutCount; // The register count for the non-FP LclVars that are alive inside or across this loop int lpHoistedFPExprCount; // The register count for the FP expressions from inside this loop that have been // hoisted int lpLoopVarFPCount; // The register count for the FP LclVars that are read/written inside this loop - int lpVarInOutFPCount; // The register count for the FP LclVars that are alive inside or accross this loop + int lpVarInOutFPCount; // The register count for the FP LclVars that are alive inside or across this loop typedef JitHashTable, bool> FieldHandleSet; FieldHandleSet* lpFieldsModified; // This has entries (mappings to "true") for all static field and object @@ -6326,11 +6467,12 @@ class Compiler struct CSEdsc { - CSEdsc* csdNextInBucket; // used by the hash table - - unsigned csdHashKey; // the orginal hashkey - - unsigned csdIndex; // 1..optCSECandidateCount + CSEdsc* csdNextInBucket; // used by the hash table + size_t csdHashKey; // the orginal hashkey + ssize_t csdConstDefValue; // When we CSE similar constants, this is the value that we use as the def + ValueNum csdConstDefVN; // When we CSE similar constants, this is the ValueNumber that we use for the LclVar + // assignment + unsigned csdIndex; // 1..optCSECandidateCount bool csdLiveAcrossCall; unsigned short csdDefCount; // definition count @@ -6359,9 +6501,15 @@ class Compiler ValueNum defConservNormVN; // if all def occurrences share the same conservative normal value // number, this will reflect it; otherwise, NoVN. + // not used for shared const CSE's }; - static const size_t s_optCSEhashSize; + static const size_t s_optCSEhashSizeInitial; + static const size_t s_optCSEhashGrowthFactor; + static const size_t s_optCSEhashBucketSize; + size_t optCSEhashSize; // The current size of hashtable + size_t optCSEhashCount; // Number of entries in hashtable + size_t optCSEhashMaxCountBeforeResize; // Number of entries before resize CSEdsc** optCSEhash; CSEdsc** optCSEtab; @@ -6397,8 +6545,14 @@ class Compiler bool optCSE_canSwap(GenTree* firstNode, GenTree* secondNode); bool optCSE_canSwap(GenTree* tree); - static int __cdecl optCSEcostCmpEx(const void* op1, const void* op2); - static int __cdecl optCSEcostCmpSz(const void* op1, const void* op2); + struct optCSEcostCmpEx + { + bool operator()(const CSEdsc* op1, const CSEdsc* op2); + }; + struct optCSEcostCmpSz + { + bool operator()(const CSEdsc* op1, const CSEdsc* op2); + }; void optCleanupCSEs(); @@ -6406,6 +6560,16 @@ class Compiler void optEnsureClearCSEInfo(); #endif // DEBUG + static bool Is_Shared_Const_CSE(size_t key) + { + return ((key & TARGET_SIGN_BIT) != 0); + } + + static size_t Decode_Shared_Const_CSE_Value(size_t key) + { + return (key & ~TARGET_SIGN_BIT) << CSE_CONST_SHARED_LOW_BITS; + } + #endif // FEATURE_ANYCSE #if FEATURE_VALNUM_CSE @@ -6487,7 +6651,7 @@ class Compiler void optCopyProp(BasicBlock* block, Statement* stmt, GenTree* tree, LclNumToGenTreePtrStack* curSsaName); void optBlockCopyPropPopStacks(BasicBlock* block, LclNumToGenTreePtrStack* curSsaName); void optBlockCopyProp(BasicBlock* block, LclNumToGenTreePtrStack* curSsaName); - bool optIsSsaLocal(GenTree* tree); + unsigned optIsSsaLocal(GenTree* tree); int optCopyProp_LclVarScore(LclVarDsc* lclVarDsc, LclVarDsc* copyVarDsc, bool preferOp2); void optVnCopyProp(); INDEBUG(void optDumpCopyPropStack(LclNumToGenTreePtrStack* curSsaName)); @@ -6762,6 +6926,11 @@ class Compiler return ((assertionKind == OAK_EQUAL) && (op1.kind == O1K_LCLVAR) && (op2.kind == O2K_LCLVAR_COPY)); } + bool IsConstantInt32Assertion() + { + return ((assertionKind == OAK_EQUAL) || (assertionKind == OAK_NOT_EQUAL)) && (op2.kind == O2K_CONST_INT); + } + static bool SameKind(AssertionDsc* a1, AssertionDsc* a2) { return a1->assertionKind == a2->assertionKind && a1->op1.kind == a2->op1.kind && @@ -8010,7 +8179,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX { return false; } - return isOpaqueSIMDType(varDsc->lvVerTypeInfo.GetClassHandle()); + return isOpaqueSIMDType(varDsc->GetStructHnd()); } static bool isRelOpSIMDIntrinsic(SIMDIntrinsicID intrinsicId) @@ -8190,7 +8359,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #if defined(TARGET_XARCH) if (getSIMDSupportLevel() == SIMD_AVX2_Supported) { - return TYP_SIMD32; + return JitConfig.EnableHWIntrinsic() ? TYP_SIMD32 : TYP_SIMD16; } else { @@ -8231,7 +8400,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #if defined(TARGET_XARCH) if (getSIMDSupportLevel() == SIMD_AVX2_Supported) { - return YMM_REGSIZE_BYTES; + return JitConfig.EnableHWIntrinsic() ? YMM_REGSIZE_BYTES : XMM_REGSIZE_BYTES; } else { @@ -8261,7 +8430,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #if defined(FEATURE_HW_INTRINSICS) && defined(TARGET_XARCH) if (compOpportunisticallyDependsOn(InstructionSet_AVX)) { - return YMM_REGSIZE_BYTES; + return JitConfig.EnableHWIntrinsic() ? YMM_REGSIZE_BYTES : XMM_REGSIZE_BYTES; } else { @@ -8782,13 +8951,14 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX bool dspEHTable; // Display the EH table reported to the VM bool dspDebugInfo; // Display the Debug info reported to the VM bool dspInstrs; // Display the IL instructions intermixed with the native code output - bool dspEmit; // Display emitter output bool dspLines; // Display source-code lines intermixed with native code output bool dmpHex; // Display raw bytes in hex of native code output bool varNames; // Display variables names in native code output bool disAsm; // Display native code as it is generated bool disAsmSpilled; // Display native code when any register spilling occurs + bool disasmWithGC; // Display GC info interleaved with disassembly. bool disDiffable; // Makes the Disassembly code 'diff-able' + bool disAddr; // Display process address next to each instruction in disassembly code bool disAsm2; // Display native code after it is generated using external disassembler bool dspOrder; // Display names of each of the methods that we ngen/jit bool dspUnwind; // Display the unwind info output @@ -8802,8 +8972,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX bool doLateDisasm; // Run the late disassembler #endif // LATE_DISASM -#if DUMP_GC_TABLES && !defined(DEBUG) && defined(JIT32_GCENCODER) -// Only the JIT32_GCENCODER implements GC dumping in non-DEBUG code. +#if DUMP_GC_TABLES && !defined(DEBUG) #pragma message("NOTE: this non-debug build has GC ptr table dumping always enabled!") static const bool dspGCtbls = true; #endif @@ -8837,8 +9006,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #else // !ARM_SOFTFP static const bool compUseSoftFP = false; #endif - - GCPollType compGCPollType; } opts; #ifdef ALT_JIT @@ -8994,14 +9161,14 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #endif } - const char* compGetTieringName() const; + const char* compGetTieringName(bool wantShortName = false) const; const char* compGetStressMessage() const; codeOptimize compCodeOpt() { #if 0 // Switching between size & speed has measurable throughput impact - // (3.5% on NGen mscorlib when measured). It used to be enabled for + // (3.5% on NGen CoreLib when measured). It used to be enabled for // DEBUG, but should generate identical code between CHK & RET builds, // so that's not acceptable. // TODO-Throughput: Figure out what to do about size vs. speed & throughput. @@ -9067,7 +9234,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX bool compIsVarArgs : 1; // Does the method have varargs parameters? 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 instrinsic + 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. @@ -9077,8 +9244,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX unsigned compArgsCount; // Number of arguments (incl. implicit and hidden) #if FEATURE_FASTTAILCALL - size_t compArgStackSize; // Incoming argument stack size in bytes -#endif // FEATURE_FASTTAILCALL + unsigned compArgStackSize; // Incoming argument stack size in bytes +#endif // FEATURE_FASTTAILCALL unsigned compRetBuffArg; // position of hidden return param var (0, 1) (BAD_VAR_NUM means not present); int compTypeCtxtArg; // position of hidden param for type context for generic code (CORINFO_CALLCONV_PARAMTYPE) @@ -9608,15 +9775,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // if this changes "*pDest". BOOL tiMergeToCommonParent(typeInfo* pDest, const typeInfo* pSrc, bool* changed) const; -#ifdef DEBUG - // VSW 471305 - // IJW allows assigning REF to BYREF. The following allows us to temporarily - // bypass the assert check in gcMarkRegSetGCref and gcMarkRegSetByref - // We use a "short" as we need to push/pop this scope. - // - short compRegSetCheckLevel; -#endif - /* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -10201,7 +10359,7 @@ class GenTreeVisitor return result; } } - __fallthrough; + FALLTHROUGH; // Leaf nodes case GT_CATCH_ARG: @@ -10246,7 +10404,7 @@ class GenTreeVisitor return result; } } - __fallthrough; + FALLTHROUGH; // Standard unary operators case GT_NOT: @@ -10850,6 +11008,7 @@ extern Histogram genTreeNsizHist; #if MEASURE_FATAL extern unsigned fatal_badCode; extern unsigned fatal_noWay; +extern unsigned fatal_implLimitation; extern unsigned fatal_NOMEM; extern unsigned fatal_noWayAssertBody; #ifdef DEBUG diff --git a/src/coreclr/src/jit/compiler.hpp b/src/coreclr/src/jit/compiler.hpp index c12bacd94d7a..ebb55a7ebdf3 100644 --- a/src/coreclr/src/jit/compiler.hpp +++ b/src/coreclr/src/jit/compiler.hpp @@ -1148,7 +1148,7 @@ inline GenTreeCall* Compiler::gtNewRuntimeLookupHelperCallNode(CORINFO_RUNTIME_L GenTree* ctxTree, void* compileTimeHandle) { - GenTree* argNode = gtNewIconEmbHndNode(pRuntimeLookup->signature, nullptr, GTF_ICON_TOKEN_HDL, compileTimeHandle); + GenTree* argNode = gtNewIconEmbHndNode(pRuntimeLookup->signature, nullptr, GTF_ICON_GLOBAL_PTR, compileTimeHandle); GenTreeCall::Use* helperArgs = gtNewCallArgs(ctxTree, argNode); return gtNewHelperCallNode(pRuntimeLookup->helper, TYP_I_IMPL, helperArgs); @@ -2117,7 +2117,7 @@ inline } #endif // DEBUG - varOffset = varDsc->lvStkOffs; + varOffset = varDsc->GetStackOffset(); } else // Its a spill-temp { @@ -3169,6 +3169,7 @@ inline regMaskTP genIntAllRegArgMask(unsigned numRegs) inline regMaskTP genFltAllRegArgMask(unsigned numRegs) { +#ifndef TARGET_X86 assert(numRegs <= MAX_FLOAT_REG_ARG); regMaskTP result = RBM_NONE; @@ -3177,6 +3178,10 @@ inline regMaskTP genFltAllRegArgMask(unsigned numRegs) result |= fltArgMasks[i]; } return result; +#else + assert(!"no x86 float arg regs\n"); + return RBM_NONE; +#endif } /* @@ -4342,7 +4347,7 @@ void GenTree::VisitOperands(TVisitor visitor) { return; } - __fallthrough; + FALLTHROUGH; // Standard unary operators case GT_STORE_LCL_VAR: diff --git a/src/coreclr/src/jit/compphases.h b/src/coreclr/src/jit/compphases.h index 0fe78151c173..50e5afad7b5a 100644 --- a/src/coreclr/src/jit/compphases.h +++ b/src/coreclr/src/jit/compphases.h @@ -46,7 +46,6 @@ CompPhaseNameMacro(PHASE_PROMOTE_STRUCTS, "Morph - Promote Structs", CompPhaseNameMacro(PHASE_MORPH_GLOBAL, "Morph - Global", "MOR-GLOB", false, -1, false) CompPhaseNameMacro(PHASE_MORPH_END, "Morph - Finish", "MOR-END", false, -1, true) CompPhaseNameMacro(PHASE_GS_COOKIE, "GS Cookie", "GS-COOK", false, -1, false) -CompPhaseNameMacro(PHASE_MARK_GC_POLL_BLOCKS, "Mark GC poll blocks", "GC-POLL", false, -1, false) CompPhaseNameMacro(PHASE_COMPUTE_EDGE_WEIGHTS, "Compute edge weights (1, false)", "EDG-WGT", false, -1, false) #if defined(FEATURE_EH_FUNCLETS) CompPhaseNameMacro(PHASE_CREATE_FUNCLETS, "Create EH funclets", "EH-FUNC", false, -1, false) diff --git a/src/coreclr/src/jit/copyprop.cpp b/src/coreclr/src/jit/copyprop.cpp index 295fcb8cb8a7..ca01e90250f6 100644 --- a/src/coreclr/src/jit/copyprop.cpp +++ b/src/coreclr/src/jit/copyprop.cpp @@ -36,8 +36,8 @@ void Compiler::optBlockCopyPropPopStacks(BasicBlock* block, LclNumToGenTreePtrSt { continue; } - unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); - if (!lvaInSsa(lclNum)) + const unsigned lclNum = optIsSsaLocal(tree); + if (lclNum == BAD_VAR_NUM) { continue; } @@ -61,8 +61,19 @@ void Compiler::optDumpCopyPropStack(LclNumToGenTreePtrStack* curSsaName) JITDUMP("{ "); for (LclNumToGenTreePtrStack::KeyIterator iter = curSsaName->Begin(); !iter.Equal(curSsaName->End()); ++iter) { - GenTree* node = iter.GetValue()->Top(); - JITDUMP("%d-[%06d]:V%02u ", iter.Get(), dspTreeID(node), node->AsLclVarCommon()->GetLclNum()); + GenTreeLclVarCommon* lclVar = iter.GetValue()->Top()->AsLclVarCommon(); + unsigned ssaLclNum = optIsSsaLocal(lclVar); + assert(ssaLclNum != BAD_VAR_NUM); + + if (ssaLclNum == lclVar->GetLclNum()) + { + JITDUMP("%d-[%06d]:V%02u ", iter.Get(), dspTreeID(lclVar), ssaLclNum); + } + else + { + // A promoted field was asigned using the parent struct, print `ssa field lclNum(parent lclNum)`. + JITDUMP("%d-[%06d]:V%02u(V%02u) ", iter.Get(), dspTreeID(lclVar), ssaLclNum, lclVar->GetLclNum()); + } } JITDUMP("}\n\n"); } @@ -150,10 +161,10 @@ void Compiler::optCopyProp(BasicBlock* block, Statement* stmt, GenTree* tree, Lc { return; } - unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); + const unsigned lclNum = optIsSsaLocal(tree); // Skip non-SSA variables. - if (!lvaInSsa(lclNum)) + if (lclNum == BAD_VAR_NUM) { return; } @@ -291,13 +302,39 @@ void Compiler::optCopyProp(BasicBlock* block, Statement* stmt, GenTree* tree, Lc return; } -/************************************************************************************** - * - * Helper to check if tree is a local that participates in SSA numbering. - */ -bool Compiler::optIsSsaLocal(GenTree* tree) +//------------------------------------------------------------------------------ +// optIsSsaLocal : helper to check if the tree is a local that participates in SSA numbering. +// +// Arguments: +// tree - The tree to perform the check on; +// +// Returns: +// - lclNum if the local is participating in SSA; +// - fieldLclNum if the parent local can be replaced by its only field; +// - BAD_VAR_NUM otherwise. +// +unsigned Compiler::optIsSsaLocal(GenTree* tree) { - return tree->IsLocal() && lvaInSsa(tree->AsLclVarCommon()->GetLclNum()); + if (!tree->IsLocal()) + { + return BAD_VAR_NUM; + } + + GenTreeLclVarCommon* lclNode = tree->AsLclVarCommon(); + unsigned lclNum = lclNode->GetLclNum(); + LclVarDsc* varDsc = lvaGetDesc(lclNum); + + if (!lvaInSsa(lclNum) && varDsc->CanBeReplacedWithItsField(this)) + { + lclNum = varDsc->lvFieldLclStart; + } + + if (!lvaInSsa(lclNum)) + { + return BAD_VAR_NUM; + } + + return lclNum; } //------------------------------------------------------------------------------ @@ -351,22 +388,22 @@ void Compiler::optBlockCopyProp(BasicBlock* block, LclNumToGenTreePtrStack* curS // embedded update. Killing the variable is a simplification to produce 0 ASM diffs // for an update release. // - if (optIsSsaLocal(tree) && (tree->gtFlags & GTF_VAR_DEF)) + const unsigned lclNum = optIsSsaLocal(tree); + if ((lclNum != BAD_VAR_NUM) && (tree->gtFlags & GTF_VAR_DEF)) { - VarSetOps::AddElemD(this, optCopyPropKillSet, lvaTable[tree->AsLclVarCommon()->GetLclNum()].lvVarIndex); + VarSetOps::AddElemD(this, optCopyPropKillSet, lvaTable[lclNum].lvVarIndex); } } // This logic must be in sync with SSA renaming process. for (GenTree* tree = stmt->GetTreeList(); tree != nullptr; tree = tree->gtNext) { - if (!optIsSsaLocal(tree)) + const unsigned lclNum = optIsSsaLocal(tree); + if (lclNum == BAD_VAR_NUM) { continue; } - unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); - // As we encounter a definition add it to the stack as a live definition. if (tree->gtFlags & GTF_VAR_DEF) { diff --git a/src/coreclr/src/jit/crossgen/CMakeLists.txt b/src/coreclr/src/jit/crossgen/CMakeLists.txt index b2f4f0a0adaf..30d35e8cde59 100644 --- a/src/coreclr/src/jit/crossgen/CMakeLists.txt +++ b/src/coreclr/src/jit/crossgen/CMakeLists.txt @@ -3,4 +3,4 @@ if(FEATURE_MERGE_JIT_AND_ENGINE) target_link_libraries(clrjit_crossgen ${JIT_LINK_LIBRARIES} ${JIT_ARCH_LINK_LIBRARIES}) endif(FEATURE_MERGE_JIT_AND_ENGINE) set_target_properties(clrjit_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) -target_precompile_header(TARGET clrjit_crossgen HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR}) +target_precompile_headers(clrjit_static PRIVATE [["jitpch.h"]]) diff --git a/src/coreclr/src/jit/delayload.cpp b/src/coreclr/src/jit/delayload.cpp deleted file mode 100644 index 7342c78b1794..000000000000 --- a/src/coreclr/src/jit/delayload.cpp +++ /dev/null @@ -1,9 +0,0 @@ -// 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" -#pragma hdrstop - -#include "shimload.h" - -ExternC PfnDliHook __pfnDliNotifyHook = ShimDelayLoadHook; diff --git a/src/coreclr/src/jit/disasm.cpp b/src/coreclr/src/jit/disasm.cpp index 56c2ed622e8d..3d900a20b460 100644 --- a/src/coreclr/src/jit/disasm.cpp +++ b/src/coreclr/src/jit/disasm.cpp @@ -964,7 +964,7 @@ size_t DisAssembler::CbDisassemble(DIS* pdis, } } - __fallthrough; + FALLTHROUGH; case DISX86::trmtaJmpShort: case DISX86::trmtaJmpNear: @@ -1022,7 +1022,7 @@ size_t DisAssembler::CbDisassemble(DIS* pdis, } } - __fallthrough; + FALLTHROUGH; case DISARM64::TRMTA::trmtaBra: case DISARM64::TRMTA::trmtaBraCase: diff --git a/src/coreclr/src/jit/ee_il_dll.cpp b/src/coreclr/src/jit/ee_il_dll.cpp index 150efed411f6..30e69dbf98d5 100644 --- a/src/coreclr/src/jit/ee_il_dll.cpp +++ b/src/coreclr/src/jit/ee_il_dll.cpp @@ -316,7 +316,8 @@ unsigned CILJit::getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags) // ensure that AVX2 is actually supported. Otherwise, we will end up getting asserts downstream. if ((JitConfig.EnableAVX2() != 0) && (JitConfig.EnableAVX() != 0) && (JitConfig.EnableSSE42() != 0) && (JitConfig.EnableSSE41() != 0) && (JitConfig.EnableSSSE3() != 0) && (JitConfig.EnableSSE3_4() != 0) && - (JitConfig.EnableSSE3() != 0) && (JitConfig.EnableSSE2() != 0) && (JitConfig.EnableSSE() != 0)) + (JitConfig.EnableSSE3() != 0) && (JitConfig.EnableSSE2() != 0) && (JitConfig.EnableSSE() != 0) && + (JitConfig.EnableHWIntrinsic() != 0)) { if (GetJitTls() != nullptr && JitTls::GetCompiler() != nullptr) { @@ -804,8 +805,18 @@ void Compiler::eeDispVar(ICorDebugInfo::NativeVarInfo* var) // Same parameters as ICorStaticInfo::setVars(). void Compiler::eeDispVars(CORINFO_METHOD_HANDLE ftn, ULONG32 cVars, ICorDebugInfo::NativeVarInfo* vars) { - printf("*************** Variable debug info\n"); - printf("%d live ranges\n", cVars); + ALLVARSET_TP uniqueVars(AllVarSetOps::MakeEmpty(this)); + for (unsigned i = 0; i < cVars; i++) + { + // ignore "special vars" and out of bounds vars + if ((((int)vars[i].varNumber) >= 0) && (vars[i].varNumber < lclMAX_ALLSET_TRACKED)) + { + AllVarSetOps::AddElemD(this, uniqueVars, vars[i].varNumber); + } + } + printf("; Variable debug info: %d live range(s), %d var(s) for method %s\n", cVars, + AllVarSetOps::Count(this, uniqueVars), info.compFullName); + for (unsigned i = 0; i < cVars; i++) { eeDispVar(&vars[i]); @@ -1057,10 +1068,10 @@ bool Compiler::eeIsJitDataOffs(CORINFO_FIELD_HANDLE field) unsigned value = static_cast(reinterpret_cast(field)); if (((CORINFO_FIELD_HANDLE)(size_t)value) != field) { - return false; // upper bits were set, not a jit data offset + return false; // some bits in the upper 32 bits were set, not a jit data offset } - // Data offsets are marked by the fact that the low two bits are 0b01 0x1 + // Data offsets are marked by the fact that the low two bits are 0b01 return (value & iaut_MASK) == iaut_DATA_OFFSET; } @@ -1072,6 +1083,8 @@ int Compiler::eeGetJitDataOffs(CORINFO_FIELD_HANDLE field) unsigned dataOffs = static_cast(reinterpret_cast(field)); assert(((CORINFO_FIELD_HANDLE)(size_t)dataOffs) == field); assert(dataOffs < 0x40000000); + + // Shift away the low two bits return (static_cast(reinterpret_cast(field))) >> iaut_SHIFT; } else @@ -1316,7 +1329,7 @@ const char* Compiler::eeGetClassName(CORINFO_CLASS_HANDLE clsHnd) const WCHAR* Compiler::eeGetCPString(size_t strHandle) { -#ifdef TARGET_UNIX +#ifdef HOST_UNIX return nullptr; #else char buff[512 + sizeof(CORINFO_String)]; @@ -1340,7 +1353,7 @@ const WCHAR* Compiler::eeGetCPString(size_t strHandle) } return (asString->chars); -#endif // TARGET_UNIX +#endif // HOST_UNIX } #endif // DEBUG diff --git a/src/coreclr/src/jit/eeinterface.cpp b/src/coreclr/src/jit/eeinterface.cpp index ca63935aaad8..2ddc62574586 100644 --- a/src/coreclr/src/jit/eeinterface.cpp +++ b/src/coreclr/src/jit/eeinterface.cpp @@ -142,7 +142,7 @@ const char* Compiler::eeGetMethodFullName(CORINFO_METHOD_HANDLE hnd) } } } - __fallthrough; + FALLTHROUGH; default: pParam->pArgNames[i] = varTypeName(type); break; @@ -177,7 +177,7 @@ const char* Compiler::eeGetMethodFullName(CORINFO_METHOD_HANDLE hnd) } } } - __fallthrough; + FALLTHROUGH; default: pParam->returnType = varTypeName(retType); break; diff --git a/src/coreclr/src/jit/emit.cpp b/src/coreclr/src/jit/emit.cpp index cc12dabc5492..08d547ef00a7 100644 --- a/src/coreclr/src/jit/emit.cpp +++ b/src/coreclr/src/jit/emit.cpp @@ -1211,6 +1211,14 @@ void emitter::appendToCurIG(instrDesc* id) #ifdef DEBUG +void emitter::emitDispInsAddr(BYTE* code) +{ + if (emitComp->opts.disAddr) + { + printf(FMT_ADDR, DBG_ADDR(code)); + } +} + void emitter::emitDispInsOffs(unsigned offs, bool doffs) { if (doffs) @@ -3172,13 +3180,158 @@ const BYTE emitter::emitFmtToOps[] = { const unsigned emitter::emitFmtCount = _countof(emitFmtToOps); #endif +//------------------------------------------------------------------------ +// Interleaved GC info dumping. +// We'll attempt to line this up with the opcode, which indented differently for +// diffable and non-diffable dumps. +// This is approximate, and is better tuned for disassembly than for jitdumps. +// See emitDispInsHex(). +#ifdef TARGET_AMD64 +const size_t basicIndent = 7; +const size_t hexEncodingSize = 21; +#elif defined(TARGET_X86) +const size_t basicIndent = 7; +const size_t hexEncodingSize = 13; +#elif defined(TARGET_ARM64) +const size_t basicIndent = 12; +const size_t hexEncodingSize = 19; +#elif defined(TARGET_ARM) +const size_t basicIndent = 12; +const size_t hexEncodingSize = 11; +#endif + +#ifdef DEBUG +//------------------------------------------------------------------------ +// emitDispGCDeltaTitle: Print an appropriately indented title for a GC info delta +// +// Arguments: +// title - The type of GC info delta we're printing +// +void emitter::emitDispGCDeltaTitle(const char* title) +{ + size_t indent = emitComp->opts.disDiffable ? basicIndent : basicIndent + hexEncodingSize; + printf("%.*s; %s", indent, " ", title); +} + +//------------------------------------------------------------------------ +// emitDispGCRegDelta: Print a delta for GC registers +// +// Arguments: +// title - The type of GC info delta we're printing +// prevRegs - The live GC registers before the recent instruction. +// curRegs - The live GC registers after the recent instruction. +// +void emitter::emitDispGCRegDelta(const char* title, regMaskTP prevRegs, regMaskTP curRegs) +{ + if (prevRegs != curRegs) + { + emitDispGCDeltaTitle(title); + regMaskTP sameRegs = prevRegs & curRegs; + regMaskTP removedRegs = prevRegs - sameRegs; + regMaskTP addedRegs = curRegs - sameRegs; + if (removedRegs != RBM_NONE) + { + printf(" -"); + dspRegMask(removedRegs); + } + if (addedRegs != RBM_NONE) + { + printf(" +"); + dspRegMask(addedRegs); + } + printf("\n"); + } +} + +//------------------------------------------------------------------------ +// emitDispGCVarDelta: Print a delta for GC variables +// +// Notes: +// Uses the debug-only variables 'debugThisGCrefVars', 'debugPrevGCrefVars' +// and 'debugPrevRegPtrDsc' to print deltas from the last time this was +// called. +// +void emitter::emitDispGCVarDelta() +{ + if (!VarSetOps::Equal(emitComp, debugPrevGCrefVars, debugThisGCrefVars)) + { + emitDispGCDeltaTitle("GC ptr vars"); + VARSET_TP sameGCrefVars(VarSetOps::Intersection(emitComp, debugPrevGCrefVars, debugThisGCrefVars)); + VARSET_TP GCrefVarsRemoved(VarSetOps::Diff(emitComp, debugPrevGCrefVars, debugThisGCrefVars)); + VARSET_TP GCrefVarsAdded(VarSetOps::Diff(emitComp, debugThisGCrefVars, debugPrevGCrefVars)); + if (!VarSetOps::IsEmpty(emitComp, GCrefVarsRemoved)) + { + printf(" -"); + dumpConvertedVarSet(emitComp, GCrefVarsRemoved); + } + if (!VarSetOps::IsEmpty(emitComp, GCrefVarsAdded)) + { + printf(" +"); + dumpConvertedVarSet(emitComp, GCrefVarsAdded); + } + VarSetOps::Assign(emitComp, debugPrevGCrefVars, debugThisGCrefVars); + printf("\n"); + } + // Dump any deltas in regPtrDsc's for outgoing args; these aren't captured in the other sets. + if (debugPrevRegPtrDsc != codeGen->gcInfo.gcRegPtrLast) + { + for (regPtrDsc* dsc = (debugPrevRegPtrDsc == nullptr) ? codeGen->gcInfo.gcRegPtrList + : debugPrevRegPtrDsc->rpdNext; + dsc != nullptr; dsc = dsc->rpdNext) + { + // The non-arg regPtrDscs are reflected in the register sets debugPrevGCrefRegs/emitThisGCrefRegs + // and debugPrevByrefRegs/emitThisByrefRegs, and dumped using those sets. + if (!dsc->rpdArg) + { + continue; + } + emitDispGCDeltaTitle(GCtypeStr((GCtype)dsc->rpdGCtype)); + switch (dsc->rpdArgType) + { + case GCInfo::rpdARG_PUSH: +#if FEATURE_FIXED_OUT_ARGS + // For FEATURE_FIXED_OUT_ARGS, we report a write to the outgoing arg area + // as a 'rpdARG_PUSH' even though it doesn't actually push. Note that + // we also have 'rpdARG_POP's even though we don't actually pop, and + // we can have those even if there's no stack arg. + printf(" arg write"); + break; +#else + printf(" arg push %u", dsc->rpdPtrArg); + break; +#endif + case GCInfo::rpdARG_POP: + printf(" arg pop %u", dsc->rpdPtrArg); + break; + case GCInfo::rpdARG_KILL: + printf(" arg kill %u", dsc->rpdPtrArg); + break; + default: + printf(" arg ??? %u", dsc->rpdPtrArg); + } + printf("\n"); + } + debugPrevRegPtrDsc = codeGen->gcInfo.gcRegPtrLast; + } +} + +//------------------------------------------------------------------------ +// emitDispGCInfoDelta: Print a delta for GC info +// +void emitter::emitDispGCInfoDelta() +{ + emitDispGCRegDelta("gcrRegs", debugPrevGCrefRegs, emitThisGCrefRegs); + emitDispGCRegDelta("byrRegs", debugPrevByrefRegs, emitThisByrefRegs); + debugPrevGCrefRegs = emitThisGCrefRegs; + debugPrevByrefRegs = emitThisByrefRegs; + emitDispGCVarDelta(); +} + /***************************************************************************** * * Display the current instruction group list. */ -#ifdef DEBUG - void emitter::emitDispIGflags(unsigned flags) { if (flags & IGF_GC_VARS) @@ -3228,7 +3381,13 @@ void emitter::emitDispIG(insGroup* ig, insGroup* igPrev, bool verbose) sprintf_s(buff, TEMP_BUFFER_LEN, "G_M%03u_IG%02u: ", emitComp->compMethodID, ig->igNum); printf("%s; ", buff); - if ((igPrev == nullptr) || (igPrev->igFuncIdx != ig->igFuncIdx)) + + // We dump less information when we're only interleaving GC info with a disassembly listing, + // than we do in the jitdump case. (Note that the verbose argument to this method is + // distinct from the verbose on Compiler.) + bool jitdump = emitComp->verbose; + + if (jitdump && ((igPrev == nullptr) || (igPrev->igFuncIdx != ig->igFuncIdx))) { printf("func=%02u, ", ig->igFuncIdx); } @@ -3316,29 +3475,37 @@ void emitter::emitDispIG(insGroup* ig, insGroup* igPrev, bool verbose) } else { - printf("offs=%06XH, size=%04XH", ig->igOffs, ig->igSize); + const char* separator = ""; + if (jitdump) + { + printf("offs=%06XH, size=%04XH", ig->igOffs, ig->igSize); + separator = ", "; + } if (emitComp->compCodeGenDone) { - printf(", bbWeight=%s PerfScore %.2f", refCntWtd2str(ig->igWeight), ig->igPerfScore); + printf("%sbbWeight=%s PerfScore %.2f", separator, refCntWtd2str(ig->igWeight), ig->igPerfScore); + separator = ", "; } if (ig->igFlags & IGF_GC_VARS) { - printf(", gcVars=%s ", VarSetOps::ToString(emitComp, ig->igGCvars())); + printf("%sgcVars=%s ", separator, VarSetOps::ToString(emitComp, ig->igGCvars())); dumpConvertedVarSet(emitComp, ig->igGCvars()); + separator = ", "; } if (!(ig->igFlags & IGF_EXTEND)) { - printf(", gcrefRegs="); + printf("%sgcrefRegs=", separator); printRegMaskInt(ig->igGCregs); emitDispRegSet(ig->igGCregs); + separator = ", "; } if (ig->igFlags & IGF_BYREF_REGS) { - printf(", byrefRegs="); + printf("%sbyrefRegs=", separator); printRegMaskInt(ig->igByrefRegs()); emitDispRegSet(ig->igByrefRegs()); } @@ -3867,7 +4034,7 @@ void emitter::emitJumpDistBind() { if (tgtIG) { - printf("to G_M%03u_IG%02u\n", emitComp->compMethodID, tgtIG->igNum); + printf(" to G_M%03u_IG%02u\n", emitComp->compMethodID, tgtIG->igNum); } else { @@ -4470,7 +4637,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, unsigned* epilogSize, void** codeAddr, void** coldCodeAddr, - void** consAddr) + void** consAddr DEBUGARG(unsigned* instrCount)) { #ifdef DEBUG if (emitComp->verbose) @@ -4612,10 +4779,11 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, #endif #ifdef TARGET_XARCH - // For x64/x86, align Tier1 methods to 32 byte boundaries if + // For x64/x86, align methods that are "optimizations enabled" to 32 byte boundaries if // they are larger than 16 bytes and contain a loop. // - if (emitComp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER1) && (emitTotalHotCodeSize > 16) && emitComp->fgHasLoops) + if (emitComp->opts.OptimizationEnabled() && !emitComp->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT) && + (emitTotalHotCodeSize > 16) && emitComp->fgHasLoops) { allocMemFlag = CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN; } @@ -4679,6 +4847,11 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, /* Assume no live GC ref variables on entry */ VarSetOps::ClearD(emitComp, emitThisGCrefVars); // This is initialized to Empty at the start of codegen. +#if defined(DEBUG) && defined(JIT32_ENCODER) + VarSetOps::ClearD(emitComp, debugThisGCRefVars); + VarSetOps::ClearD(emitComp, debugPrevGCRefVars); + debugPrevRegPtrDsc = nullptr; +#endif emitThisGCrefRegs = emitThisByrefRegs = RBM_NONE; emitThisGCrefVset = true; @@ -4802,7 +4975,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, } #endif // FEATURE_FIXED_OUT_ARGS - int offs = dsc->lvStkOffs; + int offs = dsc->GetStackOffset(); /* Is it within the interesting range of offsets */ @@ -4874,6 +5047,9 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, #define DEFAULT_CODE_BUFFER_INIT 0xcc +#ifdef DEBUG + *instrCount = 0; +#endif for (insGroup* ig = emitIGlist; ig != nullptr; ig = ig->igNext) { assert(!(ig->igFlags & IGF_PLACEHOLDER)); // There better not be any placeholder groups left @@ -4886,7 +5062,7 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, assert(coldCodeBlock); cp = coldCodeBlock; #ifdef DEBUG - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { printf("\n************** Beginning of cold code **************\n"); } @@ -4909,16 +5085,21 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, #ifdef DEBUG /* Print the IG label, but only if it is a branch label */ - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { - if (emitComp->verbose) + if (emitComp->verbose || emitComp->opts.disasmWithGC) { printf("\n"); emitDispIG(ig); // Display the flags, IG data, etc. } else { - printf("\nG_M%03u_IG%02u:\n", emitComp->compMethodID, ig->igNum); + printf("\nG_M%03u_IG%02u:", emitComp->compMethodID, ig->igNum); + if (!emitComp->opts.disDiffable) + { + printf(" ;; offset=%04XH", emitCurCodeOffs(cp)); + } + printf("\n"); } } #endif // DEBUG @@ -4992,6 +5173,12 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, emitUpdateLiveGCregs(GCT_BYREF, byrefRegs, cp); } } +#ifdef DEBUG + if (EMIT_GC_VERBOSE || emitComp->opts.disasmWithGC) + { + emitDispGCInfoDelta(); + } +#endif // DEBUG } else { @@ -5010,10 +5197,11 @@ unsigned emitter::emitEndCodeGen(Compiler* comp, } #ifdef DEBUG - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { printf("\t\t\t\t\t\t;; bbWeight=%s PerfScore %.2f", refCntWtd2str(ig->igWeight), ig->igPerfScore); } + *instrCount += ig->igInsCnt; #endif // DEBUG emitCurIG = nullptr; @@ -5320,54 +5508,57 @@ UNATIVE_OFFSET emitter::emitFindOffset(insGroup* ig, unsigned insNum) return of; } -/***************************************************************************** - * - * Start generating a constant data section for the current - * function. Returns the offset of the section in the appropriate data - * block. - */ - -UNATIVE_OFFSET emitter::emitDataGenBeg(UNATIVE_OFFSET size, UNATIVE_OFFSET alignment) +//--------------------------------------------------------------------------- +// emitDataGenBeg: +// - Allocate space for a constant or block of the size and alignment requested +// Returns the offset in the data section to use +// +// Arguments: +// size - The size in bytes of the constant or block +// alignment - The requested alignment for the data +// dataType - The type of the constant int/float/etc +// +// Note: This method only allocate the space for the constant or block. It doesn't +// initialize the value. You call emitDataGenData to initialize the value. +// +UNATIVE_OFFSET emitter::emitDataGenBeg(unsigned size, unsigned alignment, var_types dataType) { unsigned secOffs; dataSection* secDesc; assert(emitDataSecCur == nullptr); - // The size must not be zero and must be a multiple of 4 bytes - // Additionally, 4 bytes is the minimum alignment that will + // The size must not be zero and must be a multiple of MIN_DATA_ALIGN + // Additionally, MIN_DATA_ALIGN is the minimum alignment that will // actually be used. That is, if the user requests an alignment - // of 1 or 2, they will get something that is at least 4-byte - // aligned. We allow the others since 4 is at least 1/2 and its - // simpler to allow it than to check and block. - assert((size != 0) && ((size % 4) == 0)); - - // This restricts the alignment to: 1, 2, 4, 8, 16, or 32 bytes - // Alignments greater than 32 would require VM support in ICorJitInfo::allocMem - - const size_t MaxAlignment = 32; - assert(isPow2(alignment) && (alignment <= MaxAlignment)); + // less than MIN_DATA_ALIGN, they will get something that is at least + // MIN_DATA_ALIGN. We allow smaller alignment to be specified since it is + // simpler to allow it than to check and block it. + // + assert((size != 0) && ((size % dataSection::MIN_DATA_ALIGN) == 0)); + assert(isPow2(alignment) && (alignment <= dataSection::MAX_DATA_ALIGN)); /* Get hold of the current offset */ secOffs = emitConsDsc.dsdOffs; - if (alignment > 4) + if (((secOffs % alignment) != 0) && (alignment > dataSection::MIN_DATA_ALIGN)) { - // As per the above comment, the minimum alignment is actually 4 + // As per the above comment, the minimum alignment is actually (MIN_DATA_ALIGN) // bytes so we don't need to make any adjustments if the requested - // alignment is 1, 2, or 4. + // alignment is less than MIN_DATA_ALIGN. // // The maximum requested alignment is tracked and the memory allocator // will end up ensuring offset 0 is at an address matching that - // alignment. So if the requested alignment is greater than 4, we need - // to pad the space out so the offset is a multiple of the requested. - - uint8_t zero[MaxAlignment] = {}; + // alignment. So if the requested alignment is greater than MIN_DATA_ALIGN, + // we need to pad the space out so the offset is a multiple of the requested. + // + uint8_t zeros[dataSection::MAX_DATA_ALIGN] = {}; // auto initialize to all zeros - UNATIVE_OFFSET zeroSize = alignment - (secOffs % alignment); - UNATIVE_OFFSET zeroAlign = 4; + unsigned zeroSize = alignment - (secOffs % alignment); + unsigned zeroAlign = dataSection::MIN_DATA_ALIGN; + var_types zeroType = TYP_INT; - emitAnyConst(&zero, zeroSize, zeroAlign); + emitBlkConst(&zeros, zeroSize, zeroAlign, zeroType); secOffs = emitConsDsc.dsdOffs; } @@ -5385,6 +5576,8 @@ UNATIVE_OFFSET emitter::emitDataGenBeg(UNATIVE_OFFSET size, UNATIVE_OFFSET align secDesc->dsType = dataSection::data; + secDesc->dsDataType = dataType; + secDesc->dsNext = nullptr; if (emitConsDsc.dsdLast) @@ -5441,6 +5634,8 @@ UNATIVE_OFFSET emitter::emitBBTableDataGenBeg(unsigned numEntries, bool relative secDesc->dsType = relativeAddr ? dataSection::blockRelative32 : dataSection::blockAbsoluteAddr; + secDesc->dsDataType = TYP_UNKNOWN; + secDesc->dsNext = nullptr; if (emitConsDsc.dsdLast) @@ -5503,39 +5698,109 @@ void emitter::emitDataGenEnd() #endif } -/******************************************************************************** - * Generates a data section constant - * - * Parameters: - * cnsAddr - memory location containing constant value - * cnsSize - size of constant in bytes - * cnsAlign - alignment of constant in bytes - * - * Returns constant number as offset into data section. - */ -UNATIVE_OFFSET emitter::emitDataConst(const void* cnsAddr, UNATIVE_OFFSET cnsSize, UNATIVE_OFFSET cnsAlign) +//--------------------------------------------------------------------------- +// emitDataGenFind: +// - Returns the offset of an existing constant in the data section +// or INVALID_UNATIVE_OFFSET if there was no matching constant +// +// Arguments: +// cnsAddr - A pointer to the value of the constant that we need +// cnsSize - The size in bytes of the constant +// alignment - The requested alignment for the data +// dataType - The type of the constant int/float/etc +// +UNATIVE_OFFSET emitter::emitDataGenFind(const void* cnsAddr, unsigned cnsSize, unsigned alignment, var_types dataType) { - UNATIVE_OFFSET cnum = emitDataGenBeg(cnsSize, cnsAlign); - emitDataGenData(0, cnsAddr, cnsSize); - emitDataGenEnd(); + UNATIVE_OFFSET cnum = INVALID_UNATIVE_OFFSET; + unsigned cmpCount = 0; + unsigned curOffs = 0; + dataSection* secDesc = emitConsDsc.dsdList; + while (secDesc != nullptr) + { + // Search the existing secDesc entries + + // We can match as smaller 'cnsSize' value at the start of a larger 'secDesc->dsSize' block + // We match the bit pattern, so the dataType can be different + // Only match constants when the dsType is 'data' + // + if ((secDesc->dsType == dataSection::data) && (secDesc->dsSize >= cnsSize) && ((curOffs % alignment) == 0)) + { + if (memcmp(cnsAddr, secDesc->dsCont, cnsSize) == 0) + { + cnum = curOffs; + + // We also might want to update the dsDataType + // + if ((secDesc->dsDataType != dataType) && (secDesc->dsSize == cnsSize)) + { + // If the subsequent dataType is floating point then change the original dsDataType + // + if (varTypeIsFloating(dataType)) + { + secDesc->dsDataType = dataType; + } + } + break; + } + } + + curOffs += secDesc->dsSize; + secDesc = secDesc->dsNext; + + if (++cmpCount > 64) + { + // If we don't find a match in the first 64, then we just add the new constant + // This prevents an O(n^2) search cost + break; + } + } + + return cnum; +} + +//--------------------------------------------------------------------------- +// emitDataConst: +// - Returns the valid offset in the data section to use for the constant +// described by the arguments to this method +// +// Arguments: +// cnsAddr - A pointer to the value of the constant that we need +// cnsSize - The size in bytes of the constant +// alignment - The requested alignment for the data +// dataType - The type of the constant int/float/etc +// +// +// Notes: we call the method emitDataGenFind() to see if we already have +// a matching constant that can be reused. +// +UNATIVE_OFFSET emitter::emitDataConst(const void* cnsAddr, unsigned cnsSize, unsigned cnsAlign, var_types dataType) +{ + UNATIVE_OFFSET cnum = emitDataGenFind(cnsAddr, cnsSize, cnsAlign, dataType); + if (cnum == INVALID_UNATIVE_OFFSET) + { + cnum = emitDataGenBeg(cnsSize, cnsAlign, dataType); + emitDataGenData(0, cnsAddr, cnsSize); + emitDataGenEnd(); + } return cnum; } //------------------------------------------------------------------------ -// emitAnyConst: Create a data section constant of arbitrary size. +// emitBlkConst: Create a data section constant of arbitrary size. // // Arguments: -// cnsAddr - pointer to the data to be placed in the data section -// cnsSize - size of the data in bytes +// cnsAddr - pointer to the block of data to be placed in the data section +// cnsSize - total size of the block of data in bytes // cnsAlign - alignment of the data in bytes +// elemType - The type of the elements in the constant // // Return Value: // A field handle representing the data offset to access the constant. // -CORINFO_FIELD_HANDLE emitter::emitAnyConst(const void* cnsAddr, UNATIVE_OFFSET cnsSize, UNATIVE_OFFSET cnsAlign) +CORINFO_FIELD_HANDLE emitter::emitBlkConst(const void* cnsAddr, unsigned cnsSize, unsigned cnsAlign, var_types elemType) { - UNATIVE_OFFSET cnum = emitDataGenBeg(cnsSize, cnsAlign); + UNATIVE_OFFSET cnum = emitDataGenBeg(cnsSize, cnsAlign, elemType); emitDataGenData(0, cnsAddr, cnsSize); emitDataGenEnd(); @@ -5560,25 +5825,28 @@ CORINFO_FIELD_HANDLE emitter::emitFltOrDblConst(double constValue, emitAttr attr { assert((attr == EA_4BYTE) || (attr == EA_8BYTE)); - void* cnsAddr; - float f; + void* cnsAddr; + float f; + var_types dataType; if (attr == EA_4BYTE) { - f = forceCastToFloat(constValue); - cnsAddr = &f; + f = forceCastToFloat(constValue); + cnsAddr = &f; + dataType = TYP_FLOAT; } else { - cnsAddr = &constValue; + cnsAddr = &constValue; + dataType = TYP_DOUBLE; } // Access to inline data is 'abstracted' by a special type of static member // (produced by eeFindJitDataOffs) which the emitter recognizes as being a reference // to constant data, not a real static field. - UNATIVE_OFFSET cnsSize = (attr == EA_4BYTE) ? 4 : 8; - UNATIVE_OFFSET cnsAlign = cnsSize; + unsigned cnsSize = (attr == EA_4BYTE) ? sizeof(float) : sizeof(double); + unsigned cnsAlign = cnsSize; #ifdef TARGET_XARCH if (emitComp->compCodeOpt() == Compiler::SMALL_CODE) @@ -5586,11 +5854,11 @@ CORINFO_FIELD_HANDLE emitter::emitFltOrDblConst(double constValue, emitAttr attr // Some platforms don't require doubles to be aligned and so // we can use a smaller alignment to help with smaller code - cnsAlign = 1; + cnsAlign = dataSection::MIN_DATA_ALIGN; } #endif // TARGET_XARCH - UNATIVE_OFFSET cnum = emitDataConst(cnsAddr, cnsSize, cnsAlign); + UNATIVE_OFFSET cnum = emitDataConst(cnsAddr, cnsSize, cnsAlign, dataType); return emitComp->eeFindJitDataOffs(cnum); } @@ -5622,6 +5890,7 @@ void emitter::emitOutputDataSec(dataSecDsc* sec, BYTE* dst) /* Walk and emit the contents of all the data blocks */ dataSection* dsc; + size_t curOffs = 0; for (dsc = sec->dsdList; dsc; dsc = dsc->dsNext) { @@ -5648,7 +5917,7 @@ void emitter::emitOutputDataSec(dataSecDsc* sec, BYTE* dst) #ifdef TARGET_ARM target = (BYTE*)((size_t)target | 1); // Or in thumb bit #endif - bDst[i] = (target_size_t)target; + bDst[i] = (target_size_t)(size_t)target; if (emitComp->opts.compReloc) { emitRecordRelocation(&(bDst[i]), target, IMAGE_REL_BASED_HIGHLOW); @@ -5682,8 +5951,6 @@ void emitter::emitOutputDataSec(dataSecDsc* sec, BYTE* dst) } else { - JITDUMP(" section %u, size %u, raw data\n", secNum++, dscSize); - // Simple binary data: copy the bytes to the target assert(dsc->dsType == dataSection::data); @@ -5692,19 +5959,33 @@ void emitter::emitOutputDataSec(dataSecDsc* sec, BYTE* dst) #ifdef DEBUG if (EMITVERBOSE) { - printf(" "); + printf(" section %3u, size %2u, RWD%2u:\t", secNum++, dscSize, curOffs); + for (size_t i = 0; i < dscSize; i++) { printf("%02x ", dsc->dsCont[i]); if ((((i + 1) % 16) == 0) && (i + 1 != dscSize)) { - printf("\n "); + printf("\n\t\t\t\t\t"); } } + switch (dsc->dsDataType) + { + case TYP_FLOAT: + printf(" ; float %9.6g", (double)*reinterpret_cast(&dsc->dsCont)); + break; + case TYP_DOUBLE: + printf(" ; double %12.9g", *reinterpret_cast(&dsc->dsCont)); + break; + default: + break; + } printf("\n"); } #endif // DEBUG } + + curOffs += dscSize; dst += dscSize; } } @@ -5762,11 +6043,11 @@ void emitter::emitDispDataSec(dataSecDsc* section) { if (emitComp->opts.disDiffable) { - printf("dd\t%s - %s\n", blockLabel, firstLabel); + printf("\tdd\t%s - %s\n", blockLabel, firstLabel); } else { - printf("dd\t%08Xh", ig->igOffs - igFirst->igOffs); + printf("\tdd\t%08Xh", ig->igOffs - igFirst->igOffs); } } else @@ -5775,21 +6056,21 @@ void emitter::emitDispDataSec(dataSecDsc* section) // We have a 32-BIT target if (emitComp->opts.disDiffable) { - printf("dd\t%s\n", blockLabel); + printf("\tdd\t%s\n", blockLabel); } else { - printf("dd\t%08Xh", reinterpret_cast(emitOffsetToPtr(ig->igOffs))); + printf("\tdd\t%08Xh", (uint32_t)(size_t)emitOffsetToPtr(ig->igOffs)); } #else // TARGET_64BIT // We have a 64-BIT target if (emitComp->opts.disDiffable) { - printf("dq\t%s\n", blockLabel); + printf("\tdq\t%s\n", blockLabel); } else { - printf("dq\t%016llXh", reinterpret_cast(emitOffsetToPtr(ig->igOffs))); + printf("\tdq\t%016llXh", reinterpret_cast(emitOffsetToPtr(ig->igOffs))); } #endif // TARGET_64BIT } @@ -5803,24 +6084,106 @@ void emitter::emitDispDataSec(dataSecDsc* section) else { assert(data->dsType == dataSection::data); - switch (data->dsSize) + unsigned elemSize = genTypeSize(data->dsDataType); + if (elemSize == 0) { - case 2: - printf("dw\t%04Xh\n", *reinterpret_cast(&data->dsCont)); - break; - case 4: - printf("dd\t%08Xh\n", *reinterpret_cast(&data->dsCont)); - break; - case 8: - printf("dq\t%016llXh\n", *reinterpret_cast(&data->dsCont)); - break; - default: - printf("db\t"); - for (UNATIVE_OFFSET i = 0; i < data->dsSize; i++) - { - printf("%s0%02Xh", i > 0 ? ", " : "", data->dsCont[i]); - } - printf("\n"); + if ((data->dsSize % 8) == 0) + { + elemSize = 8; + } + else if ((data->dsSize % 4) == 0) + { + elemSize = 4; + } + else if ((data->dsSize % 2) == 0) + { + elemSize = 2; + } + else + { + elemSize = 1; + } + } + + unsigned i = 0; + unsigned j; + while (i < data->dsSize) + { + switch (data->dsDataType) + { + case TYP_FLOAT: + assert(data->dsSize >= 4); + printf("\tdd\t%08llXh\t", *reinterpret_cast(&data->dsCont[i])); + printf("\t; %9.6g", *reinterpret_cast(&data->dsCont[i])); + i += 4; + break; + + case TYP_DOUBLE: + assert(data->dsSize >= 8); + printf("\tdq\t%016llXh", *reinterpret_cast(&data->dsCont[i])); + printf("\t; %12.9g", *reinterpret_cast(&data->dsCont[i])); + i += 8; + break; + + default: + switch (elemSize) + { + case 1: + printf("\tdb\t%02Xh", *reinterpret_cast(&data->dsCont[i])); + for (j = 1; j < 16; j++) + { + if (i + j >= data->dsSize) + break; + printf(", %02Xh", *reinterpret_cast(&data->dsCont[i + j])); + } + i += j; + break; + + case 2: + assert((data->dsSize % 2) == 0); + printf("\tdw\t%04Xh", *reinterpret_cast(&data->dsCont[i])); + for (j = 2; j < 24; j += 2) + { + if (i + j >= data->dsSize) + break; + printf(", %04Xh", *reinterpret_cast(&data->dsCont[i + j])); + } + i += j; + break; + + case 12: + case 4: + assert((data->dsSize % 4) == 0); + printf("\tdd\t%08Xh", *reinterpret_cast(&data->dsCont[i])); + for (j = 4; j < 24; j += 4) + { + if (i + j >= data->dsSize) + break; + printf(", %08Xh", *reinterpret_cast(&data->dsCont[i + j])); + } + i += j; + break; + + case 32: + case 16: + case 8: + assert((data->dsSize % 8) == 0); + printf("\tdq\t%016llXh", *reinterpret_cast(&data->dsCont[i])); + for (j = 8; j < 32; j += 8) + { + if (i + j >= data->dsSize) + break; + printf(", %016llXh", *reinterpret_cast(&data->dsCont[i + j])); + } + i += j; + break; + + default: + assert(!"unexpected elemSize"); + break; + } + } + printf("\n"); } } } @@ -5896,24 +6259,6 @@ void emitter::emitGCvarLiveSet(int offs, GCtype gcType, BYTE* addr, ssize_t disp assert(emitGCrFrameLiveTab[disp] == nullptr); emitGCrFrameLiveTab[disp] = desc; -#ifdef DEBUG - if (EMITVERBOSE) - { - printf("[%08X] %s var born at [%s", dspPtr(desc), GCtypeStr(gcType), emitGetFrameReg()); - - if (offs < 0) - { - printf("-%02XH", -offs); - } - else if (offs > 0) - { - printf("+%02XH", +offs); - } - - printf("]\n"); - } -#endif - /* The "global" live GC variable mask is no longer up-to-date */ emitThisGCrefVset = false; @@ -5954,35 +6299,6 @@ void emitter::emitGCvarDeadSet(int offs, BYTE* addr, ssize_t disp) assert(desc->vpdEndOfs == 0xFACEDEAD); desc->vpdEndOfs = emitCurCodeOffs(addr); -#ifdef DEBUG - if (EMITVERBOSE) - { - GCtype gcType = (desc->vpdVarNum & byref_OFFSET_FLAG) ? GCT_BYREF : GCT_GCREF; -#if !defined(JIT32_GCENCODER) || !defined(FEATURE_EH_FUNCLETS) - bool isThis = (desc->vpdVarNum & this_OFFSET_FLAG) != 0; - - printf("[%08X] %s%s var died at [%s", dspPtr(desc), GCtypeStr(gcType), isThis ? "this-ptr" : "", - emitGetFrameReg()); -#else - bool isPinned = (desc->vpdVarNum & pinned_OFFSET_FLAG) != 0; - - printf("[%08X] %s%s var died at [%s", dspPtr(desc), GCtypeStr(gcType), isPinned ? "pinned" : "", - emitGetFrameReg()); -#endif - - if (offs < 0) - { - printf("-%02XH", -offs); - } - else if (offs > 0) - { - printf("+%02XH", +offs); - } - - printf("]\n"); - } -#endif - /* The "global" live GC variable mask is no longer up-to-date */ emitThisGCrefVset = false; @@ -6013,9 +6329,7 @@ void emitter::emitUpdateLiveGCvars(VARSET_VALARG_TP vars, BYTE* addr) #ifdef DEBUG if (EMIT_GC_VERBOSE) { - printf("New GC ref live vars=%s ", VarSetOps::ToString(emitComp, vars)); - dumpConvertedVarSet(emitComp, vars); - printf("\n"); + VarSetOps::Assign(emitComp, debugThisGCrefVars, vars); } #endif @@ -6047,11 +6361,11 @@ void emitter::emitUpdateLiveGCvars(VARSET_VALARG_TP vars, BYTE* addr) if (VarSetOps::IsMember(emitComp, vars, num)) { GCtype gcType = (val & byref_OFFSET_FLAG) ? GCT_BYREF : GCT_GCREF; - emitGCvarLiveUpd(offs, INT_MAX, gcType, addr); + emitGCvarLiveUpd(offs, INT_MAX, gcType, addr DEBUG_ARG(num)); } else { - emitGCvarDeadUpd(offs, addr); + emitGCvarDeadUpd(offs, addr DEBUG_ARG(num)); } } } @@ -6223,16 +6537,6 @@ void emitter::emitUpdateLiveGCregs(GCtype gcType, regMaskTP regs, BYTE* addr) regMaskTP dead; regMaskTP chg; -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("New %sReg live regs=", GCtypeStr(gcType)); - printRegMaskInt(regs); - emitDispRegSet(regs); - printf("\n"); - } -#endif - assert(needsGC(gcType)); regMaskTP& emitThisXXrefRegs = (gcType == GCT_GCREF) ? emitThisGCrefRegs : emitThisByrefRegs; @@ -6356,10 +6660,6 @@ unsigned char emitter::emitOutputByte(BYTE* dst, ssize_t val) *castto(dst, unsigned char*) = (unsigned char)val; #ifdef DEBUG - if (emitComp->opts.dspEmit) - { - printf("; emit_byte 0%02XH\n", val & 0xFF); - } #ifdef TARGET_AMD64 // if we're emitting code bytes, ensure that we've already emitted the rex prefix! assert(((val & 0xFF00000000LL) == 0) || ((val & 0xFFFFFFFF00000000LL) == 0xFFFFFFFF00000000LL)); @@ -6379,10 +6679,6 @@ unsigned char emitter::emitOutputWord(BYTE* dst, ssize_t val) MISALIGNED_WR_I2(dst, (short)val); #ifdef DEBUG - if (emitComp->opts.dspEmit) - { - printf("; emit_word 0%02XH,0%02XH\n", (val & 0xFF), (val >> 8) & 0xFF); - } #ifdef TARGET_AMD64 // if we're emitting code bytes, ensure that we've already emitted the rex prefix! assert(((val & 0xFF00000000LL) == 0) || ((val & 0xFFFFFFFF00000000LL) == 0xFFFFFFFF00000000LL)); @@ -6402,10 +6698,6 @@ unsigned char emitter::emitOutputLong(BYTE* dst, ssize_t val) MISALIGNED_WR_I4(dst, (int)val); #ifdef DEBUG - if (emitComp->opts.dspEmit) - { - printf("; emit_long 0%08XH\n", (int)val); - } #ifdef TARGET_AMD64 // if we're emitting code bytes, ensure that we've already emitted the rex prefix! assert(((val & 0xFF00000000LL) == 0) || ((val & 0xFFFFFFFF00000000LL) == 0xFFFFFFFF00000000LL)); @@ -6422,18 +6714,11 @@ unsigned char emitter::emitOutputLong(BYTE* dst, ssize_t val) unsigned char emitter::emitOutputSizeT(BYTE* dst, ssize_t val) { +#if !defined(TARGET_64BIT) + MISALIGNED_WR_I4(dst, (int)val); +#else MISALIGNED_WR_ST(dst, val); - -#ifdef DEBUG - if (emitComp->opts.dspEmit) - { -#ifdef TARGET_AMD64 - printf("; emit_size_t 0%016llXH\n", val); -#else // TARGET_AMD64 - printf("; emit_size_t 0%08XH\n", val); -#endif // TARGET_AMD64 - } -#endif // DEBUG +#endif return TARGET_POINTER_SIZE; } @@ -6450,6 +6735,7 @@ unsigned char emitter::emitOutputSizeT(BYTE* dst, ssize_t val) // Same as wrapped function. // +#if !defined(HOST_64BIT) #if defined(TARGET_X86) unsigned char emitter::emitOutputByte(BYTE* dst, size_t val) { @@ -6491,6 +6777,7 @@ unsigned char emitter::emitOutputSizeT(BYTE* dst, unsigned __int64 val) return emitOutputSizeT(dst, (ssize_t)val); } #endif // defined(TARGET_X86) +#endif // !defined(HOST_64BIT) /***************************************************************************** * @@ -6592,13 +6879,6 @@ void emitter::emitGCregLiveUpd(GCtype gcType, regNumber reg, BYTE* addr) } emitThisXXrefRegs |= regMask; - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("%sReg +[%s]\n", GCtypeStr(gcType), emitRegName(reg)); - } -#endif } // The 2 GC reg masks can't be overlapping @@ -6639,17 +6919,6 @@ void emitter::emitGCregDeadUpdMask(regMaskTP regs, BYTE* addr) } emitThisGCrefRegs &= ~gcrefRegs; - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("gcrReg "); - printRegMaskInt(gcrefRegs); - printf(" -"); - emitDispRegSet(gcrefRegs); - printf("\n"); - } -#endif } // Second, handle the byref regs going dead @@ -6666,17 +6935,6 @@ void emitter::emitGCregDeadUpdMask(regMaskTP regs, BYTE* addr) } emitThisByrefRegs &= ~byrefRegs; - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("byrReg "); - printRegMaskInt(byrefRegs); - printf(" -"); - emitDispRegSet(byrefRegs); - printf("\n"); - } -#endif } } @@ -6707,13 +6965,6 @@ void emitter::emitGCregDeadUpd(regNumber reg, BYTE* addr) } emitThisGCrefRegs &= ~regMask; - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("%s -[%s]\n", "gcrReg", emitRegName(reg)); - } -#endif } else if ((emitThisByrefRegs & regMask) != 0) { @@ -6723,13 +6974,6 @@ void emitter::emitGCregDeadUpd(regNumber reg, BYTE* addr) } emitThisByrefRegs &= ~regMask; - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("%s -[%s]\n", "byrReg", emitRegName(reg)); - } -#endif } } @@ -6741,7 +6985,7 @@ void emitter::emitGCregDeadUpd(regNumber reg, BYTE* addr) * need a valid value to check if the variable is tracked or not. */ -void emitter::emitGCvarLiveUpd(int offs, int varNum, GCtype gcType, BYTE* addr) +void emitter::emitGCvarLiveUpd(int offs, int varNum, GCtype gcType, BYTE* addr DEBUG_ARG(unsigned actualVarNum)) { assert(abs(offs) % sizeof(int) == 0); assert(needsGC(gcType)); @@ -6764,13 +7008,6 @@ void emitter::emitGCvarLiveUpd(int offs, int varNum, GCtype gcType, BYTE* addr) regPtrNext->rpdPtrArg = (unsigned short)offs; regPtrNext->rpdArgType = (unsigned short)GCInfo::rpdARG_PUSH; regPtrNext->rpdIsThis = FALSE; - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("[%04X] %s arg write\n", offs, GCtypeStr(gcType)); - } -#endif } } else @@ -6823,6 +7060,13 @@ void emitter::emitGCvarLiveUpd(int offs, int varNum, GCtype gcType, BYTE* addr) if (emitGCrFrameLiveTab[disp] == nullptr) { emitGCvarLiveSet(offs, gcType, addr, disp); +#ifdef DEBUG + if ((EMIT_GC_VERBOSE || emitComp->opts.disasmWithGC) && (actualVarNum < emitComp->lvaCount) && + emitComp->lvaGetDesc(actualVarNum)->lvTracked) + { + VarSetOps::AddElemD(emitComp, debugThisGCrefVars, emitComp->lvaGetDesc(actualVarNum)->lvVarIndex); + } +#endif } } } @@ -6833,7 +7077,7 @@ void emitter::emitGCvarLiveUpd(int offs, int varNum, GCtype gcType, BYTE* addr) * Record the fact that the given variable no longer contains a live GC ref. */ -void emitter::emitGCvarDeadUpd(int offs, BYTE* addr) +void emitter::emitGCvarDeadUpd(int offs, BYTE* addr DEBUG_ARG(unsigned varNum)) { assert(emitIssuing); assert(abs(offs) % sizeof(int) == 0); @@ -6855,6 +7099,13 @@ void emitter::emitGCvarDeadUpd(int offs, BYTE* addr) { assert(!emitComp->lvaKeepAliveAndReportThis() || (offs != emitSyncThisObjOffs)); emitGCvarDeadSet(offs, addr, disp); +#ifdef DEBUG + if ((EMIT_GC_VERBOSE || emitComp->opts.disasmWithGC) && (varNum < emitComp->lvaCount) && + emitComp->lvaGetDesc(varNum)->lvTracked) + { + VarSetOps::RemoveElemD(emitComp, debugThisGCrefVars, emitComp->lvaGetDesc(varNum)->lvVarIndex); + } +#endif } } } @@ -7022,7 +7273,7 @@ void emitter::emitNxtIG(bool extend) * emitGetInsSC: Get the instruction's constant value. */ -target_ssize_t emitter::emitGetInsSC(instrDesc* id) +cnsval_ssize_t emitter::emitGetInsSC(instrDesc* id) { #ifdef TARGET_ARM // should it be TARGET_ARMARCH? Why do we need this? Note that on ARM64 we store scaled immediates // for some formats @@ -7218,13 +7469,6 @@ void emitter::emitStackPushLargeStk(BYTE* addr, GCtype gcType, unsigned count) regPtrNext->rpdPtrArg = (unsigned short)level.Value(); regPtrNext->rpdArgType = (unsigned short)GCInfo::rpdARG_PUSH; regPtrNext->rpdIsThis = FALSE; - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("[%08X] %s arg push %u\n", dspPtr(regPtrNext), GCtypeStr(gcType), level.Value()); - } -#endif } /* This is an "interesting" argument push */ @@ -7357,13 +7601,6 @@ void emitter::emitStackPopLargeStk(BYTE* addr, bool isCall, unsigned char callIn regPtrNext->rpdArg = TRUE; regPtrNext->rpdArgType = (unsigned short)GCInfo::rpdARG_POP; regPtrNext->rpdPtrArg = argRecCnt.Value(); - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("[%08X] ptr arg pop %u\n", dspPtr(regPtrNext), count); - } -#endif } /***************************************************************************** @@ -7444,13 +7681,6 @@ void emitter::emitStackKillArgs(BYTE* addr, unsigned count, unsigned char callIn regPtrNext->rpdArg = TRUE; regPtrNext->rpdArgType = (unsigned short)GCInfo::rpdARG_KILL; regPtrNext->rpdPtrArg = gcCnt.Value(); - -#ifdef DEBUG - if (EMIT_GC_VERBOSE) - { - printf("[%08X] ptr arg kill %u\n", dspPtr(regPtrNext), count); - } -#endif } /* Now that ptr args have been marked as non-ptrs, we need to record @@ -7692,7 +7922,12 @@ regMaskTP emitter::emitGetGCRegsKilledByNoGCCall(CorInfoHelpFunc helper) break; case CORINFO_HELP_PROF_FCN_LEAVE: +#if defined(TARGET_ARM) + // profiler scratch remains gc live + result = RBM_PROFILER_LEAVE_TRASH & ~RBM_PROFILER_RET_SCRATCH; +#else result = RBM_PROFILER_LEAVE_TRASH; +#endif break; case CORINFO_HELP_PROF_FCN_TAILCALL: diff --git a/src/coreclr/src/jit/emit.h b/src/coreclr/src/jit/emit.h index 2c7f0b073b5d..4709bb2b34d6 100644 --- a/src/coreclr/src/jit/emit.h +++ b/src/coreclr/src/jit/emit.h @@ -870,7 +870,7 @@ class emitter // return value more than 15 that doesn't fit in 4 bits _idCodeSize. // If somehow we generate instruction that needs more than 15 bytes we // will fail on another assert in emit.cpp: noway_assert(id->idCodeSize() >= csz). - // Issue https://github.com/dotnet/coreclr/issues/25050. + // Issue https://github.com/dotnet/runtime/issues/12840. sz = 15; } assert(sz <= 15); // Intel decoder limit. @@ -1370,7 +1370,7 @@ class emitter struct instrDescCns : instrDesc // large const { - target_ssize_t idcCnsVal; + cnsval_ssize_t idcCnsVal; }; struct instrDescDsp : instrDesc // large displacement @@ -1466,7 +1466,7 @@ class emitter #endif // TARGET_XARCH - target_ssize_t emitGetInsSC(instrDesc* id); + cnsval_ssize_t emitGetInsSC(instrDesc* id); unsigned emitInsCount; /************************************************************************/ @@ -1489,12 +1489,26 @@ class emitter const char* emitFldName(CORINFO_FIELD_HANDLE fieldVal); const char* emitFncName(CORINFO_METHOD_HANDLE callVal); + // GC Info changes are not readily available at each instruction. + // We use debug-only sets to track the per-instruction state, and to remember + // what the state was at the last time it was output (instruction or label). + VARSET_TP debugPrevGCrefVars; + VARSET_TP debugThisGCrefVars; + regPtrDsc* debugPrevRegPtrDsc; + regMaskTP debugPrevGCrefRegs; + regMaskTP debugPrevByrefRegs; + void emitDispGCDeltaTitle(const char* title); + void emitDispGCRegDelta(const char* title, regMaskTP prevRegs, regMaskTP curRegs); + void emitDispGCVarDelta(); + void emitDispGCInfoDelta(); + void emitDispIGflags(unsigned flags); void emitDispIG(insGroup* ig, insGroup* igPrev = nullptr, bool verbose = false); void emitDispIGlist(bool verbose = false); void emitDispGCinfo(); void emitDispClsVar(CORINFO_FIELD_HANDLE fldHnd, ssize_t offs, bool reloc = false); void emitDispFrameRef(int varx, int disp, int offs, bool asmfm); + void emitDispInsAddr(BYTE* code); void emitDispInsOffs(unsigned offs, bool doffs); void emitDispInsHex(instrDesc* id, BYTE* code, size_t sz); @@ -1645,6 +1659,7 @@ class emitter unsigned char emitOutputLong(BYTE* dst, ssize_t val); unsigned char emitOutputSizeT(BYTE* dst, ssize_t val); +#if !defined(HOST_64BIT) #if defined(TARGET_X86) unsigned char emitOutputByte(BYTE* dst, size_t val); unsigned char emitOutputWord(BYTE* dst, size_t val); @@ -1656,6 +1671,7 @@ class emitter unsigned char emitOutputLong(BYTE* dst, unsigned __int64 val); unsigned char emitOutputSizeT(BYTE* dst, unsigned __int64 val); #endif // defined(TARGET_X86) +#endif // !defined(HOST_64BIT) size_t emitIssue1Instr(insGroup* ig, instrDesc* id, BYTE** dp); size_t emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp); @@ -1678,7 +1694,7 @@ class emitter void emitSetMediumJump(instrDescJmp* id); public: - CORINFO_FIELD_HANDLE emitAnyConst(const void* cnsAddr, UNATIVE_OFFSET cnsSize, UNATIVE_OFFSET cnsAlign); + CORINFO_FIELD_HANDLE emitBlkConst(const void* cnsAddr, unsigned cnsSize, unsigned cnsAlign, var_types elemType); private: CORINFO_FIELD_HANDLE emitFltOrDblConst(double constValue, emitAttr attr); @@ -1909,7 +1925,7 @@ class emitter return (instrDescCns*)emitAllocAnyInstr(sizeof(instrDescCns), attr); } - instrDescCns* emitAllocInstrCns(emitAttr attr, target_size_t cns) + instrDescCns* emitAllocInstrCns(emitAttr attr, cnsval_size_t cns) { instrDescCns* result = emitAllocInstrCns(attr); result->idSetIsLargeCns(); @@ -1963,8 +1979,8 @@ class emitter instrDesc* emitNewInstrSmall(emitAttr attr); instrDesc* emitNewInstr(emitAttr attr = EA_4BYTE); - instrDesc* emitNewInstrSC(emitAttr attr, target_ssize_t cns); - instrDesc* emitNewInstrCns(emitAttr attr, target_ssize_t cns); + instrDesc* emitNewInstrSC(emitAttr attr, cnsval_ssize_t cns); + instrDesc* emitNewInstrCns(emitAttr attr, cnsval_ssize_t cns); instrDesc* emitNewInstrDsp(emitAttr attr, target_ssize_t dsp); instrDesc* emitNewInstrCnsDsp(emitAttr attr, target_ssize_t cns, int dsp); #ifdef TARGET_ARM @@ -2127,9 +2143,9 @@ class emitter void emitGCregDeadUpd(regNumber reg, BYTE* addr); void emitGCregDeadSet(GCtype gcType, regMaskTP mask, BYTE* addr); - void emitGCvarLiveUpd(int offs, int varNum, GCtype gcType, BYTE* addr); + void emitGCvarLiveUpd(int offs, int varNum, GCtype gcType, BYTE* addr DEBUG_ARG(unsigned actualVarNum)); void emitGCvarLiveSet(int offs, GCtype gcType, BYTE* addr, ssize_t disp = -1); - void emitGCvarDeadUpd(int offs, BYTE* addr); + void emitGCvarDeadUpd(int offs, BYTE* addr DEBUG_ARG(unsigned varNum)); void emitGCvarDeadSet(int offs, BYTE* addr, ssize_t disp = -1); GCtype emitRegGCtype(regNumber reg); @@ -2151,6 +2167,12 @@ class emitter struct dataSection { + // Note to use alignments greater than 32 requires modification in the VM + // to support larger alignments (see ICorJitInfo::allocMem) + // + const static unsigned MIN_DATA_ALIGN = 4; + const static unsigned MAX_DATA_ALIGN = 32; + enum sectionType { data, @@ -2161,6 +2183,8 @@ class emitter dataSection* dsNext; UNATIVE_OFFSET dsSize; sectionType dsType; + var_types dsDataType; + // variable-sized array used to store the constant data // or BasicBlock* array in the block cases. BYTE dsCont[0]; @@ -2293,6 +2317,13 @@ class emitter VarSetOps::AssignNoCopy(emitComp, emitPrevGCrefVars, VarSetOps::MakeEmpty(emitComp)); VarSetOps::AssignNoCopy(emitComp, emitInitGCrefVars, VarSetOps::MakeEmpty(emitComp)); VarSetOps::AssignNoCopy(emitComp, emitThisGCrefVars, VarSetOps::MakeEmpty(emitComp)); +#if defined(DEBUG) + VarSetOps::AssignNoCopy(emitComp, debugPrevGCrefVars, VarSetOps::MakeEmpty(emitComp)); + VarSetOps::AssignNoCopy(emitComp, debugThisGCrefVars, VarSetOps::MakeEmpty(emitComp)); + debugPrevRegPtrDsc = nullptr; + debugPrevGCrefRegs = RBM_NONE; + debugPrevByrefRegs = RBM_NONE; +#endif } }; @@ -2511,7 +2542,7 @@ inline emitter::instrDesc* emitter::emitNewInstrDsp(emitAttr attr, target_ssize_ * Note that this very similar to emitter::emitNewInstrSC(), except it never * allocates a small descriptor. */ -inline emitter::instrDesc* emitter::emitNewInstrCns(emitAttr attr, target_ssize_t cns) +inline emitter::instrDesc* emitter::emitNewInstrCns(emitAttr attr, cnsval_ssize_t cns) { if (instrDesc::fitsInSmallCns(cns)) { @@ -2570,7 +2601,7 @@ inline size_t emitter::emitGetInstrDescSize(const instrDesc* id) * emitNewInstrCns() always allocates at least sizeof(instrDesc)). */ -inline emitter::instrDesc* emitter::emitNewInstrSC(emitAttr attr, target_ssize_t cns) +inline emitter::instrDesc* emitter::emitNewInstrSC(emitAttr attr, cnsval_ssize_t cns) { if (instrDesc::fitsInSmallCns(cns)) { diff --git a/src/coreclr/src/jit/emitarm.cpp b/src/coreclr/src/jit/emitarm.cpp index cee6fde07293..c4bad9fe0884 100644 --- a/src/coreclr/src/jit/emitarm.cpp +++ b/src/coreclr/src/jit/emitarm.cpp @@ -1938,7 +1938,7 @@ void emitter::emitIns_R_I( fmt = IF_T2_K3; sf = INS_FLAGS_NOT_SET; } - __fallthrough; + FALLTHROUGH; #endif // FEATURE_PLI_INSTRUCTION case INS_pld: @@ -2029,7 +2029,7 @@ void emitter::emitIns_R_R( sf = INS_FLAGS_NOT_SET; break; } - __fallthrough; + FALLTHROUGH; case INS_sub: assert(reg1 != REG_PC); // VM debugging single stepper doesn't support PC register with this instruction. @@ -2117,7 +2117,7 @@ void emitter::emitIns_R_R( assert(reg1 != REG_PC); // VM debugging single stepper doesn't support PC register with this instruction. assert(reg2 != REG_PC); assert(reg1 != reg2); - __fallthrough; + FALLTHROUGH; case INS_vabs: case INS_vsqrt: @@ -2133,7 +2133,6 @@ void emitter::emitIns_R_R( assert(isFloatReg(reg1)); assert(isFloatReg(reg2)); } - __fallthrough; VCVT_COMMON: fmt = IF_T2_VFP2; @@ -2177,7 +2176,7 @@ void emitter::emitIns_R_R( sf = INS_FLAGS_SET; break; } - __fallthrough; + FALLTHROUGH; case INS_orn: // assert below fired for bug 281892 where the two operands of an OR were @@ -2437,7 +2436,7 @@ void emitter::emitIns_R_R_I(instruction ins, break; } } - __fallthrough; + FALLTHROUGH; case INS_sub: assert(reg1 != REG_PC); // VM debugging single stepper doesn't support PC register with this instruction. @@ -2573,7 +2572,7 @@ void emitter::emitIns_R_R_I(instruction ins, sf = INS_FLAGS_SET; break; } - __fallthrough; + FALLTHROUGH; case INS_adc: case INS_eor: @@ -2844,10 +2843,9 @@ void emitter::emitIns_R_R_I(instruction ins, } } } - // - // If we did not find a thumb-1 encoding above - // - __fallthrough; + // + // If we did not find a thumb-1 encoding above + // COMMON_THUMB2_LDST: assert(fmt == IF_NONE); @@ -2963,7 +2961,7 @@ void emitter::emitIns_R_R_R(instruction ins, reg3 = reg2; reg2 = REG_SP; } - __fallthrough; + FALLTHROUGH; case INS_sub: assert(reg3 != REG_SP); @@ -3013,7 +3011,7 @@ void emitter::emitIns_R_R_R(instruction ins, emitIns_R_R(ins, attr, reg1, reg3, flags); return; } - __fallthrough; + FALLTHROUGH; case INS_orn: assert(reg1 != REG_PC); // VM debugging single stepper doesn't support PC register with this instruction. @@ -3035,7 +3033,7 @@ void emitter::emitIns_R_R_R(instruction ins, emitIns_R_R(ins, attr, reg1, reg3, flags); return; } - __fallthrough; + FALLTHROUGH; case INS_ror: assert(reg1 != REG_PC); // VM debugging single stepper doesn't support PC register with this instruction. @@ -3070,9 +3068,9 @@ void emitter::emitIns_R_R_R(instruction ins, assert(!"Instruction cannot be encoded"); } } - __fallthrough; #if !defined(USE_HELPERS_FOR_INT_DIV) + FALLTHROUGH; case INS_sdiv: case INS_udiv: #endif // !USE_HELPERS_FOR_INT_DIV @@ -3306,7 +3304,7 @@ void emitter::emitIns_R_R_R_I(instruction ins, } } } - __fallthrough; + FALLTHROUGH; case INS_adc: case INS_and: @@ -5550,7 +5548,7 @@ BYTE* emitter::emitOutputShortBranch(BYTE* dst, instruction ins, insFormat fmt, else if (fmt == IF_T1_I) { assert(id != NULL); - assert(ins == INS_cbz || INS_cbnz); + assert(ins == INS_cbz || ins == INS_cbnz); assert((distVal & 1) == 0); assert(distVal >= 0); assert(distVal <= 126); @@ -6111,7 +6109,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) if (!id->idIsReloc()) { assert(sizeof(size_t) == sizeof(target_size_t)); - imm = (target_size_t)addr; + imm = (target_size_t)(size_t)addr; if (ins == INS_movw) { imm &= 0xffff; @@ -6189,7 +6187,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) case INS_vneg: if (id->idOpSize() == EA_8BYTE) szCode |= (1 << 8); - __fallthrough; + FALLTHROUGH; default: srcSize = dstSize = id->idOpSize(); @@ -6503,7 +6501,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) int adr = emitComp->lvaFrameAddress(varNum, true, ®Base, ofs, /* isFloatUsage */ false); // no float GC refs if (id->idGCref() != GCT_NONE) { - emitGCvarLiveUpd(adr + ofs, varNum, id->idGCref(), dst); + emitGCvarLiveUpd(adr + ofs, varNum, id->idGCref(), dst DEBUG_ARG(varNum)); } else { @@ -6520,7 +6518,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) vt = tmpDsc->tdTempType(); } if (vt == TYP_REF || vt == TYP_BYREF) - emitGCvarDeadUpd(adr + ofs, dst); + emitGCvarDeadUpd(adr + ofs, dst DEBUG_ARG(varNum)); } } @@ -6530,7 +6528,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) size_t expected = emitSizeOfInsDsc(id); assert(sz == expected); - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { emitDispIns(id, false, dspOffs, true, emitCurCodeOffs(odst), *dp, (dst - *dp), ig); } @@ -6559,6 +6557,12 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) assert(!"JitBreakEmitOutputInstr reached"); } } + + // Output any delta in GC info. + if (EMIT_GC_VERBOSE || emitComp->opts.disasmWithGC) + { + emitDispGCInfoDelta(); + } #endif /* All instructions are expected to generate code */ @@ -6970,8 +6974,14 @@ void emitter::emitDispInsHelp( if (code == NULL) sz = 0; - if (!emitComp->opts.dspEmit && !isNew && !asmfm && sz) + if (!isNew && !asmfm && sz) + { doffs = true; + } + + /* Display the instruction address */ + + emitDispInsAddr(code); /* Display the instruction offset */ @@ -7460,13 +7470,13 @@ void emitter::emitDispInsHelp( case IF_T1_I: // Special Compare-and-branch emitDispReg(id->idReg1(), attr, true); - __fallthrough; + FALLTHROUGH; case IF_T1_K: // Special Branch, conditional case IF_T1_M: assert(((instrDescJmp*)id)->idjShort); printf("SHORT "); - __fallthrough; + FALLTHROUGH; case IF_T2_N1: if (fmt == IF_T2_N1) @@ -7474,7 +7484,7 @@ void emitter::emitDispInsHelp( emitDispReg(id->idReg1(), attr, true); printf("%s ADDRESS ", (id->idIns() == INS_movw) ? "LOW" : "HIGH"); } - __fallthrough; + FALLTHROUGH; case IF_T2_J1: case IF_T2_J2: diff --git a/src/coreclr/src/jit/emitarm64.cpp b/src/coreclr/src/jit/emitarm64.cpp index a23aef5812a6..6a819f8c05a9 100644 --- a/src/coreclr/src/jit/emitarm64.cpp +++ b/src/coreclr/src/jit/emitarm64.cpp @@ -4173,7 +4173,7 @@ void emitter::emitIns_R_R( } break; } - __fallthrough; + FALLTHROUGH; case INS_negs: assert(insOptsNone(opt)); @@ -4184,7 +4184,7 @@ void emitter::emitIns_R_R( case INS_sxtw: assert(size == EA_8BYTE); - __fallthrough; + FALLTHROUGH; case INS_sxtb: case INS_sxth: @@ -4236,7 +4236,7 @@ void emitter::emitIns_R_R( break; } - __fallthrough; + FALLTHROUGH; case INS_rev: assert(insOptsNone(opt)); @@ -4291,7 +4291,7 @@ void emitter::emitIns_R_R( fmt = IF_DV_2L; break; } - __fallthrough; + FALLTHROUGH; case INS_xtn: // Vector operation @@ -4321,7 +4321,7 @@ void emitter::emitIns_R_R( case INS_stlr: assert(isValidGeneralDatasize(size)); - __fallthrough; + FALLTHROUGH; case INS_ldarb: case INS_ldaxrb: @@ -4716,7 +4716,7 @@ void emitter::emitIns_R_R( case INS_st3: case INS_st4: assert(opt != INS_OPTS_1D); // .1D format only permitted with LD1 & ST1 - __fallthrough; + FALLTHROUGH; case INS_ld1: case INS_ld1_2regs: @@ -4835,7 +4835,7 @@ void emitter::emitIns_R_I_I( case INS_mov: ins = INS_movz; // INS_mov with LSL is an alias for INS_movz LSL - __fallthrough; + FALLTHROUGH; case INS_movk: case INS_movn: @@ -5086,7 +5086,7 @@ void emitter::emitIns_R_R_I( case INS_sxtl: case INS_uxtl: assert(imm == 0); - __fallthrough; + FALLTHROUGH; case INS_rshrn: case INS_shrn: @@ -5108,7 +5108,7 @@ void emitter::emitIns_R_R_I( case INS_sxtl2: case INS_uxtl2: assert(imm == 0); - __fallthrough; + FALLTHROUGH; case INS_rshrn2: case INS_shrn2: @@ -5265,7 +5265,7 @@ void emitter::emitIns_R_R_I( break; } } - __fallthrough; + FALLTHROUGH; case INS_ins: // (MOV from general) assert(insOptsNone(opt)); @@ -5412,7 +5412,7 @@ void emitter::emitIns_R_R_I( case INS_st3: case INS_st4: assert(opt != INS_OPTS_1D); // .1D format only permitted with LD1 & ST1 - __fallthrough; + FALLTHROUGH; case INS_ld1: case INS_ld1_2regs: @@ -5538,6 +5538,15 @@ void emitter::emitIns_R_R_I( assert(!"Instruction cannot be encoded: IF_LS_2B"); } } + + // Is the ldr/str even necessary? + // For volatile load/store, there will be memory barrier instruction before/after the load/store + // and in such case, IsRedundantLdStr() returns false, because the method just checks for load/store + // pair next to each other. + if (emitComp->opts.OptimizationEnabled() && IsRedundantLdStr(ins, reg1, reg2, imm, size, fmt)) + { + return; + } } else if (isAddSub) { @@ -5695,7 +5704,7 @@ void emitter::emitIns_R_R_R( break; } // Base instruction - __fallthrough; + FALLTHROUGH; case INS_lsl: case INS_lsr: @@ -5758,7 +5767,7 @@ void emitter::emitIns_R_R_R( break; } // Base instruction - __fallthrough; + FALLTHROUGH; case INS_adds: case INS_subs: @@ -5936,7 +5945,7 @@ void emitter::emitIns_R_R_R( fmt = IF_DV_3C; break; } - __fallthrough; + FALLTHROUGH; case INS_ands: case INS_bics: @@ -6127,7 +6136,7 @@ void emitter::emitIns_R_R_R( case INS_st3: case INS_st4: assert(opt != INS_OPTS_1D); // .1D format only permitted with LD1 & ST1 - __fallthrough; + FALLTHROUGH; case INS_ld1: case INS_ld1_2regs: @@ -6475,7 +6484,7 @@ void emitter::emitIns_R_R_R_I(instruction ins, case INS_ldnp: case INS_stnp: assert(insOptsNone(opt)); // Can't use Pre/Post index on these two instructions - __fallthrough; + FALLTHROUGH; case INS_ldp: case INS_stp: @@ -7525,6 +7534,12 @@ void emitter::emitIns_R_S(instruction ins, emitAttr attr, regNumber reg1, int va } } + // Is the ldr/str even necessary? + if (emitComp->opts.OptimizationEnabled() && IsRedundantLdStr(ins, reg1, reg2, imm, size, fmt)) + { + return; + } + assert(fmt != IF_NONE); instrDesc* id = emitNewInstrCns(attr, imm); @@ -7750,6 +7765,12 @@ void emitter::emitIns_S_R(instruction ins, emitAttr attr, regNumber reg1, int va fmt = IF_LS_3A; } + // Is the ldr/str even necessary? + if (emitComp->opts.OptimizationEnabled() && IsRedundantLdStr(ins, reg1, reg2, imm, size, fmt)) + { + return; + } + assert(fmt != IF_NONE); instrDesc* id = emitNewInstrCns(attr, imm); @@ -11389,7 +11410,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) int adr = emitComp->lvaFrameAddress(varNum, &FPbased); if (id->idGCref() != GCT_NONE) { - emitGCvarLiveUpd(adr + ofs, varNum, id->idGCref(), dst); + emitGCvarLiveUpd(adr + ofs, varNum, id->idGCref(), dst DEBUG_ARG(varNum)); } else { @@ -11406,14 +11427,14 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) vt = tmpDsc->tdTempType(); } if (vt == TYP_REF || vt == TYP_BYREF) - emitGCvarDeadUpd(adr + ofs, dst); + emitGCvarDeadUpd(adr + ofs, dst DEBUG_ARG(varNum)); } if (emitInsWritesToLclVarStackLocPair(id)) { unsigned ofs2 = ofs + TARGET_POINTER_SIZE; if (id->idGCrefReg2() != GCT_NONE) { - emitGCvarLiveUpd(adr + ofs2, varNum, id->idGCrefReg2(), dst); + emitGCvarLiveUpd(adr + ofs2, varNum, id->idGCrefReg2(), dst DEBUG_ARG(varNum)); } else { @@ -11430,7 +11451,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) vt = tmpDsc->tdTempType(); } if (vt == TYP_REF || vt == TYP_BYREF) - emitGCvarDeadUpd(adr + ofs2, dst); + emitGCvarDeadUpd(adr + ofs2, dst DEBUG_ARG(varNum)); } } } @@ -11441,7 +11462,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) size_t expected = emitSizeOfInsDsc(id); assert(sz == expected); - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { emitDispIns(id, false, dspOffs, true, emitCurCodeOffs(odst), *dp, (dst - *dp), ig); } @@ -11455,6 +11476,12 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) assert(!"JitBreakEmitOutputInstr reached"); } } + + // Output any delta in GC info. + if (EMIT_GC_VERBOSE || emitComp->opts.disasmWithGC) + { + emitDispGCInfoDelta(); + } #endif /* All instructions are expected to generate code */ @@ -12080,8 +12107,14 @@ void emitter::emitDispIns( if (pCode == NULL) sz = 0; - if (!emitComp->opts.dspEmit && !isNew && !asmfm && sz) + if (!isNew && !asmfm && sz) + { doffs = true; + } + + /* Display the instruction address */ + + emitDispInsAddr(pCode); /* Display the instruction offset */ @@ -12288,7 +12321,15 @@ void emitter::emitDispIns( { targetName = "SetGlobalSecurityCookie"; } - else if ((idFlags == GTF_ICON_STR_HDL) || (idFlags == GTF_ICON_PSTR_HDL)) + else if (idFlags == GTF_ICON_CONST_PTR) + { + targetName = "const ptr"; + } + else if (idFlags == GTF_ICON_GLOBAL_PTR) + { + targetName = "global ptr"; + } + else if (idFlags == GTF_ICON_STR_HDL) { stringLiteral = emitComp->eeGetCPString(targetHandle); // Note that eGetCPString isn't currently implemented on Linux/ARM @@ -13763,7 +13804,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins } // otherwise we should have a br_tail instruction assert(ins == INS_br_tail); - __fallthrough; + FALLTHROUGH; case IF_BR_1A: // ret, br result.insThroughput = PERFSCORE_THROUGHPUT_1C; result.insLatency = PERFSCORE_LATENCY_1C; @@ -13879,6 +13920,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins perfScoreUnhandledInstruction(id, &result); break; } + break; // ALU, basic immediate case IF_DI_1A: // cmp, cmn @@ -15461,4 +15503,90 @@ bool emitter::IsRedundantMov(instruction ins, emitAttr size, regNumber dst, regN return false; } + +//---------------------------------------------------------------------------------------- +// IsRedundantLdStr: +// For ldr/str pair next to each other, check if the current load or store is needed or is +// the value already present as of previous instruction. +// +// ldr x1, [x2, #56] +// str x1, [x2, #56] <-- redundant +// +// OR +// +// str x1, [x2, #56] +// ldr x1, [x2, #56] <-- redundant + +// Arguments: +// ins - The current instruction +// dst - The current destination +// src - The current source +// imm - Immediate offset +// size - Operand size +// fmt - Format of instruction +// Return Value: +// true if previous instruction already has desired value in register/memory location. + +bool emitter::IsRedundantLdStr( + instruction ins, regNumber reg1, regNumber reg2, ssize_t imm, emitAttr size, insFormat fmt) +{ + bool isFirstInstrInBlock = (emitCurIGinsCnt == 0) && ((emitCurIG->igFlags & IGF_EXTEND) == 0); + + if (((ins != INS_ldr) && (ins != INS_str)) || (isFirstInstrInBlock) || (emitLastIns == nullptr)) + { + return false; + } + + regNumber prevReg1 = emitLastIns->idReg1(); + regNumber prevReg2 = emitLastIns->idReg2(); + insFormat lastInsfmt = emitLastIns->idInsFmt(); + emitAttr prevSize = emitLastIns->idOpSize(); + ssize_t prevImm = emitLastIns->idIsLargeCns() ? ((instrDescCns*)emitLastIns)->idcCnsVal : emitLastIns->idSmallCns(); + + // Only optimize if: + // 1. "base" or "base plus immediate offset" addressing modes. + // 2. Addressing mode matches with previous instruction. + // 3. The operand size matches with previous instruction + if (((fmt != IF_LS_2A) && (fmt != IF_LS_2B)) || (fmt != lastInsfmt) || (prevSize != size)) + { + return false; + } + + if ((ins == INS_ldr) && (emitLastIns->idIns() == INS_str)) + { + // If reg1 is of size less than 8-bytes, then eliminating the 'ldr' + // will not zero the upper bits of reg1. + + // Make sure operand size is 8-bytes + // str w0, [x1, #4] + // ldr w0, [x1, #4] <-- can't eliminate because upper-bits of x0 won't get set. + if (size != EA_8BYTE) + { + return false; + } + + if ((prevReg1 == reg1) && (prevReg2 == reg2) && (imm == prevImm)) + { + JITDUMP("\n -- suppressing 'ldr reg%u [reg%u, #%u]' as previous 'str reg%u [reg%u, #%u]' was from same " + "location.\n", + reg1, reg2, imm, prevReg1, prevReg2, prevImm); + return true; + } + } + else if ((ins == INS_str) && (emitLastIns->idIns() == INS_ldr)) + { + // Make sure src and dst registers are not same. + // ldr x0, [x0, #4] + // str x0, [x0, #4] <-- can't eliminate because [x0+3] is not same destination as previous source. + if ((reg1 != reg2) && (prevReg1 == reg1) && (prevReg2 == reg2) && (imm == prevImm)) + { + JITDUMP("\n -- suppressing 'str reg%u [reg%u, #%u]' as previous 'ldr reg%u [reg%u, #%u]' was from same " + "location.\n", + reg1, reg2, imm, prevReg1, prevReg2, prevImm); + return true; + } + } + + return false; +} #endif // defined(TARGET_ARM64) diff --git a/src/coreclr/src/jit/emitarm64.h b/src/coreclr/src/jit/emitarm64.h index 94a3e6d7c32d..8b8c812aacfc 100644 --- a/src/coreclr/src/jit/emitarm64.h +++ b/src/coreclr/src/jit/emitarm64.h @@ -118,6 +118,7 @@ static UINT64 Replicate_helper(UINT64 value, unsigned width, emitAttr size); // Method to do check if mov is redundant with respect to the last instruction. // If yes, the caller of this method can choose to omit current mov instruction. bool IsRedundantMov(instruction ins, emitAttr size, regNumber dst, regNumber src); +bool IsRedundantLdStr(instruction ins, regNumber reg1, regNumber reg2, ssize_t imm, emitAttr size, insFormat fmt); /************************************************************************ * diff --git a/src/coreclr/src/jit/emitpub.h b/src/coreclr/src/jit/emitpub.h index 3134bf54be5c..4982104acc74 100644 --- a/src/coreclr/src/jit/emitpub.h +++ b/src/coreclr/src/jit/emitpub.h @@ -32,7 +32,7 @@ unsigned emitEndCodeGen(Compiler* comp, unsigned* epilogSize, void** codeAddr, void** coldCodeAddr, - void** consAddr); + void** consAddr DEBUGARG(unsigned* instrCount)); /************************************************************************/ /* Method prolog and epilog */ @@ -82,7 +82,7 @@ void emitIns_J(instruction ins, BasicBlock* dst, int instrCount = 0); /* Emit initialized data sections */ /************************************************************************/ -UNATIVE_OFFSET emitDataGenBeg(UNATIVE_OFFSET size, UNATIVE_OFFSET alignment); +UNATIVE_OFFSET emitDataGenBeg(unsigned size, unsigned alignment, var_types dataType); UNATIVE_OFFSET emitBBTableDataGenBeg(unsigned numEntries, bool relativeAddr); @@ -92,7 +92,11 @@ void emitDataGenData(unsigned offs, BasicBlock* label); void emitDataGenEnd(); -UNATIVE_OFFSET emitDataConst(const void* cnsAddr, UNATIVE_OFFSET cnsSize, UNATIVE_OFFSET cnsAlign); +static const UNATIVE_OFFSET INVALID_UNATIVE_OFFSET = (UNATIVE_OFFSET)-1; + +UNATIVE_OFFSET emitDataGenFind(const void* cnsAddr, unsigned size, unsigned alignment, var_types dataType); + +UNATIVE_OFFSET emitDataConst(const void* cnsAddr, unsigned cnsSize, unsigned cnsAlign, var_types dataType); UNATIVE_OFFSET emitDataSize(); diff --git a/src/coreclr/src/jit/emitxarch.cpp b/src/coreclr/src/jit/emitxarch.cpp index 1938efb9ed44..78f900ccb221 100644 --- a/src/coreclr/src/jit/emitxarch.cpp +++ b/src/coreclr/src/jit/emitxarch.cpp @@ -163,8 +163,10 @@ bool emitter::IsDstSrcSrcAVXInstruction(instruction ins) bool emitter::AreUpper32BitsZero(regNumber reg) { - // Don't look back across IG boundaries (possible control flow) - if (emitCurIGinsCnt == 0) + // If there are no instructions in this IG, we can look back at + // the previous IG's instructions if this IG is an extension. + // + if ((emitCurIGinsCnt == 0) && ((emitCurIG->igFlags & IGF_EXTEND) == 0)) { return false; } @@ -286,7 +288,7 @@ bool emitter::AreFlagsSetToZeroCmp(regNumber reg, emitAttr opSize, bool needsOCF { return false; } - __fallthrough; + FALLTHROUGH; // these always set OC to 0 case INS_and: case INS_or: @@ -522,6 +524,7 @@ bool TakesRexWPrefix(instruction ins, emitAttr attr) case INS_mulx: case INS_pdep: case INS_pext: + case INS_rorx: return true; default: return false; @@ -756,6 +759,7 @@ unsigned emitter::emitOutputRexOrVexPrefixIfNeeded(instruction ins, BYTE* dst, c { switch (ins) { + case INS_rorx: case INS_pdep: case INS_mulx: { @@ -1240,6 +1244,7 @@ bool emitter::emitInsCanOnlyWriteSSE2OrAVXReg(instrDesc* id) case INS_pextrq: case INS_pextrw: case INS_pextrw_sse41: + case INS_rorx: { // These SSE instructions write to a general purpose integer register. return false; @@ -2956,24 +2961,27 @@ void emitter::emitHandleMemOp(GenTreeIndir* indir, instrDesc* id, insFormat fmt, } else { + regNumber amBaseReg = REG_NA; if (memBase != nullptr) { - id->idAddr()->iiaAddrMode.amBaseReg = memBase->GetRegNum(); - } - else - { - id->idAddr()->iiaAddrMode.amBaseReg = REG_NA; + assert(!memBase->isContained()); + amBaseReg = memBase->GetRegNum(); + assert(amBaseReg != REG_NA); } + regNumber amIndxReg = REG_NA; if (indir->HasIndex()) { - id->idAddr()->iiaAddrMode.amIndxReg = indir->Index()->GetRegNum(); + GenTree* index = indir->Index(); + assert(!index->isContained()); + amIndxReg = index->GetRegNum(); + assert(amIndxReg != REG_NA); } - else - { - id->idAddr()->iiaAddrMode.amIndxReg = REG_NA; - } - id->idAddr()->iiaAddrMode.amScale = emitEncodeScale(indir->Scale()); + + assert((amBaseReg != REG_NA) || (amIndxReg != REG_NA) || (indir->Offset() != 0)); // At least one should be set. + id->idAddr()->iiaAddrMode.amBaseReg = amBaseReg; + id->idAddr()->iiaAddrMode.amIndxReg = amIndxReg; + id->idAddr()->iiaAddrMode.amScale = emitEncodeScale(indir->Scale()); id->idInsFmt(emitMapFmtForIns(fmt, ins)); @@ -3043,11 +3051,7 @@ void emitter::emitInsLoadInd(instruction ins, emitAttr attr, regNumber dstReg, G if (addr->OperIs(GT_LCL_VAR_ADDR, GT_LCL_FLD_ADDR)) { GenTreeLclVarCommon* varNode = addr->AsLclVarCommon(); - unsigned offset = 0; - if (addr->OperIs(GT_LCL_FLD_ADDR)) - { - offset = varNode->AsLclFld()->GetLclOffs(); - } + unsigned offset = varNode->GetLclOffs(); emitIns_R_S(ins, attr, dstReg, varNode->GetLclNum(), offset); // Updating variable liveness after instruction was emitted @@ -3288,9 +3292,11 @@ regNumber emitter::emitInsBinary(instruction ins, emitAttr attr, GenTree* dst, G switch (memBase->OperGet()) { case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: { + assert(memBase->isContained()); varNum = memBase->AsLclVarCommon()->GetLclNum(); - offset = 0; + offset = memBase->AsLclVarCommon()->GetLclOffs(); // Ensure that all the GenTreeIndir values are set to their defaults. assert(!memIndir->HasIndex()); @@ -3601,8 +3607,7 @@ void emitter::emitInsRMW(instruction ins, emitAttr attr, GenTreeStoreInd* storeI { GenTree* addr = storeInd->Addr(); addr = addr->gtSkipReloadOrCopy(); - assert(addr->OperGet() == GT_LCL_VAR || addr->OperGet() == GT_LCL_VAR_ADDR || addr->OperGet() == GT_LEA || - addr->OperGet() == GT_CLS_VAR_ADDR || addr->OperGet() == GT_CNS_INT); + assert(addr->OperIs(GT_LCL_VAR, GT_LCL_VAR_ADDR, GT_LEA, GT_CLS_VAR_ADDR, GT_CNS_INT)); instrDesc* id = nullptr; UNATIVE_OFFSET sz; @@ -3681,8 +3686,7 @@ void emitter::emitInsRMW(instruction ins, emitAttr attr, GenTreeStoreInd* storeI { GenTree* addr = storeInd->Addr(); addr = addr->gtSkipReloadOrCopy(); - assert(addr->OperGet() == GT_LCL_VAR || addr->OperGet() == GT_LCL_VAR_ADDR || addr->OperGet() == GT_CLS_VAR_ADDR || - addr->OperGet() == GT_LEA || addr->OperGet() == GT_CNS_INT); + assert(addr->OperIs(GT_LCL_VAR, GT_LCL_VAR_ADDR, GT_CLS_VAR_ADDR, GT_LEA, GT_CNS_INT)); ssize_t offset = 0; if (addr->OperGet() != GT_CLS_VAR_ADDR) @@ -3821,7 +3825,7 @@ void emitter::emitIns_R_I(instruction ins, emitAttr attr, regNumber reg, ssize_t UNATIVE_OFFSET sz; instrDesc* id; insFormat fmt = emitInsModeFormat(ins, IF_RRD_CNS); - bool valInByte = ((signed char)val == val) && (ins != INS_mov) && (ins != INS_test); + bool valInByte = ((signed char)val == (target_ssize_t)val) && (ins != INS_mov) && (ins != INS_test); // BT reg,imm might be useful but it requires special handling of the immediate value // (it is always encoded in a byte). Let's not complicate things until this is needed. @@ -3944,11 +3948,11 @@ void emitter::emitIns_R_I(instruction ins, emitAttr attr, regNumber reg, ssize_t * Add an instruction referencing an integer constant. */ -void emitter::emitIns_I(instruction ins, emitAttr attr, int val) +void emitter::emitIns_I(instruction ins, emitAttr attr, cnsval_ssize_t val) { UNATIVE_OFFSET sz; instrDesc* id; - bool valInByte = ((signed char)val == val); + bool valInByte = ((signed char)val == (target_ssize_t)val); #ifdef TARGET_AMD64 // mov reg, imm64 is the only opcode which takes a full 8 byte immediate @@ -5348,7 +5352,7 @@ void emitter::emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize emitCurIGsize += sz; } -void emitter::emitIns_AR_R(instruction ins, emitAttr attr, regNumber reg, regNumber base, int disp) +void emitter::emitIns_AR_R(instruction ins, emitAttr attr, regNumber reg, regNumber base, cnsval_ssize_t disp) { emitIns_ARX_R(ins, attr, reg, base, REG_NA, 1, disp); } @@ -5586,7 +5590,7 @@ void emitter::emitIns_R_ARX( } void emitter::emitIns_ARX_R( - instruction ins, emitAttr attr, regNumber reg, regNumber base, regNumber index, unsigned scale, int disp) + instruction ins, emitAttr attr, regNumber reg, regNumber base, regNumber index, unsigned scale, cnsval_ssize_t disp) { UNATIVE_OFFSET sz; instrDesc* id = emitNewInstrAmd(attr, disp); @@ -7113,7 +7117,7 @@ void emitter::emitIns_Call(EmitCallType callType, id->idSetIsCallRegPtr(); - __fallthrough; + FALLTHROUGH; case EC_INDIR_ARD: // the address is an indirection @@ -7348,7 +7352,7 @@ size_t emitter::emitSizeOfInsDsc(instrDesc* id) return sizeof(instrDescCGCA); } - __fallthrough; + FALLTHROUGH; case ID_OP_SCNS: case ID_OP_CNS: @@ -8234,11 +8238,15 @@ void emitter::emitDispIns( // printf("[A=%08X] " , emitSimpleByrefStkMask); // printf("[L=%02u] " , id->idCodeSize()); - if (!emitComp->opts.dspEmit && !isNew && !asmfm) + if (!isNew && !asmfm) { doffs = true; } + /* Display the instruction address */ + + emitDispInsAddr(code); + /* Display the instruction offset */ emitDispInsOffs(offset, doffs); @@ -8262,11 +8270,11 @@ void emitter::emitDispIns( { printf(" %-9s", sstr); } -#ifndef TARGET_UNIX +#ifndef HOST_UNIX if (strnlen_s(sstr, 10) >= 8) -#else // TARGET_UNIX +#else // HOST_UNIX if (strnlen(sstr, 10) >= 8) -#endif // TARGET_UNIX +#endif // HOST_UNIX { printf(" "); } @@ -9184,46 +9192,46 @@ static BYTE* emitOutputNOP(BYTE* dst, size_t nBytes) { case 15: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 14: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 13: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 12: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 11: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 10: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 9: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 8: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 7: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 6: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 5: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 4: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 3: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 2: *dst++ = 0x90; - __fallthrough; + FALLTHROUGH; case 1: *dst++ = 0x90; break; @@ -9235,7 +9243,7 @@ static BYTE* emitOutputNOP(BYTE* dst, size_t nBytes) { case 2: *dst++ = 0x66; - __fallthrough; + FALLTHROUGH; case 1: *dst++ = 0x90; break; @@ -9254,7 +9262,7 @@ static BYTE* emitOutputNOP(BYTE* dst, size_t nBytes) break; case 6: *dst++ = 0x66; - __fallthrough; + FALLTHROUGH; case 5: *dst++ = 0x0F; *dst++ = 0x1F; @@ -9289,13 +9297,13 @@ static BYTE* emitOutputNOP(BYTE* dst, size_t nBytes) break; case 11: *dst++ = 0x66; - __fallthrough; + FALLTHROUGH; case 10: *dst++ = 0x66; - __fallthrough; + FALLTHROUGH; case 9: *dst++ = 0x66; - __fallthrough; + FALLTHROUGH; case 8: *dst++ = 0x0F; *dst++ = 0x1F; @@ -9569,7 +9577,7 @@ BYTE* emitter::emitOutputAM(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc) dst += emitOutputByte(dst, 0x66); - __fallthrough; + FALLTHROUGH; case EA_4BYTE: #ifdef TARGET_AMD64 @@ -10334,7 +10342,7 @@ BYTE* emitter::emitOutputSV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc) case EA_2BYTE: // Output a size prefix for a 16-bit operand dst += emitOutputByte(dst, 0x66); - __fallthrough; + FALLTHROUGH; case EA_4BYTE: #ifdef TARGET_AMD64 @@ -10522,7 +10530,7 @@ BYTE* emitter::emitOutputSV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc) case IF_SWR: // Stack Write (So we need to update GC live for stack var) // Write stack -- GC var may be born - emitGCvarLiveUpd(adr, varNum, id->idGCref(), dst); + emitGCvarLiveUpd(adr, varNum, id->idGCref(), dst DEBUG_ARG(varNum)); break; case IF_SRD_CNS: @@ -10546,7 +10554,7 @@ BYTE* emitter::emitOutputSV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc) case IF_SWR_RRD: // Stack Write, Register Read (So we need to update GC live for stack var) // Read register, write stack -- GC var may be born - emitGCvarLiveUpd(adr, varNum, id->idGCref(), dst); + emitGCvarLiveUpd(adr, varNum, id->idGCref(), dst DEBUG_ARG(varNum)); break; case IF_RRW_SRD: // Register Read/Write, Stack Read (So we need to update GC live for register) @@ -10800,7 +10808,7 @@ BYTE* emitter::emitOutputCV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc) case EA_2BYTE: // Output a size prefix for a 16-bit operand dst += emitOutputByte(dst, 0x66); - __fallthrough; + FALLTHROUGH; case EA_4BYTE: #ifdef TARGET_AMD64 @@ -10927,7 +10935,7 @@ BYTE* emitter::emitOutputCV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc) noway_assert(id->idIsDspReloc()); dst += emitOutputLong(dst, 0); #else // TARGET_X86 - dst += emitOutputLong(dst, (int)target); + dst += emitOutputLong(dst, (int)(ssize_t)target); #endif // TARGET_X86 if (id->idIsDspReloc()) @@ -11220,7 +11228,7 @@ BYTE* emitter::emitOutputR(BYTE* dst, instrDesc* id) emitGCregDeadUpd(REG_EAX, dst); emitGCregDeadUpd(REG_EDX, dst); - __fallthrough; + FALLTHROUGH; default: @@ -11386,7 +11394,7 @@ BYTE* emitter::emitOutputRR(BYTE* dst, instrDesc* id) case EA_2BYTE: // Output a size prefix for a 16-bit operand dst += emitOutputByte(dst, 0x66); - __fallthrough; + FALLTHROUGH; case EA_4BYTE: // Set the 'w' bit to get the large version @@ -11756,7 +11764,7 @@ BYTE* emitter::emitOutputRI(BYTE* dst, instrDesc* id) instruction ins = id->idIns(); regNumber reg = id->idReg1(); ssize_t val = emitGetInsSC(id); - bool valInByte = ((signed char)val == val) && (ins != INS_mov) && (ins != INS_test); + bool valInByte = ((signed char)val == (target_ssize_t)val) && (ins != INS_mov) && (ins != INS_test); // BT reg,imm might be useful but it requires special handling of the immediate value // (it is always encoded in a byte). Let's not complicate things until this is needed. @@ -11937,7 +11945,7 @@ BYTE* emitter::emitOutputRI(BYTE* dst, instrDesc* id) case EA_2BYTE: // Output a size prefix for a 16-bit operand dst += emitOutputByte(dst, 0x66); - __fallthrough; + FALLTHROUGH; case EA_4BYTE: // Set the 'w' bit to get the large version @@ -12107,7 +12115,7 @@ BYTE* emitter::emitOutputIV(BYTE* dst, instrDesc* id) instruction ins = id->idIns(); emitAttr size = id->idOpSize(); ssize_t val = emitGetInsSC(id); - bool valInByte = ((signed char)val == val); + bool valInByte = ((signed char)val == (target_ssize_t)val); // We would to update GC info correctly assert(!IsSSEInstruction(ins)); @@ -12719,7 +12727,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) #ifdef TARGET_AMD64 dst += emitOutputLong(dst, 0); #else - dst += emitOutputLong(dst, (int)addr); + dst += emitOutputLong(dst, (int)(ssize_t)addr); #endif emitRecordRelocation((void*)(dst - sizeof(int)), addr, IMAGE_REL_BASED_DISP32); } @@ -13676,7 +13684,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) assert(*dp != dst || emitInstHasNoCode(ins)); #ifdef DEBUG - if (emitComp->opts.disAsm || emitComp->opts.dspEmit || emitComp->verbose) + if (emitComp->opts.disAsm || emitComp->verbose) { emitDispIns(id, false, dspOffs, true, emitCurCodeOffs(*dp), *dp, (dst - *dp)); } @@ -13726,6 +13734,12 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp) regMaskTP regMask = genRegMask(inst3opImulReg(ins)); assert((regMask & (emitThisGCrefRegs | emitThisByrefRegs)) == 0); } + + // Output any delta in GC info. + if (EMIT_GC_VERBOSE || emitComp->opts.disasmWithGC) + { + emitDispGCInfoDelta(); + } #endif return sz; @@ -13975,6 +13989,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins switch (ins) { + case INS_align: case INS_nop: case INS_int3: assert(memFmt == IF_NONE); @@ -14937,6 +14952,7 @@ emitter::insExecutionCharacteristics emitter::getInsExecutionCharacteristics(ins case INS_tzcnt: case INS_popcnt: case INS_crc32: + case INS_rorx: case INS_pdep: case INS_pext: case INS_addsubps: diff --git a/src/coreclr/src/jit/emitxarch.h b/src/coreclr/src/jit/emitxarch.h index f7c0f5c65af4..fb2aac2d30f0 100644 --- a/src/coreclr/src/jit/emitxarch.h +++ b/src/coreclr/src/jit/emitxarch.h @@ -299,7 +299,7 @@ void emitInsRMW(instruction inst, emitAttr attr, GenTreeStoreInd* storeInd); void emitIns_Nop(unsigned size); -void emitIns_I(instruction ins, emitAttr attr, int val); +void emitIns_I(instruction ins, emitAttr attr, cnsval_ssize_t val); void emitIns_R(instruction ins, emitAttr attr, regNumber reg); @@ -409,7 +409,7 @@ void emitIns_R_AR(instruction ins, emitAttr attr, regNumber reg, regNumber base, void emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); -void emitIns_AR_R(instruction ins, emitAttr attr, regNumber reg, regNumber base, int disp); +void emitIns_AR_R(instruction ins, emitAttr attr, regNumber reg, regNumber base, cnsval_ssize_t disp); void emitIns_AI_R(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); @@ -424,8 +424,13 @@ void emitIns_I_ARX(instruction ins, emitAttr attr, int val, regNumber reg, regNu void emitIns_R_ARX( instruction ins, emitAttr attr, regNumber reg, regNumber base, regNumber index, unsigned scale, int disp); -void emitIns_ARX_R( - instruction ins, emitAttr attr, regNumber reg, regNumber base, regNumber index, unsigned scale, int disp); +void emitIns_ARX_R(instruction ins, + emitAttr attr, + regNumber reg, + regNumber base, + regNumber index, + unsigned scale, + cnsval_ssize_t disp); void emitIns_I_AX(instruction ins, emitAttr attr, int val, regNumber reg, unsigned mul, int disp); diff --git a/src/coreclr/src/jit/error.cpp b/src/coreclr/src/jit/error.cpp index a77a217893aa..8a52465ddc4e 100644 --- a/src/coreclr/src/jit/error.cpp +++ b/src/coreclr/src/jit/error.cpp @@ -19,6 +19,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #if MEASURE_FATAL unsigned fatal_badCode; unsigned fatal_noWay; +unsigned fatal_implLimitation; unsigned fatal_NOMEM; unsigned fatal_noWayAssertBody; #ifdef DEBUG @@ -65,6 +66,16 @@ void DECLSPEC_NORETURN noWay() fatal(CORJIT_INTERNALERROR); } +/*****************************************************************************/ +void DECLSPEC_NORETURN implLimitation() +{ +#if MEASURE_FATAL + fatal_implLimitation += 1; +#endif // MEASURE_FATAL + + fatal(CORJIT_IMPLLIMITATION); +} + /*****************************************************************************/ void DECLSPEC_NORETURN NOMEM() { diff --git a/src/coreclr/src/jit/error.h b/src/coreclr/src/jit/error.h index 082ac2ec394d..520dba73b65c 100644 --- a/src/coreclr/src/jit/error.h +++ b/src/coreclr/src/jit/error.h @@ -63,6 +63,7 @@ extern void debugError(const char* msg, const char* file, unsigned line); extern void DECLSPEC_NORETURN badCode(); extern void DECLSPEC_NORETURN badCode3(const char* msg, const char* msg2, int arg, __in_z const char* file, unsigned line); extern void DECLSPEC_NORETURN noWay(); +extern void DECLSPEC_NORETURN implLimitation(); extern void DECLSPEC_NORETURN NOMEM(); extern void DECLSPEC_NORETURN fatal(int errCode); @@ -118,12 +119,22 @@ extern void RecordNowayAssertGlobal(const char* filename, unsigned line, const c #define NOWAY_MSG(msg) noWayAssertBodyConditional(msg, __FILE__, __LINE__) +// IMPL_LIMITATION is called when we encounter valid IL that is not +// supported by our current implementation because of various +// limitations (that could be removed in the future) +#define IMPL_LIMITATION(msg) (debugError(msg, __FILE__, __LINE__), implLimitation()) + #else // !DEBUG #define NO_WAY(msg) noWay() #define BADCODE(msg) badCode() #define BADCODE3(msg, msg2, arg) badCode() +// IMPL_LIMITATION is called when we encounter valid IL that is not +// supported by our current implementation because of various +// limitations (that could be removed in the future) +#define IMPL_LIMITATION(msg) implLimitation() + #ifdef FEATURE_TRACELOGGING #define NOWAY_ASSERT_BODY_ARGUMENTS __FILE__, __LINE__ #else @@ -145,10 +156,6 @@ extern void RecordNowayAssertGlobal(const char* filename, unsigned line, const c #endif // !DEBUG -// IMPL_LIMITATION is called when we encounter valid IL that is not -// supported by our current implementation because of various -// limitations (that could be removed in the future) -#define IMPL_LIMITATION(msg) NO_WAY(msg) #if 1 // All platforms currently enable NYI; this should be a tighter condition to exclude some platforms from NYI diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp index 65c9af9e8f2c..ee8bee39cd56 100644 --- a/src/coreclr/src/jit/flowgraph.cpp +++ b/src/coreclr/src/jit/flowgraph.cpp @@ -56,9 +56,6 @@ void Compiler::fgInit() /* We don't know yet which loops will always execute calls */ fgLoopCallMarked = false; - /* We haven't created GC Poll blocks yet. */ - fgGCPollsCreated = false; - /* Initialize the basic block list */ fgFirstBB = nullptr; @@ -175,11 +172,42 @@ void Compiler::fgInit() #ifdef FEATURE_SIMD fgPreviousCandidateSIMDFieldAsgStmt = nullptr; #endif + + fgHasSwitch = false; + fgBlockCounts = nullptr; } +//------------------------------------------------------------------------ +// fgHaveProfileData: check if profile data is available +// +// Returns: +// true if so +// +// Note: +// This now returns true for inlinees. We might consider preserving the +// old behavior for crossgen, since crossgen BBINSTRs still do inlining +// and don't instrument the inlinees. +// +// Thus if BBINSTR and BBOPT do the same inlines (which can happen) +// profile data for an inlinee (if available) will not fully reflect +// the behavior of the inlinee when called from this method. +// +// If this inlinee was not inlined by the BBINSTR run then the +// profile data for the inlinee will reflect this method's influence. +// +// * for ALWAYS_INLINE and FORCE_INLINE cases it is unlikely we'll find +// any profile data, as BBINSTR and BBOPT callers will both inline; +// only indirect callers will invoke the instrumented version to run. +// * for DISCRETIONARY_INLINE cases we may or may not find relevant +// data, depending, but chances are the data is relevant. +// +// TieredPGO data comes from Tier0 methods, which currently do not do +// any inlining; thus inlinee profile data should be available and +// representative. +// bool Compiler::fgHaveProfileData() { - if (compIsForInlining() || compIsForImportOnly()) + if (compIsForImportOnly()) { return false; } @@ -187,6 +215,111 @@ bool Compiler::fgHaveProfileData() return (fgBlockCounts != nullptr); } +//------------------------------------------------------------------------ +// fgComputeProfileScale: determine how much scaling to apply +// to raw profile count data. +// +// Notes: +// Scaling is only needed for inlinees, and the results of this +// computation are recorded in fields of impInlineInfo. +// +void Compiler::fgComputeProfileScale() +{ + // Only applicable to inlinees + assert(compIsForInlining()); + + // Have we already determined the scale? + if (impInlineInfo->profileScaleState != InlineInfo::ProfileScaleState::UNDETERMINED) + { + return; + } + + // No, not yet -- try and compute the scale. + JITDUMP("Computing inlinee profile scale:\n"); + + // Call site has profile weight? + // + // Todo: handle case of unprofiled caller invoking profiled callee. + // + const BasicBlock* callSiteBlock = impInlineInfo->iciBlock; + if (!callSiteBlock->hasProfileWeight()) + { + JITDUMP(" ... call site not profiled\n"); + impInlineInfo->profileScaleState = InlineInfo::ProfileScaleState::UNAVAILABLE; + return; + } + + const BasicBlock::weight_t callSiteWeight = callSiteBlock->bbWeight; + + // Call site has zero count? + // + // Todo: perhaps retain some semblance of callee profile data, + // possibly scaled down severely. + // + if (callSiteWeight == 0) + { + JITDUMP(" ... zero call site count\n"); + impInlineInfo->profileScaleState = InlineInfo::ProfileScaleState::UNAVAILABLE; + return; + } + + // Callee has profile data? + // + if (!fgHaveProfileData()) + { + JITDUMP(" ... no callee profile data\n"); + impInlineInfo->profileScaleState = InlineInfo::ProfileScaleState::UNAVAILABLE; + return; + } + + // Find callee's unscaled entry weight. + // + // Ostensibly this should be fgCalledCount for the callee, but that's not available + // as it requires some analysis. + // + // For most callees it will be the same as the entry block count. + // + BasicBlock::weight_t calleeWeight = 0; + + if (!fgGetProfileWeightForBasicBlock(0, &calleeWeight)) + { + JITDUMP(" ... no callee profile data for entry block\n"); + impInlineInfo->profileScaleState = InlineInfo::ProfileScaleState::UNAVAILABLE; + return; + } + + // We should generally be able to assume calleeWeight >= callSiteWeight. + // If this isn't so, perhaps something is wrong with the profile data + // collection or retrieval. + // + // For now, ignore callee data if we'd need to upscale. + // + if (calleeWeight < callSiteWeight) + { + JITDUMP(" ... callee entry count %d is less than call site count %d\n", calleeWeight, callSiteWeight); + impInlineInfo->profileScaleState = InlineInfo::ProfileScaleState::UNAVAILABLE; + return; + } + + // Hence, scale is always in the range (0.0...1.0] -- we are always scaling down callee counts. + // + const double scale = ((double)callSiteWeight) / calleeWeight; + impInlineInfo->profileScaleFactor = scale; + impInlineInfo->profileScaleState = InlineInfo::ProfileScaleState::KNOWN; + + JITDUMP(" call site count %u callee entry count %u scale %f\n", callSiteWeight, calleeWeight, scale); +} + +//------------------------------------------------------------------------ +// fgGetProfileWeightForBasicBlock: obtain profile data for a block +// +// Arguments: +// offset - IL offset of the block +// weightWB - [OUT] weight obtained +// +// Returns: +// true if data was found +// bool Compiler::fgGetProfileWeightForBasicBlock(IL_OFFSET offset, unsigned* weightWB) { noway_assert(weightWB != nullptr); @@ -227,19 +360,16 @@ bool Compiler::fgGetProfileWeightForBasicBlock(IL_OFFSET offset, unsigned* weigh } #endif // DEBUG - if (fgHaveProfileData() == false) + if (!fgHaveProfileData()) { return false; } - noway_assert(!compIsForInlining()); for (UINT32 i = 0; i < fgBlockCountsCount; i++) { if (fgBlockCounts[i].ILOffset == offset) { - weight = fgBlockCounts[i].ExecutionCount; - - *weightWB = weight; + *weightWB = fgBlockCounts[i].ExecutionCount; return true; } } @@ -476,7 +606,8 @@ void Compiler::fgEnsureFirstBBisScratch() noway_assert(fgLastBB != nullptr); - block->bbFlags |= (BBF_INTERNAL | BBF_IMPORTED); + // Set the expected flags + block->bbFlags |= (BBF_INTERNAL | BBF_IMPORTED | BBF_JMP_TARGET | BBF_HAS_LABEL); // This new first BB has an implicit ref, and no others. block->bbRefs = 1; @@ -1403,7 +1534,7 @@ void Compiler::fgRemoveBlockAsPred(BasicBlock* block) } } - __fallthrough; + FALLTHROUGH; case BBJ_COND: case BBJ_ALWAYS: @@ -1418,7 +1549,7 @@ void Compiler::fgRemoveBlockAsPred(BasicBlock* block) } /* If BBJ_COND fall through */ - __fallthrough; + FALLTHROUGH; case BBJ_NONE: @@ -1865,7 +1996,7 @@ bool Compiler::fgReachable(BasicBlock* b1, BasicBlock* b2) * it again. */ -void Compiler::fgUpdateChangedFlowGraph() +void Compiler::fgUpdateChangedFlowGraph(bool computeDoms) { // We need to clear this so we don't hit an assert calling fgRenumberBlocks(). fgDomsComputed = false; @@ -1876,7 +2007,10 @@ void Compiler::fgUpdateChangedFlowGraph() fgComputePreds(); fgComputeEnterBlocksSet(); fgComputeReachabilitySets(); - fgComputeDoms(); + if (computeDoms) + { + fgComputeDoms(); + } } /***************************************************************************** @@ -2101,7 +2235,7 @@ bool Compiler::fgRemoveUnreachableBlocks() /* Unmark the block as removed, */ /* clear BBF_INTERNAL as well and set BBJ_IMPORTED */ - block->bbFlags &= ~(BBF_REMOVED | BBF_INTERNAL | BBF_NEEDS_GCPOLL); + block->bbFlags &= ~(BBF_REMOVED | BBF_INTERNAL); block->bbFlags |= BBF_IMPORTED; block->bbJumpKind = BBJ_THROW; block->bbSetRunRarely(); @@ -3093,7 +3227,7 @@ void Compiler::fgComputePreds() block->bbNext->bbFlags |= (BBF_JMP_TARGET | BBF_HAS_LABEL); } - __fallthrough; + FALLTHROUGH; case BBJ_LEAVE: // Sometimes fgComputePreds is called before all blocks are imported, so BBJ_LEAVE // blocks are still in the BB list. @@ -3116,7 +3250,7 @@ void Compiler::fgComputePreds() noway_assert(block->bbNext); /* Fall through, the next block is also reachable */ - __fallthrough; + FALLTHROUGH; case BBJ_NONE: @@ -3480,81 +3614,57 @@ BasicBlock* Compiler::fgFirstBlockOfHandler(BasicBlock* block) return ehGetDsc(block->getHndIndex())->ebdHndBeg; } -/***************************************************************************** - * - * Function called to find back edges and return blocks and mark them as needing GC Polls. This marks all - * blocks. - */ -void Compiler::fgMarkGCPollBlocks() +void Compiler::fgInitBlockVarSets() { - if (GCPOLL_NONE == opts.compGCPollType) + for (BasicBlock* block = fgFirstBB; block; block = block->bbNext) { - return; + block->InitVarSets(this); } -#ifdef DEBUG - /* Check that the flowgraph data (bbNum, bbRefs, bbPreds) is up-to-date */ - fgDebugCheckBBlist(); -#endif - - BasicBlock* block; + fgBBVarSetsInited = true; +} - // Return blocks always need GC polls. In addition, all back edges (including those from switch - // statements) need GC polls. The poll is on the block with the outgoing back edge (or ret), rather than - // on the destination or on the edge itself. - for (block = fgFirstBB; block; block = block->bbNext) +//------------------------------------------------------------------------ +// blockNeedsGCPoll: Determine whether the block needs GC poll inserted +// +// Arguments: +// block - the block to check +// +// Notes: +// The GC poll may not be required because of optimizations applied earlier +// or because of GC poll done implicitly by regular unmanaged calls. +// +// Returns: +// Whether the GC poll needs to be inserted after the block +// +static bool blockNeedsGCPoll(BasicBlock* block) +{ + bool blockMayNeedGCPoll = false; + for (Statement* stmt = block->FirstNonPhiDef(); stmt != nullptr; stmt = stmt->GetNextStmt()) { - bool blockNeedsPoll = false; - switch (block->bbJumpKind) + if ((stmt->GetRootNode()->gtFlags & GTF_CALL) != 0) { - case BBJ_ALWAYS: - if (block->isBBCallAlwaysPairTail()) - { - break; - } - case BBJ_COND: - blockNeedsPoll = (block->bbJumpDest->bbNum <= block->bbNum); - break; - - case BBJ_RETURN: - blockNeedsPoll = true; - break; - - case BBJ_SWITCH: - unsigned jumpCnt; - jumpCnt = block->bbJumpSwt->bbsCount; - BasicBlock** jumpTab; - jumpTab = block->bbJumpSwt->bbsDstTab; - - do + for (GenTree* tree = stmt->GetTreeList(); tree != nullptr; tree = tree->gtNext) + { + if (tree->OperGet() == GT_CALL) { - if ((*jumpTab)->bbNum <= block->bbNum) + GenTreeCall* call = tree->AsCall(); + if (call->IsUnmanaged()) { - blockNeedsPoll = true; - break; - } - } while (++jumpTab, --jumpCnt); - break; - - default: - break; - } + if (!call->IsSuppressGCTransition()) + { + // If the block contains regular unmanaged call, we can depend on it + // to poll for GC. No need to scan further. + return false; + } - if (blockNeedsPoll) - { - block->bbFlags |= BBF_NEEDS_GCPOLL; + blockMayNeedGCPoll = true; + } + } + } } } -} - -void Compiler::fgInitBlockVarSets() -{ - for (BasicBlock* block = fgFirstBB; block; block = block->bbNext) - { - block->InitVarSets(this); - } - - fgBBVarSetsInited = true; + return blockMayNeedGCPoll; } //------------------------------------------------------------------------------ @@ -3566,6 +3676,9 @@ void Compiler::fgInitBlockVarSets() // find the basic blocks that require GC polls; when optimizing the tree nodes // are scanned to find calls to methods with SuppressGCTransitionAttribute. // +// This must be done after any transformations that would add control flow between +// calls. +// // Returns: // PhaseStatus indicating what, if anything, was changed. // @@ -3592,43 +3705,12 @@ PhaseStatus Compiler::fgInsertGCPolls() BasicBlock* block; - // Walk through the blocks and hunt for a block that has needs a GC Poll + // Walk through the blocks and hunt for a block that needs a GC Poll for (block = fgFirstBB; block; block = block->bbNext) { - bool blockNeedsGCPoll = false; - if (opts.OptimizationDisabled()) - { - if ((block->bbFlags & BBF_HAS_SUPPRESSGC_CALL) != 0) - { - blockNeedsGCPoll = true; - } - } - else - { - // When optimizations are enabled, we can't rely on BBF_HAS_SUPPRESSGC_CALL flag: - // the call could've been moved, e.g., hoisted from a loop, CSE'd, etc. - for (Statement* stmt = block->FirstNonPhiDef(); !blockNeedsGCPoll && (stmt != nullptr); - stmt = stmt->GetNextStmt()) - { - if ((stmt->GetRootNode()->gtFlags & GTF_CALL) != 0) - { - for (GenTree* tree = stmt->GetTreeList(); !blockNeedsGCPoll && (tree != nullptr); - tree = tree->gtNext) - { - if (tree->OperGet() == GT_CALL) - { - GenTreeCall* call = tree->AsCall(); - if (call->IsUnmanaged() && call->IsSuppressGCTransition()) - { - blockNeedsGCPoll = true; - } - } - } - } - } - } - - if (!blockNeedsGCPoll) + // When optimizations are enabled, we can't rely on BBF_HAS_SUPPRESSGC_CALL flag: + // the call could've been moved, e.g., hoisted from a loop, CSE'd, etc. + if (opts.OptimizationDisabled() ? ((block->bbFlags & BBF_HAS_SUPPRESSGC_CALL) == 0) : !blockNeedsGCPoll(block)) { continue; } @@ -3699,309 +3781,22 @@ PhaseStatus Compiler::fgInsertGCPolls() // We don't want to deal with all the outgoing edges of a switch block. pollType = GCPOLL_CALL; } - - BasicBlock* curBasicBlock = fgCreateGCPoll(pollType, block); - createdPollBlocks |= (block != curBasicBlock); - block = curBasicBlock; - } - - // If we split a block to create a GC Poll, then rerun fgReorderBlocks to push the rarely run blocks out - // past the epilog. We should never split blocks unless we're optimizing. - if (createdPollBlocks) - { - noway_assert(opts.OptimizationEnabled()); - fgReorderBlocks(); - fgUpdateChangedFlowGraph(); - } -#ifdef DEBUG - if (verbose) - { - printf("*************** After fgInsertGCPolls()\n"); - fgDispBasicBlocks(true); - } -#endif // DEBUG - - return result; -} - -/***************************************************************************** - * - * The following does the final pass on BBF_NEEDS_GCPOLL and then actually creates the GC Polls. - */ - -void Compiler::fgCreateGCPolls() -{ - if (GCPOLL_NONE == opts.compGCPollType) - { - return; - } - - bool createdPollBlocks = false; - -#ifdef DEBUG - if (verbose) - { - printf("*************** In fgCreateGCPolls() for %s\n", info.compFullName); - fgDispBasicBlocks(false); - printf("\n"); - } -#endif // DEBUG - - if (opts.OptimizationEnabled()) - { - // Remove polls from well formed loops with a constant upper bound. - for (unsigned lnum = 0; lnum < optLoopCount; ++lnum) - { - // Look for constant counted loops that run for a short duration. This logic is very similar to - // what's in code:Compiler::optUnrollLoops, since they have similar constraints. However, this - // logic is much more permissive since we're not doing a complex transformation. - - /* TODO-Cleanup: - * I feel bad cloning so much logic from optUnrollLoops - */ - - // Filter out loops not meeting the obvious preconditions. - // - if (optLoopTable[lnum].lpFlags & LPFLG_REMOVED) - { - continue; - } - - if (!(optLoopTable[lnum].lpFlags & LPFLG_CONST)) - { - continue; - } - - BasicBlock* head = optLoopTable[lnum].lpHead; - BasicBlock* bottom = optLoopTable[lnum].lpBottom; - - // Loops dominated by GC_SAFE_POINT won't have this set. - if (!(bottom->bbFlags & BBF_NEEDS_GCPOLL)) - { - continue; - } - - /* Get the loop data: - - initial constant - - limit constant - - iterator - - iterator increment - - increment operation type (i.e. ASG_ADD, ASG_SUB, etc...) - - loop test type (i.e. GT_GE, GT_LT, etc...) - */ - - int lbeg = optLoopTable[lnum].lpConstInit; - int llim = optLoopTable[lnum].lpConstLimit(); - genTreeOps testOper = optLoopTable[lnum].lpTestOper(); - - int lvar = optLoopTable[lnum].lpIterVar(); - int iterInc = optLoopTable[lnum].lpIterConst(); - genTreeOps iterOper = optLoopTable[lnum].lpIterOper(); - - var_types iterOperType = optLoopTable[lnum].lpIterOperType(); - bool unsTest = (optLoopTable[lnum].lpTestTree->gtFlags & GTF_UNSIGNED) != 0; - if (lvaTable[lvar].lvAddrExposed) - { // Can't reason about the value of the iteration variable. - continue; - } - - unsigned totalIter; - - /* Find the number of iterations - the function returns false if not a constant number */ - - if (!optComputeLoopRep(lbeg, llim, iterInc, iterOper, iterOperType, testOper, unsTest, - // The value here doesn't matter for this variation of the optimization - true, &totalIter)) - { -#ifdef DEBUG - if (verbose) - { - printf("Could not compute loop iterations for loop from " FMT_BB " to " FMT_BB, head->bbNum, - bottom->bbNum); - } -#endif // DEBUG - (void)head; // suppress gcc error. - - continue; - } - - /* Forget it if there are too many repetitions or not a constant loop */ - - static const unsigned ITER_LIMIT = 256; - if (totalIter > ITER_LIMIT) - { - continue; - } - - // It is safe to elminate the poll from this loop. - bottom->bbFlags &= ~BBF_NEEDS_GCPOLL; - -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in block " FMT_BB " because it forms a bounded counted loop\n", bottom->bbNum); - } -#endif // DEBUG - } - } - - // Final chance to optimize the polls. Move all polls in loops from the bottom of the loop up to the - // loop head. Also eliminate all epilog polls in non-leaf methods. This only works if we have dominator - // information. - if (fgDomsComputed) - { - for (BasicBlock* block = fgFirstBB; block; block = block->bbNext) - { - if (!(block->bbFlags & BBF_NEEDS_GCPOLL)) - { - continue; - } - - if (block->bbJumpKind == BBJ_COND || block->bbJumpKind == BBJ_ALWAYS) - { - // make sure that this is loop-like - if (!fgReachable(block->bbJumpDest, block)) - { - block->bbFlags &= ~BBF_NEEDS_GCPOLL; -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in block " FMT_BB " because it is not loop\n", block->bbNum); - } -#endif // DEBUG - continue; - } - } - else if (!(block->bbJumpKind == BBJ_RETURN || block->bbJumpKind == BBJ_SWITCH)) - { - noway_assert(!"GC Poll on a block that has no control transfer."); -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in block " FMT_BB " because it is not a jump\n", block->bbNum); - } -#endif // DEBUG - block->bbFlags &= ~BBF_NEEDS_GCPOLL; - continue; - } - - // Because of block compaction, it's possible to end up with a block that is both poll and safe. - // Clean those up now. - - if (block->bbFlags & BBF_GC_SAFE_POINT) - { -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in return block " FMT_BB " because it is GC Safe\n", block->bbNum); - } -#endif // DEBUG - block->bbFlags &= ~BBF_NEEDS_GCPOLL; - continue; - } - - if (block->bbJumpKind == BBJ_RETURN) - { - if (!optReachWithoutCall(fgFirstBB, block)) - { - // check to see if there is a call along the path between the first block and the return - // block. - block->bbFlags &= ~BBF_NEEDS_GCPOLL; -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in return block " FMT_BB " because it dominated by a call\n", - block->bbNum); - } -#endif // DEBUG - continue; - } - } - } - } - - noway_assert(!fgGCPollsCreated); - BasicBlock* block; - fgGCPollsCreated = true; - - // Walk through the blocks and hunt for a block that has BBF_NEEDS_GCPOLL - for (block = fgFirstBB; block; block = block->bbNext) - { - // Because of block compaction, it's possible to end up with a block that is both poll and safe. - // And if !fgDomsComputed, we won't have cleared them, so skip them now - if (!(block->bbFlags & BBF_NEEDS_GCPOLL) || (block->bbFlags & BBF_GC_SAFE_POINT)) - { - continue; - } - - // This block needs a poll. We either just insert a callout or we split the block and inline part of - // the test. This depends on the value of opts.compGCPollType. - - // If we're doing GCPOLL_CALL, just insert a GT_CALL node before the last node in the block. - CLANG_FORMAT_COMMENT_ANCHOR; - -#ifdef DEBUG - switch (block->bbJumpKind) - { - case BBJ_RETURN: - case BBJ_ALWAYS: - case BBJ_COND: - case BBJ_SWITCH: - break; - default: - noway_assert(!"Unknown block type for BBF_NEEDS_GCPOLL"); - } -#endif // DEBUG - - noway_assert(opts.compGCPollType); - - GCPollType pollType = opts.compGCPollType; - // pollType is set to either CALL or INLINE at this point. Below is the list of places where we - // can't or don't want to emit an inline check. Check all of those. If after all of that we still - // have INLINE, then emit an inline check. - - if (opts.OptimizationDisabled()) - { -#ifdef DEBUG - if (verbose) - { - printf("Selecting CALL poll in block " FMT_BB " because of debug/minopts\n", block->bbNum); - } -#endif // DEBUG - - // Don't split blocks and create inlined polls unless we're optimizing. - pollType = GCPOLL_CALL; - } - else if (genReturnBB == block) - { -#ifdef DEBUG - if (verbose) - { - printf("Selecting CALL poll in block " FMT_BB " because it is the single return block\n", block->bbNum); - } -#endif // DEBUG - - // we don't want to split the single return block - pollType = GCPOLL_CALL; - } - else if (BBJ_SWITCH == block->bbJumpKind) + else if ((block->bbFlags & BBF_COLD) != 0) { #ifdef DEBUG if (verbose) { - printf("Selecting CALL poll in block " FMT_BB " because it is a loop formed by a SWITCH\n", - block->bbNum); + printf("Selecting CALL poll in block " FMT_BB " because it is a cold block\n", block->bbNum); } #endif // DEBUG - // I don't want to deal with all the outgoing edges of a switch block. + // We don't want to split a cold block. pollType = GCPOLL_CALL; } - // TODO-Cleanup: potentially don't split if we're in an EH region. - BasicBlock* curBasicBlock = fgCreateGCPoll(pollType, block); createdPollBlocks |= (block != curBasicBlock); + block = curBasicBlock; } // If we split a block to create a GC Poll, then rerun fgReorderBlocks to push the rarely run blocks out @@ -4010,15 +3805,18 @@ void Compiler::fgCreateGCPolls() { noway_assert(opts.OptimizationEnabled()); fgReorderBlocks(); - fgUpdateChangedFlowGraph(); + constexpr bool computeDoms = false; + fgUpdateChangedFlowGraph(computeDoms); } #ifdef DEBUG if (verbose) { - printf("*************** After fgCreateGCPolls()\n"); + printf("*************** After fgInsertGCPolls()\n"); fgDispBasicBlocks(true); } #endif // DEBUG + + return result; } //------------------------------------------------------------------------------ @@ -4141,9 +3939,12 @@ BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) // We are allowed to split loops and we need to keep a few other flags... // - noway_assert((originalFlags & (BBF_SPLIT_NONEXIST & ~(BBF_LOOP_HEAD | BBF_LOOP_CALL0 | BBF_LOOP_CALL1))) == 0); - top->bbFlags = originalFlags & (~BBF_SPLIT_LOST | BBF_GC_SAFE_POINT); - bottom->bbFlags |= originalFlags & (BBF_SPLIT_GAINED | BBF_IMPORTED | BBF_GC_SAFE_POINT); + noway_assert((originalFlags & (BBF_SPLIT_NONEXIST & + ~(BBF_LOOP_HEAD | BBF_LOOP_CALL0 | BBF_LOOP_CALL1 | BBF_LOOP_PREHEADER | + BBF_RETLESS_CALL))) == 0); + top->bbFlags = originalFlags & (~(BBF_SPLIT_LOST | BBF_LOOP_PREHEADER | BBF_RETLESS_CALL) | BBF_GC_SAFE_POINT); + bottom->bbFlags |= originalFlags & (BBF_SPLIT_GAINED | BBF_IMPORTED | BBF_GC_SAFE_POINT | BBF_LOOP_PREHEADER | + BBF_RETLESS_CALL); bottom->inheritWeight(top); poll->bbFlags |= originalFlags & (BBF_SPLIT_GAINED | BBF_IMPORTED | BBF_GC_SAFE_POINT); @@ -4203,7 +4004,7 @@ BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) { // Use a double indirection GenTree* addr = - gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)pAddrOfCaptureThreadGlobal, GTF_ICON_PTR_HDL, true); + gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)pAddrOfCaptureThreadGlobal, GTF_ICON_CONST_PTR, true); value = gtNewOperNode(GT_IND, TYP_INT, addr); // This indirection won't cause an exception. @@ -4212,11 +4013,14 @@ BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) else { // Use a single indirection - value = gtNewIndOfIconHandleNode(TYP_INT, (size_t)addrTrap, GTF_ICON_PTR_HDL, false); + value = gtNewIndOfIconHandleNode(TYP_INT, (size_t)addrTrap, GTF_ICON_GLOBAL_PTR, false); } - // Treat the reading of g_TrapReturningThreads as volatile. - value->gtFlags |= GTF_IND_VOLATILE; + // NOTE: in c++ an equivalent load is done via LoadWithoutBarrier() to ensure that the + // program order is preserved. (not hoisted out of a loop or cached in a local, for example) + // + // Here we introduce the read really late after all major optimizations are done, and the location + // is formally unknown, so noone could optimize the load, thus no special flags are needed. // Compare for equal to zero GenTree* trapRelop = gtNewOperNode(GT_EQ, TYP_INT, value, gtNewIconNode(0, TYP_INT)); @@ -4265,7 +4069,7 @@ BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) fgReplacePred(bottom->bbNext, top, bottom); // fall through for the jump target - __fallthrough; + FALLTHROUGH; case BBJ_ALWAYS: case BBJ_CALLFINALLY: @@ -4278,10 +4082,6 @@ BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) NO_WAY("Unknown block type for updating predecessor lists."); } - top->bbFlags &= ~BBF_NEEDS_GCPOLL; - noway_assert(!(poll->bbFlags & BBF_NEEDS_GCPOLL)); - noway_assert(!(bottom->bbFlags & BBF_NEEDS_GCPOLL)); - if (compCurBB == top) { compCurBB = bottom; @@ -4488,7 +4288,7 @@ class FgStack break; case 1: ++depth; - __fallthrough; + FALLTHROUGH; case 2: slot1 = slot0; slot0 = type; @@ -4547,6 +4347,7 @@ void Compiler::fgSwitchToOptimized() JITDUMP("****\n**** JIT Tier0 jit request switching to Tier1 because of loop\n****\n"); assert(opts.jitFlags->IsSet(JitFlags::JIT_FLAG_TIER0)); opts.jitFlags->Clear(JitFlags::JIT_FLAG_TIER0); + opts.jitFlags->Clear(JitFlags::JIT_FLAG_BBINSTR); // Leave a note for jit diagnostics compSwitchedToOptimized = true; @@ -5094,7 +4895,7 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed // If we are inlining, we need to fail for a CEE_JMP opcode, just like // the list of other opcodes (for all platforms). - __fallthrough; + FALLTHROUGH; case CEE_MKREFANY: case CEE_RETHROW: if (makeInlineObservations) @@ -5171,6 +4972,7 @@ void Compiler::fgFindJumpTargets(const BYTE* codeAddr, IL_OFFSET codeSize, Fixed break; case CEE_RET: retBlocks++; + break; default: break; @@ -5502,7 +5304,8 @@ void Compiler::fgLinkBasicBlocks() BADCODE("Fall thru the end of a method"); } - // Fall through, the next block is also reachable + // Fall through, the next block is also reachable + FALLTHROUGH; case BBJ_NONE: curBBdesc->bbNext->bbRefs++; @@ -5584,6 +5387,11 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F } } + if (compIsForInlining()) + { + fgComputeProfileScale(); + } + do { unsigned jmpAddr = DUMMY_INIT(BAD_IL_OFFSET); @@ -5769,7 +5577,7 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F return retBlocks; } - __fallthrough; + FALLTHROUGH; case CEE_READONLY: case CEE_CONSTRAINED: @@ -5848,18 +5656,18 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F } } - /* For tail call, we just call CORINFO_HELP_TAILCALL, and it jumps to the - target. So we don't need an epilog - just like CORINFO_HELP_THROW. - Make the block BBJ_RETURN, but we will change it to BBJ_THROW - if the tailness of the call is satisfied. - NOTE : The next instruction is guaranteed to be a CEE_RET - and it will create another BasicBlock. But there may be an - jump directly to that CEE_RET. If we want to avoid creating - an unnecessary block, we need to check if the CEE_RETURN is - the target of a jump. - */ + /* For tail call, we just call CORINFO_HELP_TAILCALL, and it jumps to the + target. So we don't need an epilog - just like CORINFO_HELP_THROW. + Make the block BBJ_RETURN, but we will change it to BBJ_THROW + if the tailness of the call is satisfied. + NOTE : The next instruction is guaranteed to be a CEE_RET + and it will create another BasicBlock. But there may be an + jump directly to that CEE_RET. If we want to avoid creating + an unnecessary block, we need to check if the CEE_RETURN is + the target of a jump. + */ - // fall-through + FALLTHROUGH; case CEE_JMP: /* These are equivalent to a return from the current method @@ -6006,9 +5814,19 @@ unsigned Compiler::fgMakeBasicBlocks(const BYTE* codeAddr, IL_OFFSET codeSize, F curBBdesc->bbCodeOffsEnd = nxtBBoffs; unsigned profileWeight; + if (fgGetProfileWeightForBasicBlock(curBBoffs, &profileWeight)) { + if (compIsForInlining()) + { + if (impInlineInfo->profileScaleState == InlineInfo::ProfileScaleState::KNOWN) + { + profileWeight = (unsigned)(impInlineInfo->profileScaleFactor * profileWeight); + } + } + curBBdesc->setBBProfileWeight(profileWeight); + if (profileWeight == 0) { curBBdesc->bbSetRunRarely(); @@ -7145,7 +6963,7 @@ unsigned Compiler::fgGetNestingLevel(BasicBlock* block, unsigned* pFinallyNestin } //------------------------------------------------------------------------ -// fgImport: read the IL forf the method and create jit IR +// fgImport: read the IL for the method and create jit IR // // Returns: // phase status @@ -7236,7 +7054,7 @@ bool Compiler::fgIsThrow(GenTree* tree) return true; } - // TODO-CQ: there are a bunch of managed methods in [mscorlib]System.ThrowHelper + // TODO-CQ: there are a bunch of managed methods in System.ThrowHelper // that would be nice to recognize. return false; @@ -7368,31 +7186,31 @@ GenTreeCall* Compiler::fgGetStaticsCCtorHelper(CORINFO_CLASS_HANDLE cls, CorInfo { case CORINFO_HELP_GETSHARED_GCSTATIC_BASE_NOCTOR: bNeedClassID = false; - __fallthrough; + FALLTHROUGH; case CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_NOCTOR: callFlags |= GTF_CALL_HOISTABLE; - __fallthrough; + FALLTHROUGH; case CORINFO_HELP_GETSHARED_GCSTATIC_BASE: case CORINFO_HELP_GETSHARED_GCSTATIC_BASE_DYNAMICCLASS: case CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE_DYNAMICCLASS: case CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE: case CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_DYNAMICCLASS: + case CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_DYNAMICCLASS: // type = TYP_BYREF; break; case CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE_NOCTOR: bNeedClassID = false; - __fallthrough; + FALLTHROUGH; case CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR: callFlags |= GTF_CALL_HOISTABLE; - __fallthrough; + FALLTHROUGH; case CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE: case CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE: - case CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_DYNAMICCLASS: case CORINFO_HELP_CLASSINIT_SHARED_DYNAMICCLASS: type = TYP_I_IMPL; break; @@ -7506,6 +7324,10 @@ bool Compiler::fgAddrCouldBeNull(GenTree* addr) { return false; } + else if (addr->OperIs(GT_CNS_STR)) + { + return false; + } else if (addr->gtOper == GT_LCL_VAR) { unsigned varNum = addr->AsLclVarCommon()->GetLclNum(); @@ -7926,11 +7748,6 @@ inline void Compiler::fgLoopCallTest(BasicBlock* srcBB, BasicBlock* dstBB) dstBB->bbFlags |= BBF_LOOP_CALL1; } } - // if this loop will always call, then we can omit the GC Poll - if ((GCPOLL_NONE != opts.compGCPollType) && (dstBB->bbFlags & BBF_LOOP_CALL1)) - { - srcBB->bbFlags &= ~BBF_NEEDS_GCPOLL; - } } /***************************************************************************** @@ -8021,8 +7838,6 @@ inline void Compiler::fgMarkLoopHead(BasicBlock* block) printf("this block will execute a call\n"); } #endif - // single block loops that contain GC safe points don't need polls. - block->bbFlags &= ~BBF_NEEDS_GCPOLL; return; } @@ -8071,26 +7886,13 @@ inline void Compiler::fgMarkLoopHead(BasicBlock* block) return; } - // only enable fully interruptible code for if we're hijacking. - if (GCPOLL_NONE == opts.compGCPollType) - { #ifdef DEBUG - if (verbose) - { - printf("no guaranteed callsite exits, marking method as fully interruptible\n"); - } -#endif - SetInterruptible(true); - } - else + if (verbose) { -#ifdef DEBUG - if (verbose) - { - printf("no guaranteed callsite exits, but we are using GC Poll calls\n"); - } -#endif + printf("no guaranteed callsite exits, marking method as fully interruptible\n"); } +#endif + SetInterruptible(true); } GenTree* Compiler::fgGetCritSectOfStaticMethod() @@ -9342,7 +9144,8 @@ void Compiler::fgAddInternal() if (dbgHandle || pDbgHandle) { - GenTree* embNode = gtNewIconEmbHndNode(dbgHandle, pDbgHandle, GTF_ICON_TOKEN_HDL, info.compMethodHnd); + // Test the JustMyCode VM global state variable + GenTree* embNode = gtNewIconEmbHndNode(dbgHandle, pDbgHandle, GTF_ICON_GLOBAL_PTR, info.compMethodHnd); GenTree* guardCheckVal = gtNewOperNode(GT_IND, TYP_INT, embNode); GenTree* guardCheckCond = gtNewOperNode(GT_EQ, TYP_INT, guardCheckVal, gtNewZeroConNode(TYP_INT)); @@ -10820,7 +10623,7 @@ void Compiler::fgCompactBlocks(BasicBlock* block, BasicBlock* bNext) // Propagate RETLESS property block->bbFlags |= (bNext->bbFlags & BBF_RETLESS_CALL); - __fallthrough; + FALLTHROUGH; case BBJ_COND: case BBJ_ALWAYS: @@ -11051,7 +10854,6 @@ void Compiler::fgRemoveConditionalJump(BasicBlock* block) // Change the BBJ_COND to BBJ_NONE, and adjust the refCount and dupCount. block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~BBF_NEEDS_GCPOLL; --block->bbNext->bbRefs; --flow->flDupCount; @@ -11339,7 +11141,6 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) // because that would violate our invariant that BBJ_CALLFINALLY blocks are followed by // BBJ_ALWAYS blocks. bPrev->bbJumpKind = BBJ_NONE; - bPrev->bbFlags &= ~BBF_NEEDS_GCPOLL; } // If this is the first Cold basic block update fgFirstColdBlock @@ -11582,7 +11383,7 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) } /* Fall through for the jump case */ - __fallthrough; + FALLTHROUGH; case BBJ_CALLFINALLY: case BBJ_ALWAYS: @@ -11628,7 +11429,6 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) { // It's safe to change the jump type bPrev->bbJumpKind = BBJ_NONE; - bPrev->bbFlags &= ~BBF_NEEDS_GCPOLL; } } break; @@ -11776,7 +11576,6 @@ BasicBlock* Compiler::fgConnectFallThrough(BasicBlock* bSrc, BasicBlock* bDst) (bSrc->bbJumpDest == bSrc->bbNext)) { bSrc->bbJumpKind = BBJ_NONE; - bSrc->bbFlags &= ~BBF_NEEDS_GCPOLL; #ifdef DEBUG if (verbose) { @@ -14266,7 +14065,7 @@ bool Compiler::fgOptimizeEmptyBlock(BasicBlock* block) /* Can fall through since this is similar with removing * a BBJ_NONE block, only the successor is different */ - __fallthrough; + FALLTHROUGH; case BBJ_NONE: @@ -14682,9 +14481,9 @@ bool Compiler::fgOptimizeSwitchBranches(BasicBlock* block) LIR::ReadOnlyRange range(zeroConstNode, switchTree); m_pLowering->LowerRange(block, range); } - else + else if (fgStmtListThreaded) { - // Re-link the nodes for this statement. + gtSetStmtInfo(switchStmt); fgSetStmtSeq(switchStmt); } @@ -15023,7 +14822,6 @@ bool Compiler::fgOptimizeBranchToNext(BasicBlock* block, BasicBlock* bNext, Basi { /* the unconditional jump is to the next BB */ block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~BBF_NEEDS_GCPOLL; #ifdef DEBUG if (verbose) { @@ -15141,7 +14939,6 @@ bool Compiler::fgOptimizeBranchToNext(BasicBlock* block, BasicBlock* bNext, Basi /* Conditional is gone - simply fall into the next block */ block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~BBF_NEEDS_GCPOLL; /* Update bbRefs and bbNum - Conditional predecessors to the same * block are counted twice so we have to remove one of them */ @@ -16841,6 +16638,7 @@ void Compiler::fgDetermineFirstColdBlock() { default: noway_assert(!"Unhandled jumpkind in fgDetermineFirstColdBlock()"); + break; case BBJ_CALLFINALLY: // A BBJ_CALLFINALLY that falls through is always followed @@ -19386,8 +19184,7 @@ void Compiler::fgSetBlockOrder() } } } - // only enable fully interruptible code for if we're hijacking. - else if (GCPOLL_NONE == opts.compGCPollType) + else { /* If we don't have the dominators, use an abbreviated test for fully interruptible. If there are * any back edges, check the source and destination blocks to see if they're GC Safe. If not, then @@ -19445,11 +19242,6 @@ void Compiler::fgSetBlockOrder() } } - if (!fgGCPollsCreated) - { - fgCreateGCPolls(); - } - for (BasicBlock* block = fgFirstBB; block; block = block->bbNext) { @@ -19457,15 +19249,6 @@ void Compiler::fgSetBlockOrder() #ifndef JIT32_GCENCODER if (block->endsWithTailCallOrJmp(this, true) && optReachWithoutCall(fgFirstBB, block)) { - // We have a tail call that is reachable without making any other - // 'normal' call that would have counted as a GC Poll. If we were - // using polls, all return blocks meeting this criteria would have - // already added polls and then marked as being GC safe - // (BBF_GC_SAFE_POINT). Thus we can only reach here when *NOT* - // using GC polls, but instead relying on the JIT to generate - // fully-interruptible code. - noway_assert(GCPOLL_NONE == opts.compGCPollType); - // This tail call might combine with other tail calls to form a // loop. Thus we need to either add a poll, or make the method // fully interruptible. I chose the later because that's what @@ -20015,16 +19798,21 @@ FILE* Compiler::fgOpenFlowGraphFile(bool* wbDontClose, Phases phase, LPCWSTR typ ONE_FILE_PER_METHOD:; - escapedString = fgProcessEscapes(info.compFullName, s_EscapeFileMapping); - size_t wCharCount = strlen(escapedString) + wcslen(phaseName) + 1 + strlen("~999") + wcslen(type) + 1; + escapedString = fgProcessEscapes(info.compFullName, s_EscapeFileMapping); + + const char* tierName = compGetTieringName(true); + size_t wCharCount = + strlen(escapedString) + wcslen(phaseName) + 1 + strlen("~999") + wcslen(type) + strlen(tierName) + 1; if (pathname != nullptr) { wCharCount += wcslen(pathname) + 1; } filename = (LPCWSTR)alloca(wCharCount * sizeof(WCHAR)); + if (pathname != nullptr) { - swprintf_s((LPWSTR)filename, wCharCount, W("%s\\%S-%s.%s"), pathname, escapedString, phaseName, type); + swprintf_s((LPWSTR)filename, wCharCount, W("%s\\%S-%s-%S.%s"), pathname, escapedString, phaseName, tierName, + type); } else { @@ -20152,8 +19940,7 @@ bool Compiler::fgDumpFlowGraph(Phases phase) return false; } bool validWeights = fgHaveValidEdgeWeights; - unsigned calledCount = max(fgCalledCount, BB_UNITY_WEIGHT) / BB_UNITY_WEIGHT; - double weightDivisor = (double)(calledCount * BB_UNITY_WEIGHT); + double weightDivisor = (double)fgCalledCount; const char* escapedString; const char* regionString = "NONE"; @@ -20172,8 +19959,9 @@ bool Compiler::fgDumpFlowGraph(Phases phase) if (createDotFile) { - fprintf(fgxFile, "digraph %s\n{\n", info.compMethodName); - fprintf(fgxFile, "/* Method %d, after phase %s */", Compiler::jitTotalMethodCompiled, PhaseNames[phase]); + fprintf(fgxFile, "digraph FlowGraph {\n"); + fprintf(fgxFile, " graph [label = \"%s\\nafter\\n%s\"];\n", info.compMethodName, PhaseNames[phase]); + fprintf(fgxFile, " node [shape = \"Box\"];\n"); } else { @@ -20194,7 +19982,7 @@ bool Compiler::fgDumpFlowGraph(Phases phase) if (fgHaveProfileData()) { - fprintf(fgxFile, "\n calledCount=\"%d\"", calledCount); + fprintf(fgxFile, "\n calledCount=\"%d\"", fgCalledCount); fprintf(fgxFile, "\n profileData=\"true\""); } if (compHndBBtabCount > 0) @@ -20234,24 +20022,37 @@ bool Compiler::fgDumpFlowGraph(Phases phase) { if (createDotFile) { - // Add constraint edges to try to keep nodes ordered. - // It seems to work best if these edges are all created first. - switch (block->bbJumpKind) + fprintf(fgxFile, " BB%02u [label = \"BB%02u\\n\\n", block->bbNum, block->bbNum); + + // "Raw" Profile weight + if (block->hasProfileWeight()) + { + fprintf(fgxFile, "%7.2f", ((double)block->getBBWeight(this)) / BB_UNITY_WEIGHT); + } + + // end of block label + fprintf(fgxFile, "\""); + + // other node attributes + // + if (block == fgFirstBB) + { + fprintf(fgxFile, ", shape = \"house\""); + } + else if (block->bbJumpKind == BBJ_RETURN) + { + fprintf(fgxFile, ", shape = \"invhouse\""); + } + else if (block->bbJumpKind == BBJ_THROW) { - case BBJ_COND: - case BBJ_NONE: - assert(block->bbNext != nullptr); - fprintf(fgxFile, " " FMT_BB " -> " FMT_BB "\n", block->bbNum, block->bbNext->bbNum); - break; - default: - // These may or may not have an edge to the next block. - // Add a transparent edge to keep nodes ordered. - if (block->bbNext != nullptr) - { - fprintf(fgxFile, " " FMT_BB " -> " FMT_BB " [arrowtail=none,color=transparent]\n", - block->bbNum, block->bbNext->bbNum); - } + fprintf(fgxFile, ", shape = \"trapezium\""); + } + else if (block->bbFlags & BBF_INTERNAL) + { + fprintf(fgxFile, ", shape = \"note\""); } + + fprintf(fgxFile, "];\n"); } else { @@ -20298,104 +20099,168 @@ bool Compiler::fgDumpFlowGraph(Phases phase) fprintf(fgxFile, ">"); } - unsigned edgeNum = 1; - BasicBlock* bTarget; - for (bTarget = fgFirstBB; bTarget != nullptr; bTarget = bTarget->bbNext) + if (fgComputePredsDone) { - double targetWeightDivisor; - if (bTarget->bbWeight == BB_ZERO_WEIGHT) - { - targetWeightDivisor = 1.0; - } - else - { - targetWeightDivisor = (double)bTarget->bbWeight; - } - - flowList* edge; - for (edge = bTarget->bbPreds; edge != nullptr; edge = edge->flNext, edgeNum++) + unsigned edgeNum = 1; + BasicBlock* bTarget; + for (bTarget = fgFirstBB; bTarget != nullptr; bTarget = bTarget->bbNext) { - BasicBlock* bSource = edge->flBlock; - double sourceWeightDivisor; - if (bSource->bbWeight == BB_ZERO_WEIGHT) + double targetWeightDivisor; + if (bTarget->bbWeight == BB_ZERO_WEIGHT) { - sourceWeightDivisor = 1.0; + targetWeightDivisor = 1.0; } else { - sourceWeightDivisor = (double)bSource->bbWeight; + targetWeightDivisor = (double)bTarget->bbWeight; } - if (createDotFile) + + flowList* edge; + for (edge = bTarget->bbPreds; edge != nullptr; edge = edge->flNext, edgeNum++) { - // Don't duplicate the edges we added above. - if ((bSource->bbNum == (bTarget->bbNum - 1)) && - ((bSource->bbJumpKind == BBJ_NONE) || (bSource->bbJumpKind == BBJ_COND))) - { - continue; - } - fprintf(fgxFile, " " FMT_BB " -> " FMT_BB, bSource->bbNum, bTarget->bbNum); - if ((bSource->bbNum > bTarget->bbNum)) + BasicBlock* bSource = edge->flBlock; + double sourceWeightDivisor; + if (bSource->bbWeight == BB_ZERO_WEIGHT) { - fprintf(fgxFile, "[arrowhead=normal,arrowtail=none,color=green]\n"); + sourceWeightDivisor = 1.0; } else { - fprintf(fgxFile, "\n"); + sourceWeightDivisor = (double)bSource->bbWeight; } - } - else - { - fprintf(fgxFile, "\n bbNum); - fprintf(fgxFile, "\n target=\"%d\"", bTarget->bbNum); - if (bSource->bbJumpKind == BBJ_SWITCH) + if (createDotFile) { - if (edge->flDupCount >= 2) + fprintf(fgxFile, " " FMT_BB " -> " FMT_BB, bSource->bbNum, bTarget->bbNum); + + const char* sep = ""; + + if (bSource->bbNum > bTarget->bbNum) { - fprintf(fgxFile, "\n switchCases=\"%d\"", edge->flDupCount); + // Lexical backedge + fprintf(fgxFile, " [color=green"); + sep = ", "; } - if (bSource->bbJumpSwt->getDefault() == bTarget) + else if ((bSource->bbNum + 1) == bTarget->bbNum) { - fprintf(fgxFile, "\n switchDefault=\"true\""); + // Lexical successor + fprintf(fgxFile, " [color=blue, weight=20"); + sep = ", "; + } + else + { + fprintf(fgxFile, " ["); } - } - if (validWeights) - { - unsigned edgeWeight = (edge->edgeWeightMin() + edge->edgeWeightMax()) / 2; - fprintf(fgxFile, "\n weight="); - fprintfDouble(fgxFile, ((double)edgeWeight) / weightDivisor); - if (edge->edgeWeightMin() != edge->edgeWeightMax()) + if (validWeights) { - fprintf(fgxFile, "\n minWeight="); - fprintfDouble(fgxFile, ((double)edge->edgeWeightMin()) / weightDivisor); - fprintf(fgxFile, "\n maxWeight="); - fprintfDouble(fgxFile, ((double)edge->edgeWeightMax()) / weightDivisor); + unsigned edgeWeight = (edge->edgeWeightMin() + edge->edgeWeightMax()) / 2; + fprintf(fgxFile, "%slabel=\"%7.2f\"", sep, (double)edgeWeight / weightDivisor); } - if (edgeWeight > 0) + fprintf(fgxFile, "];\n"); + } + else + { + fprintf(fgxFile, "\n bbNum); + fprintf(fgxFile, "\n target=\"%d\"", bTarget->bbNum); + if (bSource->bbJumpKind == BBJ_SWITCH) + { + if (edge->flDupCount >= 2) + { + fprintf(fgxFile, "\n switchCases=\"%d\"", edge->flDupCount); + } + if (bSource->bbJumpSwt->getDefault() == bTarget) + { + fprintf(fgxFile, "\n switchDefault=\"true\""); + } + } + if (validWeights) { - if (edgeWeight < bSource->bbWeight) + unsigned edgeWeight = (edge->edgeWeightMin() + edge->edgeWeightMax()) / 2; + fprintf(fgxFile, "\n weight="); + fprintfDouble(fgxFile, ((double)edgeWeight) / weightDivisor); + + if (edge->edgeWeightMin() != edge->edgeWeightMax()) { - fprintf(fgxFile, "\n out="); - fprintfDouble(fgxFile, ((double)edgeWeight) / sourceWeightDivisor); + fprintf(fgxFile, "\n minWeight="); + fprintfDouble(fgxFile, ((double)edge->edgeWeightMin()) / weightDivisor); + fprintf(fgxFile, "\n maxWeight="); + fprintfDouble(fgxFile, ((double)edge->edgeWeightMax()) / weightDivisor); } - if (edgeWeight < bTarget->bbWeight) + + if (edgeWeight > 0) { - fprintf(fgxFile, "\n in="); - fprintfDouble(fgxFile, ((double)edgeWeight) / targetWeightDivisor); + if (edgeWeight < bSource->bbWeight) + { + fprintf(fgxFile, "\n out="); + fprintfDouble(fgxFile, ((double)edgeWeight) / sourceWeightDivisor); + } + if (edgeWeight < bTarget->bbWeight) + { + fprintf(fgxFile, "\n in="); + fprintfDouble(fgxFile, ((double)edgeWeight) / targetWeightDivisor); + } } } } + if (!createDotFile) + { + fprintf(fgxFile, ">"); + fprintf(fgxFile, "\n "); + } } - if (!createDotFile) + } + } + + // For dot, show edges w/o pred lists, and add invisible bbNext links. + // + if (createDotFile) + { + for (BasicBlock* bSource = fgFirstBB; bSource != nullptr; bSource = bSource->bbNext) + { + // Invisible edge for bbNext chain + // + if (bSource->bbNext != nullptr) + { + fprintf(fgxFile, " " FMT_BB " -> " FMT_BB " [style=\"invis\", weight=25];\n", bSource->bbNum, + bSource->bbNext->bbNum); + } + + if (fgComputePredsDone) + { + // Already emitted pred edges above. + // + continue; + } + + // Emit successor edges + // + const unsigned numSuccs = bSource->NumSucc(); + + for (unsigned i = 0; i < numSuccs; i++) { - fprintf(fgxFile, ">"); - fprintf(fgxFile, "\n "); + BasicBlock* const bTarget = bSource->GetSucc(i); + fprintf(fgxFile, " " FMT_BB " -> " FMT_BB, bSource->bbNum, bTarget->bbNum); + if (bSource->bbNum > bTarget->bbNum) + { + // Lexical backedge + fprintf(fgxFile, " [color=green]\n"); + } + else if ((bSource->bbNum + 1) == bTarget->bbNum) + { + // Lexical successor + fprintf(fgxFile, " [color=blue]\n"); + } + else + { + fprintf(fgxFile, ";\n"); + } } } } + if (createDotFile) { fprintf(fgxFile, "}\n"); @@ -21398,12 +21263,6 @@ void Compiler::fgDebugCheckBBlist(bool checkBBNum /* = false */, bool checkBBRef assert(block->lastNode()->gtNext == nullptr && (block->lastNode()->gtOper == GT_SWITCH || block->lastNode()->gtOper == GT_SWITCH_TABLE)); } - else if (!(block->bbJumpKind == BBJ_ALWAYS || block->bbJumpKind == BBJ_RETURN || - block->bbJumpKind == BBJ_NONE || block->bbJumpKind == BBJ_THROW)) - { - // this block cannot have a poll - assert(!(block->bbFlags & BBF_NEEDS_GCPOLL)); - } if (block->bbCatchTyp == BBCT_FILTER) { @@ -21586,6 +21445,10 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) chkFlags |= GTF_GLOB_REF | GTF_ASG; break; + case GT_LCL_VAR: + assert((tree->gtFlags & GTF_VAR_FOLDED_IND) == 0); + break; + default: break; } @@ -21666,6 +21529,79 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) break; case GT_ADDR: assert(!op1->CanCSE()); + break; + + case GT_IND: + // Do we have a constant integer address as op1? + // + if (op1->OperGet() == GT_CNS_INT) + { + // Is this constant a handle of some kind? + // + unsigned handleKind = (op1->gtFlags & GTF_ICON_HDL_MASK); + if (handleKind != 0) + { + // Is the GTF_IND_INVARIANT flag set or unset? + // + bool invariantFlag = (tree->gtFlags & GTF_IND_INVARIANT) != 0; + if (invariantFlag) + { + // Record the state of the GTF_IND_INVARIANT flags into 'chkFlags' + chkFlags |= GTF_IND_INVARIANT; + } + + // Is the GTF_IND_NONFAULTING flag set or unset? + // + bool nonFaultingFlag = (tree->gtFlags & GTF_IND_NONFAULTING) != 0; + if (nonFaultingFlag) + { + // Record the state of the GTF_IND_NONFAULTING flags into 'chkFlags' + chkFlags |= GTF_IND_NONFAULTING; + } + assert(nonFaultingFlag); // Currently this should always be set for all handle kinds + + // Some of these aren't handles to invariant data... + // + if ((handleKind == GTF_ICON_STATIC_HDL) || // Pointer to a mutable class Static variable + (handleKind == GTF_ICON_BBC_PTR) || // Pointer to a mutable basic block count value + (handleKind == GTF_ICON_GLOBAL_PTR)) // Pointer to mutable data from the VM state + + { + // We expect the Invariant flag to be unset for this handleKind + // If it is set then we will assert with "unexpected GTF_IND_INVARIANT flag set ... + // + if (handleKind == GTF_ICON_STATIC_HDL) + { + // We expect the GTF_GLOB_REF flag to be set for this handleKind + // If it is not set then we will assert with "Missing flags on tree" + // + treeFlags |= GTF_GLOB_REF; + } + } + else // All the other handle indirections are considered invariant + { + // We expect the Invariant flag to be set for this handleKind + // If it is not set then we will assert with "Missing flags on tree" + // + treeFlags |= GTF_IND_INVARIANT; + } + + // We currently expect all handle kinds to be nonFaulting + // + treeFlags |= GTF_IND_NONFAULTING; + + // Matrix for GTF_IND_INVARIANT (treeFlags and chkFlags) + // + // chkFlags INVARIANT value + // 0 1 + // +--------------+----------------+ + // treeFlags 0 | OK | Missing Flag | + // INVARIANT +--------------+----------------+ + // value: 1 | Extra Flag | OK | + // +--------------+----------------+ + } + } + break; default: break; @@ -21915,6 +21851,27 @@ void Compiler::fgDebugCheckFlags(GenTree* tree) fgDebugCheckFlagsHelper(tree, treeFlags, chkFlags); } +//------------------------------------------------------------------------------ +// fgDebugCheckDispFlags: +// Wrapper function that displays two GTF_IND_ flags +// and then calls ftDispFlags to display the rest. +// +// Arguments: +// tree - Tree whose flags are being checked +// dispFlags - the first argument for gtDispFlags +// ands hold GTF_IND_INVARIANT and GTF_IND_NONFLUALTING +// debugFlags - the second argument to gtDispFlags +// +void Compiler::fgDebugCheckDispFlags(GenTree* tree, unsigned dispFlags, unsigned debugFlags) +{ + if (tree->OperGet() == GT_IND) + { + printf("%c", (dispFlags & GTF_IND_INVARIANT) ? '#' : '-'); + printf("%c", (dispFlags & GTF_IND_NONFAULTING) ? 'n' : '-'); + } + GenTree::gtDispFlags(dispFlags, debugFlags); +} + //------------------------------------------------------------------------------ // fgDebugCheckFlagsHelper : Check if all bits that are set in chkFlags are also set in treeFlags. // @@ -21933,7 +21890,7 @@ void Compiler::fgDebugCheckFlagsHelper(GenTree* tree, unsigned treeFlags, unsign { // Print the tree so we can see it in the log. printf("Missing flags on tree [%06d]: ", dspTreeID(tree)); - GenTree::gtDispFlags(chkFlags & ~treeFlags, GTF_DEBUG_NONE); + Compiler::fgDebugCheckDispFlags(tree, chkFlags & ~treeFlags, GTF_DEBUG_NONE); printf("\n"); gtDispTree(tree); @@ -21941,26 +21898,29 @@ void Compiler::fgDebugCheckFlagsHelper(GenTree* tree, unsigned treeFlags, unsign // Print the tree again so we can see it right after we hook up the debugger. printf("Missing flags on tree [%06d]: ", dspTreeID(tree)); - GenTree::gtDispFlags(chkFlags & ~treeFlags, GTF_DEBUG_NONE); + Compiler::fgDebugCheckDispFlags(tree, chkFlags & ~treeFlags, GTF_DEBUG_NONE); printf("\n"); gtDispTree(tree); } else if (treeFlags & ~chkFlags) { - // TODO: We are currently only checking extra GTF_EXCEPT, GTF_ASG, and GTF_CALL flags. - if ((treeFlags & ~chkFlags & ~GTF_GLOB_REF & ~GTF_ORDER_SIDEEFF) != 0) + // We can't/don't consider these flags (GTF_GLOB_REF or GTF_ORDER_SIDEEFF) as being "extra" flags + // + unsigned flagsToCheck = ~GTF_GLOB_REF & ~GTF_ORDER_SIDEEFF; + + if ((treeFlags & ~chkFlags & flagsToCheck) != 0) { // Print the tree so we can see it in the log. - printf("Extra flags on parent tree [%X]: ", tree); - GenTree::gtDispFlags(treeFlags & ~chkFlags, GTF_DEBUG_NONE); + printf("Extra flags on tree [%06d]: ", dspTreeID(tree)); + Compiler::fgDebugCheckDispFlags(tree, treeFlags & ~chkFlags, GTF_DEBUG_NONE); printf("\n"); gtDispTree(tree); noway_assert(!"Extra flags on tree"); // Print the tree again so we can see it right after we hook up the debugger. - printf("Extra flags on parent tree [%X]: ", tree); - GenTree::gtDispFlags(treeFlags & ~chkFlags, GTF_DEBUG_NONE); + printf("Extra flags on tree [%06d]: ", dspTreeID(tree)); + Compiler::fgDebugCheckDispFlags(tree, treeFlags & ~chkFlags, GTF_DEBUG_NONE); printf("\n"); gtDispTree(tree); } @@ -23188,6 +23148,8 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineRe inlineInfo.retExprClassHnd = nullptr; inlineInfo.retExprClassHndIsExact = false; inlineInfo.inlineResult = inlineResult; + inlineInfo.profileScaleState = InlineInfo::ProfileScaleState::UNDETERMINED; + inlineInfo.profileScaleFactor = 0.0; #ifdef FEATURE_SIMD inlineInfo.hasSIMDTypeArgLocalOrReturn = false; #endif // FEATURE_SIMD @@ -23261,7 +23223,6 @@ void Compiler::fgInvokeInlineeCompiler(GenTreeCall* call, InlineResult* inlineRe // The following flags are lost when inlining. // (This is checked in Compiler::compInitOptions().) - compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_BBOPT); compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_BBINSTR); compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_PROF_ENTERLEAVE); compileFlagsForInlinee.Clear(JitFlags::JIT_FLAG_DEBUG_EnC); @@ -23467,7 +23428,9 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo) const unsigned __int64 inlineeBlockFlags = InlineeCompiler->fgFirstBB->bbFlags; noway_assert((inlineeBlockFlags & BBF_HAS_JMP) == 0); noway_assert((inlineeBlockFlags & BBF_KEEP_BBJ_ALWAYS) == 0); - iciBlock->bbFlags |= inlineeBlockFlags; + + // Todo: we may want to exclude other flags here. + iciBlock->bbFlags |= (inlineeBlockFlags & ~BBF_RUN_RARELY); #ifdef DEBUG if (verbose) @@ -23626,6 +23589,13 @@ void Compiler::fgInsertInlineeBlocks(InlineInfo* pInlineInfo) block->bbJumpKind = BBJ_NONE; } } + + // Update profile weight for callee blocks, if we didn't do it already. + if (pInlineInfo->profileScaleState == InlineInfo::ProfileScaleState::KNOWN) + { + continue; + } + if (inheritWeight) { block->inheritWeight(iciBlock); @@ -23800,10 +23770,13 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) if (call->gtFlags & GTF_CALL_NULLCHECK && !inlineInfo->thisDereferencedFirst) { // Call impInlineFetchArg to "reserve" a temp for the "this" pointer. - nullcheck = gtNewNullCheck(impInlineFetchArg(0, inlArgInfo, lclVarInfo), block); - - // The NULL-check statement will be inserted to the statement list after those statements - // that assign arguments to temps and before the actual body of the inlinee method. + GenTree* thisOp = impInlineFetchArg(0, inlArgInfo, lclVarInfo); + if (fgAddrCouldBeNull(thisOp)) + { + nullcheck = gtNewNullCheck(impInlineFetchArg(0, inlArgInfo, lclVarInfo), block); + // The NULL-check statement will be inserted to the statement list after those statements + // that assign arguments to temps and before the actual body of the inlinee method. + } } /* Treat arguments that had to be assigned to temps */ @@ -24859,7 +24832,7 @@ PhaseStatus Compiler::fgRemoveEmptyTry() GenTree* expr = stmt->GetRootNode(); if (expr->gtOper == GT_END_LFIN) { - const unsigned nestLevel = expr->AsVal()->gtVal1; + const size_t nestLevel = expr->AsVal()->gtVal1; assert(nestLevel > 0); expr->AsVal()->gtVal1 = nestLevel - 1; } @@ -25984,7 +25957,7 @@ PhaseStatus Compiler::fgMergeFinallyChains() { JITDUMP("Method had mergeable try-finallys and some callfinally merges were performed.\n"); -#if DEBUG +#ifdef DEBUG if (verbose) { printf("\n*************** After fgMergeFinallyChains()\n"); @@ -26521,3 +26494,247 @@ void Compiler::fgTailMergeThrowsJumpToHelper(BasicBlock* predBlock, // Note there is now a jump to the canonical block canonicalBlock->bbFlags |= (BBF_JMP_TARGET | BBF_HAS_LABEL); } + +#ifdef DEBUG + +//------------------------------------------------------------------------ +// fgDebugCheckProfileData: verify profile data is self-consistent +// (or nearly so) +// +// Notes: +// For each profiled block, check that the flow of counts into +// the block matches the flow of counts out of the block. +// +// We ignore EH flow as we don't have explicit edges and generally +// we expect EH edge counts to be small, so errors from ignoring +// them should be rare. +// +void Compiler::fgDebugCheckProfileData() +{ + // We can't check before we have pred lists built. + // + assert(fgComputePredsDone); + + JITDUMP("Checking Profile Data\n"); + unsigned problemBlocks = 0; + unsigned unprofiledBlocks = 0; + unsigned profiledBlocks = 0; + bool entryProfiled = false; + bool exitProfiled = false; + BasicBlock::weight_t entryWeight = 0; + BasicBlock::weight_t exitWeight = 0; + + // Verify each profiled block. + // + for (BasicBlock* block = fgFirstBB; block != nullptr; block = block->bbNext) + { + if (!block->hasProfileWeight()) + { + unprofiledBlocks++; + continue; + } + + // There is some profile data to check. + // + profiledBlocks++; + + // Currently using raw counts. Consider using normalized counts instead? + // + BasicBlock::weight_t blockWeight = block->bbWeight; + + bool verifyIncoming = true; + bool verifyOutgoing = true; + + // First, look for blocks that require special treatment. + + // Entry blocks + // + if (block == fgFirstBB) + { + entryWeight += blockWeight; + entryProfiled = true; + verifyIncoming = false; + } + + // Exit blocks + // + if ((block->bbJumpKind == BBJ_RETURN) || (block->bbJumpKind == BBJ_THROW)) + { + exitWeight += blockWeight; + exitProfiled = true; + verifyOutgoing = false; + } + + // Handler entries + // + if (block->hasEHBoundaryIn()) + { + verifyIncoming = false; + } + + // Handler exits + // + if (block->hasEHBoundaryOut()) + { + verifyOutgoing = false; + } + + // We generally expect that the incoming flow, block weight and outgoing + // flow should all match. + // + // But we have two edge counts... so for now we simply check if the block + // count falls within the [min,max] range. + // + if (verifyIncoming) + { + BasicBlock::weight_t incomingWeightMin = 0; + BasicBlock::weight_t incomingWeightMax = 0; + bool foundPreds = false; + + for (flowList* predEdge = block->bbPreds; predEdge != nullptr; predEdge = predEdge->flNext) + { + incomingWeightMin += predEdge->edgeWeightMin(); + incomingWeightMax += predEdge->edgeWeightMax(); + foundPreds = true; + } + + if (!foundPreds) + { + // Might need to tone this down as we could see unreachable blocks? + problemBlocks++; + JITDUMP(" " FMT_BB " - expected to see predecessors\n", block->bbNum); + } + else + { + if (incomingWeightMin > incomingWeightMax) + { + problemBlocks++; + JITDUMP(" " FMT_BB " - incoming min %d > incoming max %d\n", block->bbNum, incomingWeightMin, + incomingWeightMax); + } + else if (blockWeight < incomingWeightMin) + { + problemBlocks++; + JITDUMP(" " FMT_BB " - block weight %d < incoming min %d\n", block->bbNum, blockWeight, + incomingWeightMin); + } + else if (blockWeight > incomingWeightMax) + { + problemBlocks++; + JITDUMP(" " FMT_BB " - block weight %d > incoming max %d\n", block->bbNum, blockWeight, + incomingWeightMax); + } + } + } + + if (verifyOutgoing) + { + const unsigned numSuccs = block->NumSucc(); + + if (numSuccs == 0) + { + problemBlocks++; + JITDUMP(" " FMT_BB " - expected to see successors\n", block->bbNum); + } + else + { + BasicBlock::weight_t outgoingWeightMin = 0; + BasicBlock::weight_t outgoingWeightMax = 0; + + // Walking successor edges is a bit wonky. Seems like it should be easier. + // Note this can also fail to enumerate all the edges, if we have a multigraph + // + int missingEdges = 0; + + for (unsigned i = 0; i < numSuccs; i++) + { + BasicBlock* succBlock = block->GetSucc(i); + flowList* succEdge = nullptr; + + for (flowList* edge = succBlock->bbPreds; edge != nullptr; edge = edge->flNext) + { + if (edge->flBlock == block) + { + succEdge = edge; + break; + } + } + + if (succEdge == nullptr) + { + missingEdges++; + JITDUMP(" " FMT_BB " can't find successor edge to " FMT_BB "\n", block->bbNum, + succBlock->bbNum); + } + else + { + outgoingWeightMin += succEdge->edgeWeightMin(); + outgoingWeightMax += succEdge->edgeWeightMax(); + } + } + + if (missingEdges > 0) + { + JITDUMP(" " FMT_BB " - missing %d successor edges\n", block->bbNum, missingEdges); + problemBlocks++; + } + if (outgoingWeightMin > outgoingWeightMax) + { + problemBlocks++; + JITDUMP(" " FMT_BB " - outgoing min %d > outgoing max %d\n", block->bbNum, outgoingWeightMin, + outgoingWeightMax); + } + else if (blockWeight < outgoingWeightMin) + { + problemBlocks++; + JITDUMP(" " FMT_BB " - block weight %d < outgoing min %d\n", block->bbNum, blockWeight, + outgoingWeightMin); + } + else if (blockWeight > outgoingWeightMax) + { + problemBlocks++; + JITDUMP(" " FMT_BB " - block weight %d > outgoing max %d\n", block->bbNum, blockWeight, + outgoingWeightMax); + } + } + } + } + + // Verify overall input-output balance. + // + if (entryProfiled && exitProfiled) + { + if (entryWeight != exitWeight) + { + problemBlocks++; + JITDUMP(" Entry %d exit %d mismatch\n", entryWeight, exitWeight); + } + } + + // Sum up what we discovered. + // + if (problemBlocks == 0) + { + if (profiledBlocks == 0) + { + JITDUMP("No blocks were profiled, so nothing to check\n"); + } + else + { + JITDUMP("Profile is self-consistent (%d profiled blocks, %d unprofiled)\n", profiledBlocks, + unprofiledBlocks); + } + } + else + { + JITDUMP("Profile is NOT self-consistent, found %d problems (%d profiled blocks, %d unprofiled)\n", + problemBlocks, profiledBlocks, unprofiledBlocks); + + if (JitConfig.JitProfileChecks() == 2) + { + assert(!"Inconsistent profile"); + } + } +} + +#endif // DEBUG diff --git a/src/coreclr/src/jit/gcencode.cpp b/src/coreclr/src/jit/gcencode.cpp index 3c45137b0593..d315ef9a430d 100644 --- a/src/coreclr/src/jit/gcencode.cpp +++ b/src/coreclr/src/jit/gcencode.cpp @@ -1597,7 +1597,7 @@ size_t GCInfo::gcInfoBlockHdrSave( if (compiler->getNeedsGSSecurityCookie()) { assert(compiler->lvaGSSecurityCookie != BAD_VAR_NUM); - int stkOffs = compiler->lvaTable[compiler->lvaGSSecurityCookie].lvStkOffs; + int stkOffs = compiler->lvaTable[compiler->lvaGSSecurityCookie].GetStackOffset(); header->gsCookieOffset = compiler->isFramePointerUsed() ? -stkOffs : stkOffs; assert(header->gsCookieOffset != INVALID_GS_COOKIE_OFFSET); } @@ -2198,7 +2198,7 @@ size_t GCInfo::gcMakeRegPtrTable(BYTE* dest, int mask, const InfoHdr& header, un continue; } - int offset = varDsc->lvStkOffs; + int offset = varDsc->GetStackOffset(); #if DOUBLE_ALIGN // For genDoubleAlign(), locals are addressed relative to ESP and // arguments are addressed relative to EBP. @@ -2247,7 +2247,7 @@ size_t GCInfo::gcMakeRegPtrTable(BYTE* dest, int mask, const InfoHdr& header, un continue; } - unsigned offset = varDsc->lvStkOffs + i * TARGET_POINTER_SIZE; + unsigned offset = varDsc->GetStackOffset() + i * TARGET_POINTER_SIZE; #if DOUBLE_ALIGN // For genDoubleAlign(), locals are addressed relative to ESP and // arguments are addressed relative to EBP. @@ -2352,7 +2352,7 @@ size_t GCInfo::gcMakeRegPtrTable(BYTE* dest, int mask, const InfoHdr& header, un assert(compiler->lvaTable[compiler->info.compThisArg].TypeGet() == TYP_REF); - unsigned varOffs = compiler->lvaTable[compiler->info.compThisArg].lvStkOffs; + unsigned varOffs = compiler->lvaTable[compiler->info.compThisArg].GetStackOffset(); /* For negative stack offsets we must reset the low bits, * take abs and then set them back */ @@ -3588,7 +3588,7 @@ const bool verifyGCTables = false; * Dump the info block header. */ -unsigned GCInfo::gcInfoBlockHdrDump(const BYTE* table, InfoHdr* header, unsigned* methodSize) +size_t GCInfo::gcInfoBlockHdrDump(const BYTE* table, InfoHdr* header, unsigned* methodSize) { GCDump gcDump(GCINFO_VERSION); @@ -3600,7 +3600,7 @@ unsigned GCInfo::gcInfoBlockHdrDump(const BYTE* table, InfoHdr* header, unsigned /*****************************************************************************/ -unsigned GCInfo::gcDumpPtrTable(const BYTE* table, const InfoHdr& header, unsigned methodSize) +size_t GCInfo::gcDumpPtrTable(const BYTE* table, const InfoHdr& header, unsigned methodSize) { printf("Pointer table:\n"); @@ -3633,7 +3633,10 @@ void GCInfo::gcFindPtrsInFrame(const void* infoBlock, const void* codeBlock, uns template class JitHashTable; template class JitHashTable; -#ifdef DEBUG +#if defined(DEBUG) || DUMP_GC_TABLES + +// This is a copy of GcStackSlotBaseNames from gcinfotypes.h so we can compile in to non-DEBUG builds. +const char* const JitGcStackSlotBaseNames[] = {"caller.sp", "sp", "frame"}; static const char* const GcSlotFlagsNames[] = {"", "(byref) ", @@ -3652,7 +3655,7 @@ class GcInfoEncoderWithLogging public: GcInfoEncoderWithLogging(GcInfoEncoder* gcInfoEncoder, bool verbose) - : m_gcInfoEncoder(gcInfoEncoder), m_doLogging(verbose || JitConfig.JitGCInfoLogging() != 0) + : m_gcInfoEncoder(gcInfoEncoder), m_doLogging(verbose INDEBUG(|| JitConfig.JitGCInfoLogging() != 0)) { } @@ -3662,7 +3665,7 @@ class GcInfoEncoderWithLogging if (m_doLogging) { printf("Stack slot id for offset %d (0x%x) (%s) %s= %d.\n", spOffset, spOffset, - GcStackSlotBaseNames[spBase], GcSlotFlagsNames[flags & 7], newSlotId); + JitGcStackSlotBaseNames[spBase], GcSlotFlagsNames[flags & 7], newSlotId); } return newSlotId; } @@ -3827,14 +3830,14 @@ class GcInfoEncoderWithLogging }; #define GCENCODER_WITH_LOGGING(withLog, realEncoder) \ - GcInfoEncoderWithLogging withLog##Var(realEncoder, compiler->verbose || compiler->opts.dspGCtbls); \ + GcInfoEncoderWithLogging withLog##Var(realEncoder, INDEBUG(compiler->verbose ||) compiler->opts.dspGCtbls); \ GcInfoEncoderWithLogging* withLog = &withLog##Var; -#else // DEBUG +#else // !(defined(DEBUG) || DUMP_GC_TABLES) #define GCENCODER_WITH_LOGGING(withLog, realEncoder) GcInfoEncoder* withLog = realEncoder; -#endif // DEBUG +#endif // !(defined(DEBUG) || DUMP_GC_TABLES) void GCInfo::gcInfoBlockHdrSave(GcInfoEncoder* gcInfoEncoder, unsigned methodSize, unsigned prologSize) { @@ -4006,7 +4009,7 @@ void GCInfo::gcInfoBlockHdrSave(GcInfoEncoder* gcInfoEncoder, unsigned methodSiz #endif // DISPLAY_SIZES } -#ifdef DEBUG +#if defined(DEBUG) || DUMP_GC_TABLES #define Encoder GcInfoEncoderWithLogging #else #define Encoder GcInfoEncoder @@ -4166,18 +4169,19 @@ void GCInfo::gcMakeRegPtrTable( // No need to hash/lookup untracked GC refs; just grab a new Slot Id. if (mode == MAKE_REG_PTR_MODE_ASSIGN_SLOTS) { - gcInfoEncoderWithLog->GetStackSlotId(varDsc->lvStkOffs, flags, stackSlotBase); + gcInfoEncoderWithLog->GetStackSlotId(varDsc->GetStackOffset(), flags, stackSlotBase); } } else { - StackSlotIdKey sskey(varDsc->lvStkOffs, (stackSlotBase == GC_FRAMEREG_REL), flags); + StackSlotIdKey sskey(varDsc->GetStackOffset(), (stackSlotBase == GC_FRAMEREG_REL), flags); GcSlotId varSlotId; if (mode == MAKE_REG_PTR_MODE_ASSIGN_SLOTS) { if (!m_stackSlotMap->Lookup(sskey, &varSlotId)) { - varSlotId = gcInfoEncoderWithLog->GetStackSlotId(varDsc->lvStkOffs, flags, stackSlotBase); + varSlotId = + gcInfoEncoderWithLog->GetStackSlotId(varDsc->GetStackOffset(), flags, stackSlotBase); m_stackSlotMap->Set(sskey, varSlotId); } } @@ -4198,7 +4202,7 @@ void GCInfo::gcMakeRegPtrTable( continue; } - int offset = varDsc->lvStkOffs + i * TARGET_POINTER_SIZE; + int offset = varDsc->GetStackOffset() + i * TARGET_POINTER_SIZE; #if DOUBLE_ALIGN // For genDoubleAlign(), locals are addressed relative to ESP and // arguments are addressed relative to EBP. diff --git a/src/coreclr/src/jit/gcinfo.cpp b/src/coreclr/src/jit/gcinfo.cpp index a27c41c50e63..b75ddb1d86fb 100644 --- a/src/coreclr/src/jit/gcinfo.cpp +++ b/src/coreclr/src/jit/gcinfo.cpp @@ -146,14 +146,9 @@ void GCInfo::gcDspByrefSetChanges(regMaskTP gcRegByrefSetNew DEBUGARG(bool force void GCInfo::gcMarkRegSetGCref(regMaskTP regMask DEBUGARG(bool forceOutput)) { -#ifdef DEBUG - if (compiler->compRegSetCheckLevel == 0) - { - // This set of registers are going to hold REFs. - // Make sure they were not holding BYREFs. - assert((gcRegByrefSetCur & regMask) == 0); - } -#endif + // This set of registers are going to hold REFs. + // Make sure they were not holding BYREFs. + assert((gcRegByrefSetCur & regMask) == 0); regMaskTP gcRegByrefSetNew = gcRegByrefSetCur & ~regMask; // Clear it if set in Byref mask regMaskTP gcRegGCrefSetNew = gcRegGCrefSetCur | regMask; // Set it in GCref mask @@ -394,7 +389,7 @@ void GCInfo::gcCountForHeader(UNALIGNED unsigned int* pUntrackedCount, UNALIGNED #ifdef DEBUG if (compiler->verbose) { - int offs = varDsc->lvStkOffs; + int offs = varDsc->GetStackOffset(); printf("GCINFO: untrckd %s lcl at [%s", varTypeGCstring(varDsc->TypeGet()), compiler->GetEmitter()->emitGetFrameReg()); diff --git a/src/coreclr/src/jit/gentree.cpp b/src/coreclr/src/jit/gentree.cpp index 03b1d7ef87f1..ef83a02a0536 100644 --- a/src/coreclr/src/jit/gentree.cpp +++ b/src/coreclr/src/jit/gentree.cpp @@ -1852,7 +1852,7 @@ bool Compiler::gtHasRef(GenTree* tree, ssize_t lclNum, bool defOnly) { return true; } - __fallthrough; + FALLTHROUGH; case GT_DYN_BLK: if (gtHasRef(tree->AsDynBlk()->Addr(), lclNum, defOnly)) { @@ -2258,7 +2258,7 @@ unsigned Compiler::gtHashValue(GenTree* tree) case GT_STORE_DYN_BLK: hash = genTreeHashAdd(hash, gtHashValue(tree->AsDynBlk()->Data())); - __fallthrough; + FALLTHROUGH; case GT_DYN_BLK: hash = genTreeHashAdd(hash, gtHashValue(tree->AsDynBlk()->Addr())); hash = genTreeHashAdd(hash, gtHashValue(tree->AsDynBlk()->gtDynamicSize)); @@ -2482,7 +2482,7 @@ unsigned Compiler::gtSetListOrder(GenTree* list, bool isListCallArgs, bool callA // TODO: Do we have to compute costs differently for argument lists and // all other lists? - // https://github.com/dotnet/coreclr/issues/7095 + // https://github.com/dotnet/runtime/issues/6622 unsigned costSz = (isListCallArgs || (next == nullptr)) ? 0 : 1; unsigned costEx = (isListCallArgs || (next == nullptr)) ? 0 : 1; @@ -2514,7 +2514,7 @@ unsigned Compiler::gtSetListOrder(GenTree* list, bool isListCallArgs, bool callA // TODO: Do we have to compute levels differently for argument lists and // all other lists? - // https://github.com/dotnet/coreclr/issues/7095 + // https://github.com/dotnet/runtime/issues/6622 if (isListCallArgs) { if (level < lvl) @@ -3250,16 +3250,50 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) switch (oper) { #ifdef TARGET_ARM - case GT_CNS_LNG: - costSz = 9; - costEx = 4; - goto COMMON_CNS; - case GT_CNS_STR: // Uses movw/movt - costSz = 7; - costEx = 3; + costSz = 8; + costEx = 2; + goto COMMON_CNS; + + case GT_CNS_LNG: + { + GenTreeIntConCommon* con = tree->AsIntConCommon(); + + INT64 lngVal = con->LngValue(); + INT32 loVal = (INT32)(lngVal & 0xffffffff); + INT32 hiVal = (INT32)(lngVal >> 32); + + if (lngVal == 0) + { + costSz = 1; + costEx = 1; + } + else + { + // Minimum of one instruction to setup hiVal, + // and one instruction to setup loVal + costSz = 4 + 4; + costEx = 1 + 1; + + if (!codeGen->validImmForInstr(INS_mov, (target_ssize_t)hiVal) && + !codeGen->validImmForInstr(INS_mvn, (target_ssize_t)hiVal)) + { + // Needs extra instruction: movw/movt + costSz += 4; + costEx += 1; + } + + if (!codeGen->validImmForInstr(INS_mov, (target_ssize_t)loVal) && + !codeGen->validImmForInstr(INS_mvn, (target_ssize_t)loVal)) + { + // Needs extra instruction: movw/movt + costSz += 4; + costEx += 1; + } + } goto COMMON_CNS; + } case GT_CNS_INT: { @@ -3267,61 +3301,86 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) // applied to it. // Any constant that requires a reloc must use the movw/movt sequence // - GenTreeIntConCommon* con = tree->AsIntConCommon(); + GenTreeIntConCommon* con = tree->AsIntConCommon(); + target_ssize_t conVal = (target_ssize_t)con->IconValue(); - if (con->ImmedValNeedsReloc(this) || - !codeGen->validImmForInstr(INS_mov, (target_ssize_t)tree->AsIntCon()->gtIconVal)) + if (con->ImmedValNeedsReloc(this)) { - // Uses movw/movt - costSz = 7; - costEx = 3; + // Requires movw/movt + costSz = 8; + costEx = 2; } - else if (((unsigned)tree->AsIntCon()->gtIconVal) <= 0x00ff) + else if (codeGen->validImmForInstr(INS_add, conVal)) { - // mov Rd, - costSz = 1; + // Typically included with parent oper + costSz = 2; costEx = 1; } - else + else if (codeGen->validImmForInstr(INS_mov, conVal) && codeGen->validImmForInstr(INS_mvn, conVal)) { - // Uses movw/mvn - costSz = 3; + // Uses mov or mvn + costSz = 4; costEx = 1; } + else + { + // Needs movw/movt + costSz = 8; + costEx = 2; + } goto COMMON_CNS; } #elif defined TARGET_XARCH - case GT_CNS_LNG: - costSz = 10; - costEx = 3; - goto COMMON_CNS; - case GT_CNS_STR: +#ifdef TARGET_AMD64 + costSz = 10; + costEx = 2; +#else // TARGET_X86 costSz = 4; costEx = 1; +#endif goto COMMON_CNS; + case GT_CNS_LNG: case GT_CNS_INT: { + GenTreeIntConCommon* con = tree->AsIntConCommon(); + ssize_t conVal = (oper == GT_CNS_LNG) ? (ssize_t)con->LngValue() : con->IconValue(); + bool fitsInVal = true; + +#ifdef TARGET_X86 + if (oper == GT_CNS_LNG) + { + INT64 lngVal = con->LngValue(); + + conVal = (ssize_t)lngVal; // truncate to 32-bits + + fitsInVal = ((INT64)conVal == lngVal); + } +#endif // TARGET_X86 + // If the constant is a handle then it will need to have a relocation // applied to it. // - GenTreeIntConCommon* con = tree->AsIntConCommon(); - bool iconNeedsReloc = con->ImmedValNeedsReloc(this); - if (!iconNeedsReloc && con->FitsInI8()) + if (iconNeedsReloc) + { + costSz = 4; + costEx = 1; + } + else if (fitsInVal && GenTreeIntConCommon::FitsInI8(conVal)) { costSz = 1; costEx = 1; } -#if defined(TARGET_AMD64) - else if (iconNeedsReloc || !con->FitsInI32()) +#ifdef TARGET_AMD64 + else if (!GenTreeIntConCommon::FitsInI32(conVal)) { costSz = 10; - costEx = 3; + costEx = 2; } #endif // TARGET_AMD64 else @@ -3329,21 +3388,83 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) costSz = 4; costEx = 1; } +#ifdef TARGET_X86 + if (oper == GT_CNS_LNG) + { + costSz += fitsInVal ? 1 : 4; + costEx += 1; + } +#endif // TARGET_X86 + goto COMMON_CNS; } #elif defined(TARGET_ARM64) - case GT_CNS_LNG: + case GT_CNS_STR: + case GT_CNS_LNG: case GT_CNS_INT: - // TODO-ARM64-NYI: Need cost estimates. - costSz = 1; - costEx = 1; + { + GenTreeIntConCommon* con = tree->AsIntConCommon(); + bool iconNeedsReloc = con->ImmedValNeedsReloc(this); + INT64 imm = con->LngValue(); + emitAttr size = EA_SIZE(emitActualTypeSize(tree)); + + if (iconNeedsReloc) + { + costSz = 8; + costEx = 2; + } + else if (emitter::emitIns_valid_imm_for_add(imm, size)) + { + costSz = 2; + costEx = 1; + } + else if (emitter::emitIns_valid_imm_for_mov(imm, size)) + { + costSz = 4; + costEx = 1; + } + else + { + // Arm64 allows any arbitrary 16-bit constant to be loaded into a register halfword + // There are three forms + // movk which loads into any halfword preserving the remaining halfwords + // movz which loads into any halfword zeroing the remaining halfwords + // movn which loads into any halfword zeroing the remaining halfwords then bitwise inverting + // the register + // In some cases it is preferable to use movn, because it has the side effect of filling the + // other halfwords + // with ones + + // Determine whether movn or movz will require the fewest instructions to populate the immediate + bool preferMovz = false; + bool preferMovn = false; + int instructionCount = 4; + + for (int i = (size == EA_8BYTE) ? 48 : 16; i >= 0; i -= 16) + { + if (!preferMovn && (uint16_t(imm >> i) == 0x0000)) + { + preferMovz = true; // by using a movk to start we can save one instruction + instructionCount--; + } + else if (!preferMovz && (uint16_t(imm >> i) == 0xffff)) + { + preferMovn = true; // by using a movn to start we can save one instruction + instructionCount--; + } + } + + costEx = instructionCount; + costSz = 4 * instructionCount; + } + } goto COMMON_CNS; #else - case GT_CNS_LNG: case GT_CNS_STR: + case GT_CNS_LNG: case GT_CNS_INT: #error "Unknown TARGET" #endif @@ -3502,6 +3623,8 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) level = gtSetEvalOrder(op1); + GenTreeIntrinsic* intrinsic; + /* Special handling for some operators */ switch (oper) @@ -3563,54 +3686,82 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) break; case GT_INTRINSIC: - // GT_INTRINSIC intrinsics Sin, Cos, Sqrt, Abs ... have higher costs. - // TODO: tune these costs target specific as some of these are - // target intrinsics and would cost less to generate code. - switch (tree->AsIntrinsic()->gtIntrinsicId) + intrinsic = tree->AsIntrinsic(); + if (intrinsic->gtIntrinsicId == CORINFO_INTRINSIC_Illegal) { - default: - assert(!"missing case for gtIntrinsicId"); - costEx = 12; - costSz = 12; - break; + // named intrinsic + assert(intrinsic->gtIntrinsicName != NI_Illegal); - case CORINFO_INTRINSIC_Sin: - case CORINFO_INTRINSIC_Cos: - case CORINFO_INTRINSIC_Sqrt: - case CORINFO_INTRINSIC_Cbrt: - case CORINFO_INTRINSIC_Cosh: - case CORINFO_INTRINSIC_Sinh: - case CORINFO_INTRINSIC_Tan: - case CORINFO_INTRINSIC_Tanh: - case CORINFO_INTRINSIC_Asin: - case CORINFO_INTRINSIC_Asinh: - case CORINFO_INTRINSIC_Acos: - case CORINFO_INTRINSIC_Acosh: - case CORINFO_INTRINSIC_Atan: - case CORINFO_INTRINSIC_Atanh: - case CORINFO_INTRINSIC_Atan2: - case CORINFO_INTRINSIC_Log10: - case CORINFO_INTRINSIC_Pow: - case CORINFO_INTRINSIC_Exp: - case CORINFO_INTRINSIC_Ceiling: - case CORINFO_INTRINSIC_Floor: - case CORINFO_INTRINSIC_Object_GetType: - // Giving intrinsics a large fixed execution cost is because we'd like to CSE - // them, even if they are implemented by calls. This is different from modeling - // user calls since we never CSE user calls. - costEx = 36; - costSz = 4; - break; + // GT_INTRINSIC intrinsics Sin, Cos, Sqrt, Abs ... have higher costs. + // TODO: tune these costs target specific as some of these are + // target intrinsics and would cost less to generate code. + switch (intrinsic->gtIntrinsicName) + { + default: + assert(!"missing case for gtIntrinsicName"); + costEx = 12; + costSz = 12; + break; - case CORINFO_INTRINSIC_Abs: - costEx = 5; - costSz = 15; - break; + case NI_System_Math_Sin: + case NI_System_Math_Cos: + case NI_System_Math_Sqrt: + case NI_System_Math_Cbrt: + case NI_System_Math_Cosh: + case NI_System_Math_Sinh: + case NI_System_Math_Tan: + case NI_System_Math_Tanh: + case NI_System_Math_Asin: + case NI_System_Math_Asinh: + case NI_System_Math_Acos: + case NI_System_Math_Acosh: + case NI_System_Math_Atan: + case NI_System_Math_Atanh: + case NI_System_Math_Atan2: + case NI_System_Math_Log10: + case NI_System_Math_Pow: + case NI_System_Math_Exp: + case NI_System_Math_Ceiling: + case NI_System_Math_Floor: + // Giving intrinsics a large fixed execution cost is because we'd like to CSE + // them, even if they are implemented by calls. This is different from modeling + // user calls since we never CSE user calls. + costEx = 36; + costSz = 4; + break; - case CORINFO_INTRINSIC_Round: - costEx = 3; - costSz = 4; - break; + case NI_System_Math_Abs: + costEx = 5; + costSz = 15; + break; + + case NI_System_Math_Round: + costEx = 3; + costSz = 4; + break; + } + } + else + { + // old style intrinsic + assert(intrinsic->gtIntrinsicName == NI_Illegal); + + switch (intrinsic->gtIntrinsicId) + { + default: + assert(!"missing case for gtIntrinsicId"); + costEx = 12; + costSz = 12; + break; + + case CORINFO_INTRINSIC_Object_GetType: + // Giving intrinsics a large fixed execution cost is because we'd like to CSE + // them, even if they are implemented by calls. This is different from modeling + // user calls since we never CSE user calls. + costEx = 36; + costSz = 4; + break; + } } level++; break; @@ -3823,7 +3974,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) } } - __fallthrough; + FALLTHROUGH; case GT_DIV: case GT_UDIV: @@ -4032,7 +4183,8 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) break; } - // fall through and set GTF_REVERSE_OPS + // fall through and set GTF_REVERSE_OPS + FALLTHROUGH; case GT_LCL_VAR: case GT_LCL_FLD: @@ -4093,10 +4245,10 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) case GT_INTRINSIC: - switch (tree->AsIntrinsic()->gtIntrinsicId) + switch (tree->AsIntrinsic()->gtIntrinsicName) { - case CORINFO_INTRINSIC_Atan2: - case CORINFO_INTRINSIC_Pow: + case NI_System_Math_Atan2: + case NI_System_Math_Pow: // These math intrinsics are actually implemented by user calls. // Increase the Sethi 'complexity' by two to reflect the argument // register requirement. @@ -4153,7 +4305,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) // so if possible it was set above. tryToSwap = false; } - else if ((oper == GT_INTRINSIC) && IsIntrinsicImplementedByUserCall(tree->AsIntrinsic()->gtIntrinsicId)) + else if ((oper == GT_INTRINSIC) && IsIntrinsicImplementedByUserCall(tree->AsIntrinsic()->gtIntrinsicName)) { // We do not swap operand execution order for intrinsics that are implemented by user calls // because of trickiness around ensuring the execution order does not change during rationalization. @@ -4199,7 +4351,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) tree->SetOper(GenTree::SwapRelop(oper), GenTree::PRESERVE_VN); } - __fallthrough; + FALLTHROUGH; case GT_ADD: case GT_MUL: @@ -5355,7 +5507,7 @@ bool GenTree::OperRequiresCallFlag(Compiler* comp) return true; case GT_INTRINSIC: - return comp->IsIntrinsicImplementedByUserCall(this->AsIntrinsic()->gtIntrinsicId); + return comp->IsIntrinsicImplementedByUserCall(this->AsIntrinsic()->gtIntrinsicName); #if FEATURE_FIXED_OUT_ARGS && !defined(TARGET_64BIT) case GT_LSH: @@ -5538,9 +5690,9 @@ bool GenTree::OperMayThrow(Compiler* comp) // return true; } + break; } #endif // FEATURE_HW_INTRINSICS - default: break; } @@ -5836,18 +5988,25 @@ GenTree* Compiler::gtNewIndOfIconHandleNode(var_types indType, size_t addr, unsi // indNode->gtFlags |= GTF_IND_NONFAULTING; - // String Literal handles are indirections that return a TYP_REF. - // They are pointers into the GC heap and they are not invariant - // as the address is a reportable GC-root and as such it can be - // modified during a GC collection + // String Literal handles are indirections that return a TYP_REF, and + // these are pointers into the GC heap. We don't currently have any + // TYP_BYREF pointers, but if we did they also must be pointers into the GC heap. + // + // Also every GTF_ICON_STATIC_HDL also must be a pointer into the GC heap + // we will set GTF_GLOB_REF for these kinds of references. // - if (indType == TYP_REF) + if ((varTypeIsGC(indType)) || (iconFlags == GTF_ICON_STATIC_HDL)) { - // This indirection points into the gloabal heap + // This indirection also points into the gloabal heap indNode->gtFlags |= GTF_GLOB_REF; } + if (isInvariant) { + assert(iconFlags != GTF_ICON_STATIC_HDL); // Pointer to a mutable class Static variable + assert(iconFlags != GTF_ICON_BBC_PTR); // Pointer to a mutable basic block count value + assert(iconFlags != GTF_ICON_GLOBAL_PTR); // Pointer to mutable data from the VM state + // This indirection also is invariant. indNode->gtFlags |= GTF_IND_INVARIANT; } @@ -5893,12 +6052,9 @@ GenTree* Compiler::gtNewIconEmbHndNode(void* value, void* pValue, unsigned iconF // This indirection won't cause an exception. handleNode->gtFlags |= GTF_IND_NONFAULTING; -#if 0 - // It should also be invariant, but marking it as such leads to bad diffs. // This indirection also is invariant. handleNode->gtFlags |= GTF_IND_INVARIANT; -#endif } iconNode->AsIntCon()->gtCompileTimeHandle = (size_t)compileTimeHandle; @@ -5913,7 +6069,14 @@ GenTree* Compiler::gtNewStringLiteralNode(InfoAccessType iat, void* pValue) switch (iat) { - case IAT_VALUE: // constructStringLiteral in CoreRT case can return IAT_VALUE + case IAT_VALUE: + // For CoreRT only - Constant object can be a frozen string. + if (!IsTargetAbi(CORINFO_CORERT_ABI)) + { + // Non CoreRT - This case is illegal, creating a TYP_REF from an INT_CNS + noway_assert(!"unreachable IAT_VALUE case in gtNewStringLiteralNode"); + } + tree = gtNewIconEmbHndNode(pValue, nullptr, GTF_ICON_STR_HDL, nullptr); tree->gtType = TYP_REF; #ifdef DEBUG @@ -5924,7 +6087,7 @@ GenTree* Compiler::gtNewStringLiteralNode(InfoAccessType iat, void* pValue) case IAT_PVALUE: // The value needs to be accessed via an indirection // Create an indirection - tree = gtNewIndOfIconHandleNode(TYP_REF, (size_t)pValue, GTF_ICON_STR_HDL, false); + tree = gtNewIndOfIconHandleNode(TYP_REF, (size_t)pValue, GTF_ICON_STR_HDL, true); #ifdef DEBUG tree->gtGetOp1()->AsIntCon()->gtTargetHandle = (size_t)pValue; #endif @@ -5932,7 +6095,7 @@ GenTree* Compiler::gtNewStringLiteralNode(InfoAccessType iat, void* pValue) case IAT_PPVALUE: // The value needs to be accessed via a double indirection // Create the first indirection - tree = gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)pValue, GTF_ICON_PSTR_HDL, true); + tree = gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)pValue, GTF_ICON_CONST_PTR, true); #ifdef DEBUG tree->gtGetOp1()->AsIntCon()->gtTargetHandle = (size_t)pValue; #endif @@ -5990,7 +6153,7 @@ GenTree* Compiler::gtNewZeroConNode(var_types type) break; case TYP_BYREF: - __fallthrough; + FALLTHROUGH; case TYP_REF: zero = gtNewIconNode(0); @@ -6534,8 +6697,7 @@ GenTree* Compiler::gtNewStructVal(CORINFO_CLASS_HANDLE structHnd, GenTree* addr) { unsigned lclNum = addr->gtGetOp1()->AsLclVarCommon()->GetLclNum(); LclVarDsc* varDsc = &(lvaTable[lclNum]); - if (varTypeIsStruct(varDsc) && (varDsc->lvVerTypeInfo.GetClassHandle() == structHnd) && - !lvaIsImplicitByRefLocal(lclNum)) + if (varTypeIsStruct(varDsc) && (varDsc->GetStructHnd() == structHnd) && !lvaIsImplicitByRefLocal(lclNum)) { return addr->gtGetOp1(); } @@ -7577,7 +7739,8 @@ GenTree* Compiler::gtCloneExpr( case GT_INTRINSIC: copy = new (this, GT_INTRINSIC) GenTreeIntrinsic(tree->TypeGet(), tree->AsOp()->gtOp1, tree->AsOp()->gtOp2, - tree->AsIntrinsic()->gtIntrinsicId, tree->AsIntrinsic()->gtMethodHandle); + tree->AsIntrinsic()->gtIntrinsicId, tree->AsIntrinsic()->gtIntrinsicName, + tree->AsIntrinsic()->gtMethodHandle); #ifdef FEATURE_READYTORUN_COMPILER copy->AsIntrinsic()->gtEntryPoint = tree->AsIntrinsic()->gtEntryPoint; #endif @@ -9387,7 +9550,7 @@ void GenTreeUseEdgeIterator::AdvanceCall() m_edge = &call->gtCallThisArg->NodeRef(); return; } - __fallthrough; + FALLTHROUGH; case CALL_ARGS: if (m_statePtr != nullptr) @@ -9399,7 +9562,7 @@ void GenTreeUseEdgeIterator::AdvanceCall() } m_statePtr = call->gtCallLateArgs; m_advance = &GenTreeUseEdgeIterator::AdvanceCall; - __fallthrough; + FALLTHROUGH; case CALL_LATE_ARGS: if (m_statePtr != nullptr) @@ -9410,7 +9573,7 @@ void GenTreeUseEdgeIterator::AdvanceCall() return; } m_advance = &GenTreeUseEdgeIterator::AdvanceCall; - __fallthrough; + FALLTHROUGH; case CALL_CONTROL_EXPR: if (call->gtControlExpr != nullptr) @@ -9431,7 +9594,7 @@ void GenTreeUseEdgeIterator::AdvanceCall() m_state = -1; return; } - __fallthrough; + FALLTHROUGH; case CALL_COOKIE: assert(call->gtCallType == CT_INDIRECT); @@ -9442,7 +9605,7 @@ void GenTreeUseEdgeIterator::AdvanceCall() m_edge = &call->gtCallCookie; return; } - __fallthrough; + FALLTHROUGH; case CALL_ADDRESS: assert(call->gtCallType == CT_INDIRECT); @@ -9986,7 +10149,7 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z _ break; } } - __fallthrough; + FALLTHROUGH; case GT_INDEX: case GT_INDEX_ADDR: @@ -10152,6 +10315,31 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z _ printf((tree->gtFlags & GTF_JCMP_EQ) ? "EQ" : "NE"); goto DASH; + case GT_CNS_INT: + if (tree->IsIconHandle()) + { + if ((tree->gtFlags & GTF_ICON_INITCLASS) != 0) + { + printf("I"); // Static Field handle with INITCLASS requirement + --msgLength; + break; + } + else if ((tree->gtFlags & GTF_ICON_FIELD_OFF) != 0) + { + printf("O"); + --msgLength; + break; + } + else + { + // Some other handle + printf("H"); + --msgLength; + break; + } + } + goto DASH; + default: DASH: printf("-"); @@ -10347,73 +10535,94 @@ void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z _ } } +#if FEATURE_MULTIREG_RET +//---------------------------------------------------------------------------------- +// gtDispRegCount: determine how many registers to print for a multi-reg node +// +// Arguments: +// tree - Gentree node whose registers we want to print +// +// Return Value: +// The number of registers to print +// +// Notes: +// This is not the same in all cases as GenTree::GetMultiRegCount(). +// In particular, for COPY or RELOAD it only returns the number of *valid* registers, +// and for CALL, it will return 0 if the ReturnTypeDesc hasn't yet been initialized. +// But we want to print all register positions. +// +unsigned Compiler::gtDispRegCount(GenTree* tree) +{ + if (tree->IsCopyOrReload()) + { + // GetRegCount() will return only the number of valid regs for COPY or RELOAD, + // but we want to print all positions, so we get the reg count for op1. + return gtDispRegCount(tree->gtGetOp1()); + } + else if (!tree->IsMultiRegNode()) + { + // We can wind up here because IsMultiRegNode() always returns true for COPY or RELOAD, + // even if its op1 is not multireg. + // Note that this method won't be called for non-register-producing nodes. + return 1; + } + else if (tree->IsMultiRegLclVar()) + { + return tree->AsLclVar()->GetFieldCount(this); + } + else if (tree->OperIs(GT_CALL)) + { + unsigned regCount = tree->AsCall()->GetReturnTypeDesc()->TryGetReturnRegCount(); + // If it hasn't yet been initialized, we'd still like to see the registers printed. + if (regCount == 0) + { + regCount = MAX_RET_REG_COUNT; + } + return regCount; + } + else + { + return tree->GetMultiRegCount(); + } +} +#endif // FEATURE_MULTIREG_RET + +//---------------------------------------------------------------------------------- +// gtDispRegVal: Print the register(s) defined by the given node +// +// Arguments: +// tree - Gentree node whose registers we want to print +// void Compiler::gtDispRegVal(GenTree* tree) { switch (tree->GetRegTag()) { - // Don't display NOREG; the absence of this tag will imply this state - // case GenTree::GT_REGTAG_NONE: printf(" NOREG"); break; + // Don't display anything for the GT_REGTAG_NONE case; + // the absence of printed register values will imply this state. case GenTree::GT_REGTAG_REG: printf(" REG %s", compRegVarName(tree->GetRegNum())); break; default: - break; + return; } #if FEATURE_MULTIREG_RET - if (tree->OperIs(GT_CALL)) + if (tree->IsMultiRegNode()) { // 0th reg is GetRegNum(), which is already printed above. - // Print the remaining regs of a multi-reg call node. - // Note that, prior to the initialization of the ReturnTypeDesc we won't print - // any additional registers. - const GenTreeCall* call = tree->AsCall(); - const unsigned regCount = call->GetReturnTypeDesc()->TryGetReturnRegCount(); + // Print the remaining regs of a multi-reg node. + unsigned regCount = gtDispRegCount(tree); + + // For some nodes, e.g. COPY, RELOAD or CALL, we may not have valid regs for all positions. for (unsigned i = 1; i < regCount; ++i) { - printf(",%s", compRegVarName(call->GetRegNumByIdx(i))); - } - } - else if (tree->IsCopyOrReload()) - { - GenTree* op1 = tree->gtGetOp1(); - const GenTreeCopyOrReload* copyOrReload = tree->AsCopyOrReload(); - unsigned regCount = 0; - if (op1->OperIs(GT_CALL)) - { - regCount = op1->AsCall()->GetReturnTypeDesc()->TryGetReturnRegCount(); - // If it hasn't yet been initialized, we'd still like to see the registers printed. - if (regCount == 0) - { - regCount = MAX_RET_REG_COUNT; - } - } - else if (op1->IsMultiRegLclVar()) - { - regCount = op1->AsLclVar()->GetFieldCount(this); - } - else if (op1->IsMultiRegNode()) - { - regCount = op1->GetMultiRegCount(); - } - // We will only have valid regs for positions that require copy or reload. - // But we'd like to keep track of where they are so we print all positions. - for (unsigned i = 1; i < regCount; i++) - { - regNumber reg = tree->AsCopyOrReload()->GetRegNumByIdx(i); - printf(",%s", (reg == REG_NA) ? "NA" : compRegVarName(reg)); + regNumber reg = tree->GetRegByIndex(i); + printf(",%s", genIsValidReg(reg) ? compRegVarName(reg) : "NA"); } } #endif - -#if defined(TARGET_ARM) - if (tree->OperIsMultiRegOp() && (tree->AsMultiRegOp()->gtOtherReg != REG_NA)) - { - printf(",%s", compRegVarName(tree->AsMultiRegOp()->gtOtherReg)); - } -#endif } // We usually/commonly don't expect to print anything longer than this string, @@ -10717,13 +10926,14 @@ void Compiler::gtDispConst(GenTree* tree) if (tree->IsIconHandle(GTF_ICON_STR_HDL)) { const WCHAR* str = eeGetCPString(tree->AsIntCon()->gtIconVal); - if (str != nullptr) + // If *str points to a '\0' then don't print the string's values + if ((str != nullptr) && (*str != '\0')) { printf(" 0x%X \"%S\"", dspPtr(tree->AsIntCon()->gtIconVal), str); } - else + else // We can't print the value of the string { - // Note that eGetCPString isn't currently implemented on Linux/ARM + // Note that eeGetCPString isn't currently implemented on Linux/ARM // and instead always returns nullptr printf(" 0x%X [ICON_STR_HDL]", dspPtr(tree->AsIntCon()->gtIconVal)); } @@ -10789,11 +10999,11 @@ void Compiler::gtDispConst(GenTree* tree) case GTF_ICON_STR_HDL: unreached(); // This case is handled above break; - case GTF_ICON_PSTR_HDL: - printf(" pstr"); + case GTF_ICON_CONST_PTR: + printf(" const ptr"); break; - case GTF_ICON_PTR_HDL: - printf(" ptr"); + case GTF_ICON_GLOBAL_PTR: + printf(" global ptr"); break; case GTF_ICON_VARG_HDL: printf(" vararg"); @@ -10926,22 +11136,21 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) switch (tree->gtOper) { - unsigned varNum; - LclVarDsc* varDsc; case GT_LCL_FLD: case GT_LCL_FLD_ADDR: case GT_STORE_LCL_FLD: isLclFld = true; - __fallthrough; + FALLTHROUGH; case GT_PHI_ARG: case GT_LCL_VAR: case GT_LCL_VAR_ADDR: case GT_STORE_LCL_VAR: + { printf(" "); - varNum = tree->AsLclVarCommon()->GetLclNum(); - varDsc = &lvaTable[varNum]; + const unsigned varNum = tree->AsLclVarCommon()->GetLclNum(); + const LclVarDsc* varDsc = lvaGetDesc(varNum); gtDispLclVar(varNum); if (tree->AsLclVarCommon()->HasSsaName()) { @@ -10982,8 +11191,6 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) } else { - CORINFO_CLASS_HANDLE typeHnd = varDsc->lvVerTypeInfo.GetClassHandle(); - CORINFO_FIELD_HANDLE fldHnd; for (unsigned i = varDsc->lvFieldLclStart; i < varDsc->lvFieldLclStart + varDsc->lvFieldCnt; ++i) { @@ -10997,7 +11204,9 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) else #endif // !defined(TARGET_64BIT) { - fldHnd = info.compCompHnd->getFieldInClass(typeHnd, fieldVarDsc->lvFldOrdinal); + CORINFO_CLASS_HANDLE typeHnd = varDsc->GetStructHnd(); + CORINFO_FIELD_HANDLE fldHnd = + info.compCompHnd->getFieldInClass(typeHnd, fieldVarDsc->lvFldOrdinal); fieldName = eeGetFieldName(fldHnd); } @@ -11029,7 +11238,8 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) printf(" (last use)"); } } - break; + } + break; case GT_JMP: { @@ -11111,6 +11321,7 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack) case GT_JCMP: printf(" cond=%s%s", (tree->gtFlags & GTF_JCMP_TST) ? "TEST_" : "", (tree->gtFlags & GTF_JCMP_EQ) ? "EQ" : "NE"); + break; default: assert(!"don't know how to display tree leaf node"); @@ -11338,80 +11549,98 @@ void Compiler::gtDispTree(GenTree* tree, if (tree->gtOper == GT_INTRINSIC) { - switch (tree->AsIntrinsic()->gtIntrinsicId) + GenTreeIntrinsic* intrinsic = tree->AsIntrinsic(); + + if (intrinsic->gtIntrinsicId == CORINFO_INTRINSIC_Illegal) { - case CORINFO_INTRINSIC_Sin: - printf(" sin"); - break; - case CORINFO_INTRINSIC_Cos: - printf(" cos"); - break; - case CORINFO_INTRINSIC_Cbrt: - printf(" cbrt"); - break; - case CORINFO_INTRINSIC_Sqrt: - printf(" sqrt"); - break; - case CORINFO_INTRINSIC_Abs: - printf(" abs"); - break; - case CORINFO_INTRINSIC_Round: - printf(" round"); - break; - case CORINFO_INTRINSIC_Cosh: - printf(" cosh"); - break; - case CORINFO_INTRINSIC_Sinh: - printf(" sinh"); - break; - case CORINFO_INTRINSIC_Tan: - printf(" tan"); - break; - case CORINFO_INTRINSIC_Tanh: - printf(" tanh"); - break; - case CORINFO_INTRINSIC_Asin: - printf(" asin"); - break; - case CORINFO_INTRINSIC_Asinh: - printf(" asinh"); - break; - case CORINFO_INTRINSIC_Acos: - printf(" acos"); - break; - case CORINFO_INTRINSIC_Acosh: - printf(" acosh"); - break; - case CORINFO_INTRINSIC_Atan: - printf(" atan"); - break; - case CORINFO_INTRINSIC_Atan2: - printf(" atan2"); - break; - case CORINFO_INTRINSIC_Atanh: - printf(" atanh"); - break; - case CORINFO_INTRINSIC_Log10: - printf(" log10"); - break; - case CORINFO_INTRINSIC_Pow: - printf(" pow"); - break; - case CORINFO_INTRINSIC_Exp: - printf(" exp"); - break; - case CORINFO_INTRINSIC_Ceiling: - printf(" ceiling"); - break; - case CORINFO_INTRINSIC_Floor: - printf(" floor"); - break; - case CORINFO_INTRINSIC_Object_GetType: - printf(" objGetType"); - break; + // named intrinsic + assert(intrinsic->gtIntrinsicName != NI_Illegal); + switch (intrinsic->gtIntrinsicName) + { + case NI_System_Math_Sin: + printf(" sin"); + break; + case NI_System_Math_Cos: + printf(" cos"); + break; + case NI_System_Math_Cbrt: + printf(" cbrt"); + break; + case NI_System_Math_Sqrt: + printf(" sqrt"); + break; + case NI_System_Math_Abs: + printf(" abs"); + break; + case NI_System_Math_Round: + printf(" round"); + break; + case NI_System_Math_Cosh: + printf(" cosh"); + break; + case NI_System_Math_Sinh: + printf(" sinh"); + break; + case NI_System_Math_Tan: + printf(" tan"); + break; + case NI_System_Math_Tanh: + printf(" tanh"); + break; + case NI_System_Math_Asin: + printf(" asin"); + break; + case NI_System_Math_Asinh: + printf(" asinh"); + break; + case NI_System_Math_Acos: + printf(" acos"); + break; + case NI_System_Math_Acosh: + printf(" acosh"); + break; + case NI_System_Math_Atan: + printf(" atan"); + break; + case NI_System_Math_Atan2: + printf(" atan2"); + break; + case NI_System_Math_Atanh: + printf(" atanh"); + break; + case NI_System_Math_Log10: + printf(" log10"); + break; + case NI_System_Math_Pow: + printf(" pow"); + break; + case NI_System_Math_Exp: + printf(" exp"); + break; + case NI_System_Math_Ceiling: + printf(" ceiling"); + break; + case NI_System_Math_Floor: + printf(" floor"); + break; - default: - unreached(); + default: + unreached(); + } + } + else + { + // old style intrinsic + assert(intrinsic->gtIntrinsicName == NI_Illegal); + switch (intrinsic->gtIntrinsicId) + { + case CORINFO_INTRINSIC_Object_GetType: + printf(" objGetType"); + break; + + default: + unreached(); + } } } @@ -13027,7 +13256,7 @@ GenTree* Compiler::gtFoldExprSpecial(GenTree* tree) // unsigned (0 > x) is always false return NewMorphedIntConNode(0); } - __fallthrough; + FALLTHROUGH; case GT_EQ: case GT_NE: @@ -13611,16 +13840,13 @@ GenTree* Compiler::gtTryRemoveBoxUpstreamEffects(GenTree* op, BoxRemovalOptions // For struct types read the first byte of the // source struct; there's no need to read the // entire thing, and no place to put it. - assert(copySrc->gtOper == GT_OBJ || copySrc->gtOper == GT_IND || copySrc->gtOper == GT_FIELD); + assert(copySrc->OperIs(GT_OBJ, GT_IND, GT_FIELD)); copyStmt->SetRootNode(copySrc); if (options == BR_REMOVE_AND_NARROW || options == BR_REMOVE_AND_NARROW_WANT_TYPE_HANDLE) { JITDUMP(" to read first byte of struct via modified [%06u]\n", dspTreeID(copySrc)); - copySrc->ChangeOper(GT_NULLCHECK); - copySrc->gtType = TYP_BYTE; - compCurBB->bbFlags |= BBF_HAS_NULLCHECK; - optMethodFlags |= OMF_HAS_NULLCHECK; + gtChangeOperToNullCheck(copySrc, compCurBB); } else { @@ -14305,12 +14531,26 @@ GenTree* Compiler::gtFoldExprConst(GenTree* tree) /* String nodes are an RVA at this point */ - if (op1->gtOper == GT_CNS_STR || op2->gtOper == GT_CNS_STR) + if (op1->OperIs(GT_CNS_STR) || op2->OperIs(GT_CNS_STR)) { + // Fold "ldstr" ==/!= null + if (op2->IsIntegralConst(0)) + { + if (tree->OperIs(GT_EQ)) + { + i1 = 0; + goto FOLD_COND; + } + if (tree->OperIs(GT_NE) || (tree->OperIs(GT_GT) && tree->IsUnsigned())) + { + i1 = 1; + goto FOLD_COND; + } + } return tree; } - __fallthrough; + FALLTHROUGH; case TYP_BYREF: @@ -14357,6 +14597,7 @@ GenTree* Compiler::gtFoldExprConst(GenTree* tree) #endif goto DONE; } + break; default: break; @@ -15799,6 +16040,11 @@ void Compiler::gtExtractSideEffList(GenTree* expr, if (m_compiler->gtNodeHasSideEffects(node, m_flags)) { m_sideEffects.Push(node); + if (node->OperIsBlk() && !node->OperIsStoreBlk()) + { + JITDUMP("Replace an unused OBJ/BLK node [%06d] with a NULLCHECK\n", dspTreeID(node)); + m_compiler->gtChangeOperToNullCheck(node, m_compiler->compCurBB); + } return Compiler::WALK_SKIP_SUBTREES; } @@ -17227,8 +17473,8 @@ GenTree* Compiler::gtGetSIMDZero(var_types simdType, var_types baseType, CORINFO break; case TYP_UINT: assert(simdHandle == m_simdHandleCache->Vector64UIntHandle); - break; #endif // defined(TARGET_ARM64) && defined(FEATURE_HW_INTRINSICS) + break; default: break; } @@ -17422,8 +17668,11 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree) #endif break; case GT_LCL_VAR: - structHnd = lvaTable[tree->AsLclVarCommon()->GetLclNum()].lvVerTypeInfo.GetClassHandle(); + { + unsigned lclNum = tree->AsLclVarCommon()->GetLclNum(); + structHnd = lvaGetStruct(lclNum); break; + } case GT_RETURN: structHnd = gtGetStructHandleIfPresent(tree->AsOp()->gtOp1); break; @@ -17471,7 +17720,9 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleIfPresent(GenTree* tree) { CORINFO_FIELD_HANDLE fieldHnd = fieldSeq->m_fieldHnd; CorInfoType fieldCorType = info.compCompHnd->getFieldType(fieldHnd, &structHnd); - assert(fieldCorType == CORINFO_TYPE_VALUECLASS); + // With unsafe code and type casts + // this can return a primitive type and have nullptr for structHnd + // see runtime/issues/38541 } } } @@ -18289,7 +18540,7 @@ void GenTree::ParseArrayAddressWork(Compiler* comp, assert(!AsOp()->gtOp2->AsIntCon()->ImmedValNeedsReloc(comp)); // TODO-CrossBitness: we wouldn't need the cast below if GenTreeIntCon::gtIconVal had target_ssize_t // type. - target_ssize_t shiftVal = AsOp()->gtOp2->AsIntConCommon()->IconValue(); + target_ssize_t shiftVal = (target_ssize_t)AsOp()->gtOp2->AsIntConCommon()->IconValue(); target_ssize_t subMul = target_ssize_t{1} << shiftVal; AsOp()->gtOp1->ParseArrayAddressWork(comp, inputMul * subMul, pArr, pInxVN, pOffset, pFldSeq); return; @@ -18634,7 +18885,7 @@ bool GenTree::isCommutativeSIMDIntrinsic() } } -// Returns true for the SIMD Instrinsic instructions that have MemoryLoad semantics, false otherwise +// Returns true for the SIMD Intrinsic instructions that have MemoryLoad semantics, false otherwise bool GenTreeSIMD::OperIsMemoryLoad() const { if (gtSIMDIntrinsicID == SIMDIntrinsicInitArray) @@ -18856,7 +19107,7 @@ GenTreeHWIntrinsic* Compiler::gtNewScalarHWIntrinsicNode( GenTreeHWIntrinsic(type, gtNewArgList(op1, op2, op3), hwIntrinsicID, TYP_UNKNOWN, 0); } -// Returns true for the HW Instrinsic instructions that have MemoryLoad semantics, false otherwise +// Returns true for the HW Intrinsic instructions that have MemoryLoad semantics, false otherwise bool GenTreeHWIntrinsic::OperIsMemoryLoad() const { #if defined(TARGET_XARCH) || defined(TARGET_ARM64) @@ -18899,7 +19150,7 @@ bool GenTreeHWIntrinsic::OperIsMemoryLoad() const return false; } -// Returns true for the HW Instrinsic instructions that have MemoryStore semantics, false otherwise +// Returns true for the HW Intrinsic instructions that have MemoryStore semantics, false otherwise bool GenTreeHWIntrinsic::OperIsMemoryStore() const { #if defined(TARGET_XARCH) || defined(TARGET_ARM64) @@ -18935,7 +19186,7 @@ bool GenTreeHWIntrinsic::OperIsMemoryStore() const return false; } -// Returns true for the HW Instrinsic instructions that have MemoryLoad semantics, false otherwise +// Returns true for the HW Intrinsic instructions that have MemoryLoad semantics, false otherwise bool GenTreeHWIntrinsic::OperIsMemoryLoadOrStore() const { #if defined(TARGET_XARCH) || defined(TARGET_ARM64) @@ -19008,7 +19259,7 @@ void ReturnTypeDesc::InitializeStructReturnType(Compiler* comp, CORINFO_CLASS_HA { case Compiler::SPK_EnclosingType: m_isEnclosingType = true; - __fallthrough; + FALLTHROUGH; case Compiler::SPK_PrimitiveType: { diff --git a/src/coreclr/src/jit/gentree.h b/src/coreclr/src/jit/gentree.h index b6a95a1d3c7a..687a27134af1 100644 --- a/src/coreclr/src/jit/gentree.h +++ b/src/coreclr/src/jit/gentree.h @@ -32,8 +32,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // 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 // build to define DEBUGGABLE_GENTREE=1, as well as pass /OPT:NOICF to the linker (or else all the vtables get merged, -// making the debugging value supplied by them useless). See protojit.nativeproj for a commented example of setting the -// build flags correctly. +// making the debugging value supplied by them useless). #ifndef DEBUGGABLE_GENTREE #ifdef DEBUG #define DEBUGGABLE_GENTREE 1 @@ -815,6 +814,9 @@ struct GenTree #define GTF_VAR_ITERATOR 0x00800000 // GT_LCL_VAR -- this is a iterator reference in the loop condition #define GTF_VAR_CLONED 0x00400000 // GT_LCL_VAR -- this node has been cloned or is a clone #define GTF_VAR_CONTEXT 0x00200000 // GT_LCL_VAR -- this node is part of a runtime lookup +#define GTF_VAR_FOLDED_IND 0x00100000 // GT_LCL_VAR -- this node was folded from *(typ*)&lclVar expression tree in fgMorphSmpOp() +// where 'typ' is a small type and 'lclVar' corresponds to a normalized-on-store local variable. +// This flag identifies such nodes in order to make sure that fgDoNormalizeOnStore() is called on their parents in post-order morph. // Relevant for inlining optimizations (see fgInlinePrependStatements) @@ -901,11 +903,11 @@ struct GenTree #define GTF_ICON_FIELD_HDL 0x40000000 // GT_CNS_INT -- constant is a field handle #define GTF_ICON_STATIC_HDL 0x50000000 // GT_CNS_INT -- constant is a handle to static data #define GTF_ICON_STR_HDL 0x60000000 // GT_CNS_INT -- constant is a string handle -#define GTF_ICON_PSTR_HDL 0x70000000 // GT_CNS_INT -- constant is a ptr to a string handle -#define GTF_ICON_PTR_HDL 0x80000000 // GT_CNS_INT -- constant is a ldptr handle +#define GTF_ICON_CONST_PTR 0x70000000 // GT_CNS_INT -- constant is a pointer to immutable data, (e.g. IAT_PPVALUE) +#define GTF_ICON_GLOBAL_PTR 0x80000000 // GT_CNS_INT -- constant is a pointer to mutable data (e.g. from the VM state) #define GTF_ICON_VARG_HDL 0x90000000 // GT_CNS_INT -- constant is a var arg cookie handle #define GTF_ICON_PINVKI_HDL 0xA0000000 // GT_CNS_INT -- constant is a pinvoke calli handle -#define GTF_ICON_TOKEN_HDL 0xB0000000 // GT_CNS_INT -- constant is a token handle +#define GTF_ICON_TOKEN_HDL 0xB0000000 // GT_CNS_INT -- constant is a token handle (other than class, method or field) #define GTF_ICON_TLS_HDL 0xC0000000 // GT_CNS_INT -- constant is a TLS ref with offset #define GTF_ICON_FTN_ADDR 0xD0000000 // GT_CNS_INT -- constant is a function address #define GTF_ICON_CIDMID_HDL 0xE0000000 // GT_CNS_INT -- constant is a class ID or a module ID @@ -4201,6 +4203,7 @@ struct GenTreeCall final : public GenTree #define GTF_CALL_M_ALLOC_SIDE_EFFECTS 0x00400000 // GT_CALL -- this is a call to an allocator with side effects #define GTF_CALL_M_SUPPRESS_GC_TRANSITION 0x00800000 // GT_CALL -- suppress the GC transition (i.e. during a pinvoke) but a separate GC safe point is required. #define GTF_CALL_M_EXP_RUNTIME_LOOKUP 0x01000000 // GT_CALL -- this call needs to be tranformed into CFG for the dynamic dictionary expansion feature. +#define GTF_CALL_M_STRESS_TAILCALL 0x02000000 // GT_CALL -- the call is NOT "tail" prefixed but GTF_CALL_M_EXPLICIT_TAILCALL was added because of tail call stress mode // clang-format on @@ -4315,6 +4318,13 @@ struct GenTreeCall final : public GenTree return (gtCallMoreFlags & GTF_CALL_M_EXPLICIT_TAILCALL) != 0; } + // Returns true if this call didn't have an explicit tail. prefix in the IL + // but was marked as an explicit tail call because of tail call stress mode. + bool IsStressTailCall() const + { + return (gtCallMoreFlags & GTF_CALL_M_STRESS_TAILCALL) != 0; + } + // This method returning "true" implies that tail call flowgraph morhphing has // performed final checks and committed to making a tail call. bool IsTailCall() const @@ -4729,6 +4739,7 @@ struct GenTreeQmark : public GenTreeOp struct GenTreeIntrinsic : public GenTreeOp { CorInfoIntrinsics gtIntrinsicId; + NamedIntrinsic gtIntrinsicName; CORINFO_METHOD_HANDLE gtMethodHandle; // Method handle of the method which is treated as an intrinsic. #ifdef FEATURE_READYTORUN_COMPILER @@ -4736,15 +4747,31 @@ struct GenTreeIntrinsic : public GenTreeOp CORINFO_CONST_LOOKUP gtEntryPoint; #endif - GenTreeIntrinsic(var_types type, GenTree* op1, CorInfoIntrinsics intrinsicId, CORINFO_METHOD_HANDLE methodHandle) - : GenTreeOp(GT_INTRINSIC, type, op1, nullptr), gtIntrinsicId(intrinsicId), gtMethodHandle(methodHandle) + GenTreeIntrinsic(var_types type, + GenTree* op1, + CorInfoIntrinsics intrinsicId, + NamedIntrinsic intrinsicName, + CORINFO_METHOD_HANDLE methodHandle) + : GenTreeOp(GT_INTRINSIC, type, op1, nullptr) + , gtIntrinsicId(intrinsicId) + , gtIntrinsicName(intrinsicName) + , gtMethodHandle(methodHandle) { + assert(intrinsicId != CORINFO_INTRINSIC_Illegal || intrinsicName != NI_Illegal); } - GenTreeIntrinsic( - var_types type, GenTree* op1, GenTree* op2, CorInfoIntrinsics intrinsicId, CORINFO_METHOD_HANDLE methodHandle) - : GenTreeOp(GT_INTRINSIC, type, op1, op2), gtIntrinsicId(intrinsicId), gtMethodHandle(methodHandle) + GenTreeIntrinsic(var_types type, + GenTree* op1, + GenTree* op2, + CorInfoIntrinsics intrinsicId, + NamedIntrinsic intrinsicName, + CORINFO_METHOD_HANDLE methodHandle) + : GenTreeOp(GT_INTRINSIC, type, op1, op2) + , gtIntrinsicId(intrinsicId) + , gtIntrinsicName(intrinsicName) + , gtMethodHandle(methodHandle) { + assert(intrinsicId != CORINFO_INTRINSIC_Illegal || intrinsicName != NI_Illegal); } #if DEBUGGABLE_GENTREE @@ -4848,7 +4875,7 @@ struct GenTreeSIMD : public GenTreeJitIntrinsic gtSIMDIntrinsicID = simdIntrinsicID; } - bool OperIsMemoryLoad() const; // Returns true for the SIMD Instrinsic instructions that have MemoryLoad semantics, + bool OperIsMemoryLoad() const; // Returns true for the SIMD Intrinsic instructions that have MemoryLoad semantics, // false otherwise #if DEBUGGABLE_GENTREE @@ -4889,15 +4916,15 @@ struct GenTreeHWIntrinsic : public GenTreeJitIntrinsic } } - // Note that HW Instrinsic instructions are a sub class of GenTreeOp which only supports two operands - // However there are HW Instrinsic instructions that have 3 or even 4 operands and this is + // 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) - bool OperIsMemoryLoad() const; // Returns true for the HW Instrinsic instructions that have MemoryLoad semantics, + bool OperIsMemoryLoad() const; // Returns true for the HW Intrinsic instructions that have MemoryLoad semantics, // false otherwise - bool OperIsMemoryStore() const; // Returns true for the HW Instrinsic instructions that have MemoryStore semantics, + bool OperIsMemoryStore() const; // Returns true for the HW Intrinsic instructions that have MemoryStore semantics, // false otherwise - bool OperIsMemoryLoadOrStore() const; // Returns true for the HW Instrinsic instructions that have MemoryLoad or + bool OperIsMemoryLoadOrStore() const; // Returns true for the HW Intrinsic instructions that have MemoryLoad or // MemoryStore semantics, false otherwise #if DEBUGGABLE_GENTREE @@ -6020,13 +6047,13 @@ struct GenTreePutArgStk : public GenTreeUnOp #endif // !FEATURE_FASTTAILCALL - unsigned getArgOffset() + unsigned getArgOffset() const { return gtSlotNum * TARGET_POINTER_SIZE; } #if defined(UNIX_X86_ABI) - unsigned getArgPadding() + unsigned getArgPadding() const { return gtPadAlign; } @@ -6038,15 +6065,14 @@ struct GenTreePutArgStk : public GenTreeUnOp #endif #ifdef FEATURE_PUT_STRUCT_ARG_STK - - unsigned getArgSize() + unsigned getArgSize() const { return gtNumSlots * TARGET_POINTER_SIZE; } // Return true if this is a PutArgStk of a SIMD12 struct. // This is needed because such values are re-typed to SIMD16, and the type of PutArgStk is VOID. - unsigned isSIMD12() + unsigned isSIMD12() const { return (varTypeIsSIMD(gtOp1) && (gtNumSlots == 3)); } @@ -6061,7 +6087,7 @@ struct GenTreePutArgStk : public GenTreeUnOp }; Kind gtPutArgStkKind; - bool isPushKind() + bool isPushKind() const { return (gtPutArgStkKind == Kind::Push) || (gtPutArgStkKind == Kind::PushAllSlots); } @@ -6199,7 +6225,7 @@ struct GenTreePutArgSplit : public GenTreePutArgStk // Return Value: // var_type of the register specified by its index. - var_types GetRegType(unsigned index) + var_types GetRegType(unsigned index) const { assert(index < gtNumRegs); var_types result = m_regType[index]; @@ -6221,7 +6247,7 @@ struct GenTreePutArgSplit : public GenTreePutArgStk } #ifdef FEATURE_PUT_STRUCT_ARG_STK - unsigned getArgSize() + unsigned getArgSize() const { return (gtNumSlots + gtNumRegs) * TARGET_POINTER_SIZE; } diff --git a/src/coreclr/src/jit/gschecks.cpp b/src/coreclr/src/jit/gschecks.cpp index 4022724d36bc..9d841c571af3 100644 --- a/src/coreclr/src/jit/gschecks.cpp +++ b/src/coreclr/src/jit/gschecks.cpp @@ -381,50 +381,54 @@ void Compiler::gsParamsToShadows() continue; } - int shadowVar = lvaGrabTemp(false DEBUGARG("shadowVar")); + int shadowVarNum = lvaGrabTemp(false DEBUGARG("shadowVar")); // reload varDsc as lvaGrabTemp may realloc the lvaTable[] - varDsc = &lvaTable[lclNum]; + varDsc = &lvaTable[lclNum]; + LclVarDsc* shadowVarDsc = &lvaTable[shadowVarNum]; // Copy some info - var_types type = varTypeIsSmall(varDsc->TypeGet()) ? TYP_INT : varDsc->TypeGet(); - lvaTable[shadowVar].lvType = type; + var_types type = varTypeIsSmall(varDsc->TypeGet()) ? TYP_INT : varDsc->TypeGet(); + shadowVarDsc->lvType = type; #ifdef FEATURE_SIMD - lvaTable[shadowVar].lvSIMDType = varDsc->lvSIMDType; - lvaTable[shadowVar].lvUsedInSIMDIntrinsic = varDsc->lvUsedInSIMDIntrinsic; + shadowVarDsc->lvSIMDType = varDsc->lvSIMDType; + shadowVarDsc->lvUsedInSIMDIntrinsic = varDsc->lvUsedInSIMDIntrinsic; if (varDsc->lvSIMDType) { - lvaTable[shadowVar].lvExactSize = varDsc->lvExactSize; - lvaTable[shadowVar].lvBaseType = varDsc->lvBaseType; + shadowVarDsc->lvBaseType = varDsc->lvBaseType; } #endif - lvaTable[shadowVar].lvRegStruct = varDsc->lvRegStruct; + shadowVarDsc->lvRegStruct = varDsc->lvRegStruct; - lvaTable[shadowVar].lvAddrExposed = varDsc->lvAddrExposed; - lvaTable[shadowVar].lvDoNotEnregister = varDsc->lvDoNotEnregister; + shadowVarDsc->lvAddrExposed = varDsc->lvAddrExposed; + shadowVarDsc->lvDoNotEnregister = varDsc->lvDoNotEnregister; #ifdef DEBUG - lvaTable[shadowVar].lvVMNeedsStackAddr = varDsc->lvVMNeedsStackAddr; - lvaTable[shadowVar].lvLiveInOutOfHndlr = varDsc->lvLiveInOutOfHndlr; - lvaTable[shadowVar].lvLclFieldExpr = varDsc->lvLclFieldExpr; - lvaTable[shadowVar].lvLiveAcrossUCall = varDsc->lvLiveAcrossUCall; + shadowVarDsc->lvVMNeedsStackAddr = varDsc->lvVMNeedsStackAddr; + shadowVarDsc->lvLiveInOutOfHndlr = varDsc->lvLiveInOutOfHndlr; + shadowVarDsc->lvLclFieldExpr = varDsc->lvLclFieldExpr; + shadowVarDsc->lvLiveAcrossUCall = varDsc->lvLiveAcrossUCall; #endif - lvaTable[shadowVar].lvVerTypeInfo = varDsc->lvVerTypeInfo; + shadowVarDsc->lvVerTypeInfo = varDsc->lvVerTypeInfo; if (varTypeIsStruct(type)) { - lvaTable[shadowVar].SetLayout(varDsc->GetLayout()); + // We don't need unsafe value cls check here since we are copying the params and this flag + // would have been set on the original param before reaching here. + lvaSetStruct(shadowVarNum, varDsc->GetStructHnd(), false); + shadowVarDsc->lvIsMultiRegArg = varDsc->lvIsMultiRegArg; + shadowVarDsc->lvIsMultiRegRet = varDsc->lvIsMultiRegRet; } - lvaTable[shadowVar].lvIsUnsafeBuffer = varDsc->lvIsUnsafeBuffer; - lvaTable[shadowVar].lvIsPtr = varDsc->lvIsPtr; + shadowVarDsc->lvIsUnsafeBuffer = varDsc->lvIsUnsafeBuffer; + shadowVarDsc->lvIsPtr = varDsc->lvIsPtr; #ifdef DEBUG if (verbose) { - printf("Var V%02u is shadow param candidate. Shadow copy is V%02u.\n", lclNum, shadowVar); + printf("Var V%02u is shadow param candidate. Shadow copy is V%02u.\n", lclNum, shadowVarNum); } #endif - gsShadowVarInfo[lclNum].shadowCopy = shadowVar; + gsShadowVarInfo[lclNum].shadowCopy = shadowVarNum; } class ReplaceShadowParamsVisitor final : public GenTreeVisitor @@ -487,18 +491,19 @@ void Compiler::gsParamsToShadows() // Now insert code to copy the params to their shadow copy. for (UINT lclNum = 0; lclNum < lvaOldCount; lclNum++) { - LclVarDsc* varDsc = &lvaTable[lclNum]; + const LclVarDsc* varDsc = &lvaTable[lclNum]; - unsigned shadowVar = gsShadowVarInfo[lclNum].shadowCopy; - if (shadowVar == NO_SHADOW_COPY) + const unsigned shadowVarNum = gsShadowVarInfo[lclNum].shadowCopy; + if (shadowVarNum == NO_SHADOW_COPY) { continue; } - var_types type = lvaTable[shadowVar].TypeGet(); + const LclVarDsc* shadowVarDsc = &lvaTable[shadowVarNum]; + var_types type = shadowVarDsc->TypeGet(); GenTree* src = gtNewLclvNode(lclNum, varDsc->TypeGet()); - GenTree* dst = gtNewLclvNode(shadowVar, type); + GenTree* dst = gtNewLclvNode(shadowVarNum, type); src->gtFlags |= GTF_DONT_CSE; dst->gtFlags |= GTF_DONT_CSE; @@ -506,14 +511,9 @@ void Compiler::gsParamsToShadows() GenTree* opAssign = nullptr; if (type == TYP_STRUCT) { - // We don't need unsafe value cls check here since we are copying the params and this flag - // would have been set on the original param before reaching here. - lvaSetStruct(shadowVar, varDsc->lvVerTypeInfo.GetClassHandle(), false); - + assert(shadowVarDsc->GetLayout() != nullptr); + assert(shadowVarDsc->lvExactSize != 0); opAssign = gtNewBlkOpNode(dst, src, false, true); - - lvaTable[shadowVar].lvIsMultiRegArg = lvaTable[lclNum].lvIsMultiRegArg; - lvaTable[shadowVar].lvIsMultiRegRet = lvaTable[lclNum].lvIsMultiRegRet; } else { @@ -543,15 +543,17 @@ void Compiler::gsParamsToShadows() for (UINT lclNum = 0; lclNum < info.compArgsCount; lclNum++) { - LclVarDsc* varDsc = &lvaTable[lclNum]; + const LclVarDsc* varDsc = &lvaTable[lclNum]; - unsigned shadowVar = gsShadowVarInfo[lclNum].shadowCopy; - if (shadowVar == NO_SHADOW_COPY) + const unsigned shadowVarNum = gsShadowVarInfo[lclNum].shadowCopy; + if (shadowVarNum == NO_SHADOW_COPY) { continue; } - GenTree* src = gtNewLclvNode(shadowVar, lvaTable[shadowVar].TypeGet()); + const LclVarDsc* shadowVarDsc = &lvaTable[shadowVarNum]; + + GenTree* src = gtNewLclvNode(shadowVarNum, shadowVarDsc->TypeGet()); GenTree* dst = gtNewLclvNode(lclNum, varDsc->TypeGet()); src->gtFlags |= GTF_DONT_CSE; diff --git a/src/coreclr/src/jit/hwintrinsic.cpp b/src/coreclr/src/jit/hwintrinsic.cpp index 5e7eda61c30d..5723ac8f322b 100644 --- a/src/coreclr/src/jit/hwintrinsic.cpp +++ b/src/coreclr/src/jit/hwintrinsic.cpp @@ -202,7 +202,7 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleForHWSIMD(var_types simdType, va { int numArgs = HWIntrinsicInfo::lookupNumArgs(hwIntrinsicID); - // HW Instrinsic's with -1 for numArgs have a varying number of args, so we currently + // HW Intrinsic's with -1 for numArgs have a varying number of args, so we currently // give themm a unique value number them, and don't add an extra argument. // if (numArgs == -1) @@ -210,7 +210,7 @@ CORINFO_CLASS_HANDLE Compiler::gtGetStructHandleForHWSIMD(var_types simdType, va return false; } - // We iterate over all of the different baseType's for this instrinsic in the HWIntrinsicInfo table + // We iterate over all of the different baseType's for this intrinsic in the HWIntrinsicInfo table // We set diffInsCount to the number of instructions that can execute differently. // unsigned diffInsCount = 0; diff --git a/src/coreclr/src/jit/hwintrinsicarm64.cpp b/src/coreclr/src/jit/hwintrinsicarm64.cpp index c572f9bf0888..0d0021b0b8c6 100644 --- a/src/coreclr/src/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/src/jit/hwintrinsicarm64.cpp @@ -396,11 +396,10 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, for (unsigned i = 0; i < sig->numArgs; i++) { - tmp = gtNewArgList(impPopStack().val); - tmp->gtOp2 = op1; - op1 = tmp; + tmp = gtNewListNode(impPopStack().val, tmp); } + op1 = tmp; retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, baseType, simdSize); } break; diff --git a/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp index 162fd4588915..5b2fd24a5391 100644 --- a/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp @@ -204,17 +204,17 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) case 4: assert(intrin.op4 != nullptr); op4Reg = intrin.op4->GetRegNum(); - __fallthrough; + FALLTHROUGH; case 3: assert(intrin.op3 != nullptr); op3Reg = intrin.op3->GetRegNum(); - __fallthrough; + FALLTHROUGH; case 2: assert(intrin.op2 != nullptr); op2Reg = intrin.op2->GetRegNum(); - __fallthrough; + FALLTHROUGH; case 1: assert(intrin.op1 != nullptr); diff --git a/src/coreclr/src/jit/hwintrinsiccodegenxarch.cpp b/src/coreclr/src/jit/hwintrinsiccodegenxarch.cpp index 574e8c48d15f..ddca579f34ab 100644 --- a/src/coreclr/src/jit/hwintrinsiccodegenxarch.cpp +++ b/src/coreclr/src/jit/hwintrinsiccodegenxarch.cpp @@ -469,9 +469,11 @@ void CodeGen::genHWIntrinsic_R_RM( switch (addr->OperGet()) { case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: { + assert(addr->isContained()); varNum = addr->AsLclVarCommon()->GetLclNum(); - offset = 0; + offset = addr->AsLclVarCommon()->GetLclOffs(); break; } @@ -698,9 +700,11 @@ void CodeGen::genHWIntrinsic_R_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, switch (addr->OperGet()) { case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: { + assert(addr->isContained()); varNum = addr->AsLclVarCommon()->GetLclNum(); - offset = 0; + offset = addr->AsLclVarCommon()->GetLclOffs(); break; } @@ -861,9 +865,11 @@ void CodeGen::genHWIntrinsic_R_R_RM_R(GenTreeHWIntrinsic* node, instruction ins) switch (addr->OperGet()) { case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: { + assert(addr->isContained()); varNum = addr->AsLclVarCommon()->GetLclNum(); - offset = 0; + offset = addr->AsLclVarCommon()->GetLclOffs(); break; } @@ -986,9 +992,11 @@ void CodeGen::genHWIntrinsic_R_R_R_RM( switch (addr->OperGet()) { case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: { + assert(addr->isContained()); varNum = addr->AsLclVarCommon()->GetLclNum(); - offset = 0; + offset = addr->AsLclVarCommon()->GetLclOffs(); break; } diff --git a/src/coreclr/src/jit/hwintrinsicxarch.cpp b/src/coreclr/src/jit/hwintrinsicxarch.cpp index 8d7824ea189b..f6558fbb9670 100644 --- a/src/coreclr/src/jit/hwintrinsicxarch.cpp +++ b/src/coreclr/src/jit/hwintrinsicxarch.cpp @@ -405,11 +405,12 @@ bool HWIntrinsicInfo::isScalarIsa(CORINFO_InstructionSet isa) case InstructionSet_BMI2_X64: case InstructionSet_LZCNT: case InstructionSet_LZCNT_X64: - case InstructionSet_POPCNT: - case InstructionSet_POPCNT_X64: case InstructionSet_X86Base: case InstructionSet_X86Base_X64: { + // InstructionSet_POPCNT and InstructionSet_POPCNT_X64 are excluded + // even though they are "scalar" ISA because they depend on SSE4.2 + // and Popcnt.IsSupported implies Sse42.IsSupported return true; } @@ -550,7 +551,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, break; } - __fallthrough; + FALLTHROUGH; } case NI_Vector128_As: @@ -773,11 +774,10 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, for (unsigned i = 0; i < sig->numArgs; i++) { - tmp = gtNewArgList(impPopStack().val); - tmp->gtOp2 = op1; - op1 = tmp; + tmp = gtNewListNode(impPopStack().val, tmp); } + op1 = tmp; retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, baseType, simdSize); } break; @@ -968,7 +968,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, // Using software fallback if JIT/hardware don't support AVX instructions and YMM registers return nullptr; } - __fallthrough; + FALLTHROUGH; } case NI_Vector128_WithElement: @@ -1136,7 +1136,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, valueOp = gtNewSimdHWIntrinsicNode(TYP_SIMD16, valueOp, NI_Vector128_CreateScalarUnsafe, TYP_FLOAT, 16); immNode->AsIntCon()->SetIconValue(imm8 * 16); - __fallthrough; + FALLTHROUGH; } } @@ -1192,7 +1192,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, // Using software fallback if JIT/hardware don't support AVX instructions and YMM registers return nullptr; } - __fallthrough; + FALLTHROUGH; } case NI_Vector128_GetElement: @@ -1330,7 +1330,7 @@ GenTree* Compiler::impBaseIntrinsic(NamedIntrinsic intrinsic, NI_SSE_Shuffle, TYP_FLOAT, 16); return gtNewSimdHWIntrinsicNode(retType, vectorOp, NI_Vector128_ToScalar, TYP_FLOAT, 16); } - __fallthrough; + FALLTHROUGH; } case TYP_UBYTE: diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index e1443b849ad3..c408667db7c6 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -964,16 +964,6 @@ GenTreeCall::Use* Compiler::impPopCallArgs(unsigned count, CORINFO_SIG_INFO* sig if (corType != CORINFO_TYPE_CLASS && corType != CORINFO_TYPE_BYREF && corType != CORINFO_TYPE_PTR && corType != CORINFO_TYPE_VAR && (argRealClass = info.compCompHnd->getArgClass(sig, argLst)) != nullptr) { - // Everett MC++ could generate IL with a mismatched valuetypes. It used to work with Everett JIT, - // but it stopped working in Whidbey when we have started passing simple valuetypes as underlying - // primitive types. - // We will try to adjust for this case here to avoid breaking customers code (see VSW 485789 for - // details). - if (corType == CORINFO_TYPE_VALUECLASS && !varTypeIsStruct(arg->GetNode()->TypeGet())) - { - arg->SetNode(impNormStructVal(arg->GetNode(), argRealClass, (unsigned)CHECK_SPILL_ALL, true)); - } - // Make sure that all valuetypes (including enums) that we push are loaded. // This is to guarantee that if a GC is triggered from the prestub of this methods, // all valuetypes in the method signature are already loaded. @@ -1392,8 +1382,8 @@ GenTree* Compiler::impAssignStructPtr(GenTree* destAddr, } else if (asgType == TYP_STRUCT) { - asgType = impNormStructType(structHnd); - src->gtType = asgType; + // It should already have the appropriate type. + assert(asgType == impNormStructType(structHnd)); } if ((dest == nullptr) && (destAddr->OperGet() == GT_ADDR)) { @@ -1681,7 +1671,7 @@ GenTree* Compiler::impNormStructVal(GenTree* structVal, structLcl = structVal->AsLclVarCommon(); // Wrap it in a GT_OBJ. structVal = gtNewObjNode(structHnd, gtNewOperNode(GT_ADDR, TYP_BYREF, structVal)); - __fallthrough; + FALLTHROUGH; case GT_OBJ: case GT_BLK: @@ -2081,7 +2071,9 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken void* compileTimeHandle) { GenTree* ctxTree = getRuntimeContextTree(pLookup->lookupKind.runtimeLookupKind); - +#if 0 + ctxTree->gtFlags |= GTF_DONT_CSE; // ToDo Remove this +#endif CORINFO_RUNTIME_LOOKUP* pRuntimeLookup = &pLookup->runtimeLookup; // It's available only via the run-time helper function if (pRuntimeLookup->indirections == CORINFO_USEHELPER) @@ -2117,11 +2109,18 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken nullptr DEBUGARG("impRuntimeLookup indirectOffset")); } + // The last indirection could be subject to a size check (dynamic dictionary expansion) + bool isLastIndirectionWithSizeCheck = + ((i == pRuntimeLookup->indirections - 1) && (pRuntimeLookup->sizeOffset != CORINFO_NO_SIZE_CHECK)); + if (i != 0) { slotPtrTree = gtNewOperNode(GT_IND, TYP_I_IMPL, slotPtrTree); slotPtrTree->gtFlags |= GTF_IND_NONFAULTING; - slotPtrTree->gtFlags |= GTF_IND_INVARIANT; + if (!isLastIndirectionWithSizeCheck) + { + slotPtrTree->gtFlags |= GTF_IND_INVARIANT; + } } if ((i == 1 && pRuntimeLookup->indirectFirstOffset) || (i == 2 && pRuntimeLookup->indirectSecondOffset)) @@ -2131,8 +2130,7 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken if (pRuntimeLookup->offsets[i] != 0) { - // The last indirection could be subject to a size check (dynamic dictionary expansion) - if (i == pRuntimeLookup->indirections - 1 && pRuntimeLookup->sizeOffset != CORINFO_NO_SIZE_CHECK) + if (isLastIndirectionWithSizeCheck) { lastIndOfTree = impCloneExpr(slotPtrTree, &slotPtrTree, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL, nullptr DEBUGARG("impRuntimeLookup indirectOffset")); @@ -2195,8 +2193,9 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken GenTree* handleForNullCheck = gtNewOperNode(GT_IND, TYP_I_IMPL, slotPtrTree); handleForNullCheck->gtFlags |= GTF_IND_NONFAULTING; - // Call to helper - GenTree* argNode = gtNewIconEmbHndNode(pRuntimeLookup->signature, nullptr, GTF_ICON_TOKEN_HDL, compileTimeHandle); + // Call the helper + // - Setup argNode with the pointer to the signature returned by the lookup + GenTree* argNode = gtNewIconEmbHndNode(pRuntimeLookup->signature, nullptr, GTF_ICON_GLOBAL_PTR, compileTimeHandle); GenTreeCall::Use* helperArgs = gtNewCallArgs(ctxTree, argNode); GenTreeCall* helperCall = gtNewHelperCallNode(pRuntimeLookup->helper, TYP_I_IMPL, helperArgs); @@ -2217,6 +2216,7 @@ GenTree* Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken GenTreeIntCon* sizeOffset = gtNewIconNode(pRuntimeLookup->sizeOffset, TYP_I_IMPL); GenTree* sizeValueOffset = gtNewOperNode(GT_ADD, TYP_I_IMPL, lastIndOfTree, sizeOffset); GenTree* sizeValue = gtNewOperNode(GT_IND, TYP_I_IMPL, sizeValueOffset); + sizeValue->gtFlags |= GTF_IND_NONFAULTING; // sizeCheck fails if sizeValue < pRuntimeLookup->offsets[i] GenTree* offsetValue = gtNewIconNode(pRuntimeLookup->offsets[pRuntimeLookup->indirections - 1], TYP_I_IMPL); @@ -3433,7 +3433,8 @@ GenTree* Compiler::impInitializeArrayIntrinsic(CORINFO_SIG_INFO* sig) GenTree* dstAddr = gtNewOperNode(GT_ADD, TYP_BYREF, arrayLocalNode, gtNewIconNode(dataOffset, TYP_I_IMPL)); GenTree* dst = new (this, GT_BLK) GenTreeBlk(GT_BLK, TYP_STRUCT, dstAddr, typGetBlkLayout(blkSize)); - GenTree* src = gtNewIndOfIconHandleNode(TYP_STRUCT, (size_t)initData, GTF_ICON_STATIC_HDL, false); + GenTree* src = gtNewIndOfIconHandleNode(TYP_STRUCT, (size_t)initData, GTF_ICON_CONST_PTR, true); + #ifdef DEBUG src->gtGetOp1()->AsIntCon()->gtTargetHandle = THT_IntializeArrayIntrinsics; #endif @@ -3623,31 +3624,6 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, GenTree* op1; GenTree* op2; - case CORINFO_INTRINSIC_Sin: - case CORINFO_INTRINSIC_Cbrt: - case CORINFO_INTRINSIC_Sqrt: - case CORINFO_INTRINSIC_Abs: - case CORINFO_INTRINSIC_Cos: - case CORINFO_INTRINSIC_Round: - case CORINFO_INTRINSIC_Cosh: - case CORINFO_INTRINSIC_Sinh: - case CORINFO_INTRINSIC_Tan: - case CORINFO_INTRINSIC_Tanh: - case CORINFO_INTRINSIC_Asin: - case CORINFO_INTRINSIC_Asinh: - case CORINFO_INTRINSIC_Acos: - case CORINFO_INTRINSIC_Acosh: - case CORINFO_INTRINSIC_Atan: - case CORINFO_INTRINSIC_Atan2: - case CORINFO_INTRINSIC_Atanh: - case CORINFO_INTRINSIC_Log10: - case CORINFO_INTRINSIC_Pow: - case CORINFO_INTRINSIC_Exp: - case CORINFO_INTRINSIC_Ceiling: - case CORINFO_INTRINSIC_Floor: - retNode = impMathIntrinsic(method, sig, callType, intrinsicID, tailCall); - break; - #if defined(TARGET_XARCH) || defined(TARGET_ARM64) // TODO-ARM-CQ: reenable treating Interlocked operation as intrinsic @@ -3921,7 +3897,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, { JITDUMP("Expanding as special intrinsic\n"); impPopStack(); - op1 = new (this, GT_INTRINSIC) GenTreeIntrinsic(genActualType(callType), op1, intrinsicID, method); + op1 = new (this, GT_INTRINSIC) GenTreeIntrinsic(genActualType(callType), op1, intrinsicID, ni, method); // Set the CALL flag to indicate that the operator is implemented by a call. // Set also the EXCEPTION flag because the native implementation of @@ -4145,44 +4121,19 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, case NI_System_Type_IsAssignableFrom: { - // Optimize patterns like: - // - // typeof(TTo).IsAssignableFrom(typeof(TTFrom)) - // valueTypeVar.GetType().IsAssignableFrom(typeof(TTFrom)) - // - // to true/false GenTree* typeTo = impStackTop(1).val; GenTree* typeFrom = impStackTop(0).val; - if (typeTo->IsCall() && typeFrom->IsCall()) - { - // make sure both arguments are `typeof()` - CORINFO_METHOD_HANDLE hTypeof = eeFindHelper(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE); - if ((typeTo->AsCall()->gtCallMethHnd == hTypeof) && (typeFrom->AsCall()->gtCallMethHnd == hTypeof)) - { - CORINFO_CLASS_HANDLE hClassTo = - gtGetHelperArgClassHandle(typeTo->AsCall()->gtCallArgs->GetNode()); - CORINFO_CLASS_HANDLE hClassFrom = - gtGetHelperArgClassHandle(typeFrom->AsCall()->gtCallArgs->GetNode()); - - if (hClassTo == NO_CLASS_HANDLE || hClassFrom == NO_CLASS_HANDLE) - { - break; - } + retNode = impTypeIsAssignable(typeTo, typeFrom); + break; + } - TypeCompareState castResult = info.compCompHnd->compareTypesForCast(hClassFrom, hClassTo); - if (castResult == TypeCompareState::May) - { - // requires runtime check - // e.g. __Canon, COMObjects, Nullable - break; - } + case NI_System_Type_IsAssignableTo: + { + GenTree* typeTo = impStackTop(0).val; + GenTree* typeFrom = impStackTop(1).val; - retNode = gtNewIconNode((castResult == TypeCompareState::Must) ? 1 : 0); - impPopStack(); // drop both CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE calls - impPopStack(); - } - } + retNode = impTypeIsAssignable(typeTo, typeFrom); break; } @@ -4218,7 +4169,6 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, #ifdef FEATURE_HW_INTRINSICS case NI_System_Math_FusedMultiplyAdd: - case NI_System_MathF_FusedMultiplyAdd: { #ifdef TARGET_XARCH if (compExactlyDependsOn(InstructionSet_FMA) && supportSIMDTypes()) @@ -4227,9 +4177,9 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, // We are constructing a chain of intrinsics similar to: // return FMA.MultiplyAddScalar( - // Vector128.CreateScalar(x), - // Vector128.CreateScalar(y), - // Vector128.CreateScalar(z) + // Vector128.CreateScalarUnsafe(x), + // Vector128.CreateScalarUnsafe(y), + // Vector128.CreateScalarUnsafe(z) // ).ToScalar(); GenTree* op3 = gtNewSimdHWIntrinsicNode(TYP_SIMD16, impPopStack().val, @@ -4243,20 +4193,66 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, retNode = gtNewSimdHWIntrinsicNode(callType, res, NI_Vector128_ToScalar, callType, 16); } -#endif // TARGET_XARCH +#elif defined(TARGET_ARM64) + if (compExactlyDependsOn(InstructionSet_AdvSimd)) + { + assert(varTypeIsFloating(callType)); + + // We are constructing a chain of intrinsics similar to: + // return AdvSimd.FusedMultiplyAddScalar( + // Vector64.Create{ScalarUnsafe}(z), + // Vector64.Create{ScalarUnsafe}(y), + // Vector64.Create{ScalarUnsafe}(x) + // ).ToScalar(); + + NamedIntrinsic createVector64 = + (callType == TYP_DOUBLE) ? NI_Vector64_Create : NI_Vector64_CreateScalarUnsafe; + + constexpr unsigned int simdSize = 8; + + GenTree* op3 = + gtNewSimdHWIntrinsicNode(TYP_SIMD8, impPopStack().val, createVector64, callType, simdSize); + GenTree* op2 = + gtNewSimdHWIntrinsicNode(TYP_SIMD8, impPopStack().val, createVector64, callType, simdSize); + GenTree* op1 = + gtNewSimdHWIntrinsicNode(TYP_SIMD8, impPopStack().val, createVector64, callType, simdSize); + + // Note that AdvSimd.FusedMultiplyAddScalar(op1,op2,op3) corresponds to op1 + op2 * op3 + // while Math{F}.FusedMultiplyAddScalar(op1,op2,op3) corresponds to op1 * op2 + op3 + retNode = gtNewSimdHWIntrinsicNode(TYP_SIMD8, op3, op2, op1, NI_AdvSimd_FusedMultiplyAddScalar, + callType, simdSize); + + retNode = gtNewSimdHWIntrinsicNode(callType, retNode, NI_Vector64_ToScalar, callType, simdSize); + } +#endif break; } #endif // FEATURE_HW_INTRINSICS + case NI_System_Math_Sin: + case NI_System_Math_Cbrt: + case NI_System_Math_Sqrt: + case NI_System_Math_Abs: + case NI_System_Math_Cos: case NI_System_Math_Round: - case NI_System_MathF_Round: - { - // Math.Round and MathF.Round used to be a traditional JIT intrinsic. In order - // to simplify the transition, we will just treat it as if it was still the - // old intrinsic, CORINFO_INTRINSIC_Round. This should end up flowing properly - // everywhere else. - - retNode = impMathIntrinsic(method, sig, callType, CORINFO_INTRINSIC_Round, tailCall); + case NI_System_Math_Cosh: + case NI_System_Math_Sinh: + case NI_System_Math_Tan: + case NI_System_Math_Tanh: + case NI_System_Math_Asin: + case NI_System_Math_Asinh: + case NI_System_Math_Acos: + case NI_System_Math_Acosh: + case NI_System_Math_Atan: + case NI_System_Math_Atan2: + case NI_System_Math_Atanh: + case NI_System_Math_Log10: + case NI_System_Math_Pow: + case NI_System_Math_Exp: + case NI_System_Math_Ceiling: + case NI_System_Math_Floor: + { + retNode = impMathIntrinsic(method, sig, callType, ni, tailCall); break; } @@ -4307,6 +4303,27 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, break; } + // Fold PopCount for constant input + case NI_System_Numerics_BitOperations_PopCount: + { + assert(sig->numArgs == 1); + if (impStackTop().val->IsIntegralConst()) + { + typeInfo argType = verParseArgSigToTypeInfo(sig, sig->args).NormaliseForStack(); + ssize_t cns = impPopStack().val->AsIntConCommon()->IconValue(); + if (argType.IsType(TI_LONG)) + { + retNode = gtNewIconNode(genCountBits(cns), callType); + } + else + { + assert(argType.IsType(TI_INT)); + retNode = gtNewIconNode(genCountBits(static_cast(cns)), callType); + } + } + break; + } + case NI_System_GC_KeepAlive: { retNode = gtNewOperNode(GT_KEEPALIVE, TYP_VOID, impPopStack().val); @@ -4342,17 +4359,61 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, return retNode; } +GenTree* Compiler::impTypeIsAssignable(GenTree* typeTo, GenTree* typeFrom) +{ + // Optimize patterns like: + // + // typeof(TTo).IsAssignableFrom(typeof(TTFrom)) + // valueTypeVar.GetType().IsAssignableFrom(typeof(TTFrom)) + // typeof(TTFrom).IsAssignableTo(typeof(TTo)) + // typeof(TTFrom).IsAssignableTo(valueTypeVar.GetType()) + // + // to true/false + + if (typeTo->IsCall() && typeFrom->IsCall()) + { + // make sure both arguments are `typeof()` + CORINFO_METHOD_HANDLE hTypeof = eeFindHelper(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE); + if ((typeTo->AsCall()->gtCallMethHnd == hTypeof) && (typeFrom->AsCall()->gtCallMethHnd == hTypeof)) + { + CORINFO_CLASS_HANDLE hClassTo = gtGetHelperArgClassHandle(typeTo->AsCall()->gtCallArgs->GetNode()); + CORINFO_CLASS_HANDLE hClassFrom = gtGetHelperArgClassHandle(typeFrom->AsCall()->gtCallArgs->GetNode()); + + if (hClassTo == NO_CLASS_HANDLE || hClassFrom == NO_CLASS_HANDLE) + { + return nullptr; + } + + TypeCompareState castResult = info.compCompHnd->compareTypesForCast(hClassFrom, hClassTo); + if (castResult == TypeCompareState::May) + { + // requires runtime check + // e.g. __Canon, COMObjects, Nullable + return nullptr; + } + + GenTreeIntCon* retNode = gtNewIconNode((castResult == TypeCompareState::Must) ? 1 : 0); + impPopStack(); // drop both CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE calls + impPopStack(); + + return retNode; + } + } + + return nullptr; +} + GenTree* Compiler::impMathIntrinsic(CORINFO_METHOD_HANDLE method, CORINFO_SIG_INFO* sig, var_types callType, - CorInfoIntrinsics intrinsicID, + NamedIntrinsic intrinsicName, bool tailCall) { GenTree* op1; GenTree* op2; assert(callType != TYP_STRUCT); - assert(IsMathIntrinsic(intrinsicID)); + assert(IsMathIntrinsic(intrinsicName)); op1 = nullptr; @@ -4363,12 +4424,12 @@ GenTree* Compiler::impMathIntrinsic(CORINFO_METHOD_HANDLE method, // a) For back compatibility reasons on desktop .NET Framework 4.6 / 4.6.1 // b) It will be non-trivial task or too late to re-materialize a surviving // tail prefixed GT_INTRINSIC as tail call in rationalizer. - if (!IsIntrinsicImplementedByUserCall(intrinsicID) || !tailCall) + if (!IsIntrinsicImplementedByUserCall(intrinsicName) || !tailCall) #else // On x86 RyuJIT, importing intrinsics that are implemented as user calls can cause incorrect calculation // of the depth of the stack if these intrinsics are used as arguments to another call. This causes bad // code generation for certain EH constructs. - if (!IsIntrinsicImplementedByUserCall(intrinsicID)) + if (!IsIntrinsicImplementedByUserCall(intrinsicName)) #endif { switch (sig->numArgs) @@ -4383,7 +4444,8 @@ GenTree* Compiler::impMathIntrinsic(CORINFO_METHOD_HANDLE method, op1 = gtNewCastNode(callType, op1, false, callType); } - op1 = new (this, GT_INTRINSIC) GenTreeIntrinsic(genActualType(callType), op1, intrinsicID, method); + op1 = new (this, GT_INTRINSIC) + GenTreeIntrinsic(genActualType(callType), op1, CORINFO_INTRINSIC_Illegal, intrinsicName, method); break; case 2: @@ -4402,14 +4464,15 @@ GenTree* Compiler::impMathIntrinsic(CORINFO_METHOD_HANDLE method, op1 = gtNewCastNode(callType, op1, false, callType); } - op1 = new (this, GT_INTRINSIC) GenTreeIntrinsic(genActualType(callType), op1, op2, intrinsicID, method); + op1 = new (this, GT_INTRINSIC) GenTreeIntrinsic(genActualType(callType), op1, op2, + CORINFO_INTRINSIC_Illegal, intrinsicName, method); break; default: - NO_WAY("Unsupported number of args for Math Instrinsic"); + NO_WAY("Unsupported number of args for Math Intrinsic"); } - if (IsIntrinsicImplementedByUserCall(intrinsicID)) + if (IsIntrinsicImplementedByUserCall(intrinsicName)) { op1->gtFlags |= GTF_CALL; } @@ -4474,31 +4537,99 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) { result = NI_System_Enum_HasFlag; } - else if (strncmp(className, "Math", 4) == 0) + else if (strcmp(className, "Math") == 0 || strcmp(className, "MathF") == 0) { - className += 4; - - if (className[0] == '\0') + if (strcmp(methodName, "FusedMultiplyAdd") == 0) { - if (strcmp(methodName, "FusedMultiplyAdd") == 0) - { - result = NI_System_Math_FusedMultiplyAdd; - } - else if (strcmp(methodName, "Round") == 0) - { - result = NI_System_Math_Round; - } + result = NI_System_Math_FusedMultiplyAdd; } - else if (strcmp(className, "F") == 0) + else if (strcmp(methodName, "Round") == 0) { - if (strcmp(methodName, "FusedMultiplyAdd") == 0) - { - result = NI_System_MathF_FusedMultiplyAdd; - } - else if (strcmp(methodName, "Round") == 0) - { - result = NI_System_MathF_Round; - } + result = NI_System_Math_Round; + } + else if (strcmp(methodName, "Sin") == 0) + { + result = NI_System_Math_Sin; + } + else if (strcmp(methodName, "Cos") == 0) + { + result = NI_System_Math_Cos; + } + else if (strcmp(methodName, "Cbrt") == 0) + { + result = NI_System_Math_Cbrt; + } + else if (strcmp(methodName, "Sqrt") == 0) + { + result = NI_System_Math_Sqrt; + } + else if (strcmp(methodName, "Abs") == 0) + { + result = NI_System_Math_Abs; + } + else if (strcmp(methodName, "Cosh") == 0) + { + result = NI_System_Math_Cosh; + } + else if (strcmp(methodName, "Sinh") == 0) + { + result = NI_System_Math_Sinh; + } + else if (strcmp(methodName, "Tan") == 0) + { + result = NI_System_Math_Tan; + } + else if (strcmp(methodName, "Tanh") == 0) + { + result = NI_System_Math_Tanh; + } + else if (strcmp(methodName, "Asin") == 0) + { + result = NI_System_Math_Asin; + } + else if (strcmp(methodName, "Asinh") == 0) + { + result = NI_System_Math_Asinh; + } + else if (strcmp(methodName, "Acos") == 0) + { + result = NI_System_Math_Acos; + } + else if (strcmp(methodName, "Acosh") == 0) + { + result = NI_System_Math_Acosh; + } + else if (strcmp(methodName, "Atan") == 0) + { + result = NI_System_Math_Atan; + } + else if (strcmp(methodName, "Atan2") == 0) + { + result = NI_System_Math_Atan2; + } + else if (strcmp(methodName, "Atanh") == 0) + { + result = NI_System_Math_Atanh; + } + else if (strcmp(methodName, "Log10") == 0) + { + result = NI_System_Math_Log10; + } + else if (strcmp(methodName, "Pow") == 0) + { + result = NI_System_Math_Pow; + } + else if (strcmp(methodName, "Exp") == 0) + { + result = NI_System_Math_Exp; + } + else if (strcmp(methodName, "Ceiling") == 0) + { + result = NI_System_Math_Ceiling; + } + else if (strcmp(methodName, "Floor") == 0) + { + result = NI_System_Math_Floor; } } else if (strcmp(className, "GC") == 0) @@ -4518,6 +4649,10 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) { result = NI_System_Type_IsAssignableFrom; } + else if (strcmp(methodName, "IsAssignableTo") == 0) + { + result = NI_System_Type_IsAssignableTo; + } } } #if defined(TARGET_XARCH) || defined(TARGET_ARM64) @@ -4536,6 +4671,13 @@ NamedIntrinsic Compiler::lookupNamedIntrinsic(CORINFO_METHOD_HANDLE method) result = NI_System_Collections_Generic_EqualityComparer_get_Default; } } + else if ((strcmp(namespaceName, "System.Numerics") == 0) && (strcmp(className, "BitOperations") == 0)) + { + if (strcmp(methodName, "PopCount") == 0) + { + result = NI_System_Numerics_BitOperations_PopCount; + } + } #ifdef FEATURE_HW_INTRINSICS else if (strcmp(namespaceName, "System.Numerics") == 0) { @@ -4796,7 +4938,14 @@ GenTree* Compiler::impArrayAccessIntrinsic( if (intrinsicID != CORINFO_INTRINSIC_Array_Address) { - arrElem = gtNewOperNode(GT_IND, elemType, arrElem); + if (varTypeIsStruct(elemType)) + { + arrElem = gtNewObjNode(sig->retTypeClass, arrElem); + } + else + { + arrElem = gtNewOperNode(GT_IND, elemType, arrElem); + } } if (intrinsicID == CORINFO_INTRINSIC_Array_Set) @@ -5508,7 +5657,8 @@ void Compiler::verVerifyCall(OPCODE opcode, goto DONE_ARGS; } } - // fall thru to default checks + // fall thru to default checks + FALLTHROUGH; default: VerifyOrReturn(!(mflags & CORINFO_FLG_ABSTRACT), "method abstract"); } @@ -5907,16 +6057,8 @@ GenTree* Compiler::impImportLdvirtftn(GenTree* thisPtr, // CoreRT generic virtual method if ((pCallInfo->sig.sigInst.methInstCount != 0) && IsTargetAbi(CORINFO_CORERT_ABI)) { - GenTree* runtimeMethodHandle = nullptr; - if (pCallInfo->exactContextNeedsRuntimeLookup) - { - runtimeMethodHandle = - impRuntimeLookupToTree(pResolvedToken, &pCallInfo->codePointerLookup, pCallInfo->hMethod); - } - else - { - runtimeMethodHandle = gtNewIconEmbMethHndNode(pResolvedToken->hMethod); - } + GenTree* runtimeMethodHandle = + impLookupToTree(pResolvedToken, &pCallInfo->codePointerLookup, GTF_ICON_METHOD_HDL, pCallInfo->hMethod); return gtNewHelperCallNode(CORINFO_HELP_GVMLOOKUP_FOR_SLOT, TYP_I_IMPL, gtNewCallArgs(thisPtr, runtimeMethodHandle)); } @@ -7164,7 +7306,32 @@ GenTree* Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolvedT default: { - if (!(access & CORINFO_ACCESS_ADDRESS)) + // Do we need the address of a static field? + // + if (access & CORINFO_ACCESS_ADDRESS) + { + void** pFldAddr = nullptr; + void* fldAddr = info.compCompHnd->getFieldAddress(pResolvedToken->hField, (void**)&pFldAddr); + + // We should always be able to access this static's address directly + // + assert(pFldAddr == nullptr); + + FieldSeqNode* fldSeq = GetFieldSeqStore()->CreateSingleton(pResolvedToken->hField); + + /* Create the data member node */ + op1 = gtNewIconHandleNode(pFldAddr == nullptr ? (size_t)fldAddr : (size_t)pFldAddr, GTF_ICON_STATIC_HDL, + fldSeq); +#ifdef DEBUG + op1->AsIntCon()->gtTargetHandle = op1->AsIntCon()->gtIconVal; +#endif + + if (pFieldInfo->fieldFlags & CORINFO_FLG_FIELD_INITCLASS) + { + op1->gtFlags |= GTF_ICON_INITCLASS; + } + } + else // We need the value of a static field { // In future, it may be better to just create the right tree here instead of folding it later. op1 = gtNewFieldRef(lclTyp, pResolvedToken->hField); @@ -7197,38 +7364,7 @@ GenTree* Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolvedT return op1; } - else - { - void** pFldAddr = nullptr; - void* fldAddr = info.compCompHnd->getFieldAddress(pResolvedToken->hField, (void**)&pFldAddr); - - FieldSeqNode* fldSeq = GetFieldSeqStore()->CreateSingleton(pResolvedToken->hField); - - /* Create the data member node */ - op1 = gtNewIconHandleNode(pFldAddr == nullptr ? (size_t)fldAddr : (size_t)pFldAddr, GTF_ICON_STATIC_HDL, - fldSeq); -#ifdef DEBUG - op1->AsIntCon()->gtTargetHandle = op1->AsIntCon()->gtIconVal; -#endif - - if (pFieldInfo->fieldFlags & CORINFO_FLG_FIELD_INITCLASS) - { - op1->gtFlags |= GTF_ICON_INITCLASS; - } - - if (pFldAddr != nullptr) - { - // There are two cases here, either the static is RVA based, - // in which case the type of the FIELD node is not a GC type - // and the handle to the RVA is a TYP_I_IMPL. Or the FIELD node is - // a GC type and the handle to it is a TYP_BYREF in the GC heap - // because handles to statics now go into the large object heap - var_types handleTyp = (var_types)(varTypeIsGC(lclTyp) ? TYP_BYREF : TYP_I_IMPL); - op1 = gtNewOperNode(GT_IND, handleTyp, op1); - op1->gtFlags |= GTF_IND_INVARIANT | GTF_IND_NONFAULTING; - } - } break; } } @@ -7400,11 +7536,13 @@ enum PREFIX_TAILCALL_EXPLICIT = 0x00000001, // call has "tail" IL prefix PREFIX_TAILCALL_IMPLICIT = 0x00000010, // call is treated as having "tail" prefix even though there is no "tail" IL prefix - PREFIX_TAILCALL = (PREFIX_TAILCALL_EXPLICIT | PREFIX_TAILCALL_IMPLICIT), - PREFIX_VOLATILE = 0x00000100, - PREFIX_UNALIGNED = 0x00001000, - PREFIX_CONSTRAINED = 0x00010000, - PREFIX_READONLY = 0x00100000 + PREFIX_TAILCALL_STRESS = + 0x00000100, // call doesn't "tail" IL prefix but is treated as explicit because of tail call stress + PREFIX_TAILCALL = (PREFIX_TAILCALL_EXPLICIT | PREFIX_TAILCALL_IMPLICIT | PREFIX_TAILCALL_STRESS), + PREFIX_VOLATILE = 0x00001000, + PREFIX_UNALIGNED = 0x00010000, + PREFIX_CONSTRAINED = 0x00100000, + PREFIX_READONLY = 0x01000000 }; /******************************************************************************** @@ -7709,7 +7847,7 @@ var_types Compiler::impImportCall(OPCODE opcode, // If this is a call to JitTestLabel.Mark, do "early inlining", and record the test attribute. // This recognition should really be done by knowing the methHnd of the relevant Mark method(s). - // These should be in mscorlib.h, and available through a JIT/EE interface call. + // These should be in corelib.h, and available through a JIT/EE interface call. const char* modName; const char* className; const char* methodName; @@ -7944,9 +8082,9 @@ var_types Compiler::impImportCall(OPCODE opcode, // This is for a non-virtual, non-interface etc. call call = gtNewCallNode(CT_USER_FUNC, callInfo->hMethod, callRetTyp, nullptr, ilOffset); - // We remove the nullcheck for the GetType call instrinsic. + // We remove the nullcheck for the GetType call intrinsic. // TODO-CQ: JIT64 does not introduce the null check for many more helper calls - // and instrinsics. + // and intrinsics. if (callInfo->nullInstanceCheck && !((mflags & CORINFO_FLG_INTRINSIC) != 0 && (intrinsicID == CORINFO_INTRINSIC_Object_GetType))) { @@ -8548,6 +8686,7 @@ var_types Compiler::impImportCall(OPCODE opcode, { const bool isExplicitTailCall = (tailCallFlags & PREFIX_TAILCALL_EXPLICIT) != 0; const bool isImplicitTailCall = (tailCallFlags & PREFIX_TAILCALL_IMPLICIT) != 0; + const bool isStressTailCall = (tailCallFlags & PREFIX_TAILCALL_STRESS) != 0; // Exactly one of these should be true. assert(isExplicitTailCall != isImplicitTailCall); @@ -8614,6 +8753,12 @@ var_types Compiler::impImportCall(OPCODE opcode, // for in-lining. call->AsCall()->gtCallMoreFlags |= GTF_CALL_M_EXPLICIT_TAILCALL; JITDUMP("\nGTF_CALL_M_EXPLICIT_TAILCALL set for call [%06u]\n", dspTreeID(call)); + + if (isStressTailCall) + { + call->AsCall()->gtCallMoreFlags |= GTF_CALL_M_STRESS_TAILCALL; + JITDUMP("\nGTF_CALL_M_STRESS_TAILCALL set for call [%06u]\n", dspTreeID(call)); + } } else { @@ -10708,6 +10853,25 @@ GenTree* Compiler::impCastClassOrIsInstToTree(GenTree* op1, } while (0) #endif // DEBUG +//------------------------------------------------------------------------ +// impBlockIsInALoop: check if a block might be in a loop +// +// Arguments: +// block - block to check +// +// Returns: +// true if the block might be in a loop. +// +// Notes: +// Conservatively correct; may return true for some blocks that are +// not actually in loops. +// +bool Compiler::impBlockIsInALoop(BasicBlock* block) +{ + return (compIsForInlining() && ((impInlineInfo->iciBlock->bbFlags & BBF_BACKWARD_JUMP) != 0)) || + ((block->bbFlags & BBF_BACKWARD_JUMP) != 0); +} + #ifdef _PREFAST_ #pragma warning(push) #pragma warning(disable : 21000) // Suppress PREFast warning about overly large function @@ -13023,6 +13187,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) case CEE_CONV_OVF_U_UN: case CEE_CONV_U: isNative = true; + break; default: // leave 'isNative' = false; break; @@ -13188,10 +13353,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) // via an underlying address, just null check the address. if (op1->OperIs(GT_FIELD, GT_IND, GT_OBJ)) { - op1->ChangeOper(GT_NULLCHECK); - block->bbFlags |= BBF_HAS_NULLCHECK; - optMethodFlags |= OMF_HAS_NULLCHECK; - op1->gtType = TYP_BYTE; + gtChangeOperToNullCheck(op1, block); } else { @@ -13918,9 +14080,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) lvaSetStruct(lclNum, resolvedToken.hClass, true /* unsafe value cls check */); } - bool bbInALoop = - (compIsForInlining() && ((impInlineInfo->iciBlock->bbFlags & BBF_BACKWARD_JUMP) != 0)) || - ((block->bbFlags & BBF_BACKWARD_JUMP) != 0); + bool bbInALoop = impBlockIsInALoop(block); bool bbIsReturn = (block->bbJumpKind == BBJ_RETURN) && (!compIsForInlining() || (impInlineInfo->iciBlock->bbJumpKind == BBJ_RETURN)); LclVarDsc* const lclDsc = lvaGetDesc(lclNum); @@ -13995,7 +14155,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) } } - // fall through + FALLTHROUGH; case CEE_CALLVIRT: case CEE_CALL: @@ -14086,6 +14246,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) // Stress the tailcall. JITDUMP(" (Tailcall stress: prefixFlags |= PREFIX_TAILCALL_EXPLICIT)"); prefixFlags |= PREFIX_TAILCALL_EXPLICIT; + prefixFlags |= PREFIX_TAILCALL_STRESS; } else { @@ -14420,7 +14581,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) #else fieldInfo.fieldAccessor = CORINFO_FIELD_STATIC_ADDR_HELPER; - __fallthrough; + FALLTHROUGH; #endif case CORINFO_FIELD_STATIC_ADDR_HELPER: @@ -14448,6 +14609,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) info.compCompHnd->getFieldAddress(resolvedToken.hField, (void**)&pFldAddr); // We should always be able to access this static's address directly + // assert(pFldAddr == nullptr); op1 = impImportStaticReadOnlyField(fldAddr, lclTyp); @@ -14461,7 +14623,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) } } - __fallthrough; + FALLTHROUGH; case CORINFO_FIELD_STATIC_RVA_ADDRESS: case CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER: @@ -14726,7 +14888,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) #else fieldInfo.fieldAccessor = CORINFO_FIELD_STATIC_ADDR_HELPER; - __fallthrough; + FALLTHROUGH; #endif case CORINFO_FIELD_STATIC_ADDR_HELPER: @@ -15031,6 +15193,8 @@ void Compiler::impImportBlockCode(BasicBlock* block) { const ssize_t allocSize = op2->AsIntCon()->IconValue(); + bool bbInALoop = impBlockIsInALoop(block); + if (allocSize == 0) { // Result is nullptr @@ -15038,7 +15202,7 @@ void Compiler::impImportBlockCode(BasicBlock* block) op1 = gtNewIconNode(0, TYP_I_IMPL); convertedToLocal = true; } - else if ((allocSize > 0) && ((compCurBB->bbFlags & BBF_BACKWARD_JUMP) == 0)) + else if ((allocSize > 0) && !bbInALoop) { // Get the size threshold for local conversion ssize_t maxSize = DEFAULT_MAX_LOCALLOC_TO_LOCAL_SIZE; @@ -16231,11 +16395,18 @@ void Compiler::impImportBlockCode(BasicBlock* block) case 0xCC: OutputDebugStringA("CLR: Invalid x86 breakpoint in IL stream\n"); + FALLTHROUGH; case CEE_ILLEGAL: case CEE_MACRO_END: default: + if (compIsForInlining()) + { + compInlineResult->NoteFatal(InlineObservation::CALLEE_COMPILATION_ERROR); + return; + } + BADCODE3("unknown opcode", ": %02X", (int)opcode); } @@ -16745,7 +16916,7 @@ bool Compiler::impReturnInstruction(int prefixFlags, OPCODE& opcode) info.compCompHnd->getChildType(info.compMethodInfo->args.retTypeClass, &referentClassHandle); if (varTypeIsStruct(JITtype2varType(referentType)) && - (varDsc->lvVerTypeInfo.GetClassHandle() != referentClassHandle)) + (varDsc->GetStructHnd() != referentClassHandle)) { // We are returning a byref to struct1; the method signature specifies return type as // byref @@ -19014,7 +19185,7 @@ void Compiler::impInlineRecordArgInfo( // expression from some set of inlines. // - when argument type casting is needed the necessary casts are added // around the argument node. -// - if an argment can be simplified by folding then the node here is the +// - if an argument can be simplified by folding then the node here is the // folded value. // // The method may make observations that lead to marking this candidate as @@ -20072,10 +20243,10 @@ void Compiler::impMarkInlineCandidateHelper(GenTreeCall* call, // Returns true if the given intrinsic will be implemented by target-specific // instructions -bool Compiler::IsTargetIntrinsic(CorInfoIntrinsics intrinsicId) +bool Compiler::IsTargetIntrinsic(NamedIntrinsic intrinsicName) { #if defined(TARGET_XARCH) - switch (intrinsicId) + switch (intrinsicName) { // AMD64/x86 has SSE2 instructions to directly compute sqrt/abs and SSE4.1 // instructions to directly compute round/ceiling/floor. @@ -20086,37 +20257,37 @@ bool Compiler::IsTargetIntrinsic(CorInfoIntrinsics intrinsicId) // a CQ problem, it may be necessary to change the implementation of // the helper calls to decrease call overhead or switch back to the // x87 instructions. This is tracked by #7097. - case CORINFO_INTRINSIC_Sqrt: - case CORINFO_INTRINSIC_Abs: + case NI_System_Math_Sqrt: + case NI_System_Math_Abs: return true; - case CORINFO_INTRINSIC_Round: - case CORINFO_INTRINSIC_Ceiling: - case CORINFO_INTRINSIC_Floor: + case NI_System_Math_Round: + case NI_System_Math_Ceiling: + case NI_System_Math_Floor: return compOpportunisticallyDependsOn(InstructionSet_SSE41); default: return false; } #elif defined(TARGET_ARM64) - switch (intrinsicId) + switch (intrinsicName) { - case CORINFO_INTRINSIC_Sqrt: - case CORINFO_INTRINSIC_Abs: - case CORINFO_INTRINSIC_Round: - case CORINFO_INTRINSIC_Floor: - case CORINFO_INTRINSIC_Ceiling: + case NI_System_Math_Sqrt: + case NI_System_Math_Abs: + case NI_System_Math_Round: + case NI_System_Math_Floor: + case NI_System_Math_Ceiling: return true; default: return false; } #elif defined(TARGET_ARM) - switch (intrinsicId) + switch (intrinsicName) { - case CORINFO_INTRINSIC_Sqrt: - case CORINFO_INTRINSIC_Abs: - case CORINFO_INTRINSIC_Round: + case NI_System_Math_Sqrt: + case NI_System_Math_Abs: + case NI_System_Math_Round: return true; default: @@ -20134,41 +20305,41 @@ bool Compiler::IsTargetIntrinsic(CorInfoIntrinsics intrinsicId) // Returns true if the given intrinsic will be implemented by calling System.Math // methods. -bool Compiler::IsIntrinsicImplementedByUserCall(CorInfoIntrinsics intrinsicId) +bool Compiler::IsIntrinsicImplementedByUserCall(NamedIntrinsic intrinsicName) { // Currently, if a math intrinsic is not implemented by target-specific // instructions, it will be implemented by a System.Math call. In the // future, if we turn to implementing some of them with helper calls, // this predicate needs to be revisited. - return !IsTargetIntrinsic(intrinsicId); + return !IsTargetIntrinsic(intrinsicName); } -bool Compiler::IsMathIntrinsic(CorInfoIntrinsics intrinsicId) +bool Compiler::IsMathIntrinsic(NamedIntrinsic intrinsicName) { - switch (intrinsicId) - { - case CORINFO_INTRINSIC_Sin: - case CORINFO_INTRINSIC_Cbrt: - case CORINFO_INTRINSIC_Sqrt: - case CORINFO_INTRINSIC_Abs: - case CORINFO_INTRINSIC_Cos: - case CORINFO_INTRINSIC_Round: - case CORINFO_INTRINSIC_Cosh: - case CORINFO_INTRINSIC_Sinh: - case CORINFO_INTRINSIC_Tan: - case CORINFO_INTRINSIC_Tanh: - case CORINFO_INTRINSIC_Asin: - case CORINFO_INTRINSIC_Asinh: - case CORINFO_INTRINSIC_Acos: - case CORINFO_INTRINSIC_Acosh: - case CORINFO_INTRINSIC_Atan: - case CORINFO_INTRINSIC_Atan2: - case CORINFO_INTRINSIC_Atanh: - case CORINFO_INTRINSIC_Log10: - case CORINFO_INTRINSIC_Pow: - case CORINFO_INTRINSIC_Exp: - case CORINFO_INTRINSIC_Ceiling: - case CORINFO_INTRINSIC_Floor: + switch (intrinsicName) + { + case NI_System_Math_Sin: + case NI_System_Math_Cbrt: + case NI_System_Math_Sqrt: + case NI_System_Math_Abs: + case NI_System_Math_Cos: + case NI_System_Math_Round: + case NI_System_Math_Cosh: + case NI_System_Math_Sinh: + case NI_System_Math_Tan: + case NI_System_Math_Tanh: + case NI_System_Math_Asin: + case NI_System_Math_Asinh: + case NI_System_Math_Acos: + case NI_System_Math_Acosh: + case NI_System_Math_Atan: + case NI_System_Math_Atan2: + case NI_System_Math_Atanh: + case NI_System_Math_Log10: + case NI_System_Math_Pow: + case NI_System_Math_Exp: + case NI_System_Math_Ceiling: + case NI_System_Math_Floor: return true; default: return false; @@ -20177,7 +20348,7 @@ bool Compiler::IsMathIntrinsic(CorInfoIntrinsics intrinsicId) bool Compiler::IsMathIntrinsic(GenTree* tree) { - return (tree->OperGet() == GT_INTRINSIC) && IsMathIntrinsic(tree->AsIntrinsic()->gtIntrinsicId); + return (tree->OperGet() == GT_INTRINSIC) && IsMathIntrinsic(tree->AsIntrinsic()->gtIntrinsicName); } //------------------------------------------------------------------------ diff --git a/src/coreclr/src/jit/inline.cpp b/src/coreclr/src/jit/inline.cpp index 9b4d6f168614..759a6e366181 100644 --- a/src/coreclr/src/jit/inline.cpp +++ b/src/coreclr/src/jit/inline.cpp @@ -1624,7 +1624,7 @@ void InlineStrategy::DumpXml(FILE* file, unsigned indent) // Root context will be null if we're not optimizing the method. // - // Note there are cases of this in mscorlib even in release builds, + // Note there are cases of this in System.Private.CoreLib even in release builds, // eg Task.NotifyDebuggerOfWaitCompletion. // // For such methods there aren't any inlines. diff --git a/src/coreclr/src/jit/inline.h b/src/coreclr/src/jit/inline.h index 1019341de999..8302356c6e8f 100644 --- a/src/coreclr/src/jit/inline.h +++ b/src/coreclr/src/jit/inline.h @@ -27,7 +27,7 @@ // // Enums are used throughout to provide various descriptions. // -// There are 4 sitations where inline candidacy is evaluated. In each +// There are 4 situations where inline candidacy is evaluated. In each // case an InlineResult is allocated on the stack to collect // information about the inline candidate. Each InlineResult refers // to an InlinePolicy. @@ -614,6 +614,17 @@ struct InlineInfo GenTreeCall* iciCall; // The GT_CALL node to be inlined. Statement* iciStmt; // The statement iciCall is in. BasicBlock* iciBlock; // The basic block iciStmt is in. + + // Profile support + enum class ProfileScaleState + { + UNDETERMINED, + KNOWN, + UNAVAILABLE + }; + + ProfileScaleState profileScaleState; + double profileScaleFactor; }; // InlineContext tracks the inline history in a method. diff --git a/src/coreclr/src/jit/inlinepolicy.cpp b/src/coreclr/src/jit/inlinepolicy.cpp index 8852991cf200..cb113e646e82 100644 --- a/src/coreclr/src/jit/inlinepolicy.cpp +++ b/src/coreclr/src/jit/inlinepolicy.cpp @@ -1536,6 +1536,7 @@ void DiscretionaryPolicy::ComputeOpcodeBin(OPCODE opcode) case CEE_RET: m_ReturnCount++; + break; default: break; @@ -1700,7 +1701,7 @@ void DiscretionaryPolicy::MethodInfoObservations(CORINFO_METHOD_INFO* methodInfo // 0.100 * m_CalleeNativeSizeEstimate + // -0.100 * m_CallsiteNativeSizeEstimate // -// On the inlines in CoreCLR's mscorlib, release windows x64, this +// On the inlines in CoreCLR's CoreLib, release windows x64, this // yields scores of R=0.42, MSE=228, and MAE=7.25. // // This estimate can be improved slighly by refitting, resulting in diff --git a/src/coreclr/src/jit/instr.cpp b/src/coreclr/src/jit/instr.cpp index a13887baa0f6..0c6d91f52515 100644 --- a/src/coreclr/src/jit/instr.cpp +++ b/src/coreclr/src/jit/instr.cpp @@ -454,7 +454,7 @@ void CodeGen::inst_RV_RV_RV(instruction ins, * Generate a "op icon" instruction. */ -void CodeGen::inst_IV(instruction ins, int val) +void CodeGen::inst_IV(instruction ins, cnsval_ssize_t val) { GetEmitter()->emitIns_I(ins, EA_PTRSIZE, val); } @@ -465,7 +465,7 @@ void CodeGen::inst_IV(instruction ins, int val) * by 'flags' */ -void CodeGen::inst_IV_handle(instruction ins, int val) +void CodeGen::inst_IV_handle(instruction ins, cnsval_ssize_t val) { GetEmitter()->emitIns_I(ins, EA_HANDLE_CNS_RELOC, val); } @@ -478,7 +478,7 @@ void CodeGen::inst_IV_handle(instruction ins, int val) void CodeGen::inst_set_SV_var(GenTree* tree) { #ifdef DEBUG - assert(tree && (tree->gtOper == GT_LCL_VAR || tree->gtOper == GT_LCL_VAR_ADDR || tree->gtOper == GT_STORE_LCL_VAR)); + assert((tree != nullptr) && tree->OperIs(GT_LCL_VAR, GT_LCL_VAR_ADDR, GT_STORE_LCL_VAR)); assert(tree->AsLclVarCommon()->GetLclNum() < compiler->lvaCount); GetEmitter()->emitVarRefOffs = tree->AsLclVar()->gtLclILoffs; @@ -774,7 +774,7 @@ void CodeGen::inst_RV_TT(instruction ins, { case INS_mov: ins = ins_Load(tree->TypeGet()); - __fallthrough; + FALLTHROUGH; case INS_lea: case INS_ldr: @@ -1019,9 +1019,11 @@ void CodeGen::inst_RV_TT_IV(instruction ins, emitAttr attr, regNumber reg1, GenT switch (addr->OperGet()) { case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: { + assert(addr->isContained()); varNum = addr->AsLclVarCommon()->GetLclNum(); - offset = 0; + offset = addr->AsLclVarCommon()->GetLclOffs(); break; } @@ -1146,9 +1148,11 @@ void CodeGen::inst_RV_RV_TT( switch (addr->OperGet()) { case GT_LCL_VAR_ADDR: + case GT_LCL_FLD_ADDR: { + assert(addr->isContained()); varNum = addr->AsLclVarCommon()->GetLclNum(); - offset = 0; + offset = addr->AsLclVarCommon()->GetLclOffs(); break; } @@ -2227,8 +2231,10 @@ instruction CodeGen::ins_FloatConv(var_types to, var_types from) { case TYP_FLOAT: NYI("long to float"); + break; case TYP_DOUBLE: NYI("long to double"); + break; default: unreached(); } @@ -2242,6 +2248,7 @@ instruction CodeGen::ins_FloatConv(var_types to, var_types from) return INS_vcvt_f2u; case TYP_LONG: NYI("float to long"); + break; case TYP_DOUBLE: return INS_vcvt_f2d; case TYP_FLOAT: @@ -2259,6 +2266,7 @@ instruction CodeGen::ins_FloatConv(var_types to, var_types from) return INS_vcvt_d2u; case TYP_LONG: NYI("double to long"); + break; case TYP_FLOAT: return INS_vcvt_d2f; case TYP_DOUBLE: @@ -2270,6 +2278,7 @@ instruction CodeGen::ins_FloatConv(var_types to, var_types from) default: unreached(); } + unreached(); } #elif defined(TARGET_ARM64) diff --git a/src/coreclr/src/jit/instrsxarch.h b/src/coreclr/src/jit/instrsxarch.h index 60616c5177b5..c6a50690f702 100644 --- a/src/coreclr/src/jit/instrsxarch.h +++ b/src/coreclr/src/jit/instrsxarch.h @@ -594,6 +594,7 @@ INST3(blsr, "blsr", IUM_WR, BAD_CODE, BAD_CODE, INST3(bextr, "bextr", IUM_WR, BAD_CODE, BAD_CODE, SSE38(0xF7), INS_Flags_IsDstDstSrcAVXInstruction) // Bit Field Extract // BMI2 +INST3(rorx, "rorx", IUM_WR, BAD_CODE, BAD_CODE, SSE3A(0xF0), INS_FLAGS_None) INST3(pdep, "pdep", IUM_WR, BAD_CODE, BAD_CODE, SSE38(0xF5), INS_Flags_IsDstDstSrcAVXInstruction) // Parallel Bits Deposit INST3(pext, "pext", IUM_WR, BAD_CODE, BAD_CODE, SSE38(0xF5), INS_Flags_IsDstDstSrcAVXInstruction) // Parallel Bits Extract INST3(bzhi, "bzhi", IUM_WR, BAD_CODE, BAD_CODE, SSE38(0xF5), INS_Flags_IsDstDstSrcAVXInstruction) // Zero High Bits Starting with Specified Bit Position diff --git a/src/coreclr/src/jit/jit.h b/src/coreclr/src/jit/jit.h index 70296152db53..1c8a9e70d996 100644 --- a/src/coreclr/src/jit/jit.h +++ b/src/coreclr/src/jit/jit.h @@ -245,6 +245,23 @@ #define UNIX_AMD64_ABI_ONLY(x) #endif // defined(UNIX_AMD64_ABI) +#if defined(DEBUG) && !defined(OSX_ARM64_ABI) +// On all platforms except Arm64 OSX arguments on the stack are taking +// register size slots. On these platforms we could check that stack slots count +// matchs out new byte size calculations. +#define DEBUG_ARG_SLOTS +#endif + +#if defined(DEBUG_ARG_SLOTS) +#define DEBUG_ARG_SLOTS_ARG(x) , x +#define DEBUG_ARG_SLOTS_ONLY(x) x +#define DEBUG_ARG_SLOTS_ASSERT(x) assert(x) +#else +#define DEBUG_ARG_SLOTS_ARG(x) +#define DEBUG_ARG_SLOTS_ONLY(x) +#define DEBUG_ARG_SLOTS_ASSERT(x) +#endif + #if defined(UNIX_AMD64_ABI) || !defined(TARGET_64BIT) || defined(TARGET_ARM64) #define FEATURE_PUT_STRUCT_ARG_STK 1 #define PUT_STRUCT_ARG_STK_ONLY_ARG(x) , x diff --git a/src/coreclr/src/jit/jitconfigvalues.h b/src/coreclr/src/jit/jitconfigvalues.h index e6c1ab307e46..5d77d6a0affd 100644 --- a/src/coreclr/src/jit/jitconfigvalues.h +++ b/src/coreclr/src/jit/jitconfigvalues.h @@ -21,7 +21,9 @@ CONFIG_INTEGER(BreakOnDumpToken, W("BreakOnDumpToken"), 0xffffffff) // Breaks wh // particular token value. CONFIG_INTEGER(DebugBreakOnVerificationFailure, W("DebugBreakOnVerificationFailure"), 0) // Halts the jit on // verification failure -CONFIG_INTEGER(DiffableDasm, W("JitDiffableDasm"), 0) // Make the disassembly diff-able +CONFIG_INTEGER(DiffableDasm, W("JitDiffableDasm"), 0) // Make the disassembly diff-able +CONFIG_INTEGER(JitDasmWithAddress, W("JitDasmWithAddress"), 0) // Print the process address next to each instruction of + // the disassembly CONFIG_INTEGER(DisplayLoopHoistStats, W("JitLoopHoistStats"), 0) // Display JIT loop hoisting statistics CONFIG_INTEGER(DisplayLsraStats, W("JitLsraStats"), 0) // Display JIT Linear Scan Register Allocator statistics CONFIG_INTEGER(DumpJittedMethods, W("DumpJittedMethods"), 0) // Prints all jitted methods to the console @@ -99,6 +101,7 @@ CONFIG_INTEGER(JitPInvokeCheckEnabled, W("JITPInvokeCheckEnabled"), 0) CONFIG_INTEGER(JitPInvokeEnabled, W("JITPInvokeEnabled"), 1) 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) CONFIG_INTEGER(JitRoundFloat, W("JITRoundFloat"), DEFAULT_ROUND_LEVEL) CONFIG_INTEGER(JitStackAllocToLocalSize, W("JitStackAllocToLocalSize"), DEFAULT_MAX_LOCALLOC_TO_LOCAL_SIZE) @@ -140,6 +143,7 @@ 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_METHODSET(JitEHDump, W("JitEHDump")) // Dump the EH table for the method, as reported to the VM CONFIG_METHODSET(JitExclude, W("JitExclude")) @@ -285,6 +289,20 @@ CONFIG_INTEGER(JitDisableSimdVN, W("JitDisableSimdVN"), 0) // Default 0, ValueNu // If 3, disable both SIMD and HW Intrinsic nodes #endif // FEATURE_SIMD +// Default 0, enable the CSE of Constants, including nearby offsets. (only for ARM64) +// If 1, disable all the CSE of Constants +// If 2, enable the CSE of Constants but don't combine with nearby offsets. (only for ARM64) +// If 3, enable the CSE of Constants including nearby offsets. (all platforms) +// If 4, enable the CSE of Constants but don't combine with nearby offsets. (all platforms) +// +CONFIG_INTEGER(JitConstCSE, W("JitConstCSE"), 0) + +#define CONST_CSE_ENABLE_ARM64 0 +#define CONST_CSE_DISABLE_ALL 1 +#define CONST_CSE_ENABLE_ARM64_NO_SHARING 2 +#define CONST_CSE_ENABLE_ALL 3 +#define CONST_CSE_ENABLE_ALL_NO_SHARING 4 + /// /// JIT /// diff --git a/src/coreclr/src/jit/jitee.h b/src/coreclr/src/jit/jitee.h index a12f7f29329b..25ff8b835d5a 100644 --- a/src/coreclr/src/jit/jitee.h +++ b/src/coreclr/src/jit/jitee.h @@ -17,7 +17,7 @@ class JitFlags JIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode JIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info JIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necesarily debuggable code) - JIT_FLAG_GCPOLL_CALLS = 6, // Emit calls to JIT_POLLGC for thread suspension. + JIT_FLAG_UNUSED1 = 6, JIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete #if defined(TARGET_X86) @@ -29,11 +29,11 @@ class JitFlags #else // !defined(TARGET_X86) - JIT_FLAG_UNUSED1 = 8, - JIT_FLAG_UNUSED2 = 9, - JIT_FLAG_UNUSED3 = 10, - JIT_FLAG_UNUSED4 = 11, - JIT_FLAG_UNUSED5 = 12, + JIT_FLAG_UNUSED2 = 8, + JIT_FLAG_UNUSED3 = 9, + JIT_FLAG_UNUSED4 = 10, + JIT_FLAG_UNUSED5 = 11, + JIT_FLAG_UNUSED6 = 12, #endif // !defined(TARGET_X86) @@ -65,43 +65,43 @@ class JitFlags JIT_FLAG_FRAMED = 31, // All methods have an EBP frame JIT_FLAG_ALIGN_LOOPS = 32, // add NOPs before loops to align them at 16 byte boundaries JIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - JIT_FLAG_GCPOLL_INLINE = 34, // JIT must inline calls to GCPoll when possible + JIT_FLAG_UNUSED11 = 34, JIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background JIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions JIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - // JIT_FLAG_UNUSED = 38, + JIT_FLAG_UNUSED12 = 38, JIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible JIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code #if defined(TARGET_ARM) JIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records #else // !defined(TARGET_ARM) - JIT_FLAG_UNUSED11 = 41, + JIT_FLAG_UNUSED13 = 41, #endif // !defined(TARGET_ARM) JIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method - JIT_FLAG_UNUSED12 = 43, - JIT_FLAG_UNUSED13 = 44, - JIT_FLAG_UNUSED14 = 45, - JIT_FLAG_UNUSED15 = 46, - JIT_FLAG_UNUSED16 = 47, - JIT_FLAG_UNUSED17 = 48, - JIT_FLAG_UNUSED18 = 49, - JIT_FLAG_UNUSED19 = 50, - JIT_FLAG_UNUSED20 = 51, - JIT_FLAG_UNUSED21 = 52, - JIT_FLAG_UNUSED22 = 53, - JIT_FLAG_UNUSED23 = 54, - JIT_FLAG_UNUSED24 = 55, - JIT_FLAG_UNUSED25 = 56, - JIT_FLAG_UNUSED26 = 57, - JIT_FLAG_UNUSED27 = 58, - JIT_FLAG_UNUSED28 = 59, - JIT_FLAG_UNUSED29 = 60, - JIT_FLAG_UNUSED30 = 61, - JIT_FLAG_UNUSED31 = 62, - JIT_FLAG_UNUSED32 = 63 + JIT_FLAG_UNUSED14 = 43, + JIT_FLAG_UNUSED15 = 44, + JIT_FLAG_UNUSED16 = 45, + JIT_FLAG_UNUSED17 = 46, + JIT_FLAG_UNUSED18 = 47, + JIT_FLAG_UNUSED19 = 48, + JIT_FLAG_UNUSED20 = 49, + JIT_FLAG_UNUSED21 = 50, + JIT_FLAG_UNUSED22 = 51, + JIT_FLAG_UNUSED23 = 52, + JIT_FLAG_UNUSED24 = 53, + JIT_FLAG_UNUSED25 = 54, + JIT_FLAG_UNUSED26 = 55, + JIT_FLAG_UNUSED27 = 56, + JIT_FLAG_UNUSED28 = 57, + JIT_FLAG_UNUSED29 = 58, + JIT_FLAG_UNUSED30 = 59, + JIT_FLAG_UNUSED31 = 60, + JIT_FLAG_UNUSED32 = 61, + JIT_FLAG_UNUSED33 = 62, + JIT_FLAG_UNUSED34 = 63 }; // clang-format on @@ -169,7 +169,6 @@ class JitFlags FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_EnC, JIT_FLAG_DEBUG_EnC); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_INFO, JIT_FLAG_DEBUG_INFO); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MIN_OPT, JIT_FLAG_MIN_OPT); - FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_CALLS, JIT_FLAG_GCPOLL_CALLS); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MCJIT_BACKGROUND, JIT_FLAG_MCJIT_BACKGROUND); #if defined(TARGET_X86) @@ -203,7 +202,6 @@ class JitFlags FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_FRAMED, JIT_FLAG_FRAMED); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_ALIGN_LOOPS, JIT_FLAG_ALIGN_LOOPS); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PUBLISH_SECRET_PARAM, JIT_FLAG_PUBLISH_SECRET_PARAM); - FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_INLINE, JIT_FLAG_GCPOLL_INLINE); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_SAMPLING_JIT_BACKGROUND, JIT_FLAG_SAMPLING_JIT_BACKGROUND); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_USE_PINVOKE_HELPERS, JIT_FLAG_USE_PINVOKE_HELPERS); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_REVERSE_PINVOKE, JIT_FLAG_REVERSE_PINVOKE); diff --git a/src/coreclr/src/jit/jitgcinfo.h b/src/coreclr/src/jit/jitgcinfo.h index e9ef97c2a17e..83393bda9bbe 100644 --- a/src/coreclr/src/jit/jitgcinfo.h +++ b/src/coreclr/src/jit/jitgcinfo.h @@ -377,11 +377,11 @@ class GCInfo void gcFindPtrsInFrame(const void* infoBlock, const void* codeBlock, unsigned offs); #ifdef JIT32_GCENCODER - unsigned gcInfoBlockHdrDump(const BYTE* table, - InfoHdr* header, /* OUT */ - unsigned* methodSize); /* OUT */ + size_t gcInfoBlockHdrDump(const BYTE* table, + InfoHdr* header, /* OUT */ + unsigned* methodSize); /* OUT */ - unsigned gcDumpPtrTable(const BYTE* table, const InfoHdr& header, unsigned methodSize); + size_t gcDumpPtrTable(const BYTE* table, const InfoHdr& header, unsigned methodSize); #endif // JIT32_GCENCODER #endif // DUMP_GC_TABLES diff --git a/src/coreclr/src/jit/jithashtable.cpp b/src/coreclr/src/jit/jithashtable.cpp new file mode 100644 index 000000000000..cf9f22639efe --- /dev/null +++ b/src/coreclr/src/jit/jithashtable.cpp @@ -0,0 +1,53 @@ +// 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" + +#if defined(_MSC_VER) +#pragma hdrstop +#endif // defined(_MSC_VER) + +// Table of primes and their magic-number-divide constant. +// For more info see the book "Hacker's Delight" chapter 10.9 "Unsigned Division by Divisors >= 1" +// These were selected by looking for primes, each roughly twice as big as the next, having +// 32-bit magic numbers, (because the algorithm for using 33-bit magic numbers is slightly slower). + +#include "jithashtable.h" + +// Table of primes and their magic-number-divide constant. +// For more info see the book "Hacker's Delight" chapter 10.9 "Unsigned Division by Divisors >= 1" +// These were selected by looking for primes, each roughly twice as big as the next, having +// 32-bit magic numbers, (because the algorithm for using 33-bit magic numbers is slightly slower). + +// clang-format off +const JitPrimeInfo jitPrimeInfo[] +{ + JitPrimeInfo(9, 0x38e38e39, 1), + JitPrimeInfo(23, 0xb21642c9, 4), + JitPrimeInfo(59, 0x22b63cbf, 3), + JitPrimeInfo(131, 0xfa232cf3, 7), + JitPrimeInfo(239, 0x891ac73b, 7), + JitPrimeInfo(433, 0x975a751, 4), + JitPrimeInfo(761, 0x561e46a5, 8), + JitPrimeInfo(1399, 0xbb612aa3, 10), + JitPrimeInfo(2473, 0x6a009f01, 10), + JitPrimeInfo(4327, 0xf2555049, 12), + JitPrimeInfo(7499, 0x45ea155f, 11), + JitPrimeInfo(12973, 0x1434f6d3, 10), + JitPrimeInfo(22433, 0x2ebe18db, 12), + JitPrimeInfo(46559, 0xb42bebd5, 15), + JitPrimeInfo(96581, 0xadb61b1b, 16), + JitPrimeInfo(200341, 0x29df2461, 15), + JitPrimeInfo(415517, 0xa181c46d, 18), + JitPrimeInfo(861719, 0x4de0bde5, 18), + JitPrimeInfo(1787021, 0x9636c46f, 20), + JitPrimeInfo(3705617, 0x4870adc1, 20), + JitPrimeInfo(7684087, 0x8bbc5b83, 22), + JitPrimeInfo(15933877, 0x86c65361, 23), + JitPrimeInfo(33040633, 0x40fec79b, 23), + JitPrimeInfo(68513161, 0x7d605cd1, 25), + JitPrimeInfo(142069021, 0xf1da390b, 27), + JitPrimeInfo(294594427, 0x74a2507d, 27), + JitPrimeInfo(733045421, 0x5dbec447, 28), +}; +// clang-format on diff --git a/src/coreclr/src/jit/jithashtable.h b/src/coreclr/src/jit/jithashtable.h index cb2cc1e60d20..131f804a1127 100644 --- a/src/coreclr/src/jit/jithashtable.h +++ b/src/coreclr/src/jit/jithashtable.h @@ -91,38 +91,7 @@ class JitPrimeInfo // These were selected by looking for primes, each roughly twice as big as the next, having // 32-bit magic numbers, (because the algorithm for using 33-bit magic numbers is slightly slower). -// clang-format off -constexpr JitPrimeInfo jitPrimeInfo[] -{ - JitPrimeInfo(9, 0x38e38e39, 1), - JitPrimeInfo(23, 0xb21642c9, 4), - JitPrimeInfo(59, 0x22b63cbf, 3), - JitPrimeInfo(131, 0xfa232cf3, 7), - JitPrimeInfo(239, 0x891ac73b, 7), - JitPrimeInfo(433, 0x975a751, 4), - JitPrimeInfo(761, 0x561e46a5, 8), - JitPrimeInfo(1399, 0xbb612aa3, 10), - JitPrimeInfo(2473, 0x6a009f01, 10), - JitPrimeInfo(4327, 0xf2555049, 12), - JitPrimeInfo(7499, 0x45ea155f, 11), - JitPrimeInfo(12973, 0x1434f6d3, 10), - JitPrimeInfo(22433, 0x2ebe18db, 12), - JitPrimeInfo(46559, 0xb42bebd5, 15), - JitPrimeInfo(96581, 0xadb61b1b, 16), - JitPrimeInfo(200341, 0x29df2461, 15), - JitPrimeInfo(415517, 0xa181c46d, 18), - JitPrimeInfo(861719, 0x4de0bde5, 18), - JitPrimeInfo(1787021, 0x9636c46f, 20), - JitPrimeInfo(3705617, 0x4870adc1, 20), - JitPrimeInfo(7684087, 0x8bbc5b83, 22), - JitPrimeInfo(15933877, 0x86c65361, 23), - JitPrimeInfo(33040633, 0x40fec79b, 23), - JitPrimeInfo(68513161, 0x7d605cd1, 25), - JitPrimeInfo(142069021, 0xf1da390b, 27), - JitPrimeInfo(294594427, 0x74a2507d, 27), - JitPrimeInfo(733045421, 0x5dbec447, 28), -}; -// clang-format on +extern const JitPrimeInfo jitPrimeInfo[27]; // Hash table class definition diff --git a/src/coreclr/src/jit/layout.cpp b/src/coreclr/src/jit/layout.cpp index bafe17bb0b0a..6318b56e195a 100644 --- a/src/coreclr/src/jit/layout.cpp +++ b/src/coreclr/src/jit/layout.cpp @@ -428,12 +428,11 @@ ClassLayout* ClassLayout::GetPPPQuirkLayout(CompAllocator alloc) // static bool ClassLayout::AreCompatible(const ClassLayout* layout1, const ClassLayout* layout2) { + assert((layout1 != nullptr) && (layout2 != nullptr)); CORINFO_CLASS_HANDLE clsHnd1 = layout1->GetClassHandle(); CORINFO_CLASS_HANDLE clsHnd2 = layout2->GetClassHandle(); - assert(clsHnd1 != NO_CLASS_HANDLE); - assert(clsHnd2 != NO_CLASS_HANDLE); - if (clsHnd1 == clsHnd2) + if ((clsHnd1 != NO_CLASS_HANDLE) && (clsHnd1 == clsHnd2)) { return true; } @@ -453,7 +452,10 @@ bool ClassLayout::AreCompatible(const ClassLayout* layout1, const ClassLayout* l return true; } + assert(clsHnd1 != NO_CLASS_HANDLE); + assert(clsHnd2 != NO_CLASS_HANDLE); assert(layout1->HasGCPtr() && layout2->HasGCPtr()); + if (layout1->GetGCPtrCount() != layout2->GetGCPtrCount()) { return false; diff --git a/src/coreclr/src/jit/lclmorph.cpp b/src/coreclr/src/jit/lclmorph.cpp index 1df49356c6ae..811cfc038060 100644 --- a/src/coreclr/src/jit/lclmorph.cpp +++ b/src/coreclr/src/jit/lclmorph.cpp @@ -1021,7 +1021,8 @@ class LocalAddressVisitor final : public GenTreeVisitor // otherwise the below layout equality check would be insufficient. assert(varDsc->GetLayout() != nullptr); - if ((val.Offset() == 0) && (structLayout == varDsc->GetLayout())) + if ((val.Offset() == 0) && (structLayout != nullptr) && + ClassLayout::AreCompatible(structLayout, varDsc->GetLayout())) { indir->ChangeOper(GT_LCL_VAR); indir->AsLclVar()->SetLclNum(val.LclNum()); diff --git a/src/coreclr/src/jit/lclvars.cpp b/src/coreclr/src/jit/lclvars.cpp index 3cf7f4c14091..a97e81da2161 100644 --- a/src/coreclr/src/jit/lclvars.cpp +++ b/src/coreclr/src/jit/lclvars.cpp @@ -401,7 +401,7 @@ void Compiler::lvaInitArgs(InitVarDscInfo* varDscInfo) but it will be very difficult for fully interruptible code */ if (compArgSize != (size_t)(unsigned short)compArgSize) - NO_WAY("Too many arguments for the \"ret\" instruction to pop"); + IMPL_LIMITATION("Too many arguments for the \"ret\" instruction to pop"); #endif } @@ -1014,7 +1014,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo) #endif // TARGET_XXX #if FEATURE_FASTTAILCALL - varDsc->lvStkOffs = varDscInfo->stackArgSize; + varDsc->SetStackOffset(varDscInfo->stackArgSize); varDscInfo->stackArgSize += roundUp(argSize, TARGET_POINTER_SIZE); #endif // FEATURE_FASTTAILCALL } @@ -1027,13 +1027,14 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo) #else // !UNIX_AMD64_ABI compArgSize += argSize; #endif // !UNIX_AMD64_ABI - if (info.compIsVarArgs || isHfaArg || isSoftFPPreSpill) + if (info.compIsVarArgs || isSoftFPPreSpill) { #if defined(TARGET_X86) - varDsc->lvStkOffs = compArgSize; + varDsc->SetStackOffset(compArgSize); #else // !TARGET_X86 // TODO-CQ: We shouldn't have to go as far as to declare these // address-exposed -- DoNotEnregister should suffice. + lvaSetVarAddrExposed(varDscInfo->varNum); #endif // !TARGET_X86 } @@ -1046,6 +1047,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo) } } // for each user arg + compArgSize = roundUp(compArgSize, TARGET_POINTER_SIZE); #ifdef TARGET_ARM if (doubleAlignMask != RBM_NONE) @@ -1116,7 +1118,7 @@ void Compiler::lvaInitGenericsCtxt(InitVarDscInfo* varDscInfo) // returns false. varDsc->lvOnFrame = true; #if FEATURE_FASTTAILCALL - varDsc->lvStkOffs = varDscInfo->stackArgSize; + varDsc->SetStackOffset(varDscInfo->stackArgSize); varDscInfo->stackArgSize += TARGET_POINTER_SIZE; #endif // FEATURE_FASTTAILCALL } @@ -1125,7 +1127,7 @@ void Compiler::lvaInitGenericsCtxt(InitVarDscInfo* varDscInfo) #if defined(TARGET_X86) if (info.compIsVarArgs) - varDsc->lvStkOffs = compArgSize; + varDsc->SetStackOffset(compArgSize); #endif // TARGET_X86 varDscInfo->varNum++; @@ -1186,7 +1188,7 @@ void Compiler::lvaInitVarArgsHandle(InitVarDscInfo* varDscInfo) // returns false. varDsc->lvOnFrame = true; #if FEATURE_FASTTAILCALL - varDsc->lvStkOffs = varDscInfo->stackArgSize; + varDsc->SetStackOffset(varDscInfo->stackArgSize); varDscInfo->stackArgSize += TARGET_POINTER_SIZE; #endif // FEATURE_FASTTAILCALL } @@ -1199,7 +1201,7 @@ void Compiler::lvaInitVarArgsHandle(InitVarDscInfo* varDscInfo) varDscInfo->varDsc++; #if defined(TARGET_X86) - varDsc->lvStkOffs = compArgSize; + varDsc->SetStackOffset(compArgSize); // Allocate a temp to point at the beginning of the args @@ -1338,7 +1340,7 @@ void Compiler::lvaInitVarDsc(LclVarDsc* varDsc, #endif #ifdef DEBUG - varDsc->lvStkOffs = BAD_STK_OFFS; + varDsc->SetStackOffset(BAD_STK_OFFS); #endif #if FEATURE_MULTIREG_ARGS @@ -1496,13 +1498,13 @@ bool Compiler::lvaVarDoNotEnregister(unsigned varNum) CORINFO_CLASS_HANDLE Compiler::lvaGetStruct(unsigned varNum) { noway_assert(varNum < lvaCount); - LclVarDsc* varDsc = &lvaTable[varNum]; + const LclVarDsc* varDsc = lvaGetDesc(varNum); - return varDsc->lvVerTypeInfo.GetClassHandleForValueClass(); + return varDsc->GetStructHnd(); } //-------------------------------------------------------------------------------------------- -// lvaFieldOffsetCmp - a static compare function passed to qsort() by Compiler::StructPromotionHelper; +// lvaFieldOffsetCmp - a static compare function passed to jitstd::sort() by Compiler::StructPromotionHelper; // compares fields' offsets. // // Arguments: @@ -1512,19 +1514,9 @@ CORINFO_CLASS_HANDLE Compiler::lvaGetStruct(unsigned varNum) // Return value: // 0 if the fields' offsets are equal, 1 if the first field has bigger offset, -1 otherwise. // -int __cdecl Compiler::lvaFieldOffsetCmp(const void* field1, const void* field2) +bool Compiler::lvaFieldOffsetCmp::operator()(const lvaStructFieldInfo& field1, const lvaStructFieldInfo& field2) { - lvaStructFieldInfo* pFieldInfo1 = (lvaStructFieldInfo*)field1; - lvaStructFieldInfo* pFieldInfo2 = (lvaStructFieldInfo*)field2; - - if (pFieldInfo1->fldOffset == pFieldInfo2->fldOffset) - { - return 0; - } - else - { - return (pFieldInfo1->fldOffset > pFieldInfo2->fldOffset) ? +1 : -1; - } + return field1.fldOffset < field2.fldOffset; } //------------------------------------------------------------------------ @@ -1830,17 +1822,6 @@ bool Compiler::StructPromotionHelper::CanPromoteStructVar(unsigned lclNum) return false; } - // Explicitly check for HFA reg args and reject them for promotion here. - // Promoting HFA args will fire an assert in lvaAssignFrameOffsets - // when the HFA reg arg is struct promoted. - // - // TODO-PERF - Allow struct promotion for HFA register arguments - if (varDsc->lvIsHfaRegArg()) - { - JITDUMP(" struct promotion of V%02u is disabled because lvIsHfaRegArg()\n", lclNum); - return false; - } - if (!compiler->lvaEnregMultiRegVars && varDsc->lvIsMultiRegArgOrRet()) { JITDUMP(" struct promotion of V%02u is disabled because lvIsMultiRegArgOrRet()\n", lclNum); @@ -1854,24 +1835,61 @@ bool Compiler::StructPromotionHelper::CanPromoteStructVar(unsigned lclNum) return false; } - CORINFO_CLASS_HANDLE typeHnd = varDsc->lvVerTypeInfo.GetClassHandle(); - assert(typeHnd != nullptr); + CORINFO_CLASS_HANDLE typeHnd = varDsc->GetStructHnd(); + assert(typeHnd != NO_CLASS_HANDLE); bool canPromote = CanPromoteStructType(typeHnd); if (canPromote && varDsc->lvIsMultiRegArgOrRet()) { - if (structPromotionInfo.fieldCnt > MAX_MULTIREG_COUNT) + unsigned fieldCnt = structPromotionInfo.fieldCnt; + if (fieldCnt > MAX_MULTIREG_COUNT) { canPromote = false; } -#ifdef UNIX_AMD64_ABI +#if defined(FEATURE_SIMD) && defined(TARGET_ARMARCH) + else if (fieldCnt > 1) + { + // If we have a register-passed struct with mixed non-opaque SIMD types (i.e. with defined fields) + // and non-SIMD types, we don't currently handle that case in the prolog, so we can't promote. + for (unsigned i = 0; canPromote && (i < fieldCnt); i++) + { + if (varTypeIsStruct(structPromotionInfo.fields[i].fldType) && + !compiler->isOpaqueSIMDType(structPromotionInfo.fields[i].fldTypeHnd)) + { + canPromote = false; + } + } + } +#elif defined(UNIX_AMD64_ABI) else { SortStructFields(); - if ((structPromotionInfo.fieldCnt == 2) && (structPromotionInfo.fields[1].fldOffset != TARGET_POINTER_SIZE)) + // Only promote if the field types match the registers. + SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR structDesc; + compiler->eeGetSystemVAmd64PassStructInRegisterDescriptor(typeHnd, &structDesc); + unsigned regCount = structDesc.eightByteCount; + if (structPromotionInfo.fieldCnt != regCount) { canPromote = false; } + else + { + for (unsigned i = 0; canPromote && (i < regCount); i++) + { + lvaStructFieldInfo* fieldInfo = &(structPromotionInfo.fields[i]); + var_types fieldType = fieldInfo->fldType; + // We don't currently support passing SIMD types in registers. + if (varTypeIsSIMD(fieldType)) + { + canPromote = false; + } + else if (varTypeUsesFloatReg(fieldType) != + (structDesc.eightByteClassifications[i] == SystemVClassificationTypeSSE)) + { + canPromote = false; + } + } + } } #endif // UNIX_AMD64_ABI } @@ -1895,7 +1913,7 @@ bool Compiler::StructPromotionHelper::ShouldPromoteStructVar(unsigned lclNum) LclVarDsc* varDsc = &compiler->lvaTable[lclNum]; assert(varTypeIsStruct(varDsc)); - assert(varDsc->lvVerTypeInfo.GetClassHandle() == structPromotionInfo.typeHnd); + assert(varDsc->GetStructHnd() == structPromotionInfo.typeHnd); assert(structPromotionInfo.canPromote); bool shouldPromote = true; @@ -1946,7 +1964,7 @@ bool Compiler::StructPromotionHelper::ShouldPromoteStructVar(unsigned lclNum) shouldPromote = false; } #endif // TARGET_AMD64 || TARGET_ARM64 || TARGET_ARM - else if (varDsc->lvIsParam && !compiler->lvaIsImplicitByRefLocal(lclNum)) + else if (varDsc->lvIsParam && !compiler->lvaIsImplicitByRefLocal(lclNum) && !varDsc->lvIsHfa()) { #if FEATURE_MULTIREG_STRUCT_PROMOTE // Is this a variable holding a value with exactly two fields passed in @@ -2001,8 +2019,8 @@ void Compiler::StructPromotionHelper::SortStructFields() { if (!structPromotionInfo.fieldsSorted) { - qsort(structPromotionInfo.fields, structPromotionInfo.fieldCnt, sizeof(*structPromotionInfo.fields), - lvaFieldOffsetCmp); + jitstd::sort(structPromotionInfo.fields, structPromotionInfo.fields + structPromotionInfo.fieldCnt, + lvaFieldOffsetCmp()); structPromotionInfo.fieldsSorted = true; } } @@ -2166,7 +2184,7 @@ void Compiler::StructPromotionHelper::PromoteStructVar(unsigned lclNum) // We should never see a reg-sized non-field-addressed struct here. assert(!varDsc->lvRegStruct); - assert(varDsc->lvVerTypeInfo.GetClassHandle() == structPromotionInfo.typeHnd); + assert(varDsc->GetStructHnd() == structPromotionInfo.typeHnd); assert(structPromotionInfo.canPromote); varDsc->lvFieldCnt = structPromotionInfo.fieldCnt; @@ -2183,8 +2201,7 @@ void Compiler::StructPromotionHelper::PromoteStructVar(unsigned lclNum) #ifdef DEBUG if (compiler->verbose) { - printf("\nPromoting struct local V%02u (%s):", lclNum, - compiler->eeGetClassName(varDsc->lvVerTypeInfo.GetClassHandle())); + printf("\nPromoting struct local V%02u (%s):", lclNum, compiler->eeGetClassName(varDsc->GetStructHnd())); } #endif @@ -2249,25 +2266,49 @@ void Compiler::StructPromotionHelper::PromoteStructVar(unsigned lclNum) // Reset the implicitByRef flag. fieldVarDsc->lvIsImplicitByRef = 0; +#endif + +#if defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_ARM) + // Do we have a parameter that can be enregistered? // if (varDsc->lvIsRegArg) { fieldVarDsc->lvIsRegArg = true; - fieldVarDsc->SetArgReg(varDsc->GetArgReg()); -#if FEATURE_MULTIREG_ARGS && defined(FEATURE_SIMD) - if (varTypeIsSIMD(fieldVarDsc) && !compiler->lvaIsImplicitByRefLocal(lclNum)) + regNumber parentArgReg = varDsc->GetArgReg(); +#if FEATURE_MULTIREG_ARGS + if (!compiler->lvaIsImplicitByRefLocal(lclNum)) { - // This field is a SIMD type, and will be considered to be passed in multiple registers - // if the parent struct was. Note that this code relies on the fact that if there is - // a SIMD field of an enregisterable struct, it is the only field. - // We will assert that, in case future changes are made to the ABI. - assert(varDsc->lvFieldCnt == 1); - fieldVarDsc->SetOtherArgReg(varDsc->GetOtherArgReg()); +#ifdef UNIX_AMD64_ABI + if (varTypeIsSIMD(fieldVarDsc) && (varDsc->lvFieldCnt == 1)) + { + // This SIMD typed field may be passed in multiple registers. + fieldVarDsc->SetArgReg(parentArgReg); + fieldVarDsc->SetOtherArgReg(varDsc->GetOtherArgReg()); + } + else +#endif // UNIX_AMD64_ABI + { + // TODO: Need to determine if/how to handle split args. + // TODO: Assert that regs are always sequential. + unsigned regIncrement = fieldVarDsc->lvFldOrdinal; +#ifdef TARGET_ARM + if (varDsc->lvIsHfa() && (varDsc->GetHfaType() == TYP_DOUBLE)) + { + regIncrement = (fieldVarDsc->lvFldOrdinal * 2); + } +#endif // TARGET_ARM + regNumber fieldRegNum = (regNumber)(parentArgReg + regIncrement); + fieldVarDsc->SetArgReg(fieldRegNum); + } } + else #endif // FEATURE_MULTIREG_ARGS && defined(FEATURE_SIMD) + { + fieldVarDsc->SetArgReg(parentArgReg); + } } -#endif +#endif // defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_ARM) #ifdef FEATURE_SIMD if (varTypeIsSIMD(pFieldInfo->fldType)) @@ -2568,7 +2609,7 @@ bool Compiler::lvaIsMultiregStruct(LclVarDsc* varDsc, bool isVarArg) { if (varTypeIsStruct(varDsc->TypeGet())) { - CORINFO_CLASS_HANDLE clsHnd = varDsc->lvVerTypeInfo.GetClassHandleForValueClass(); + CORINFO_CLASS_HANDLE clsHnd = varDsc->GetStructHnd(); structPassingKind howToPassStruct; var_types type = getArgTypeForStruct(clsHnd, &howToPassStruct, isVarArg, varDsc->lvExactSize); @@ -2608,11 +2649,14 @@ void Compiler::lvaSetStruct(unsigned varNum, CORINFO_CLASS_HANDLE typeHnd, bool { varDsc->lvType = TYP_STRUCT; } - if (varDsc->lvExactSize == 0) + if (varDsc->GetLayout() == nullptr) { ClassLayout* layout = typGetObjLayout(typeHnd); varDsc->SetLayout(layout); + + assert(varDsc->lvExactSize == 0); varDsc->lvExactSize = layout->GetSize(); + assert(varDsc->lvExactSize != 0); if (layout->IsValueClass()) { @@ -2668,6 +2712,11 @@ void Compiler::lvaSetStruct(unsigned varNum, CORINFO_CLASS_HANDLE typeHnd, bool #if FEATURE_SIMD assert(!varTypeIsSIMD(varDsc) || (varDsc->lvBaseType != TYP_UNKNOWN)); #endif // FEATURE_SIMD + ClassLayout* layout = typGetObjLayout(typeHnd); + assert(ClassLayout::AreCompatible(varDsc->GetLayout(), layout)); + // Inlining could replace a canon struct type with an exact one. + varDsc->SetLayout(layout); + assert(varDsc->lvExactSize != 0); } #ifndef TARGET_64BIT @@ -2801,7 +2850,7 @@ void Compiler::lvaSetClass(unsigned varNum, CORINFO_CLASS_HANDLE clsHnd, bool is assert(varDsc->lvType == TYP_REF); // We shoud not have any ref type information for this var. - assert(varDsc->lvClassHnd == nullptr); + assert(varDsc->lvClassHnd == NO_CLASS_HANDLE); assert(!varDsc->lvClassIsExact); JITDUMP("\nlvaSetClass: setting class for V%02i to (%p) %s %s\n", varNum, dspPtr(clsHnd), @@ -2886,7 +2935,7 @@ void Compiler::lvaUpdateClass(unsigned varNum, CORINFO_CLASS_HANDLE clsHnd, bool assert(varDsc->lvType == TYP_REF); // We should already have a class - assert(varDsc->lvClassHnd != nullptr); + assert(varDsc->lvClassHnd != NO_CLASS_HANDLE); // We should only be updating classes for single-def locals. assert(varDsc->lvSingleDef); @@ -2995,9 +3044,6 @@ unsigned Compiler::lvaLclSize(unsigned varNum) assert(!"Unknown size"); NO_WAY("Target doesn't support TYP_LCLBLK"); - // Keep prefast happy - __fallthrough; - #endif // FEATURE_FIXED_OUT_ARGS default: // This must be a primitive var. Fall out of switch statement @@ -3041,9 +3087,6 @@ unsigned Compiler::lvaLclExactSize(unsigned varNum) assert(!"Unknown size"); NO_WAY("Target doesn't support TYP_LCLBLK"); - // Keep prefast happy - __fallthrough; - #endif // FEATURE_FIXED_OUT_ARGS default: // This must be a primitive var. Fall out of switch statement @@ -3480,7 +3523,7 @@ void Compiler::lvaSortByRefCount() noway_assert(!"lvType not set correctly"); varDsc->lvType = TYP_INT; - __fallthrough; + FALLTHROUGH; default: varDsc->lvTracked = 0; @@ -3789,7 +3832,7 @@ void Compiler::lvaMarkLclRefs(GenTree* tree, BasicBlock* block, Statement* stmt, } // Not 0 or 1, fall through .... - __fallthrough; + FALLTHROUGH; default: @@ -4964,13 +5007,13 @@ void Compiler::lvaFixVirtualFrameOffsets() varDsc = &lvaTable[lvaPSPSym]; assert(varDsc->lvFramePointerBased); // We always access it RBP-relative. assert(!varDsc->lvMustInit); // It is never "must init". - varDsc->lvStkOffs = codeGen->genCallerSPtoInitialSPdelta() + lvaLclSize(lvaOutgoingArgSpaceVar); + varDsc->SetStackOffset(codeGen->genCallerSPtoInitialSPdelta() + lvaLclSize(lvaOutgoingArgSpaceVar)); // With OSR the new frame RBP points at the base of the new frame, but the virtual offsets // are from the base of the old frame. Adjust. if (opts.IsOSR()) { - varDsc->lvStkOffs -= info.compPatchpointInfo->FpToSpDelta(); + varDsc->SetStackOffset(varDsc->GetStackOffset() - info.compPatchpointInfo->FpToSpDelta()); } } #endif @@ -5062,29 +5105,30 @@ void Compiler::lvaFixVirtualFrameOffsets() if (doAssignStkOffs) { - JITDUMP("-- V%02u was %d, now %d\n", lclNum, varDsc->lvStkOffs, varDsc->lvStkOffs + delta); - varDsc->lvStkOffs += delta; + JITDUMP("-- V%02u was %d, now %d\n", lclNum, varDsc->GetStackOffset(), varDsc->GetStackOffset() + delta); + varDsc->SetStackOffset(varDsc->GetStackOffset() + delta); #if DOUBLE_ALIGN if (genDoubleAlign() && !codeGen->isFramePointerUsed()) { if (varDsc->lvFramePointerBased) { - varDsc->lvStkOffs -= delta; + varDsc->SetStackOffset(varDsc->GetStackOffset() - delta); // We need to re-adjust the offsets of the parameters so they are EBP // relative rather than stack/frame pointer relative - varDsc->lvStkOffs += (2 * TARGET_POINTER_SIZE); // return address and pushed EBP + varDsc->SetStackOffset(varDsc->GetStackOffset() + + (2 * TARGET_POINTER_SIZE)); // return address and pushed EBP - noway_assert(varDsc->lvStkOffs >= FIRST_ARG_STACK_OFFS); + noway_assert(varDsc->GetStackOffset() >= FIRST_ARG_STACK_OFFS); } } #endif // On System V environments the stkOffs could be 0 for params passed in registers. // // For normal methods only EBP relative references can have negative offsets. - assert(codeGen->isFramePointerUsed() || varDsc->lvStkOffs >= 0); + assert(codeGen->isFramePointerUsed() || varDsc->GetStackOffset() >= 0); } } @@ -5100,8 +5144,8 @@ void Compiler::lvaFixVirtualFrameOffsets() if (lvaOutgoingArgSpaceVar != BAD_VAR_NUM) { - varDsc = &lvaTable[lvaOutgoingArgSpaceVar]; - varDsc->lvStkOffs = 0; + varDsc = &lvaTable[lvaOutgoingArgSpaceVar]; + varDsc->SetStackOffset(0); varDsc->lvFramePointerBased = false; varDsc->lvMustInit = false; } @@ -5118,7 +5162,7 @@ void Compiler::lvaFixVirtualFrameOffsets() assert(codeGen->isFramePointerUsed()); if (lvaRetAddrVar != BAD_VAR_NUM) { - lvaTable[lvaRetAddrVar].lvStkOffs = REGSIZE_BYTES; + lvaTable[lvaRetAddrVar].SetStackOffset(REGSIZE_BYTES); } #endif } @@ -5132,10 +5176,11 @@ bool Compiler::lvaIsPreSpilled(unsigned lclNum, regMaskTP preSpillMask) #endif // TARGET_ARM //------------------------------------------------------------------------ -// UpdateLifeFieldVar: Update live sets for only the given field of a multi-reg LclVar node. +// lvaUpdateArgWithInitialReg: Set the initial register of a local variable +// to the one assigned by the register allocator. // // Arguments: -// lclNode - the GT_LCL_VAR node. +// varDsc - the local variable descriptor // void Compiler::lvaUpdateArgWithInitialReg(LclVarDsc* varDsc) { @@ -5164,15 +5209,14 @@ void Compiler::lvaUpdateArgsWithInitialReg() if (varDsc->lvPromotedStruct()) { - noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here - - unsigned fieldVarNum = varDsc->lvFieldLclStart; - varDsc = lvaTable + fieldVarNum; + for (unsigned fieldVarNum = varDsc->lvFieldLclStart; + fieldVarNum < varDsc->lvFieldLclStart + varDsc->lvFieldCnt; ++fieldVarNum) + { + LclVarDsc* fieldVarDsc = lvaGetDesc(fieldVarNum); + lvaUpdateArgWithInitialReg(fieldVarDsc); + } } - - noway_assert(varDsc->lvIsParam); - - if (varDsc->lvIsRegCandidate()) + else { lvaUpdateArgWithInitialReg(varDsc); } @@ -5406,11 +5450,11 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, if (varDsc->lvOnFrame) { // The offset for args needs to be set only for the stack homed arguments for System V. - varDsc->lvStkOffs = argOffs; + varDsc->SetStackOffset(argOffs); } else { - varDsc->lvStkOffs = 0; + varDsc->SetStackOffset(0); } } else @@ -5427,7 +5471,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, // method, which fixes the offsets, based on frame pointer existence, existence of alloca instructions, ret // address pushed, ets. - varDsc->lvStkOffs = *callerArgOffset; + varDsc->SetStackOffset(*callerArgOffset); // Structs passed on stack could be of size less than TARGET_POINTER_SIZE. // Make sure they get at least TARGET_POINTER_SIZE on the stack - this is required for alignment. if (argSize > TARGET_POINTER_SIZE) @@ -5446,20 +5490,14 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, if (varDsc->lvPromotedStruct()) { unsigned firstFieldNum = varDsc->lvFieldLclStart; - int offset = varDsc->lvStkOffs; + int offset = varDsc->GetStackOffset(); for (unsigned i = 0; i < varDsc->lvFieldCnt; i++) { LclVarDsc* fieldVarDsc = lvaGetDesc(firstFieldNum + i); - fieldVarDsc->lvStkOffs = offset; + fieldVarDsc->SetStackOffset(offset); offset += fieldVarDsc->lvFldOffset; } } - // For an independent promoted struct field we also assign the parent struct stack offset - else if (varDsc->lvIsStructField) - { - noway_assert(varDsc->lvParentLcl < lvaCount); - lvaTable[varDsc->lvParentLcl].lvStkOffs = varDsc->lvStkOffs; - } if (Target::g_tgtArgOrder == Target::ARG_ORDER_R2L && !varDsc->lvIsRegArg) { @@ -5517,7 +5555,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, argOffs += TARGET_POINTER_SIZE; #elif defined(TARGET_AMD64) // Register arguments on AMD64 also takes stack space. (in the backing store) - varDsc->lvStkOffs = argOffs; + varDsc->SetStackOffset(argOffs); argOffs += TARGET_POINTER_SIZE; #elif defined(TARGET_ARM64) // Register arguments on ARM64 only take stack space when they have a frame home. @@ -5530,7 +5568,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, { // This is a split struct. It will account for an extra (8 bytes) // of alignment. - varDsc->lvStkOffs += TARGET_POINTER_SIZE; + varDsc->SetStackOffset(varDsc->GetStackOffset() + TARGET_POINTER_SIZE); argOffs += TARGET_POINTER_SIZE; } } @@ -5538,7 +5576,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, #elif defined(TARGET_ARM) // On ARM we spill the registers in codeGen->regSet.rsMaskPreSpillRegArg - // in the prolog, so we have to fill in lvStkOffs here + // in the prolog, so we have to do SetStackOffset() here // regMaskTP regMask = genRegMask(varDsc->GetArgReg()); if (codeGen->regSet.rsMaskPreSpillRegArg & regMask) @@ -5574,7 +5612,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, { break; } - __fallthrough; + FALLTHROUGH; case TYP_DOUBLE: case TYP_LONG: @@ -5611,7 +5649,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, // No alignment of argOffs required break; } - varDsc->lvStkOffs = argOffs; + varDsc->SetStackOffset(argOffs); argOffs += argSize; } #else // TARGET* @@ -5715,7 +5753,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, if (!varDsc->lvStructDoubleAlign) break; - __fallthrough; + FALLTHROUGH; case TYP_DOUBLE: case TYP_LONG: @@ -5730,7 +5768,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, } #endif // TARGET_ARM - varDsc->lvStkOffs = argOffs; + varDsc->SetStackOffset(argOffs); } // For struct promoted parameters we need to set the offsets for both LclVars. @@ -5742,9 +5780,9 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, if ((varDsc->TypeGet() == TYP_LONG) && varDsc->lvPromoted) { noway_assert(varDsc->lvFieldCnt == 2); - fieldVarNum = varDsc->lvFieldLclStart; - lvaTable[fieldVarNum].lvStkOffs = varDsc->lvStkOffs; - lvaTable[fieldVarNum + 1].lvStkOffs = varDsc->lvStkOffs + genTypeSize(TYP_INT); + fieldVarNum = varDsc->lvFieldLclStart; + lvaTable[fieldVarNum].SetStackOffset(varDsc->GetStackOffset()); + lvaTable[fieldVarNum + 1].SetStackOffset(varDsc->GetStackOffset() + genTypeSize(TYP_INT)); } else #endif // !defined(TARGET_64BIT) @@ -5754,7 +5792,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum, for (unsigned i = 0; i < varDsc->lvFieldCnt; i++) { LclVarDsc* fieldVarDsc = lvaGetDesc(firstFieldNum + i); - fieldVarDsc->lvStkOffs = varDsc->lvStkOffs + fieldVarDsc->lvFldOffset; + fieldVarDsc->SetStackOffset(varDsc->GetStackOffset() + fieldVarDsc->lvFldOffset); } } @@ -5812,11 +5850,11 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() stkOffs -= TARGET_POINTER_SIZE; // return address; if (lvaRetAddrVar != BAD_VAR_NUM) { - lvaTable[lvaRetAddrVar].lvStkOffs = stkOffs; + lvaTable[lvaRetAddrVar].SetStackOffset(stkOffs); } // If we are an OSR method, we "inherit" the frame of the original method, - // and the stack is already double aligned on entry (since the return adddress push + // and the stack is already double aligned on entry (since the return address push // and any special alignment push happened "before"). if (opts.IsOSR()) { @@ -5880,7 +5918,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() // top. if (lvaRetAddrVar != BAD_VAR_NUM) { - lvaTable[lvaRetAddrVar].lvStkOffs = stkOffs - REGSIZE_BYTES; + lvaTable[lvaRetAddrVar].SetStackOffset(stkOffs - REGSIZE_BYTES); } #endif @@ -6191,7 +6229,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() JITDUMP("---OSR--- V%02u (on old frame) old rbp offset %d old frame offset %d new virt offset %d\n", lclNum, originalOffset, originalFrameStkOffs, offset); - lvaTable[lclNum].lvStkOffs = offset; + lvaTable[lclNum].SetStackOffset(offset); continue; } @@ -6227,7 +6265,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() "virt offset %d\n", lclNum, originalOffset, originalFrameStkOffs, offset); - lvaTable[lclNum].lvStkOffs = offset; + lvaTable[lclNum].SetStackOffset(offset); } continue; @@ -6246,7 +6284,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() #endif // JIT32_GCENCODER lclNum == lvaRetAddrVar) { - assert(varDsc->lvStkOffs != BAD_STK_OFFS); + assert(varDsc->GetStackOffset() != BAD_STK_OFFS); continue; } @@ -6276,7 +6314,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() #if defined(TARGET_AMD64) && !defined(UNIX_AMD64_ABI) // On Windows AMD64 we can use the caller-reserved stack area that is already setup - assert(varDsc->lvStkOffs != BAD_STK_OFFS); + assert(varDsc->GetStackOffset() != BAD_STK_OFFS); continue; #else // !TARGET_AMD64 @@ -6293,8 +6331,8 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() if (info.compIsVarArgs && varDsc->GetArgReg() != theFixedRetBuffArgNum()) { // Stack offset to varargs (parameters) should point to home area which will be preallocated. - varDsc->lvStkOffs = - -initialStkOffs + genMapIntRegNumToRegArgNum(varDsc->GetArgReg()) * REGSIZE_BYTES; + const unsigned regArgNum = genMapIntRegNumToRegArgNum(varDsc->GetArgReg()); + varDsc->SetStackOffset(-initialStkOffs + regArgNum * REGSIZE_BYTES); continue; } @@ -6306,7 +6344,7 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() // if ((codeGen->regSet.rsMaskPreSpillRegs(false) & genRegMask(varDsc->GetArgReg())) != 0) { - assert(varDsc->lvStkOffs != BAD_STK_OFFS); + assert(varDsc->GetStackOffset() != BAD_STK_OFFS); continue; } #endif @@ -6393,31 +6431,33 @@ void Compiler::lvaAssignVirtualFrameOffsetsToLocals() // Reserve the stack space for this variable stkOffs = lvaAllocLocalAndSetVirtualOffset(lclNum, lvaLclSize(lclNum), stkOffs); -#ifdef TARGET_ARM64 +#ifdef TARGET_ARMARCH // If we have an incoming register argument that has a struct promoted field // then we need to copy the lvStkOff (the stack home) from the reg arg to the field lclvar // if (varDsc->lvIsRegArg && varDsc->lvPromotedStruct()) { - noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here - - unsigned fieldVarNum = varDsc->lvFieldLclStart; - lvaTable[fieldVarNum].lvStkOffs = varDsc->lvStkOffs; + unsigned firstFieldNum = varDsc->lvFieldLclStart; + for (unsigned i = 0; i < varDsc->lvFieldCnt; i++) + { + LclVarDsc* fieldVarDsc = lvaGetDesc(firstFieldNum + i); + fieldVarDsc->SetStackOffset(varDsc->GetStackOffset() + fieldVarDsc->lvFldOffset); + } } -#endif // TARGET_ARM64 #ifdef TARGET_ARM // If we have an incoming register argument that has a promoted long // then we need to copy the lvStkOff (the stack home) from the reg arg to the field lclvar // - if (varDsc->lvIsRegArg && varDsc->lvPromoted) + else if (varDsc->lvIsRegArg && varDsc->lvPromoted) { assert(varTypeIsLong(varDsc) && (varDsc->lvFieldCnt == 2)); - unsigned fieldVarNum = varDsc->lvFieldLclStart; - lvaTable[fieldVarNum].lvStkOffs = varDsc->lvStkOffs; - lvaTable[fieldVarNum + 1].lvStkOffs = varDsc->lvStkOffs + 4; + unsigned fieldVarNum = varDsc->lvFieldLclStart; + lvaTable[fieldVarNum].SetStackOffset(varDsc->GetStackOffset()); + lvaTable[fieldVarNum + 1].SetStackOffset(varDsc->GetStackOffset() + 4); } #endif // TARGET_ARM +#endif // TARGET_ARM64 } } @@ -6643,7 +6683,7 @@ int Compiler::lvaAllocLocalAndSetVirtualOffset(unsigned lclNum, unsigned size, i lvaIncrementFrameSize(size); stkOffs -= size; - lvaTable[lclNum].lvStkOffs = stkOffs; + lvaTable[lclNum].SetStackOffset(stkOffs); #ifdef DEBUG if (verbose) @@ -6773,7 +6813,7 @@ void Compiler::lvaAlignFrame() #if DOUBLE_ALIGN if (genDoubleAlign()) { - // Double Frame Alignement for x86 is handled in Compiler::lvaAssignVirtualFrameOffsetsToLocals() + // Double Frame Alignment for x86 is handled in Compiler::lvaAssignVirtualFrameOffsetsToLocals() if (compLclFrameSize == 0) { @@ -6858,7 +6898,7 @@ void Compiler::lvaAssignFrameOffsetsToPromotedStructs() noway_assert(varDsc->lvOnFrame); if (parentvarDsc->lvOnFrame) { - varDsc->lvStkOffs = parentvarDsc->lvStkOffs + varDsc->lvFldOffset; + varDsc->SetStackOffset(parentvarDsc->GetStackOffset() + varDsc->lvFldOffset); } else { @@ -7179,7 +7219,7 @@ void Compiler::lvaDumpEntry(unsigned lclNum, FrameLayoutState curState, size_t r { printf(" stack-byref"); } - if (varDsc->lvClassHnd != nullptr) + if (varDsc->lvClassHnd != NO_CLASS_HANDLE) { printf(" class-hnd"); } @@ -7223,7 +7263,7 @@ void Compiler::lvaDumpEntry(unsigned lclNum, FrameLayoutState curState, size_t r else #endif // !defined(TARGET_64BIT) { - CORINFO_CLASS_HANDLE typeHnd = parentvarDsc->lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE typeHnd = parentvarDsc->GetStructHnd(); CORINFO_FIELD_HANDLE fldHnd = info.compCompHnd->getFieldInClass(typeHnd, varDsc->lvFldOrdinal); printf(" V%02u.%s(offs=0x%02x)", varDsc->lvParentLcl, eeGetFieldName(fldHnd), varDsc->lvFldOffset); @@ -7447,11 +7487,11 @@ int Compiler::lvaGetSPRelativeOffset(unsigned varNum) { // The stack offset is relative to the frame pointer, so convert it to be // relative to the stack pointer (which makes no sense for localloc functions). - spRelativeOffset = varDsc->lvStkOffs + codeGen->genSPtoFPdelta(); + spRelativeOffset = varDsc->GetStackOffset() + codeGen->genSPtoFPdelta(); } else { - spRelativeOffset = varDsc->lvStkOffs; + spRelativeOffset = varDsc->GetStackOffset(); } assert(spRelativeOffset >= 0); @@ -7471,7 +7511,7 @@ int Compiler::lvaGetCallerSPRelativeOffset(unsigned varNum) LclVarDsc* varDsc = lvaTable + varNum; assert(varDsc->lvOnFrame); - return lvaToCallerSPRelativeOffset(varDsc->lvStkOffs, varDsc->lvFramePointerBased); + return lvaToCallerSPRelativeOffset(varDsc->GetStackOffset(), varDsc->lvFramePointerBased); } int Compiler::lvaToCallerSPRelativeOffset(int offset, bool isFpBased) const @@ -7518,7 +7558,7 @@ int Compiler::lvaGetInitialSPRelativeOffset(unsigned varNum) LclVarDsc* varDsc = lvaTable + varNum; assert(varDsc->lvOnFrame); - return lvaToInitialSPRelativeOffset(varDsc->lvStkOffs, varDsc->lvFramePointerBased); + return lvaToInitialSPRelativeOffset(varDsc->GetStackOffset(), varDsc->lvFramePointerBased); } // Given a local variable offset, and whether that offset is frame-pointer based, return its offset from Initial-SP. diff --git a/src/coreclr/src/jit/linuxnonjit/CMakeLists.txt b/src/coreclr/src/jit/linuxnonjit/CMakeLists.txt deleted file mode 100644 index 951b757a6a70..000000000000 --- a/src/coreclr/src/jit/linuxnonjit/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -project(linuxnonjit) - -add_definitions(-DALT_JIT) -add_definitions(-DFEATURE_NO_HOST) -add_definitions(-DSELF_NO_HOST) -remove_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE) - -if(FEATURE_READYTORUN) - add_definitions(-DFEATURE_READYTORUN_COMPILER) -endif(FEATURE_READYTORUN) - -if (CLR_CMAKE_HOST_ARCH_I386) - remove_definitions(-DFEATURE_SIMD) - remove_definitions(-DFEATURE_HW_INTRINSICS) - add_definitions(-DUNIX_X86_ABI) - set(JIT_ARCH_SOURCES ${JIT_I386_SOURCES}) - set(JIT_ARCH_LINK_LIBRARIES gcinfo_linuxx86) -elseif(CLR_CMAKE_HOST_ARCH_AMD64) - add_definitions(-DUNIX_AMD64_ABI) - set(JIT_ARCH_SOURCES ${JIT_AMD64_SOURCES}) - set(JIT_ARCH_LINK_LIBRARIES gcinfo) -else() - clr_unknown_arch() -endif() - -add_jit(linuxnonjit) diff --git a/src/coreclr/src/jit/liveness.cpp b/src/coreclr/src/jit/liveness.cpp index feb8f23a222e..cbc4ebbd05af 100644 --- a/src/coreclr/src/jit/liveness.cpp +++ b/src/coreclr/src/jit/liveness.cpp @@ -1980,17 +1980,13 @@ void Compiler::fgComputeLifeLIR(VARSET_TP& life, BasicBlock* block, VARSET_VALAR GenTree* data = store->OperIs(GT_STOREIND) ? store->AsStoreInd()->Data() : store->AsBlk()->Data(); data->SetUnusedValue(); + if (data->isIndir()) { - // This is a block assignment. An indirection of the rhs is not considered - // to happen until the assignment so mark it as non-faulting. - data->gtFlags |= GTF_IND_NONFAULTING; + Lowering::TransformUnusedIndirection(data->AsIndir(), this, block); } - blockRange.Remove(store); - - assert(!opts.MinOpts()); - fgStmtRemoved = true; + fgRemoveDeadStoreLIR(store, block); } } } @@ -2019,25 +2015,7 @@ void Compiler::fgComputeLifeLIR(VARSET_TP& life, BasicBlock* block, VARSET_VALAR // Remove the store. DCE will iteratively clean up any ununsed operands. lclVarNode->gtOp1->SetUnusedValue(); - // If the store is marked as a late argument, it is referenced by a call. Instead of removing - // it, bash it to a NOP. - if ((node->gtFlags & GTF_LATE_ARG) != 0) - { - JITDUMP("node is a late arg; replacing with NOP\n"); - node->gtBashToNOP(); - - // NOTE: this is a bit of a hack. We need to keep these nodes around as they are - // referenced by the call, but they're considered side-effect-free non-value-producing - // nodes, so they will be removed if we don't do this. - node->gtFlags |= GTF_ORDER_SIDEEFF; - } - else - { - blockRange.Remove(node); - } - - assert(!opts.MinOpts()); - fgStmtRemoved = true; + fgRemoveDeadStoreLIR(node, block); } break; @@ -2109,40 +2087,112 @@ void Compiler::fgComputeLifeLIR(VARSET_TP& life, BasicBlock* block, VARSET_VALAR break; case GT_NOP: + { // NOTE: we need to keep some NOPs around because they are referenced by calls. See the dead store // removal code above (case GT_STORE_LCL_VAR) for more explanation. if ((node->gtFlags & GTF_ORDER_SIDEEFF) != 0) { break; } - __fallthrough; + fgTryRemoveNonLocal(node, &blockRange); + } + break; - default: - assert(!node->OperIsLocal()); - if (!node->IsValue() || node->IsUnusedValue()) + case GT_BLK: + case GT_OBJ: + case GT_DYN_BLK: + { + bool removed = fgTryRemoveNonLocal(node, &blockRange); + if (!removed && node->IsUnusedValue()) { - // We are only interested in avoiding the removal of nodes with direct side-effects - // (as opposed to side effects of their children). - // This default case should never include calls or assignments. - assert(!node->OperRequiresAsgFlag() && !node->OperIs(GT_CALL)); - if (!node->gtSetFlags() && !node->OperMayThrow(this)) - { - JITDUMP("Removing dead node:\n"); - DISPNODE(node); - - node->VisitOperands([](GenTree* operand) -> GenTree::VisitResult { - operand->SetUnusedValue(); - return GenTree::VisitResult::Continue; - }); - - blockRange.Remove(node); - } + // IR doesn't expect dummy uses of `GT_OBJ/BLK/DYN_BLK`. + JITDUMP("Transform an unused OBJ/BLK node [%06d]\n", dspTreeID(node)); + Lowering::TransformUnusedIndirection(node->AsIndir(), this, block); } + } + break; + + default: + fgTryRemoveNonLocal(node, &blockRange); break; } } } +//--------------------------------------------------------------------- +// fgTryRemoveNonLocal - try to remove a node if it is unused and has no direct +// side effects. +// +// Arguments +// node - the non-local node to try; +// blockRange - the block range that contains the node. +// +// Return value: +// None +// +// Notes: local nodes are processed independently and are not expected in this function. +// +bool Compiler::fgTryRemoveNonLocal(GenTree* node, LIR::Range* blockRange) +{ + assert(!node->OperIsLocal()); + if (!node->IsValue() || node->IsUnusedValue()) + { + // We are only interested in avoiding the removal of nodes with direct side effects + // (as opposed to side effects of their children). + // This default case should never include calls or assignments. + assert(!node->OperRequiresAsgFlag() && !node->OperIs(GT_CALL)); + if (!node->gtSetFlags() && !node->OperMayThrow(this)) + { + JITDUMP("Removing dead node:\n"); + DISPNODE(node); + + node->VisitOperands([](GenTree* operand) -> GenTree::VisitResult { + operand->SetUnusedValue(); + return GenTree::VisitResult::Continue; + }); + + blockRange->Remove(node); + return true; + } + } + return false; +} + +//--------------------------------------------------------------------- +// fgRemoveDeadStoreSimple - remove a dead store +// +// pTree - GenTree** to local, including store-form local or local addr (post-rationalize) +// varDsc - var that is being stored to +// life - current live tracked vars (maintained as we walk backwards) +// doAgain - out parameter, true if we should restart the statement +// pStmtInfoDirty - should defer the cost computation to the point after the reverse walk is completed? +// +void Compiler::fgRemoveDeadStoreLIR(GenTree* store, BasicBlock* block) +{ + LIR::Range& blockRange = LIR::AsRange(block); + + // If the store is marked as a late argument, it is referenced by a call. + // Instead of removing it, bash it to a NOP. + if ((store->gtFlags & GTF_LATE_ARG) != 0) + { + JITDUMP("node is a late arg; replacing with NOP\n"); + store->gtBashToNOP(); + + // NOTE: this is a bit of a hack. We need to keep these nodes around as they are + // referenced by the call, but they're considered side-effect-free non-value-producing + // nodes, so they will be removed if we don't do this. + store->gtFlags |= GTF_ORDER_SIDEEFF; + } + else + { + blockRange.Remove(store); + } + + assert(!opts.MinOpts()); + fgStmtRemoved = true; +} + +//--------------------------------------------------------------------- // fgRemoveDeadStore - remove a store to a local which has no exposed uses. // // pTree - GenTree** to local, including store-form local or local addr (post-rationalize) @@ -2285,17 +2335,6 @@ bool Compiler::fgRemoveDeadStore(GenTree** pTree, } #endif // DEBUG // Extract the side effects - if (rhsNode->TypeGet() == TYP_STRUCT) - { - // This is a block assignment. An indirection of the rhs is not considered to - // happen until the assignment, so we will extract the side effects from only - // the address. - if (rhsNode->OperIsIndir()) - { - assert(rhsNode->OperGet() != GT_NULLCHECK); - rhsNode = rhsNode->AsIndir()->Addr(); - } - } gtExtractSideEffList(rhsNode, &sideEffList); } diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp index cc9e2891e9a4..6494b9515626 100644 --- a/src/coreclr/src/jit/lower.cpp +++ b/src/coreclr/src/jit/lower.cpp @@ -247,7 +247,7 @@ GenTree* Lowering::LowerNode(GenTree* node) LowerStoreSingleRegCallStruct(node->AsBlk()); break; } - __fallthrough; + FALLTHROUGH; case GT_STORE_DYN_BLK: LowerBlockStoreCommon(node->AsBlk()); break; @@ -307,7 +307,7 @@ GenTree* Lowering::LowerNode(GenTree* node) case GT_STORE_LCL_VAR: WidenSIMD12IfNecessary(node->AsLclVarCommon()); - __fallthrough; + FALLTHROUGH; case GT_STORE_LCL_FLD: LowerStoreLocCommon(node->AsLclVarCommon()); @@ -585,7 +585,7 @@ GenTree* Lowering::LowerSwitch(GenTree* node) // I think this is due to the fact that we use absolute addressing // instead of relative. But in CoreRT is used as a rule relative // addressing when we generate an executable. - // See also https://github.com/dotnet/coreclr/issues/13194 + // See also https://github.com/dotnet/runtime/issues/8683 // Also https://github.com/dotnet/coreclr/pull/13197 useJumpSequence = useJumpSequence || comp->IsTargetAbi(CORINFO_CORERT_ABI); #endif // defined(TARGET_UNIX) && defined(TARGET_ARM) @@ -1041,8 +1041,15 @@ GenTree* Lowering::NewPutArg(GenTreeCall* call, GenTree* arg, fgArgTabEntry* inf #endif // TARGET_ARM } + unsigned slotNumber = info->GetByteOffset() / TARGET_POINTER_SIZE; +#if defined(FEATURE_PUT_STRUCT_ARG_STK) + unsigned numberOfStackSlots = info->GetStackSlotsNumber(); + DEBUG_ARG_SLOTS_ASSERT(numberOfStackSlots == info->numSlots); +#endif + DEBUG_ARG_SLOTS_ASSERT(slotNumber == info->slotNum); + putArg = new (comp, GT_PUTARG_SPLIT) - GenTreePutArgSplit(arg, info->slotNum PUT_STRUCT_ARG_STK_ONLY_ARG(info->numSlots), info->numRegs, + GenTreePutArgSplit(arg, slotNumber PUT_STRUCT_ARG_STK_ONLY_ARG(numberOfStackSlots), info->numRegs, call->IsFastTailCall(), call); // If struct argument is morphed to GT_FIELD_LIST node(s), @@ -1126,12 +1133,16 @@ GenTree* Lowering::NewPutArg(GenTreeCall* call, GenTree* arg, fgArgTabEntry* inf // Mark this one as tail call arg if it is a fast tail call. // This provides the info to put this argument in in-coming arg area slot // instead of in out-going arg area slot. + CLANG_FORMAT_COMMENT_ANCHOR; +#ifdef DEBUG // Make sure state is correct. The PUTARG_STK has TYP_VOID, as it doesn't produce // a result. So the type of its operand must be the correct type to push on the stack. // For a FIELD_LIST, this will be the type of the field (not the type of the arg), // but otherwise it is generally the type of the operand. info->checkIsStruct(); +#endif + if ((arg->OperGet() != GT_FIELD_LIST)) { #if defined(FEATURE_SIMD) && defined(FEATURE_PUT_STRUCT_ARG_STK) @@ -1145,10 +1156,16 @@ GenTree* Lowering::NewPutArg(GenTreeCall* call, GenTree* arg, fgArgTabEntry* inf assert(genActualType(arg->TypeGet()) == type); } } + unsigned slotNumber = info->GetByteOffset() / TARGET_POINTER_SIZE; +#if defined(FEATURE_PUT_STRUCT_ARG_STK) + unsigned numberOfStackSlots = info->GetStackSlotsNumber(); + DEBUG_ARG_SLOTS_ASSERT(numberOfStackSlots == info->numSlots); +#endif + DEBUG_ARG_SLOTS_ASSERT(slotNumber == info->slotNum); putArg = new (comp, GT_PUTARG_STK) GenTreePutArgStk(GT_PUTARG_STK, TYP_VOID, arg, - info->slotNum PUT_STRUCT_ARG_STK_ONLY_ARG(info->numSlots), + slotNumber PUT_STRUCT_ARG_STK_ONLY_ARG(numberOfStackSlots), call->IsFastTailCall(), call); #ifdef FEATURE_PUT_STRUCT_ARG_STK @@ -1895,19 +1912,19 @@ void Lowering::LowerFastTailCall(GenTreeCall* call) unsigned int argStart = callerArgLclNum * TARGET_POINTER_SIZE; unsigned int argEnd = argStart + static_cast(callerArgDsc->lvArgStackSize()); #else - assert(callerArgDsc->lvStkOffs != BAD_STK_OFFS); + assert(callerArgDsc->GetStackOffset() != BAD_STK_OFFS); if (baseOff == -1) { - baseOff = callerArgDsc->lvStkOffs; + baseOff = callerArgDsc->GetStackOffset(); } // On all ABIs where we fast tail call the stack args should come in order. - assert(baseOff <= callerArgDsc->lvStkOffs); + assert(baseOff <= callerArgDsc->GetStackOffset()); // Compute offset of this stack argument relative to the first stack arg. // This will be its offset into the incoming arg space area. - unsigned int argStart = static_cast(callerArgDsc->lvStkOffs - baseOff); + unsigned int argStart = static_cast(callerArgDsc->GetStackOffset() - baseOff); unsigned int argEnd = argStart + comp->lvaLclSize(callerArgLclNum); #endif @@ -2115,7 +2132,10 @@ GenTree* Lowering::LowerTailCallViaJitHelper(GenTreeCall* call, GenTree* callTar // We need to figure out the size of the outgoing stack arguments, not including the special args. // The number of 4-byte words is passed to the helper for the incoming and outgoing argument sizes. // This number is exactly the next slot number in the call's argument info struct. - unsigned nNewStkArgsWords = call->fgArgInfo->GetNextSlotNum(); + unsigned nNewStkArgsBytes = call->fgArgInfo->GetNextSlotByteOffset(); + const int wordSize = 4; + unsigned nNewStkArgsWords = nNewStkArgsBytes / wordSize; + DEBUG_ARG_SLOTS_ASSERT(call->fgArgInfo->GetNextSlotNum() == nNewStkArgsWords); assert(nNewStkArgsWords >= 4); // There must be at least the four special stack args. nNewStkArgsWords -= 4; @@ -2991,7 +3011,7 @@ void Lowering::LowerRet(GenTreeUnOp* ret) ReturnTypeDesc retTypeDesc; LclVarDsc* varDsc = nullptr; varDsc = comp->lvaGetDesc(retVal->AsLclVar()->GetLclNum()); - retTypeDesc.InitializeStructReturnType(comp, varDsc->lvVerTypeInfo.GetClassHandle()); + retTypeDesc.InitializeStructReturnType(comp, varDsc->GetStructHnd()); if (retTypeDesc.GetReturnRegCount() > 1) { CheckMultiRegLclVar(retVal->AsLclVar(), &retTypeDesc); @@ -3181,7 +3201,9 @@ void Lowering::LowerStoreLocCommon(GenTreeLclVarCommon* lclStore) // Create the assignment node. lclStore->ChangeOper(GT_STORE_OBJ); GenTreeBlk* objStore = lclStore->AsObj(); - objStore->gtFlags = GTF_ASG | GTF_IND_NONFAULTING | GTF_IND_TGT_NOT_HEAP; + // Only the GTF_LATE_ARG flag (if present) is preserved. + objStore->gtFlags &= GTF_LATE_ARG; + objStore->gtFlags |= GTF_ASG | GTF_IND_NONFAULTING | GTF_IND_TGT_NOT_HEAP; #ifndef JIT32_GCENCODER objStore->gtBlkOpGcUnsafe = false; #endif @@ -3278,7 +3300,7 @@ void Lowering::LowerRetStruct(GenTreeUnOp* ret) case GT_OBJ: retVal->ChangeOper(GT_IND); - __fallthrough; + FALLTHROUGH; case GT_IND: retVal->ChangeType(nativeReturnType); LowerIndir(retVal->AsIndir()); @@ -3485,7 +3507,7 @@ void Lowering::LowerCallStruct(GenTreeCall* call) #endif // FEATURE_SIMD // importer has a separate mechanism to retype calls to helpers, // keep it for now. - assert(user->TypeIs(TYP_REF)); + assert(user->TypeIs(TYP_REF) || (user->TypeIs(TYP_I_IMPL) && comp->IsTargetAbi(CORINFO_CORERT_ABI))); assert(call->IsHelperCall()); assert(returnType == user->TypeGet()); break; @@ -3689,10 +3711,17 @@ GenTree* Lowering::LowerDirectCall(GenTreeCall* call) // Non-virtual direct calls to addresses accessed by // a double indirection. // - // Double-indirection. Load the address into a register - // and call indirectly through the register + + // Expanding an IAT_PPVALUE here, will lose the opportunity + // to Hoist/CSE the first indirection as it is an invariant load + // + assert(!"IAT_PPVALUE case in LowerDirectCall"); + noway_assert(helperNum == CORINFO_HELP_UNDEF); result = AddrGen(addr); + // Double-indirection. Load the address into a register + // and call indirectly through the register + // result = Ind(Ind(result)); break; @@ -4158,7 +4187,7 @@ void Lowering::InsertPInvokeCallProlog(GenTreeCall* call) // On x86 targets, PInvoke calls need the size of the stack args in InlinedCallFrame.m_Datum. // This is because the callee pops stack arguments, and we need to keep track of this during stack // walking - const unsigned numStkArgBytes = call->fgArgInfo->GetNextSlotNum() * TARGET_POINTER_SIZE; + const unsigned numStkArgBytes = call->fgArgInfo->GetNextSlotByteOffset(); GenTree* stackBytes = comp->gtNewIconNode(numStkArgBytes, TYP_INT); GenTreeCall::Use* args = comp->gtNewCallArgs(frameAddr, stackBytes); #else @@ -4192,9 +4221,9 @@ void Lowering::InsertPInvokeCallProlog(GenTreeCall* call) { #if !defined(TARGET_64BIT) // On 32-bit targets, indirect calls need the size of the stack args in InlinedCallFrame.m_Datum. - const unsigned numStkArgBytes = call->fgArgInfo->GetNextSlotNum() * TARGET_POINTER_SIZE; + const unsigned stackByteOffset = call->fgArgInfo->GetNextSlotByteOffset(); - src = comp->gtNewIconNode(numStkArgBytes, TYP_INT); + src = comp->gtNewIconNode(stackByteOffset, TYP_INT); #else // On 64-bit targets, indirect calls may need the stub parameter value in InlinedCallFrame.m_Datum. // If the stub parameter value is not needed, m_Datum will be initialized by the VM. @@ -4486,10 +4515,20 @@ GenTree* Lowering::LowerNonvirtPinvokeCall(GenTreeCall* call) break; case IAT_PPVALUE: + // ToDo: Expanding an IAT_PPVALUE here, loses the opportunity + // to Hoist/CSE the first indirection as it is an invariant load + // + // This case currently occurs today when we make PInvoke calls in crossgen + // + // assert(!"IAT_PPVALUE in Lowering::LowerNonvirtPinvokeCall"); + addrTree = AddrGen(addr); #ifdef DEBUG addrTree->AsIntCon()->gtTargetHandle = (size_t)methHnd; #endif + // Double-indirection. Load the address into a register + // and call indirectly through the register + // result = Ind(Ind(addrTree)); break; @@ -6239,6 +6278,7 @@ void Lowering::ContainCheckNode(GenTree* node) break; case GT_STOREIND: ContainCheckStoreIndir(node->AsIndir()); + break; case GT_IND: ContainCheckIndir(node->AsIndir()); break; @@ -6450,41 +6490,7 @@ void Lowering::LowerIndir(GenTreeIndir* ind) if (ind->OperIs(GT_NULLCHECK) || ind->IsUnusedValue()) { - // A nullcheck is essentially the same as an indirection with no use. - // The difference lies in whether a target register must be allocated. - // On XARCH we can generate a compare with no target register as long as the addresss - // is not contained. - // On ARM64 we can generate a load to REG_ZR in all cases. - // However, on ARM we must always generate a load to a register. - // In the case where we require a target register, it is better to use GT_IND, since - // GT_NULLCHECK is a non-value node and would therefore require an internal register - // to use as the target. That is non-optimal because it will be modeled as conflicting - // with the source register(s). - // So, to summarize: - // - On ARM64, always use GT_NULLCHECK for a dead indirection. - // - On ARM, always use GT_IND. - // - On XARCH, use GT_IND if we have a contained address, and GT_NULLCHECK otherwise. - // In all cases, change the type to TYP_INT. - // - ind->gtType = TYP_INT; -#ifdef TARGET_ARM64 - bool useNullCheck = true; -#elif TARGET_ARM - bool useNullCheck = false; -#else // TARGET_XARCH - bool useNullCheck = !ind->Addr()->isContained(); -#endif // !TARGET_XARCH - - if (useNullCheck && ind->OperIs(GT_IND)) - { - ind->ChangeOper(GT_NULLCHECK); - ind->ClearUnusedValue(); - } - else if (!useNullCheck && ind->OperIs(GT_NULLCHECK)) - { - ind->ChangeOper(GT_IND); - ind->SetUnusedValue(); - } + TransformUnusedIndirection(ind, comp, m_block); } } else @@ -6496,6 +6502,55 @@ void Lowering::LowerIndir(GenTreeIndir* ind) } } +//------------------------------------------------------------------------ +// TransformUnusedIndirection: change the opcode and the type of the unused indirection. +// +// Arguments: +// ind - Indirection to transform. +// comp - Compiler instance. +// block - Basic block of the indirection. +// +void Lowering::TransformUnusedIndirection(GenTreeIndir* ind, Compiler* comp, BasicBlock* block) +{ + // A nullcheck is essentially the same as an indirection with no use. + // The difference lies in whether a target register must be allocated. + // On XARCH we can generate a compare with no target register as long as the address + // is not contained. + // On ARM64 we can generate a load to REG_ZR in all cases. + // However, on ARM we must always generate a load to a register. + // In the case where we require a target register, it is better to use GT_IND, since + // GT_NULLCHECK is a non-value node and would therefore require an internal register + // to use as the target. That is non-optimal because it will be modeled as conflicting + // with the source register(s). + // So, to summarize: + // - On ARM64, always use GT_NULLCHECK for a dead indirection. + // - On ARM, always use GT_IND. + // - On XARCH, use GT_IND if we have a contained address, and GT_NULLCHECK otherwise. + // In all cases, change the type to TYP_INT. + // + assert(ind->OperIs(GT_NULLCHECK, GT_IND, GT_BLK, GT_OBJ)); + + ind->gtType = TYP_INT; +#ifdef TARGET_ARM64 + bool useNullCheck = true; +#elif TARGET_ARM + bool useNullCheck = false; +#else // TARGET_XARCH + bool useNullCheck = !ind->Addr()->isContained(); +#endif // !TARGET_XARCH + + if (useNullCheck && !ind->OperIs(GT_NULLCHECK)) + { + comp->gtChangeOperToNullCheck(ind, block); + ind->ClearUnusedValue(); + } + else if (!useNullCheck && !ind->OperIs(GT_IND)) + { + ind->ChangeOper(GT_IND); + ind->SetUnusedValue(); + } +} + //------------------------------------------------------------------------ // LowerBlockStoreCommon: a common logic to lower STORE_OBJ/BLK/DYN_BLK. // diff --git a/src/coreclr/src/jit/lower.h b/src/coreclr/src/jit/lower.h index 0c620aebeb0f..ff13302c1ba9 100644 --- a/src/coreclr/src/jit/lower.h +++ b/src/coreclr/src/jit/lower.h @@ -8,6 +8,7 @@ XX Lower XX XX XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ #ifndef _LOWER_H_ @@ -326,12 +327,12 @@ class Lowering final : public Phase void LowerHWIntrinsicCmpOp(GenTreeHWIntrinsic* node, genTreeOps cmpOp); void LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node); void LowerHWIntrinsicDot(GenTreeHWIntrinsic* node); - void LowerFusedMultiplyAdd(GenTreeHWIntrinsic* node); - #if defined(TARGET_XARCH) + void LowerFusedMultiplyAdd(GenTreeHWIntrinsic* node); void LowerHWIntrinsicToScalar(GenTreeHWIntrinsic* node); #elif defined(TARGET_ARM64) bool IsValidConstForMovImm(GenTreeHWIntrinsic* node); + void LowerHWIntrinsicFusedMultiplyAddScalar(GenTreeHWIntrinsic* node); #endif // !TARGET_XARCH && !TARGET_ARM64 union VectorConstant { @@ -532,6 +533,8 @@ class Lowering final : public Phase bool IsContainableHWIntrinsicOp(GenTreeHWIntrinsic* containingNode, GenTree* node, bool* supportsRegOptional); #endif // FEATURE_HW_INTRINSICS + static void TransformUnusedIndirection(GenTreeIndir* ind, Compiler* comp, BasicBlock* block); + private: static bool NodesAreEquivalentLeaves(GenTree* candidate, GenTree* storeInd); diff --git a/src/coreclr/src/jit/lowerarmarch.cpp b/src/coreclr/src/jit/lowerarmarch.cpp index 2ab6fa947822..80e2bc2c5db8 100644 --- a/src/coreclr/src/jit/lowerarmarch.cpp +++ b/src/coreclr/src/jit/lowerarmarch.cpp @@ -517,6 +517,76 @@ void Lowering::LowerSIMD(GenTreeSIMD* simdNode) #endif // FEATURE_SIMD #ifdef FEATURE_HW_INTRINSICS + +//---------------------------------------------------------------------------------------------- +// LowerHWIntrinsicFusedMultiplyAddScalar: Lowers AdvSimd_FusedMultiplyAddScalar intrinsics +// when some of the operands are negated by "containing" such negation. +// +// Arguments: +// node - The original hardware intrinsic node +// +// | op1 | op2 | op3 | +// | + | + | + | AdvSimd_FusedMultiplyAddScalar +// | + | + | - | AdvSimd_FusedMultiplySubtractScalar +// | + | - | + | AdvSimd_FusedMultiplySubtractScalar +// | + | - | - | AdvSimd_FusedMultiplyAddScalar +// | - | + | + | AdvSimd_FusedMultiplySubtractNegatedScalar +// | - | + | - | AdvSimd_FusedMultiplyAddNegatedScalar +// | - | - | + | AdvSimd_FusedMultiplyAddNegatedScalar +// | - | - | - | AdvSimd_FusedMultiplySubtractNegatedScalar +// +void Lowering::LowerHWIntrinsicFusedMultiplyAddScalar(GenTreeHWIntrinsic* node) +{ + assert(node->gtHWIntrinsicId == NI_AdvSimd_FusedMultiplyAddScalar); + + const HWIntrinsic intrin(node); + + GenTree* op1 = intrin.op1; + GenTree* op2 = intrin.op2; + GenTree* op3 = intrin.op3; + + auto lowerOperand = [this](GenTree* op) { + bool wasNegated = false; + + if (op->OperIsHWIntrinsic() && + ((op->AsHWIntrinsic()->gtHWIntrinsicId == NI_AdvSimd_Arm64_DuplicateToVector64) || + (op->AsHWIntrinsic()->gtHWIntrinsicId == NI_Vector64_CreateScalarUnsafe))) + { + GenTreeHWIntrinsic* createVector64 = op->AsHWIntrinsic(); + GenTree* valueOp = createVector64->gtGetOp1(); + + if (valueOp->OperIs(GT_NEG)) + { + createVector64->gtOp1 = valueOp->gtGetOp1(); + BlockRange().Remove(valueOp); + wasNegated = true; + } + } + + return wasNegated; + }; + + const bool op1WasNegated = lowerOperand(op1); + const bool op2WasNegated = lowerOperand(op2); + const bool op3WasNegated = lowerOperand(op3); + + if (op1WasNegated) + { + if (op2WasNegated != op3WasNegated) + { + node->gtHWIntrinsicId = NI_AdvSimd_FusedMultiplyAddNegatedScalar; + } + else + { + node->gtHWIntrinsicId = NI_AdvSimd_FusedMultiplySubtractNegatedScalar; + } + } + else if (op2WasNegated != op3WasNegated) + { + node->gtHWIntrinsicId = NI_AdvSimd_FusedMultiplySubtractScalar; + } +} + //---------------------------------------------------------------------------------------------- // Lowering::LowerHWIntrinsic: Perform containment analysis for a hardware intrinsic node. // @@ -573,6 +643,10 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) return; } + case NI_AdvSimd_FusedMultiplyAddScalar: + LowerHWIntrinsicFusedMultiplyAddScalar(node); + break; + default: break; } @@ -918,11 +992,13 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) } } - UNATIVE_OFFSET cnsSize = (simdSize == 12) ? 16 : simdSize; - UNATIVE_OFFSET cnsAlign = cnsSize; + unsigned cnsSize = (simdSize == 12) ? 16 : simdSize; + unsigned cnsAlign = cnsSize; + var_types dataType = Compiler::getSIMDTypeForSize(simdSize); - CORINFO_FIELD_HANDLE hnd = comp->GetEmitter()->emitAnyConst(&vecCns, cnsSize, cnsAlign); - GenTree* clsVarAddr = new (comp, GT_CLS_VAR_ADDR) GenTreeClsVar(GT_CLS_VAR_ADDR, TYP_I_IMPL, hnd, nullptr); + UNATIVE_OFFSET cnum = comp->GetEmitter()->emitDataConst(&vecCns, cnsSize, cnsAlign, dataType); + CORINFO_FIELD_HANDLE hnd = comp->eeFindJitDataOffs(cnum); + GenTree* clsVarAddr = new (comp, GT_CLS_VAR_ADDR) GenTreeClsVar(GT_CLS_VAR_ADDR, TYP_I_IMPL, hnd, nullptr); BlockRange().InsertBefore(node, clsVarAddr); node->ChangeOper(GT_IND); diff --git a/src/coreclr/src/jit/lowerxarch.cpp b/src/coreclr/src/jit/lowerxarch.cpp index 331c674eab9e..971424e64c96 100644 --- a/src/coreclr/src/jit/lowerxarch.cpp +++ b/src/coreclr/src/jit/lowerxarch.cpp @@ -592,8 +592,8 @@ void Lowering::LowerPutArgStk(GenTreePutArgStk* putArgStk) * * TODO-XArch-CQ: (Low-pri): Jit64 generates in-line code of 8 instructions for (i) above. * There are hardly any occurrences of this conversion operation in platform - * assemblies or in CQ perf benchmarks (1 occurrence in mscorlib, microsoft.jscript, - * 1 occurence in Roslyn and no occurrences in system, system.core, system.numerics + * assemblies or in CQ perf benchmarks (1 occurrence in corelib, microsoft.jscript, + * 1 occurrence in Roslyn and no occurrences in system, system.core, system.numerics * system.windows.forms, scimark, fractals, bio mums). If we ever find evidence that * doing this optimization is a win, should consider generating in-lined code. */ @@ -713,10 +713,11 @@ void Lowering::LowerSIMD(GenTreeSIMD* simdNode) assert(sizeof(constArgValues) == 16); - UNATIVE_OFFSET cnsSize = sizeof(constArgValues); - UNATIVE_OFFSET cnsAlign = (comp->compCodeOpt() != Compiler::SMALL_CODE) ? cnsSize : 1; + unsigned cnsSize = sizeof(constArgValues); + unsigned cnsAlign = (comp->compCodeOpt() != Compiler::SMALL_CODE) ? cnsSize : 1; - CORINFO_FIELD_HANDLE hnd = comp->GetEmitter()->emitAnyConst(constArgValues, cnsSize, cnsAlign); + CORINFO_FIELD_HANDLE hnd = + comp->GetEmitter()->emitBlkConst(constArgValues, cnsSize, cnsAlign, simdNode->gtSIMDBaseType); 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); @@ -1008,7 +1009,7 @@ void Lowering::LowerHWIntrinsic(GenTreeHWIntrinsic* node) break; } - __fallthrough; + FALLTHROUGH; } case NI_SSE_CompareGreaterThan: @@ -1540,11 +1541,14 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) } } - UNATIVE_OFFSET cnsSize = (simdSize != 12) ? simdSize : 16; - UNATIVE_OFFSET cnsAlign = (comp->compCodeOpt() != Compiler::SMALL_CODE) ? cnsSize : 1; + unsigned cnsSize = (simdSize != 12) ? simdSize : 16; + unsigned cnsAlign = + (comp->compCodeOpt() != Compiler::SMALL_CODE) ? cnsSize : emitter::dataSection::MIN_DATA_ALIGN; + var_types dataType = Compiler::getSIMDTypeForSize(simdSize); - CORINFO_FIELD_HANDLE hnd = comp->GetEmitter()->emitAnyConst(&vecCns, cnsSize, cnsAlign); - GenTree* clsVarAddr = new (comp, GT_CLS_VAR_ADDR) GenTreeClsVar(GT_CLS_VAR_ADDR, TYP_I_IMPL, hnd, nullptr); + UNATIVE_OFFSET cnum = comp->GetEmitter()->emitDataConst(&vecCns, cnsSize, cnsAlign, dataType); + CORINFO_FIELD_HANDLE hnd = comp->eeFindJitDataOffs(cnum); + GenTree* clsVarAddr = new (comp, GT_CLS_VAR_ADDR) GenTreeClsVar(GT_CLS_VAR_ADDR, TYP_I_IMPL, hnd, nullptr); BlockRange().InsertBefore(node, clsVarAddr); node->ChangeOper(GT_IND); @@ -1728,7 +1732,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(tmp2, tmp1); LowerNode(tmp1); - __fallthrough; + FALLTHROUGH; } case TYP_SHORT: @@ -1765,7 +1769,7 @@ void Lowering::LowerHWIntrinsicCreate(GenTreeHWIntrinsic* node) BlockRange().InsertAfter(tmp2, tmp1); LowerNode(tmp1); - __fallthrough; + FALLTHROUGH; } case TYP_INT: @@ -3439,8 +3443,7 @@ bool Lowering::IsRMWMemOpRootedAtStoreInd(GenTree* tree, GenTree** outIndirCandi assert(storeInd->IsRMWStatusUnknown()); // Early out if indirDst is not one of the supported memory operands. - if (indirDst->OperGet() != GT_LEA && indirDst->OperGet() != GT_LCL_VAR && indirDst->OperGet() != GT_LCL_VAR_ADDR && - indirDst->OperGet() != GT_CLS_VAR_ADDR && indirDst->OperGet() != GT_CNS_INT) + if (!indirDst->OperIs(GT_LEA, GT_LCL_VAR, GT_LCL_VAR_ADDR, GT_CLS_VAR_ADDR, GT_CNS_INT)) { storeInd->SetRMWStatus(STOREIND_RMW_UNSUPPORTED_ADDR); return false; @@ -4452,14 +4455,13 @@ bool Lowering::LowerRMWMemOp(GenTreeIndir* storeInd) } else { - assert(indirCandidateChild->OperGet() == GT_LCL_VAR || indirCandidateChild->OperGet() == GT_LCL_VAR_ADDR || - indirCandidateChild->OperGet() == GT_CLS_VAR_ADDR || indirCandidateChild->OperGet() == GT_CNS_INT); + assert(indirCandidateChild->OperIs(GT_LCL_VAR, GT_LCL_VAR_ADDR, GT_CLS_VAR_ADDR, GT_CNS_INT)); // If it is a GT_LCL_VAR, it still needs the reg to hold the address. // We would still need a reg for GT_CNS_INT if it doesn't fit within addressing mode base. // For GT_CLS_VAR_ADDR, we don't need a reg to hold the address, because field address value is known at jit // time. Also, we don't need a reg for GT_CLS_VAR_ADDR. - if (indirCandidateChild->OperGet() == GT_LCL_VAR_ADDR || indirCandidateChild->OperGet() == GT_CLS_VAR_ADDR) + if (indirCandidateChild->OperIs(GT_LCL_VAR_ADDR, GT_CLS_VAR_ADDR)) { indirDst->SetContained(); } @@ -4616,10 +4618,10 @@ void Lowering::ContainCheckIntrinsic(GenTreeOp* node) { assert(node->OperIs(GT_INTRINSIC)); - CorInfoIntrinsics intrinsicId = node->AsIntrinsic()->gtIntrinsicId; + NamedIntrinsic intrinsicName = node->AsIntrinsic()->gtIntrinsicName; - if (intrinsicId == CORINFO_INTRINSIC_Sqrt || intrinsicId == CORINFO_INTRINSIC_Round || - intrinsicId == CORINFO_INTRINSIC_Ceiling || intrinsicId == CORINFO_INTRINSIC_Floor) + if (intrinsicName == NI_System_Math_Sqrt || intrinsicName == NI_System_Math_Round || + intrinsicName == NI_System_Math_Ceiling || intrinsicName == NI_System_Math_Floor) { GenTree* op1 = node->gtGetOp1(); if (IsContainableMemoryOp(op1) || op1->IsCnsNonZeroFltOrDbl()) @@ -5138,7 +5140,7 @@ void Lowering::ContainCheckHWIntrinsicAddr(GenTreeHWIntrinsic* node, GenTree* ad { assert((addr->TypeGet() == TYP_I_IMPL) || (addr->TypeGet() == TYP_BYREF)); TryCreateAddrMode(addr, true); - if ((addr->OperIs(GT_CLS_VAR_ADDR, GT_LCL_VAR_ADDR, GT_LEA) || + if ((addr->OperIs(GT_CLS_VAR_ADDR, GT_LCL_VAR_ADDR, GT_LCL_FLD_ADDR, GT_LEA) || (addr->IsCnsIntOrI() && addr->AsIntConCommon()->FitsInAddrBase(comp))) && IsSafeToContainMem(node, addr)) { @@ -5354,7 +5356,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) op2->SetRegOptional(); // TODO-XArch-CQ: For commutative nodes, either operand can be reg-optional. - // https://github.com/dotnet/coreclr/issues/6361 + // https://github.com/dotnet/runtime/issues/6358 } break; } @@ -5540,7 +5542,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) // 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/coreclr/issues/6361 + // https://github.com/dotnet/runtime/issues/6358 // 213 form: op1 = (op2 * op1) + op3 op3->SetRegOptional(); @@ -5596,6 +5598,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) } } } + break; } case HW_Category_IMM: diff --git a/src/coreclr/src/jit/lsra.cpp b/src/coreclr/src/jit/lsra.cpp index 4f51e2890a5b..d24e1f1ff009 100644 --- a/src/coreclr/src/jit/lsra.cpp +++ b/src/coreclr/src/jit/lsra.cpp @@ -4240,7 +4240,7 @@ void LinearScan::spillInterval(Interval* interval, RefPosition* fromRefPosition // an active interval, without spilling. // // Arguments: -// regRec - the RegRecord to be unasssigned +// regRec - the RegRecord to be unassigned // // Return Value: // None. @@ -4266,7 +4266,7 @@ void LinearScan::unassignPhysRegNoSpill(RegRecord* regRec) // physical register record // // Arguments: -// regRec - the physical RegRecord to be unasssigned +// regRec - the physical RegRecord to be unassigned // spillRefPosition - The RefPosition at which the assignedInterval is to be spilled // or nullptr if we aren't spilling // @@ -4304,7 +4304,7 @@ void LinearScan::checkAndClearInterval(RegRecord* regRec, RefPosition* spillRefP // assignedInterval at the given spillRefPosition, if any. // // Arguments: -// regRec - The RegRecord to be unasssigned +// regRec - The RegRecord to be unassigned // newRegType - The RegisterType of interval that would be assigned // // Return Value: @@ -4356,7 +4356,7 @@ void LinearScan::unassignPhysReg(RegRecord* regRec ARM_ARG(RegisterType newRegTy // assignedInterval at the given spillRefPosition, if any. // // Arguments: -// regRec - the RegRecord to be unasssigned +// regRec - the RegRecord to be unassigned // spillRefPosition - The RefPosition at which the assignedInterval is to be spilled // // Return Value: diff --git a/src/coreclr/src/jit/lsraarm.cpp b/src/coreclr/src/jit/lsraarm.cpp index f3b480fddd6d..ad345d9acdcf 100644 --- a/src/coreclr/src/jit/lsraarm.cpp +++ b/src/coreclr/src/jit/lsraarm.cpp @@ -226,7 +226,7 @@ int LinearScan::BuildNode(GenTree* tree) { return 0; } - __fallthrough; + FALLTHROUGH; case GT_LCL_FLD: { @@ -251,7 +251,7 @@ int LinearScan::BuildNode(GenTree* tree) { dstCount = compiler->lvaGetDesc(tree->AsLclVar()->GetLclNum())->lvFieldCnt; } - __fallthrough; + FALLTHROUGH; case GT_STORE_LCL_FLD: srcCount = BuildStoreLoc(tree->AsLclVarCommon()); @@ -290,10 +290,10 @@ int LinearScan::BuildNode(GenTree* tree) BuildUse(op1); srcCount = 1; - switch (tree->AsIntrinsic()->gtIntrinsicId) + switch (tree->AsIntrinsic()->gtIntrinsicName) { - case CORINFO_INTRINSIC_Abs: - case CORINFO_INTRINSIC_Sqrt: + case NI_System_Math_Abs: + case NI_System_Math_Sqrt: assert(dstCount == 1); BuildDef(tree); break; @@ -365,7 +365,7 @@ int LinearScan::BuildNode(GenTree* tree) break; } - __fallthrough; + FALLTHROUGH; case GT_AND: case GT_OR: @@ -404,7 +404,7 @@ int LinearScan::BuildNode(GenTree* tree) setInternalRegsDelayFree = true; buildInternalIntRegisterDefForNode(tree); } - __fallthrough; + FALLTHROUGH; case GT_DIV: case GT_MULHI: @@ -477,7 +477,7 @@ int LinearScan::BuildNode(GenTree* tree) buildInternalIntRegisterDefForNode(tree); buildInternalIntRegisterDefForNode(tree); } - __fallthrough; + FALLTHROUGH; case GT_CNS_INT: { @@ -491,6 +491,8 @@ int LinearScan::BuildNode(GenTree* tree) case GT_RETURN: srcCount = BuildReturn(tree); + killMask = getKillSetForReturn(); + BuildDefsWithKills(tree, 0, RBM_NONE, killMask); break; case GT_RETFILT: @@ -699,7 +701,8 @@ int LinearScan::BuildNode(GenTree* tree) // that overlaps with all the source registers. assert(!"Should never see GT_NULLCHECK on Arm/32"); #endif - // For Arm64 we simply fall through to the GT_IND case, and will use REG_ZR as the target. + // For Arm64 we simply fall through to the GT_IND case, and will use REG_ZR as the target. + FALLTHROUGH; case GT_IND: assert(dstCount == (tree->OperIs(GT_NULLCHECK) ? 0 : 1)); srcCount = BuildIndir(tree->AsIndir()); diff --git a/src/coreclr/src/jit/lsraarm64.cpp b/src/coreclr/src/jit/lsraarm64.cpp index 514ed90feef4..9c67a05cc556 100644 --- a/src/coreclr/src/jit/lsraarm64.cpp +++ b/src/coreclr/src/jit/lsraarm64.cpp @@ -83,7 +83,7 @@ int LinearScan::BuildNode(GenTree* tree) { return 0; } - __fallthrough; + FALLTHROUGH; case GT_LCL_FLD: { @@ -108,7 +108,7 @@ int LinearScan::BuildNode(GenTree* tree) { dstCount = compiler->lvaGetDesc(tree->AsLclVar()->GetLclNum())->lvFieldCnt; } - __fallthrough; + FALLTHROUGH; case GT_STORE_LCL_FLD: srcCount = BuildStoreLoc(tree->AsLclVarCommon()); @@ -159,7 +159,7 @@ int LinearScan::BuildNode(GenTree* tree) buildInternalRegisterUses(); } } - __fallthrough; + FALLTHROUGH; case GT_CNS_INT: { @@ -266,7 +266,7 @@ int LinearScan::BuildNode(GenTree* tree) assert(tree->gtGetOp1()->TypeGet() == tree->gtGetOp2()->TypeGet()); } - __fallthrough; + FALLTHROUGH; case GT_AND: case GT_OR: @@ -304,7 +304,7 @@ int LinearScan::BuildNode(GenTree* tree) buildInternalIntRegisterDefForNode(tree); setInternalRegsDelayFree = true; } - __fallthrough; + FALLTHROUGH; case GT_DIV: case GT_MULHI: @@ -319,11 +319,11 @@ int LinearScan::BuildNode(GenTree* tree) case GT_INTRINSIC: { - noway_assert((tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Abs) || - (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Ceiling) || - (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Floor) || - (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Round) || - (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Sqrt)); + noway_assert((tree->AsIntrinsic()->gtIntrinsicName == NI_System_Math_Abs) || + (tree->AsIntrinsic()->gtIntrinsicName == NI_System_Math_Ceiling) || + (tree->AsIntrinsic()->gtIntrinsicName == NI_System_Math_Floor) || + (tree->AsIntrinsic()->gtIntrinsicName == NI_System_Math_Round) || + (tree->AsIntrinsic()->gtIntrinsicName == NI_System_Math_Sqrt)); // Both operand and its result must be of the same floating point type. GenTree* op1 = tree->gtGetOp1(); @@ -905,7 +905,7 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) case SIMDIntrinsicWiden: case SIMDIntrinsicInvalid: assert(!"These intrinsics should not be seen during register allocation"); - __fallthrough; + FALLTHROUGH; default: noway_assert(!"Unimplemented SIMD node type."); @@ -1050,9 +1050,24 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) if (intrin.op1 != nullptr) { - // If we have an RMW intrinsic, we want to preference op1Reg to the target if - // op1 is not contained. - if (isRMW) + bool simdRegToSimdRegMove = false; + + if ((intrin.id == NI_Vector64_CreateScalarUnsafe) || (intrin.id == NI_Vector128_CreateScalarUnsafe)) + { + simdRegToSimdRegMove = varTypeIsFloating(intrin.op1); + } + else if (intrin.id == NI_AdvSimd_Arm64_DuplicateToVector64) + { + simdRegToSimdRegMove = (intrin.op1->TypeGet() == TYP_DOUBLE); + } + else if ((intrin.id == NI_Vector64_ToScalar) || (intrin.id == NI_Vector128_ToScalar)) + { + simdRegToSimdRegMove = varTypeIsFloating(intrinsicTree); + } + + // If we have an RMW intrinsic or an intrinsic with simple move semantic between two SIMD registers, + // we want to preference op1Reg to the target if op1 is not contained. + if (isRMW || simdRegToSimdRegMove) { tgtPrefOp1 = !intrin.op1->isContained(); } @@ -1119,29 +1134,62 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) { if (intrin.op2 != nullptr) { - if (isRMW) + // RMW intrinsic operands doesn't have to be delayFree when they can be assigned the same register as op1Reg + // (i.e. a register that corresponds to read-modify-write operand) and one of them is the last use. + + bool op2DelayFree = isRMW; + bool op3DelayFree = isRMW; + bool op4DelayFree = isRMW; + + assert(intrin.op1 != nullptr); + + if (isRMW && intrin.op1->OperIs(GT_LCL_VAR)) { - srcCount += BuildDelayFreeUses(intrin.op2); + unsigned int varNum1 = intrin.op1->AsLclVar()->GetLclNum(); + bool op1LastUse = false; + + unsigned int varNum2 = BAD_VAR_NUM; + unsigned int varNum3 = BAD_VAR_NUM; + unsigned int varNum4 = BAD_VAR_NUM; + + if (intrin.op2->OperIs(GT_LCL_VAR)) + { + varNum2 = intrin.op2->AsLclVar()->GetLclNum(); + op1LastUse |= ((varNum1 == varNum2) && intrin.op2->HasLastUse()); + } if (intrin.op3 != nullptr) { - srcCount += BuildDelayFreeUses(intrin.op3); + if (intrin.op3->OperIs(GT_LCL_VAR)) + { + varNum3 = intrin.op3->AsLclVar()->GetLclNum(); + op1LastUse |= ((varNum1 == varNum3) && intrin.op3->HasLastUse()); + } - if (intrin.op4 != nullptr) + if ((intrin.op4 != nullptr) && intrin.op4->OperIs(GT_LCL_VAR)) { - srcCount += BuildDelayFreeUses(intrin.op4); + varNum4 = intrin.op4->AsLclVar()->GetLclNum(); + op1LastUse |= ((varNum1 == varNum4) && intrin.op4->HasLastUse()); } } + + if (op1LastUse) + { + op2DelayFree = (varNum1 != varNum2); + op3DelayFree = (varNum1 != varNum3); + op4DelayFree = (varNum1 != varNum4); + } } - else + + srcCount += op2DelayFree ? BuildDelayFreeUses(intrin.op2) : BuildOperandUses(intrin.op2); + + if (intrin.op3 != nullptr) { - srcCount += BuildOperandUses(intrin.op2); + srcCount += op3DelayFree ? BuildDelayFreeUses(intrin.op3) : BuildOperandUses(intrin.op3); - if (intrin.op3 != nullptr) + if (intrin.op4 != nullptr) { - assert(intrin.op4 == nullptr); - - srcCount += BuildOperandUses(intrin.op3); + srcCount += op4DelayFree ? BuildDelayFreeUses(intrin.op4) : BuildOperandUses(intrin.op4); } } } diff --git a/src/coreclr/src/jit/lsrabuild.cpp b/src/coreclr/src/jit/lsrabuild.cpp index d902b3a1ab4e..7b581f2c66f6 100644 --- a/src/coreclr/src/jit/lsrabuild.cpp +++ b/src/coreclr/src/jit/lsrabuild.cpp @@ -2180,15 +2180,24 @@ void LinearScan::buildIntervals() if (argDsc->lvPromotedStruct()) { - noway_assert(argDsc->lvFieldCnt == 1); // We only handle one field here - - unsigned fieldVarNum = argDsc->lvFieldLclStart; - argDsc = &(compiler->lvaTable[fieldVarNum]); + for (unsigned fieldVarNum = argDsc->lvFieldLclStart; + fieldVarNum < argDsc->lvFieldLclStart + argDsc->lvFieldCnt; ++fieldVarNum) + { + LclVarDsc* fieldVarDsc = compiler->lvaGetDesc(fieldVarNum); + noway_assert(fieldVarDsc->lvIsParam); + if (!fieldVarDsc->lvTracked && fieldVarDsc->lvIsRegArg) + { + updateRegStateForArg(fieldVarDsc); + } + } } - noway_assert(argDsc->lvIsParam); - if (!argDsc->lvTracked && argDsc->lvIsRegArg) + else { - updateRegStateForArg(argDsc); + noway_assert(argDsc->lvIsParam); + if (!argDsc->lvTracked && argDsc->lvIsRegArg) + { + updateRegStateForArg(argDsc); + } } } @@ -3443,10 +3452,15 @@ int LinearScan::BuildReturn(GenTree* tree) if (varTypeIsSIMD(tree) && !op1->IsMultiRegLclVar()) { useCandidates = allSIMDRegs(); + if (op1->OperGet() == GT_LCL_VAR) + { + assert(op1->TypeGet() != TYP_SIMD32); + useCandidates = RBM_DOUBLERET; + } BuildUse(op1, useCandidates); return 1; } -#endif // !TARGET_ARM64 +#endif // TARGET_ARM64 if (varTypeIsStruct(tree)) { @@ -3470,7 +3484,7 @@ int LinearScan::BuildReturn(GenTree* tree) assert(compiler->lvaEnregMultiRegVars); LclVarDsc* varDsc = compiler->lvaGetDesc(op1->AsLclVar()->GetLclNum()); ReturnTypeDesc retTypeDesc; - retTypeDesc.InitializeStructReturnType(compiler, varDsc->lvVerTypeInfo.GetClassHandle()); + retTypeDesc.InitializeStructReturnType(compiler, varDsc->GetStructHnd()); pRetTypeDesc = &retTypeDesc; assert(compiler->lvaGetDesc(op1->AsLclVar()->GetLclNum())->lvFieldCnt == retTypeDesc.GetReturnRegCount()); diff --git a/src/coreclr/src/jit/lsraxarch.cpp b/src/coreclr/src/jit/lsraxarch.cpp index 8895dc95ecec..02f739d15ddc 100644 --- a/src/coreclr/src/jit/lsraxarch.cpp +++ b/src/coreclr/src/jit/lsraxarch.cpp @@ -90,7 +90,7 @@ int LinearScan::BuildNode(GenTree* tree) { return 0; } - __fallthrough; + FALLTHROUGH; case GT_LCL_FLD: { @@ -323,7 +323,7 @@ int LinearScan::BuildNode(GenTree* tree) #if defined(TARGET_X86) case GT_MUL_LONG: dstCount = 2; - __fallthrough; + FALLTHROUGH; #endif case GT_MUL: case GT_MULHI: @@ -1280,6 +1280,11 @@ int LinearScan::BuildBlockStore(GenTreeBlk* blkNode) regMaskTP srcRegMask = RBM_NONE; regMaskTP sizeRegMask = RBM_NONE; + RefPosition* internalIntDef = nullptr; +#ifdef TARGET_X86 + bool internalIsByte = false; +#endif + if (blkNode->OperIsInitBlkOp()) { if (src->OperIs(GT_INIT_VAL)) @@ -1359,10 +1364,11 @@ int LinearScan::BuildBlockStore(GenTreeBlk* blkNode) if ((size & 1) != 0) { // We'll need to store a byte so a byte register is needed on x86. - regMask = allByteRegs(); + regMask = allByteRegs(); + internalIsByte = true; } #endif - buildInternalIntRegisterDefForNode(blkNode, regMask); + internalIntDef = buildInternalIntRegisterDefForNode(blkNode, regMask); } if (size >= XMM_REGSIZE_BYTES) @@ -1436,9 +1442,30 @@ int LinearScan::BuildBlockStore(GenTreeBlk* blkNode) BuildUse(blkNode->AsDynBlk()->gtDynamicSize, sizeRegMask); } +#ifdef TARGET_X86 + // If we require a byte register on x86, we may run into an over-constrained situation + // if we have BYTE_REG_COUNT or more uses (currently, it can be at most 4, if both the + // source and destination have base+index addressing). + // This is because the byteable register requirement doesn't "reserve" a specific register, + // and it would be possible for the incoming sources to all be occupying the byteable + // registers, leaving none free for the internal register. + // In this scenario, we will require rax to ensure that it is reserved and available. + // We need to make that modification prior to building the uses for the internal register, + // so that when we create the use we will also create the RefTypeFixedRef on the RegRecord. + // We don't expect a useCount of more than 3 for the initBlk case, so we haven't set + // internalIsByte in that case above. + assert((useCount < BYTE_REG_COUNT) || !blkNode->OperIsInitBlkOp()); + if (internalIsByte && (useCount >= BYTE_REG_COUNT)) + { + noway_assert(internalIntDef != nullptr); + internalIntDef->registerAssignment = RBM_RAX; + } +#endif + buildInternalRegisterUses(); regMaskTP killMask = getKillSetForBlockStore(blkNode); BuildDefsWithKills(blkNode, 0, RBM_NONE, killMask); + return useCount; } @@ -1594,6 +1621,15 @@ int LinearScan::BuildPutArgStk(GenTreePutArgStk* putArgStk) srcCount = BuildOperandUses(src); buildInternalRegisterUses(); + +#ifdef TARGET_X86 + // There are only 4 (BYTE_REG_COUNT) byteable registers on x86. If we require a byteable internal register, + // we must have less than BYTE_REG_COUNT sources. + // If we have BYTE_REG_COUNT or more sources, and require a byteable internal register, we need to reserve + // one explicitly (see BuildBlockStore()). + assert(srcCount < BYTE_REG_COUNT); +#endif + return srcCount; } #endif // FEATURE_PUT_STRUCT_ARG_STK @@ -1779,9 +1815,9 @@ int LinearScan::BuildIntrinsic(GenTree* tree) assert(op1->TypeGet() == tree->TypeGet()); RefPosition* internalFloatDef = nullptr; - switch (tree->AsIntrinsic()->gtIntrinsicId) + switch (tree->AsIntrinsic()->gtIntrinsicName) { - case CORINFO_INTRINSIC_Abs: + case NI_System_Math_Abs: // Abs(float x) = x & 0x7fffffff // Abs(double x) = x & 0x7ffffff ffffffff @@ -1798,16 +1834,16 @@ int LinearScan::BuildIntrinsic(GenTree* tree) break; #ifdef TARGET_X86 - case CORINFO_INTRINSIC_Cos: - case CORINFO_INTRINSIC_Sin: + case NI_System_Math_Cos: + case NI_System_Math_Sin: NYI_X86("Math intrinsics Cos and Sin"); break; #endif // TARGET_X86 - case CORINFO_INTRINSIC_Sqrt: - case CORINFO_INTRINSIC_Round: - case CORINFO_INTRINSIC_Ceiling: - case CORINFO_INTRINSIC_Floor: + case NI_System_Math_Sqrt: + case NI_System_Math_Round: + case NI_System_Math_Ceiling: + case NI_System_Math_Floor: break; default: @@ -2728,6 +2764,7 @@ int LinearScan::BuildIndir(GenTreeIndir* indirTree) } } } + #ifdef FEATURE_SIMD if (varTypeIsSIMD(indirTree)) { @@ -2736,6 +2773,16 @@ int LinearScan::BuildIndir(GenTreeIndir* indirTree) buildInternalRegisterUses(); #endif // FEATURE_SIMD +#ifdef TARGET_X86 + // There are only BYTE_REG_COUNT byteable registers on x86. If we have a source that requires + // such a register, we must have no more than BYTE_REG_COUNT sources. + // If we have more than BYTE_REG_COUNT sources, and require a byteable register, we need to reserve + // one explicitly (see BuildBlockStore()). + // (Note that the assert below doesn't count internal registers because we only have + // floating point internal registers, if any). + assert(srcCount <= BYTE_REG_COUNT); +#endif + if (indirTree->gtOper != GT_STOREIND) { BuildDef(indirTree); diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index c333a2799fe4..d74e851be899 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -77,8 +77,10 @@ GenTree* Compiler::fgMorphIntoHelperCall(GenTree* tree, int helper, GenTreeCall: #if DEBUG // Helper calls are never candidates. - call->gtInlineObservation = InlineObservation::CALLSITE_IS_CALL_TO_HELPER; + + call->callSig = nullptr; + #endif // DEBUG #ifdef FEATURE_READYTORUN_COMPILER @@ -767,7 +769,7 @@ GenTree* Compiler::fgMorphCast(GenTree* tree) #endif #ifdef DEBUG -void fgArgTabEntry::Dump() +void fgArgTabEntry::Dump() const { printf("fgArgTabEntry[arg %u", argNum); printf(" %d.%s", GetNode()->gtTreeID, GenTree::OpName(GetNode()->OperGet())); @@ -781,11 +783,16 @@ void fgArgTabEntry::Dump() printf(" %s", getRegName(regNums[i])); } } - if (numSlots > 0) + if (GetStackByteSize() > 0) { - printf(", numSlots=%u, slotNum=%u", numSlots, slotNum); +#if defined(DEBUG_ARG_SLOTS) + printf(", numSlots=%u, slotNum=%u, byteSize=%u, byteOffset=%u", numSlots, slotNum, m_byteSize, m_byteOffset); +#else + printf(", byteSize=%u, byteOffset=%u", m_byteSize, m_byteOffset); + +#endif } - printf(", align=%u", alignment); + printf(", byteAlignment=%u", byteAlignment); if (isLateArg()) { printf(", lateArgInx=%u", GetLateArgInx()); @@ -832,11 +839,12 @@ void fgArgTabEntry::Dump() fgArgInfo::fgArgInfo(Compiler* comp, GenTreeCall* call, unsigned numArgs) { - compiler = comp; - callTree = call; - argCount = 0; // filled in arg count, starts at zero - nextSlotNum = INIT_ARG_STACK_SLOT; - stkLevel = 0; + compiler = comp; + callTree = call; + argCount = 0; // filled in arg count, starts at zero + DEBUG_ARG_SLOTS_ONLY(nextSlotNum = INIT_ARG_STACK_SLOT;) + nextStackByteOffset = INIT_ARG_STACK_SLOT * TARGET_POINTER_SIZE; + stkLevel = 0; #if defined(UNIX_X86_ABI) alignmentDone = false; stkSizeBytes = 0; @@ -879,11 +887,12 @@ fgArgInfo::fgArgInfo(GenTreeCall* newCall, GenTreeCall* oldCall) { fgArgInfo* oldArgInfo = oldCall->AsCall()->fgArgInfo; - compiler = oldArgInfo->compiler; - callTree = newCall; - argCount = 0; // filled in arg count, starts at zero - nextSlotNum = INIT_ARG_STACK_SLOT; - stkLevel = oldArgInfo->stkLevel; + compiler = oldArgInfo->compiler; + callTree = newCall; + argCount = 0; // filled in arg count, starts at zero + DEBUG_ARG_SLOTS_ONLY(nextSlotNum = INIT_ARG_STACK_SLOT;) + nextStackByteOffset = INIT_ARG_STACK_SLOT * TARGET_POINTER_SIZE; + stkLevel = oldArgInfo->stkLevel; #if defined(UNIX_X86_ABI) alignmentDone = oldArgInfo->alignmentDone; stkSizeBytes = oldArgInfo->stkSizeBytes; @@ -957,8 +966,10 @@ fgArgInfo::fgArgInfo(GenTreeCall* newCall, GenTreeCall* oldCall) } } - argCount = oldArgInfo->argCount; - nextSlotNum = oldArgInfo->nextSlotNum; + argCount = oldArgInfo->argCount; + DEBUG_ARG_SLOTS_ONLY(nextSlotNum = oldArgInfo->nextSlotNum;) + nextStackByteOffset = oldArgInfo->nextStackByteOffset; + hasRegArgs = oldArgInfo->hasRegArgs; hasStackArgs = oldArgInfo->hasStackArgs; argsComplete = true; @@ -977,7 +988,8 @@ fgArgTabEntry* fgArgInfo::AddRegArg(unsigned argNum, GenTreeCall::Use* use, regNumber regNum, unsigned numRegs, - unsigned alignment, + unsigned byteSize, + unsigned byteAlignment, bool isStruct, bool isVararg /*=false*/) { @@ -989,14 +1001,18 @@ fgArgTabEntry* fgArgInfo::AddRegArg(unsigned argNum, // may actually be less. curArgTabEntry->setRegNum(0, regNum); - curArgTabEntry->argNum = argNum; - curArgTabEntry->argType = node->TypeGet(); - curArgTabEntry->use = use; - curArgTabEntry->lateUse = nullptr; - curArgTabEntry->slotNum = 0; - curArgTabEntry->numRegs = numRegs; - curArgTabEntry->numSlots = 0; - curArgTabEntry->alignment = alignment; + curArgTabEntry->argNum = argNum; + curArgTabEntry->argType = node->TypeGet(); + curArgTabEntry->use = use; + curArgTabEntry->lateUse = nullptr; + curArgTabEntry->numRegs = numRegs; + +#if defined(DEBUG_ARG_SLOTS) + curArgTabEntry->slotNum = 0; + curArgTabEntry->numSlots = 0; +#endif + + curArgTabEntry->byteAlignment = byteAlignment; curArgTabEntry->SetLateArgInx(UINT_MAX); curArgTabEntry->tmpNum = BAD_VAR_NUM; curArgTabEntry->SetSplit(false); @@ -1011,6 +1027,8 @@ fgArgTabEntry* fgArgInfo::AddRegArg(unsigned argNum, curArgTabEntry->isNonStandard = false; curArgTabEntry->isStruct = isStruct; curArgTabEntry->SetIsVararg(isVararg); + curArgTabEntry->SetByteSize(byteSize); + curArgTabEntry->SetByteOffset(0); hasRegArgs = true; AddArg(curArgTabEntry); @@ -1023,7 +1041,8 @@ fgArgTabEntry* fgArgInfo::AddRegArg(unsigned GenTreeCall::Use* use, regNumber regNum, unsigned numRegs, - unsigned alignment, + unsigned byteSize, + unsigned byteAlignment, const bool isStruct, const bool isVararg, const regNumber otherRegNum, @@ -1031,14 +1050,15 @@ fgArgTabEntry* fgArgInfo::AddRegArg(unsigned const unsigned structFloatRegs, const SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* const structDescPtr) { - fgArgTabEntry* curArgTabEntry = AddRegArg(argNum, node, use, regNum, numRegs, alignment, isStruct, isVararg); + fgArgTabEntry* curArgTabEntry = + AddRegArg(argNum, node, use, regNum, numRegs, byteSize, byteAlignment, isStruct, isVararg); assert(curArgTabEntry != nullptr); curArgTabEntry->isStruct = isStruct; // is this a struct arg curArgTabEntry->structIntRegs = structIntRegs; curArgTabEntry->structFloatRegs = structFloatRegs; - curArgTabEntry->checkIsStruct(); + INDEBUG(curArgTabEntry->checkIsStruct();) assert(numRegs <= 2); if (numRegs == 2) { @@ -1058,27 +1078,36 @@ fgArgTabEntry* fgArgInfo::AddStkArg(unsigned argNum, GenTree* node, GenTreeCall::Use* use, unsigned numSlots, - unsigned alignment, + unsigned byteSize, + unsigned byteAlignment, bool isStruct, bool isVararg /*=false*/) { fgArgTabEntry* curArgTabEntry = new (compiler, CMK_fgArgInfo) fgArgTabEntry; - nextSlotNum = roundUp(nextSlotNum, alignment); +#if defined(DEBUG_ARG_SLOTS) + nextSlotNum = roundUp(nextSlotNum, byteAlignment / TARGET_POINTER_SIZE); +#endif + + nextStackByteOffset = roundUp(nextStackByteOffset, byteAlignment); + DEBUG_ARG_SLOTS_ASSERT(nextStackByteOffset / TARGET_POINTER_SIZE == nextSlotNum); curArgTabEntry->setRegNum(0, REG_STK); curArgTabEntry->argNum = argNum; curArgTabEntry->argType = node->TypeGet(); curArgTabEntry->use = use; curArgTabEntry->lateUse = nullptr; - curArgTabEntry->slotNum = nextSlotNum; +#if defined(DEBUG_ARG_SLOTS) + curArgTabEntry->numSlots = numSlots; + curArgTabEntry->slotNum = nextSlotNum; +#endif + curArgTabEntry->numRegs = 0; #if defined(UNIX_AMD64_ABI) curArgTabEntry->structIntRegs = 0; curArgTabEntry->structFloatRegs = 0; #endif // defined(UNIX_AMD64_ABI) - curArgTabEntry->numSlots = numSlots; - curArgTabEntry->alignment = alignment; + curArgTabEntry->byteAlignment = byteAlignment; curArgTabEntry->SetLateArgInx(UINT_MAX); curArgTabEntry->tmpNum = BAD_VAR_NUM; curArgTabEntry->SetSplit(false); @@ -1094,16 +1123,20 @@ fgArgTabEntry* fgArgInfo::AddStkArg(unsigned argNum, curArgTabEntry->isStruct = isStruct; curArgTabEntry->SetIsVararg(isVararg); + curArgTabEntry->SetByteSize(byteSize); + curArgTabEntry->SetByteOffset(nextStackByteOffset); + hasStackArgs = true; AddArg(curArgTabEntry); - - nextSlotNum += numSlots; + DEBUG_ARG_SLOTS_ONLY(nextSlotNum += numSlots;) + nextStackByteOffset += byteSize; return curArgTabEntry; } void fgArgInfo::RemorphReset() { - nextSlotNum = INIT_ARG_STACK_SLOT; + DEBUG_ARG_SLOTS_ONLY(nextSlotNum = INIT_ARG_STACK_SLOT;) + nextStackByteOffset = INIT_ARG_STACK_SLOT * TARGET_POINTER_SIZE; } //------------------------------------------------------------------------ @@ -1149,10 +1182,22 @@ void fgArgInfo::UpdateStkArg(fgArgTabEntry* curArgTabEntry, GenTree* node, bool noway_assert(curArgTabEntry->use != callTree->gtCallThisArg); assert((curArgTabEntry->GetRegNum() == REG_STK) || curArgTabEntry->IsSplit()); assert(curArgTabEntry->use->GetNode() == node); - nextSlotNum = (unsigned)roundUp(nextSlotNum, curArgTabEntry->alignment); +#if defined(DEBUG_ARG_SLOTS) + nextSlotNum = roundUp(nextSlotNum, curArgTabEntry->byteAlignment / TARGET_POINTER_SIZE); assert(curArgTabEntry->slotNum == nextSlotNum); - nextSlotNum += curArgTabEntry->numSlots; +#endif + nextStackByteOffset = roundUp(nextStackByteOffset, curArgTabEntry->byteAlignment); + assert(curArgTabEntry->GetByteOffset() == nextStackByteOffset); + + if (!curArgTabEntry->IsSplit()) + { + nextStackByteOffset += curArgTabEntry->GetByteSize(); + } + else + { + nextStackByteOffset += curArgTabEntry->GetStackByteSize(); + } } void fgArgInfo::SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots) @@ -1175,17 +1220,20 @@ void fgArgInfo::SplitArg(unsigned argNum, unsigned numRegs, unsigned numSlots) { assert(curArgTabEntry->IsSplit() == true); assert(curArgTabEntry->numRegs == numRegs); - assert(curArgTabEntry->numSlots == numSlots); + DEBUG_ARG_SLOTS_ONLY(assert(curArgTabEntry->numSlots == numSlots);) assert(hasStackArgs == true); } else { curArgTabEntry->SetSplit(true); - curArgTabEntry->numRegs = numRegs; - curArgTabEntry->numSlots = numSlots; - hasStackArgs = true; - } - nextSlotNum += numSlots; + curArgTabEntry->numRegs = numRegs; + DEBUG_ARG_SLOTS_ONLY(curArgTabEntry->numSlots = numSlots;) + curArgTabEntry->SetByteOffset(0); + hasStackArgs = true; + } + DEBUG_ARG_SLOTS_ONLY(nextSlotNum += numSlots;) + // TODO-Cleanup: structs are aligned to 8 bytes on arm64 apple, so it would work, but pass the precise size. + nextStackByteOffset += numSlots * TARGET_POINTER_SIZE; } //------------------------------------------------------------------------ @@ -1378,7 +1426,8 @@ void fgArgInfo::ArgsComplete() // CLANG_FORMAT_COMMENT_ANCHOR; #ifdef TARGET_ARM - bool isMultiRegArg = (curArgTabEntry->numRegs > 0) && (curArgTabEntry->numRegs + curArgTabEntry->numSlots > 1); + bool isMultiRegArg = + (curArgTabEntry->numRegs > 0) && (curArgTabEntry->numRegs + curArgTabEntry->GetStackSlotsNumber() > 1); #else bool isMultiRegArg = (curArgTabEntry->numRegs > 1); #endif @@ -1859,7 +1908,7 @@ void fgArgInfo::SortArgs() } #ifdef DEBUG -void fgArgInfo::Dump(Compiler* compiler) +void fgArgInfo::Dump(Compiler* compiler) const { for (unsigned curInx = 0; curInx < ArgCount(); curInx++) { @@ -1901,9 +1950,9 @@ GenTree* Compiler::fgMakeTmpArgNode(fgArgTabEntry* curArgTabEntry) // Otherwise, it will return TYP_UNKNOWN and we will pass it as a struct type. bool passedAsPrimitive = false; - if (curArgTabEntry->isSingleRegOrSlot()) + if (curArgTabEntry->TryPassAsPrimitive()) { - CORINFO_CLASS_HANDLE clsHnd = varDsc->lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE clsHnd = varDsc->GetStructHnd(); var_types structBaseType = getPrimitiveTypeForStruct(lvaLclExactSize(tmpVarNum), clsHnd, curArgTabEntry->IsVararg()); @@ -2384,7 +2433,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) unsigned argIndex = 0; unsigned intArgRegNum = 0; unsigned fltArgRegNum = 0; - unsigned argSlots = 0; + DEBUG_ARG_SLOTS_ONLY(unsigned argSlots = 0;) bool callHasRetBuffArg = call->HasRetBufArg(); bool callIsVararg = call->IsVarargs(); @@ -2677,7 +2726,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) *insertionPoint = gtNewCallArgs(arg); #else // !defined(TARGET_X86) // All other architectures pass the cookie in a register. - call->gtCallArgs = gtPrependNewCallArg(arg, call->gtCallArgs); + call->gtCallArgs = gtPrependNewCallArg(arg, call->gtCallArgs); #endif // defined(TARGET_X86) nonStandardArgs.Add(arg, REG_PINVOKE_COOKIE_PARAM); @@ -2707,6 +2756,13 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) indirectCellAddress->AsIntCon()->gtTargetHandle = (size_t)call->gtCallMethHnd; #endif indirectCellAddress->SetRegNum(REG_R2R_INDIRECT_PARAM); +#ifdef TARGET_ARM + // Issue #xxxx : Don't attempt to CSE this constant on ARM32 + // + // This constant has specific register requirements, and LSRA doesn't currently correctly + // handle them when the value is in a CSE'd local. + indirectCellAddress->SetDoNotCSE(); +#endif // TARGET_ARM // Push the stub address onto the list of arguments. call->gtCallArgs = gtPrependNewCallArg(indirectCellAddress, call->gtCallArgs); @@ -2729,10 +2785,16 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) assert(call->gtCallType == CT_USER_FUNC || call->gtCallType == CT_INDIRECT); assert(varTypeIsGC(argx) || (argx->gtType == TYP_I_IMPL)); + const regNumber regNum = genMapIntRegArgNumToRegNum(intArgRegNum); + const unsigned numRegs = 1; + const unsigned byteSize = TARGET_POINTER_SIZE; + const unsigned byteAlignment = TARGET_POINTER_SIZE; + const bool isStruct = false; + // This is a register argument - put it in the table. - call->fgArgInfo->AddRegArg(argIndex, argx, call->gtCallThisArg, genMapIntRegArgNumToRegNum(intArgRegNum), 1, 1, - false, callIsVararg UNIX_AMD64_ABI_ONLY_ARG(REG_STK) UNIX_AMD64_ABI_ONLY_ARG(0) - UNIX_AMD64_ABI_ONLY_ARG(0) UNIX_AMD64_ABI_ONLY_ARG(nullptr)); + call->fgArgInfo->AddRegArg(argIndex, argx, call->gtCallThisArg, regNum, numRegs, byteSize, byteAlignment, + isStruct, callIsVararg UNIX_AMD64_ABI_ONLY_ARG(REG_STK) UNIX_AMD64_ABI_ONLY_ARG(0) + UNIX_AMD64_ABI_ONLY_ARG(0) UNIX_AMD64_ABI_ONLY_ARG(nullptr)); intArgRegNum++; #ifdef WINDOWS_AMD64_ABI @@ -2741,7 +2803,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) fltArgRegNum++; #endif // WINDOWS_AMD64_ABI argIndex++; - argSlots++; + DEBUG_ARG_SLOTS_ONLY(argSlots++;) } #ifdef TARGET_X86 @@ -2849,9 +2911,14 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) var_types hfaType = TYP_UNDEF; unsigned hfaSlots = 0; - bool passUsingFloatRegs; - unsigned argAlign = 1; + bool passUsingFloatRegs; +#if !defined(OSX_ARM64_ABI) + unsigned argAlignBytes = TARGET_POINTER_SIZE; +#else + unsigned argAlignBytes = TARGET_POINTER_SIZE; // TODO-OSX-ARM64: change it after other changes are merged. +#endif unsigned size = 0; + unsigned byteSize = 0; CORINFO_CLASS_HANDLE copyBlkClass = nullptr; bool isRegArg = false; bool isNonStandard = false; @@ -2885,12 +2952,11 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) bool passUsingIntRegs = passUsingFloatRegs ? false : (intArgRegNum < MAX_REG_ARG); // We don't use the "size" return value from InferOpSizeAlign(). - codeGen->InferOpSizeAlign(argx, &argAlign); + codeGen->InferOpSizeAlign(argx, &argAlignBytes); - argAlign = roundUp(argAlign, TARGET_POINTER_SIZE); - argAlign /= TARGET_POINTER_SIZE; + argAlignBytes = roundUp(argAlignBytes, TARGET_POINTER_SIZE); - if (argAlign == 2) + if (argAlignBytes == 2 * TARGET_POINTER_SIZE) { if (passUsingFloatRegs) { @@ -2909,10 +2975,12 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) } } +#if defined(DEBUG) if (argSlots % 2 == 1) { argSlots++; } +#endif } #elif defined(TARGET_ARM64) @@ -2981,15 +3049,22 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) #ifdef UNIX_AMD64_ABI if (!isStructArg) { - size = 1; // On AMD64, all primitives fit in a single (64-bit) 'slot' + size = 1; // On AMD64, all primitives fit in a single (64-bit) 'slot' + byteSize = genTypeSize(argx); } else { - size = (unsigned)(roundUp(structSize, TARGET_POINTER_SIZE)) / TARGET_POINTER_SIZE; + size = (unsigned)(roundUp(structSize, TARGET_POINTER_SIZE)) / TARGET_POINTER_SIZE; + byteSize = structSize; eeGetSystemVAmd64PassStructInRegisterDescriptor(objClass, &structDesc); } -#else // !UNIX_AMD64_ABI +#else // !UNIX_AMD64_ABI size = 1; // On AMD64 Windows, all args fit in a single (64-bit) 'slot' + if (!isStructArg) + { + byteSize = genTypeSize(argx); + } + #endif // UNIX_AMD64_ABI #elif defined(TARGET_ARM64) if (isStructArg) @@ -2998,7 +3073,9 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) { // HFA structs are passed by value in multiple registers. // The "size" in registers may differ the size in pointer-sized units. - size = GetHfaCount(argx); + CORINFO_CLASS_HANDLE structHnd = gtGetStructHandle(argx); + size = GetHfaCount(structHnd); + byteSize = info.compCompHnd->getClassSize(structHnd); } else { @@ -3007,8 +3084,8 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) // if sufficient registers are available. // Structs that are larger than 2 pointers (except for HFAs) are passed by // reference (to a copy) - size = (unsigned)(roundUp(structSize, TARGET_POINTER_SIZE)) / TARGET_POINTER_SIZE; - + size = (unsigned)(roundUp(structSize, TARGET_POINTER_SIZE)) / TARGET_POINTER_SIZE; + byteSize = structSize; if (size > 2) { size = 1; @@ -3019,52 +3096,48 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) } else { - size = 1; // Otherwise, all primitive types fit in a single (64-bit) 'slot' + size = 1; // Otherwise, all primitive types fit in a single (64-bit) 'slot' + byteSize = genTypeSize(argx); } #elif defined(TARGET_ARM) || defined(TARGET_X86) if (isStructArg) { - size = (unsigned)(roundUp(structSize, TARGET_POINTER_SIZE)) / TARGET_POINTER_SIZE; + size = (unsigned)(roundUp(structSize, TARGET_POINTER_SIZE)) / TARGET_POINTER_SIZE; + byteSize = structSize; } else { // The typical case. // Long/double type argument(s) will be modified as needed in Lowering. - size = genTypeStSz(argx->gtType); + size = genTypeStSz(argx->gtType); + byteSize = genTypeSize(argx); } #else #error Unsupported or unset target architecture #endif // TARGET_XXX + if (isStructArg) { // We have an argument with a struct type, but it may be be a child of a GT_COMMA GenTree* argObj = argx->gtEffectiveVal(true /*commaOnly*/); assert(argx == args->GetNode()); - - unsigned originalSize = structSize; - originalSize = (originalSize == 0 ? TARGET_POINTER_SIZE : originalSize); - unsigned roundupSize = (unsigned)roundUp(originalSize, TARGET_POINTER_SIZE); - - structSize = originalSize; + assert(structSize != 0); structPassingKind howToPassStruct; - - structBaseType = getArgTypeForStruct(objClass, &howToPassStruct, callIsVararg, originalSize); - - bool passedInRegisters = false; - passStructByRef = (howToPassStruct == SPK_ByReference); + structBaseType = getArgTypeForStruct(objClass, &howToPassStruct, callIsVararg, structSize); + passStructByRef = (howToPassStruct == SPK_ByReference); + if (howToPassStruct == SPK_ByReference) + { + byteSize = TARGET_POINTER_SIZE; + } + else + { + byteSize = structSize; + } if (howToPassStruct == SPK_PrimitiveType) { -// For ARM64 or AMD64/UX we can pass non-power-of-2 structs in a register. -// For ARM or AMD64/Windows only power-of-2 structs are passed in registers. -#if !defined(TARGET_ARM64) && !defined(UNIX_AMD64_ABI) - if (!isPow2(originalSize)) -#endif // !TARGET_ARM64 && !UNIX_AMD64_ABI - { - passedInRegisters = true; - } #ifdef TARGET_ARM // TODO-CQ: getArgTypeForStruct should *not* return TYP_DOUBLE for a double struct, // or for a struct of two floats. This causes the struct to be address-taken. @@ -3086,6 +3159,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) // The 'size' value has now must have been set. (the original value of zero is an invalid value) assert(size != 0); + assert(byteSize != 0); // // Figure out if the argument will be passed in a register. @@ -3328,11 +3402,11 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) #endif // This is a register argument - put it in the table - newArgEntry = call->fgArgInfo->AddRegArg(argIndex, argx, args, nextRegNum, size, argAlign, isStructArg, - callIsVararg UNIX_AMD64_ABI_ONLY_ARG(nextOtherRegNum) - UNIX_AMD64_ABI_ONLY_ARG(structIntRegs) - UNIX_AMD64_ABI_ONLY_ARG(structFloatRegs) - UNIX_AMD64_ABI_ONLY_ARG(&structDesc)); + newArgEntry = call->fgArgInfo->AddRegArg(argIndex, argx, args, nextRegNum, size, byteSize, argAlignBytes, + isStructArg, callIsVararg UNIX_AMD64_ABI_ONLY_ARG(nextOtherRegNum) + UNIX_AMD64_ABI_ONLY_ARG(structIntRegs) + UNIX_AMD64_ABI_ONLY_ARG(structFloatRegs) + UNIX_AMD64_ABI_ONLY_ARG(&structDesc)); newArgEntry->SetIsBackFilled(isBackFilled); newArgEntry->isNonStandard = isNonStandard; @@ -3393,7 +3467,8 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) else // We have an argument that is not passed in a register { // This is a stack argument - put it in the table - newArgEntry = call->fgArgInfo->AddStkArg(argIndex, argx, args, size, argAlign, isStructArg, callIsVararg); + newArgEntry = call->fgArgInfo->AddStkArg(argIndex, argx, args, size, byteSize, argAlignBytes, isStructArg, + callIsVararg); #ifdef UNIX_AMD64_ABI // TODO-Amd64-Unix-CQ: This is temporary (see also in fgMorphArgs). if (structDesc.passedInRegisters) @@ -3422,7 +3497,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) newArgEntry->argType = argx->TypeGet(); } - argSlots += size; + DEBUG_ARG_SLOTS_ONLY(argSlots += size;) } // end foreach argument loop #ifdef DEBUG @@ -3484,7 +3559,8 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) unsigned flagsSummary = 0; unsigned argIndex = 0; - unsigned argSlots = 0; + + DEBUG_ARG_SLOTS_ONLY(unsigned argSlots = 0;) bool reMorphing = call->AreArgsComplete(); @@ -3523,7 +3599,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) flagsSummary |= argx->gtFlags; assert(argIndex == 0); argIndex++; - argSlots++; + DEBUG_ARG_SLOTS_ONLY(argSlots++;) } // Note that this name is a bit of a misnomer - it indicates that there are struct args @@ -3540,17 +3616,18 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) *parentArgx = argx; assert(argx == args->GetNode()); - unsigned argAlign = argEntry->alignment; - unsigned size = argEntry->getSize(); + DEBUG_ARG_SLOTS_ONLY(unsigned size = argEntry->getSize();) CORINFO_CLASS_HANDLE copyBlkClass = NO_CLASS_HANDLE; - if (argAlign == 2) +#if defined(DEBUG_ARG_SLOTS) + if (argEntry->byteAlignment == 2 * TARGET_POINTER_SIZE) { if (argSlots % 2 == 1) { argSlots++; } } +#endif // DEBUG if (argEntry->isNonStandard) { // We need to update the node field for this nonStandard arg here @@ -3559,9 +3636,8 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) flagsSummary |= argx->gtFlags; continue; } - - assert(size != 0); - argSlots += argEntry->getSlotCount(); + DEBUG_ARG_SLOTS_ASSERT(size != 0); + DEBUG_ARG_SLOTS_ONLY(argSlots += argEntry->getSlotCount();) if (argx->IsLocalAddrExpr() != nullptr) { @@ -3612,7 +3688,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) // First, handle the case where the argument is passed by reference. if (argEntry->passedByRef) { - assert(size == 1); + DEBUG_ARG_SLOTS_ASSERT(size == 1); copyBlkClass = objClass; #ifdef UNIX_AMD64_ABI assert(!"Structs are not passed by reference on x64/ux"); @@ -3624,7 +3700,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) #ifndef TARGET_X86 // Check to see if we can transform this into load of a primitive type. // 'size' must be the number of pointer sized items - assert(size == roundupSize / TARGET_POINTER_SIZE); + DEBUG_ARG_SLOTS_ASSERT(size == roundupSize / TARGET_POINTER_SIZE); structSize = originalSize; unsigned passingSize = originalSize; @@ -3721,12 +3797,11 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) // or a local. // Change our argument, as needed, into a value of the appropriate type. CLANG_FORMAT_COMMENT_ANCHOR; - #ifdef TARGET_ARM - assert((size == 1) || ((structBaseType == TYP_DOUBLE) && (size == 2))); + DEBUG_ARG_SLOTS_ASSERT((size == 1) || ((structBaseType == TYP_DOUBLE) && (size == 2))); #else - assert((size == 1) || - (varTypeIsSIMD(structBaseType) && size == (genTypeSize(structBaseType) / REGSIZE_BYTES))); + DEBUG_ARG_SLOTS_ASSERT((size == 1) || (varTypeIsSIMD(structBaseType) && + size == (genTypeSize(structBaseType) / REGSIZE_BYTES))); #endif assert((structBaseType != TYP_STRUCT) && (genTypeSize(structBaseType) >= originalSize)); @@ -3820,9 +3895,8 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) // We still have a struct unless we converted the GT_OBJ into a GT_IND above... if (isHfaArg && passUsingFloatRegs) { - size = argEntry->numRegs; } - else if (structBaseType == TYP_STRUCT) + else if ((!isHfaArg || !passUsingFloatRegs) && (structBaseType == TYP_STRUCT)) { // If the valuetype size is not a multiple of TARGET_POINTER_SIZE, // we must copyblk to a temp before doing the obj to avoid @@ -3842,8 +3916,6 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) copyBlkClass = NO_CLASS_HANDLE; } } - - size = roundupSize / TARGET_POINTER_SIZE; // Normalize size to number of pointer sized items } #endif // !UNIX_AMD64_ABI @@ -3909,7 +3981,8 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) #if FEATURE_MULTIREG_ARGS if (isStructArg) { - if (((argEntry->numRegs + argEntry->numSlots) > 1) || (isHfaArg && argx->TypeGet() == TYP_STRUCT)) + if (((argEntry->numRegs + argEntry->GetStackSlotsNumber()) > 1) || + (isHfaArg && argx->TypeGet() == TYP_STRUCT)) { hasMultiregStructArgs = true; } @@ -3923,8 +3996,8 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) else { // We must have exactly one register or slot. - assert(((argEntry->numRegs == 1) && (argEntry->numSlots == 0)) || - ((argEntry->numRegs == 0) && (argEntry->numSlots == 1))); + assert(((argEntry->numRegs == 1) && (argEntry->GetStackSlotsNumber() == 0)) || + ((argEntry->numRegs == 0) && (argEntry->GetStackSlotsNumber() == 1))); } #endif @@ -3994,21 +4067,33 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) // outgoing arg size. if (!call->IsFastTailCall()) { - unsigned preallocatedArgCount = call->fgArgInfo->GetNextSlotNum(); #if defined(UNIX_AMD64_ABI) // This is currently required for the UNIX ABI to work correctly. opts.compNeedToAlignFrame = true; #endif // UNIX_AMD64_ABI - const unsigned outgoingArgSpaceSize = preallocatedArgCount * REGSIZE_BYTES; + const unsigned outgoingArgSpaceSize = GetOutgoingArgByteSize(call->fgArgInfo->GetNextSlotByteOffset()); + +#if defined(DEBUG_ARG_SLOTS) + unsigned preallocatedArgCount = call->fgArgInfo->GetNextSlotNum(); + assert(outgoingArgSpaceSize == preallocatedArgCount * REGSIZE_BYTES); +#endif call->fgArgInfo->SetOutArgSize(max(outgoingArgSpaceSize, MIN_ARG_AREA_FOR_CALL)); #ifdef DEBUG if (verbose) { - printf("argSlots=%d, preallocatedArgCount=%d, nextSlotNum=%d, outgoingArgSpaceSize=%d\n", argSlots, - preallocatedArgCount, call->fgArgInfo->GetNextSlotNum(), outgoingArgSpaceSize); + const fgArgInfo* argInfo = call->fgArgInfo; +#if defined(DEBUG_ARG_SLOTS) + printf("argSlots=%d, preallocatedArgCount=%d, nextSlotNum=%d, nextSlotByteOffset=%d, " + "outgoingArgSpaceSize=%d\n", + argSlots, preallocatedArgCount, argInfo->GetNextSlotNum(), argInfo->GetNextSlotByteOffset(), + outgoingArgSpaceSize); +#else + printf("nextSlotByteOffset=%d, outgoingArgSpaceSize=%d\n", argInfo->GetNextSlotByteOffset(), + outgoingArgSpaceSize); +#endif } #endif } @@ -4115,7 +4200,7 @@ void Compiler::fgMorphMultiregStructArgs(GenTreeCall* call) continue; } - unsigned size = (fgEntryPtr->numRegs + fgEntryPtr->numSlots); + unsigned size = (fgEntryPtr->numRegs + fgEntryPtr->GetStackSlotsNumber()); if ((size > 1) || (fgEntryPtr->IsHfaArg() && argx->TypeGet() == TYP_STRUCT)) { foundStructArg = true; @@ -4129,6 +4214,10 @@ void Compiler::fgMorphMultiregStructArgs(GenTreeCall* call) { structSize = argx->AsObj()->GetLayout()->GetSize(); } + else if (varTypeIsSIMD(argx)) + { + structSize = genTypeSize(argx); + } else { assert(argx->OperIs(GT_LCL_VAR)); @@ -4209,7 +4298,7 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry #endif #ifdef TARGET_ARM - if ((fgEntryPtr->IsSplit() && fgEntryPtr->numSlots + fgEntryPtr->numRegs > 4) || + if ((fgEntryPtr->IsSplit() && fgEntryPtr->GetStackSlotsNumber() + fgEntryPtr->numRegs > 4) || (!fgEntryPtr->IsSplit() && fgEntryPtr->GetRegNum() == REG_STK)) #else if (fgEntryPtr->GetRegNum() == REG_STK) @@ -4255,10 +4344,9 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry #if FEATURE_MULTIREG_ARGS // Examine 'arg' and setup argValue objClass and structSize // - CORINFO_CLASS_HANDLE objClass = gtGetStructHandleIfPresent(arg); - noway_assert(objClass != NO_CLASS_HANDLE); - GenTree* argValue = arg; // normally argValue will be arg, but see right below - unsigned structSize = 0; + const CORINFO_CLASS_HANDLE objClass = gtGetStructHandle(arg); + GenTree* argValue = arg; // normally argValue will be arg, but see right below + unsigned structSize = 0; if (arg->TypeGet() != TYP_STRUCT) { @@ -4267,8 +4355,9 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry } else if (arg->OperGet() == GT_OBJ) { - GenTreeObj* argObj = arg->AsObj(); - structSize = argObj->GetLayout()->GetSize(); + GenTreeObj* argObj = arg->AsObj(); + const ClassLayout* objLayout = argObj->GetLayout(); + structSize = objLayout->GetSize(); assert(structSize == info.compCompHnd->getClassSize(objClass)); // If we have a GT_OBJ of a GT_ADDR then we set argValue to the child node of the GT_ADDR. @@ -4278,10 +4367,14 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry GenTree* underlyingTree = op1->AsOp()->gtOp1; // Only update to the same type. - if (underlyingTree->OperIs(GT_LCL_VAR) && (underlyingTree->TypeGet() == argValue->TypeGet()) && - (objClass == gtGetStructHandleIfPresent(underlyingTree))) + if (underlyingTree->OperIs(GT_LCL_VAR)) { - argValue = underlyingTree; + const GenTreeLclVar* lclVar = underlyingTree->AsLclVar(); + const LclVarDsc* varDsc = lvaGetDesc(lclVar); + if (ClassLayout::AreCompatible(varDsc->GetLayout(), objLayout)) + { + argValue = underlyingTree; + } } } } @@ -4299,7 +4392,6 @@ GenTree* Compiler::fgMorphMultiregStructArg(GenTree* arg, fgArgTabEntry* fgEntry { structSize = info.compCompHnd->getClassSize(objClass); } - noway_assert(objClass != NO_CLASS_HANDLE); var_types hfaType = TYP_UNDEF; var_types elemType = TYP_UNDEF; @@ -5728,14 +5820,16 @@ GenTree* Compiler::fgMorphStackArgForVarArgs(unsigned lclNum, var_types varType, // Create a node representing the local pointing to the base of the args GenTree* ptrArg = gtNewOperNode(GT_SUB, TYP_I_IMPL, gtNewLclvNode(lvaVarargsBaseOfStkArgs, TYP_I_IMPL), - gtNewIconNode(varDsc->lvStkOffs - codeGen->intRegState.rsCalleeRegArgCount * REGSIZE_BYTES - - lclOffs)); + gtNewIconNode(varDsc->GetStackOffset() - + codeGen->intRegState.rsCalleeRegArgCount * REGSIZE_BYTES - lclOffs)); // Access the argument through the local GenTree* tree; if (varTypeIsStruct(varType)) { - tree = new (this, GT_BLK) GenTreeBlk(GT_BLK, TYP_STRUCT, ptrArg, typGetBlkLayout(varDsc->lvExactSize)); + CORINFO_CLASS_HANDLE typeHnd = varDsc->GetStructHnd(); + assert(typeHnd != nullptr); + tree = gtNewObjNode(typeHnd, ptrArg); } else { @@ -5883,7 +5977,7 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac) } #ifdef FEATURE_SIMD - // if this field belongs to simd struct, translate it to simd instrinsic. + // if this field belongs to simd struct, translate it to simd intrinsic. if (mac == nullptr) { GenTree* newTree = fgMorphFieldToSIMDIntrinsicGet(tree); @@ -6016,8 +6110,8 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac) bool addExplicitNullCheck = false; - // Implicit byref locals are never null. - if (!((objRef->gtOper == GT_LCL_VAR) && lvaIsImplicitByRefLocal(objRef->AsLclVarCommon()->GetLclNum()))) + // Implicit byref locals and string literals are never null. + if (fgAddrCouldBeNull(objRef)) { // If the objRef is a GT_ADDR node, it, itself, never requires null checking. The expression // whose address is being taken is either a local or static variable, whose address is necessarily @@ -6114,7 +6208,7 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac) if (tree->AsField()->gtFieldLookup.accessType == IAT_PVALUE) { offsetNode = gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)tree->AsField()->gtFieldLookup.addr, - GTF_ICON_FIELD_HDL, false); + GTF_ICON_CONST_PTR, true); #ifdef DEBUG offsetNode->gtGetOp1()->AsIntCon()->gtTargetHandle = (size_t)symHnd; #endif @@ -6216,7 +6310,7 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac) } else { - dllRef = gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)pIdAddr, GTF_ICON_STATIC_HDL, true); + dllRef = gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)pIdAddr, GTF_ICON_CONST_PTR, true); // Next we multiply by 4 dllRef = gtNewOperNode(GT_MUL, TYP_I_IMPL, dllRef, gtNewIconNode(4, TYP_I_IMPL)); @@ -6276,51 +6370,21 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac) void** pFldAddr = nullptr; void* fldAddr = info.compCompHnd->getFieldAddress(symHnd, (void**)&pFldAddr); - if (pFldAddr == nullptr) - { -#ifdef TARGET_64BIT - if (IMAGE_REL_BASED_REL32 != eeGetRelocTypeHint(fldAddr)) - { - // The address is not directly addressible, so force it into a - // constant, so we handle it properly - - GenTree* addr = gtNewIconHandleNode((size_t)fldAddr, GTF_ICON_STATIC_HDL); - addr->gtType = TYP_I_IMPL; - FieldSeqNode* fieldSeq = - fieldMayOverlap ? FieldSeqStore::NotAField() : GetFieldSeqStore()->CreateSingleton(symHnd); - addr->AsIntCon()->gtFieldSeq = fieldSeq; - // Translate GTF_FLD_INITCLASS to GTF_ICON_INITCLASS - if ((tree->gtFlags & GTF_FLD_INITCLASS) != 0) - { - tree->gtFlags &= ~GTF_FLD_INITCLASS; - addr->gtFlags |= GTF_ICON_INITCLASS; - } - - tree->SetOper(GT_IND); - tree->AsOp()->gtOp1 = addr; - - return fgMorphSmpOp(tree); - } - else -#endif // TARGET_64BIT - { - // Only volatile or classinit could be set, and they map over - noway_assert((tree->gtFlags & ~(GTF_FLD_VOLATILE | GTF_FLD_INITCLASS | GTF_COMMON_MASK)) == 0); - static_assert_no_msg(GTF_FLD_VOLATILE == GTF_CLS_VAR_VOLATILE); - static_assert_no_msg(GTF_FLD_INITCLASS == GTF_CLS_VAR_INITCLASS); - tree->SetOper(GT_CLS_VAR); - tree->AsClsVar()->gtClsVarHnd = symHnd; - FieldSeqNode* fieldSeq = - fieldMayOverlap ? FieldSeqStore::NotAField() : GetFieldSeqStore()->CreateSingleton(symHnd); - tree->AsClsVar()->gtFieldSeq = fieldSeq; - } + // We should always be able to access this static field address directly + // + assert(pFldAddr == nullptr); - return tree; - } - else +#ifdef TARGET_64BIT + if (IMAGE_REL_BASED_REL32 != eeGetRelocTypeHint(fldAddr)) { - GenTree* addr = gtNewIconHandleNode((size_t)pFldAddr, GTF_ICON_STATIC_HDL); + // The address is not directly addressible, so force it into a + // constant, so we handle it properly + GenTree* addr = gtNewIconHandleNode((size_t)fldAddr, GTF_ICON_STATIC_HDL); + addr->gtType = TYP_I_IMPL; + FieldSeqNode* fieldSeq = + fieldMayOverlap ? FieldSeqStore::NotAField() : GetFieldSeqStore()->CreateSingleton(symHnd); + addr->AsIntCon()->gtFieldSeq = fieldSeq; // Translate GTF_FLD_INITCLASS to GTF_ICON_INITCLASS if ((tree->gtFlags & GTF_FLD_INITCLASS) != 0) { @@ -6328,19 +6392,26 @@ GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac) addr->gtFlags |= GTF_ICON_INITCLASS; } - // There are two cases here, either the static is RVA based, - // in which case the type of the FIELD node is not a GC type - // and the handle to the RVA is a TYP_I_IMPL. Or the FIELD node is - // a GC type and the handle to it is a TYP_BYREF in the GC heap - // because handles to statics now go into the large object heap - - var_types handleTyp = (var_types)(varTypeIsGC(tree->TypeGet()) ? TYP_BYREF : TYP_I_IMPL); - GenTree* op1 = gtNewOperNode(GT_IND, handleTyp, addr); - op1->gtFlags |= GTF_IND_INVARIANT; - tree->SetOper(GT_IND); - tree->AsOp()->gtOp1 = op1; + tree->AsOp()->gtOp1 = addr; + + return fgMorphSmpOp(tree); + } + else +#endif // TARGET_64BIT + { + // Only volatile or classinit could be set, and they map over + noway_assert((tree->gtFlags & ~(GTF_FLD_VOLATILE | GTF_FLD_INITCLASS | GTF_COMMON_MASK)) == 0); + static_assert_no_msg(GTF_FLD_VOLATILE == GTF_CLS_VAR_VOLATILE); + static_assert_no_msg(GTF_FLD_INITCLASS == GTF_CLS_VAR_INITCLASS); + tree->SetOper(GT_CLS_VAR); + tree->AsClsVar()->gtClsVarHnd = symHnd; + FieldSeqNode* fieldSeq = + fieldMayOverlap ? FieldSeqStore::NotAField() : GetFieldSeqStore()->CreateSingleton(symHnd); + tree->AsClsVar()->gtFieldSeq = fieldSeq; } + + return tree; } } noway_assert(tree->gtOper == GT_IND); @@ -6620,13 +6691,13 @@ void Compiler::fgMorphCallInlineHelper(GenTreeCall* call, InlineResult* result) // 1) If the callee has structs which cannot be enregistered it will be // reported as cannot fast tail call. This is an implementation limitation // where the callee only is checked for non enregisterable structs. This is -// tracked with https://github.com/dotnet/coreclr/issues/12644. +// tracked with https://github.com/dotnet/runtime/issues/8492. // // 2) If the caller or callee has stack arguments and the callee has more // arguments then the caller it will be reported as cannot fast tail call. // This is due to a bug in LowerFastTailCall which assumes that // nCalleeArgs <= nCallerArgs, which is always true on Windows Amd64. This -// is tracked with https://github.com/dotnet/coreclr/issues/12468. +// is tracked with https://github.com/dotnet/runtime/issues/8413. // // 3) If the callee has a 9 to 16 byte struct argument and the callee has // stack arguments, the decision will be to not fast tail call. This is @@ -6699,15 +6770,17 @@ bool Compiler::fgCanFastTailCall(GenTreeCall* callee, const char** failReason) fgArgInfo* argInfo = callee->fgArgInfo; - size_t calleeArgStackSize = 0; - size_t callerArgStackSize = info.compArgStackSize; + unsigned calleeArgStackSize = 0; + unsigned callerArgStackSize = info.compArgStackSize; for (unsigned index = 0; index < argInfo->ArgCount(); ++index) { fgArgTabEntry* arg = argInfo->GetArgEntry(index, false); - calleeArgStackSize += arg->stackSize(); + calleeArgStackSize = roundUp(calleeArgStackSize, arg->byteAlignment); + calleeArgStackSize += arg->GetStackByteSize(); } + calleeArgStackSize = GetOutgoingArgByteSize(calleeArgStackSize); auto reportFastTailCallDecision = [&](const char* thisFailReason) { if (failReason != nullptr) @@ -6765,6 +6838,12 @@ bool Compiler::fgCanFastTailCall(GenTreeCall* callee, const char** failReason) return false; } + if (callee->IsStressTailCall()) + { + reportFastTailCallDecision("Fast tail calls are not performed under tail call stress"); + return false; + } + // Note on vararg methods: // If the caller is vararg method, we don't know the number of arguments passed by caller's caller. // But we can be sure that in-coming arg area of vararg caller would be sufficient to hold its @@ -7217,6 +7296,14 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call) // is set. This avoids the need for iterating through all lcl vars of the current // method. Right now throughout the code base we are not consistently using 'set' // method to set lvHasLdAddrOp and lvAddrExposed flags. + + bool isImplicitOrStressTailCall = call->IsImplicitTailCall() || call->IsStressTailCall(); + if (isImplicitOrStressTailCall && compLocallocUsed) + { + failTailCall("Localloc used"); + return nullptr; + } + bool hasStructParam = false; for (unsigned varNum = 0; varNum < lvaCount; varNum++) { @@ -7226,7 +7313,7 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call) // We still must check for any struct parameters and set 'hasStructParam' // so that we won't transform the recursive tail call into a loop. // - if (call->IsImplicitTailCall()) + if (isImplicitOrStressTailCall) { if (varDsc->lvHasLdAddrOp && !lvaIsImplicitByRefLocal(varNum)) { @@ -7677,6 +7764,8 @@ GenTree* Compiler::fgMorphTailCallViaHelpers(GenTreeCall* call, CORINFO_TAILCALL assert(!call->IsImplicitTailCall()); assert(!fgCanFastTailCall(call, nullptr)); + bool virtualCall = call->IsVirtual(); + // If VSD then get rid of arg to VSD since we turn this into a direct call. // The extra arg will be the first arg so this needs to be done before we // handle the retbuf below. @@ -7711,41 +7800,39 @@ GenTree* Compiler::fgMorphTailCallViaHelpers(GenTreeCall* call, CORINFO_TAILCALL // where we pass instantiating stub. if ((help.flags & CORINFO_TAILCALL_STORE_TARGET) != 0) { - // If asked to store target and we have a type arg we will store - // instantiating stub, so in that case we should not pass the type arg. - if (call->tailCallInfo->GetSig()->hasTypeArg()) + JITDUMP("Adding target since VM requested it\n"); + GenTree* target; + if (!virtualCall) { - JITDUMP("Removing type arg"); - - assert(call->gtCallArgs != nullptr); - if (Target::g_tgtArgOrder == Target::ARG_ORDER_R2L) + if (call->gtCallType == CT_INDIRECT) { - // Generic context is first arg - call->gtCallArgs = call->gtCallArgs->GetNext(); + noway_assert(call->gtCallAddr != nullptr); + target = call->gtCallAddr; } else { - // Generic context is last arg - GenTreeCall::Use** lastArgSlot = &call->gtCallArgs; - while ((*lastArgSlot)->GetNext() != nullptr) + CORINFO_CONST_LOOKUP addrInfo; + info.compCompHnd->getFunctionEntryPoint(call->gtCallMethHnd, &addrInfo); + + CORINFO_GENERIC_HANDLE handle = nullptr; + void* pIndirection = nullptr; + assert(addrInfo.accessType != IAT_PPVALUE && addrInfo.accessType != IAT_RELPVALUE); + + if (addrInfo.accessType == IAT_VALUE) { - lastArgSlot = &(*lastArgSlot)->NextRef(); + handle = addrInfo.handle; } - - *lastArgSlot = nullptr; + else if (addrInfo.accessType == IAT_PVALUE) + { + pIndirection = addrInfo.addr; + } + target = gtNewIconEmbHndNode(handle, pIndirection, GTF_ICON_FTN_ADDR, call->gtCallMethHnd); } - call->fgArgInfo = nullptr; - } - - JITDUMP("Adding target since VM requested it\n"); - GenTree* target; - if (call->tailCallInfo->IsCalli()) - { - noway_assert(call->gtCallType == CT_INDIRECT && call->gtCallAddr != nullptr); - target = call->gtCallAddr; } else { + assert(!call->tailCallInfo->GetSig()->hasTypeArg()); + CORINFO_CALL_INFO callInfo; unsigned flags = CORINFO_CALLINFO_LDFTN; if (call->tailCallInfo->IsCallvirt()) @@ -7755,19 +7842,10 @@ GenTree* Compiler::fgMorphTailCallViaHelpers(GenTreeCall* call, CORINFO_TAILCALL eeGetCallInfo(call->tailCallInfo->GetToken(), nullptr, (CORINFO_CALLINFO_FLAGS)flags, &callInfo); - if (!call->tailCallInfo->IsCallvirt() || - ((callInfo.methodFlags & (CORINFO_FLG_FINAL | CORINFO_FLG_STATIC)) != 0) || - ((callInfo.methodFlags & CORINFO_FLG_VIRTUAL) == 0)) - { - target = getMethodPointerTree(call->tailCallInfo->GetToken(), &callInfo); - } - else - { - assert(call->gtCallThisArg != nullptr); - // TODO: Proper cloning of the this pointer. - target = getVirtMethodPointerTree(gtCloneExpr(call->gtCallThisArg->GetNode()), - call->tailCallInfo->GetToken(), &callInfo); - } + assert(call->gtCallThisArg != nullptr); + // TODO: Proper cloning of the this pointer. + target = getVirtMethodPointerTree(gtCloneExpr(call->gtCallThisArg->GetNode()), + call->tailCallInfo->GetToken(), &callInfo); } // Insert target as last arg @@ -7894,21 +7972,54 @@ GenTree* Compiler::fgCreateCallDispatcherAndGetResult(GenTreeCall* orig // Add return value arg. GenTree* retValArg; - GenTree* retVal = nullptr; - unsigned int newRetLcl = BAD_VAR_NUM; + GenTree* retVal = nullptr; + unsigned int newRetLcl = BAD_VAR_NUM; + GenTree* copyToRetBufNode = nullptr; - // Use existing retbuf if there is one. if (origCall->HasRetBufArg()) { JITDUMP("Transferring retbuf\n"); GenTree* retBufArg = origCall->gtCallArgs->GetNode(); - assert((info.compRetBuffArg != BAD_VAR_NUM) && retBufArg->OperIsLocal() && - (retBufArg->AsLclVarCommon()->GetLclNum() == info.compRetBuffArg)); - retValArg = retBufArg; + assert(info.compRetBuffArg != BAD_VAR_NUM); + 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")); + + constexpr bool unsafeValueClsCheck = false; + lvaSetStruct(tmpRetBufNum, origCall->gtRetClsHnd, unsafeValueClsCheck); + lvaSetVarAddrExposed(tmpRetBufNum); + + var_types tmpRetBufType = lvaGetDesc(tmpRetBufNum)->TypeGet(); + + retValArg = gtNewOperNode(GT_ADDR, TYP_I_IMPL, gtNewLclvNode(tmpRetBufNum, tmpRetBufType)); + + 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); + + constexpr bool isVolatile = false; + constexpr bool isCopyBlock = true; + copyToRetBufNode = gtNewBlkOpNode(dst, src, isVolatile, isCopyBlock); + } + if (origCall->gtType != TYP_VOID) { - retVal = gtClone(retValArg); + retVal = gtClone(retBufArg); } } else if (origCall->gtType != TYP_VOID) @@ -7962,46 +8073,30 @@ GenTree* Compiler::fgCreateCallDispatcherAndGetResult(GenTreeCall* orig GenTree* retAddrSlot = gtNewOperNode(GT_ADDR, TYP_I_IMPL, gtNewLclvNode(lvaRetAddrVar, TYP_I_IMPL)); callDispatcherNode->gtCallArgs = gtPrependNewCallArg(retAddrSlot, callDispatcherNode->gtCallArgs); + GenTree* finalTree = callDispatcherNode; + + if (copyToRetBufNode != nullptr) + { + finalTree = gtNewOperNode(GT_COMMA, TYP_VOID, callDispatcherNode, copyToRetBufNode); + } + if (origCall->gtType == TYP_VOID) { - return callDispatcherNode; + return finalTree; } assert(retVal != nullptr); - GenTree* comma = gtNewOperNode(GT_COMMA, origCall->TypeGet(), callDispatcherNode, retVal); + finalTree = gtNewOperNode(GT_COMMA, origCall->TypeGet(), finalTree, retVal); + // The JIT seems to want to CSE this comma and messes up multi-reg ret // values in the process. Just avoid CSE'ing this tree entirely in that // case. if (origCall->HasMultiRegRetVal()) { - comma->gtFlags |= GTF_DONT_CSE; + finalTree->gtFlags |= GTF_DONT_CSE; } - return comma; -} - -//------------------------------------------------------------------------ -// getMethodPointerTree: get a method pointer tree -// -// Arguments: -// pResolvedToken - resolved token of the call -// pCallInfo - the call info of the call -// -// Return Value: -// A node representing the method pointer -// -GenTree* Compiler::getMethodPointerTree(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_CALL_INFO* pCallInfo) -{ - switch (pCallInfo->kind) - { - case CORINFO_CALL: - return new (this, GT_FTN_ADDR) GenTreeFptrVal(TYP_I_IMPL, pCallInfo->hMethod); - case CORINFO_CALL_CODE_POINTER: - return getLookupTree(pResolvedToken, &pCallInfo->codePointerLookup, GTF_ICON_FTN_ADDR, pCallInfo->hMethod); - default: - noway_assert(!"unknown call kind"); - return nullptr; - } + return finalTree; } //------------------------------------------------------------------------ @@ -8743,7 +8838,7 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) assert(!call->CanTailCall()); #if FEATURE_MULTIREG_RET - if (fgGlobalMorph && call->HasMultiRegRetVal()) + if (fgGlobalMorph && call->HasMultiRegRetVal() && varTypeIsStruct(call->TypeGet())) { // The tail call has been rejected so we must finish the work deferred // by impFixupCallStructReturn for multi-reg-returning calls and transform @@ -8760,23 +8855,14 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) lvaGrabTemp(false DEBUGARG("Return value temp for multi-reg return (rejected tail call).")); lvaTable[tmpNum].lvIsMultiRegRet = true; - GenTree* assg = nullptr; - if (varTypeIsStruct(call->TypeGet())) - { - CORINFO_CLASS_HANDLE structHandle = call->gtRetClsHnd; - assert(structHandle != NO_CLASS_HANDLE); - const bool unsafeValueClsCheck = false; - lvaSetStruct(tmpNum, structHandle, unsafeValueClsCheck); - var_types structType = lvaTable[tmpNum].lvType; - GenTree* dst = gtNewLclvNode(tmpNum, structType); - assg = gtNewAssignNode(dst, call); - } - else - { - assg = gtNewTempAssign(tmpNum, call); - } - - assg = fgMorphTree(assg); + CORINFO_CLASS_HANDLE structHandle = call->gtRetClsHnd; + assert(structHandle != NO_CLASS_HANDLE); + const bool unsafeValueClsCheck = false; + lvaSetStruct(tmpNum, structHandle, unsafeValueClsCheck); + var_types structType = lvaTable[tmpNum].lvType; + GenTree* dst = gtNewLclvNode(tmpNum, structType); + GenTree* assg = gtNewAssignNode(dst, call); + assg = fgMorphTree(assg); // Create the assignment statement and insert it before the current statement. Statement* assgStmt = gtNewStmt(assg, compCurStmt->GetILOffsetX()); @@ -8898,7 +8984,7 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call) 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->gtType == TYP_BYREF && !(dest->OperGet() == GT_ADDR && dest->AsOp()->gtOp1->OperGet() == GT_LCL_VAR)) + 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. @@ -9240,33 +9326,41 @@ GenTree* Compiler::fgMorphLeaf(GenTree* tree) info.compCompHnd->getFunctionFixedEntryPoint(tree->AsFptrVal()->gtFptrMethod, &addrInfo); } - // Refer to gtNewIconHandleNode() as the template for constructing a constant handle - // - tree->SetOper(GT_CNS_INT); - tree->AsIntConCommon()->SetIconValue(ssize_t(addrInfo.handle)); - tree->gtFlags |= GTF_ICON_FTN_ADDR; - + GenTree* indNode = nullptr; switch (addrInfo.accessType) { case IAT_PPVALUE: - tree = gtNewOperNode(GT_IND, TYP_I_IMPL, tree); - tree->gtFlags |= GTF_IND_INVARIANT; - - __fallthrough; + indNode = gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)addrInfo.handle, GTF_ICON_CONST_PTR, true); + + // Add the second indirection + indNode = gtNewOperNode(GT_IND, TYP_I_IMPL, indNode); + // This indirection won't cause an exception. + indNode->gtFlags |= GTF_IND_NONFAULTING; + // This indirection also is invariant. + indNode->gtFlags |= GTF_IND_INVARIANT; + break; case IAT_PVALUE: - tree = gtNewOperNode(GT_IND, TYP_I_IMPL, tree); + indNode = gtNewIndOfIconHandleNode(TYP_I_IMPL, (size_t)addrInfo.handle, GTF_ICON_FTN_ADDR, true); break; case IAT_VALUE: - tree = gtNewOperNode(GT_NOP, tree->TypeGet(), tree); // prevents constant folding + // Refer to gtNewIconHandleNode() as the template for constructing a constant handle + // + tree->SetOper(GT_CNS_INT); + tree->AsIntConCommon()->SetIconValue(ssize_t(addrInfo.handle)); + tree->gtFlags |= GTF_ICON_FTN_ADDR; break; default: noway_assert(!"Unknown addrInfo.accessType"); } - return fgMorphTree(tree); + if (indNode != nullptr) + { + DEBUG_DESTROY_NODE(tree); + tree = fgMorphTree(indNode); + } } return tree; @@ -9371,7 +9465,7 @@ GenTree* Compiler::fgMorphOneAsgBlockOp(GenTree* tree) destVarDsc = &(lvaTable[destVarNum]); if (asgType == TYP_STRUCT) { - clsHnd = destVarDsc->lvVerTypeInfo.GetClassHandle(); + clsHnd = destVarDsc->GetStructHnd(); size = destVarDsc->lvExactSize; } } @@ -9960,7 +10054,7 @@ GenTree* Compiler::fgMorphPromoteLocalInitBlock(GenTreeLclVar* destLclNode, GenT // Promoted fields are expected to be "normalize on load". If that changes then // we may need to adjust this code to widen the constant correctly. assert(fieldDesc->lvNormalizeOnLoad()); - __fallthrough; + FALLTHROUGH; case TYP_INT: { int64_t mask = (int64_t(1) << (genTypeSize(dest->TypeGet()) * 8)) - 1; @@ -10419,6 +10513,10 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) JITDUMP(" not morphing a multireg call return\n"); return tree; } + else if (dest->IsMultiRegLclVar() && !src->IsMultiRegNode()) + { + dest->AsLclVar()->ClearMultiReg(); + } #endif // FEATURE_MULTIREG_RET if (src->IsCall() && !compDoOldStructRetyping()) @@ -10509,7 +10607,7 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) // but it doesn't always for the temps that the importer creates when it spills side // effects. // TODO-Cleanup: Determine when this happens, and whether it can be changed. - blockWidth = info.compCompHnd->getClassSize(destLclVar->lvVerTypeInfo.GetClassHandle()); + blockWidth = info.compCompHnd->getClassSize(destLclVar->GetStructHnd()); } else { @@ -10726,7 +10824,7 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) // Both structs should be of the same type, or have the same number of fields of the same type. // If not we will use a copy block. bool misMatchedTypes = false; - if (destLclVar->lvVerTypeInfo.GetClassHandle() != srcLclVar->lvVerTypeInfo.GetClassHandle()) + if (destLclVar->GetStructHnd() != srcLclVar->GetStructHnd()) { if (destLclVar->lvFieldCnt != srcLclVar->lvFieldCnt) { @@ -10911,7 +11009,7 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) src = fgMorphBlockOperand(src, asgType, blockWidth, false /*isBlkReqd*/); if (srcAddr == nullptr) { - srcAddr = fgMorphGetStructAddr(&src, destLclVar->lvVerTypeInfo.GetClassHandle(), true /* rValue */); + srcAddr = fgMorphGetStructAddr(&src, destLclVar->GetStructHnd(), true /* rValue */); } } else @@ -11104,7 +11202,7 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) LclVarDsc* srcFieldVarDsc = lvaGetDesc(srcFieldLclNum); // Have to set the field sequence -- which means we need the field handle. - CORINFO_CLASS_HANDLE classHnd = srcVarDsc->lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE classHnd = srcVarDsc->GetStructHnd(); CORINFO_FIELD_HANDLE fieldHnd = info.compCompHnd->getFieldInClass(classHnd, srcFieldVarDsc->lvFldOrdinal); FieldSeqNode* curFieldSeq = GetFieldSeqStore()->CreateSingleton(fieldHnd); @@ -11166,7 +11264,7 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree) noway_assert(srcFld != nullptr); } - CORINFO_CLASS_HANDLE classHnd = lvaTable[destLclNum].lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE classHnd = lvaTable[destLclNum].GetStructHnd(); CORINFO_FIELD_HANDLE fieldHnd = info.compCompHnd->getFieldInClass(classHnd, lvaTable[dstFieldLclNum].lvFldOrdinal); FieldSeqNode* curFieldSeq = GetFieldSeqStore()->CreateSingleton(fieldHnd); @@ -11513,6 +11611,68 @@ GenTree* Compiler::fgMorphFieldAssignToSIMDIntrinsicSet(GenTree* tree) #endif // FEATURE_SIMD +//------------------------------------------------------------------------------ +// fgMorphCommutative : Try to simplify "(X op C1) op C2" to "X op C3" +// for commutative operators. +// +// Arguments: +// tree - node to fold +// +// return value: +// A folded GenTree* instance or nullptr if something prevents folding. +// + +GenTree* Compiler::fgMorphCommutative(GenTreeOp* tree) +{ + assert(varTypeIsIntegralOrI(tree->TypeGet())); + assert(tree->OperIs(GT_ADD, GT_MUL, GT_OR, GT_AND, GT_XOR)); + + // op1 can be GT_COMMA, in this case we're going to fold + // "(op (COMMA(... (op X C1))) C2)" to "(COMMA(... (op X C3)))" + GenTree* op1 = tree->gtGetOp1()->gtEffectiveVal(true); + genTreeOps oper = tree->OperGet(); + + if (!op1->OperIs(oper) || !tree->gtGetOp2()->IsCnsIntOrI() || !op1->gtGetOp2()->IsCnsIntOrI() || + op1->gtGetOp1()->IsCnsIntOrI() || gtIsActiveCSE_Candidate(op1)) + { + return nullptr; + } + + if (tree->OperMayOverflow() && (tree->gtOverflow() || op1->gtOverflow())) + { + return nullptr; + } + + GenTreeIntCon* cns1 = op1->gtGetOp2()->AsIntCon(); + GenTreeIntCon* cns2 = tree->gtGetOp2()->AsIntCon(); + + if (!varTypeIsIntegralOrI(tree->TypeGet()) || cns1->TypeIs(TYP_REF) || !cns1->TypeIs(cns2->TypeGet())) + { + return nullptr; + } + + GenTree* foldedCns = gtFoldExprConst(gtNewOperNode(oper, cns1->TypeGet(), cns1, cns2)); + if (!foldedCns->IsCnsIntOrI()) + { + // Give up if we can't fold "C1 op C2" + return nullptr; + } + + cns1->gtIconVal = foldedCns->AsIntCon()->IconValue(); + if ((oper == GT_ADD) && foldedCns->IsCnsIntOrI()) + { + cns1->AsIntCon()->gtFieldSeq = + GetFieldSeqStore()->Append(cns1->AsIntCon()->gtFieldSeq, cns2->AsIntCon()->gtFieldSeq); + } + + GenTreeOp* newTree = tree->gtGetOp1()->AsOp(); + DEBUG_DESTROY_NODE(tree); + DEBUG_DESTROY_NODE(cns2); + DEBUG_DESTROY_NODE(foldedCns); + INDEBUG(newTree->gtOp2->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED); + return newTree; +} + /***************************************************************************** * * Transform the given GTK_SMPOP tree for code generation. @@ -12132,7 +12292,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) } } - __fallthrough; + FALLTHROUGH; case GT_GT: { @@ -12159,7 +12319,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) #ifdef TARGET_ARM case GT_INTRINSIC: - if (tree->AsIntrinsic()->gtIntrinsicId == CORINFO_INTRINSIC_Round) + if (tree->AsIntrinsic()->gtIntrinsicName == NI_System_Math_Round) { switch (tree->TypeGet()) { @@ -12635,6 +12795,13 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) { case GT_ASG: + if (op1->OperIs(GT_LCL_VAR) && ((op1->gtFlags & GTF_VAR_FOLDED_IND) != 0)) + { + op1->gtFlags &= ~GTF_VAR_FOLDED_IND; + tree = fgDoNormalizeOnStore(tree); + op2 = tree->gtGetOp2(); + } + lclVarTree = fgIsIndirOfAddrOfLocal(op1); if (lclVarTree != nullptr) { @@ -13346,49 +13513,8 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) if (op2->IsCnsIntOrI() && varTypeIsIntegralOrI(typ)) { - // Fold "((x+icon1)+icon2) to (x+(icon1+icon2))" - // Fold "((comma(y, x+icon1)+icon2) to comma(y, x+(icon1+icon2))" CLANG_FORMAT_COMMENT_ANCHOR; - const bool commasOnly = true; - GenTree* op1EffectiveValue = op1->gtEffectiveVal(commasOnly); - - if (op1EffectiveValue->gtOper == GT_ADD && !gtIsActiveCSE_Candidate(op1EffectiveValue) && - !op1EffectiveValue->gtOverflow() && op1EffectiveValue->AsOp()->gtOp2->IsCnsIntOrI() && - (op1EffectiveValue->AsOp()->gtOp2->OperGet() == op2->OperGet()) && - (op1EffectiveValue->AsOp()->gtOp2->TypeGet() != TYP_REF) && (op2->TypeGet() != TYP_REF)) - { - cns1 = op1EffectiveValue->AsOp()->gtOp2; - - cns1->AsIntConCommon()->SetIconValue(cns1->AsIntConCommon()->IconValue() + - op2->AsIntConCommon()->IconValue()); -#ifdef TARGET_64BIT - if (cns1->TypeGet() == TYP_INT) - { - // we need to properly re-sign-extend or truncate after adding two int constants above - cns1->AsIntCon()->TruncateOrSignExtend32(); - } -#endif // TARGET_64BIT - - if (cns1->OperGet() == GT_CNS_INT) - { - cns1->AsIntCon()->gtFieldSeq = - GetFieldSeqStore()->Append(cns1->AsIntCon()->gtFieldSeq, op2->AsIntCon()->gtFieldSeq); - } - DEBUG_DESTROY_NODE(op2); - - GenTree* oldTree = tree; - tree = tree->AsOp()->gtOp1; - op1 = tree->AsOp()->gtOp1; - op2 = tree->AsOp()->gtOp2; - DEBUG_DESTROY_NODE(oldTree); - - if (tree->OperGet() != GT_ADD) - { - return tree; - } - } - // Fold (x + 0). if ((op2->AsIntConCommon()->IconValue() == 0) && !gtIsActiveCSE_Candidate(tree)) @@ -13564,10 +13690,31 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) op2 = tree->AsOp()->gtOp2; } + if (varTypeIsIntegralOrI(tree->TypeGet()) && tree->OperIs(GT_ADD, GT_MUL, GT_AND, GT_OR, GT_XOR)) + { + GenTree* foldedTree = fgMorphCommutative(tree->AsOp()); + if (foldedTree != nullptr) + { + tree = foldedTree; + op1 = tree->gtGetOp1(); + op2 = tree->gtGetOp2(); + if (!tree->OperIs(oper)) + { + return tree; + } + } + } + break; case GT_NOT: case GT_NEG: + // Remove double negation/not + if (op1->OperIs(oper) && opts.OptimizationEnabled()) + { + GenTree* child = op1->AsOp()->gtGetOp1(); + return child; + } /* Any constant cases should have been folded earlier */ noway_assert(!op1->OperIsConst() || !opts.OptEnabled(CLFLG_CONSTANTFOLD) || optValnumCSE_phase); @@ -13593,17 +13740,16 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) break; case GT_IND: - + { // Can not remove a GT_IND if it is currently a CSE candidate. if (gtIsActiveCSE_Candidate(tree)) { break; } - bool foldAndReturnTemp; - foldAndReturnTemp = false; - temp = nullptr; - ival1 = 0; + bool foldAndReturnTemp = false; + temp = nullptr; + ival1 = 0; // Don't remove a volatile GT_IND, even if the address points to a local variable. if ((tree->gtFlags & GTF_IND_VOLATILE) == 0) @@ -13659,15 +13805,31 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) } // If the type of the IND (typ) is a "small int", and the type of the local has the // same width, then we can reduce to just the local variable -- it will be - // correctly normalized, and signed/unsigned differences won't matter. + // correctly normalized. // // The below transformation cannot be applied if the local var needs to be normalized on load. - else if (varTypeIsSmall(typ) && (genTypeSize(lvaTable[lclNum].lvType) == genTypeSize(typ)) && + else if (varTypeIsSmall(typ) && (genTypeSize(varDsc) == genTypeSize(typ)) && !lvaTable[lclNum].lvNormalizeOnLoad()) { - tree->gtType = typ = temp->TypeGet(); - foldAndReturnTemp = true; + const bool definitelyLoad = (tree->gtFlags & GTF_DONT_CSE) == 0; + const bool possiblyStore = !definitelyLoad; + + if (possiblyStore || (varTypeIsUnsigned(varDsc) == varTypeIsUnsigned(typ))) + { + typ = temp->TypeGet(); + tree->gtType = typ; + foldAndReturnTemp = true; + + if (possiblyStore) + { + // This node can be on the left-hand-side of an assignment node. + // Mark this node with GTF_VAR_FOLDED_IND to make sure that fgDoNormalizeOnStore() + // is called on its parent in post-order morph. + temp->gtFlags |= GTF_VAR_FOLDED_IND; + } + } } + // For matching types we can fold else if (!varTypeIsStruct(typ) && (lvaTable[lclNum].lvType == typ) && !lvaTable[lclNum].lvNormalizeOnLoad()) { @@ -13941,6 +14103,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) } break; + } case GT_ADDR: @@ -14164,6 +14327,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) return tree; } + break; default: break; @@ -15823,9 +15987,8 @@ bool Compiler::fgFoldConditional(BasicBlock* block) /* JTRUE 0 - transform the basic block into a BBJ_NONE */ block->bbJumpKind = BBJ_NONE; - noway_assert(!(block->bbFlags & BBF_NEEDS_GCPOLL)); - bTaken = block->bbNext; - bNotTaken = block->bbJumpDest; + bTaken = block->bbNext; + bNotTaken = block->bbJumpDest; } if (fgHaveValidEdgeWeights) @@ -15892,7 +16055,7 @@ bool Compiler::fgFoldConditional(BasicBlock* block) newMaxWeight = bUpdated->bbWeight; newMinWeight = min(edge->edgeWeightMin(), newMaxWeight); edge->setEdgeWeights(newMinWeight, newMaxWeight); - __fallthrough; + FALLTHROUGH; case BBJ_ALWAYS: edge = fgGetPredForBlock(bUpdated->bbJumpDest, bUpdated); @@ -16046,18 +16209,11 @@ bool Compiler::fgFoldConditional(BasicBlock* block) /* transform the basic block into a BBJ_ALWAYS */ block->bbJumpKind = BBJ_ALWAYS; block->bbJumpDest = curJump; - - // if we are jumping backwards, make sure we have a GC Poll. - if (curJump->bbNum > block->bbNum) - { - block->bbFlags &= ~BBF_NEEDS_GCPOLL; - } } else { /* transform the basic block into a BBJ_NONE */ block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~BBF_NEEDS_GCPOLL; } foundVal = true; } @@ -17472,6 +17628,11 @@ void Compiler::fgPromoteStructs() lvaStructPromotionInfo structPromotionInfo; bool tooManyLocalsReported = false; + // Clear the structPromotionHelper, since it is used during inlining, at which point it + // may be conservative about looking up SIMD info. + // We don't want to preserve those conservative decisions for the actual struct promotion. + structPromotionHelper->Clear(); + for (unsigned lclNum = 0; lclNum < startLvaCount; lclNum++) { // Whether this var got promoted @@ -17826,7 +17987,7 @@ void Compiler::fgRetypeImplicitByRefArgs() } else { - CORINFO_CLASS_HANDLE typeHnd = varDsc->lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE typeHnd = varDsc->GetStructHnd(); size = info.compCompHnd->getClassSize(typeHnd); } @@ -18217,7 +18378,7 @@ GenTree* Compiler::fgMorphImplicitByRefArgs(GenTree* tree, bool isAddr) } else { - tree = gtNewObjNode(lclVarDsc->lvVerTypeInfo.GetClassHandle(), tree); + tree = gtNewObjNode(lclVarDsc->GetStructHnd(), tree); if (structType == TYP_STRUCT) { diff --git a/src/coreclr/src/jit/namedintrinsiclist.h b/src/coreclr/src/jit/namedintrinsiclist.h index 63d79fbeff19..30404463da80 100644 --- a/src/coreclr/src/jit/namedintrinsiclist.h +++ b/src/coreclr/src/jit/namedintrinsiclist.h @@ -12,14 +12,35 @@ enum NamedIntrinsic : unsigned short NI_System_Enum_HasFlag, NI_System_Math_FusedMultiplyAdd, + NI_System_Math_Sin, + NI_System_Math_Cos, + NI_System_Math_Cbrt, + NI_System_Math_Sqrt, + NI_System_Math_Abs, NI_System_Math_Round, - NI_System_MathF_FusedMultiplyAdd, - NI_System_MathF_Round, + NI_System_Math_Cosh, + NI_System_Math_Sinh, + NI_System_Math_Tan, + NI_System_Math_Tanh, + NI_System_Math_Asin, + NI_System_Math_Asinh, + NI_System_Math_Acos, + NI_System_Math_Acosh, + NI_System_Math_Atan, + NI_System_Math_Atan2, + NI_System_Math_Atanh, + NI_System_Math_Log10, + NI_System_Math_Pow, + NI_System_Math_Exp, + NI_System_Math_Ceiling, + NI_System_Math_Floor, NI_System_Collections_Generic_EqualityComparer_get_Default, NI_System_Buffers_Binary_BinaryPrimitives_ReverseEndianness, + NI_System_Numerics_BitOperations_PopCount, NI_System_GC_KeepAlive, NI_System_Type_get_IsValueType, NI_System_Type_IsAssignableFrom, + NI_System_Type_IsAssignableTo, // These are used by HWIntrinsics but are defined more generally // to allow dead code optimization and handle the recursion case diff --git a/src/coreclr/src/jit/objectalloc.cpp b/src/coreclr/src/jit/objectalloc.cpp index 39c22e63a811..e41a61175179 100644 --- a/src/coreclr/src/jit/objectalloc.cpp +++ b/src/coreclr/src/jit/objectalloc.cpp @@ -662,7 +662,7 @@ bool ObjectAllocator::CanLclVarEscapeViaParentStack(ArrayStack* parent canLclVarEscapeViaParentStack = false; break; } - __fallthrough; + FALLTHROUGH; case GT_COLON: case GT_QMARK: case GT_ADD: @@ -768,7 +768,7 @@ void ObjectAllocator::UpdateAncestorTypes(GenTree* tree, ArrayStack* p // Left child of GT_COMMA, it will be discarded break; } - __fallthrough; + FALLTHROUGH; case GT_COLON: case GT_QMARK: case GT_ADD: diff --git a/src/coreclr/src/jit/optcse.cpp b/src/coreclr/src/jit/optcse.cpp index 46e834df0dc4..f5dc3f27adf6 100644 --- a/src/coreclr/src/jit/optcse.cpp +++ b/src/coreclr/src/jit/optcse.cpp @@ -11,6 +11,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ #include "jitpch.h" +#include "jitstd/algorithm.h" #ifdef _MSC_VER #pragma hdrstop #endif @@ -20,7 +21,9 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /*****************************************************************************/ /* static */ -const size_t Compiler::s_optCSEhashSize = EXPSET_SZ * 2; +const size_t Compiler::s_optCSEhashSizeInitial = EXPSET_SZ * 2; +const size_t Compiler::s_optCSEhashGrowthFactor = 2; +const size_t Compiler::s_optCSEhashBucketSize = 4; /***************************************************************************** * @@ -36,11 +39,11 @@ void Compiler::optCSEstop() CSEdsc* dsc; CSEdsc** ptr; - unsigned cnt; + size_t cnt; optCSEtab = new (this, CMK_CSE) CSEdsc*[optCSECandidateCount](); - for (cnt = s_optCSEhashSize, ptr = optCSEhash; cnt; cnt--, ptr++) + for (cnt = optCSEhashSize, ptr = optCSEhash; cnt; cnt--, ptr++) { for (dsc = *ptr; dsc; dsc = dsc->csdNextInBucket) { @@ -265,90 +268,74 @@ bool Compiler::optCSE_canSwap(GenTree* tree) /***************************************************************************** * - * Compare function passed to qsort() by CSE_Heuristic::SortCandidates + * Compare function passed to jitstd::sort() by CSE_Heuristic::SortCandidates * when (CodeOptKind() != Compiler::SMALL_CODE) */ /* static */ -int __cdecl Compiler::optCSEcostCmpEx(const void* op1, const void* op2) +bool Compiler::optCSEcostCmpEx::operator()(const CSEdsc* dsc1, const CSEdsc* dsc2) { - CSEdsc* dsc1 = *(CSEdsc**)op1; - CSEdsc* dsc2 = *(CSEdsc**)op2; - GenTree* exp1 = dsc1->csdTree; GenTree* exp2 = dsc2->csdTree; - int diff; - - diff = (int)(exp2->GetCostEx() - exp1->GetCostEx()); + auto expCost1 = exp1->GetCostEx(); + auto expCost2 = exp2->GetCostEx(); - if (diff != 0) + if (expCost2 != expCost1) { - return diff; + return expCost2 < expCost1; } // Sort the higher Use Counts toward the top - diff = (int)(dsc2->csdUseWtCnt - dsc1->csdUseWtCnt); - - if (diff != 0) + if (dsc2->csdUseWtCnt != dsc1->csdUseWtCnt) { - return diff; + return dsc2->csdUseWtCnt < dsc1->csdUseWtCnt; } // With the same use count, Sort the lower Def Counts toward the top - diff = (int)(dsc1->csdDefWtCnt - dsc2->csdDefWtCnt); - - if (diff != 0) + if (dsc1->csdDefWtCnt != dsc2->csdDefWtCnt) { - return diff; + return dsc1->csdDefWtCnt < dsc2->csdDefWtCnt; } // In order to ensure that we have a stable sort, we break ties using the csdIndex - return (int)(dsc1->csdIndex - dsc2->csdIndex); + return dsc1->csdIndex < dsc2->csdIndex; } /***************************************************************************** * - * Compare function passed to qsort() by CSE_Heuristic::SortCandidates + * Compare function passed to jitstd::sort() by CSE_Heuristic::SortCandidates * when (CodeOptKind() == Compiler::SMALL_CODE) */ /* static */ -int __cdecl Compiler::optCSEcostCmpSz(const void* op1, const void* op2) +bool Compiler::optCSEcostCmpSz::operator()(const CSEdsc* dsc1, const CSEdsc* dsc2) { - CSEdsc* dsc1 = *(CSEdsc**)op1; - CSEdsc* dsc2 = *(CSEdsc**)op2; - GenTree* exp1 = dsc1->csdTree; GenTree* exp2 = dsc2->csdTree; - int diff; - - diff = (int)(exp2->GetCostSz() - exp1->GetCostSz()); + auto expCost1 = exp1->GetCostSz(); + auto expCost2 = exp2->GetCostSz(); - if (diff != 0) + if (expCost2 != expCost1) { - return diff; + return expCost2 < expCost1; } // Sort the higher Use Counts toward the top - diff = (int)(dsc2->csdUseCount - dsc1->csdUseCount); - - if (diff != 0) + if (dsc2->csdUseCount != dsc1->csdUseCount) { - return diff; + return dsc2->csdUseCount < dsc1->csdUseCount; } // With the same use count, Sort the lower Def Counts toward the top - diff = (int)(dsc1->csdDefCount - dsc2->csdDefCount); - - if (diff != 0) + if (dsc1->csdDefCount != dsc2->csdDefCount) { - return diff; + return dsc1->csdDefCount < dsc2->csdDefCount; } // In order to ensure that we have a stable sort, we break ties using the csdIndex - return (int)(dsc1->csdIndex - dsc2->csdIndex); + return dsc1->csdIndex < dsc2->csdIndex; } /*****************************************************************************/ @@ -373,7 +360,11 @@ void Compiler::optValnumCSE_Init() cseMaskTraits = nullptr; // Allocate and clear the hash bucket table - optCSEhash = new (this, CMK_CSE) CSEdsc*[s_optCSEhashSize](); + optCSEhash = new (this, CMK_CSE) CSEdsc*[s_optCSEhashSizeInitial](); + + optCSEhashSize = s_optCSEhashSizeInitial; + optCSEhashMaxCountBeforeResize = optCSEhashSize * s_optCSEhashBucketSize; + optCSEhashCount = 0; optCSECandidateCount = 0; optDoCSE = false; // Stays false until we find duplicate CSE tree @@ -382,6 +373,20 @@ void Compiler::optValnumCSE_Init() optCseCheckedBoundMap = nullptr; } +unsigned optCSEKeyToHashIndex(size_t key, size_t optCSEhashSize) +{ + unsigned hash; + + hash = (unsigned)key; +#ifdef TARGET_64BIT + hash ^= (unsigned)(key >> 32); +#endif + hash *= (unsigned)(optCSEhashSize + 1); + hash >>= 7; + + return hash % optCSEhashSize; +} + //--------------------------------------------------------------------------- // optValnumCSE_Index: // - Returns the CSE index to use for this tree, @@ -401,10 +406,26 @@ void Compiler::optValnumCSE_Init() // unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt) { - unsigned key; - unsigned hash; + size_t key; unsigned hval; CSEdsc* hashDsc; + bool isIntConstHash = false; + bool enableSharedConstCSE = false; + int configValue = JitConfig.JitConstCSE(); + +#if defined(TARGET_ARM64) + // ARM64 - allow to combine with nearby offsets, when config is not 2 or 4 + if ((configValue != CONST_CSE_ENABLE_ARM64_NO_SHARING) && (configValue != CONST_CSE_ENABLE_ALL_NO_SHARING)) + { + enableSharedConstCSE = true; + } +#endif // TARGET_ARM64 + + // All Platforms - also allow to combine with nearby offsets, when config is 3 + if (configValue == CONST_CSE_ENABLE_ALL) + { + enableSharedConstCSE = true; + } // We use the liberal Value numbers when building the set of CSE ValueNum vnLib = tree->GetVN(VNK_Liberal); @@ -446,11 +467,11 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt) // if (vnOp2Lib != vnLib) { - key = (unsigned)vnLib; // include the exc set in the hash key + key = vnLib; // include the exc set in the hash key } else { - key = (unsigned)vnLibNorm; + key = vnLibNorm; } // If we didn't do the above we would have op1 as the CSE def @@ -459,18 +480,33 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt) // assert(vnLibNorm == vnStore->VNNormalValue(vnOp2Lib)); } - else // Not a GT_COMMA + else if (enableSharedConstCSE && tree->IsIntegralConst()) { - key = (unsigned)vnLibNorm; + assert(vnStore->IsVNConstant(vnLibNorm)); + key = vnStore->CoercedConstantValue(vnLibNorm); + + // We don't shared small offset constants when we require a reloc + if (!tree->AsIntConCommon()->ImmedValNeedsReloc(this)) + { + // Make constants that have the same upper bits use the same key + + // Shift the key right by CSE_CONST_SHARED_LOW_BITS bits, this sets the upper bits to zero + key >>= CSE_CONST_SHARED_LOW_BITS; + } + assert((key & TARGET_SIGN_BIT) == 0); + + // We use the sign bit of 'key' as the flag + // that we are hashing constants (with a shared offset) + key |= TARGET_SIGN_BIT; + } + else // Not a GT_COMMA or a GT_CNS_INT + { + key = vnLibNorm; } // Compute the hash value for the expression - hash = key; - hash *= (unsigned)(s_optCSEhashSize + 1); - hash >>= 7; - - hval = hash % s_optCSEhashSize; + hval = optCSEKeyToHashIndex(key, optCSEhashSize); /* Look for a matching index in the hash table */ @@ -480,6 +516,12 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt) { if (hashDsc->csdHashKey == key) { + // Check for mismatched types on GT_CNS_INT nodes + if ((tree->OperGet() == GT_CNS_INT) && (tree->TypeGet() != hashDsc->csdTree->TypeGet())) + { + continue; + } + treeStmtLst* newElem; /* Have we started the list of matching nodes? */ @@ -582,9 +624,42 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt) if (optCSECandidateCount < MAX_CSE_CNT) { + if (optCSEhashCount == optCSEhashMaxCountBeforeResize) + { + size_t newOptCSEhashSize = optCSEhashSize * s_optCSEhashGrowthFactor; + CSEdsc** newOptCSEhash = new (this, CMK_CSE) CSEdsc*[newOptCSEhashSize](); + + // Iterate through each existing entry, moving to the new table + CSEdsc** ptr; + CSEdsc* dsc; + size_t cnt; + for (cnt = optCSEhashSize, ptr = optCSEhash; cnt; cnt--, ptr++) + { + for (dsc = *ptr; dsc;) + { + CSEdsc* nextDsc = dsc->csdNextInBucket; + + size_t newHval = optCSEKeyToHashIndex(dsc->csdHashKey, newOptCSEhashSize); + + // Move CSEdsc to bucket in enlarged table + dsc->csdNextInBucket = newOptCSEhash[newHval]; + newOptCSEhash[newHval] = dsc; + + dsc = nextDsc; + } + } + + optCSEhash = newOptCSEhash; + optCSEhashSize = newOptCSEhashSize; + optCSEhashMaxCountBeforeResize = optCSEhashMaxCountBeforeResize * s_optCSEhashGrowthFactor; + } + + ++optCSEhashCount; hashDsc = new (this, CMK_CSE) CSEdsc; hashDsc->csdHashKey = key; + hashDsc->csdConstDefValue = 0; + hashDsc->csdConstDefVN = vnStore->VNForNull(); // uninit value hashDsc->csdIndex = 0; hashDsc->csdLiveAcrossCall = false; hashDsc->csdDefCount = 0; @@ -645,8 +720,17 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt) #ifdef DEBUG if (verbose) { - printf("\nCSE candidate #%02u, vn=", CSEindex); - vnPrint(key, 0); + printf("\nCSE candidate #%02u, key=", CSEindex); + if (!Compiler::Is_Shared_Const_CSE(key)) + { + vnPrint((unsigned)key, 0); + } + else + { + size_t kVal = Compiler::Decode_Shared_Const_CSE_Value(key); + printf("K_%p", dspPtr(kVal)); + } + printf(" in " FMT_BB ", [cost=%2u, size=%2u]: \n", compCurBB->bbNum, tree->GetCostEx(), tree->GetCostSz()); gtDispTree(tree); } @@ -666,6 +750,29 @@ unsigned Compiler::optValnumCSE_Locate() { // Locate CSE candidates and assign them indices + bool enableConstCSE = true; + + int configValue = JitConfig.JitConstCSE(); + + // all platforms - disable CSE of constant values when config is 1 + if (configValue == CONST_CSE_DISABLE_ALL) + { + enableConstCSE = false; + } + +#if !defined(TARGET_ARM64) + // non-ARM64 platforms - disable by default + // + enableConstCSE = false; + + // Check for the two enable cases for all platforms + // + if ((configValue == CONST_CSE_ENABLE_ALL) || (configValue == CONST_CSE_ENABLE_ALL_NO_SHARING)) + { + enableConstCSE = true; + } +#endif + for (BasicBlock* block = fgFirstBB; block != nullptr; block = block->bbNext) { /* Make the block publicly available */ @@ -691,6 +798,16 @@ unsigned Compiler::optValnumCSE_Locate() optCseUpdateCheckedBoundMap(tree); } + // Don't allow CSE of constants if it is disabled + // + if (tree->IsIntegralConst()) + { + if (!enableConstCSE) + { + continue; + } + } + if (!optIsCSEcandidate(tree)) { continue; @@ -701,15 +818,17 @@ unsigned Compiler::optValnumCSE_Locate() continue; } - // Don't CSE constant values, instead let the Value Number - // based Assertion Prop phase handle them. Here, unlike - // the rest of optCSE, we use the conservative value number + // We want to CSE simple constant leaf nodes, but we don't want to + // CSE non-leaf trees that compute CSE constant values. + // Instead we let the Value Number based Assertion Prop phase handle them. + // + // Here, unlike the rest of optCSE, we use the conservative value number // rather than the liberal one, since the conservative one // is what the Value Number based Assertion Prop will use // and the point is to avoid optimizing cases that it will // handle. // - if (vnStore->IsVNConstant(vnStore->VNConservativeNormalValue(tree->gtVNPair))) + if (!tree->OperIsLeaf() && vnStore->IsVNConstant(vnStore->VNConservativeNormalValue(tree->gtVNPair))) { continue; } @@ -1283,7 +1402,7 @@ void Compiler::optValnumCSE_Availablity() isUse = BitVecOps::IsMember(cseLivenessTraits, available_cses, CseAvailBit); isDef = !isUse; // If is isn't a CSE use, it is a CSE def - // Is this a "use", that we haven't yet marked as live accross a call + // Is this a "use", that we haven't yet marked as live across a call // and it is not available when we have calls that kill CSE's (cseAvailCrossCallBit) // if the above is true then we will mark this the CSE as live across a call // @@ -1428,23 +1547,28 @@ void Compiler::optValnumCSE_Availablity() } } - // Record or update the value of desc->defConservNormVN + // For shared const CSE we don't set/use the defConservNormVN // - ValueNum theConservNormVN = vnStore->VNConservativeNormalValue(tree->gtVNPair); - - // Is defConservNormVN still set to the uninit marker value of VNForNull() ? - if (desc->defConservNormVN == vnStore->VNForNull()) - { - // This is the first def that we have visited, set defConservNormVN - desc->defConservNormVN = theConservNormVN; - } - else + if (!Is_Shared_Const_CSE(desc->csdHashKey)) { - // Check to see if all defs have the same conservative normal VN - if (theConservNormVN != desc->defConservNormVN) + // Record or update the value of desc->defConservNormVN + // + ValueNum theConservNormVN = vnStore->VNConservativeNormalValue(tree->gtVNPair); + + // Is defConservNormVN still set to the uninit marker value of VNForNull() ? + if (desc->defConservNormVN == vnStore->VNForNull()) { - // This candidate has defs with differing conservative normal VNs, mark it with NoVN - desc->defConservNormVN = ValueNumStore::NoVN; // record the marker for differing VNs + // This is the first def that we have visited, set defConservNormVN + desc->defConservNormVN = theConservNormVN; + } + else + { + // Check to see if all defs have the same conservative normal VN + if (theConservNormVN != desc->defConservNormVN) + { + // This candidate has defs with differing conservative normal VNs, mark it with NoVN + desc->defConservNormVN = ValueNumStore::NoVN; // record the marker for differing VNs + } } } @@ -1860,11 +1984,11 @@ class CSE_Heuristic if (CodeOptKind() == Compiler::SMALL_CODE) { - qsort(sortTab, m_pCompiler->optCSECandidateCount, sizeof(*sortTab), m_pCompiler->optCSEcostCmpSz); + jitstd::sort(sortTab, sortTab + m_pCompiler->optCSECandidateCount, Compiler::optCSEcostCmpSz()); } else { - qsort(sortTab, m_pCompiler->optCSECandidateCount, sizeof(*sortTab), m_pCompiler->optCSEcostCmpEx); + jitstd::sort(sortTab, sortTab + m_pCompiler->optCSECandidateCount, Compiler::optCSEcostCmpEx()); } #ifdef DEBUG @@ -1894,9 +2018,19 @@ class CSE_Heuristic cost = dsc->csdTree->GetCostEx(); } - printf("CSE #%02u, {$%-3x, $%-3x} useCnt=%d: [def=%3u, use=%3u, cost=%3u%s]\n :: ", - dsc->csdIndex, dsc->csdHashKey, dsc->defExcSetPromise, dsc->csdUseCount, def, use, cost, - dsc->csdLiveAcrossCall ? ", call" : " "); + if (!Compiler::Is_Shared_Const_CSE(dsc->csdHashKey)) + { + printf("CSE #%02u, {$%-3x, $%-3x} useCnt=%d: [def=%3u, use=%3u, cost=%3u%s]\n :: ", + dsc->csdIndex, dsc->csdHashKey, dsc->defExcSetPromise, dsc->csdUseCount, def, use, cost, + dsc->csdLiveAcrossCall ? ", call" : " "); + } + else + { + size_t kVal = Compiler::Decode_Shared_Const_CSE_Value(dsc->csdHashKey); + printf("CSE #%02u, {K_%p} useCnt=%d: [def=%3u, use=%3u, cost=%3u%s]\n :: ", dsc->csdIndex, + dspPtr(kVal), dsc->csdUseCount, def, use, cost, + dsc->csdLiveAcrossCall ? ", call" : " "); + } m_pCompiler->gtDispTree(expr, nullptr, nullptr, true); } @@ -2377,8 +2511,9 @@ class CSE_Heuristic #ifdef DEBUG if (m_pCompiler->verbose) { - printf("Moderate CSE Promotion (CSE is live across a call) (%u >= %u)\n", cseRefCnt, - moderateRefCnt); + printf("Moderate CSE Promotion (%s) (%u >= %u)\n", + candidate->LiveAcrossCall() ? "CSE is live across a call" : "not enregisterable", + cseRefCnt, moderateRefCnt); } #endif cse_def_cost = 2; @@ -2409,8 +2544,9 @@ class CSE_Heuristic #ifdef DEBUG if (m_pCompiler->verbose) { - printf("Conservative CSE Promotion (CSE never live at call) (%u < %u)\n", cseRefCnt, - moderateRefCnt); + printf("Conservative CSE Promotion (%s) (%u < %u)\n", + candidate->LiveAcrossCall() ? "CSE is live across a call" : "not enregisterable", + cseRefCnt, moderateRefCnt); } #endif cse_def_cost = 2; @@ -2634,7 +2770,7 @@ class CSE_Heuristic if (varTypeIsStruct(cseLclVarTyp)) { // Retrieve the struct handle that we recorded while bulding the list of CSE candidates. - // If all occurances were in GT_IND nodes it could still be NO_CLASS_HANDLE + // If all occurrences were in GT_IND nodes it could still be NO_CLASS_HANDLE // CORINFO_CLASS_HANDLE structHnd = successfulCandidate->CseDsc()->csdStructHnd; if (structHnd == NO_CLASS_HANDLE) @@ -2660,8 +2796,7 @@ class CSE_Heuristic // // Later we will unmark any nested CSE's for the CSE uses. // - Compiler::CSEdsc* dsc = successfulCandidate->CseDsc(); - Compiler::treeStmtLst* lst; + Compiler::CSEdsc* dsc = successfulCandidate->CseDsc(); // If there's just a single def for the CSE, we'll put this // CSE into SSA form on the fly. We won't need any PHIs. @@ -2678,53 +2813,122 @@ class CSE_Heuristic cseSsaNum = m_pCompiler->lvaTable[cseLclVarNum].lvPerSsaData.AllocSsaNum(allocator); } -#ifdef DEBUG // Verify that all of the ValueNumbers in this list are correct as // Morph will change them when it performs a mutating operation. // - ValueNum firstVN = ValueNumStore::NoVN; - ValueNum currVN; - bool allSame = true; + bool setRefCnt = true; + bool allSame = true; + bool isSharedConst = Compiler::Is_Shared_Const_CSE(dsc->csdHashKey); + ValueNum bestVN = ValueNumStore::NoVN; + bool bestIsDef = false; + ssize_t bestConstValue = 0; + Compiler::treeStmtLst* lst = dsc->csdTreeList; - lst = dsc->csdTreeList; while (lst != nullptr) { // Ignore this node if the gtCSEnum value has been cleared if (IS_CSE_INDEX(lst->tslTree->gtCSEnum)) { // We used the liberal Value numbers when building the set of CSE - currVN = m_pCompiler->vnStore->VNLiberalNormalValue(lst->tslTree->gtVNPair); + ValueNum currVN = m_pCompiler->vnStore->VNLiberalNormalValue(lst->tslTree->gtVNPair); assert(currVN != ValueNumStore::NoVN); + ssize_t curConstValue = isSharedConst ? m_pCompiler->vnStore->CoercedConstantValue(currVN) : 0; + + GenTree* exp = lst->tslTree; + bool isDef = IS_CSE_DEF(exp->gtCSEnum); - if (firstVN == ValueNumStore::NoVN) + if (bestVN == ValueNumStore::NoVN) { - firstVN = currVN; + // first entry + // set bestVN + bestVN = currVN; + + if (isSharedConst) + { + // set bestConstValue and bestIsDef + bestConstValue = curConstValue; + bestIsDef = isDef; + } } - else if (currVN != firstVN) + else if (currVN != bestVN) { + assert(isSharedConst); // Must be true when we have differing VNs + + // subsequent entry + // clear allSame and check for a lower constant allSame = false; - break; + + ssize_t diff = curConstValue - bestConstValue; + + // The ARM64 ldr addressing modes allow for a subtraction of up to 255 + // so we will allow the diff to be up to -255 before replacing a CSE def + // This will minimize the number of extra subtract instructions. + // + if ((bestIsDef && (diff < -255)) || (!bestIsDef && (diff < 0))) + { + // set new bestVN, bestConstValue and bestIsDef + bestVN = currVN; + bestConstValue = curConstValue; + bestIsDef = isDef; + } + } + + BasicBlock* blk = lst->tslBlock; + BasicBlock::weight_t curWeight = blk->getBBWeight(m_pCompiler); + + if (setRefCnt) + { + m_pCompiler->lvaTable[cseLclVarNum].setLvRefCnt(1); + m_pCompiler->lvaTable[cseLclVarNum].setLvRefCntWtd(curWeight); + setRefCnt = false; + } + else + { + m_pCompiler->lvaTable[cseLclVarNum].incRefCnts(curWeight, m_pCompiler); + } + + // A CSE Def references the LclVar twice + // + if (isDef) + { + m_pCompiler->lvaTable[cseLclVarNum].incRefCnts(curWeight, m_pCompiler); } } lst = lst->tslNext; } - if (!allSame) + + dsc->csdConstDefValue = bestConstValue; + dsc->csdConstDefVN = bestVN; + +#ifdef DEBUG + if (m_pCompiler->verbose) { - lst = dsc->csdTreeList; - GenTree* firstTree = lst->tslTree; - printf("In %s, CSE (oper = %s, type = %s) has differing VNs: ", m_pCompiler->info.compFullName, - GenTree::OpName(firstTree->OperGet()), varTypeName(firstTree->TypeGet())); - while (lst != nullptr) + if (!allSame) { - if (IS_CSE_INDEX(lst->tslTree->gtCSEnum)) + if (isSharedConst) + { + printf("\nWe have shared Const CSE's and selected " FMT_VN " with a value of 0x%p as the base.\n", + dsc->csdConstDefVN, dspPtr(dsc->csdConstDefValue)); + } + else // !isSharedConst { - currVN = m_pCompiler->vnStore->VNLiberalNormalValue(lst->tslTree->gtVNPair); - printf("0x%x(%s " FMT_VN ") ", lst->tslTree, IS_CSE_USE(lst->tslTree->gtCSEnum) ? "use" : "def", - currVN); + lst = dsc->csdTreeList; + GenTree* firstTree = lst->tslTree; + printf("In %s, CSE (oper = %s, type = %s) has differing VNs: ", m_pCompiler->info.compFullName, + GenTree::OpName(firstTree->OperGet()), varTypeName(firstTree->TypeGet())); + while (lst != nullptr) + { + if (IS_CSE_INDEX(lst->tslTree->gtCSEnum)) + { + ValueNum currVN = m_pCompiler->vnStore->VNLiberalNormalValue(lst->tslTree->gtVNPair); + printf("0x%x(%s " FMT_VN ") ", lst->tslTree, + IS_CSE_USE(lst->tslTree->gtCSEnum) ? "use" : "def", currVN); + } + lst = lst->tslNext; + } + printf("\n"); } - lst = lst->tslNext; } - printf("\n"); } #endif // DEBUG @@ -2762,7 +2966,8 @@ class CSE_Heuristic // The cseLclVarType must be a compatible with expTyp // - noway_assert(IsCompatibleType(cseLclVarTyp, expTyp)); + ValueNumStore* vnStore = m_pCompiler->vnStore; + noway_assert(IsCompatibleType(cseLclVarTyp, expTyp) || (dsc->csdConstDefVN != vnStore->VNForNull())); // This will contain the replacement tree for exp // It will either be the CSE def or CSE ref @@ -2790,63 +2995,86 @@ class CSE_Heuristic // We will replace the CSE ref with a new tree // this is typically just a simple use of the new CSE LclVar // - ValueNumStore* vnStore = m_pCompiler->vnStore; - cse = m_pCompiler->gtNewLclvNode(cseLclVarNum, cseLclVarTyp); - - // Assign the ssa num for the use. Note it may be the reserved num. - cse->AsLclVarCommon()->SetSsaNum(cseSsaNum); - // assign the proper ValueNumber, A CSE use discards any exceptions - cse->gtVNPair = vnStore->VNPNormalPair(exp->gtVNPair); + // Create a reference to the CSE temp + GenTree* cseLclVar = m_pCompiler->gtNewLclvNode(cseLclVarNum, cseLclVarTyp); + cseLclVar->gtVNPair.SetBoth(dsc->csdConstDefVN); - ValueNum theConservativeVN = successfulCandidate->CseDsc()->defConservNormVN; + // Assign the ssa num for the lclvar use. Note it may be the reserved num. + cseLclVar->AsLclVarCommon()->SetSsaNum(cseSsaNum); - if (theConservativeVN != ValueNumStore::NoVN) + cse = cseLclVar; + if (isSharedConst) { - // All defs of this CSE share the same normal conservative VN, and we are rewriting this - // use to fetch the same value with no reload, so we can safely propagate that - // conservative VN to this use. This can help range check elimination later on. - cse->gtVNPair.SetConservative(theConservativeVN); - - // If the old VN was flagged as a checked bound, propagate that to the new VN - // to make sure assertion prop will pay attention to this VN. - ValueNum oldVN = exp->gtVNPair.GetConservative(); - if (!vnStore->IsVNConstant(theConservativeVN) && vnStore->IsVNCheckedBound(oldVN)) + ValueNum currVN = m_pCompiler->vnStore->VNLiberalNormalValue(exp->gtVNPair); + ssize_t curValue = m_pCompiler->vnStore->CoercedConstantValue(currVN); + ssize_t delta = curValue - dsc->csdConstDefValue; + if (delta != 0) { - vnStore->SetVNIsCheckedBound(theConservativeVN); + GenTree* deltaNode = m_pCompiler->gtNewIconNode(delta, cseLclVarTyp); + cse = m_pCompiler->gtNewOperNode(GT_ADD, cseLclVarTyp, cseLclVar, deltaNode); + cse->SetDoNotCSE(); } + } - GenTree* cmp; - if ((m_pCompiler->optCseCheckedBoundMap != nullptr) && - (m_pCompiler->optCseCheckedBoundMap->Lookup(exp, &cmp))) - { - // Propagate the new value number to this compare node as well, since - // subsequent range check elimination will try to correlate it with - // the other appearances that are getting CSEd. + // assign the proper ValueNumber, A CSE use discards any exceptions + cse->gtVNPair = vnStore->VNPNormalPair(exp->gtVNPair); - ValueNum oldCmpVN = cmp->gtVNPair.GetConservative(); - ValueNum newCmpArgVN; + // shared const CSE has the correct value number assigned + // and both liberal and conservative are identical + // and they do not use theConservativeVN + // + if (!isSharedConst) + { + ValueNum theConservativeVN = successfulCandidate->CseDsc()->defConservNormVN; - ValueNumStore::CompareCheckedBoundArithInfo info; - if (vnStore->IsVNCompareCheckedBound(oldCmpVN)) + if (theConservativeVN != ValueNumStore::NoVN) + { + // All defs of this CSE share the same normal conservative VN, and we are rewriting this + // use to fetch the same value with no reload, so we can safely propagate that + // conservative VN to this use. This can help range check elimination later on. + cse->gtVNPair.SetConservative(theConservativeVN); + + // If the old VN was flagged as a checked bound, propagate that to the new VN + // to make sure assertion prop will pay attention to this VN. + ValueNum oldVN = exp->gtVNPair.GetConservative(); + if (!vnStore->IsVNConstant(theConservativeVN) && vnStore->IsVNCheckedBound(oldVN)) { - // Comparison is against the bound directly. - - newCmpArgVN = theConservativeVN; - vnStore->GetCompareCheckedBound(oldCmpVN, &info); + vnStore->SetVNIsCheckedBound(theConservativeVN); } - else + + GenTree* cmp; + if ((m_pCompiler->optCseCheckedBoundMap != nullptr) && + (m_pCompiler->optCseCheckedBoundMap->Lookup(exp, &cmp))) { - // Comparison is against the bound +/- some offset. + // Propagate the new value number to this compare node as well, since + // subsequent range check elimination will try to correlate it with + // the other appearances that are getting CSEd. + + ValueNum oldCmpVN = cmp->gtVNPair.GetConservative(); + ValueNum newCmpArgVN; + + ValueNumStore::CompareCheckedBoundArithInfo info; + if (vnStore->IsVNCompareCheckedBound(oldCmpVN)) + { + // Comparison is against the bound directly. + + newCmpArgVN = theConservativeVN; + vnStore->GetCompareCheckedBound(oldCmpVN, &info); + } + else + { + // Comparison is against the bound +/- some offset. - assert(vnStore->IsVNCompareCheckedBoundArith(oldCmpVN)); - vnStore->GetCompareCheckedBoundArithInfo(oldCmpVN, &info); - newCmpArgVN = vnStore->VNForFunc(vnStore->TypeOfVN(info.arrOp), (VNFunc)info.arrOper, - info.arrOp, theConservativeVN); + assert(vnStore->IsVNCompareCheckedBoundArith(oldCmpVN)); + vnStore->GetCompareCheckedBoundArithInfo(oldCmpVN, &info); + newCmpArgVN = vnStore->VNForFunc(vnStore->TypeOfVN(info.arrOp), (VNFunc)info.arrOper, + info.arrOp, theConservativeVN); + } + ValueNum newCmpVN = vnStore->VNForFunc(vnStore->TypeOfVN(oldCmpVN), (VNFunc)info.cmpOper, + info.cmpOp, newCmpArgVN); + cmp->gtVNPair.SetConservative(newCmpVN); } - ValueNum newCmpVN = vnStore->VNForFunc(vnStore->TypeOfVN(oldCmpVN), (VNFunc)info.cmpOper, - info.cmpOp, newCmpArgVN); - cmp->gtVNPair.SetConservative(newCmpVN); } } #ifdef DEBUG @@ -2878,10 +3106,9 @@ class CSE_Heuristic } #endif - GenTree* cseVal = cse; - GenTree* curSideEff = sideEffList; - ValueNumStore* vnStore = m_pCompiler->vnStore; - ValueNumPair exceptions_vnp = ValueNumStore::VNPForEmptyExcSet(); + GenTree* cseVal = cse; + GenTree* curSideEff = sideEffList; + ValueNumPair exceptions_vnp = ValueNumStore::VNPForEmptyExcSet(); while ((curSideEff->OperGet() == GT_COMMA) || (curSideEff->OperGet() == GT_ASG)) { @@ -2936,6 +3163,17 @@ class CSE_Heuristic exp->gtCSEnum = NO_CSE; // clear the gtCSEnum field GenTree* val = exp; + if (isSharedConst) + { + ValueNum currVN = m_pCompiler->vnStore->VNLiberalNormalValue(exp->gtVNPair); + ssize_t curValue = m_pCompiler->vnStore->CoercedConstantValue(currVN); + ssize_t delta = curValue - dsc->csdConstDefValue; + if (delta != 0) + { + val = m_pCompiler->gtNewIconNode(dsc->csdConstDefValue, cseLclVarTyp); + val->gtVNPair.SetBoth(dsc->csdConstDefVN); + } + } /* Create an assignment of the value to the temp */ GenTree* asg = m_pCompiler->gtNewTempAssign(cseLclVarNum, val); @@ -2977,19 +3215,37 @@ class CSE_Heuristic } /* Create a reference to the CSE temp */ - GenTree* ref = m_pCompiler->gtNewLclvNode(cseLclVarNum, cseLclVarTyp); - ref->gtVNPair = val->gtVNPair; // The new 'ref' is the same as 'val' + GenTree* cseLclVar = m_pCompiler->gtNewLclvNode(cseLclVarNum, cseLclVarTyp); + cseLclVar->gtVNPair.SetBoth(dsc->csdConstDefVN); - // Assign the ssa num for the ref use. Note it may be the reserved num. - ref->AsLclVarCommon()->SetSsaNum(cseSsaNum); + // Assign the ssa num for the lclvar use. Note it may be the reserved num. + cseLclVar->AsLclVarCommon()->SetSsaNum(cseSsaNum); + + GenTree* cseUse = cseLclVar; + if (isSharedConst) + { + ValueNum currVN = m_pCompiler->vnStore->VNLiberalNormalValue(exp->gtVNPair); + ssize_t curValue = m_pCompiler->vnStore->CoercedConstantValue(currVN); + ssize_t delta = curValue - dsc->csdConstDefValue; + if (delta != 0) + { + GenTree* deltaNode = m_pCompiler->gtNewIconNode(delta, cseLclVarTyp); + cseUse = m_pCompiler->gtNewOperNode(GT_ADD, cseLclVarTyp, cseLclVar, deltaNode); + cseUse->SetDoNotCSE(); + } + } + cseUse->gtVNPair = val->gtVNPair; // The 'cseUse' is equal to 'val' /* Create a comma node for the CSE assignment */ - cse = m_pCompiler->gtNewOperNode(GT_COMMA, expTyp, origAsg, ref); - cse->gtVNPair = ref->gtVNPair; // The comma's value is the same as 'val' - // as the assignment to the CSE LclVar - // cannot add any new exceptions + cse = m_pCompiler->gtNewOperNode(GT_COMMA, expTyp, origAsg, cseUse); + cse->gtVNPair = cseUse->gtVNPair; // The comma's value is the same as 'val' + // as the assignment to the CSE LclVar + // cannot add any new exceptions } + cse->CopyReg(exp); // The cse inheirits any reg num property from the orginal exp node + exp->ClearRegNum(); // The exp node (for a CSE def) no longer has a register requirement + // Walk the statement 'stmt' and find the pointer // in the tree is pointing to 'exp' // @@ -3069,9 +3325,19 @@ class CSE_Heuristic #ifdef DEBUG if (m_pCompiler->verbose) { - printf("\nConsidering CSE #%02u {$%-3x, $%-3x} [def=%3u, use=%3u, cost=%3u%s]\n", candidate.CseIndex(), - dsc->csdHashKey, dsc->defExcSetPromise, candidate.DefCount(), candidate.UseCount(), - candidate.Cost(), dsc->csdLiveAcrossCall ? ", call" : " "); + if (!Compiler::Is_Shared_Const_CSE(dsc->csdHashKey)) + { + printf("\nConsidering CSE #%02u {$%-3x, $%-3x} [def=%3u, use=%3u, cost=%3u%s]\n", + candidate.CseIndex(), dsc->csdHashKey, dsc->defExcSetPromise, candidate.DefCount(), + candidate.UseCount(), candidate.Cost(), dsc->csdLiveAcrossCall ? ", call" : " "); + } + else + { + size_t kVal = Compiler::Decode_Shared_Const_CSE_Value(dsc->csdHashKey); + printf("\nConsidering CSE #%02u {K_%p} [def=%3u, use=%3u, cost=%3u%s]\n", candidate.CseIndex(), + dspPtr(kVal), candidate.DefCount(), candidate.UseCount(), candidate.Cost(), + dsc->csdLiveAcrossCall ? ", call" : " "); + } printf("CSE Expression : \n"); m_pCompiler->gtDispTree(candidate.Expr()); printf("\n"); @@ -3306,8 +3572,11 @@ bool Compiler::optIsCSEcandidate(GenTree* tree) return (tree->AsOp()->gtOp1->gtOper != GT_ARR_ELEM); - case GT_CNS_INT: case GT_CNS_LNG: +#ifndef TARGET_64BIT + return false; // Don't CSE 64-bit constants on 32-bit platforms +#endif + case GT_CNS_INT: case GT_CNS_DBL: case GT_CNS_STR: return true; // We reach here only when CSE_CONSTS is enabled @@ -3349,6 +3618,7 @@ bool Compiler::optIsCSEcandidate(GenTree* tree) { return false; } + return true; case GT_EQ: case GT_NE: diff --git a/src/coreclr/src/jit/optimizer.cpp b/src/coreclr/src/jit/optimizer.cpp index d953ecd92aed..240e0c508857 100644 --- a/src/coreclr/src/jit/optimizer.cpp +++ b/src/coreclr/src/jit/optimizer.cpp @@ -489,7 +489,7 @@ void Compiler::optUpdateLoopsBeforeRemoveBlock(BasicBlock* block, bool skipUnmar break; } - __fallthrough; + FALLTHROUGH; case BBJ_ALWAYS: noway_assert(block->bbJumpDest); @@ -550,7 +550,7 @@ void Compiler::optUpdateLoopsBeforeRemoveBlock(BasicBlock* block, bool skipUnmar break; } - __fallthrough; + FALLTHROUGH; case BBJ_ALWAYS: noway_assert(auxBlock->bbJumpDest); @@ -1392,7 +1392,7 @@ void Compiler::optCheckPreds() { break; } - __fallthrough; + FALLTHROUGH; case BBJ_NONE: noway_assert(blockPred->bbNext == block); break; @@ -3207,7 +3207,7 @@ bool Compiler::optComputeLoopRep(int constInit, { case GT_SUB: iterInc = -iterInc; - __fallthrough; + FALLTHROUGH; case GT_ADD: if (constInitX != constLimitX) @@ -3254,7 +3254,7 @@ bool Compiler::optComputeLoopRep(int constInit, { case GT_SUB: iterInc = -iterInc; - __fallthrough; + FALLTHROUGH; case GT_ADD: if (constInitX < constLimitX) @@ -3301,7 +3301,7 @@ bool Compiler::optComputeLoopRep(int constInit, { case GT_SUB: iterInc = -iterInc; - __fallthrough; + FALLTHROUGH; case GT_ADD: if (constInitX <= constLimitX) @@ -3348,7 +3348,7 @@ bool Compiler::optComputeLoopRep(int constInit, { case GT_SUB: iterInc = -iterInc; - __fallthrough; + FALLTHROUGH; case GT_ADD: if (constInitX > constLimitX) @@ -3395,7 +3395,7 @@ bool Compiler::optComputeLoopRep(int constInit, { case GT_SUB: iterInc = -iterInc; - __fallthrough; + FALLTHROUGH; case GT_ADD: if (constInitX >= constLimitX) @@ -3798,8 +3798,6 @@ void Compiler::optUnrollLoops() testCopyStmt->SetRootNode(sideEffList); } newBlock->bbJumpKind = BBJ_NONE; - newBlock->bbFlags &= - ~BBF_NEEDS_GCPOLL; // Clear any NEEDS_GCPOLL flag as this block no longer can be a back edge // Exit this loop; we've walked all the blocks. break; @@ -3842,7 +3840,7 @@ void Compiler::optUnrollLoops() { block->bbStmtList = nullptr; block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~(BBF_NEEDS_GCPOLL | BBF_LOOP_HEAD); + block->bbFlags &= ~BBF_LOOP_HEAD; if (block->bbJumpDest != nullptr) { block->bbJumpDest = nullptr; @@ -3871,7 +3869,6 @@ void Compiler::optUnrollLoops() initStmt->SetNextStmt(nullptr); preHeaderStmt->SetPrevStmt(initStmt); head->bbJumpKind = BBJ_NONE; - head->bbFlags &= ~BBF_NEEDS_GCPOLL; } else { @@ -5783,7 +5780,7 @@ bool Compiler::optNarrowTree(GenTree* tree, var_types srct, var_types dstt, Valu noway_assert(doit == false); return false; } - __fallthrough; + FALLTHROUGH; case GT_OR: case GT_XOR: @@ -6549,6 +6546,7 @@ void Compiler::optHoistThisLoop(unsigned lnum, LoopHoistContext* hoistCtxt) { printf("optHoistLoopCode for loop L%02u <" FMT_BB ".." FMT_BB ">:\n", lnum, begn, endn); printf(" Loop body %s a call\n", pLoopDsc->lpContainsCall ? "contains" : "does not contain"); + printf(" Loop has %s\n", (pLoopDsc->lpFlags & LPFLG_ONE_EXIT) ? "single exit" : "multiple exits"); } #endif @@ -7524,7 +7522,7 @@ void Compiler::fgCreateLoopPreHeader(unsigned lnum) noway_assert(predBlock->bbJumpDest != top); break; } - __fallthrough; + FALLTHROUGH; case BBJ_ALWAYS: case BBJ_EHCATCHRET: @@ -7563,6 +7561,7 @@ void Compiler::fgCreateLoopPreHeader(unsigned lnum) preHead->bbFlags |= BBF_JMP_TARGET | BBF_HAS_LABEL; } } while (++jumpTab, --jumpCnt); + break; default: noway_assert(!"Unexpected bbJumpKind"); @@ -7920,10 +7919,11 @@ bool Compiler::optComputeLoopSideEffectsOfBlock(BasicBlock* blk) } break; - case GT_LOCKADD: // Binop - case GT_XADD: // Binop - case GT_XCHG: // Binop - case GT_CMPXCHG: // Specialop + case GT_LOCKADD: + case GT_XADD: + case GT_XCHG: + case GT_CMPXCHG: + case GT_MEMORYBARRIER: { assert(!tree->OperIs(GT_LOCKADD) && "LOCKADD should not appear before lowering"); memoryHavoc |= memoryKindSet(GcHeap, ByrefExposed); diff --git a/src/coreclr/src/jit/patchpoint.cpp b/src/coreclr/src/jit/patchpoint.cpp index e5a2981abd02..790ec3e56a00 100644 --- a/src/coreclr/src/jit/patchpoint.cpp +++ b/src/coreclr/src/jit/patchpoint.cpp @@ -54,6 +54,10 @@ class PatchpointTransformer { if (block->bbFlags & BBF_PATCHPOINT) { + // 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. // diff --git a/src/coreclr/src/jit/phase.cpp b/src/coreclr/src/jit/phase.cpp index f1fd245ae1b9..b2387101e9b2 100644 --- a/src/coreclr/src/jit/phase.cpp +++ b/src/coreclr/src/jit/phase.cpp @@ -218,6 +218,20 @@ void Phase::PostPhase(PhaseStatus status) } } + // Optionally check profile data, if we have any. + // + // There's no point checking until we've built pred lists, as + // we can't easily reason about consistency without them. + // + // Bypass the "doPostPhase" filter until we're sure all + // phases that mess with profile counts set their phase status + // appropriately. + // + if ((JitConfig.JitProfileChecks() > 0) && comp->fgHaveProfileData() && comp->fgComputePredsDone) + { + comp->fgDebugCheckProfileData(); + } + #endif // DEBUG comp->EndPhase(m_phase); diff --git a/src/coreclr/src/jit/protojit/CMakeLists.txt b/src/coreclr/src/jit/protojit/CMakeLists.txt deleted file mode 100644 index 981583be888a..000000000000 --- a/src/coreclr/src/jit/protojit/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project(protojit) - -add_definitions(-DALT_JIT) -add_definitions(-DFEATURE_NO_HOST) -add_definitions(-DSELF_NO_HOST) -remove_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE) - -if(FEATURE_READYTORUN) - add_definitions(-DFEATURE_READYTORUN_COMPILER) -endif(FEATURE_READYTORUN) - -add_jit(protojit) diff --git a/src/coreclr/src/jit/protojit/SOURCES b/src/coreclr/src/jit/protojit/SOURCES deleted file mode 100644 index 42c58f760f0f..000000000000 --- a/src/coreclr/src/jit/protojit/SOURCES +++ /dev/null @@ -1,10 +0,0 @@ - -# -# DO NOT EDIT THIS FILE!!! Modify the project file in this directory -# This file merely allows the MSBuild project file in this directory to be integrated with Build.Exe -# -TARGETTYPE=NOTARGET -CLR_TARGETTYPE=DLL -MSBuildProjectFile=protojit.nativeproj -SOURCES= - diff --git a/src/coreclr/src/jit/protojit/makefile b/src/coreclr/src/jit/protojit/makefile deleted file mode 100644 index 04c839a2a668..000000000000 --- a/src/coreclr/src/jit/protojit/makefile +++ /dev/null @@ -1,6 +0,0 @@ - -# -# DO NOT EDIT THIS FILE!!! Modify the project file in this directory -# This file merely allows the MSBuild project file in this directory to be integrated with Build.Exe -# -!INCLUDE $(NTMAKEENV)\msbuild.def diff --git a/src/coreclr/src/jit/protojit/protojit.def b/src/coreclr/src/jit/protojit/protojit.def deleted file mode 100644 index 0afb54dca77d..000000000000 --- a/src/coreclr/src/jit/protojit/protojit.def +++ /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. -EXPORTS - getJit - jitStartup diff --git a/src/coreclr/src/jit/protononjit/CMakeLists.txt b/src/coreclr/src/jit/protononjit/CMakeLists.txt deleted file mode 100644 index 45c9a5999b70..000000000000 --- a/src/coreclr/src/jit/protononjit/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -project(protononjit) - -add_definitions(-DALT_JIT) -add_definitions(-DFEATURE_NO_HOST) -add_definitions(-DSELF_NO_HOST) -remove_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE) - -if(FEATURE_READYTORUN) - add_definitions(-DFEATURE_READYTORUN_COMPILER) -endif(FEATURE_READYTORUN) - -if (CLR_CMAKE_HOST_ARCH_I386) - remove_definitions(-DTARGET_X86) - remove_definitions(-DFEATURE_SIMD) - remove_definitions(-DFEATURE_HW_INTRINSICS) - add_definitions(-DTARGET_ARM) - add_definitions(-DFEATURE_EH_FUNCLETS) - set(JIT_ARCH_SOURCES ${JIT_ARM_SOURCES}) - set(JIT_ARCH_LINK_LIBRARIES gcinfo_arm) -elseif(CLR_CMAKE_HOST_ARCH_AMD64) - remove_definitions(-DTARGET_AMD64) - add_definitions(-DTARGET_ARM64) - set(JIT_ARCH_SOURCES ${JIT_ARM64_SOURCES}) - set(JIT_ARCH_LINK_LIBRARIES gcinfo_arm64) -else() - clr_unknown_arch() -endif() - -if (NOT CLR_CMAKE_HOST_WIN32) - if (CLR_CMAKE_HOST_ARCH_I386) - remove_definitions(-DUNIX_X86_ABI) - elseif(CLR_CMAKE_HOST_ARCH_AMD64) - remove_definitions(-DUNIX_AMD64_ABI) - else() - clr_unknown_arch() - endif() -endif(NOT CLR_CMAKE_HOST_WIN32) - -add_jit(protononjit) diff --git a/src/coreclr/src/jit/protononjit/SOURCES b/src/coreclr/src/jit/protononjit/SOURCES deleted file mode 100644 index 79189a609762..000000000000 --- a/src/coreclr/src/jit/protononjit/SOURCES +++ /dev/null @@ -1,9 +0,0 @@ - -# -# DO NOT EDIT THIS FILE!!! Modify the project file in this directory -# This file merely allows the MSBuild project file in this directory to be integrated with Build.Exe -# -TARGETTYPE=NOTARGET -CLR_TARGETTYPE=DLL -MSBuildProjectFile=protononjit.nativeproj -SOURCES= diff --git a/src/coreclr/src/jit/protononjit/makefile b/src/coreclr/src/jit/protononjit/makefile deleted file mode 100644 index bf27e8c84b05..000000000000 --- a/src/coreclr/src/jit/protononjit/makefile +++ /dev/null @@ -1,7 +0,0 @@ - -# -# DO NOT EDIT THIS FILE!!! Modify the project file in this directory -# This file merely allows the MSBuild project file in this directory to be integrated with Build.Exe -# - -!INCLUDE $(NTMAKEENV)\devdiv.def diff --git a/src/coreclr/src/jit/protononjit/protononjit.def b/src/coreclr/src/jit/protononjit/protononjit.def deleted file mode 100644 index 0afb54dca77d..000000000000 --- a/src/coreclr/src/jit/protononjit/protononjit.def +++ /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. -EXPORTS - getJit - jitStartup diff --git a/src/coreclr/src/jit/rangecheck.cpp b/src/coreclr/src/jit/rangecheck.cpp index 66ebafb1c747..3b5c925229bd 100644 --- a/src/coreclr/src/jit/rangecheck.cpp +++ b/src/coreclr/src/jit/rangecheck.cpp @@ -59,13 +59,29 @@ int RangeCheck::GetArrLength(ValueNum vn) return m_pCompiler->vnStore->GetNewArrSize(arrRefVN); } -// Check if the computed range is within bounds. -bool RangeCheck::BetweenBounds(Range& range, int lower, GenTree* upper) +//------------------------------------------------------------------------ +// BetweenBounds: Check if the computed range is within bounds +// +// Arguments: +// Range - the range to check if in bounds +// upper - the array length vn +// arrSize - the length of the array if known, or <= 0 +// +// Return Value: +// True iff range is between [0 and vn - 1] or [0, arrSize - 1] +// +// notes: +// This function assumes that the lower range is resolved and upper range is symbolic as in an +// increasing loop. +// +// TODO-CQ: This is not general enough. +// +bool RangeCheck::BetweenBounds(Range& range, GenTree* upper, int arrSize) { #ifdef DEBUG if (m_pCompiler->verbose) { - printf("%s BetweenBounds <%d, ", range.ToString(m_pCompiler->getAllocatorDebugOnly()), lower); + printf("%s BetweenBounds <%d, ", range.ToString(m_pCompiler->getAllocatorDebugOnly()), 0); Compiler::printTreeID(upper); printf(">\n"); } @@ -85,28 +101,9 @@ bool RangeCheck::BetweenBounds(Range& range, int lower, GenTree* upper) JITDUMP("\n"); #endif - int arrSize = 0; - - if (vnStore->IsVNConstant(uLimitVN)) + if ((arrSize <= 0) && !vnStore->IsVNCheckedBound(uLimitVN)) { - ssize_t constVal = -1; - unsigned iconFlags = 0; - - if (m_pCompiler->optIsTreeKnownIntValue(true, upper, &constVal, &iconFlags)) - { - arrSize = (int)constVal; - } - } - else if (vnStore->IsVNArrLen(uLimitVN)) - { - // Get the array reference from the length. - ValueNum arrRefVN = vnStore->GetArrForLenVn(uLimitVN); - // Check if array size can be obtained. - arrSize = vnStore->GetNewArrSize(arrRefVN); - } - else if (!vnStore->IsVNCheckedBound(uLimitVN)) - { - // If the upper limit is not length, then bail. + // If we don't know the array size and the upper limit is not known, then bail. return false; } @@ -231,6 +228,19 @@ void RangeCheck::OptimizeRangeCheck(BasicBlock* block, Statement* stmt, GenTree* #endif // FEATURE_SIMD { arrSize = GetArrLength(arrLenVn); + + // if we can't find the array length, see if there + // are any assertions about the array size we can use to get a minimum length + if (arrSize <= 0) + { + JITDUMP("Looking for array size assertions for: " FMT_VN "\n", arrLenVn); + Range arrLength = Range(Limit(Limit::keDependent)); + MergeEdgeAssertions(arrLenVn, block->bbAssertionIn, &arrLength); + if (arrLength.lLimit.IsConstant()) + { + arrSize = arrLength.lLimit.GetConstant(); + } + } } JITDUMP("ArrSize for lengthVN:%03X = %d\n", arrLenVn, arrSize); @@ -286,7 +296,7 @@ void RangeCheck::OptimizeRangeCheck(BasicBlock* block, Statement* stmt, GenTree* } // Is the range between the lower and upper bound values. - if (BetweenBounds(range, 0, bndsChk->gtArrLen)) + if (BetweenBounds(range, bndsChk->gtArrLen, arrSize)) { JITDUMP("[RangeCheck::OptimizeRangeCheck] Between bounds\n"); m_pCompiler->optRemoveRangeCheck(treeParent, stmt); @@ -532,18 +542,51 @@ void RangeCheck::SetDef(UINT64 hash, Location* loc) } #endif -// Merge assertions on the edge flowing into the block about a variable. +//------------------------------------------------------------------------ +// MergeEdgeAssertions: Merge assertions on the edge flowing into the block about a variable +// +// Arguments: +// GenTreeLclVarCommon - the variable to look for assertions for +// assertions - the assertions to use +// pRange - the range to tighten with assertions +// void RangeCheck::MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP assertions, Range* pRange) +{ + if (lcl->GetSsaNum() == SsaConfig::RESERVED_SSA_NUM) + { + return; + } + + LclVarDsc* varDsc = m_pCompiler->lvaGetDesc(lcl); + if (varDsc->CanBeReplacedWithItsField(m_pCompiler)) + { + varDsc = m_pCompiler->lvaGetDesc(varDsc->lvFieldLclStart); + } + LclSsaVarDsc* ssaData = varDsc->GetPerSsaData(lcl->GetSsaNum()); + ValueNum normalLclVN = m_pCompiler->vnStore->VNConservativeNormalValue(ssaData->m_vnPair); + MergeEdgeAssertions(normalLclVN, assertions, pRange); +} + +//------------------------------------------------------------------------ +// MergeEdgeAssertions: Merge assertions on the edge flowing into the block about a variable +// +// Arguments: +// normalLclVN - the value number to look for assertions for +// assertions - the assertions to use +// pRange - the range to tighten with assertions +// +void RangeCheck::MergeEdgeAssertions(ValueNum normalLclVN, ASSERT_VALARG_TP assertions, Range* pRange) { if (BitVecOps::IsEmpty(m_pCompiler->apTraits, assertions)) { return; } - if (lcl->GetSsaNum() == SsaConfig::RESERVED_SSA_NUM) + if (normalLclVN == ValueNumStore::NoVN) { return; } + // Walk through the "assertions" to check if the apply. BitVecOps::Iter iter(m_pCompiler->apTraits, assertions); unsigned index = 0; @@ -554,15 +597,8 @@ void RangeCheck::MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP Compiler::AssertionDsc* curAssertion = m_pCompiler->optGetAssertion(assertionIndex); Limit limit(Limit::keUndef); - genTreeOps cmpOper = GT_NONE; - - LclVarDsc* varDsc = m_pCompiler->lvaGetDesc(lcl); - if (varDsc->CanBeReplacedWithItsField(m_pCompiler)) - { - varDsc = m_pCompiler->lvaGetDesc(varDsc->lvFieldLclStart); - } - LclSsaVarDsc* ssaData = varDsc->GetPerSsaData(lcl->GetSsaNum()); - ValueNum normalLclVN = m_pCompiler->vnStore->VNConservativeNormalValue(ssaData->m_vnPair); + genTreeOps cmpOper = GT_NONE; + bool isConstantAssertion = false; // Current assertion is of the form (i < len - cns) != 0 if (curAssertion->IsCheckedBoundArithBound()) @@ -602,13 +638,20 @@ void RangeCheck::MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP m_pCompiler->vnStore->GetCompareCheckedBound(curAssertion->op1.vn, &info); // If we don't have the same variable we are comparing against, bail. - if (normalLclVN != info.cmpOp) + if (normalLclVN == info.cmpOp) + { + cmpOper = (genTreeOps)info.cmpOper; + limit = Limit(Limit::keBinOpArray, info.vnBound, 0); + } + else if (normalLclVN == info.vnBound) + { + cmpOper = GenTree::SwapRelop((genTreeOps)info.cmpOper); + limit = Limit(Limit::keBinOpArray, info.cmpOp, 0); + } + else { continue; } - - limit = Limit(Limit::keBinOpArray, info.vnBound, 0); - cmpOper = (genTreeOps)info.cmpOper; } // Current assertion is of the form (i < 100) != 0 else if (curAssertion->IsConstantBound()) @@ -627,6 +670,36 @@ void RangeCheck::MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP limit = Limit(Limit::keConstant, info.constVal); cmpOper = (genTreeOps)info.cmpOper; } + // Current assertion is of the form i == 100 + else if (curAssertion->IsConstantInt32Assertion()) + { + if (curAssertion->op1.vn != normalLclVN) + { + continue; + } + + int cnstLimit = m_pCompiler->vnStore->CoercedConstantValue(curAssertion->op2.vn); + + if ((cnstLimit == 0) && (curAssertion->assertionKind == Compiler::OAK_NOT_EQUAL) && + m_pCompiler->vnStore->IsVNCheckedBound(curAssertion->op1.vn)) + { + // we have arr.Len != 0, so the length must be atleast one + limit = Limit(Limit::keConstant, 1); + cmpOper = GT_GE; + } + else if (curAssertion->assertionKind == Compiler::OAK_EQUAL) + { + limit = Limit(Limit::keConstant, cnstLimit); + cmpOper = GT_EQ; + } + else + { + // We have a != assertion, but it doesn't tell us much about the interval. So just skip it. + continue; + } + + isConstantAssertion = true; + } // Current assertion is not supported, ignore it else { @@ -635,8 +708,8 @@ void RangeCheck::MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP assert(limit.IsBinOpArray() || limit.IsConstant()); - // Make sure the assertion is of the form != 0 or == 0. - if (curAssertion->op2.vn != m_pCompiler->vnStore->VNZeroForType(TYP_INT)) + // Make sure the assertion is of the form != 0 or == 0 if it isn't a constant assertion. + if (!isConstantAssertion && (curAssertion->op2.vn != m_pCompiler->vnStore->VNZeroForType(TYP_INT))) { continue; } @@ -647,6 +720,17 @@ void RangeCheck::MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP } #endif + // Limits are sometimes made with the form vn + constant, where vn is a known constant + // see if we can simplify this to just a constant + if (limit.IsBinOpArray() && m_pCompiler->vnStore->IsVNInt32Constant(limit.vn)) + { + Limit tempLimit = Limit(Limit::keConstant, m_pCompiler->vnStore->ConstantValue(limit.vn)); + if (tempLimit.AddConstant(limit.cns)) + { + limit = tempLimit; + } + } + ValueNum arrLenVN = m_pCompiler->vnStore->VNConservativeNormalValue(m_pCurBndsChk->gtArrLen->gtVNPair); if (m_pCompiler->vnStore->IsVNConstant(arrLenVN)) @@ -663,22 +747,25 @@ void RangeCheck::MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP // (i < length) != 0 // (i < 100) == 0 // (i < 100) != 0 + // i == 100 // - // At this point, we have detected that op1.vn is (i < length) or (i < length + cns) or - // (i < 100) and the op2.vn is 0. + // At this point, we have detected that either op1.vn is (i < length) or (i < length + cns) or + // (i < 100) and the op2.vn is 0 or that op1.vn is i and op2.vn is a known constant. // // Now, let us check if we are == 0 (i.e., op1 assertion is false) or != 0 (op1 assertion - // is true.), + // is true.). // - // If we have an assertion of the form == 0 (i.e., equals false), then reverse relop. + // If we have a non-constant assertion of the form == 0 (i.e., equals false), then reverse relop. // The relop has to be reversed because we have: (i < length) is false which is the same // as (i >= length). - if (curAssertion->assertionKind == Compiler::OAK_EQUAL) + if ((curAssertion->assertionKind == Compiler::OAK_EQUAL) && !isConstantAssertion) { cmpOper = GenTree::ReverseRelop(cmpOper); } - // Bounds are inclusive, so add -1 for upper bound when "<". But make sure we won't overflow. + assert(cmpOper != GT_NONE); + + // Bounds are inclusive, so add -1 for upper bound when "<". But make sure we won't underflow. if (cmpOper == GT_LT && !limit.AddConstant(-1)) { continue; @@ -744,6 +831,11 @@ void RangeCheck::MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP pRange->lLimit = limit; break; + case GT_EQ: + pRange->uLimit = limit; + pRange->lLimit = limit; + break; + default: // All other 'cmpOper' kinds leave lLimit/uLimit unchanged break; diff --git a/src/coreclr/src/jit/rangecheck.h b/src/coreclr/src/jit/rangecheck.h index 754f64cbc2ea..751b243740c4 100644 --- a/src/coreclr/src/jit/rangecheck.h +++ b/src/coreclr/src/jit/rangecheck.h @@ -434,11 +434,11 @@ class RangeCheck int GetArrLength(ValueNum vn); - // Check whether the computed range is within lower and upper bounds. This function + // Check whether the computed range is within 0 and upper bounds. This function // assumes that the lower range is resolved and upper range is symbolic as in an // increasing loop. // TODO-CQ: This is not general enough. - bool BetweenBounds(Range& range, int lower, GenTree* upper); + bool BetweenBounds(Range& range, GenTree* upper, int arrSize); // Entry point to optimize range checks in the block. Assumes value numbering // and assertion prop phases are completed. @@ -474,6 +474,9 @@ class RangeCheck // refine the "pRange" value. void MergeEdgeAssertions(GenTreeLclVarCommon* lcl, ASSERT_VALARG_TP assertions, Range* pRange); + // Inspect the assertions about the current ValueNum to refine pRange + void MergeEdgeAssertions(ValueNum num, ASSERT_VALARG_TP assertions, Range* pRange); + // The maximum possible value of the given "limit." If such a value could not be determined // return "false." For example: ARRLEN_MAX for array length. bool GetLimitMax(Limit& limit, int* pMax); diff --git a/src/coreclr/src/jit/rationalize.cpp b/src/coreclr/src/jit/rationalize.cpp index b878a30beeae..8054fda6e8ef 100644 --- a/src/coreclr/src/jit/rationalize.cpp +++ b/src/coreclr/src/jit/rationalize.cpp @@ -726,7 +726,7 @@ Compiler::fgWalkResult Rationalizer::RewriteNode(GenTree** useEdge, Compiler::Ge case GT_INTRINSIC: // Non-target intrinsics should have already been rewritten back into user calls. - assert(comp->IsTargetIntrinsic(node->AsIntrinsic()->gtIntrinsicId)); + assert(comp->IsTargetIntrinsic(node->AsIntrinsic()->gtIntrinsicName)); break; #ifdef FEATURE_SIMD @@ -903,7 +903,7 @@ PhaseStatus Rationalizer::DoPhase() { GenTree* const node = *use; if (node->OperGet() == GT_INTRINSIC && - m_rationalizer.comp->IsIntrinsicImplementedByUserCall(node->AsIntrinsic()->gtIntrinsicId)) + m_rationalizer.comp->IsIntrinsicImplementedByUserCall(node->AsIntrinsic()->gtIntrinsicName)) { m_rationalizer.RewriteIntrinsicAsUserCall(use, this->m_ancestors); } diff --git a/src/coreclr/src/jit/rationalize.h b/src/coreclr/src/jit/rationalize.h index e4c8872eb0cd..6fe51c8cee43 100644 --- a/src/coreclr/src/jit/rationalize.h +++ b/src/coreclr/src/jit/rationalize.h @@ -2,6 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. //=============================================================================== +#ifndef JIT_RATIONALIZE_H +#define JIT_RATIONALIZE_H + #include "phase.h" class Rationalizer final : public Phase @@ -64,3 +67,5 @@ inline Rationalizer::Rationalizer(Compiler* _comp) : Phase(_comp, PHASE_RATIONAL comp->compNumStatementLinksTraversed = 0; #endif } + +#endif diff --git a/src/coreclr/src/jit/regalloc.cpp b/src/coreclr/src/jit/regalloc.cpp index 381edde88670..8dc4930ca837 100644 --- a/src/coreclr/src/jit/regalloc.cpp +++ b/src/coreclr/src/jit/regalloc.cpp @@ -165,7 +165,7 @@ regNumber Compiler::raUpdateRegStateForArg(RegState* regState, LclVarDsc* argDsc if (argDsc->lvIsHfaRegArg()) { assert(regState->rsIsFloat); - unsigned cSlots = GetHfaCount(argDsc->lvVerTypeInfo.GetClassHandleForValueClass()); + unsigned cSlots = GetHfaCount(argDsc->GetStructHnd()); for (unsigned i = 1; i < cSlots; i++) { assert(inArgReg + i <= LAST_FP_ARGREG); diff --git a/src/coreclr/src/jit/scopeinfo.cpp b/src/coreclr/src/jit/scopeinfo.cpp index 5fc7bca119f4..97dc968becb4 100644 --- a/src/coreclr/src/jit/scopeinfo.cpp +++ b/src/coreclr/src/jit/scopeinfo.cpp @@ -487,7 +487,7 @@ CodeGenInterface::siVarLoc CodeGenInterface::getSiVarLoc(const LclVarDsc* varDsc // For stack vars, find the base register, and offset regNumber baseReg; - signed offset = varDsc->lvStkOffs; + signed offset = varDsc->GetStackOffset(); if (!varDsc->lvFramePointerBased) { @@ -603,7 +603,7 @@ CodeGenInterface::siVarLoc CodeGen::getSiVarLoc(const LclVarDsc* varDsc, const s // For stack vars, find the base register, and offset regNumber baseReg; - signed offset = varDsc->lvStkOffs; + signed offset = varDsc->GetStackOffset(); if (!varDsc->lvFramePointerBased) { @@ -1487,17 +1487,17 @@ NATIVE_OFFSET CodeGen::psiGetVarStackOffset(const LclVarDsc* lclVarDsc) const #ifdef TARGET_AMD64 // scOffset = offset from caller SP - REGSIZE_BYTES // TODO-Cleanup - scOffset needs to be understood. For now just matching with the existing definition. - stackOffset = - compiler->lvaToCallerSPRelativeOffset(lclVarDsc->lvStkOffs, lclVarDsc->lvFramePointerBased) + REGSIZE_BYTES; + stackOffset = compiler->lvaToCallerSPRelativeOffset(lclVarDsc->GetStackOffset(), lclVarDsc->lvFramePointerBased) + + REGSIZE_BYTES; #else // !TARGET_AMD64 if (doubleAlignOrFramePointerUsed()) { // REGSIZE_BYTES - for the pushed value of EBP - stackOffset = lclVarDsc->lvStkOffs - REGSIZE_BYTES; + stackOffset = lclVarDsc->GetStackOffset() - REGSIZE_BYTES; } else { - stackOffset = lclVarDsc->lvStkOffs - genTotalFrameSize(); + stackOffset = lclVarDsc->GetStackOffset() - genTotalFrameSize(); } #endif // !TARGET_AMD64 @@ -1550,7 +1550,7 @@ void CodeGen::psiBegProlog() SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR structDesc; if (varTypeIsStruct(lclVarDsc)) { - CORINFO_CLASS_HANDLE typeHnd = lclVarDsc->lvVerTypeInfo.GetClassHandle(); + CORINFO_CLASS_HANDLE typeHnd = lclVarDsc->GetStructHnd(); assert(typeHnd != nullptr); compiler->eeGetSystemVAmd64PassStructInRegisterDescriptor(typeHnd, &structDesc); if (structDesc.passedInRegisters) @@ -1673,7 +1673,7 @@ void CodeGen::psiEndProlog() We still report all the arguments at the very start of the method so that the user can see the arguments at the very start of the method (offset=0). - Disabling this decreased the debug maps in mscorlib by 10% (01/2003) + Disabling this decreased the debug maps in CoreLib by 10% (01/2003) */ #if 0 @@ -1867,7 +1867,7 @@ void CodeGen::psiMoveToStack(unsigned varNum) psiScope* newScope = psiNewPrologScope(scope->scLVnum, scope->scSlotNum); newScope->scRegister = false; newScope->u2.scBaseReg = (compiler->lvaTable[varNum].lvFramePointerBased) ? REG_FPBASE : REG_SPBASE; - newScope->u2.scOffset = compiler->lvaTable[varNum].lvStkOffs; + newScope->u2.scOffset = compiler->lvaTable[varNum].GetStackOffset(); psiEndPrologScope(scope); return; diff --git a/src/coreclr/src/jit/simdashwintrinsic.cpp b/src/coreclr/src/jit/simdashwintrinsic.cpp index 6e48db4d8212..f4f9ec906c78 100644 --- a/src/coreclr/src/jit/simdashwintrinsic.cpp +++ b/src/coreclr/src/jit/simdashwintrinsic.cpp @@ -385,7 +385,7 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, #if defined(TARGET_XARCH) bool isVectorT256 = (SimdAsHWIntrinsicInfo::lookupClassId(intrinsic) == SimdAsHWIntrinsicClassId::VectorT256); - // We should have alredy exited early if SSE2 isn't supported + // We should have already exited early if SSE2 isn't supported assert(compIsaSupportedDebugOnly(InstructionSet_SSE2)); switch (intrinsic) @@ -428,7 +428,7 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, // Vector, when 32-bytes, requires at least AVX2 assert(!isVectorT256 || compIsaSupportedDebugOnly(InstructionSet_AVX2)); #elif defined(TARGET_ARM64) - // We should have alredy exited early if AdvSimd isn't supported + // We should have already exited early if AdvSimd isn't supported assert(compIsaSupportedDebugOnly(InstructionSet_AdvSimd)); #else #error Unsupported platform @@ -556,6 +556,7 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, break; } } + break; } case 1: @@ -1069,26 +1070,11 @@ GenTree* Compiler::impSimdAsHWIntrinsicCndSel(CORINFO_CLASS_HANDLE clsHnd, assert(op3 != nullptr); #if defined(TARGET_XARCH) - bool isVectorT256 = (simdSize == 32); - // Vector for the rel-ops covered here requires at least SSE2 assert(compIsaSupportedDebugOnly(InstructionSet_SSE2)); // Vector, when 32-bytes, requires at least AVX2 - assert(!isVectorT256 || compIsaSupportedDebugOnly(InstructionSet_AVX2)); - - if (compOpportunisticallyDependsOn(InstructionSet_SSE41)) - { - NamedIntrinsic hwIntrinsic = NI_SSE41_BlendVariable; - - if (isVectorT256) - { - hwIntrinsic = varTypeIsIntegral(baseType) ? NI_AVX2_BlendVariable : NI_AVX_BlendVariable; - } - - return gtNewSimdAsHWIntrinsicNode(retType, op3, op2, op1, hwIntrinsic, baseType, simdSize); - } -#endif // TARGET_XARCH + assert((simdSize != 32) || compIsaSupportedDebugOnly(InstructionSet_AVX2)); NamedIntrinsic hwIntrinsic; @@ -1113,6 +1099,11 @@ GenTree* Compiler::impSimdAsHWIntrinsicCndSel(CORINFO_CLASS_HANDLE clsHnd, // result = op2 | op3 hwIntrinsic = SimdAsHWIntrinsicInfo::lookupHWIntrinsic(NI_VectorT128_op_BitwiseOr, baseType); return gtNewSimdAsHWIntrinsicNode(retType, op2, op3, hwIntrinsic, baseType, simdSize); +#elif defined(TARGET_ARM64) + return gtNewSimdAsHWIntrinsicNode(retType, op1, op2, op3, NI_AdvSimd_BitwiseSelect, baseType, simdSize); +#else +#error Unsupported platform +#endif // !TARGET_XARCH && !TARGET_ARM64 } #if defined(TARGET_XARCH) diff --git a/src/coreclr/src/jit/simdcodegenxarch.cpp b/src/coreclr/src/jit/simdcodegenxarch.cpp index 4045c9b97f62..f1bafb9991d8 100644 --- a/src/coreclr/src/jit/simdcodegenxarch.cpp +++ b/src/coreclr/src/jit/simdcodegenxarch.cpp @@ -105,7 +105,7 @@ instruction CodeGen::getOpForSIMDIntrinsic(SIMDIntrinsicID intrinsicId, var_type } // For SSE, SIMDIntrinsicInit uses the same instruction as the SIMDIntrinsicShuffleSSE2 intrinsic. - __fallthrough; + FALLTHROUGH; case SIMDIntrinsicShuffleSSE2: if (baseType == TYP_FLOAT) diff --git a/src/coreclr/src/jit/ssabuilder.cpp b/src/coreclr/src/jit/ssabuilder.cpp index d562065bf216..62efd8696dac 100644 --- a/src/coreclr/src/jit/ssabuilder.cpp +++ b/src/coreclr/src/jit/ssabuilder.cpp @@ -1656,8 +1656,6 @@ bool SsaBuilder::IncludeInSsa(unsigned lclNum) // - SSA doesn't allow a single node to contain multiple SSA definitions. // - and PROMOTION_TYPE_DEPENDEDNT fields are never candidates for a register. // - // Example mscorlib method: CompatibilitySwitches:IsCompatibilitySwitchSet - // return false; } else if (varDsc->lvIsStructField && m_pCompiler->lvaGetDesc(varDsc->lvParentLcl)->lvIsMultiRegRet) diff --git a/src/coreclr/src/jit/stacklevelsetter.cpp b/src/coreclr/src/jit/stacklevelsetter.cpp index fa48b8080ea1..361a4faadf53 100644 --- a/src/coreclr/src/jit/stacklevelsetter.cpp +++ b/src/coreclr/src/jit/stacklevelsetter.cpp @@ -249,8 +249,9 @@ unsigned StackLevelSetter::PopArgumentsFromCall(GenTreeCall* call) { for (unsigned i = 0; i < argInfo->ArgCount(); ++i) { - fgArgTabEntry* argTab = argInfo->ArgTable()[i]; - if (argTab->numSlots != 0) + const fgArgTabEntry* argTab = argInfo->ArgTable()[i]; + const unsigned slotCount = argTab->GetStackSlotsNumber(); + if (slotCount != 0) { GenTree* node = argTab->GetNode(); assert(node->OperIsPutArgStkOrSplit()); @@ -258,13 +259,13 @@ unsigned StackLevelSetter::PopArgumentsFromCall(GenTreeCall* call) GenTreePutArgStk* putArg = node->AsPutArgStk(); #if !FEATURE_FIXED_OUT_ARGS - assert(argTab->numSlots == putArg->gtNumSlots); + assert(slotCount == putArg->gtNumSlots); #endif // !FEATURE_FIXED_OUT_ARGS - putArgNumSlots.Set(putArg, argTab->numSlots); + putArgNumSlots.Set(putArg, slotCount); - usedStackSlotsCount += argTab->numSlots; - AddStackLevel(argTab->numSlots); + usedStackSlotsCount += slotCount; + AddStackLevel(slotCount); } } } diff --git a/src/coreclr/src/jit/standalone/CMakeLists.txt b/src/coreclr/src/jit/standalone/CMakeLists.txt deleted file mode 100644 index c37ed9c31b55..000000000000 --- a/src/coreclr/src/jit/standalone/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -project(ryujit) - -add_definitions(-DFEATURE_NO_HOST) -add_definitions(-DSELF_NO_HOST) -remove_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE) - -if(FEATURE_READYTORUN) - add_definitions(-DFEATURE_READYTORUN_COMPILER) -endif(FEATURE_READYTORUN) - -add_jit(clrjit ADDITIONAL_DESTINATION sharedFramework) - -# Enable profile guided optimization -add_pgo(clrjit) diff --git a/src/coreclr/src/jit/static/CMakeLists.txt b/src/coreclr/src/jit/static/CMakeLists.txt index b4e62c041cd4..8a9c1ab0cb07 100644 --- a/src/coreclr/src/jit/static/CMakeLists.txt +++ b/src/coreclr/src/jit/static/CMakeLists.txt @@ -2,14 +2,18 @@ project(ClrJit) set_source_files_properties(${JIT_EXPORTS_FILE} PROPERTIES GENERATED TRUE) -add_library_clr(clrjit_static +add_library_clr(clrjit_obj OBJECT ${JIT_CORE_SOURCES} ${JIT_ARCH_SOURCES} ) if(CLR_CMAKE_HOST_UNIX) - add_dependencies(clrjit_static coreclrpal gcinfo) + add_dependencies(clrjit_obj coreclrpal gcinfo) endif(CLR_CMAKE_HOST_UNIX) -target_precompile_header(TARGET clrjit_static HEADER jitpch.h ADDITIONAL_INCLUDE_DIRECTORIES ${JIT_SOURCE_DIR}) +target_include_directories(clrjit_obj PRIVATE ${JIT_SOURCE_DIR}) +target_precompile_headers(clrjit_obj PRIVATE [["jitpch.h"]]) + +add_library(clrjit_static INTERFACE) +target_sources(clrjit_static INTERFACE $) diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h index 4e75434cd242..41d1afea1241 100644 --- a/src/coreclr/src/jit/target.h +++ b/src/coreclr/src/jit/target.h @@ -31,12 +31,15 @@ // with static const members of Target #if defined(TARGET_XARCH) #define REGMASK_BITS 32 +#define CSE_CONST_SHARED_LOW_BITS 16 #elif defined(TARGET_ARM) #define REGMASK_BITS 64 +#define CSE_CONST_SHARED_LOW_BITS 12 #elif defined(TARGET_ARM64) #define REGMASK_BITS 64 +#define CSE_CONST_SHARED_LOW_BITS 12 #else #error Unsupported or unset target architecture @@ -433,6 +436,7 @@ typedef unsigned char regNumberSmall; #define FIRST_ARG_STACK_OFFS (2*REGSIZE_BYTES) // Caller's saved EBP and return address #define MAX_REG_ARG 2 + #define MAX_FLOAT_REG_ARG 0 #define REG_ARG_FIRST REG_ECX #define REG_ARG_LAST REG_EDX @@ -441,10 +445,8 @@ typedef unsigned char regNumberSmall; #define REG_ARG_0 REG_ECX #define REG_ARG_1 REG_EDX - constexpr regNumber intArgRegs [] = {REG_ECX, REG_EDX}; - constexpr regMaskTP intArgMasks[] = {RBM_ECX, RBM_EDX}; - constexpr regNumber fltArgRegs [] = {REG_XMM0, REG_XMM1, REG_XMM2, REG_XMM3}; - constexpr regMaskTP fltArgMasks[] = {RBM_XMM0, RBM_XMM1, RBM_XMM2, RBM_XMM3}; + extern const regNumber intArgRegs [MAX_REG_ARG]; + extern const regMaskTP intArgMasks[MAX_REG_ARG]; #define RBM_ARG_0 RBM_ECX #define RBM_ARG_1 RBM_EDX @@ -779,10 +781,10 @@ typedef unsigned char regNumberSmall; #define REG_ARG_4 REG_R8 #define REG_ARG_5 REG_R9 - constexpr regNumber intArgRegs [] = { REG_EDI, REG_ESI, REG_EDX, REG_ECX, REG_R8, REG_R9 }; - constexpr regMaskTP intArgMasks[] = { RBM_EDI, RBM_ESI, RBM_EDX, RBM_ECX, RBM_R8, RBM_R9 }; - constexpr regNumber fltArgRegs [] = { REG_XMM0, REG_XMM1, REG_XMM2, REG_XMM3, REG_XMM4, REG_XMM5, REG_XMM6, REG_XMM7 }; - constexpr regMaskTP fltArgMasks[] = { RBM_XMM0, RBM_XMM1, RBM_XMM2, RBM_XMM3, RBM_XMM4, RBM_XMM5, RBM_XMM6, RBM_XMM7 }; + extern const regNumber intArgRegs [MAX_REG_ARG]; + extern const regMaskTP intArgMasks[MAX_REG_ARG]; + extern const regNumber fltArgRegs [MAX_FLOAT_REG_ARG]; + extern const regMaskTP fltArgMasks[MAX_FLOAT_REG_ARG]; #define RBM_ARG_0 RBM_RDI #define RBM_ARG_1 RBM_RSI @@ -802,10 +804,10 @@ typedef unsigned char regNumberSmall; #define REG_ARG_2 REG_R8 #define REG_ARG_3 REG_R9 - constexpr regNumber intArgRegs [] = { REG_ECX, REG_EDX, REG_R8, REG_R9 }; - constexpr regMaskTP intArgMasks[] = { RBM_ECX, RBM_EDX, RBM_R8, RBM_R9 }; - constexpr regNumber fltArgRegs [] = { REG_XMM0, REG_XMM1, REG_XMM2, REG_XMM3 }; - constexpr regMaskTP fltArgMasks[] = { RBM_XMM0, RBM_XMM1, RBM_XMM2, RBM_XMM3 }; + extern const regNumber intArgRegs [MAX_REG_ARG]; + extern const regMaskTP intArgMasks[MAX_REG_ARG]; + extern const regNumber fltArgRegs [MAX_FLOAT_REG_ARG]; + extern const regMaskTP fltArgMasks[MAX_FLOAT_REG_ARG]; #define RBM_ARG_0 RBM_ECX #define RBM_ARG_1 RBM_EDX @@ -1103,7 +1105,9 @@ typedef unsigned char regNumberSmall; // The registers trashed by profiler enter/leave/tailcall hook // See vm\arm\asmhelpers.asm for more details. #define RBM_PROFILER_ENTER_TRASH RBM_NONE - #define RBM_PROFILER_LEAVE_TRASH RBM_NONE + // While REG_PROFILER_RET_SCRATCH is not trashed by the method, the register allocator must + // consider it killed by the return. + #define RBM_PROFILER_LEAVE_TRASH RBM_PROFILER_RET_SCRATCH #define RBM_PROFILER_TAILCALL_TRASH RBM_NONE // Which register are int and long values returned in ? @@ -1150,8 +1154,8 @@ typedef unsigned char regNumberSmall; #define REG_ARG_2 REG_R2 #define REG_ARG_3 REG_R3 - constexpr regNumber intArgRegs [] = {REG_R0, REG_R1, REG_R2, REG_R3}; - constexpr regMaskTP intArgMasks[] = {RBM_R0, RBM_R1, RBM_R2, RBM_R3}; + extern const regNumber intArgRegs [MAX_REG_ARG]; + extern const regMaskTP intArgMasks[MAX_REG_ARG]; #define RBM_ARG_0 RBM_R0 #define RBM_ARG_1 RBM_R1 @@ -1162,8 +1166,8 @@ typedef unsigned char regNumberSmall; #define RBM_FLTARG_REGS (RBM_F0|RBM_F1|RBM_F2|RBM_F3|RBM_F4|RBM_F5|RBM_F6|RBM_F7|RBM_F8|RBM_F9|RBM_F10|RBM_F11|RBM_F12|RBM_F13|RBM_F14|RBM_F15) #define RBM_DBL_REGS RBM_ALLDOUBLE - constexpr regNumber fltArgRegs [] = {REG_F0, REG_F1, REG_F2, REG_F3, REG_F4, REG_F5, REG_F6, REG_F7, REG_F8, REG_F9, REG_F10, REG_F11, REG_F12, REG_F13, REG_F14, REG_F15 }; - constexpr regMaskTP fltArgMasks[] = {RBM_F0, RBM_F1, RBM_F2, RBM_F3, RBM_F4, RBM_F5, RBM_F6, RBM_F7, RBM_F8, RBM_F9, RBM_F10, RBM_F11, RBM_F12, RBM_F13, RBM_F14, RBM_F15 }; + extern const regNumber fltArgRegs [MAX_FLOAT_REG_ARG]; + extern const regMaskTP fltArgMasks[MAX_FLOAT_REG_ARG]; #define LBL_DIST_SMALL_MAX_NEG (0) #define LBL_DIST_SMALL_MAX_POS (+1020) @@ -1484,8 +1488,8 @@ typedef unsigned char regNumberSmall; #define REG_ARG_6 REG_R6 #define REG_ARG_7 REG_R7 - constexpr regNumber intArgRegs [] = {REG_R0, REG_R1, REG_R2, REG_R3, REG_R4, REG_R5, REG_R6, REG_R7}; - constexpr regMaskTP intArgMasks[] = {RBM_R0, RBM_R1, RBM_R2, RBM_R3, RBM_R4, RBM_R5, RBM_R6, RBM_R7}; + extern const regNumber intArgRegs [MAX_REG_ARG]; + extern const regMaskTP intArgMasks[MAX_REG_ARG]; #define RBM_ARG_0 RBM_R0 #define RBM_ARG_1 RBM_R1 @@ -1517,8 +1521,8 @@ typedef unsigned char regNumberSmall; #define RBM_ARG_REGS (RBM_ARG_0|RBM_ARG_1|RBM_ARG_2|RBM_ARG_3|RBM_ARG_4|RBM_ARG_5|RBM_ARG_6|RBM_ARG_7) #define RBM_FLTARG_REGS (RBM_FLTARG_0|RBM_FLTARG_1|RBM_FLTARG_2|RBM_FLTARG_3|RBM_FLTARG_4|RBM_FLTARG_5|RBM_FLTARG_6|RBM_FLTARG_7) - constexpr regNumber fltArgRegs [] = {REG_V0, REG_V1, REG_V2, REG_V3, REG_V4, REG_V5, REG_V6, REG_V7 }; - constexpr regMaskTP fltArgMasks[] = {RBM_V0, RBM_V1, RBM_V2, RBM_V3, RBM_V4, RBM_V5, RBM_V6, RBM_V7 }; + extern const regNumber fltArgRegs [MAX_FLOAT_REG_ARG]; + extern const regMaskTP fltArgMasks[MAX_FLOAT_REG_ARG]; #define LBL_DIST_SMALL_MAX_NEG (-1048576) #define LBL_DIST_SMALL_MAX_POS (+1048575) @@ -1594,6 +1598,7 @@ C_ASSERT((FEATURE_TAILCALL_OPT == 0) || (FEATURE_FASTTAILCALL == 1)); #if CPU_HAS_BYTE_REGS #define RBM_BYTE_REGS (RBM_EAX|RBM_ECX|RBM_EDX|RBM_EBX) + #define BYTE_REG_COUNT 4 #define RBM_NON_BYTE_REGS (RBM_ESI|RBM_EDI) #else #define RBM_BYTE_REGS RBM_ALLINT @@ -1616,11 +1621,11 @@ class Target static const enum ArgOrder g_tgtArgOrder; }; -#if defined(DEBUG) || defined(LATE_DISASM) +#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_GC_TABLES const char* getRegName(unsigned reg, bool isFloat = false); // this is for gcencode.cpp and disasm.cpp that don't use // the regNumber type const char* getRegName(regNumber reg, bool isFloat = false); -#endif // defined(DEBUG) || defined(LATE_DISASM) +#endif // defined(DEBUG) || defined(LATE_DISASM) || DUMP_GC_TABLES #ifdef DEBUG const char* getRegNameFloat(regNumber reg, var_types type); @@ -1997,14 +2002,30 @@ C_ASSERT((RBM_INT_CALLEE_SAVED & RBM_FPBASE) == RBM_NONE); #ifdef TARGET_64BIT typedef unsigned __int64 target_size_t; typedef __int64 target_ssize_t; -#else // !TARGET_64BIT -typedef unsigned int target_size_t; -typedef int target_ssize_t; +#define TARGET_SIGN_BIT (1ULL << 63) + +#else // !TARGET_64BIT +typedef unsigned int target_size_t; +typedef int target_ssize_t; +#define TARGET_SIGN_BIT (1ULL << 31) + #endif // !TARGET_64BIT C_ASSERT(sizeof(target_size_t) == TARGET_POINTER_SIZE); C_ASSERT(sizeof(target_ssize_t) == TARGET_POINTER_SIZE); +#if defined(TARGET_X86) +// instrDescCns holds constant values for the emitter. The X86 compiler is unique in that it +// may represent relocated pointer values with these constants. On the 64bit to 32 bit +// cross-targetting jit, the the constant value must be represented as a 64bit value in order +// to represent these pointers. +typedef ssize_t cnsval_ssize_t; +typedef size_t cnsval_size_t; +#else +typedef target_ssize_t cnsval_ssize_t; +typedef target_size_t cnsval_size_t; +#endif + /*****************************************************************************/ #endif // TARGET_H_ /*****************************************************************************/ diff --git a/src/coreclr/src/jit/targetamd64.cpp b/src/coreclr/src/jit/targetamd64.cpp index 143e6e464180..372c4dffc27b 100644 --- a/src/coreclr/src/jit/targetamd64.cpp +++ b/src/coreclr/src/jit/targetamd64.cpp @@ -15,4 +15,18 @@ const char* Target::g_tgtCPUName = "x64"; const Target::ArgOrder Target::g_tgtArgOrder = ARG_ORDER_R2L; +// clang-format off +#ifdef UNIX_AMD64_ABI +const regNumber intArgRegs [] = { REG_EDI, REG_ESI, REG_EDX, REG_ECX, REG_R8, REG_R9 }; +const regMaskTP intArgMasks[] = { RBM_EDI, RBM_ESI, RBM_EDX, RBM_ECX, RBM_R8, RBM_R9 }; +const regNumber fltArgRegs [] = { REG_XMM0, REG_XMM1, REG_XMM2, REG_XMM3, REG_XMM4, REG_XMM5, REG_XMM6, REG_XMM7 }; +const regMaskTP fltArgMasks[] = { RBM_XMM0, RBM_XMM1, RBM_XMM2, RBM_XMM3, RBM_XMM4, RBM_XMM5, RBM_XMM6, RBM_XMM7 }; +#else // !UNIX_AMD64_ABI +const regNumber intArgRegs [] = { REG_ECX, REG_EDX, REG_R8, REG_R9 }; +const regMaskTP intArgMasks[] = { RBM_ECX, RBM_EDX, RBM_R8, RBM_R9 }; +const regNumber fltArgRegs [] = { REG_XMM0, REG_XMM1, REG_XMM2, REG_XMM3 }; +const regMaskTP fltArgMasks[] = { RBM_XMM0, RBM_XMM1, RBM_XMM2, RBM_XMM3 }; +#endif // !UNIX_AMD64_ABI +// clang-format on + #endif // TARGET_AMD64 diff --git a/src/coreclr/src/jit/targetarm.cpp b/src/coreclr/src/jit/targetarm.cpp index ca974a76af39..da125cbb436a 100644 --- a/src/coreclr/src/jit/targetarm.cpp +++ b/src/coreclr/src/jit/targetarm.cpp @@ -15,4 +15,12 @@ const char* Target::g_tgtCPUName = "arm"; const Target::ArgOrder Target::g_tgtArgOrder = ARG_ORDER_R2L; +// clang-format off +const regNumber intArgRegs [] = {REG_R0, REG_R1, REG_R2, REG_R3}; +const regMaskTP intArgMasks[] = {RBM_R0, RBM_R1, RBM_R2, RBM_R3}; + +const regNumber fltArgRegs [] = {REG_F0, REG_F1, REG_F2, REG_F3, REG_F4, REG_F5, REG_F6, REG_F7, REG_F8, REG_F9, REG_F10, REG_F11, REG_F12, REG_F13, REG_F14, REG_F15 }; +const regMaskTP fltArgMasks[] = {RBM_F0, RBM_F1, RBM_F2, RBM_F3, RBM_F4, RBM_F5, RBM_F6, RBM_F7, RBM_F8, RBM_F9, RBM_F10, RBM_F11, RBM_F12, RBM_F13, RBM_F14, RBM_F15 }; +// clang-format on + #endif // TARGET_ARM diff --git a/src/coreclr/src/jit/targetarm64.cpp b/src/coreclr/src/jit/targetarm64.cpp index 7b035f145b01..8f5481a83e02 100644 --- a/src/coreclr/src/jit/targetarm64.cpp +++ b/src/coreclr/src/jit/targetarm64.cpp @@ -15,4 +15,12 @@ const char* Target::g_tgtCPUName = "arm64"; const Target::ArgOrder Target::g_tgtArgOrder = ARG_ORDER_R2L; +// clang-format off +const regNumber intArgRegs [] = {REG_R0, REG_R1, REG_R2, REG_R3, REG_R4, REG_R5, REG_R6, REG_R7}; +const regMaskTP intArgMasks[] = {RBM_R0, RBM_R1, RBM_R2, RBM_R3, RBM_R4, RBM_R5, RBM_R6, RBM_R7}; + +const regNumber fltArgRegs [] = {REG_V0, REG_V1, REG_V2, REG_V3, REG_V4, REG_V5, REG_V6, REG_V7 }; +const regMaskTP fltArgMasks[] = {RBM_V0, RBM_V1, RBM_V2, RBM_V3, RBM_V4, RBM_V5, RBM_V6, RBM_V7 }; +// clang-format on + #endif // TARGET_ARM64 diff --git a/src/coreclr/src/jit/targetx86.cpp b/src/coreclr/src/jit/targetx86.cpp index 391a934e5b9e..fab7286782a2 100644 --- a/src/coreclr/src/jit/targetx86.cpp +++ b/src/coreclr/src/jit/targetx86.cpp @@ -15,4 +15,9 @@ const char* Target::g_tgtCPUName = "x86"; const Target::ArgOrder Target::g_tgtArgOrder = ARG_ORDER_L2R; +// clang-format off +const regNumber intArgRegs [] = {REG_ECX, REG_EDX}; +const regMaskTP intArgMasks[] = {RBM_ECX, RBM_EDX}; +// clang-format on + #endif // TARGET_X86 diff --git a/src/coreclr/src/jit/unwind.h b/src/coreclr/src/jit/unwind.h index 5541450e0ef7..f510eb6f1d82 100644 --- a/src/coreclr/src/jit/unwind.h +++ b/src/coreclr/src/jit/unwind.h @@ -150,7 +150,7 @@ class UnwindCodesBase class UnwindPrologCodes : public UnwindBase, public UnwindCodesBase { - // UPC_LOCAL_COUNT is the amount of memory local to this class. For ARM mscorlib.dll, the maximum size is 34. + // UPC_LOCAL_COUNT is the amount of memory local to this class. For ARM CoreLib, the maximum size is 34. // Here is a histogram of other interesting sizes: // <=16 79% // <=24 96% @@ -314,7 +314,7 @@ class UnwindPrologCodes : public UnwindBase, public UnwindCodesBase class UnwindEpilogCodes : public UnwindBase, public UnwindCodesBase { - // UEC_LOCAL_COUNT is the amount of memory local to this class. For ARM mscorlib.dll, the maximum size is 6, + // UEC_LOCAL_COUNT is the amount of memory local to this class. For ARM CoreLib, the maximum size is 6, // while 89% of epilogs fit in 4. So, set it to 4 to maintain array alignment and hit most cases. static const int UEC_LOCAL_COUNT = 4; diff --git a/src/coreclr/src/jit/unwindarm64.cpp b/src/coreclr/src/jit/unwindarm64.cpp index d7356f4a1fd8..665e0ce9f525 100644 --- a/src/coreclr/src/jit/unwindarm64.cpp +++ b/src/coreclr/src/jit/unwindarm64.cpp @@ -22,11 +22,208 @@ short Compiler::mapRegNumToDwarfReg(regNumber reg) { short dwarfReg = DWARF_REG_ILLEGAL; - NYI("CFI codes"); + switch (reg) + { + case REG_R0: + dwarfReg = 0; + break; + case REG_R1: + dwarfReg = 1; + break; + case REG_R2: + dwarfReg = 2; + break; + case REG_R3: + dwarfReg = 3; + break; + case REG_R4: + dwarfReg = 4; + break; + case REG_R5: + dwarfReg = 5; + break; + case REG_R6: + dwarfReg = 6; + break; + case REG_R7: + dwarfReg = 7; + break; + case REG_R8: + dwarfReg = 8; + break; + case REG_R9: + dwarfReg = 9; + break; + case REG_R10: + dwarfReg = 10; + break; + case REG_R11: + dwarfReg = 11; + break; + case REG_R12: + dwarfReg = 12; + break; + case REG_R13: + dwarfReg = 13; + break; + case REG_R14: + dwarfReg = 14; + break; + case REG_R15: + dwarfReg = 15; + break; + case REG_R16: + dwarfReg = 16; + break; + case REG_R17: + dwarfReg = 17; + break; + case REG_R18: + dwarfReg = 18; + break; + case REG_R19: + dwarfReg = 19; + break; + case REG_R20: + dwarfReg = 20; + break; + case REG_R21: + dwarfReg = 21; + break; + case REG_R22: + dwarfReg = 22; + break; + case REG_R23: + dwarfReg = 23; + break; + case REG_R24: + dwarfReg = 24; + break; + case REG_R25: + dwarfReg = 25; + break; + case REG_R26: + dwarfReg = 26; + break; + case REG_R27: + dwarfReg = 27; + break; + case REG_R28: + dwarfReg = 28; + break; + case REG_R29: + dwarfReg = 29; + break; + case REG_R30: + dwarfReg = 30; + break; + case REG_SP: + dwarfReg = 31; + break; + case REG_V0: + dwarfReg = 64; + break; + case REG_V1: + dwarfReg = 65; + break; + case REG_V2: + dwarfReg = 66; + break; + case REG_V3: + dwarfReg = 67; + break; + case REG_V4: + dwarfReg = 68; + break; + case REG_V5: + dwarfReg = 69; + break; + case REG_V6: + dwarfReg = 70; + break; + case REG_V7: + dwarfReg = 71; + break; + case REG_V8: + dwarfReg = 72; + break; + case REG_V9: + dwarfReg = 73; + break; + case REG_V10: + dwarfReg = 74; + break; + case REG_V11: + dwarfReg = 75; + break; + case REG_V12: + dwarfReg = 76; + break; + case REG_V13: + dwarfReg = 77; + break; + case REG_V14: + dwarfReg = 78; + break; + case REG_V15: + dwarfReg = 79; + break; + case REG_V16: + dwarfReg = 80; + break; + case REG_V17: + dwarfReg = 81; + break; + case REG_V18: + dwarfReg = 82; + break; + case REG_V19: + dwarfReg = 83; + break; + case REG_V20: + dwarfReg = 84; + break; + case REG_V21: + dwarfReg = 85; + break; + case REG_V22: + dwarfReg = 86; + break; + case REG_V23: + dwarfReg = 87; + break; + case REG_V24: + dwarfReg = 88; + break; + case REG_V25: + dwarfReg = 89; + break; + case REG_V26: + dwarfReg = 90; + break; + case REG_V27: + dwarfReg = 91; + break; + case REG_V28: + dwarfReg = 92; + break; + case REG_V29: + dwarfReg = 93; + break; + case REG_V30: + dwarfReg = 94; + break; + case REG_V31: + dwarfReg = 95; + break; + + default: + NYI("CFI codes"); + } return dwarfReg; } -#endif // TARGET_ARM +#endif // TARGET_UNIX void Compiler::unwindPush(regNumber reg) { @@ -35,6 +232,18 @@ void Compiler::unwindPush(regNumber reg) void Compiler::unwindAllocStack(unsigned size) { +#if defined(TARGET_UNIX) + if (generateCFIUnwindCodes()) + { + if (compGeneratingProlog) + { + unwindAllocStackCFI(size); + } + + return; + } +#endif // TARGET_UNIX + UnwindInfo* pu = &funCurrentFunc()->uwi; assert(size % 16 == 0); @@ -67,6 +276,18 @@ void Compiler::unwindAllocStack(unsigned size) void Compiler::unwindSetFrameReg(regNumber reg, unsigned offset) { +#if defined(TARGET_UNIX) + if (generateCFIUnwindCodes()) + { + if (compGeneratingProlog) + { + unwindSetFrameRegCFI(reg, offset); + } + + return; + } +#endif // TARGET_UNIX + UnwindInfo* pu = &funCurrentFunc()->uwi; if (offset == 0) @@ -121,14 +342,30 @@ void Compiler::unwindNop() // which we should do instead). void Compiler::unwindSaveRegPair(regNumber reg1, regNumber reg2, int offset) { - UnwindInfo* pu = &funCurrentFunc()->uwi; - // stp reg1, reg2, [sp, #offset] // offset for store pair in prolog must be positive and a multiple of 8. assert(0 <= offset && offset <= 504); assert((offset % 8) == 0); +#if defined(TARGET_UNIX) + if (generateCFIUnwindCodes()) + { + if (compGeneratingProlog) + { + FuncInfoDsc* func = funCurrentFunc(); + UNATIVE_OFFSET cbProlog = unwindGetCurrentOffset(func); + + createCfiCode(func, cbProlog, CFI_REL_OFFSET, mapRegNumToDwarfReg(reg1), offset); + createCfiCode(func, cbProlog, CFI_REL_OFFSET, mapRegNumToDwarfReg(reg2), offset + 8); + } + + return; + } +#endif // TARGET_UNIX + + UnwindInfo* pu = &funCurrentFunc()->uwi; + int z = offset / 8; assert(0 <= z && z <= 0x3F); @@ -187,14 +424,31 @@ void Compiler::unwindSaveRegPair(regNumber reg1, regNumber reg2, int offset) // reg1. void Compiler::unwindSaveRegPairPreindexed(regNumber reg1, regNumber reg2, int offset) { - UnwindInfo* pu = &funCurrentFunc()->uwi; - // stp reg1, reg2, [sp, #offset]! // pre-indexed offset in prolog must be negative and a multiple of 8. assert(offset < 0); assert((offset % 8) == 0); +#if defined(TARGET_UNIX) + if (generateCFIUnwindCodes()) + { + if (compGeneratingProlog) + { + FuncInfoDsc* func = funCurrentFunc(); + UNATIVE_OFFSET cbProlog = unwindGetCurrentOffset(func); + + createCfiCode(func, cbProlog, CFI_ADJUST_CFA_OFFSET, DWARF_REG_ILLEGAL, -offset); + createCfiCode(func, cbProlog, CFI_REL_OFFSET, mapRegNumToDwarfReg(reg1), 0); + createCfiCode(func, cbProlog, CFI_REL_OFFSET, mapRegNumToDwarfReg(reg2), 8); + } + + return; + } +#endif // TARGET_UNIX + + UnwindInfo* pu = &funCurrentFunc()->uwi; + if (reg1 == REG_FP) { // save_fplr_x: 10zzzzzz: save pair at [sp-(#Z+1)*8]!, pre-indexed offset >= -512 @@ -259,17 +513,32 @@ void Compiler::unwindSaveRegPairPreindexed(regNumber reg1, regNumber reg2, int o void Compiler::unwindSaveReg(regNumber reg, int offset) { - UnwindInfo* pu = &funCurrentFunc()->uwi; - // str reg, [sp, #offset] // offset for store in prolog must be positive and a multiple of 8. assert(0 <= offset && offset <= 504); assert((offset % 8) == 0); +#if defined(TARGET_UNIX) + if (generateCFIUnwindCodes()) + { + if (compGeneratingProlog) + { + FuncInfoDsc* func = funCurrentFunc(); + UNATIVE_OFFSET cbProlog = unwindGetCurrentOffset(func); + + createCfiCode(func, cbProlog, CFI_REL_OFFSET, mapRegNumToDwarfReg(reg), offset); + } + + return; + } +#endif // TARGET_UNIX + int z = offset / 8; assert(0 <= z && z <= 0x3F); + UnwindInfo* pu = &funCurrentFunc()->uwi; + if (emitter::isGeneralRegister(reg)) { // save_reg: 110100xx | xxzzzzzz: save reg r(19 + #X) at [sp + #Z * 8], offset <= 504 @@ -298,14 +567,30 @@ void Compiler::unwindSaveReg(regNumber reg, int offset) void Compiler::unwindSaveRegPreindexed(regNumber reg, int offset) { - UnwindInfo* pu = &funCurrentFunc()->uwi; - // str reg, [sp, #offset]! // pre-indexed offset in prolog must be negative and a multiple of 8. assert(-256 <= offset && offset < 0); assert((offset % 8) == 0); +#if defined(TARGET_UNIX) + if (generateCFIUnwindCodes()) + { + if (compGeneratingProlog) + { + FuncInfoDsc* func = funCurrentFunc(); + UNATIVE_OFFSET cbProlog = unwindGetCurrentOffset(func); + + createCfiCode(func, cbProlog, CFI_ADJUST_CFA_OFFSET, DWARF_REG_ILLEGAL, -offset); + createCfiCode(func, cbProlog, CFI_REL_OFFSET, mapRegNumToDwarfReg(reg), 0); + } + + return; + } +#endif // _TARGET_UNIX_ + + UnwindInfo* pu = &funCurrentFunc()->uwi; + int z = (-offset) / 8 - 1; assert(0 <= z && z <= 0x1F); @@ -337,6 +622,11 @@ void Compiler::unwindSaveRegPreindexed(regNumber reg, int offset) void Compiler::unwindSaveNext() { +#if defined(TARGET_UNIX) + // do not use unwindSaveNext when generating CFI codes as there is no code for this + assert(!generateCFIUnwindCodes()); +#endif // TARGET_UNIX + UnwindInfo* pu = &funCurrentFunc()->uwi; // We're saving the next register pair. The caller is responsible for ensuring this is correct! diff --git a/src/coreclr/src/jit/utils.cpp b/src/coreclr/src/jit/utils.cpp index 4477ceb16295..de1fd4a880b2 100644 --- a/src/coreclr/src/jit/utils.cpp +++ b/src/coreclr/src/jit/utils.cpp @@ -128,7 +128,7 @@ const char* varTypeName(var_types vt) return varTypeNames[vt]; } -#if defined(DEBUG) || defined(LATE_DISASM) +#if defined(DEBUG) || defined(LATE_DISASM) || DUMP_GC_TABLES /***************************************************************************** * * Return the name of the given register. @@ -164,7 +164,7 @@ const char* getRegName(unsigned reg, { return getRegName((regNumber)reg, isFloat); } -#endif // defined(DEBUG) || defined(LATE_DISASM) +#endif // defined(DEBUG) || defined(LATE_DISASM) || DUMP_GC_TABLES #if defined(DEBUG) @@ -767,11 +767,11 @@ void ConfigMethodRange::InitRanges(const WCHAR* rangeStr, unsigned capacity) } else if ((L'A' <= *p) && (*p <= L'F')) { - n = (*p++) - L'A'; + n = (*p++) - L'A' + 10; } else if ((L'a' <= *p) && (*p <= L'f')) { - n = (*p++) - L'a'; + n = (*p++) - L'a' + 10; } int j = 16 * i + n; diff --git a/src/coreclr/src/jit/valuenum.cpp b/src/coreclr/src/jit/valuenum.cpp index 1cc0cab621ca..eb357ddf991b 100644 --- a/src/coreclr/src/jit/valuenum.cpp +++ b/src/coreclr/src/jit/valuenum.cpp @@ -3408,7 +3408,7 @@ ValueNum ValueNumStore::EvalUsingMathIdentity(var_types typ, VNFunc func, ValueN break; } // (x == x) == true (integer only) - __fallthrough; + FALLTHROUGH; case GT_GE: case GT_LE: // (x <= x) == true (integer only) @@ -3456,7 +3456,7 @@ ValueNum ValueNumStore::EvalUsingMathIdentity(var_types typ, VNFunc func, ValueN // (x < 0) == false // (x < x) == false std::swap(arg0VN, arg1VN); - __fallthrough; + FALLTHROUGH; case VNF_GT_UN: // (0 > x) == false // (x > x) == false @@ -3474,7 +3474,7 @@ ValueNum ValueNumStore::EvalUsingMathIdentity(var_types typ, VNFunc func, ValueN // (x >= 0) == true // (x >= x) == true std::swap(arg0VN, arg1VN); - __fallthrough; + FALLTHROUGH; case VNF_LE_UN: // (0 <= x) == true // (x <= x) == true @@ -4137,14 +4137,23 @@ ValueNum Compiler::fgValueNumberArrIndexVal(GenTree* tree, ValueNum Compiler::fgValueNumberByrefExposedLoad(var_types type, ValueNum pointerVN) { - ValueNum memoryVN = fgCurMemoryVN[ByrefExposed]; - // The memoization for VNFunc applications does not factor in the result type, so - // VNF_ByrefExposedLoad takes the loaded type as an explicit parameter. - ValueNum typeVN = vnStore->VNForIntCon(type); - ValueNum loadVN = - vnStore->VNForFunc(type, VNF_ByrefExposedLoad, typeVN, vnStore->VNNormalValue(pointerVN), memoryVN); - - return loadVN; + if (type == TYP_STRUCT) + { + // We can't assign a value number for a read of a struct as we can't determine + // how many bytes will be read by this load, so return a new unique value number + // + return vnStore->VNForExpr(compCurBB, TYP_STRUCT); + } + else + { + ValueNum memoryVN = fgCurMemoryVN[ByrefExposed]; + // The memoization for VNFunc applications does not factor in the result type, so + // VNF_ByrefExposedLoad takes the loaded type as an explicit parameter. + ValueNum typeVN = vnStore->VNForIntCon(type); + ValueNum loadVN = + vnStore->VNForFunc(type, VNF_ByrefExposedLoad, typeVN, vnStore->VNNormalValue(pointerVN), memoryVN); + return loadVN; + } } var_types ValueNumStore::TypeOfVN(ValueNum vn) @@ -4548,7 +4557,7 @@ void ValueNumStore::SetVNIsCheckedBound(ValueNum vn) m_checkedBoundVNs.AddOrUpdate(vn, true); } -ValueNum ValueNumStore::EvalMathFuncUnary(var_types typ, CorInfoIntrinsics gtMathFN, ValueNum arg0VN) +ValueNum ValueNumStore::EvalMathFuncUnary(var_types typ, NamedIntrinsic gtMathFN, ValueNum arg0VN) { assert(arg0VN == VNNormalValue(arg0VN)); @@ -4568,25 +4577,25 @@ ValueNum ValueNumStore::EvalMathFuncUnary(var_types typ, CorInfoIntrinsics gtMat double res = 0.0; switch (gtMathFN) { - case CORINFO_INTRINSIC_Sin: + case NI_System_Math_Sin: res = sin(arg0Val); break; - case CORINFO_INTRINSIC_Cos: + case NI_System_Math_Cos: res = cos(arg0Val); break; - case CORINFO_INTRINSIC_Sqrt: + case NI_System_Math_Sqrt: res = sqrt(arg0Val); break; - case CORINFO_INTRINSIC_Abs: + case NI_System_Math_Abs: res = fabs(arg0Val); break; - case CORINFO_INTRINSIC_Ceiling: + case NI_System_Math_Ceiling: res = ceil(arg0Val); break; - case CORINFO_INTRINSIC_Floor: + case NI_System_Math_Floor: res = floor(arg0Val); break; - case CORINFO_INTRINSIC_Round: + case NI_System_Math_Round: res = FloatingPointUtils::round(arg0Val); break; default: @@ -4604,25 +4613,25 @@ ValueNum ValueNumStore::EvalMathFuncUnary(var_types typ, CorInfoIntrinsics gtMat float res = 0.0f; switch (gtMathFN) { - case CORINFO_INTRINSIC_Sin: + case NI_System_Math_Sin: res = sinf(arg0Val); break; - case CORINFO_INTRINSIC_Cos: + case NI_System_Math_Cos: res = cosf(arg0Val); break; - case CORINFO_INTRINSIC_Sqrt: + case NI_System_Math_Sqrt: res = sqrtf(arg0Val); break; - case CORINFO_INTRINSIC_Abs: + case NI_System_Math_Abs: res = fabsf(arg0Val); break; - case CORINFO_INTRINSIC_Ceiling: + case NI_System_Math_Ceiling: res = ceilf(arg0Val); break; - case CORINFO_INTRINSIC_Floor: + case NI_System_Math_Floor: res = floorf(arg0Val); break; - case CORINFO_INTRINSIC_Round: + case NI_System_Math_Round: res = FloatingPointUtils::round(arg0Val); break; default: @@ -4633,11 +4642,11 @@ ValueNum ValueNumStore::EvalMathFuncUnary(var_types typ, CorInfoIntrinsics gtMat } else { - // CORINFO_INTRINSIC_Round is currently the only intrinsic that takes floating-point arguments - // and that returns a non floating-point result. + // NI_System_Math{F}_Round are currently the only intrinsic that take floating-point arguments + // and return a non floating-point result. assert(typ == TYP_INT); - assert(gtMathFN == CORINFO_INTRINSIC_Round); + assert(gtMathFN == NI_System_Math_Round); int res = 0; @@ -4664,27 +4673,27 @@ ValueNum ValueNumStore::EvalMathFuncUnary(var_types typ, CorInfoIntrinsics gtMat } else { - assert(typ == TYP_DOUBLE || typ == TYP_FLOAT || (typ == TYP_INT && gtMathFN == CORINFO_INTRINSIC_Round)); + assert(typ == TYP_DOUBLE || typ == TYP_FLOAT || typ == TYP_INT && gtMathFN == NI_System_Math_Round); VNFunc vnf = VNF_Boundary; switch (gtMathFN) { - case CORINFO_INTRINSIC_Sin: + case NI_System_Math_Sin: vnf = VNF_Sin; break; - case CORINFO_INTRINSIC_Cos: + case NI_System_Math_Cos: vnf = VNF_Cos; break; - case CORINFO_INTRINSIC_Cbrt: + case NI_System_Math_Cbrt: vnf = VNF_Cbrt; break; - case CORINFO_INTRINSIC_Sqrt: + case NI_System_Math_Sqrt: vnf = VNF_Sqrt; break; - case CORINFO_INTRINSIC_Abs: + case NI_System_Math_Abs: vnf = VNF_Abs; break; - case CORINFO_INTRINSIC_Round: + case NI_System_Math_Round: if (typ == TYP_DOUBLE) { vnf = VNF_RoundDouble; @@ -4702,46 +4711,46 @@ ValueNum ValueNumStore::EvalMathFuncUnary(var_types typ, CorInfoIntrinsics gtMat noway_assert(!"Invalid INTRINSIC_Round"); } break; - case CORINFO_INTRINSIC_Cosh: + case NI_System_Math_Cosh: vnf = VNF_Cosh; break; - case CORINFO_INTRINSIC_Sinh: + case NI_System_Math_Sinh: vnf = VNF_Sinh; break; - case CORINFO_INTRINSIC_Tan: + case NI_System_Math_Tan: vnf = VNF_Tan; break; - case CORINFO_INTRINSIC_Tanh: + case NI_System_Math_Tanh: vnf = VNF_Tanh; break; - case CORINFO_INTRINSIC_Asin: + case NI_System_Math_Asin: vnf = VNF_Asin; break; - case CORINFO_INTRINSIC_Asinh: + case NI_System_Math_Asinh: vnf = VNF_Asinh; break; - case CORINFO_INTRINSIC_Acos: + case NI_System_Math_Acos: vnf = VNF_Acos; break; - case CORINFO_INTRINSIC_Acosh: + case NI_System_Math_Acosh: vnf = VNF_Acosh; break; - case CORINFO_INTRINSIC_Atan: + case NI_System_Math_Atan: vnf = VNF_Atan; break; - case CORINFO_INTRINSIC_Atanh: + case NI_System_Math_Atanh: vnf = VNF_Atanh; break; - case CORINFO_INTRINSIC_Log10: + case NI_System_Math_Log10: vnf = VNF_Log10; break; - case CORINFO_INTRINSIC_Exp: + case NI_System_Math_Exp: vnf = VNF_Exp; break; - case CORINFO_INTRINSIC_Ceiling: + case NI_System_Math_Ceiling: vnf = VNF_Ceiling; break; - case CORINFO_INTRINSIC_Floor: + case NI_System_Math_Floor: vnf = VNF_Floor; break; default: @@ -4752,7 +4761,7 @@ ValueNum ValueNumStore::EvalMathFuncUnary(var_types typ, CorInfoIntrinsics gtMat } } -ValueNum ValueNumStore::EvalMathFuncBinary(var_types typ, CorInfoIntrinsics gtMathFN, ValueNum arg0VN, ValueNum arg1VN) +ValueNum ValueNumStore::EvalMathFuncBinary(var_types typ, NamedIntrinsic gtMathFN, ValueNum arg0VN, ValueNum arg1VN) { assert(varTypeIsFloating(typ)); assert(arg0VN == VNNormalValue(arg0VN)); @@ -4765,11 +4774,11 @@ ValueNum ValueNumStore::EvalMathFuncBinary(var_types typ, CorInfoIntrinsics gtMa switch (gtMathFN) { - case CORINFO_INTRINSIC_Atan2: + case NI_System_Math_Atan2: vnf = VNF_Atan2; break; - case CORINFO_INTRINSIC_Pow: + case NI_System_Math_Pow: vnf = VNF_Pow; break; @@ -6426,7 +6435,7 @@ void Compiler::fgValueNumberTreeConst(GenTree* tree) tree->gtVNPair.SetBoth(vnStore->VNForLongCon(tree->AsIntConCommon()->LngValue())); #else // 32BIT assert(tree->AsIntConCommon()->IconValue() == 0); - tree->gtVNPair.SetBoth(vnStore->VNForIntCon(tree->AsIntConCommon()->IconValue())); + tree->gtVNPair.SetBoth(vnStore->VNForIntCon(int(tree->AsIntConCommon()->IconValue()))); #endif break; #endif // FEATURE_SIMD @@ -6780,6 +6789,10 @@ void Compiler::fgValueNumberBlockAssignment(GenTree* tree) { fgMutateAddressExposedLocal(tree DEBUGARG("COPYBLK - address-exposed local")); } + else + { + JITDUMP("LHS V%02u not in ssa at [%06u], so no VN assigned\n", lhsLclNum, dspTreeID(lclVarTree)); + } } else { @@ -7365,7 +7378,7 @@ void Compiler::fgValueNumberTree(GenTree* tree) break; case GT_BLK: - __fallthrough; + FALLTHROUGH; case GT_IND: { @@ -8389,7 +8402,7 @@ void Compiler::fgValueNumberIntrinsic(GenTree* tree) vnStore->VNPUnpackExc(intrinsic->AsOp()->gtOp2->gtVNPair, &arg1VNP, &arg1VNPx); } - if (IsMathIntrinsic(intrinsic->gtIntrinsicId)) + if (IsMathIntrinsic(intrinsic->gtIntrinsicName)) { // GT_INTRINSIC is a currently a subtype of binary operators. But most of // the math intrinsics are actually unary operations. @@ -8397,13 +8410,13 @@ void Compiler::fgValueNumberIntrinsic(GenTree* tree) if (intrinsic->AsOp()->gtOp2 == nullptr) { intrinsic->gtVNPair = - vnStore->VNPWithExc(vnStore->EvalMathFuncUnary(tree->TypeGet(), intrinsic->gtIntrinsicId, arg0VNP), + vnStore->VNPWithExc(vnStore->EvalMathFuncUnary(tree->TypeGet(), intrinsic->gtIntrinsicName, arg0VNP), arg0VNPx); } else { ValueNumPair newVNP = - vnStore->EvalMathFuncBinary(tree->TypeGet(), intrinsic->gtIntrinsicId, arg0VNP, arg1VNP); + vnStore->EvalMathFuncBinary(tree->TypeGet(), intrinsic->gtIntrinsicName, arg0VNP, arg1VNP); ValueNumPair excSet = vnStore->VNPExcSetUnion(arg0VNPx, arg1VNPx); intrinsic->gtVNPair = vnStore->VNPWithExc(newVNP, excSet); } @@ -8615,7 +8628,7 @@ void Compiler::fgValueNumberHWIntrinsic(GenTree* tree) else if (tree->AsOp()->gtOp1->OperIs(GT_LIST) || (lookupNumArgs == -1)) { // We have a HWINTRINSIC node in the GT_LIST form with 3 or more args - // Or the numArgs was specified as -1 in the numArgs column in "hwinstrinsiclistxarch.h" + // Or the numArgs was specified as -1 in the numArgs column in "hwintrinsiclistxarch.h" // For now we will generate a unique value number for this case. // Generate unique VN @@ -9889,7 +9902,7 @@ void Compiler::fgValueNumberAddExceptionSet(GenTree* tree) // Don't add exception set on LHS of assignment break; } - __fallthrough; + FALLTHROUGH; case GT_BLK: case GT_OBJ: diff --git a/src/coreclr/src/jit/valuenum.h b/src/coreclr/src/jit/valuenum.h index 9f3cc2025be2..26b9fd55f2e4 100644 --- a/src/coreclr/src/jit/valuenum.h +++ b/src/coreclr/src/jit/valuenum.h @@ -742,7 +742,7 @@ class ValueNumStore { case TYP_REF: assert(0 <= offset && offset <= 1); // Null or exception. - __fallthrough; + FALLTHROUGH; case TYP_BYREF: @@ -752,7 +752,7 @@ class ValueNumStore #endif // _MSC_VER - __fallthrough; + FALLTHROUGH; case TYP_INT: case TYP_LONG: @@ -818,20 +818,17 @@ class ValueNumStore // "arg0VN". For binary ops, return the value number for the application of this function to "arg0VN" and // "arg1VN". - ValueNum EvalMathFuncUnary(var_types typ, CorInfoIntrinsics mthFunc, ValueNum arg0VN); + ValueNum EvalMathFuncUnary(var_types typ, NamedIntrinsic mthFunc, ValueNum arg0VN); - ValueNum EvalMathFuncBinary(var_types typ, CorInfoIntrinsics mthFunc, ValueNum arg0VN, ValueNum arg1VN); + ValueNum EvalMathFuncBinary(var_types typ, NamedIntrinsic mthFunc, ValueNum arg0VN, ValueNum arg1VN); - ValueNumPair EvalMathFuncUnary(var_types typ, CorInfoIntrinsics mthFunc, ValueNumPair arg0VNP) + ValueNumPair EvalMathFuncUnary(var_types typ, NamedIntrinsic mthFunc, ValueNumPair arg0VNP) { return ValueNumPair(EvalMathFuncUnary(typ, mthFunc, arg0VNP.GetLiberal()), EvalMathFuncUnary(typ, mthFunc, arg0VNP.GetConservative())); } - ValueNumPair EvalMathFuncBinary(var_types typ, - CorInfoIntrinsics mthFunc, - ValueNumPair arg0VNP, - ValueNumPair arg1VNP) + ValueNumPair EvalMathFuncBinary(var_types typ, NamedIntrinsic mthFunc, ValueNumPair arg0VNP, ValueNumPair arg1VNP) { return ValueNumPair(EvalMathFuncBinary(typ, mthFunc, arg0VNP.GetLiberal(), arg1VNP.GetLiberal()), EvalMathFuncBinary(typ, mthFunc, arg0VNP.GetConservative(), arg1VNP.GetConservative())); diff --git a/src/coreclr/src/md/CMakeLists.txt b/src/coreclr/src/md/CMakeLists.txt index 8c4438c34a38..53a675b4f500 100644 --- a/src/coreclr/src/md/CMakeLists.txt +++ b/src/coreclr/src/md/CMakeLists.txt @@ -9,8 +9,7 @@ add_compile_definitions($<$>:FEATURE_METAD add_compile_definitions($<$>,$>>>:FEATURE_METADATA_VERIFY_LAYOUTS>) if (CLR_CMAKE_HOST_WIN32) - add_compile_options($<$>,$>:-MTd>) - add_compile_options($<$>,$>>:-MT>) + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$>,$>:Debug>) endif() add_subdirectory(compiler) diff --git a/src/coreclr/src/md/ceefilegen/CMakeLists.txt b/src/coreclr/src/md/ceefilegen/CMakeLists.txt index 39864c71817f..aaae88889080 100644 --- a/src/coreclr/src/md/ceefilegen/CMakeLists.txt +++ b/src/coreclr/src/md/ceefilegen/CMakeLists.txt @@ -25,8 +25,11 @@ if (CLR_CMAKE_TARGET_WIN32) list(APPEND CEEFILEGEN_SOURCES ${CEEFILEGEN_HEADERS}) endif (CLR_CMAKE_TARGET_WIN32) -add_library_clr(ceefgen +add_library_clr(ceefgen_obj OBJECT ${CEEFILEGEN_SOURCES} ) -target_precompile_header(TARGET ceefgen HEADER stdafx.h) +target_precompile_headers(ceefgen_obj PRIVATE stdafx.h) + +add_library(ceefgen INTERFACE) +target_sources(ceefgen INTERFACE $) diff --git a/src/coreclr/src/md/compiler/CMakeLists.txt b/src/coreclr/src/md/compiler/CMakeLists.txt index 495fa4d70ca2..a2d3a5776c0b 100644 --- a/src/coreclr/src/md/compiler/CMakeLists.txt +++ b/src/coreclr/src/md/compiler/CMakeLists.txt @@ -32,14 +32,12 @@ set(MDCOMPILER_HEADERS ../inc/metamodelrw.h ../inc/rwutil.h ../inc/stgio.h - cacheload.h classfactory.h custattr.h disp.h filtermanager.h importhelper.h mdperf.h - mdsighelper.h mdutil.h regmeta.h ) @@ -66,20 +64,22 @@ endif() add_library_clr(mdcompiler_dac ${MDCOMPILER_SOURCES}) set_target_properties(mdcompiler_dac PROPERTIES DAC_COMPONENT TRUE) -target_precompile_header(TARGET mdcompiler_dac HEADER stdafx.h) +target_precompile_headers(mdcompiler_dac PRIVATE stdafx.h) -add_library_clr(mdcompiler_wks OBJECT ${MDCOMPILER_WKS_SOURCES}) -target_compile_definitions(mdcompiler_wks PRIVATE FEATURE_METADATA_EMIT_ALL) -target_precompile_header(TARGET mdcompiler_wks HEADER stdafx.h) +add_library_clr(mdcompiler_wks_obj OBJECT ${MDCOMPILER_WKS_SOURCES}) +target_compile_definitions(mdcompiler_wks_obj PRIVATE FEATURE_METADATA_EMIT_ALL) +target_precompile_headers(mdcompiler_wks_obj PRIVATE stdafx.h) +add_library(mdcompiler_wks INTERFACE) +target_sources(mdcompiler_wks INTERFACE $) add_library_clr(mdcompiler-dbi ${MDCOMPILER_SOURCES}) set_target_properties(mdcompiler-dbi PROPERTIES DBI_COMPONENT TRUE) -target_precompile_header(TARGET mdcompiler-dbi HEADER stdafx.h) +target_precompile_headers(mdcompiler-dbi PRIVATE stdafx.h) add_library_clr(mdcompiler_crossgen ${MDCOMPILER_SOURCES}) set_target_properties(mdcompiler_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) -target_precompile_header(TARGET mdcompiler_crossgen HEADER stdafx.h) +target_precompile_headers(mdcompiler_crossgen PRIVATE stdafx.h) add_library_clr(mdcompiler_ppdb ${MDCOMPILER_SOURCES}) target_compile_definitions(mdcompiler_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB) -target_precompile_header(TARGET mdcompiler_ppdb HEADER stdafx.h) \ No newline at end of file +target_precompile_headers(mdcompiler_ppdb PRIVATE stdafx.h) diff --git a/src/coreclr/src/md/compiler/cacheload.h b/src/coreclr/src/md/compiler/cacheload.h deleted file mode 100644 index 6fc1dc88a6e3..000000000000 --- a/src/coreclr/src/md/compiler/cacheload.h +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// CacheLoad.h -// - -// -// Class for returning the memory image where the image lives -// -//***************************************************************************** -#ifndef __CACHELOAD__H__ -#define __CACHELOAD__H__ - - -#undef INTERFACE -#define INTERFACE ICacheLoad -DECLARE_INTERFACE_(ICacheLoad, IUnknown) -{ - STDMETHOD(GetCachedImaged)( - LPVOID* pImage); - - STDMETHOD(SetCachedImaged)( - LPVOID pImage); -}; - -#endif diff --git a/src/coreclr/src/md/compiler/custattr_emit.cpp b/src/coreclr/src/md/compiler/custattr_emit.cpp index cff1be18dfbb..47589f93a242 100644 --- a/src/coreclr/src/md/compiler/custattr_emit.cpp +++ b/src/coreclr/src/md/compiler/custattr_emit.cpp @@ -1315,6 +1315,7 @@ HRESULT RegMeta::_HandleKnownCustomAttribute( // S_OK or error. // Force to wider value. qArgs[0].val.u4 = (unsigned)qArgs[0].val.i2; // Fall through to validation. + FALLTHROUGH; case CA_MethodImplAttribute3: // Validate bits. if (qArgs[0].val.u4 & ~(miUserMask)) @@ -1323,6 +1324,7 @@ HRESULT RegMeta::_HandleKnownCustomAttribute( // S_OK or error. if (!qNamedArgs[MI_CodeType].val.type.tag) break; // fall through to set the code type. + FALLTHROUGH; case CA_MethodImplAttribute1: { USHORT usFlags = reinterpret_cast(pRow)->GetImplFlags(); @@ -1338,6 +1340,7 @@ HRESULT RegMeta::_HandleKnownCustomAttribute( // S_OK or error. // Force the U2 to a wider U4 value explicitly. qArgs[0].val.u4 = qArgs[0].val.u2; // Fall through to handle the CA. + FALLTHROUGH; case CA_MarshalAsAttribute2: IfFailGo(_HandleNativeTypeCustomAttribute(tkObj, qArgs.Ptr(), qNamedArgs.Ptr(), qNativeType)); break; @@ -1351,6 +1354,7 @@ HRESULT RegMeta::_HandleKnownCustomAttribute( // S_OK or error. // Convert the I2 to a U2, then wide to an I4, then fall through. qArgs[0].val.i4 = static_cast(static_cast(qArgs[0].val.i2)); } + FALLTHROUGH; case CA_StructLayoutAttribute2: { // Get a copy of the flags to work with. diff --git a/src/coreclr/src/md/compiler/mdsighelper.h b/src/coreclr/src/md/compiler/mdsighelper.h deleted file mode 100644 index 057746e8f787..000000000000 --- a/src/coreclr/src/md/compiler/mdsighelper.h +++ /dev/null @@ -1,121 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** - -// -// MDSigHelp.h -// -// contains utility code for signature parsing and comparisons. -// -// This is needed for validator support, especially because it may need to compare signatures -// across multiple metadata scopes. -//***************************************************************************** - -#ifndef __mdsighelper_h_ -#define __mdsighelper_h_ - -#include "regmeta.h" - - -//**************************************************************************** -//**************************************************************************** -class MDSigParser : public SigParser -{ - friend class MDSigComparer; - - public: - //------------------------------------------------------------------------ - // Constructor. - //------------------------------------------------------------------------ - FORCEINLINE MDSigParser(PCCOR_SIGNATURE ptr, DWORD len) - : SigParser(ptr, len) - { } - - FORCEINLINE MDSigParser(const MDSigParser &sig) - : SigParser(sig.m_ptr, sig.m_dwLen) - { } -}; - -//**************************************************************************** -//**************************************************************************** -class MDSigComparer -{ - public: - //------------------------------------------------------------------------ - // This is the base type used to provide callback comparison functionality. - //------------------------------------------------------------------------ - class MDSigComparerBaseType - { - public: - //------------------------------------------------------------------------ - // Returns S_OK if the tokens are equivalent, E_FAIL if they are not, or - // error. - //------------------------------------------------------------------------ - virtual HRESULT CompareToken(const mdToken &tok1, const mdToken &tok2) = 0; - }; - - //------------------------------------------------------------------------ - // Ctor - //------------------------------------------------------------------------ - MDSigComparer(const MDSigParser &sig1, - const MDSigParser &sig2, - MDSigComparerBaseType &comparer) - : m_sig1(sig1), m_sig2(sig2), m_comparer(comparer) - { } - - //------------------------------------------------------------------------ - // Returns S_OK if the signatures are equivalent, E_FAIL if they are not, - // or error. - //------------------------------------------------------------------------ - HRESULT CompareMethodSignature(); - - protected: - MDSigParser m_sig1; - MDSigParser m_sig2; - MDSigComparerBaseType &m_comparer; - - // This will compare exactly one type in each signature to determine - // if they are equal - HRESULT _CompareMethodSignature(); - HRESULT _CompareExactlyOne(); - HRESULT _CompareData(ULONG *pulData); - HRESULT _CompareMethodSignatureHeader(ULONG &cArgs); -}; - -//**************************************************************************** -//**************************************************************************** -class UnifiedAssemblySigComparer : public MDSigComparer::MDSigComparerBaseType -{ - public: - //------------------------------------------------------------------------ - // Ctor - //------------------------------------------------------------------------ - UnifiedAssemblySigComparer(const RegMeta ®Meta) - : m_pRegMeta(const_cast(®Meta)) - { } - - //------------------------------------------------------------------------ - // Returns S_OK if the tokens are equivalent, E_FAIL if they are not, or - // error. - //------------------------------------------------------------------------ - virtual HRESULT CompareToken(const mdToken &tok1, const mdToken &tok2); - - protected: - RegMeta *m_pRegMeta; - - HRESULT _CompareAssemblies(mdToken tkAsmRef1,mdToken tkAsmRef2, BOOL* pfEquivalent); - - HRESULT _CreateTypeNameFromTypeRef( - mdToken tkTypeRef, - SString &ssName, - mdToken &tkParent); - - HRESULT _CreateFullyQualifiedTypeNameFromTypeRef( - mdToken tkTypeRef, - SString &ssFullName, - mdToken &tkParent); -}; - - -#endif // __mdsighelper_h_ - diff --git a/src/coreclr/src/md/datasource/CMakeLists.txt b/src/coreclr/src/md/datasource/CMakeLists.txt index 9216108a9727..75bdec0bc1bc 100644 --- a/src/coreclr/src/md/datasource/CMakeLists.txt +++ b/src/coreclr/src/md/datasource/CMakeLists.txt @@ -22,4 +22,4 @@ endif (CLR_CMAKE_TARGET_WIN32) add_library_clr(mddatasource_dbi STATIC ${MDDATASOURCE_SOURCES}) set_target_properties(mddatasource_dbi PROPERTIES DBI_COMPONENT TRUE) -target_precompile_header(TARGET mddatasource_dbi HEADER stdafx.h) +target_precompile_headers(mddatasource_dbi PRIVATE stdafx.h) diff --git a/src/coreclr/src/md/enc/CMakeLists.txt b/src/coreclr/src/md/enc/CMakeLists.txt index 14ed0a267fae..6bd2518d868c 100644 --- a/src/coreclr/src/md/enc/CMakeLists.txt +++ b/src/coreclr/src/md/enc/CMakeLists.txt @@ -50,20 +50,22 @@ convert_to_absolute_path(MDRUNTIMERW_SOURCES ${MDRUNTIMERW_SOURCES}) add_library_clr(mdruntimerw_dac ${MDRUNTIMERW_SOURCES}) set_target_properties(mdruntimerw_dac PROPERTIES DAC_COMPONENT TRUE) -target_precompile_header(TARGET mdruntimerw_dac HEADER stdafx.h) +target_precompile_headers(mdruntimerw_dac PRIVATE stdafx.h) -add_library_clr(mdruntimerw_wks OBJECT ${MDRUNTIMERW_SOURCES}) -target_compile_definitions(mdruntimerw_wks PRIVATE FEATURE_METADATA_EMIT_ALL) -target_precompile_header(TARGET mdruntimerw_wks HEADER stdafx.h) +add_library_clr(mdruntimerw_wks_obj OBJECT ${MDRUNTIMERW_SOURCES}) +target_compile_definitions(mdruntimerw_wks_obj PRIVATE FEATURE_METADATA_EMIT_ALL) +target_precompile_headers(mdruntimerw_wks_obj PRIVATE stdafx.h) +add_library(mdruntimerw_wks INTERFACE) +target_sources(mdruntimerw_wks INTERFACE $) add_library_clr(mdruntimerw-dbi ${MDRUNTIMERW_SOURCES}) set_target_properties(mdruntimerw-dbi PROPERTIES DBI_COMPONENT TRUE) -target_precompile_header(TARGET mdruntimerw-dbi HEADER stdafx.h) +target_precompile_headers(mdruntimerw-dbi PRIVATE stdafx.h) add_library_clr(mdruntimerw_crossgen ${MDRUNTIMERW_SOURCES}) set_target_properties(mdruntimerw_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) -target_precompile_header(TARGET mdruntimerw_crossgen HEADER stdafx.h) +target_precompile_headers(mdruntimerw_crossgen PRIVATE stdafx.h) add_library_clr(mdruntimerw_ppdb ${MDRUNTIMERW_SOURCES}) target_compile_definitions(mdruntimerw_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB) -target_precompile_header(TARGET mdruntimerw_ppdb HEADER stdafx.h) \ No newline at end of file +target_precompile_headers(mdruntimerw_ppdb PRIVATE stdafx.h) diff --git a/src/coreclr/src/md/enc/pdbheap.cpp b/src/coreclr/src/md/enc/pdbheap.cpp index 8305986f8c0c..962472ac65a2 100644 --- a/src/coreclr/src/md/enc/pdbheap.cpp +++ b/src/coreclr/src/md/enc/pdbheap.cpp @@ -1,6 +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. #include "stdafx.h" #include "pdbheap.h" diff --git a/src/coreclr/src/md/enc/stgio.cpp b/src/coreclr/src/md/enc/stgio.cpp index 451ee2590900..887f478cf63f 100644 --- a/src/coreclr/src/md/enc/stgio.cpp +++ b/src/coreclr/src/md/enc/stgio.cpp @@ -358,6 +358,8 @@ void StgIO::Close() break; } + FALLTHROUGH; + case STGIO_MEM: case STGIO_HFILEMEM: if (m_bFreeMem && m_pBaseData) @@ -366,6 +368,7 @@ void StgIO::Close() m_pBaseData = m_pData = 0; } // Intentional fall through to file case, if we kept handle open. + FALLTHROUGH; case STGIO_HFILE: { diff --git a/src/coreclr/src/md/enc/stgtiggerstorage.cpp b/src/coreclr/src/md/enc/stgtiggerstorage.cpp index e4c799a08af2..435a7a8996e3 100644 --- a/src/coreclr/src/md/enc/stgtiggerstorage.cpp +++ b/src/coreclr/src/md/enc/stgtiggerstorage.cpp @@ -624,7 +624,7 @@ HRESULT STDMETHODCALLTYPE TiggerStorage::OpenStream( // Look for the stream which must be found for this to work. Note that // this error is explicitly not posted as an error object since unfound streams - // are a common occurence and do not warrant a resource file load. + // are a common occurrence and do not warrant a resource file load. IfFailRet(FindStream(rcName, &pStream)); // Get the memory for the stream. diff --git a/src/coreclr/src/md/hotdata/CMakeLists.txt b/src/coreclr/src/md/hotdata/CMakeLists.txt index 03430e292c75..7f8ba752c4bf 100644 --- a/src/coreclr/src/md/hotdata/CMakeLists.txt +++ b/src/coreclr/src/md/hotdata/CMakeLists.txt @@ -31,20 +31,22 @@ endif (CLR_CMAKE_TARGET_WIN32) add_library_clr(mdhotdata_dac ${MDHOTDATA_SOURCES}) set_target_properties(mdhotdata_dac PROPERTIES DAC_COMPONENT TRUE) -target_precompile_header(TARGET mdhotdata_dac HEADER external.h) +target_precompile_headers(mdhotdata_dac PRIVATE external.h) -add_library_clr(mdhotdata_full OBJECT ${MDHOTDATA_SOURCES}) -target_precompile_header(TARGET mdhotdata_full HEADER external.h) +add_library_clr(mdhotdata_full_obj OBJECT ${MDHOTDATA_SOURCES}) +target_precompile_headers(mdhotdata_full_obj PRIVATE external.h) +add_library(mdhotdata_full INTERFACE) +target_sources(mdhotdata_full INTERFACE $) add_library_clr(mdhotdata_crossgen ${MDHOTDATA_SOURCES}) set_target_properties(mdhotdata_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) -target_precompile_header(TARGET mdhotdata_crossgen HEADER external.h) +target_precompile_headers(mdhotdata_crossgen PRIVATE external.h) if(CLR_CMAKE_HOST_WIN32) add_library_clr(mdhotdata-staticcrt ${MDHOTDATA_SOURCES}) - target_precompile_header(TARGET mdhotdata-staticcrt HEADER external.h) + target_precompile_headers(mdhotdata-staticcrt PRIVATE external.h) endif(CLR_CMAKE_HOST_WIN32) add_library_clr(mdhotdata_ppdb ${MDHOTDATA_SOURCES}) target_compile_definitions(mdhotdata_ppdb PRIVATE FEATURE_METADATA_EMIT_PORTABLE_PDB) -target_precompile_header(TARGET mdhotdata_ppdb HEADER external.h) \ No newline at end of file +target_precompile_headers(mdhotdata_ppdb PRIVATE external.h) diff --git a/src/coreclr/src/md/inc/pdbheap.h b/src/coreclr/src/md/inc/pdbheap.h index 0f5d25a91b20..92cc3b24494a 100644 --- a/src/coreclr/src/md/inc/pdbheap.h +++ b/src/coreclr/src/md/inc/pdbheap.h @@ -1,6 +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. #ifndef _PDBHEAP_H_ #define _PDBHEAP_H_ diff --git a/src/coreclr/src/md/inc/portablepdbmdds.h b/src/coreclr/src/md/inc/portablepdbmdds.h index ddaa8a8c74bd..10c82d3dba31 100644 --- a/src/coreclr/src/md/inc/portablepdbmdds.h +++ b/src/coreclr/src/md/inc/portablepdbmdds.h @@ -1,6 +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. /***************************************************************************** ** ** diff --git a/src/coreclr/src/md/inc/portablepdbmdi.h b/src/coreclr/src/md/inc/portablepdbmdi.h index 26a1cb916f43..d1785bca193b 100644 --- a/src/coreclr/src/md/inc/portablepdbmdi.h +++ b/src/coreclr/src/md/inc/portablepdbmdi.h @@ -1,6 +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. /***************************************************************************** ** ** diff --git a/src/coreclr/src/md/runtime/CMakeLists.txt b/src/coreclr/src/md/runtime/CMakeLists.txt index 5753e655abf9..6ff49d3e803e 100644 --- a/src/coreclr/src/md/runtime/CMakeLists.txt +++ b/src/coreclr/src/md/runtime/CMakeLists.txt @@ -47,20 +47,22 @@ endif (CLR_CMAKE_TARGET_WIN32) add_library_clr(mdruntime_dac ${MDRUNTIME_SOURCES}) set_target_properties(mdruntime_dac PROPERTIES DAC_COMPONENT TRUE) -target_precompile_header(TARGET mdruntime_dac HEADER stdafx.h) +target_precompile_headers(mdruntime_dac PRIVATE stdafx.h) -add_library_clr(mdruntime_wks OBJECT ${MDRUNTIME_SOURCES}) -target_compile_definitions(mdruntime_wks PRIVATE FEATURE_METADATA_EMIT_ALL) -target_precompile_header(TARGET mdruntime_wks HEADER stdafx.h) +add_library_clr(mdruntime_wks_obj OBJECT ${MDRUNTIME_SOURCES}) +target_compile_definitions(mdruntime_wks_obj PRIVATE FEATURE_METADATA_EMIT_ALL) +target_precompile_headers(mdruntime_wks_obj PRIVATE stdafx.h) +add_library(mdruntime_wks INTERFACE) +target_sources(mdruntime_wks INTERFACE $) add_library_clr(mdruntime-dbi ${MDRUNTIME_SOURCES}) set_target_properties(mdruntime-dbi PROPERTIES DBI_COMPONENT TRUE) -target_precompile_header(TARGET mdruntime-dbi HEADER stdafx.h) +target_precompile_headers(mdruntime-dbi PRIVATE stdafx.h) add_library_clr(mdruntime_crossgen ${MDRUNTIME_SOURCES}) set_target_properties(mdruntime_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) -target_precompile_header(TARGET mdruntime_crossgen HEADER stdafx.h) +target_precompile_headers(mdruntime_crossgen PRIVATE stdafx.h) add_library_clr(mdruntime_ppdb ${MDRUNTIME_SOURCES}) target_compile_definitions(mdruntime_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB) -target_precompile_header(TARGET mdruntime_ppdb HEADER stdafx.h) \ No newline at end of file +target_precompile_headers(mdruntime_ppdb PRIVATE stdafx.h) diff --git a/src/coreclr/src/pal/inc/mbusafecrt.h b/src/coreclr/src/pal/inc/mbusafecrt.h index 52ccc6c02aed..c2a12fc8c3a1 100644 --- a/src/coreclr/src/pal/inc/mbusafecrt.h +++ b/src/coreclr/src/pal/inc/mbusafecrt.h @@ -101,6 +101,8 @@ extern int swscanf_s( const WCHAR *string, const WCHAR *format, ... ); extern errno_t memcpy_s( void * dst, size_t sizeInBytes, const void * src, size_t count ) THROW_DECL; extern errno_t memmove_s( void * dst, size_t sizeInBytes, const void * src, size_t count ); +extern errno_t _wcslwr_s(char16_t *string, size_t sz); + #ifdef __cplusplus } #endif diff --git a/src/coreclr/src/pal/inc/pal.h b/src/coreclr/src/pal/inc/pal.h index df658c546905..19e64091018c 100644 --- a/src/coreclr/src/pal/inc/pal.h +++ b/src/coreclr/src/pal/inc/pal.h @@ -191,6 +191,18 @@ typedef PVOID NATIVE_LIBRARY_HANDLE; #endif #endif +#ifndef __has_cpp_attribute +#define __has_cpp_attribute(x) (0) +#endif + +#ifndef FALLTHROUGH +#if __has_cpp_attribute(fallthrough) +#define FALLTHROUGH [[fallthrough]] +#else // __has_cpp_attribute(fallthrough) +#define FALLTHROUGH +#endif // __has_cpp_attribute(fallthrough) +#endif // FALLTHROUGH + #ifndef PAL_STDCPP_COMPAT #if __GNUC__ @@ -376,7 +388,7 @@ PALIMPORT DWORD PALAPI PAL_InitializeCoreCLR( - const char *szExePath, bool runningInExe); + const char *szExePath, BOOL runningInExe); /// /// This function shuts down PAL WITHOUT exiting the current process. @@ -498,11 +510,8 @@ PALAPI PAL_GetPALDirectoryW( OUT LPWSTR lpDirectoryName, IN OUT UINT* cchDirectoryName); -#ifdef UNICODE + #define PAL_GetPALDirectory PAL_GetPALDirectoryW -#else -#define PAL_GetPALDirectory PAL_GetPALDirectoryA -#endif PALIMPORT VOID @@ -511,6 +520,32 @@ PAL_Random( IN OUT LPVOID lpBuffer, IN DWORD dwLength); +PALIMPORT +BOOL +PALAPI +PAL_OpenProcessMemory( + IN DWORD processId, + OUT DWORD* pHandle +); + +PALIMPORT +VOID +PALAPI +PAL_CloseProcessMemory( + IN DWORD handle +); + +PALIMPORT +BOOL +PALAPI +PAL_ReadProcessMemory( + IN DWORD handle, + IN ULONG64 address, + IN LPVOID buffer, + IN SIZE_T size, + OUT SIZE_T* numberOfBytesRead +); + PALIMPORT BOOL PALAPI @@ -685,13 +720,8 @@ SearchPathW( OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart ); -#ifdef UNICODE -#define SearchPath SearchPathW -#else -#define SearchPath SearchPathA -#endif // !UNICODE - +#define SearchPath SearchPathW PALIMPORT BOOL @@ -707,7 +737,6 @@ CopyFileW( #define CopyFile CopyFileA #endif - PALIMPORT BOOL PALAPI @@ -720,12 +749,9 @@ DeleteFileW( #define DeleteFile DeleteFileA #endif - - #define MOVEFILE_REPLACE_EXISTING 0x00000001 #define MOVEFILE_COPY_ALLOWED 0x00000002 - PALIMPORT BOOL PALAPI @@ -1053,15 +1079,6 @@ GetCurrentDirectoryW( #define GetCurrentDirectory GetCurrentDirectoryA #endif -PALIMPORT -HANDLE -PALAPI -CreateSemaphoreW( - IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, - IN LONG lInitialCount, - IN LONG lMaximumCount, - IN LPCWSTR lpName); - PALIMPORT HANDLE PALAPI @@ -1081,13 +1098,7 @@ OpenSemaphoreW( IN BOOL bInheritHandle, IN LPCWSTR lpName); -#ifdef UNICODE -#define CreateSemaphore CreateSemaphoreW #define CreateSemaphoreEx CreateSemaphoreExW -#else -#define CreateSemaphore CreateSemaphoreA -#define CreateSemaphoreEx CreateSemaphoreExA -#endif PALIMPORT BOOL @@ -1119,11 +1130,7 @@ CreateEventExW( #define CREATE_EVENT_MANUAL_RESET ((DWORD)0x1) #define CREATE_EVENT_INITIAL_SET ((DWORD)0x2) -#ifdef UNICODE #define CreateEvent CreateEventW -#else -#define CreateEvent CreateEventA -#endif PALIMPORT BOOL @@ -1169,11 +1176,7 @@ CreateMutexExW( // CreateMutexExW: dwFlags #define CREATE_MUTEX_INITIAL_OWNER ((DWORD)0x1) -#ifdef UNICODE #define CreateMutex CreateMutexW -#else -#define CreateMutex CreateMutexA -#endif PALIMPORT HANDLE @@ -1183,12 +1186,9 @@ OpenMutexW( IN BOOL bInheritHandle, IN LPCWSTR lpName); - #ifdef UNICODE #define OpenMutex OpenMutexW -#else -#define OpenMutex OpenMutexA -#endif // UNICODE +#endif PALIMPORT BOOL @@ -1252,34 +1252,8 @@ typedef struct _STARTUPINFOW { HANDLE hStdError; } STARTUPINFOW, *LPSTARTUPINFOW; -typedef struct _STARTUPINFOA { - DWORD cb; - LPSTR lpReserved_PAL_Undefined; - LPSTR lpDesktop_PAL_Undefined; - LPSTR lpTitle_PAL_Undefined; - DWORD dwX_PAL_Undefined; - DWORD dwY_PAL_Undefined; - DWORD dwXSize_PAL_Undefined; - DWORD dwYSize_PAL_Undefined; - DWORD dwXCountChars_PAL_Undefined; - DWORD dwYCountChars_PAL_Undefined; - DWORD dwFillAttribute_PAL_Undefined; - DWORD dwFlags; - WORD wShowWindow_PAL_Undefined; - WORD cbReserved2_PAL_Undefined; - LPBYTE lpReserved2_PAL_Undefined; - HANDLE hStdInput; - HANDLE hStdOutput; - HANDLE hStdError; -} STARTUPINFOA, *LPSTARTUPINFOA; - -#ifdef UNICODE typedef STARTUPINFOW STARTUPINFO; typedef LPSTARTUPINFOW LPSTARTUPINFO; -#else -typedef STARTUPINFOA STARTUPINFO; -typedef LPSTARTUPINFOW LPSTARTUPINFO; -#endif #define CREATE_NEW_CONSOLE 0x00000010 @@ -1307,11 +1281,7 @@ CreateProcessW( IN LPSTARTUPINFOW lpStartupInfo, OUT LPPROCESS_INFORMATION lpProcessInformation); -#ifdef UNICODE #define CreateProcess CreateProcessW -#else -#define CreateProcess CreateProcessA -#endif PALIMPORT PAL_NORETURN @@ -2442,11 +2412,7 @@ CreateFileMappingW( IN DWORD dwMaximumSizeLow, IN LPCWSTR lpName); -#ifdef UNICODE #define CreateFileMapping CreateFileMappingW -#else -#define CreateFileMapping CreateFileMappingA -#endif #define SECTION_QUERY 0x0001 #define SECTION_MAP_WRITE 0x0002 @@ -2466,11 +2432,7 @@ OpenFileMappingW( IN BOOL bInheritHandle, IN LPCWSTR lpName); -#ifdef UNICODE #define OpenFileMapping OpenFileMappingW -#else -#define OpenFileMapping OpenFileMappingA -#endif typedef INT_PTR (PALAPI_NOEXPORT *FARPROC)(); @@ -2528,6 +2490,11 @@ PALAPI PAL_FreeLibraryDirect( IN NATIVE_LIBRARY_HANDLE dl_handle); +PALIMPORT +HMODULE +PALAPI +PAL_GetPalHostModule(); + PALIMPORT FARPROC PALAPI @@ -2688,6 +2655,33 @@ VirtualFree( IN SIZE_T dwSize, IN DWORD dwFreeType); +#if defined(HOST_OSX) && defined(HOST_ARM64) +#ifdef __cplusplus +extern "C++" { +struct PAL_JITWriteEnableHolder +{ +public: + PAL_JITWriteEnableHolder(bool jitWriteEnable) + { + m_jitWriteEnableRestore = JITWriteEnable(jitWriteEnable); + }; + ~PAL_JITWriteEnableHolder() + { + JITWriteEnable(m_jitWriteEnableRestore); + } + +private: + bool JITWriteEnable(bool enable); + bool m_jitWriteEnableRestore; +}; + +inline +PAL_JITWriteEnableHolder +PAL_JITWriteEnable(IN bool enable) { return PAL_JITWriteEnableHolder(enable); } +} +#endif // __cplusplus +#endif // defined(HOST_OSX) && defined(HOST_ARM64) + PALIMPORT BOOL PALAPI @@ -2750,14 +2744,6 @@ LocalAlloc( IN UINT uFlags, IN SIZE_T uBytes); -PALIMPORT -HLOCAL -PALAPI -LocalReAlloc( - IN HLOCAL hMem, - IN SIZE_T uBytes, - IN UINT uFlags); - PALIMPORT HLOCAL PALAPI @@ -2786,26 +2772,6 @@ typedef struct _cpinfo { BYTE LeadByte[MAX_LEADBYTES]; } CPINFO, *LPCPINFO; -PALIMPORT -BOOL -PALAPI -GetCPInfo( - IN UINT CodePage, - OUT LPCPINFO lpCPInfo); - -PALIMPORT -BOOL -PALAPI -IsDBCSLeadByteEx( - IN UINT CodePage, - IN BYTE TestChar); - -PALIMPORT -BOOL -PALAPI -IsDBCSLeadByte( - IN BYTE TestChar); - #define MB_PRECOMPOSED 0x00000001 #define MB_ERR_INVALID_CHARS 0x00000008 @@ -2998,11 +2964,7 @@ LPWSTR PALAPI GetEnvironmentStringsW(); -#ifdef UNICODE #define GetEnvironmentStrings GetEnvironmentStringsW -#else -#define GetEnvironmentStrings GetEnvironmentStringsA -#endif PALIMPORT BOOL @@ -3010,11 +2972,7 @@ PALAPI FreeEnvironmentStringsW( IN LPWSTR); -#ifdef UNICODE #define FreeEnvironmentStrings FreeEnvironmentStringsW -#else -#define FreeEnvironmentStrings FreeEnvironmentStringsA -#endif PALIMPORT BOOL @@ -3995,9 +3953,6 @@ PALIMPORT DLLEXPORT int __cdecl _stricmp(const char *, const char *); PALIMPORT DLLEXPORT int __cdecl vsprintf_s(char *, size_t, const char *, va_list); PALIMPORT char * __cdecl _gcvt_s(char *, int, double, int); PALIMPORT int __cdecl __iscsym(int); -PALIMPORT unsigned char * __cdecl _mbsinc(const unsigned char *); -PALIMPORT unsigned char * __cdecl _mbsninc(const unsigned char *, size_t); -PALIMPORT unsigned char * __cdecl _mbsdec(const unsigned char *, const unsigned char *); PALIMPORT DLLEXPORT int __cdecl _wcsicmp(const WCHAR *, const WCHAR*); PALIMPORT int __cdecl _wcsnicmp(const WCHAR *, const WCHAR *, size_t); PALIMPORT int __cdecl _vsnprintf(char *, size_t, const char *, va_list); @@ -4030,7 +3985,7 @@ PALIMPORT int __cdecl PAL_swscanf(const WCHAR *, const WCHAR *, ...); PALIMPORT DLLEXPORT ULONG __cdecl PAL_wcstoul(const WCHAR *, WCHAR **, int); PALIMPORT double __cdecl PAL_wcstod(const WCHAR *, WCHAR **); -PALIMPORT WCHAR * __cdecl _wcslwr(WCHAR *); +PALIMPORT errno_t __cdecl _wcslwr_s(WCHAR *, size_t sz); PALIMPORT DLLEXPORT ULONGLONG _wcstoui64(const WCHAR *, WCHAR **, int); PALIMPORT DLLEXPORT errno_t __cdecl _i64tow_s(long long, WCHAR *, size_t, int); PALIMPORT int __cdecl _wtoi(const WCHAR *); diff --git a/src/coreclr/src/pal/inc/pal_error.h b/src/coreclr/src/pal/inc/pal_error.h index be9350d333e9..b387e6854006 100644 --- a/src/coreclr/src/pal/inc/pal_error.h +++ b/src/coreclr/src/pal/inc/pal_error.h @@ -133,7 +133,6 @@ #define ERROR_PALINIT_INITIALIZE_MACH_EXCEPTION 65280L #define ERROR_PALINIT_PROCABORT_INITIALIZE 65281L #define ERROR_PALINIT_INITIALIZE_FLUSH_PROCESS_WRITE_BUFFERS 65282L -#define ERROR_PALINIT_TIME 65283L #define ERROR_PALINIT_MAP 65284L #define ERROR_PALINIT_VIRTUAL 65285L #define ERROR_PALINIT_SEH 65286L diff --git a/src/coreclr/src/pal/inc/pal_safecrt.h b/src/coreclr/src/pal/inc/pal_safecrt.h deleted file mode 100644 index 481e9c4422bf..000000000000 --- a/src/coreclr/src/pal/inc/pal_safecrt.h +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - pal_safecrt.h - -Abstract: - -Wrapper for including SafeCRT for Mac build of CoreCLR - - - ---*/ - -#ifndef _PAL_SAFECRT_H_ -#define _PAL_SAFECRT_H_ - -#define _CRT_ALTERNATIVE_INLINES -#define _SAFECRT_NO_INCLUDES 1 - -#if !defined (_SAFECRT_USE_INLINES) -#define _SAFECRT_USE_INLINES 0 -#endif - -#if !defined (_SAFECRT_IMPL) -#define _SAFECRT_IMPL 0 -#endif - -#define _SAFECRT_SET_ERRNO 0 -#define _SAFECRT_DEFINE_MBS_FUNCTIONS 0 -#define _SAFECRT_DEFINE_TCS_MACROS 1 -//#define _SAFECRT_INVALID_PARAMETER(message) WARN(message "\n") - -#if defined (SAFECRT_IN_PAL) - -#define DUMMY_memset void * __cdecl memset(void *, int, size_t); - -#endif - -// Include the safecrt implementation -#include "../../palrt/inc/safecrt.h" - -#if defined(SAFECRT_IN_PAL) - -#define DUMMY_memset - -#endif - -#endif // _PAL_SAFECRT_H_ diff --git a/src/coreclr/src/pal/inc/palprivate.h b/src/coreclr/src/pal/inc/palprivate.h index e92cd1aa4747..097229eb64ef 100644 --- a/src/coreclr/src/pal/inc/palprivate.h +++ b/src/coreclr/src/pal/inc/palprivate.h @@ -145,43 +145,6 @@ PALAPI SetCurrentDirectoryA( IN LPCSTR lpPathName); -PALIMPORT -HANDLE -PALAPI -CreateSemaphoreA( - IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, - IN LONG lInitialCount, - IN LONG lMaximumCount, - IN LPCSTR lpName); - -PALIMPORT -HANDLE -PALAPI -CreateSemaphoreExA( - IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, - IN LONG lInitialCount, - IN LONG lMaximumCount, - IN LPCSTR lpName, - IN /*_Reserved_*/ DWORD dwFlags, - IN DWORD dwDesiredAccess); - -PALIMPORT -HANDLE -PALAPI -CreateEventA( - IN LPSECURITY_ATTRIBUTES lpEventAttributes, - IN BOOL bManualReset, - IN BOOL bInitialState, - IN LPCSTR lpName); - -PALIMPORT -HANDLE -PALAPI -CreateMutexA( - IN LPSECURITY_ATTRIBUTES lpMutexAttributes, - IN BOOL bInitialOwner, - IN LPCSTR lpName); - PALIMPORT HANDLE PALAPI @@ -190,40 +153,6 @@ OpenMutexA( IN BOOL bInheritHandle, IN LPCSTR lpName); -PALIMPORT -BOOL -PALAPI -CreateProcessA( - IN LPCSTR lpApplicationName, - IN LPSTR lpCommandLine, - IN LPSECURITY_ATTRIBUTES lpProcessAttributes, - IN LPSECURITY_ATTRIBUTES lpThreadAttributes, - IN BOOL bInheritHandles, - IN DWORD dwCreationFlags, - IN LPVOID lpEnvironment, - IN LPCSTR lpCurrentDirectory, - IN LPSTARTUPINFOA lpStartupInfo, - OUT LPPROCESS_INFORMATION lpProcessInformation); - -PALIMPORT -HANDLE -PALAPI -CreateFileMappingA( - IN HANDLE hFile, - IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, - IN DWORD flProtect, - IN DWORD dwMaximumSizeHigh, - IN DWORD dwMaximumSizeLow, - IN LPCSTR lpName); - -PALIMPORT -HANDLE -PALAPI -OpenFileMappingA( - IN DWORD dwDesiredAccess, - IN BOOL bInheritHandle, - IN LPCSTR lpName); - PALIMPORT HMODULE PALAPI @@ -246,12 +175,6 @@ GetModuleFileNameA( OUT LPSTR lpFileName, IN DWORD nSize); - -PALIMPORT -LPSTR -PALAPI -GetEnvironmentStringsA(); - PALIMPORT BOOL PALAPI @@ -267,31 +190,12 @@ GetEnvironmentVariableA( OUT LPSTR lpBuffer, IN DWORD nSize); -PALIMPORT -BOOL -PALAPI -FreeEnvironmentStringsA( - IN LPSTR); - -PALIMPORT -BOOL -PALAPI -RemoveDirectoryA( - IN LPCSTR lpPathName); - PALIMPORT BOOL PALAPI RemoveDirectoryW( IN LPCWSTR lpPathName); -PALIMPORT -BOOL -PALAPI -PAL_GetPALDirectoryA( - OUT LPSTR lpDirectoryName, - IN UINT* cchDirectoryName); - PALIMPORT LONG PALAPI diff --git a/src/coreclr/src/pal/inc/rt/accctrl.h b/src/coreclr/src/pal/inc/rt/accctrl.h deleted file mode 100644 index 4f76c298d3af..000000000000 --- a/src/coreclr/src/pal/inc/rt/accctrl.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: accctl.h -// -// =========================================================================== -// dummy accctl.h for PAL - -#include "palrt.h" diff --git a/src/coreclr/src/pal/inc/rt/hstring.h b/src/coreclr/src/pal/inc/rt/hstring.h deleted file mode 100644 index b23533a2940d..000000000000 --- a/src/coreclr/src/pal/inc/rt/hstring.h +++ /dev/null @@ -1,4 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include "palrt.h" diff --git a/src/coreclr/src/pal/inc/rt/mbstring.h b/src/coreclr/src/pal/inc/rt/mbstring.h deleted file mode 100644 index 19966945dc2f..000000000000 --- a/src/coreclr/src/pal/inc/rt/mbstring.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: mbstring.h -// -// =========================================================================== -// dummy mbstring.h for PAL - -#include "palrt.h" diff --git a/src/coreclr/src/pal/inc/rt/oleidl.h b/src/coreclr/src/pal/inc/rt/oleidl.h deleted file mode 100644 index f1b442c86b14..000000000000 --- a/src/coreclr/src/pal/inc/rt/oleidl.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: oleidl.h -// -// =========================================================================== -// simplified oleidl.h for PAL - -#include "palrt.h" diff --git a/src/coreclr/src/pal/inc/rt/palrt.h b/src/coreclr/src/pal/inc/rt/palrt.h index b021277e4375..db50a288af0b 100644 --- a/src/coreclr/src/pal/inc/rt/palrt.h +++ b/src/coreclr/src/pal/inc/rt/palrt.h @@ -303,7 +303,6 @@ typedef union _ULARGE_INTEGER { /******************* OLE, BSTR, VARIANT *************************/ STDAPI_VIS(DLLEXPORT, LPVOID) CoTaskMemAlloc(SIZE_T cb); -STDAPI_VIS(DLLEXPORT, LPVOID) CoTaskMemRealloc(LPVOID pv, SIZE_T cb); STDAPI_VIS(DLLEXPORT, void) CoTaskMemFree(LPVOID pv); typedef SHORT VARIANT_BOOL; @@ -708,10 +707,6 @@ STDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize) #define _SAFECRT_SET_ERRNO 0 #define _SAFECRT_DEFINE_MBS_FUNCTIONS 0 #define _SAFECRT_DEFINE_TCS_MACROS 1 -/* -#define _SAFECRT__ISMBBLEAD(_Character) 0 -#define _SAFECRT__MBSDEC(_String, _Current) (_Current - 1) -*/ #include "safecrt.h" #include "specstrings.h" @@ -720,7 +715,6 @@ The wrappers below are simple implementations that may not be as robust as compl Remember to fix the errcode defintion in safecrt.h. */ -#define _wcslwr_s _wcslwr_unsafe #define swscanf_s swscanf #define _wfopen_s _wfopen_unsafe @@ -732,33 +726,11 @@ extern "C++" { #include -inline errno_t __cdecl _wcslwr_unsafe(WCHAR *str, size_t sz) -{ - size_t fullSize; - if(!ClrSafeInt::multiply(sz, sizeof(WCHAR), fullSize)) - return 1; - WCHAR *copy = (WCHAR *)malloc(fullSize); - if(copy == nullptr) - return 1; - - errno_t retCode = wcscpy_s(copy, sz, str); - if(retCode) { - free(copy); - return 1; - } - - _wcslwr(copy); - wcscpy_s(str, sz, copy); - free(copy); - - return 0; -} - inline int __cdecl _vscprintf_unsafe(const char *_Format, va_list _ArgList) { int guess = 10; - for (;;) + while (true) { char *buf = (char *)malloc(guess * sizeof(char)); if(buf == nullptr) @@ -802,7 +774,6 @@ inline errno_t __cdecl _fopen_unsafe(PAL_FILE * *ff, const char *fileName, const } #endif /* __cplusplus */ - STDAPI_(BOOL) PathAppendW(LPWSTR pszPath, LPCWSTR pszMore); STDAPI_(int) PathCommonPrefixW(LPCWSTR pszFile1, LPCWSTR pszFile2, LPWSTR pszPath); PALIMPORT LPWSTR PALAPI PathFindFileNameW(LPCWSTR pPath); @@ -876,8 +847,6 @@ typedef HANDLE HWND; #define IS_TEXT_UNICODE_SIGNATURE 0x0008 #define IS_TEXT_UNICODE_UNICODE_MASK 0x000F -BOOL IsTextUnicode(CONST VOID* lpv, int iSize, LPINT lpiResult); - typedef struct _LIST_ENTRY { struct _LIST_ENTRY *Flink; struct _LIST_ENTRY *Blink; diff --git a/src/coreclr/src/pal/inc/rt/pshpck16.h b/src/coreclr/src/pal/inc/rt/pshpck16.h deleted file mode 100644 index bd0d82ed724e..000000000000 --- a/src/coreclr/src/pal/inc/rt/pshpck16.h +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: pshpck16.h -// -// =========================================================================== - -/*++ - -Abstract: - - This file turns 16 byte packing of structures on. (That is, it disables - automatic alignment of structure fields.) An include file is needed - because various compilers do this in different ways. For Microsoft - compatible compilers, this files uses the push option to the pack pragma - so that the poppack.h include file can restore the previous packing - reliably. - - The file poppack.h is the complement to this file. - ---*/ - -#if ! (defined(lint) || defined(RC_INVOKED)) -#if ( _MSC_VER >= 800 && !defined(_M_I86)) || defined(_PUSHPOP_SUPPORTED) -#pragma warning(disable:4103) -#if !(defined( MIDL_PASS )) || defined( __midl ) -#pragma pack(push,16) -#else -#pragma pack(16) -#endif -#else -#pragma pack(16) -#endif -#endif // ! (defined(lint) || defined(RC_INVOKED)) diff --git a/src/coreclr/src/pal/inc/rt/safecrt.h b/src/coreclr/src/pal/inc/rt/safecrt.h index fa30a150a34d..e440196df859 100644 --- a/src/coreclr/src/pal/inc/rt/safecrt.h +++ b/src/coreclr/src/pal/inc/rt/safecrt.h @@ -332,17 +332,6 @@ typedef int errno_t; /* standard */ return EINVAL; #endif -/* MBCS handling: change these definitions if you do not need to support mbcs strings */ -#if !defined(_SAFECRT__ISMBBLEAD) -#define _SAFECRT__ISMBBLEAD(_Character) \ - _ismbblead(_Character) -#endif - -#if !defined(_SAFECRT__MBSDEC) -#define _SAFECRT__MBSDEC(_String, _Current) \ - _mbsdec(_String, _Current) -#endif - _SAFECRT__EXTERN_C void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionName, const WCHAR *_FileName, unsigned int _LineNumber, uintptr_t _Reserved); @@ -373,7 +362,7 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam #if _SAFECRT_DEFINE_TCS_MACROS /* _tcs macros */ -#if !defined(_UNICODE) && !defined(UNICODE) && !defined(_MBCS) +#if !defined(_UNICODE) && !defined(UNICODE) #define _tcscpy_s strcpy_s #define _tcsncpy_s strncpy_s @@ -382,13 +371,7 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam #define _tcsset_s _strset_s #define _tcsnset_s _strnset_s #define _tcstok_s strtok_s -#define _tmakepath_s _makepath_s -#define _tsplitpath_s _splitpath_s -#define _stprintf_s sprintf_s -#define _sntprintf_s _snprintf_s #define _vsntprintf_s _vsnprintf_s -#define _tscanf_s scanf_s -#define _tsscanf_s sscanf_s #elif defined(_UNICODE) || defined(UNICODE) @@ -406,22 +389,6 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam #define _tscanf_s wscanf_s #define _tsscanf_s swscanf_s -#elif defined(_MBCS) - -#define _tcscpy_s _mbscpy_s -#define _tcsncpy_s _mbsnbcpy_s -#define _tcscat_s _mbscat_s -#define _tcsncat_s _mbsnbcat_s -#define _tcsset_s _mbsset_s -#define _tcsnset_s _mbsnbset_s -#define _tcstok_s _mbstok_s -#define _tmakepath_s _makepath_s -#define _tsplitpath_s _splitpath_s -#define _stprintf_s sprintf_s -#define _sntprintf_s _snprintf_s -#define _tscanf_s scanf_s -#define _tsscanf_s sscanf_s - #else #error We should not get here... @@ -524,64 +491,6 @@ errno_t __cdecl wcscpy_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Src) #endif -/* _mbscpy_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbscpy_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbscpy_s(unsigned char (&_Dst)[_SizeInBytes], const unsigned char *_Src) -{ - return _mbscpy_s(_Dst, _SizeInBytes, _Src); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbscpy_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src) -{ - unsigned char *p; - size_t available; - - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - _SAFECRT__VALIDATE_POINTER_RESET_STRING(_Src, _Dst, _SizeInBytes); - - p = _Dst; - available = _SizeInBytes; - while ((*p++ = *_Src++) != 0 && --available > 0) - { - } - - if (available == 0) - { - if (*_Src == 0 && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the source string ended with a lead byte: we remove it */ - p[-1] = 0; - return 0; - } - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Dst, _SizeInBytes); - } - if (available < _SizeInBytes && _SAFECRT__ISMBBLEAD(p[-2])) - { - /* the source string ended with a lead byte: we remove it */ - p[-2] = 0; - available++; - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - return 0; -} - -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - /* strncpy_s */ /* * strncpy_s, wcsncpy_s copy at max _Count characters from string _Src into _Dst; @@ -734,212 +643,6 @@ errno_t __cdecl wcsncpy_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Src, s #endif -/* _mbsnbcpy_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src, size_t _CountInBytes); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbsnbcpy_s(unsigned char (&_Dst)[_SizeInBytes], const unsigned char *_Src, size_t _CountInBytes) -{ - return _mbsnbcpy_s(_Dst, _SizeInBytes, _Src, _CountInBytes); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src, size_t _CountInBytes) -{ - unsigned char *p; - size_t available; - - if (_CountInBytes == 0 && _Dst == nullptr && _SizeInBytes == 0) - { - /* this case is allowed; nothing to do */ - return 0; - } - - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - if (_CountInBytes == 0) - { - /* notice that the source string pointer can be nullptr in this case */ - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - return 0; - } - _SAFECRT__VALIDATE_POINTER_RESET_STRING(_Src, _Dst, _SizeInBytes); - - p = _Dst; - available = _SizeInBytes; - if (_CountInBytes == _TRUNCATE) - { - while ((*p++ = *_Src++) != 0 && --available > 0) - { - } - } - else - { - while ((*p++ = *_Src++) != 0 && --available > 0 && --_CountInBytes > 0) - { - } - if (_CountInBytes == 0) - { - *p++ = 0; - } - } - - if (available == 0) - { - if ((*_Src == 0 || _CountInBytes == 1) && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the source string ended with a lead byte: we remove it */ - p[-1] = 0; - return 0; - } - if (_CountInBytes == _TRUNCATE) - { - if (_SizeInBytes > 1 && _SAFECRT__ISMBBLEAD(_Dst[_SizeInBytes - 2])) - { - _Dst[_SizeInBytes - 2] = 0; - _SAFECRT__FILL_BYTE(_Dst[_SizeInBytes - 1]); - } - else - { - _Dst[_SizeInBytes - 1] = 0; - } - return STRUNCATE; - } - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Dst, _SizeInBytes); - } - if (available < _SizeInBytes && _SAFECRT__ISMBBLEAD(p[-2])) - { - /* the source string ended with a lead byte: we remove it */ - p[-2] = 0; - available++; - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - return 0; -} - -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - -/* _mbsncpy_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbsncpy_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src, size_t _CountInChars); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbsncpy_s(unsigned char (&_Dst)[_SizeInBytes], const unsigned char *_Src, size_t _CountInChars) -{ - return _mbsncpy_s(_Dst, _SizeInBytes, _Src, _CountInChars); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbsncpy_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src, size_t _CountInChars) -{ - unsigned char *p; - size_t available; - - if (_CountInChars == 0 && _Dst == nullptr && _SizeInBytes == 0) - { - /* this case is allowed; nothing to do */ - return 0; - } - - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - if (_CountInChars == 0) - { - /* notice that the source string pointer can be nullptr in this case */ - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - return 0; - } - _SAFECRT__VALIDATE_POINTER_RESET_STRING(_Src, _Dst, _SizeInBytes); - - p = _Dst; - available = _SizeInBytes; - if (_CountInChars == _TRUNCATE) - { - while ((*p++ = *_Src++) != 0 && --available > 0) - { - } - } - else - { - do - { - if (_SAFECRT__ISMBBLEAD(*_Src)) - { - if (_Src[1] == 0) - { - /* the source string ended with a lead byte: we remove it */ - *p = 0; - break; - } - if (available <= 2) - { - /* not enough space */ - available = 0; - break; - } - *p++ = *_Src++; - *p++ = *_Src++; - available -= 2; - } - else - { - if ((*p++ = *_Src++) == 0 || --available == 0) - { - break; - } - } - } - while (--_CountInChars > 0); - if (_CountInChars == 0) - { - *p++ = 0; - } - } - - if (available == 0) - { - if (_CountInChars == _TRUNCATE) - { - if (_SizeInBytes > 1 && _SAFECRT__ISMBBLEAD(_Dst[_SizeInBytes - 2])) - { - _Dst[_SizeInBytes - 2] = 0; - _SAFECRT__FILL_BYTE(_Dst[_SizeInBytes - 1]); - } - else - { - _Dst[_SizeInBytes - 1] = 0; - } - return STRUNCATE; - } - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Dst, _SizeInBytes); - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - return 0; -} - -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - /* strcat_s */ /* * strcat_s, wcscat_s append string _Src to _Dst; @@ -1052,93 +755,6 @@ errno_t __cdecl wcscat_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Src) #endif -/* _mbscat_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbscat_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbscat_s(unsigned char (&_Dst)[_SizeInBytes], const unsigned char *_Src) -{ - return _mbscat_s(_Dst, _SizeInBytes, _Src); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbscat_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src) -{ - unsigned char *p; - size_t available; - - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - _SAFECRT__VALIDATE_POINTER_RESET_STRING(_Src, _Dst, _SizeInBytes); - - p = _Dst; - available = _SizeInBytes; - while (available > 0 && *p != 0) - { - p++; - available--; - } - - if (available == 0) - { - if (*p == 0 && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the original string ended with a lead byte: we remove it */ - p--; - *p = 0; - available = 1; - } - else - { - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInBytes); - } - } - if (available < _SizeInBytes && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the original string ended with a lead byte: we remove it */ - p--; - *p = 0; - available++; - } - - while ((*p++ = *_Src++) != 0 && --available > 0) - { - } - - if (available == 0) - { - if (*_Src == 0 && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the source string ended with a lead byte: we remove it */ - p[-1] = 0; - return 0; - } - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Dst, _SizeInBytes); - } - if (available < _SizeInBytes && _SAFECRT__ISMBBLEAD(p[-2])) - { - /* the source string ended with a lead byte: we remove it */ - p[-2] = 0; - available++; - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - return 0; -} - -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - /* strncat_s */ /* * strncat_s, wcsncat_s append at max _Count characters from string _Src to _Dst; @@ -1307,260 +923,6 @@ errno_t __cdecl wcsncat_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Src, s #endif -/* _mbsnbcat_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src, size_t _CountInBytes); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbsnbcat_s(unsigned char (&_Dst)[_SizeInBytes], const unsigned char *_Src, size_t _CountInBytes) -{ - return _mbsnbcat_s(_Dst, _SizeInBytes, _Src, size_t _CountInBytes); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src, size_t _CountInBytes) -{ - unsigned char *p; - size_t available; - if (_CountInBytes == 0 && _Dst == nullptr && _SizeInBytes == 0) - { - /* this case is allowed; nothing to do */ - return 0; - } - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - if (_CountInBytes != 0) - { - _SAFECRT__VALIDATE_POINTER_RESET_STRING(_Src, _Dst, _SizeInBytes); - } - - p = _Dst; - available = _SizeInBytes; - while (available > 0 && *p != 0) - { - p++; - available--; - } - - if (available == 0) - { - if (*p == 0 && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the original string ended with a lead byte: we remove it */ - p--; - *p = 0; - available = 1; - } - else - { - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInBytes); - } - } - if (available < _SizeInBytes && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the original string ended with a lead byte: we remove it */ - p--; - *p = 0; - available++; - } - - if (_CountInBytes == _TRUNCATE) - { - while ((*p++ = *_Src++) != 0 && --available > 0) - { - } - } - else - { - while (_CountInBytes > 0 && (*p++ = *_Src++) != 0 && --available > 0) - { - _CountInBytes--; - } - if (_CountInBytes == 0) - { - *p++ = 0; - } - } - - if (available == 0) - { - if ((*_Src == 0 || _CountInBytes == 1) && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the source string ended with a lead byte: we remove it */ - p[-1] = 0; - return 0; - } - if (_CountInBytes == _TRUNCATE) - { - if (_SizeInBytes > 1 && _SAFECRT__ISMBBLEAD(_Dst[_SizeInBytes - 2])) - { - _Dst[_SizeInBytes - 2] = 0; - _SAFECRT__FILL_BYTE(_Dst[_SizeInBytes - 1]); - } - else - { - _Dst[_SizeInBytes - 1] = 0; - } - return STRUNCATE; - } - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Dst, _SizeInBytes); - } - if (available < _SizeInBytes && _SAFECRT__ISMBBLEAD(p[-2])) - { - /* the source string ended with a lead byte: we remove it */ - p[-2] = 0; - available++; - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - return 0; -} - -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - -/* _mbsncat_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbsncat_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src, size_t _CountInChars); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbsncat_s(unsigned char (&_Dst)[_SizeInBytes], const unsigned char *_Src, size_t _CountInChars) -{ - return _mbsncat_s(_Dst, _SizeInBytes, _Src, size_t _CountInChars); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbsncat_s(unsigned char *_Dst, size_t _SizeInBytes, const unsigned char *_Src, size_t _CountInChars) -{ - unsigned char *p; - size_t available; - if (_CountInChars == 0 && _Dst == nullptr && _SizeInBytes == 0) - { - /* this case is allowed; nothing to do */ - return 0; - } - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - if (_CountInChars != 0) - { - _SAFECRT__VALIDATE_POINTER_RESET_STRING(_Src, _Dst, _SizeInBytes); - } - - p = _Dst; - available = _SizeInBytes; - while (available > 0 && *p != 0) - { - p++; - available--; - } - - if (available == 0) - { - if (*p == 0 && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the original string ended with a lead byte: we remove it */ - p--; - *p = 0; - available = 1; - } - else - { - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInBytes); - } - } - if (available < _SizeInBytes && _SAFECRT__ISMBBLEAD(p[-1])) - { - /* the original string ended with a lead byte: we remove it */ - p--; - *p = 0; - available++; - } - - if (_CountInChars == _TRUNCATE) - { - while ((*p++ = *_Src++) != 0 && --available > 0) - { - } - } - else - { - while (_CountInChars > 0) - { - if (_SAFECRT__ISMBBLEAD(*_Src)) - { - if (_Src[1] == 0) - { - /* the source string ended with a lead byte: we remove it */ - *p = 0; - break; - } - if (available <= 2) - { - /* not enough space */ - available = 0; - break; - } - *p++ = *_Src++; - *p++ = *_Src++; - available -= 2; - } - else - { - if ((*p++ = *_Src++) == 0 || --available == 0) - { - break; - } - } - _CountInChars--; - } - if (_CountInChars == 0) - { - *p++ = 0; - } - } - - if (available == 0) - { - if (_CountInChars == _TRUNCATE) - { - if (_SizeInBytes > 1 && _SAFECRT__ISMBBLEAD(_Dst[_SizeInBytes - 2])) - { - _Dst[_SizeInBytes - 2] = 0; - _SAFECRT__FILL_BYTE(_Dst[_SizeInBytes - 1]); - } - else - { - _Dst[_SizeInBytes - 1] = 0; - } - return STRUNCATE; - } - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Dst, _SizeInBytes); - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - return 0; -} - -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ /* _strset_s */ /* @@ -1650,101 +1012,6 @@ errno_t __cdecl _wcsset_s(WCHAR *_Dst, size_t _SizeInWords, WCHAR _Value) #endif -/* _mbsset_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbsset_s(unsigned char *_Dst, size_t _SizeInBytes, unsigned int _Value); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbsset_s(unsigned char (&_Dst)[_SizeInBytes], unsigned int _Value) -{ - return _mbsset_s(_Dst, _SizeInBytes, _Value); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbsset_s(unsigned char *_Dst, size_t _SizeInBytes, unsigned int _Value) -{ - int mbcs_error = 0; - unsigned char *p; - size_t available; - unsigned char highval, lowval; - - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - - p = _Dst; - available = _SizeInBytes; - highval = (unsigned char)(_Value >> 8); - lowval = (unsigned char)(_Value & 0x00ff); - if (highval != 0) - { - if (_SAFECRT__ISMBBLEAD(highval) && lowval != 0) - { - while (*p != 0 && --available > 0) - { - if (p[1] == 0) - { - /* do not orphan leadbyte */ - *p++ = ' '; - break; - } - *p++ = highval; - if (--available == 0) - { - break; - } - *p++ = lowval; - } - } - else - { - mbcs_error = 1; - highval = 0; - lowval = ' '; - } - } - else - { - if (_SAFECRT__ISMBBLEAD(lowval)) - { - mbcs_error = 1; - lowval = ' '; - } - } - if (highval == 0) - { - while (*p != 0 && --available > 0) - { - *p++ = lowval; - } - } - - if (available == 0) - { - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInBytes); - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - if (mbcs_error) - { - _SAFECRT__SET_ERRNO(EILSEQ); return EILSEQ; - } - else - { - return 0; - } -} - -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - /* _strnset_s */ /* * _strnset_s, _wcsnset_s ; @@ -1766,367 +1033,92 @@ errno_t __cdecl _strnset_s(char (&_Dst)[_SizeInBytes], int _Value, size_t _Count _SAFECRT__INLINE errno_t __cdecl _strnset_s(char *_Dst, size_t _SizeInBytes, int _Value, size_t _Count) -{ - char *p; - size_t available; - - /* validation section */ - if (_Count == 0 && _Dst == nullptr && _SizeInBytes == 0) - { - /* this case is allowed; nothing to do */ - return 0; - } - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - - p = _Dst; - available = _SizeInBytes; - while (*p != 0 && _Count > 0 && --available > 0) - { - *p++ = (char)_Value; - --_Count; - } - - if (available == 0) - { - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInBytes); - } - if (_Count == 0) - { - *p = 0; - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - return 0; -} - -#endif - -/* _wcsnset_s */ -_SAFECRT__EXTERN_C -errno_t __cdecl _wcsnset_s(WCHAR *_Dst, size_t _SizeInWords, WCHAR _Value, size_t _Count); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _wcsnset_s(WCHAR (&_Dst)[_SizeInWords], WCHAR _Value, size_t _Count) -{ - return _wcsnset_s(_Dst, _SizeInWords, _Value, _Count); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _wcsnset_s(WCHAR *_Dst, size_t _SizeInWords, WCHAR _Value, size_t _Count) -{ - WCHAR *p; - size_t available; - - /* validation section */ - if (_Count == 0 && _Dst == nullptr && _SizeInWords == 0) - { - /* this case is allowed; nothing to do */ - return 0; - } - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInWords); - - p = _Dst; - available = _SizeInWords; - while (*p != 0 && _Count > 0 && --available > 0) - { - *p++ = (WCHAR)_Value; - --_Count; - } - - if (available == 0) - { - _SAFECRT__RESET_STRING(_Dst, _SizeInWords); - _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInWords); - } - if (_Count == 0) - { - *p = 0; - } - _SAFECRT__FILL_STRING(_Dst, _SizeInWords, _SizeInWords - available + 1); - return 0; -} - -#endif - -/* _mbsnbset_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbsnbset_s(unsigned char *_Dst, size_t _SizeInBytes, unsigned int _Value, size_t _CountInBytes); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbsnbset_s(unsigned char (&_Dst)[_SizeInBytes], unsigned int _Value, size_t _CountInBytes) -{ - return _mbsnbset_s(_Dst, _SizeInBytes, _Value, _CountInBytes); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbsnbset_s(unsigned char *_Dst, size_t _SizeInBytes, unsigned int _Value, size_t _CountInBytes) -{ - int mbcs_error = 0; - unsigned char *p; - size_t available; - unsigned char highval, lowval; - - /* validation section */ - if (_CountInBytes == 0 && _Dst == nullptr && _SizeInBytes == 0) - { - /* this case is allowed; nothing to do */ - return 0; - } - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - - p = _Dst; - available = _SizeInBytes; - highval = (unsigned char)(_Value >> 8); - lowval = (unsigned char)(_Value & 0x00ff); - if (highval != 0) - { - if (_SAFECRT__ISMBBLEAD(highval) && lowval != 0) - { - while (*p != 0 && _CountInBytes > 0 && --available > 0) - { - if (_CountInBytes == 1 || p[1] == 0) - { - /* do not orphan leadbyte */ - *p++ = ' '; - --_CountInBytes; - break; - } - *p++ = highval; - if (--available == 0) - { - break; - } - *p++ = lowval; - _CountInBytes -= 2; - } - } - else - { - mbcs_error = 1; - highval = 0; - lowval = ' '; - } - } - else - { - if (_SAFECRT__ISMBBLEAD(lowval)) - { - mbcs_error = 1; - lowval = ' '; - } - } - if (highval == 0) - { - while (*p != 0 && available > 0 && _CountInBytes > 0) - { - *p++ = lowval; - --available; - --_CountInBytes; - } - } - if (available == 0) - { - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInBytes); - } - if (_CountInBytes == 0) - { - *p = 0; - } - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - if (mbcs_error) - { - _SAFECRT__SET_ERRNO(EILSEQ); return EILSEQ; - } - else - { - return 0; - } -} - -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - -/* _mbsnset_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -errno_t __cdecl _mbsnset_s(unsigned char *_Dst, size_t _SizeInBytes, unsigned int _Value, size_t _CountInChars); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _mbsnset_s(unsigned char (&_Dst)[_SizeInBytes], unsigned int _Value, size_t _CountInChars) -{ - return _mbsnset_s(_Dst, _SizeInBytes, _Value, _CountInChars); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _mbsnset_s(unsigned char *_Dst, size_t _SizeInBytes, unsigned int _Value, size_t _CountInChars) -{ - int mbcs_error = 0; - unsigned char *p; - size_t available; - unsigned char highval, lowval; - - /* validation section */ - if (_CountInChars == 0 && _Dst == nullptr && _SizeInBytes == 0) - { - /* this case is allowed; nothing to do */ - return 0; - } - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - - p = _Dst; - available = _SizeInBytes; - highval = (unsigned char)(_Value >> 8); - lowval = (unsigned char)(_Value & 0x00ff); - if (highval != 0) - { - if (_SAFECRT__ISMBBLEAD(highval) && lowval != 0) - { - while (*p != 0 && _CountInChars > 0 && --available > 0) - { - if (p[1] == 0) - { - /* do not orphan leadbyte */ - *p++ = ' '; - break; - } - *p++ = highval; - if (--available == 0) - { - break; - } - *p++ = lowval; - --_CountInChars; - } - } - else - { - mbcs_error = 1; - highval = 0; - lowval = ' '; - } - } - else +{ + char *p; + size_t available; + + /* validation section */ + if (_Count == 0 && _Dst == nullptr && _SizeInBytes == 0) { - if (_SAFECRT__ISMBBLEAD(lowval)) - { - mbcs_error = 1; - lowval = ' '; - } + /* this case is allowed; nothing to do */ + return 0; } - if (highval == 0) + _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); + + p = _Dst; + available = _SizeInBytes; + while (*p != 0 && _Count > 0 && --available > 0) { - while (*p != 0 && available > 0 && _CountInChars > 0) - { - *p++ = lowval; - --available; - --_CountInChars; - } + *p++ = (char)_Value; + --_Count; } + if (available == 0) { _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInBytes); } - if (_CountInChars == 0) + if (_Count == 0) { *p = 0; } _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, _SizeInBytes - available + 1); - if (mbcs_error) - { - _SAFECRT__SET_ERRNO(EILSEQ); return EILSEQ; - } - else - { - return 0; - } + return 0; } #endif -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - -/* _mbccpy_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - +/* _wcsnset_s */ _SAFECRT__EXTERN_C -errno_t __cdecl _mbccpy_s(unsigned char *_Dst, size_t _SizeInBytes, int *_PCopied, const unsigned char *_Src); +errno_t __cdecl _wcsnset_s(WCHAR *_Dst, size_t _SizeInWords, WCHAR _Value, size_t _Count); #if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template +template inline -errno_t __cdecl _mbccpy_s(unsigned char (&_Dst)[_SizeInBytes], int *_PCopied, const unsigned char *_Src) +errno_t __cdecl _wcsnset_s(WCHAR (&_Dst)[_SizeInWords], WCHAR _Value, size_t _Count) { - return _mbccpy_s(_Dst, _SizeInBytes, _PCopied, _Src); + return _wcsnset_s(_Dst, _SizeInWords, _Value, _Count); } #endif #if _SAFECRT_USE_INLINES || _SAFECRT_IMPL _SAFECRT__INLINE -errno_t __cdecl _mbccpy_s(unsigned char *_Dst, size_t _SizeInBytes, int *_PCopied, const unsigned char *_Src) +errno_t __cdecl _wcsnset_s(WCHAR *_Dst, size_t _SizeInWords, WCHAR _Value, size_t _Count) { + WCHAR *p; + size_t available; + /* validation section */ - if (_PCopied != nullptr) { *_PCopied = 0; }; - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - if (_Src == nullptr) + if (_Count == 0 && _Dst == nullptr && _SizeInWords == 0) { - *_Dst = '\0'; - _SAFECRT__RETURN_EINVAL; + /* this case is allowed; nothing to do */ + return 0; } + _SAFECRT__VALIDATE_STRING(_Dst, _SizeInWords); - /* copy */ - if (_SAFECRT__ISMBBLEAD(*_Src)) + p = _Dst; + available = _SizeInWords; + while (*p != 0 && _Count > 0 && --available > 0) { - if (_Src[1] == '\0') - { - /* the source string contained a lead byte followed by the null terminator: - we copy only the null terminator and return EILSEQ to indicate the - malformed char */ - *_Dst = '\0'; - if (_PCopied != nullptr) { *_PCopied = 1; }; - _SAFECRT__SET_ERRNO(EILSEQ); return EILSEQ; - } - if (_SizeInBytes < 2) - { - *_Dst = '\0'; - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Dst, _SizeInBytes); - } - *_Dst++ = *_Src++; - *_Dst = *_Src; - if (_PCopied != nullptr) { *_PCopied = 2; }; + *p++ = (WCHAR)_Value; + --_Count; } - else + + if (available == 0) { - *_Dst = *_Src; - if (_PCopied != nullptr) { *_PCopied = 1; }; + _SAFECRT__RESET_STRING(_Dst, _SizeInWords); + _SAFECRT__RETURN_DEST_NOT_NULL_TERMINATED(_Dst, _SizeInWords); } - + if (_Count == 0) + { + *p = 0; + } + _SAFECRT__FILL_STRING(_Dst, _SizeInWords, _SizeInWords - available + 1); return 0; } -#endif -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ +#endif /* strtok_s */ /* @@ -2275,129 +1267,6 @@ WCHAR * __cdecl wcstok_s(WCHAR *_String, const WCHAR *_Control, WCHAR **_Context } #endif -/* _mbstok_s */ -#if _SAFECRT_DEFINE_MBS_FUNCTIONS - -_SAFECRT__EXTERN_C -unsigned char * __cdecl _mbstok_s(unsigned char *_String, const unsigned char *_Control, unsigned char **_Context); - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -unsigned char * __cdecl _mbstok_s(unsigned char *_String, const unsigned char *_Control, unsigned char **_Context) -{ - unsigned char *token; - const unsigned char *ctl; - int dbc; - - /* validation section */ - _SAFECRT__VALIDATE_POINTER_ERROR_RETURN(_Context, EINVAL, nullptr); - _SAFECRT__VALIDATE_POINTER_ERROR_RETURN(_Control, EINVAL, nullptr); - _SAFECRT__VALIDATE_CONDITION_ERROR_RETURN(_String != nullptr || *_Context != nullptr, EINVAL, nullptr); - - /* If string==nullptr, continue with previous string */ - if (!_String) - { - _String = *_Context; - } - - /* Find beginning of token (skip over leading delimiters). Note that - * there is no token iff this loop sets string to point to the terminal null. */ - for ( ; *_String != 0; _String++) - { - for (ctl = _Control; *ctl != 0; ctl++) - { - if (_SAFECRT__ISMBBLEAD(*ctl)) - { - if (*ctl == *_String && (ctl[1] == 0 || ctl[1] == _String[1])) - { - break; - } - ctl++; - } - else - { - if (*ctl == *_String) - { - break; - } - } - } - if (*ctl == 0) - { - break; - } - if (_SAFECRT__ISMBBLEAD(*_String)) - { - _String++; - if (*_String == 0) - { - break; - } - } - } - - token = _String; - - /* Find the end of the token. If it is not the end of the string, - * put a null there. */ - for ( ; *_String != 0; _String++) - { - for (ctl = _Control, dbc = 0; *ctl != 0; ctl++) - { - if (_SAFECRT__ISMBBLEAD(*ctl)) - { - if (*ctl == *_String && (ctl[1] == 0 || ctl[1] == _String[1])) - { - dbc = 1; - break; - } - ctl++; - } - else - { - if (*ctl == *_String) - { - break; - } - } - } - if (*ctl != 0) - { - *_String++ = 0; - if (dbc && ctl[1] != 0) - { - *_String++ = 0; - } - break; - } - if (_SAFECRT__ISMBBLEAD(*_String)) - { - _String++; - if (*_String == 0) - { - break; - } - } - } - - /* Update the context */ - *_Context = _String; - - /* Determine if a token has been found. */ - if (token == _String) - { - return nullptr; - } - else - { - return token; - } -} -#endif - -#endif /* _SAFECRT_DEFINE_MBS_FUNCTIONS */ - #ifndef PAL_STDCPP_COMPAT /* strnlen */ /* @@ -2432,142 +1301,23 @@ size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize); #if _SAFECRT_USE_INLINES || _SAFECRT_IMPL -_SAFECRT__INLINE -size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize) -{ - size_t n; - - /* Note that we do not check if s == nullptr, because we do not - * return errno_t... - */ - - for (n = 0; n < inMaxSize && *inString; n++, inString++) - ; - - return n; -} - -#endif -#endif // PAL_STDCPP_COMPAT - -/* _makepath_s */ -/* - * _makepath_s, _wmakepath_s build up a path starting from the specified components; - * will call _SAFECRT_INVALID_PARAMETER if there is not enough space in _Dst; - * any of _Drive, _Dir, _Filename and _Ext can be nullptr - */ -_SAFECRT__EXTERN_C -errno_t __cdecl _makepath_s(char *_Dst, size_t _SizeInBytes, const char *_Drive, const char *_Dir, const char *_Filename, const char *_Ext); - -#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -errno_t __cdecl _makepath_s(char (&_Dst)[_SizeInBytes], const char *_Drive, const char *_Dir, const char *_Filename, const char *_Ext) -{ - return _makepath_s(_Dst, _SizeInBytes, _Drive, _Dir, _Filename, _Ext); -} -#endif - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _makepath_s(char *_Dst, size_t _SizeInBytes, const char *_Drive, const char *_Dir, const char *_Filename, const char *_Ext) -{ - size_t written; - const char *p; - char *d; - - /* validation section */ - _SAFECRT__VALIDATE_STRING(_Dst, _SizeInBytes); - - /* copy drive */ - written = 0; - d = _Dst; - if (_Drive != nullptr && *_Drive != 0) - { - written += 2; - if(written >= _SizeInBytes) - { - goto error_return; - } - *d++ = *_Drive; - *d++ = ':'; - } - - /* copy dir */ - p = _Dir; - if (p != nullptr && *p != 0) - { - do { - if(++written >= _SizeInBytes) - { - goto error_return; - } - *d++ = *p++; - } while (*p != 0); - - p = (const char *)_SAFECRT__MBSDEC((const unsigned char *)_Dir, (const unsigned char *)p); - if (*p != '/' && *p != '\\') - { - if(++written >= _SizeInBytes) - { - goto error_return; - } - *d++ = '\\'; - } - } - - /* copy fname */ - p = _Filename; - if (p != nullptr) - { - while (*p != 0) - { - if(++written >= _SizeInBytes) - { - goto error_return; - } - *d++ = *p++; - } - } - - /* copy extension; check to see if a '.' needs to be inserted */ - p = _Ext; - if (p != nullptr) - { - if (*p != 0 && *p != '.') - { - if(++written >= _SizeInBytes) - { - goto error_return; - } - *d++ = '.'; - } - while (*p != 0) - { - if(++written >= _SizeInBytes) - { - goto error_return; - } - *d++ = *p++; - } - } - - if(++written > _SizeInBytes) - { - goto error_return; - } - *d = 0; - _SAFECRT__FILL_STRING(_Dst, _SizeInBytes, written); - return 0; +_SAFECRT__INLINE +size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize) +{ + size_t n; -error_return: - _SAFECRT__RESET_STRING(_Dst, _SizeInBytes); - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Dst, _SizeInBytes); - /* should never happen, but compiler can't tell */ - return EINVAL; + /* Note that we do not check if s == nullptr, because we do not + * return errno_t... + */ + + for (n = 0; n < inMaxSize && *inString; n++, inString++) + ; + + return n; } + #endif +#endif // PAL_STDCPP_COMPAT /* _wmakepath_s */ _SAFECRT__EXTERN_C @@ -2683,245 +1433,6 @@ errno_t __cdecl _wmakepath_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Dri } #endif -/* _splitpath_s */ -/* - * _splitpath_s, _wsplitpath_s decompose a path into the specified components; - * will call _SAFECRT_INVALID_PARAMETER if there is not enough space in - * any of _Drive, _Dir, _Filename and _Ext; - * any of _Drive, _Dir, _Filename and _Ext can be nullptr, but the correspondent size must - * be set to 0, e.g. (_Drive == nullptr && _DriveSize == 0) is allowed, but - * (_Drive == nullptr && _DriveSize != 0) is considered an invalid parameter - */ -_SAFECRT__EXTERN_C -errno_t __cdecl _splitpath_s( - const char *_Path, - char *_Drive, size_t _DriveSize, - char *_Dir, size_t _DirSize, - char *_Filename, size_t _FilenameSize, - char *_Ext, size_t _ExtSize -); - -/* no C++ overload for _splitpath_s */ - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _splitpath_s( - const char *_Path, - char *_Drive, size_t _DriveSize, - char *_Dir, size_t _DirSize, - char *_Filename, size_t _FilenameSize, - char *_Ext, size_t _ExtSize -) -{ - const char *tmp; - const char *last_slash; - const char *dot; - int drive_set = 0; - size_t length = 0; - int bEinval = 0; - - /* validation section */ - _SAFECRT__VALIDATE_POINTER(_Path); - if ((_Drive == nullptr && _DriveSize != 0) || (_Drive != nullptr && _DriveSize == 0)) - { - goto error_einval; - } - if ((_Dir == nullptr && _DirSize != 0) || (_Dir != nullptr && _DirSize == 0)) - { - goto error_einval; - } - if ((_Filename == nullptr && _FilenameSize != 0) || (_Filename != nullptr && _FilenameSize == 0)) - { - goto error_einval; - } - if ((_Ext == nullptr && _ExtSize != 0) || (_Ext != nullptr && _ExtSize == 0)) - { - goto error_einval; - } - - /* check if _Path begins with the longpath prefix */ - if (_Path[0] == '\\' && _Path[1] == '\\' && _Path[2] == '?' && _Path[3] == '\\') - { - _Path += 4; - } - - /* extract drive letter and ':', if any */ - if (!drive_set) - { - size_t skip = _MAX_DRIVE - 2; - tmp = _Path; - while (skip > 0 && *tmp != 0) - { - skip--; - tmp++; - } - if (*tmp == ':') - { - if (_Drive != nullptr) - { - if (_DriveSize < _MAX_DRIVE) - { - goto error_erange; - } - strncpy_s(_Drive, _DriveSize, _Path, _MAX_DRIVE - 1); - } - _Path = tmp + 1; - } - else - { - if (_Drive != nullptr) - { - _SAFECRT__RESET_STRING(_Drive, _DriveSize); - } - } - } - - /* extract path string, if any. _Path now points to the first character - * of the path, if any, or the filename or extension, if no path was - * specified. Scan ahead for the last occurence, if any, of a '/' or - * '\' path separator character. If none is found, there is no path. - * We will also note the last '.' character found, if any, to aid in - * handling the extension. - */ - last_slash = nullptr; - dot = nullptr; - tmp = _Path; - for (; *tmp != 0; ++tmp) - { -#if _SAFECRT_DEFINE_MBS_FUNCTIONS -#pragma warning(push) -#pragma warning(disable:4127) - if (_SAFECRT__ISMBBLEAD(*tmp)) -#pragma warning(pop) -#else - if (0) -#endif - { - tmp++; - } - else - { - if (*tmp == '/' || *tmp == '\\') - { - /* point to one beyond for later copy */ - last_slash = tmp + 1; - } - else if (*tmp == '.') - { - dot = tmp; - } - } - } - - if (last_slash != nullptr) - { - /* found a path - copy up through last_slash or max characters - * allowed, whichever is smaller - */ - if (_Dir != nullptr) { - length = (size_t)(last_slash - _Path); - if (_DirSize <= length) - { - goto error_erange; - } - strncpy_s(_Dir, _DirSize, _Path, length); - } - _Path = last_slash; - } - else - { - /* there is no path */ - if (_Dir != nullptr) - { - _SAFECRT__RESET_STRING(_Dir, _DirSize); - } - } - - /* extract file name and extension, if any. Path now points to the - * first character of the file name, if any, or the extension if no - * file name was given. Dot points to the '.' beginning the extension, - * if any. - */ - if (dot != nullptr && (dot >= _Path)) - { - /* found the marker for an extension - copy the file name up to the '.' */ - if (_Filename) - { - length = (size_t)(dot - _Path); - if (_FilenameSize <= length) - { - goto error_erange; - } - strncpy_s(_Filename, _FilenameSize, _Path, length); - } - /* now we can get the extension - remember that tmp still points - * to the terminating nullptr character of path. - */ - if (_Ext) - { - length = (size_t)(tmp - dot); - if (_ExtSize <= length) - { - goto error_erange; - } - strncpy_s(_Ext, _ExtSize, dot, length); - } - } - else - { - /* found no extension, give empty extension and copy rest of - * string into fname. - */ - if (_Filename) - { - length = (size_t)(tmp - _Path); - if (_FilenameSize <= length) - { - goto error_erange; - } - strncpy_s(_Filename, _FilenameSize, _Path, length); - } - if (_Ext) - { - _SAFECRT__RESET_STRING(_Ext, _ExtSize); - } - } - - return 0; - -error_einval: - bEinval = 1; - -error_erange: - if (_Drive != nullptr && _DriveSize > 0) - { - _SAFECRT__RESET_STRING(_Drive, _DriveSize); - } - if (_Dir != nullptr && _DirSize > 0) - { - _SAFECRT__RESET_STRING(_Dir, _DirSize); - } - if (_Filename != nullptr && _FilenameSize > 0) - { - _SAFECRT__RESET_STRING(_Filename, _FilenameSize); - } - if (_Ext != nullptr && _ExtSize > 0) - { - _SAFECRT__RESET_STRING(_Ext, _ExtSize); - } - - if (bEinval) - { - _SAFECRT__RETURN_EINVAL; - } - - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Strings, _StringSizes); - /* should never happen, but compiler can't tell */ - return EINVAL; -} -#endif - /* _wsplitpath_s */ _SAFECRT__EXTERN_C errno_t __cdecl _wsplitpath_s( @@ -3010,7 +1521,7 @@ errno_t __cdecl _wsplitpath_s( /* extract path string, if any. _Path now points to the first character * of the path, if any, or the filename or extension, if no path was - * specified. Scan ahead for the last occurence, if any, of a '/' or + * specified. Scan ahead for the last occurrence, if any, of a '/' or * '\' path separator character. If none is found, there is no path. * We will also note the last '.' character found, if any, to aid in * handling the extension. @@ -3141,9 +1652,9 @@ errno_t __cdecl _wsplitpath_s( } #endif -/* sprintf_s, vsprintf_s */ +/* vsprintf_s */ /* - * sprintf_s, swprintf_s, vsprintf_s, vswprintf_s format a string and copy it into _Dst; + * swprintf_s, vsprintf_s, vswprintf_s format a string and copy it into _Dst; * need safecrt.lib and msvcrt.dll; * will call _SAFECRT_INVALID_PARAMETER if there is not enough space in _Dst; * will call _SAFECRT_INVALID_PARAMETER if the format string is malformed; @@ -3154,23 +1665,9 @@ errno_t __cdecl _wsplitpath_s( * cannot be used without safecrt.lib */ _SAFECRT__EXTERN_C -int __cdecl sprintf_s(char *_Dst, size_t _SizeInBytes, const char *_Format, ...); -_SAFECRT__EXTERN_C int __cdecl vsprintf_s(char *_Dst, size_t _SizeInBytes, const char *_Format, va_list _ArgList); #if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -int __cdecl sprintf_s(char (&_Dst)[_SizeInBytes], const char *_Format, ...) -{ - int ret; - va_list _ArgList; - va_start(_ArgList, _Format); - ret = vsprintf_s(_Dst, _SizeInBytes, _Format, _ArgList); - va_end(_ArgList); - return ret; -} - template inline int __cdecl vsprintf_s(char (&_Dst)[_SizeInBytes], const char *_Format, va_list _ArgList) @@ -3179,7 +1676,7 @@ int __cdecl vsprintf_s(char (&_Dst)[_SizeInBytes], const char *_Format, va_list } #endif -/* no inline version of sprintf_s, vsprintf_s */ +/* no inline version of vsprintf_s */ /* swprintf_s, vswprintf_s */ _SAFECRT__EXTERN_C @@ -3210,9 +1707,9 @@ int __cdecl vswprintf_s(WCHAR (&_Dst)[_SizeInWords], const WCHAR *_Format, va_li /* no inline version of swprintf_s, vswprintf_s */ -/* _snprintf_s, _vsnprintf_s */ +/* _vsnprintf_s */ /* - * _snprintf_s, _snwprintf_s, _vsnprintf_s, _vsnwprintf_s format a string and copy at max _Count characters into _Dst; + * _snwprintf_s, _vsnprintf_s, _vsnwprintf_s format a string and copy at max _Count characters into _Dst; * need safecrt.lib and msvcrt.dll; * string _Dst will always be null-terminated; * will call _SAFECRT_INVALID_PARAMETER if there is not enough space in _Dst; @@ -3228,18 +1725,6 @@ int __cdecl vswprintf_s(WCHAR (&_Dst)[_SizeInWords], const WCHAR *_Format, va_li */ #if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS -template -inline -int __cdecl _snprintf_s(char (&_Dst)[_SizeInBytes], size_t _Count, const char *_Format, ...) -{ - int ret; - va_list _ArgList; - va_start(_ArgList, _Format); - ret = _vsnprintf_s(_Dst, _SizeInBytes, _Count, _Format, _ArgList); - va_end(_ArgList); - return ret; -} - template inline int __cdecl _vsnprintf_s(char (&_Dst)[_SizeInBytes], size_t _Count, const char *_Format, va_list _ArgList) @@ -3248,7 +1733,7 @@ int __cdecl _vsnprintf_s(char (&_Dst)[_SizeInBytes], size_t _Count, const char * } #endif -/* no inline version of _snprintf_s, _vsnprintf_s */ +/* no inline version of _vsnprintf_s */ /* _snwprintf_s, _vsnwprintf_s */ _SAFECRT__EXTERN_C @@ -3277,27 +1762,6 @@ int __cdecl _vsnwprintf_s(char (&_Dst)[_SizeInWords], size_t _Count, const char /* no inline version of _snwprintf_s, _vsnwprintf_s */ -/* scanf_s */ -/* - * read formatted data from the standard input stream; - * need safecrt.lib and msvcrt.dll; - * will call _SAFECRT_INVALID_PARAMETER if the format string is malformed; - * for format types %s, %S, %[, %c and %C, in the argument list the buffer pointer - * need to be followed by the size of the buffer, e.g.: - * #define BUFFSIZE 100 - * char buff[BUFFSIZE]; - * scanf_s("%s", buff, BUFFSIZE); - * as scanf, returns the number of fields successfully converted and assigned; - * if a buffer field is too small, scanf set the buffer to the empty string and returns. - * do not support floating-point, for now - */ -_SAFECRT__EXTERN_C -int __cdecl scanf_s(const char *_Format, ...); - -/* no C++ overload for scanf_s */ - -/* no inline version of scanf_s */ - /* wscanf_s */ _SAFECRT__EXTERN_C int __cdecl wscanf_s(const WCHAR *_Format, ...); @@ -3306,14 +1770,6 @@ int __cdecl wscanf_s(const WCHAR *_Format, ...); /* no inline version of wscanf_s */ -/* sscanf_s */ -_SAFECRT__EXTERN_C -int __cdecl sscanf_s(const char *_String, const char *_Format, ...); - -/* no C++ overload for sscanf_s */ - -/* no inline version of sscanf_s */ - /* swscanf_s */ _SAFECRT__EXTERN_C int __cdecl swscanf_s(const WCHAR *_String, const WCHAR *_Format, ...); diff --git a/src/coreclr/src/pal/inc/rt/sal.h b/src/coreclr/src/pal/inc/rt/sal.h index 9f7c014b792e..88991ce4464e 100644 --- a/src/coreclr/src/pal/inc/rt/sal.h +++ b/src/coreclr/src/pal/inc/rt/sal.h @@ -2339,7 +2339,7 @@ typedef struct __F_ __F_; __blocksOn(resource) f : Function f blocks on the resource 'resource'. - __fallthrough : + FALLTHROUGH : Annotates switch statement labels where fall-through is desired, to distinguish from forgotten break statements. @@ -2586,8 +2586,6 @@ extern "C" { #define __inner_override _SA_annotes0(__override) #define __inner_callback _SA_annotes0(__callback) #define __inner_blocksOn(resource) _SA_annotes1(SAL_blocksOn, resource) - #define __inner_fallthrough_dec __inline __nothrow void __FallThrough() {} - #define __inner_fallthrough __FallThrough(); #define __post_except_maybenull __post __inner_exceptthat _Maybenull_impl_ #define __pre_except_maybenull __pre __inner_exceptthat _Maybenull_impl_ @@ -2626,8 +2624,6 @@ extern "C" { #define __inner_override #define __inner_callback #define __inner_blocksOn(resource) - #define __inner_fallthrough_dec - #define __inner_fallthrough #define __refparam #define __inner_control_entrypoint(category) #define __inner_data_entrypoint(category) @@ -2873,8 +2869,11 @@ of each annotation, see the advanced annotations section. #define __on_failure(annotes) _On_failure_impl_(annotes _SAL_nop_impl_) #ifndef __fallthrough // [ - __inner_fallthrough_dec - #define __fallthrough __inner_fallthrough +#if __has_cpp_attribute(fallthrough) +#define __fallthrough [[fallthrough]] +#else +#define __fallthrough +#endif #endif // ] #ifndef __analysis_assume // [ diff --git a/src/coreclr/src/pal/inc/rt/specstrings_adt.h b/src/coreclr/src/pal/inc/rt/specstrings_adt.h deleted file mode 100644 index 06eab8c0ab75..000000000000 --- a/src/coreclr/src/pal/inc/rt/specstrings_adt.h +++ /dev/null @@ -1,57 +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 once -/************************************************************************* -* DEFINITIONS OF NEW TYPES -*************************************************************************/ -#if !defined(__midl) -#define __$compname_props \ - __type_has_adt_prop(compname,nullterminated) \ - __type_has_adt_prop(compname,valid_schars) \ - __type_has_adt_prop(compname,correct_len) \ - __nullterminated -#if defined(UNICODE) || defined(_UNICODE) -#define __$TCHAR unsigned short -#else -#define __$TCHAR char -#endif -// DEVDIV: Windows SDK Vista RTM update: Ignore C4956 warning when compiling with /clr:safe flag -#ifdef _MSC_VER -#pragma warning( disable : 4956 ) -#endif // _MSC_VER -typedef __$compname_props char* ValidCompNameA; -typedef __$compname_props unsigned short* ValidCompNameW; -typedef __$compname_props const unsigned short* ConstValidCompNameW; -typedef __$compname_props __$TCHAR* SAL_ValidCompNameT; -typedef __$compname_props const __$TCHAR* SAL_ConstValidCompNameT; -#ifdef _MSC_VER -#pragma warning(default:4956) -#endif // _MSC_VER -#undef __$compname_props -#undef __$TCHAR -#endif - -/************************************************************************* -* DEFINITIONS OF INLINE FUNCTIONS FOR CASTING TO THE NEW TYPES : USER -*************************************************************************/ -#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_) -#ifdef __cplusplus -extern "C" { -#endif -void __inline __nothrow __SAL_ValidCompNameA(__out_has_type_adt_props(ValidCompNameA) const void *expr) { expr;} -void __inline __nothrow __SAL_ValidCompNameW(__out_has_type_adt_props(ValidCompNameW) const void *expr) { expr;} -#ifdef __cplusplus -} -#endif -#define __assume_ValidCompNameA(expr) __SAL_ValidCompNameA(expr) -#define __assume_ValidCompNameW(expr) __SAL_ValidCompNameW(expr) -#else -#define __assume_ValidCompNameA(expr) -#define __assume_ValidCompNameW(expr) -#endif - - diff --git a/src/coreclr/src/pal/inc/rt/specstrings_undef.h b/src/coreclr/src/pal/inc/rt/specstrings_undef.h index 0008f2278598..b0e1848c5eb8 100644 --- a/src/coreclr/src/pal/inc/rt/specstrings_undef.h +++ b/src/coreclr/src/pal/inc/rt/specstrings_undef.h @@ -336,8 +336,6 @@ #undef __inner_data_entrypoint #undef __inner_data_source #undef __inner_encoded -#undef __inner_fallthrough -#undef __inner_fallthrough_dec #undef __inner_nonvolatile #undef __inner_out_validated #undef __inner_override diff --git a/src/coreclr/src/pal/inc/rt/symcrypt.h b/src/coreclr/src/pal/inc/rt/symcrypt.h deleted file mode 100644 index 88ac20b5426b..000000000000 --- a/src/coreclr/src/pal/inc/rt/symcrypt.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: symcrypt.h -// -// =========================================================================== -// dummy symcrypt.h for PAL - -#include "palrt.h" diff --git a/src/coreclr/src/pal/inc/rt/x86intrin.h b/src/coreclr/src/pal/inc/rt/x86intrin.h deleted file mode 100644 index c88e9fc6e471..000000000000 --- a/src/coreclr/src/pal/inc/rt/x86intrin.h +++ /dev/null @@ -1 +0,0 @@ -#include "xmmintrin.h" diff --git a/src/coreclr/src/pal/inc/unixasmmacrosarm64.inc b/src/coreclr/src/pal/inc/unixasmmacrosarm64.inc index 69cdcb3f48ba..9545afb9f8e5 100644 --- a/src/coreclr/src/pal/inc/unixasmmacrosarm64.inc +++ b/src/coreclr/src/pal/inc/unixasmmacrosarm64.inc @@ -4,7 +4,11 @@ .macro NESTED_ENTRY Name, Section, Handler LEAF_ENTRY \Name, \Section .ifnc \Handler, NoHandler +#if defined(__APPLE__) + .cfi_personality 0x9b, C_FUNC(\Handler) // 0x9b == DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4 +#else .cfi_personality 0x1b, C_FUNC(\Handler) // 0x1b == DW_EH_PE_pcrel | DW_EH_PE_sdata4 +#endif .endif .endm @@ -19,13 +23,20 @@ C_FUNC(\Name): .macro LEAF_ENTRY Name, Section .global C_FUNC(\Name) +#if defined(__APPLE__) + .text + .p2align 2 +#else .type \Name, %function +#endif C_FUNC(\Name): .cfi_startproc .endm .macro LEAF_END Name, Section +#if !defined(__APPLE__) .size \Name, .-\Name +#endif .cfi_endproc .endm @@ -36,8 +47,13 @@ C_FUNC(\Name\()_End): .endm .macro PREPARE_EXTERNAL_VAR Name, HelperReg - adrp \HelperReg, \Name - add \HelperReg, \HelperReg, :lo12:\Name +#if defined(__APPLE__) + adrp \HelperReg, C_FUNC(\Name)@GOTPAGE + ldr \HelperReg, [\HelperReg, C_FUNC(\Name)@GOTPAGEOFF] +#else + adrp \HelperReg, C_FUNC(\Name) + add \HelperReg, \HelperReg, :lo12:C_FUNC(\Name) +#endif .endm .macro PROLOG_STACK_ALLOC Size diff --git a/src/coreclr/src/pal/prebuilt/corerror/mscorurt.rc b/src/coreclr/src/pal/prebuilt/corerror/mscorurt.rc index f51e77ae1245..783d1adafb10 100644 --- a/src/coreclr/src/pal/prebuilt/corerror/mscorurt.rc +++ b/src/coreclr/src/pal/prebuilt/corerror/mscorurt.rc @@ -314,14 +314,13 @@ BEGIN MSG_FOR_URT_HR(CORDBG_E_UNSUPPORTED_DELEGATE) "The delegate contains a delegate currently not supported by the API." MSG_FOR_URT_HR(PEFMT_E_64BIT) "File is PE32+." MSG_FOR_URT_HR(PEFMT_E_32BIT) "File is PE32" - MSG_FOR_URT_HR(NGEN_E_SYS_ASM_NI_MISSING) "NGen cannot proceed because Mscorlib.dll does not have a native image" MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW) "The bound assembly has a version that is lower than that of the request." MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH) "The assembly version has a public key token that does not match that of the request." MSG_FOR_URT_HR(CLR_E_BIND_IMAGE_UNAVAILABLE) "The requested image was not found or is unavailable." MSG_FOR_URT_HR(CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT) "The provided identity format is not recognized." MSG_FOR_URT_HR(CLR_E_BIND_ASSEMBLY_NOT_FOUND) "A binding for the specified assembly name was not found." MSG_FOR_URT_HR(CLR_E_BIND_TYPE_NOT_FOUND) "A binding for the specified type name was not found." - MSG_FOR_URT_HR(CLR_E_BIND_SYS_ASM_NI_MISSING) "Could not use native image because Mscorlib.dll is missing a native image" + MSG_FOR_URT_HR(CLR_E_BIND_SYS_ASM_NI_MISSING) "Could not use native image because System.Private.CoreLib.dll is missing a native image" MSG_FOR_URT_HR(CLR_E_BIND_NI_SECURITY_FAILURE) "Native image was generated in a different trust level than present at runtime" MSG_FOR_URT_HR(CLR_E_BIND_NI_DEP_IDENTITY_MISMATCH) "Native image identity mismatch with respect to its dependencies" MSG_FOR_URT_HR(CLR_E_GC_OOM) "Failfast due to an OOM during a GC" diff --git a/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp b/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp index 85d7ab575a51..5208843c10eb 100644 --- a/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp +++ b/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp @@ -8,7 +8,7 @@ /* File created by MIDL compiler version 8.01.0622 */ /* at Mon Jan 18 19:14:07 2038 */ -/* Compiler settings for E:/repos/runtime2/src/coreclr/src/inc/cordebug.idl: +/* Compiler settings for runtime/src/coreclr/src/inc/cordebug.idl: Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data @@ -289,6 +289,9 @@ MIDL_DEFINE_GUID(IID, IID_ICorDebugNativeFrame2,0x35389FF1,0x3684,0x4c55,0xA2,0x MIDL_DEFINE_GUID(IID, IID_ICorDebugModule3,0x86F012BF,0xFF15,0x4372,0xBD,0x30,0xB6,0xF1,0x1C,0xAA,0xE1,0xDD); +MIDL_DEFINE_GUID(IID, IID_ICorDebugModule4,0xFF8B8EAF,0x25CD,0x4316,0x88,0x59,0x84,0x41,0x6D,0xE4,0x40,0x2E); + + MIDL_DEFINE_GUID(IID, IID_ICorDebugRuntimeUnwindableFrame,0x879CAC0A,0x4A53,0x4668,0xB8,0xE3,0xCB,0x84,0x73,0xCB,0x18,0x7F); diff --git a/src/coreclr/src/pal/prebuilt/idl/sospriv_i.cpp b/src/coreclr/src/pal/prebuilt/idl/sospriv_i.cpp index ee2cd1d82010..44e6f3ca739e 100644 --- a/src/coreclr/src/pal/prebuilt/idl/sospriv_i.cpp +++ b/src/coreclr/src/pal/prebuilt/idl/sospriv_i.cpp @@ -105,6 +105,10 @@ MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface8,0xc12f35a9,0xe55c,0x4520,0xa8,0x94,0 MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface9,0x4eca42d8,0x7e7b,0x4c8a,0xa1,0x16,0x7b,0xfb,0xf6,0x92,0x92,0x67); + +MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface10,0x90B8FCC3,0x7251,0x4B0A,0xAE,0x3D,0x5C,0x13,0xA6,0x7E,0xC9,0xAA); + + #undef MIDL_DEFINE_GUID #ifdef __cplusplus diff --git a/src/coreclr/src/pal/prebuilt/inc/cordebug.h b/src/coreclr/src/pal/prebuilt/inc/cordebug.h index 3418b8cf9b30..b497d141c480 100644 --- a/src/coreclr/src/pal/prebuilt/inc/cordebug.h +++ b/src/coreclr/src/pal/prebuilt/inc/cordebug.h @@ -6,7 +6,7 @@ /* File created by MIDL compiler version 8.01.0622 */ /* at Mon Jan 18 19:14:07 2038 */ -/* Compiler settings for E:/repos/runtime2/src/coreclr/src/inc/cordebug.idl: +/* Compiler settings for runtime/src/coreclr/src/inc/cordebug.idl: Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data @@ -563,6 +563,13 @@ typedef interface ICorDebugModule3 ICorDebugModule3; #endif /* __ICorDebugModule3_FWD_DEFINED__ */ +#ifndef __ICorDebugModule4_FWD_DEFINED__ +#define __ICorDebugModule4_FWD_DEFINED__ +typedef interface ICorDebugModule4 ICorDebugModule4; + +#endif /* __ICorDebugModule4_FWD_DEFINED__ */ + + #ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ #define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ typedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame; @@ -11691,6 +11698,86 @@ EXTERN_C const IID IID_ICorDebugModule3; #endif /* __ICorDebugModule3_INTERFACE_DEFINED__ */ +#ifndef __ICorDebugModule4_INTERFACE_DEFINED__ +#define __ICorDebugModule4_INTERFACE_DEFINED__ + +/* interface ICorDebugModule4 */ +/* [unique][uuid][local][object] */ + + +EXTERN_C const IID IID_ICorDebugModule4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("FF8B8EAF-25CD-4316-8859-84416DE4402E") + ICorDebugModule4 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE IsMappedLayout( + /* [out] */ BOOL *pIsMapped) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorDebugModule4Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorDebugModule4 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorDebugModule4 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ICorDebugModule4 * This); + + HRESULT ( STDMETHODCALLTYPE *IsMappedLayout )( + ICorDebugModule4 * This, + /* [out] */ BOOL *pIsMapped); + + END_INTERFACE + } ICorDebugModule4Vtbl; + + interface ICorDebugModule4 + { + CONST_VTBL struct ICorDebugModule4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorDebugModule4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorDebugModule4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorDebugModule4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorDebugModule4_IsMappedLayout(This,pIsMapped) \ + ( (This)->lpVtbl -> IsMappedLayout(This,pIsMapped) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICorDebugModule4_INTERFACE_DEFINED__ */ + + #ifndef __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ #define __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ @@ -12075,14 +12162,14 @@ EXTERN_C const IID IID_ICorDebugModule; #endif /* __ICorDebugModule_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0075 */ +/* interface __MIDL_itf_cordebug_0000_0076 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0075_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0075_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0076_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0076_v0_0_s_ifspec; #ifndef __ICorDebugModule2_INTERFACE_DEFINED__ #define __ICorDebugModule2_INTERFACE_DEFINED__ @@ -15129,15 +15216,15 @@ EXTERN_C const IID IID_ICorDebugBoxValue; #endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0102 */ +/* interface __MIDL_itf_cordebug_0000_0103 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0102_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0102_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0103_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0103_v0_0_s_ifspec; #ifndef __ICorDebugStringValue_INTERFACE_DEFINED__ #define __ICorDebugStringValue_INTERFACE_DEFINED__ @@ -15277,14 +15364,14 @@ EXTERN_C const IID IID_ICorDebugStringValue; #endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0103 */ +/* interface __MIDL_itf_cordebug_0000_0104 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0103_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0103_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0104_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0104_v0_0_s_ifspec; #ifndef __ICorDebugArrayValue_INTERFACE_DEFINED__ #define __ICorDebugArrayValue_INTERFACE_DEFINED__ @@ -18059,15 +18146,15 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum; #endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0127 */ +/* interface __MIDL_itf_cordebug_0000_0128 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0128_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0128_v0_0_s_ifspec; #ifndef __ICorDebugMDA_INTERFACE_DEFINED__ #define __ICorDebugMDA_INTERFACE_DEFINED__ @@ -18207,7 +18294,7 @@ EXTERN_C const IID IID_ICorDebugMDA; #endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0128 */ +/* interface __MIDL_itf_cordebug_0000_0129 */ /* [local] */ #pragma warning(pop) @@ -18215,8 +18302,8 @@ EXTERN_C const IID IID_ICorDebugMDA; #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0128_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0128_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0129_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0129_v0_0_s_ifspec; #ifndef __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ #define __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ @@ -18332,14 +18419,14 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo; #endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0129 */ +/* interface __MIDL_itf_cordebug_0000_0130 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0129_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0129_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0130_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0130_v0_0_s_ifspec; #ifndef __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ #define __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ diff --git a/src/coreclr/src/pal/prebuilt/inc/corerror.h b/src/coreclr/src/pal/prebuilt/inc/corerror.h index 31ba2d9c4554..0fe7c75d2d24 100644 --- a/src/coreclr/src/pal/prebuilt/inc/corerror.h +++ b/src/coreclr/src/pal/prebuilt/inc/corerror.h @@ -385,7 +385,6 @@ #define CORDBG_E_UNSUPPORTED_DELEGATE EMAKEHR(0x1c68) #define PEFMT_E_64BIT EMAKEHR(0x1d02) #define PEFMT_E_32BIT EMAKEHR(0x1d0b) -#define NGEN_E_SYS_ASM_NI_MISSING EMAKEHR(0x1f06) #define CLDB_E_INTERNALERROR EMAKEHR(0x1fff) #define CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW EMAKEHR(0x2000) #define CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH EMAKEHR(0x2001) diff --git a/src/coreclr/src/pal/prebuilt/inc/sospriv.h b/src/coreclr/src/pal/prebuilt/inc/sospriv.h index 6fe59addcfe2..e1cbc05e9028 100644 --- a/src/coreclr/src/pal/prebuilt/inc/sospriv.h +++ b/src/coreclr/src/pal/prebuilt/inc/sospriv.h @@ -129,6 +129,20 @@ typedef interface ISOSDacInterface8 ISOSDacInterface8; #endif /* __ISOSDacInterface8_FWD_DEFINED__ */ +#ifndef __ISOSDacInterface9_FWD_DEFINED__ +#define __ISOSDacInterface9_FWD_DEFINED__ +typedef interface ISOSDacInterface9 ISOSDacInterface9; + +#endif /* __ISOSDacInterface9_FWD_DEFINED__ */ + + +#ifndef __ISOSDacInterface10_FWD_DEFINED__ +#define __ISOSDacInterface10_FWD_DEFINED__ +typedef interface ISOSDacInterface10 ISOSDacInterface10; + +#endif /* __ISOSDacInterface10_FWD_DEFINED__ */ + + /* header files for imported files */ #include "unknwn.h" #include "xclrdata.h" @@ -2745,6 +2759,144 @@ EXTERN_C const IID IID_ISOSDacInterface9; #endif /* __ISOSDacInterface9_INTERFACE_DEFINED__ */ +#ifndef __ISOSDacInterface10_INTERFACE_DEFINED__ +#define __ISOSDacInterface10_INTERFACE_DEFINED__ + +/* interface ISOSDacInterface10 */ +/* [uuid][local][object] */ + + +EXTERN_C const IID IID_ISOSDacInterface10; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("90B8FCC3-7251-4B0A-AE3D-5C13A67EC9AA") + ISOSDacInterface10 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetObjectComWrappersData( + CLRDATA_ADDRESS objAddr, + CLRDATA_ADDRESS *rcw, + unsigned int count, + CLRDATA_ADDRESS *mowList, + unsigned int *pNeeded) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsComWrappersCCW( + CLRDATA_ADDRESS ccw, + BOOL *isComWrappersCCW) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetComWrappersCCWData( + CLRDATA_ADDRESS ccw, + CLRDATA_ADDRESS *managedObject, + int *refCount) = 0; + + virtual HRESULT STDMETHODCALLTYPE IsComWrappersRCW( + CLRDATA_ADDRESS rcw, + BOOL *isComWrappersRCW) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetComWrappersRCWData( + CLRDATA_ADDRESS rcw, + CLRDATA_ADDRESS *identity) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISOSDacInterface10Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISOSDacInterface10 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISOSDacInterface10 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISOSDacInterface10 * This); + + HRESULT ( STDMETHODCALLTYPE *GetObjectComWrappersData )( + ISOSDacInterface10 * This, + CLRDATA_ADDRESS objAddr, + CLRDATA_ADDRESS *rcw, + unsigned int count, + CLRDATA_ADDRESS *mowList, + unsigned int *pNeeded); + + HRESULT ( STDMETHODCALLTYPE *IsComWrappersCCW )( + ISOSDacInterface10 * This, + CLRDATA_ADDRESS ccw, + BOOL *isComWrappersCCW); + + HRESULT ( STDMETHODCALLTYPE *GetComWrappersCCWData )( + ISOSDacInterface10 * This, + CLRDATA_ADDRESS ccw, + CLRDATA_ADDRESS *managedObject, + int *refCount); + + HRESULT ( STDMETHODCALLTYPE *IsComWrappersRCW )( + ISOSDacInterface10 * This, + CLRDATA_ADDRESS rcw, + BOOL *isComWrappersRCW); + + HRESULT ( STDMETHODCALLTYPE *GetComWrappersRCWData )( + ISOSDacInterface10 * This, + CLRDATA_ADDRESS rcw, + CLRDATA_ADDRESS *identity); + + END_INTERFACE + } ISOSDacInterface10Vtbl; + + interface ISOSDacInterface10 + { + CONST_VTBL struct ISOSDacInterface10Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISOSDacInterface10_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISOSDacInterface10_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISOSDacInterface10_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISOSDacInterface10_GetObjectComWrappersData(This,objAddr,rcw,count,mowList,pNeeded) \ + ( (This)->lpVtbl -> GetObjectComWrappersData(This,objAddr,rcw,count,mowList,pNeeded) ) + +#define ISOSDacInterface10_IsComWrappersCCW(This,ccw,isComWrappersCCW) \ + ( (This)->lpVtbl -> IsComWrappersCCW(This,ccw,isComWrappersCCW) ) + +#define ISOSDacInterface10_GetComWrappersCCWData(This,ccw,managedObject,refCount) \ + ( (This)->lpVtbl -> GetComWrappersCCWData(This,ccw,managedObject,refCount) ) + +#define ISOSDacInterface10_IsComWrappersRCW(This,rcw,isComWrappersRCW) \ + ( (This)->lpVtbl -> IsComWrappersRCW(This,rcw,isComWrappersRCW) ) + +#define ISOSDacInterface10_GetComWrappersRCWData(This,rcw,identity) \ + ( (This)->lpVtbl -> GetComWrappersRCWData(This,rcw,identity) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISOSDacInterface10_INTERFACE_DEFINED__ */ + + /* Additional Prototypes for ALL interfaces */ /* end of Additional Prototypes */ diff --git a/src/coreclr/src/pal/src/CMakeLists.txt b/src/coreclr/src/pal/src/CMakeLists.txt index 094f14cabf82..a47da8004412 100644 --- a/src/coreclr/src/pal/src/CMakeLists.txt +++ b/src/coreclr/src/pal/src/CMakeLists.txt @@ -41,17 +41,29 @@ include_directories(include) # Compile options +if(CLR_CMAKE_HOST_ARCH_AMD64) + set(PAL_ARCH_SOURCES_DIR amd64) +elseif(CLR_CMAKE_HOST_ARCH_ARM) + set(PAL_ARCH_SOURCES_DIR arm) +elseif(CLR_CMAKE_HOST_ARCH_ARM64) + set(PAL_ARCH_SOURCES_DIR arm64) +elseif(CLR_CMAKE_HOST_ARCH_I386) + set(PAL_ARCH_SOURCES_DIR i386) +endif() + if(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) add_definitions(-DFEATURE_USE_SYSTEM_LIBUNWIND) endif(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) if(CLR_CMAKE_TARGET_OSX) add_definitions(-DTARGET_OSX) - add_definitions(-DXSTATE_SUPPORTED) + if(CLR_CMAKE_TARGET_ARCH_AMD64) + add_definitions(-DXSTATE_SUPPORTED) + endif() set(PLATFORM_SOURCES - arch/amd64/activationhandlerwrapper.S - arch/amd64/context.S - arch/amd64/dispatchexceptionwrapper.S + arch/${PAL_ARCH_SOURCES_DIR}/activationhandlerwrapper.S + arch/${PAL_ARCH_SOURCES_DIR}/context.S + arch/${PAL_ARCH_SOURCES_DIR}/dispatchexceptionwrapper.S exception/machexception.cpp exception/machmessage.cpp ) @@ -64,15 +76,6 @@ add_definitions(-DLP64COMPATIBLE) add_definitions(-DCORECLR) add_definitions(-DPIC) add_definitions(-D_FILE_OFFSET_BITS=64) -if(CLR_CMAKE_HOST_ARCH_AMD64) - set(PAL_ARCH_SOURCES_DIR amd64) -elseif(CLR_CMAKE_HOST_ARCH_ARM) - set(PAL_ARCH_SOURCES_DIR arm) -elseif(CLR_CMAKE_HOST_ARCH_ARM64) - set(PAL_ARCH_SOURCES_DIR arm64) -elseif(CLR_CMAKE_HOST_ARCH_I386) - set(PAL_ARCH_SOURCES_DIR i386) -endif() if(CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_HOST_ALPINE_LINUX) # Currently the _xstate is not available on Alpine Linux @@ -90,10 +93,6 @@ endif(CLR_CMAKE_HOST_ALPINE_LINUX) # turn off capability to remove unused functions (which was enabled in debug build with sanitizers) set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--no-gc-sections") -if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - add_compile_options(-Wno-unused-result) -endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set(ARCH_SOURCES arch/${PAL_ARCH_SOURCES_DIR}/context2.S arch/${PAL_ARCH_SOURCES_DIR}/debugbreak.S @@ -123,7 +122,6 @@ set(SOURCES cruntime/filecrt.cpp cruntime/malloc.cpp cruntime/math.cpp - cruntime/mbstring.cpp cruntime/misc.cpp cruntime/path.cpp cruntime/printf.cpp @@ -197,6 +195,7 @@ set(SOURCES safecrt/wcscat_s.cpp safecrt/wcscpy_s.cpp safecrt/wcslen_s.cpp + safecrt/wcslwr_s.cpp safecrt/wcsncat_s.cpp safecrt/wcsncpy_s.cpp safecrt/wcstok_s.cpp @@ -219,12 +218,6 @@ set(SOURCES thread/threadsusp.cpp ) -if(NOT CLR_CMAKE_TARGET_OSX) - list(APPEND SOURCES - exception/remote-unwind.cpp - ) -endif(NOT CLR_CMAKE_TARGET_OSX) - if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) set(LIBUNWIND_OBJECTS $) endif(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) @@ -246,19 +239,27 @@ if(CLR_CMAKE_TARGET_OSX) ${LIBUNWIND_DAC_OBJECTS} ) - target_compile_definitions(coreclrpal_dac PUBLIC + target_compile_definitions(coreclrpal_dac PUBLIC "-D_XOPEN_SOURCE" "-DUNW_REMOTE_ONLY" ) +else() + if(NOT FEATURE_CROSSBITNESS) + add_library(coreclrpal_dac STATIC + exception/remote-unwind.cpp + ) + endif(NOT FEATURE_CROSSBITNESS) +endif(CLR_CMAKE_TARGET_OSX) - target_include_directories(coreclrpal_dac PUBLIC +if(NOT FEATURE_CROSSBITNESS) + target_include_directories(coreclrpal_dac PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include/tdep ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include/tdep ) -endif(CLR_CMAKE_TARGET_OSX) +endif(NOT FEATURE_CROSSBITNESS) # There is only one function exported in 'tracepointprovider.cpp' namely 'PAL_InitializeTracing', # which is guarded with '#if defined(__linux__)'. On macOS, Xcode issues the following warning: @@ -267,10 +268,12 @@ endif(CLR_CMAKE_TARGET_OSX) # > warning for library: libtracepointprovider.a the table of contents is empty (no object file members in the library define global symbols) # if(CLR_CMAKE_TARGET_LINUX) - add_library(tracepointprovider + add_library(tracepointprovider_obj OBJECT misc/tracepointprovider.cpp ) + add_library(tracepointprovider INTERFACE) + target_sources(tracepointprovider INTERFACE $) endif(CLR_CMAKE_TARGET_LINUX) if(CLR_CMAKE_TARGET_OSX) diff --git a/src/coreclr/src/pal/src/arch/arm64/activationhandlerwrapper.S b/src/coreclr/src/pal/src/arch/arm64/activationhandlerwrapper.S new file mode 100644 index 000000000000..240757fa506e --- /dev/null +++ b/src/coreclr/src/pal/src/arch/arm64/activationhandlerwrapper.S @@ -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. + +#include "unixasmmacros.inc" +#include "asmconstants.h" + +// Offset of the return address from the ActivationHandler in the ActivationHandlerWrapper +.globl C_FUNC(ActivationHandlerReturnOffset) +C_FUNC(ActivationHandlerReturnOffset): + .int LOCAL_LABEL(ActivationHandlerReturn)-C_FUNC(ActivationHandlerWrapper) + +NESTED_ENTRY ActivationHandlerWrapper, _TEXT, NoHandler + PROLOG_SAVE_REG_PAIR_INDEXED fp, lr, -(16 + CONTEXT_Size) + // Should never actually run + EMIT_BREAKPOINT + bl EXTERNAL_C_FUNC(ActivationHandler) +LOCAL_LABEL(ActivationHandlerReturn): + // Should never return + EMIT_BREAKPOINT + EPILOG_RESTORE_REG_PAIR_INDEXED fp, lr, (16 + CONTEXT_Size) + ret +NESTED_END ActivationHandlerWrapper, _TEXT diff --git a/src/coreclr/src/pal/src/arch/arm64/asmconstants.h b/src/coreclr/src/pal/src/arch/arm64/asmconstants.h index ad7d09e6efbb..a657b8e5eb1c 100644 --- a/src/coreclr/src/pal/src/arch/arm64/asmconstants.h +++ b/src/coreclr/src/pal/src/arch/arm64/asmconstants.h @@ -90,5 +90,6 @@ #define CONTEXT_FLOAT_CONTROL_OFFSET CONTEXT_V31+16 #define CONTEXT_Fpcr 0 #define CONTEXT_Fpsr CONTEXT_Fpcr+8 +#define CONTEXT_Size ((CONTEXT_NEON_OFFSET + CONTEXT_Fpsr + 8 + 0xf) & ~0xf) #endif diff --git a/src/coreclr/src/pal/src/arch/arm64/context.S b/src/coreclr/src/pal/src/arch/arm64/context.S new file mode 100644 index 000000000000..1323c72fa2ca --- /dev/null +++ b/src/coreclr/src/pal/src/arch/arm64/context.S @@ -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. + +#include "unixasmmacros.inc" + +#if defined(_DEBUG) +NESTED_ENTRY DBG_CheckStackAlignment, _TEXT, NoHandler + PROLOG_SAVE_REG_PAIR_INDEXED fp, lr, -16 + // Reading from an unaligned stack pointer will trigger a stack alignment fault + ldr x0, [sp] + EPILOG_RESTORE_REG_PAIR_INDEXED fp, lr, 16 + ret +NESTED_END _DBG_CheckStackAlignment, _TEXT +#endif + diff --git a/src/coreclr/src/pal/src/arch/arm64/dispatchexceptionwrapper.S b/src/coreclr/src/pal/src/arch/arm64/dispatchexceptionwrapper.S new file mode 100644 index 000000000000..c7989377758f --- /dev/null +++ b/src/coreclr/src/pal/src/arch/arm64/dispatchexceptionwrapper.S @@ -0,0 +1,49 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// ==++== +// + +// ==--== +// +// Implementation of the PAL_DispatchExceptionWrapper that is +// interposed between a function that caused a hardware fault +// and PAL_DispatchException that throws an SEH exception for +// the fault, to make the stack unwindable. +// + +#include "unixasmmacros.inc" + +// Offset of the return address from the PAL_DispatchException in the PAL_DispatchExceptionWrapper +.globl C_FUNC(PAL_DispatchExceptionReturnOffset) +C_FUNC(PAL_DispatchExceptionReturnOffset): + .int LOCAL_LABEL(PAL_DispatchExceptionReturn) - C_FUNC(PAL_DispatchExceptionWrapper) + +// +// PAL_DispatchExceptionWrapper will never be called; it only serves +// to be referenced from a stack frame on the faulting thread. Its +// unwinding behavior is equivalent to any standard function. +// It is analogous to the following source file. +// +// extern "C" void PAL_DispatchException(CONTEXT *pContext, EXCEPTION_RECORD *pExceptionRecord, MachExceptionInfo *pMachExceptionInfo); +// +// extern "C" void PAL_DispatchExceptionWrapper() +// { +// CONTEXT Context; +// EXCEPTION_RECORD ExceptionRecord; +// MachExceptionInfo MachExceptionInfo; +// PAL_DispatchException(&Context, &ExceptionRecord, &MachExceptionInfo); +// } +// + +NESTED_ENTRY PAL_DispatchExceptionWrapper, _TEXT, NoHandler + PROLOG_SAVE_REG_PAIR_INDEXED fp, lr, -16 + // Should never actually run + EMIT_BREAKPOINT + bl EXTERNAL_C_FUNC(PAL_DispatchException) +LOCAL_LABEL(PAL_DispatchExceptionReturn): + // Should never return + EMIT_BREAKPOINT + EPILOG_RESTORE_REG_PAIR_INDEXED fp, lr, 16 + ret +NESTED_END PAL_DispatchExceptionWrapper, _TEXT diff --git a/src/coreclr/src/pal/src/config.h.in b/src/coreclr/src/pal/src/config.h.in index 8e7e69288bc9..728c49d350ba 100644 --- a/src/coreclr/src/pal/src/config.h.in +++ b/src/coreclr/src/pal/src/config.h.in @@ -24,6 +24,7 @@ #cmakedefine01 HAVE_PTHREAD_NP_H #cmakedefine01 HAVE_AUXV_HWCAP_H #cmakedefine01 HAVE_SYS_PTRACE_H +#cmakedefine01 HAVE_GETAUXVAL #cmakedefine01 HAVE_KQUEUE #cmakedefine01 HAVE_PTHREAD_SUSPEND @@ -36,7 +37,6 @@ #cmakedefine01 HAVE_PTHREAD_GETCPUCLOCKID #cmakedefine01 HAVE_PTHREAD_SIGQUEUE #cmakedefine01 HAVE_PTHREAD_GETAFFINITY_NP -#cmakedefine01 HAVE_PTHREAD_ATTR_SETAFFINITY_NP #cmakedefine01 HAVE_CPUSET_T #cmakedefine01 HAVE_SIGRETURN #cmakedefine01 HAVE__THREAD_SYS_SIGRETURN @@ -66,6 +66,7 @@ #cmakedefine01 HAVE_TTRACE #cmakedefine01 HAVE_PIPE2 #cmakedefine01 HAVE_SCHED_GETAFFINITY +#cmakedefine01 HAVE_SCHED_SETAFFINITY #cmakedefine HAVE_UNW_GET_SAVE_LOC #cmakedefine HAVE_UNW_GET_ACCESSORS #cmakedefine01 HAVE_XSWDEV @@ -113,7 +114,7 @@ #cmakedefine01 HAVE_WORKING_CLOCK_GETTIME #cmakedefine01 HAVE_CLOCK_MONOTONIC #cmakedefine01 HAVE_CLOCK_MONOTONIC_COARSE -#cmakedefine01 HAVE_MACH_ABSOLUTE_TIME +#cmakedefine01 HAVE_CLOCK_GETTIME_NSEC_NP #cmakedefine01 HAVE_CLOCK_THREAD_CPUTIME #cmakedefine01 HAVE_PTHREAD_CONDATTR_SETCLOCK #cmakedefine01 HAVE_MMAP_DEV_ZERO diff --git a/src/coreclr/src/pal/src/configure.cmake b/src/coreclr/src/pal/src/configure.cmake index b67637b584ba..dfa14fa0928a 100644 --- a/src/coreclr/src/pal/src/configure.cmake +++ b/src/coreclr/src/pal/src/configure.cmake @@ -44,9 +44,9 @@ check_include_files(runetype.h HAVE_RUNETYPE_H) check_include_files(semaphore.h HAVE_SEMAPHORE_H) check_include_files(sys/prctl.h HAVE_PRCTL_H) check_include_files(numa.h HAVE_NUMA_H) -check_include_files(pthread_np.h HAVE_PTHREAD_NP_H) check_include_files("sys/auxv.h;asm/hwcap.h" HAVE_AUXV_HWCAP_H) check_include_files("sys/ptrace.h" HAVE_SYS_PTRACE_H) +check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) @@ -81,6 +81,7 @@ check_include_files(gnu/lib-names.h HAVE_GNU_LIBNAMES_H) check_function_exists(kqueue HAVE_KQUEUE) check_library_exists(c sched_getaffinity "" HAVE_SCHED_GETAFFINITY) +check_library_exists(c sched_setaffinity "" HAVE_SCHED_SETAFFINITY) check_library_exists(pthread pthread_create "" HAVE_LIBPTHREAD) check_library_exists(c pthread_create "" HAVE_PTHREAD_IN_LIBC) @@ -100,7 +101,6 @@ check_library_exists(${PTHREAD_LIBRARY} pthread_getattr_np "" HAVE_PTHREAD_GETAT check_library_exists(${PTHREAD_LIBRARY} pthread_getcpuclockid "" HAVE_PTHREAD_GETCPUCLOCKID) check_library_exists(${PTHREAD_LIBRARY} pthread_sigqueue "" HAVE_PTHREAD_SIGQUEUE) check_library_exists(${PTHREAD_LIBRARY} pthread_getaffinity_np "" HAVE_PTHREAD_GETAFFINITY_NP) -check_library_exists(${PTHREAD_LIBRARY} pthread_attr_setaffinity_np "" HAVE_PTHREAD_ATTR_SETAFFINITY_NP) check_function_exists(sigreturn HAVE_SIGRETURN) check_function_exists(_thread_sys_sigreturn HAVE__THREAD_SYS_SIGRETURN) @@ -445,16 +445,14 @@ set(CMAKE_REQUIRED_LIBRARIES) check_cxx_source_runs(" #include -#include +#include int main() { int ret; - mach_timebase_info_data_t timebaseInfo; - ret = mach_timebase_info(&timebaseInfo); - mach_absolute_time(); - exit(ret); -}" HAVE_MACH_ABSOLUTE_TIME) + ret = clock_gettime_nsec_np(CLOCK_UPTIME_RAW); + exit((ret == 0) ? 1 : 0); +}" HAVE_CLOCK_GETTIME_NSEC_NP) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_RT_LIBS}) check_cxx_source_runs(" @@ -1048,8 +1046,6 @@ if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) list(INSERT CMAKE_REQUIRED_INCLUDES 0 ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include) endif() -set(CMAKE_REQUIRED_FLAGS "-c -Werror=implicit-function-declaration") - check_c_source_compiles(" #include #include @@ -1061,29 +1057,9 @@ int main(int argc, char **argv) return 0; }" UNWIND_CONTEXT_IS_UCONTEXT_T) -check_c_source_compiles(" -#include - -int main(int argc, char **argv) { - unw_cursor_t cursor; - unw_save_loc_t saveLoc; - int reg = UNW_REG_IP; - unw_get_save_loc(&cursor, reg, &saveLoc); - - return 0; -}" HAVE_UNW_GET_SAVE_LOC) - -check_c_source_compiles(" -#include - -int main(int argc, char **argv) { - unw_addr_space_t as; - unw_get_accessors(as); - - return 0; -}" HAVE_UNW_GET_ACCESSORS) +check_symbol_exists(unw_get_save_loc libunwind.h HAVE_UNW_GET_SAVE_LOC) +check_symbol_exists(unw_get_accessors libunwind.h HAVE_UNW_GET_ACCESSORS) -set(CMAKE_REQUIRED_FLAGS) if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) list(REMOVE_AT CMAKE_REQUIRED_INCLUDES 0 1) endif() diff --git a/src/coreclr/src/pal/src/cruntime/mbstring.cpp b/src/coreclr/src/pal/src/cruntime/mbstring.cpp deleted file mode 100644 index 12d0cb067cfb..000000000000 --- a/src/coreclr/src/pal/src/cruntime/mbstring.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - mbstring.c - -Abstract: - - Implementation of the multi-byte string functions in the C runtime library that - are Windows specific. - -Implementation Notes: - - Assuming it is not possible to change multi-byte code page using - the PAL (_setmbcp does not seem to be required), these functions - should have a trivial implementation (treat as single-byte). If it - is possible, then support for multi-byte code pages will have to - be implemented before these functions can behave correctly for - multi-byte strings. - - - ---*/ - -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" - -#include - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - - -/*++ -Function: - _mbsinc - -Return Value - -Returns a pointer to the character that immediately follows string. - -Parameter - -string Character pointer - -Remarks - -The _mbsinc function returns a pointer to the first byte of the -multibyte character that immediately follows string. - ---*/ -unsigned char * -__cdecl -_mbsinc( - const unsigned char *string) -{ - unsigned char *ret; - - PERF_ENTRY(_mbsinc); - ENTRY("_mbsinc (string=%p)\n", string); - - if (string == NULL) - { - ret = NULL; - } - else - { - ret = (unsigned char *) string; - if (IsDBCSLeadByteEx(CP_ACP, *ret)) - { - ++ret; - } - ++ret; - } - - LOGEXIT("_mbsinc returning unsigned char* %p (%s)\n", ret, ret); - PERF_EXIT(_mbsinc); - return ret; -} - - -/*++ -Function: - _mbsninc - -Return Value - -Returns a pointer to string after string has been incremented by count -characters, or NULL if the supplied pointer is NULL. If count is -greater than or equal to the number of characters in string, the -result is undefined. - -Parameters - -string Source string -count Number of characters to increment string pointer - -Remarks - -The _mbsninc function increments string by count multibyte -characters. _mbsninc recognizes multibyte-character sequences -according to the multibyte code page currently in use. - ---*/ -unsigned char * -__cdecl -_mbsninc( - const unsigned char *string, size_t count) -{ - unsigned char *ret; - CPINFO cpinfo; - - PERF_ENTRY(_mbsninc); - ENTRY("_mbsninc (string=%p, count=%lu)\n", string, count); - if (string == NULL) - { - ret = NULL; - } - else - { - ret = (unsigned char *) string; - if (GetCPInfo(CP_ACP, &cpinfo) && cpinfo.MaxCharSize == 1) - { - ret += std::min(count, strlen((const char*)string)); - } - else - { - while (count-- && (*ret != 0)) - { - if (IsDBCSLeadByteEx(CP_ACP, *ret)) - { - ++ret; - } - ++ret; - } - } - } - LOGEXIT("_mbsninc returning unsigned char* %p (%s)\n", ret, ret); - PERF_EXIT(_mbsninc); - return ret; -} - -/*++ -Function: - _mbsdec - -Return Value - -_mbsdec returns a pointer to the character that immediately precedes -current; _mbsdec returns NULL if the value of start is greater than or -equal to that of current. - -Parameters - -start Pointer to first byte of any multibyte character in the source - string; start must precede current in the source string - -current Pointer to first byte of any multibyte character in the source - string; current must follow start in the source string - ---*/ -unsigned char * -__cdecl -_mbsdec( - const unsigned char *start, - const unsigned char *current) -{ - unsigned char *ret; - unsigned char *strPtr; - CPINFO cpinfo; - - PERF_ENTRY(_mbsdec); - ENTRY("_mbsdec (start=%p, current=%p)\n", start, current); - - if (current <= start) - { - ret = NULL; - } - else if (GetCPInfo(CP_ACP, &cpinfo) && cpinfo.MaxCharSize == 1) - { - ret = (unsigned char *) current - 1; - } - else - { - ret = strPtr = (unsigned char *) start; - while (strPtr < current) - { - ret = strPtr; - if (IsDBCSLeadByteEx(CP_ACP, *strPtr)) - { - ++strPtr; - } - ++strPtr; - } - } - LOGEXIT("_mbsdec returning unsigned int %p (%s)\n", ret, ret); - PERF_EXIT(_mbsdec); - return ret; -} diff --git a/src/coreclr/src/pal/src/cruntime/printf.cpp b/src/coreclr/src/pal/src/cruntime/printf.cpp index 5144984c1b89..79d16e7b48f9 100644 --- a/src/coreclr/src/pal/src/cruntime/printf.cpp +++ b/src/coreclr/src/pal/src/cruntime/printf.cpp @@ -227,7 +227,7 @@ PAL_fwprintf( /******************************************************************************* Function: - Internal_ScanfExtractFormatA + Internal_ScanfExtractFormatW Paramaters: Fmt @@ -251,337 +251,6 @@ PAL_fwprintf( Notes: - I'm also handling the undocumented %ws, %wc, %w... *******************************************************************************/ - -#define CHECK_OUT_IN_ITS_RANGE(Out,BeginOut,EndOut) \ - if ((Out)<(BeginOut) || (Out)>=(EndOut)) \ - { \ - SetLastError(ERROR_INSUFFICIENT_BUFFER); \ - ERROR("Pointer Out wanted to access 0x%p. However the range of buffer is [0x%p,0x%p).",\ - (Out), (BeginOut), (EndOut)); \ - return false; \ - } - -static BOOL Internal_ScanfExtractFormatA(LPCSTR *Fmt, LPSTR Out, int iOutSize, LPBOOL Store, - LPINT Width, LPINT Prefix, LPINT Type) -{ - BOOL Result = FALSE; - LPSTR TempStr; - LPSTR TempStrPtr; - LPSTR BaseOut = Out; - LPSTR EndOut = Out + iOutSize; - - *Width = -1; - *Store = TRUE; - *Prefix = -1; - *Type = -1; - - if (*Fmt && **Fmt == '%') - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = *(*Fmt)++; - } - else - { - return Result; - } - - /* we'll never need a temp string longer than the original */ - TempStrPtr = TempStr = (LPSTR) PAL_malloc(strlen(*Fmt)+1); - if (!TempStr) - { - ERROR("PAL_malloc failed\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return Result; - } - - /* parse '*' flag which means don't store */ - if (**Fmt == '*') - { - *Store = FALSE; - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = *(*Fmt)++; - } - - /* grab width specifier */ - if (isdigit((unsigned char) **Fmt)) - { - TempStrPtr = TempStr; - while (isdigit((unsigned char) **Fmt)) - { - *TempStrPtr++ = **Fmt; - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = *(*Fmt)++; - } - *TempStrPtr = 0; /* end string */ - *Width = atoi(TempStr); - if (*Width < 0) - { - ERROR("atoi returned a negative value indicative of an overflow.\n"); - SetLastError(ERROR_INTERNAL_ERROR); - return Result; - } - } - -#ifdef HOST_64BIT - if (**Fmt == 'p') - { - *Prefix = SCANF_PREFIX_LONGLONG; - } -#endif - /* grab prefix of 'I64' for __int64 */ - if ((*Fmt)[0] == 'I' && (*Fmt)[1] == '6' && (*Fmt)[2] == '4') - { - /* convert to 'q'/'ll' so Unix sscanf can handle it */ - *Fmt += 3; - *Prefix = SCANF_PREFIX_LONGLONG; - } - /* grab a prefix of 'h' */ - else if (**Fmt == 'h') - { - *Prefix = SCANF_PREFIX_SHORT; - ++(*Fmt); - } - /* grab prefix of 'l' or the undocumented 'w' (at least in MSDN) */ - else if (**Fmt == 'l' || **Fmt == 'w') - { - ++(*Fmt); -#ifdef HOST_64BIT - // Only want to change the prefix on 64 bit when inputing characters. - if (**Fmt == 'c' || **Fmt == 's') -#endif - { - *Prefix = SCANF_PREFIX_LONG; /* give it a wide prefix */ - } - if (**Fmt == 'l') - { - *Prefix = SCANF_PREFIX_LONGLONG; - ++(*Fmt); - } - } - else if (**Fmt == 'L') - { - /* a prefix of 'L' seems to be ignored */ - ++(*Fmt); - } - - /* grab type 'c' */ - if (**Fmt == 'c' || **Fmt == 'C') - { - *Type = SCANF_TYPE_CHAR; - if (*Prefix != SCANF_PREFIX_SHORT && **Fmt == 'C') - { - *Prefix = SCANF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == SCANF_PREFIX_LONG) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = 'l'; - } - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = 'c'; - ++(*Fmt); - Result = TRUE; - } - /* grab type 's' */ - else if (**Fmt == 's' || **Fmt == 'S') - { - *Type = SCANF_TYPE_STRING; - if (*Prefix != SCANF_PREFIX_SHORT && **Fmt == 'S') - { - *Prefix = SCANF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == SCANF_PREFIX_LONG) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = 'l'; - } - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = 's'; - ++(*Fmt); - Result = TRUE; - } - /* grab int types */ - else if (**Fmt == 'd' || **Fmt == 'i' || **Fmt == 'o' || - **Fmt == 'u' || **Fmt == 'x' || **Fmt == 'X' || - **Fmt == 'p') - { - *Type = SCANF_TYPE_INT; - if (*Prefix == SCANF_PREFIX_SHORT) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = 'h'; - } - else if (*Prefix == SCANF_PREFIX_LONG) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = 'l'; - } - else if (*Prefix == SCANF_PREFIX_LONGLONG) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - - if (strcpy_s(Out, iOutSize-(Out-BaseOut), scanf_longlongfmt) != SAFECRT_SUCCESS) - { - ERROR("strcpy_s failed\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - - Out += strlen(scanf_longlongfmt); - } - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = *(*Fmt)++; - Result = TRUE; - } - else if (**Fmt == 'e' || **Fmt == 'E' || **Fmt == 'f' || - **Fmt == 'g' || **Fmt == 'G') - { - /* we can safely ignore the prefixes and only add the type*/ - *Type = SCANF_TYPE_FLOAT; - /* this gets rid of %E/%G since they're they're the - same when scanning */ - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = tolower( *(*Fmt)++ ); - Result = TRUE; - } - else if (**Fmt == 'n') - { - if (*Prefix == SCANF_PREFIX_SHORT) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = 'h'; - } - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = *(*Fmt)++; - *Type = SCANF_TYPE_N; - Result = TRUE; - } - else if (**Fmt == '[') - { - /* There is a small compatibility problem in the handling of the [] - option in FreeBSD vs. Windows. In Windows, you can have [z-a] - as well as [a-z]. In FreeBSD, [z-a] fails. So, we need to - reverse the instances of z-a to a-z (and [m-e] to [e-m], etc). */ - - /* step 1 : copy the leading [ */ - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = '['; - (*Fmt)++; - - /* step 2 : copy a leading ^, if present */ - if( '^' == **Fmt ) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = '^'; - (*Fmt)++; - } - - /* step 3 : copy a leading ], if present; a ] immediately after the - leading [ (or [^) does *not* end the sequence, it is part of the - characters to match */ - if( ']' == **Fmt ) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = ']'; - (*Fmt)++; - } - - /* step 4 : if the next character is already a '-', it's not part of an - interval specifier, so just copy it */ - if('-' == **Fmt ) - { - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = '-'; - (*Fmt)++; - } - - /* ok then, process the rest of it */ - while( '\0' != **Fmt ) - { - if(']' == **Fmt) - { - /* ']' marks end of the format specifier; we're done */ - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = ']'; - (*Fmt)++; - break; - } - if('-' == **Fmt) - { - if( ']' == (*Fmt)[1] ) - { - /* got a '-', next character is the terminating ']'; - copy '-' literally */ - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = '-'; - (*Fmt)++; - } - else - { - /* got a '-' indicating an interval specifier */ - unsigned char prev, next; - - /* get the interval boundaries */ - prev = (*Fmt)[-1]; - next = (*Fmt)[1]; - - /* if boundaries were inverted, replace the already-copied - low boundary by the 'real' low boundary */ - if( prev > next ) - { - CHECK_OUT_IN_ITS_RANGE(Out-1,BaseOut,EndOut) - Out[-1] = next; - - /* ...and save the 'real' upper boundary, which will be - copied to 'Out' below */ - next = prev; - } - - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = '-'; - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = next; - - /* skip over the '-' and the next character, which we - already copied */ - (*Fmt)+=2; - } - } - else - { - /* plain character; just copy it */ - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = **Fmt; - (*Fmt)++; - } - } - - *Type = SCANF_TYPE_BRACKETS; - Result = TRUE; - } - else if (**Fmt == ' ') - { - *Type = SCANF_TYPE_SPACE; - } - - /* add %n so we know how far to increment the pointer */ - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = '%'; - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out++ = 'n'; - - CHECK_OUT_IN_ITS_RANGE(Out,BaseOut,EndOut) - *Out = 0; /* end the string */ - PAL_free(TempStr); - return Result; -} - -/******************************************************************************* -Function: - Internal_ScanfExtractFormatW - - -- see Internal_ScanfExtractFormatA above -*******************************************************************************/ static BOOL Internal_ScanfExtractFormatW(LPCWSTR *Fmt, LPSTR Out, int iOutSize, LPBOOL Store, LPINT Width, LPINT Prefix, LPINT Type) { diff --git a/src/coreclr/src/pal/src/cruntime/printfcpp.cpp b/src/coreclr/src/pal/src/cruntime/printfcpp.cpp index a71814e0dd4e..0f7cb682650f 100644 --- a/src/coreclr/src/pal/src/cruntime/printfcpp.cpp +++ b/src/coreclr/src/pal/src/cruntime/printfcpp.cpp @@ -59,6 +59,7 @@ static int Internal_Convertfwrite(CPalThread *pthrCurrent, const void *buffer, s clearerr (stream); #endif + if(convert) { int nsize; @@ -66,6 +67,8 @@ static int Internal_Convertfwrite(CPalThread *pthrCurrent, const void *buffer, s nsize = WideCharToMultiByte(CP_ACP, 0,(LPCWSTR)buffer, count, 0, 0, 0, 0); if (!nsize) { + if (count == 0) + return 0; ASSERT("WideCharToMultiByte failed. Error is %d\n", GetLastError()); return -1; } diff --git a/src/coreclr/src/pal/src/cruntime/wchar.cpp b/src/coreclr/src/pal/src/cruntime/wchar.cpp index 43023bb50075..5c21d7bd0153 100644 --- a/src/coreclr/src/pal/src/cruntime/wchar.cpp +++ b/src/coreclr/src/pal/src/cruntime/wchar.cpp @@ -36,7 +36,6 @@ Module Name: SET_DEFAULT_DEBUG_CHANNEL(CRT); - /*-- Function: _wtoi @@ -193,48 +192,6 @@ _wcsicmp( return ret; } - -/*++ -Function: - _wcslwr - -Convert a string to lowercase. - -Return Value - -Returns a pointer to the converted string. Because the modification is -done in place, the pointer returned is the same as the pointer passed -as the input argument. No return value is reserved to indicate an -error. - -Parameter - -string Null-terminated string to convert to lowercase - -Remarks - ---*/ -wchar_16 * -__cdecl -_wcslwr( - wchar_16 *string) -{ - int i; - - PERF_ENTRY(_wcslwr); - ENTRY("_wcslwr (string=%p (%S))\n", string?string:W16_NULLSTRING, string?string:W16_NULLSTRING); - - for (i=0 ; string[i] != 0; i++) - { - string[i] = towlower(string[i]); - } - - LOGEXIT("_wcslwr returning wchar_t %p (%S)\n", string?string:W16_NULLSTRING, string?string:W16_NULLSTRING); - PERF_EXIT(_wcslwr); - return string; -} - - /*++ Function: PAL_wcstoul diff --git a/src/coreclr/src/pal/src/debug/debug.cpp b/src/coreclr/src/pal/src/debug/debug.cpp index b58b2fe587e1..8c2ed154ae47 100644 --- a/src/coreclr/src/pal/src/debug/debug.cpp +++ b/src/coreclr/src/pal/src/debug/debug.cpp @@ -62,6 +62,11 @@ SET_DEFAULT_DEBUG_CHANNEL(DEBUG); // some headers have code with asserts, so do #include #endif // HAVE_PROCFS_H +#ifdef __APPLE__ +#include +#include +#endif // __APPLE__ + #if HAVE_MACH_EXCEPTIONS #include "../exception/machexception.h" #endif // HAVE_MACH_EXCEPTIONS @@ -69,6 +74,7 @@ SET_DEFAULT_DEBUG_CHANNEL(DEBUG); // some headers have code with asserts, so do using namespace CorUnix; extern "C" void DBG_DebugBreak_End(); +extern size_t OffsetWithinPage(off_t addr); #if HAVE_PROCFS_CTL #define CTL_ATTACH "attach" @@ -541,6 +547,183 @@ SetThreadContext( return ret; } +/*++ +Function: + PAL_OpenProcessMemory + +Abstract + Creates the handle for PAL_ReadProcessMemory. + +Parameter + processId : process id to read memory + pHandle : returns a platform specific handle or UINT32_MAX if failed + +Return + true successful, false invalid process id or not supported. +--*/ +BOOL +PALAPI +PAL_OpenProcessMemory( + IN DWORD processId, + OUT DWORD* pHandle +) +{ + ENTRY("PAL_OpenProcessMemory(pid=%d)\n", processId); + _ASSERTE(pHandle != nullptr); + *pHandle = UINT32_MAX; +#ifdef __APPLE__ + mach_port_name_t port; + kern_return_t result = ::task_for_pid(mach_task_self(), (int)processId, &port); + if (result != KERN_SUCCESS) + { + ERROR("task_for_pid(%d) FAILED %x %s\n", processId, result, mach_error_string(result)); + LOGEXIT("PAL_OpenProcessMemory FALSE\n"); + return FALSE; + } + *pHandle = port; +#else + char memPath[128]; + _snprintf_s(memPath, sizeof(memPath), sizeof(memPath), "/proc/%lu/mem", processId); + + int fd = open(memPath, O_RDONLY); + if (fd == -1) + { + ERROR("open(%s) FAILED %d (%s)\n", memPath, errno, strerror(errno)); + LOGEXIT("PAL_OpenProcessMemory FALSE\n"); + return FALSE; + } + *pHandle = fd; +#endif + LOGEXIT("PAL_OpenProcessMemory TRUE\n"); + return TRUE; +} + +/*++ +Function: + PAL_CloseProcessMemory + +Abstract + Closes the PAL_OpenProcessMemory handle. + +Parameter + handle : from PAL_OpenProcessMemory + +Return + none +--*/ +VOID +PALAPI +PAL_CloseProcessMemory( + IN DWORD handle +) +{ + ENTRY("PAL_CloseProcessMemory(handle=%x)\n", handle); + if (handle != UINT32_MAX) + { +#ifdef __APPLE__ + kern_return_t result = ::mach_port_deallocate(mach_task_self(), (mach_port_name_t)handle); + if (result != KERN_SUCCESS) + { + ERROR("mach_port_deallocate FAILED %x %s\n", result, mach_error_string(result)); + } +#else + close(handle); +#endif + } + LOGEXIT("PAL_CloseProcessMemory\n"); +} + +/*++ +Function: + PAL_ReadProcessMemory + +Abstract + Reads process memory. + +Parameter + handle : from PAL_OpenProcessMemory + address : address of memory to read + buffer : buffer to read memory to + size : number of bytes to read + numberOfBytesRead: number of bytes read (optional) + +Return + true read memory is successful, false if not. +--*/ +BOOL +PALAPI +PAL_ReadProcessMemory( + IN DWORD handle, + IN ULONG64 address, + IN LPVOID buffer, + IN SIZE_T size, + OUT SIZE_T* numberOfBytesRead) +{ + ENTRY("PAL_ReadProcessMemory(handle=%x, address=%p buffer=%p size=%d)\n", handle, (void*)address, buffer, size); + _ASSERTE(handle != 0); + _ASSERTE(numberOfBytesRead != nullptr); + BOOL result = TRUE; + size_t read = 0; +#ifdef __APPLE__ + vm_map_t task = (vm_map_t)handle; + + // vm_read_overwrite usually requires that the address be page-aligned + // and the size be a multiple of the page size. We can't differentiate + // between the cases in which that's required and those in which it + // isn't, so we do it all the time. + const size_t pageSize = GetVirtualPageSize(); + vm_address_t addressAligned = ALIGN_DOWN(address, pageSize); + ssize_t offset = OffsetWithinPage(address); + ssize_t bytesLeft = size; + + char *data = (char*)malloc(pageSize); + if (data != nullptr) + { + while (bytesLeft > 0) + { + vm_size_t bytesRead = pageSize; + kern_return_t result = ::vm_read_overwrite(task, addressAligned, pageSize, (vm_address_t)data, &bytesRead); + if (result != KERN_SUCCESS || bytesRead != pageSize) + { + TRACE("PAL_ReadProcessMemory(%p %d): vm_read_overwrite failed bytesLeft %d bytesRead %d from %p: %x %s\n", + (void*)address, size, bytesLeft, bytesRead, (void*)addressAligned, result, mach_error_string(result)); + break; + } + ssize_t bytesToCopy = pageSize - offset; + if (bytesToCopy > bytesLeft) + { + bytesToCopy = bytesLeft; + } + memcpy((LPSTR)buffer + read, data + offset, bytesToCopy); + addressAligned = addressAligned + pageSize; + read += bytesToCopy; + bytesLeft -= bytesToCopy; + offset = 0; + } + result = size == 0 || read > 0; + } + else + { + ERROR("malloc(%d) FAILED\n", pageSize); + result = FALSE; + } + + if (data != nullptr) + { + free(data); + } +#else + read = pread(handle, buffer, size, address); + if (read == (size_t)-1) + { + result = FALSE; + } +#endif + *numberOfBytesRead = read; + LOGEXIT("PAL_ReadProcessMemory result=%d bytes read=%d\n", result, read); + return result; +} + /*++ Function: PAL_ProbeMemory diff --git a/src/coreclr/src/pal/src/eventprovider/dummyprovider/CMakeLists.txt b/src/coreclr/src/pal/src/eventprovider/dummyprovider/CMakeLists.txt index 39b9826d1ab5..8e6968cf783d 100644 --- a/src/coreclr/src/pal/src/eventprovider/dummyprovider/CMakeLists.txt +++ b/src/coreclr/src/pal/src/eventprovider/dummyprovider/CMakeLists.txt @@ -1,8 +1,8 @@ -include(FindPython) +include(FindPythonInterp) set (GENERATE_SCRIPT ${CLR_DIR}/src/scripts/genDummyProvider.py) -set(GENERATE_COMMAND ${Python_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --intermediate ${CMAKE_CURRENT_BINARY_DIR}) +set(GENERATE_COMMAND ${PYTHON_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --intermediate ${CMAKE_CURRENT_BINARY_DIR}) execute_process( COMMAND ${GENERATE_COMMAND} --dry-run diff --git a/src/coreclr/src/pal/src/eventprovider/lttngprovider/CMakeLists.txt b/src/coreclr/src/pal/src/eventprovider/lttngprovider/CMakeLists.txt index 234dea19b753..cd6771955e4c 100644 --- a/src/coreclr/src/pal/src/eventprovider/lttngprovider/CMakeLists.txt +++ b/src/coreclr/src/pal/src/eventprovider/lttngprovider/CMakeLists.txt @@ -1,7 +1,7 @@ -include(FindPython) +include(FindPythonInterp) set (GENERATE_SCRIPT ${CLR_DIR}/src/scripts/genLttngProvider.py) -set(GENERATE_COMMAND ${Python_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --intermediate ${CMAKE_CURRENT_BINARY_DIR}) +set(GENERATE_COMMAND ${PYTHON_EXECUTABLE} ${GENERATE_SCRIPT} --man ${EVENT_MANIFEST} --intermediate ${CMAKE_CURRENT_BINARY_DIR}) execute_process( COMMAND ${GENERATE_COMMAND} --dry-run @@ -55,6 +55,7 @@ add_library(eventprovider add_library(coreclrtraceptprovider SHARED ${TRACEPOINT_PROVIDER_SOURCES} + ${VERSION_FILE_PATH} ) add_dependencies(eventprovider generated_eventing_headers) @@ -71,4 +72,4 @@ set_target_properties(coreclrtraceptprovider PROPERTIES LINKER_LANGUAGE CXX) # Install the static eventprovider library _install(TARGETS eventprovider DESTINATION lib) # Install the static coreclrtraceptprovider library -install_clr(TARGETS coreclrtraceptprovider ADDITIONAL_DESTINATION sharedFramework) +install_clr(TARGETS coreclrtraceptprovider ADDITIONAL_DESTINATIONS sharedFramework paltests) diff --git a/src/coreclr/src/pal/src/exception/machexception.cpp b/src/coreclr/src/pal/src/exception/machexception.cpp index de50fd6be99d..442e77d4a15e 100644 --- a/src/coreclr/src/pal/src/exception/machexception.cpp +++ b/src/coreclr/src/pal/src/exception/machexception.cpp @@ -356,11 +356,16 @@ PAL_ERROR CorUnix::CPalThread::DisableMachExceptions() return palError; } +#if defined(HOST_AMD64) // Since HijackFaultingThread pushed the context, exception record and info on the stack, we need to adjust the // signature of PAL_DispatchException such that the corresponding arguments are considered to be on the stack // per GCC64 calling convention rules. Hence, the first 6 dummy arguments (corresponding to RDI, RSI, RDX,RCX, R8, R9). extern "C" void PAL_DispatchException(DWORD64 dwRDI, DWORD64 dwRSI, DWORD64 dwRDX, DWORD64 dwRCX, DWORD64 dwR8, DWORD64 dwR9, PCONTEXT pContext, PEXCEPTION_RECORD pExRecord, MachExceptionInfo *pMachExceptionInfo) +#elif defined(HOST_ARM64) +extern "C" +void PAL_DispatchException(PCONTEXT pContext, PEXCEPTION_RECORD pExRecord, MachExceptionInfo *pMachExceptionInfo) +#endif { CPalThread *pThread = InternalGetCurrentThread(); @@ -441,12 +446,36 @@ BuildExceptionRecord( } else { +#if defined(HOST_AMD64) exceptionCode = EXCEPTION_ACCESS_VIOLATION; +#elif defined(HOST_ARM64) + switch (exceptionInfo.Subcodes[0]) + { + case EXC_ARM_DA_ALIGN: + exceptionCode = EXCEPTION_DATATYPE_MISALIGNMENT; + break; + case EXC_ARM_DA_DEBUG: + exceptionCode = EXCEPTION_BREAKPOINT; + break; + case EXC_ARM_SP_ALIGN: + exceptionCode = EXCEPTION_DATATYPE_MISALIGNMENT; + break; + case EXC_ARM_SWP: + exceptionCode = EXCEPTION_ILLEGAL_INSTRUCTION; + break; + case EXC_ARM_PAC_FAIL: + // PAC Authentication failure fall through + default: + exceptionCode = EXCEPTION_ACCESS_VIOLATION; + } +#else +#error Unexpected architecture +#endif pExceptionRecord->NumberParameters = 2; pExceptionRecord->ExceptionInformation[0] = 0; pExceptionRecord->ExceptionInformation[1] = exceptionInfo.Subcodes[1]; - NONPAL_TRACE("subcodes[1] = %llx\n", exceptionInfo.Subcodes[1]); + NONPAL_TRACE("subcodes[1] = %llx\n", (uint64_t) exceptionInfo.Subcodes[1]); } break; @@ -468,6 +497,7 @@ BuildExceptionRecord( { switch (exceptionInfo.Subcodes[0]) { +#if defined(HOST_AMD64) case EXC_I386_DIV: exceptionCode = EXCEPTION_INT_DIVIDE_BY_ZERO; break; @@ -480,6 +510,28 @@ BuildExceptionRecord( case EXC_I386_BOUND: exceptionCode = EXCEPTION_ARRAY_BOUNDS_EXCEEDED; break; +#elif defined(HOST_ARM64) + case EXC_ARM_FP_IO: + exceptionCode = EXCEPTION_FLT_INVALID_OPERATION; + break; + case EXC_ARM_FP_DZ: + exceptionCode = EXCEPTION_FLT_DIVIDE_BY_ZERO; + break; + case EXC_ARM_FP_OF: + exceptionCode = EXCEPTION_FLT_OVERFLOW; + break; + case EXC_ARM_FP_UF: + exceptionCode = EXCEPTION_FLT_UNDERFLOW; + break; + case EXC_ARM_FP_IX: + exceptionCode = EXCEPTION_FLT_INEXACT_RESULT; + break; + case EXC_ARM_FP_ID: + exceptionCode = EXCEPTION_FLT_DENORMAL_OPERAND; + break; +#else +#error Unexpected architecture +#endif default: exceptionCode = EXCEPTION_ILLEGAL_INSTRUCTION; break; @@ -493,6 +545,7 @@ BuildExceptionRecord( // Trace, breakpoint, etc. Details in subcode field. case EXC_BREAKPOINT: +#if defined(HOST_AMD64) if (exceptionInfo.Subcodes[0] == EXC_I386_SGL) { exceptionCode = EXCEPTION_SINGLE_STEP; @@ -501,6 +554,14 @@ BuildExceptionRecord( { exceptionCode = EXCEPTION_BREAKPOINT; } +#elif defined(HOST_ARM64) + if (exceptionInfo.Subcodes[0] == EXC_ARM_BREAKPOINT) + { + exceptionCode = EXCEPTION_BREAKPOINT; + } +#else +#error Unexpected architecture +#endif else { WARN("unexpected subcode %d for EXC_BREAKPOINT", exceptionInfo.Subcodes[0]); @@ -594,12 +655,26 @@ HijackFaultingThread( // Fill in the exception record from the exception info BuildExceptionRecord(exceptionInfo, &exceptionRecord); +#if defined(HOST_AMD64) threadContext.ContextFlags = CONTEXT_FLOATING_POINT; CONTEXT_GetThreadContextFromThreadState(x86_FLOAT_STATE, (thread_state_t)&exceptionInfo.FloatState, &threadContext); threadContext.ContextFlags |= CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS; CONTEXT_GetThreadContextFromThreadState(x86_THREAD_STATE, (thread_state_t)&exceptionInfo.ThreadState, &threadContext); + void **targetSP = (void **)threadContext.Rsp; +#elif defined(HOST_ARM64) + threadContext.ContextFlags = CONTEXT_FLOATING_POINT; + CONTEXT_GetThreadContextFromThreadState(ARM_NEON_STATE64, (thread_state_t)&exceptionInfo.FloatState, &threadContext); + + threadContext.ContextFlags |= CONTEXT_CONTROL | CONTEXT_INTEGER; + CONTEXT_GetThreadContextFromThreadState(ARM_THREAD_STATE64, (thread_state_t)&exceptionInfo.ThreadState, &threadContext); + + void **targetSP = (void **)threadContext.Sp; +#else +#error Unexpected architecture +#endif + // For CoreCLR we look more deeply at access violations to determine whether they're the result of a stack // overflow. If so we'll terminate the process immediately (the current default policy of the CoreCLR EE). // Otherwise we'll either A/V ourselves trying to set up the SEH exception record and context on the @@ -653,7 +728,7 @@ HijackFaultingThread( // Calculate the page base addresses for the fault and the faulting thread's SP. int cbPage = getpagesize(); char *pFaultPage = (char*)(exceptionRecord.ExceptionInformation[1] & ~(cbPage - 1)); - char *pStackTopPage = (char*)(threadContext.Rsp & ~(cbPage - 1)); + char *pStackTopPage = (char*)((size_t)targetSP & ~(cbPage - 1)); if (pFaultPage == pStackTopPage || pFaultPage == (pStackTopPage - cbPage)) { @@ -697,7 +772,6 @@ HijackFaultingThread( { // Check if we can read pointer sizeD bytes below the target thread's stack pointer. // If we are unable to, then it implies we have run into SO. - void **targetSP = (void **)threadContext.Rsp; vm_address_t targetAddr = (mach_vm_address_t)(targetSP); targetAddr -= sizeof(void *); vm_size_t vm_size = sizeof(void *); @@ -711,6 +785,15 @@ HijackFaultingThread( } } + if (fIsStackOverflow) + { + exceptionRecord.ExceptionCode = EXCEPTION_STACK_OVERFLOW; + } + + exceptionRecord.ExceptionFlags = EXCEPTION_IS_SIGNAL; + exceptionRecord.ExceptionRecord = NULL; + +#if defined(HOST_AMD64) NONPAL_ASSERTE(exceptionInfo.ThreadState.tsh.flavor == x86_THREAD_STATE64); // Make a copy of the thread state because the one in exceptionInfo needs to be preserved to restore @@ -723,16 +806,20 @@ HijackFaultingThread( ts64.__rflags &= ~EFL_TF; } - if (fIsStackOverflow) - { - exceptionRecord.ExceptionCode = EXCEPTION_STACK_OVERFLOW; - } - - exceptionRecord.ExceptionFlags = EXCEPTION_IS_SIGNAL; - exceptionRecord.ExceptionRecord = NULL; exceptionRecord.ExceptionAddress = (void *)ts64.__rip; - void **FramePointer; + void **FramePointer = (void **)ts64.__rsp; +#elif defined(HOST_ARM64) + // Make a copy of the thread state because the one in exceptionInfo needs to be preserved to restore + // the state if the exception is forwarded. + arm_thread_state64_t ts64 = exceptionInfo.ThreadState; + + exceptionRecord.ExceptionAddress = (void *)arm_thread_state64_get_pc_fptr(ts64); + + void **FramePointer = (void **)arm_thread_state64_get_sp(ts64); +#else +#error Unexpected architecture +#endif if (fIsStackOverflow) { @@ -751,12 +838,6 @@ HijackFaultingThread( FramePointer = (void**)((size_t)stackOverflowHandlerStack + stackOverflowStackSize); } - else - { - FramePointer = (void **)ts64.__rsp; - } - - *--FramePointer = (void *)ts64.__rip; // Construct a stack frame for a pretend activation of the function // PAL_DispatchExceptionWrapper that serves only to make the stack @@ -764,8 +845,19 @@ HijackFaultingThread( // PAL_DispatchExceptionWrapper has an ebp frame, its local variables // are the context and exception record, and it has just "called" // PAL_DispatchException. +#if defined(HOST_AMD64) + *--FramePointer = (void *)ts64.__rip; *--FramePointer = (void *)ts64.__rbp; + ts64.__rbp = (SIZE_T)FramePointer; +#elif defined(HOST_ARM64) + *--FramePointer = (void *)arm_thread_state64_get_pc_fptr(ts64); + *--FramePointer = (void *)arm_thread_state64_get_fp(ts64); + + arm_thread_state64_set_fp(ts64, FramePointer); +#else +#error Unexpected architecture +#endif // Put the context on the stack FramePointer = (void **)((ULONG_PTR)FramePointer - sizeof(CONTEXT)); @@ -783,6 +875,7 @@ HijackFaultingThread( MachExceptionInfo *pMachExceptionInfo = (MachExceptionInfo *)FramePointer; *pMachExceptionInfo = exceptionInfo; +#if defined(HOST_AMD64) // Push arguments to PAL_DispatchException FramePointer = (void **)((ULONG_PTR)FramePointer - 3 * sizeof(void *)); @@ -802,6 +895,26 @@ HijackFaultingThread( // Now set the thread state for the faulting thread so that PAL_DispatchException executes next machret = thread_set_state(thread, x86_THREAD_STATE64, (thread_state_t)&ts64, x86_THREAD_STATE64_COUNT); CHECK_MACH("thread_set_state(thread)", machret); +#elif defined(HOST_ARM64) + // Setup arguments to PAL_DispatchException + ts64.__x[0] = (uint64_t)pContext; + ts64.__x[1] = (uint64_t)pExceptionRecord; + ts64.__x[2] = (uint64_t)pMachExceptionInfo; + + // Make sure it's aligned - SP has 16-byte alignment + FramePointer = (void **)((ULONG_PTR)FramePointer - ((ULONG_PTR)FramePointer % 16)); + arm_thread_state64_set_sp(ts64, FramePointer); + + // Make the call to DispatchException + arm_thread_state64_set_lr_fptr(ts64, (uint64_t)PAL_DispatchExceptionWrapper + PAL_DispatchExceptionReturnOffset); + arm_thread_state64_set_pc_fptr(ts64, PAL_DispatchException); + + // Now set the thread state for the faulting thread so that PAL_DispatchException executes next + machret = thread_set_state(thread, ARM_THREAD_STATE64, (thread_state_t)&ts64, ARM_THREAD_STATE64_COUNT); + CHECK_MACH("thread_set_state(thread)", machret); +#else +#error Unexpected architecture +#endif } /*++ @@ -932,8 +1045,9 @@ SEHExceptionThread(void *args) int subcode_count = sMessage.GetExceptionCodeCount(); for (int i = 0; i < subcode_count; i++) - NONPAL_TRACE("ExceptionNotification subcode[%d] = %llx\n", i, sMessage.GetExceptionCode(i)); + NONPAL_TRACE("ExceptionNotification subcode[%d] = %llx\n", i, (uint64_t) sMessage.GetExceptionCode(i)); +#if defined(HOST_AMD64) x86_thread_state64_t threadStateActual; unsigned int count = sizeof(threadStateActual) / sizeof(unsigned); machret = thread_get_state(thread, x86_THREAD_STATE64, (thread_state_t)&threadStateActual, &count); @@ -957,6 +1071,31 @@ SEHExceptionThread(void *args) threadExceptionState.__cpu, threadExceptionState.__err, threadExceptionState.__faultvaddr); +#elif defined(HOST_ARM64) + arm_thread_state64_t threadStateActual; + unsigned int count = sizeof(threadStateActual) / sizeof(unsigned); + machret = thread_get_state(thread, ARM_THREAD_STATE64, (thread_state_t)&threadStateActual, &count); + CHECK_MACH("thread_get_state", machret); + + NONPAL_TRACE("ExceptionNotification actual lr %p sp %016llx fp %016llx pc %p cpsr %08x\n", + arm_thread_state64_get_lr_fptr(threadStateActual), + arm_thread_state64_get_sp(threadStateActual), + arm_thread_state64_get_fp(threadStateActual), + arm_thread_state64_get_pc_fptr(threadStateActual), + threadStateActual.__cpsr); + + arm_exception_state64_t threadExceptionState; + unsigned int ehStateCount = sizeof(threadExceptionState) / sizeof(unsigned); + machret = thread_get_state(thread, ARM_EXCEPTION_STATE64, (thread_state_t)&threadExceptionState, &ehStateCount); + CHECK_MACH("thread_get_state", machret); + + NONPAL_TRACE("ExceptionNotification far %016llx esr %08x exception %08x\n", + threadExceptionState.__far, + threadExceptionState.__esr, + threadExceptionState.__exception); +#else +#error Unexpected architecture +#endif } #endif // _DEBUG @@ -1081,6 +1220,7 @@ MachExceptionInfo::MachExceptionInfo(mach_port_t thread, MachMessage& message) for (int i = 0; i < SubcodeCount; i++) Subcodes[i] = message.GetExceptionCode(i); +#if defined(HOST_AMD64) mach_msg_type_number_t count = x86_THREAD_STATE_COUNT; machret = thread_get_state(thread, x86_THREAD_STATE, (thread_state_t)&ThreadState, &count); CHECK_MACH("thread_get_state", machret); @@ -1092,6 +1232,21 @@ MachExceptionInfo::MachExceptionInfo(mach_port_t thread, MachMessage& message) count = x86_DEBUG_STATE_COUNT; machret = thread_get_state(thread, x86_DEBUG_STATE, (thread_state_t)&DebugState, &count); CHECK_MACH("thread_get_state(debug)", machret); +#elif defined(HOST_ARM64) + mach_msg_type_number_t count = ARM_THREAD_STATE64_COUNT; + machret = thread_get_state(thread, ARM_THREAD_STATE64, (thread_state_t)&ThreadState, &count); + CHECK_MACH("thread_get_state", machret); + + count = ARM_NEON_STATE64_COUNT; + machret = thread_get_state(thread, ARM_NEON_STATE64, (thread_state_t)&FloatState, &count); + CHECK_MACH("thread_get_state(float)", machret); + + count = ARM_DEBUG_STATE64_COUNT; + machret = thread_get_state(thread, ARM_DEBUG_STATE64, (thread_state_t)&DebugState, &count); + CHECK_MACH("thread_get_state(debug)", machret); +#else +#error Unexpected architecture +#endif } /*++ @@ -1108,6 +1263,7 @@ Return value : --*/ void MachExceptionInfo::RestoreState(mach_port_t thread) { +#if defined(HOST_AMD64) // If we are restarting a breakpoint, we need to bump the IP back one to // point at the actual int 3 instructions. if (ExceptionType == EXC_BREAKPOINT) @@ -1125,6 +1281,18 @@ void MachExceptionInfo::RestoreState(mach_port_t thread) machret = thread_set_state(thread, x86_DEBUG_STATE, (thread_state_t)&DebugState, x86_DEBUG_STATE_COUNT); CHECK_MACH("thread_set_state(debug)", machret); +#elif defined(HOST_ARM64) + kern_return_t machret = thread_set_state(thread, ARM_THREAD_STATE64, (thread_state_t)&ThreadState, ARM_THREAD_STATE64_COUNT); + CHECK_MACH("thread_set_state(thread)", machret); + + machret = thread_set_state(thread, ARM_NEON_STATE64, (thread_state_t)&FloatState, ARM_NEON_STATE64_COUNT); + CHECK_MACH("thread_set_state(float)", machret); + + machret = thread_set_state(thread, ARM_DEBUG_STATE64, (thread_state_t)&DebugState, ARM_DEBUG_STATE64_COUNT); + CHECK_MACH("thread_set_state(debug)", machret); +#else +#error Unexpected architecture +#endif } /*++ @@ -1257,7 +1425,13 @@ ActivationHandler(CONTEXT* context) g_activationFunction(context); } +#ifdef TARGET_ARM64 + // RtlRestoreContext assembly corrupts X16 & X17, so it cannot be + // used for Activation restore + MachSetThreadContext(context); +#else RtlRestoreContext(context, NULL); +#endif DebugBreak(); } @@ -1265,6 +1439,30 @@ extern "C" void ActivationHandlerWrapper(); extern "C" int ActivationHandlerReturnOffset; extern "C" unsigned int XmmYmmStateSupport(); +#if defined(HOST_AMD64) +bool IsHardwareException(x86_exception_state64_t exceptionState) +{ + static const int MaxHardwareExceptionVector = 31; + return exceptionState.__trapno <= MaxHardwareExceptionVector; +} +#elif defined(HOST_ARM64) +bool IsHardwareException(arm_exception_state64_t exceptionState) +{ + // Infer exception state from the ESR_EL* register value. + // Bits 31-26 represent the ESR.EC field + const int ESR_EC_SHIFT = 26; + const int ESR_EC_MASK = 0x3f; + const int esr_ec = (exceptionState.__esr >> ESR_EC_SHIFT) & ESR_EC_MASK; + + const int ESR_EC_SVC = 0x15; // Supervisor Call exception from aarch64. + + // Assume only supervisor calls from aarch64 are not hardware exceptions + return (esr_ec != ESR_EC_SVC); +} +#else +#error Unexpected architecture +#endif + /*++ Function : InjectActivationInternal @@ -1289,28 +1487,44 @@ InjectActivationInternal(CPalThread* pThread) if (palError == NO_ERROR) { - mach_msg_type_number_t count; - +#if defined(HOST_AMD64) x86_exception_state64_t ExceptionState; - count = x86_EXCEPTION_STATE64_COUNT; + const thread_state_flavor_t exceptionFlavor = x86_EXCEPTION_STATE64; + const mach_msg_type_number_t exceptionCount = x86_EXCEPTION_STATE64_COUNT; + + x86_thread_state64_t ThreadState; + const thread_state_flavor_t threadFlavor = x86_THREAD_STATE64; + const mach_msg_type_number_t threadCount = x86_THREAD_STATE64_COUNT; +#elif defined(HOST_ARM64) + arm_exception_state64_t ExceptionState; + const thread_state_flavor_t exceptionFlavor = ARM_EXCEPTION_STATE64; + const mach_msg_type_number_t exceptionCount = ARM_EXCEPTION_STATE64_COUNT; + + arm_thread_state64_t ThreadState; + const thread_state_flavor_t threadFlavor = ARM_THREAD_STATE64; + const mach_msg_type_number_t threadCount = ARM_THREAD_STATE64_COUNT; +#else +#error Unexpected architecture +#endif + mach_msg_type_number_t count = exceptionCount; + MachRet = thread_get_state(threadPort, - x86_EXCEPTION_STATE64, + exceptionFlavor, (thread_state_t)&ExceptionState, &count); - _ASSERT_MSG(MachRet == KERN_SUCCESS, "thread_get_state for x86_EXCEPTION_STATE64\n"); + _ASSERT_MSG(MachRet == KERN_SUCCESS, "thread_get_state for *_EXCEPTION_STATE64\n"); // Inject the activation only if the thread doesn't have a pending hardware exception - static const int MaxHardwareExceptionVector = 31; - if (ExceptionState.__trapno > MaxHardwareExceptionVector) + if (!IsHardwareException(ExceptionState)) { - x86_thread_state64_t ThreadState; - count = x86_THREAD_STATE64_COUNT; + count = threadCount; MachRet = thread_get_state(threadPort, - x86_THREAD_STATE64, + threadFlavor, (thread_state_t)&ThreadState, &count); - _ASSERT_MSG(MachRet == KERN_SUCCESS, "thread_get_state for x86_THREAD_STATE64\n"); + _ASSERT_MSG(MachRet == KERN_SUCCESS, "thread_get_state for *_THREAD_STATE64\n"); +#if defined(HOST_AMD64) if ((g_safeActivationCheckFunction != NULL) && g_safeActivationCheckFunction(ThreadState.__rip, /* checkingCurrentThread */ FALSE)) { // TODO: it would be nice to preserve the red zone in case a jitter would want to use it @@ -1319,15 +1533,29 @@ InjectActivationInternal(CPalThread* pThread) *(--sp) = ThreadState.__rip; *(--sp) = ThreadState.__rbp; size_t rbpAddress = (size_t)sp; +#elif defined(HOST_ARM64) + if ((g_safeActivationCheckFunction != NULL) && g_safeActivationCheckFunction((size_t)arm_thread_state64_get_pc_fptr(ThreadState), /* checkingCurrentThread */ FALSE)) + { + // TODO: it would be nice to preserve the red zone in case a jitter would want to use it + // Do we really care about unwinding through the wrapper? + size_t* sp = (size_t*)arm_thread_state64_get_sp(ThreadState); + *(--sp) = (size_t)arm_thread_state64_get_pc_fptr(ThreadState); + *(--sp) = arm_thread_state64_get_fp(ThreadState); + size_t fpAddress = (size_t)sp; +#else +#error Unexpected architecture +#endif size_t contextAddress = (((size_t)sp) - sizeof(CONTEXT)) & ~15; - size_t returnAddressAddress = contextAddress - sizeof(size_t); - *(size_t*)(returnAddressAddress) = ActivationHandlerReturnOffset + (size_t)ActivationHandlerWrapper; // Fill in the context in the helper frame with the full context of the suspended thread. // The ActivationHandler will use the context to resume the execution of the thread // after the activation function returns. CONTEXT *pContext = (CONTEXT *)contextAddress; +#if defined(HOST_AMD64) pContext->ContextFlags = CONTEXT_FULL | CONTEXT_SEGMENTS; +#else + pContext->ContextFlags = CONTEXT_FULL; +#endif #ifdef XSTATE_SUPPORTED if (XmmYmmStateSupport() == 1) { @@ -1337,16 +1565,30 @@ InjectActivationInternal(CPalThread* pThread) MachRet = CONTEXT_GetThreadContextFromPort(threadPort, pContext); _ASSERT_MSG(MachRet == KERN_SUCCESS, "CONTEXT_GetThreadContextFromPort\n"); +#if defined(HOST_AMD64) + size_t returnAddressAddress = contextAddress - sizeof(size_t); + *(size_t*)(returnAddressAddress) = ActivationHandlerReturnOffset + (size_t)ActivationHandlerWrapper; + // Make the instruction register point to ActivationHandler ThreadState.__rip = (size_t)ActivationHandler; ThreadState.__rsp = returnAddressAddress; ThreadState.__rbp = rbpAddress; ThreadState.__rdi = contextAddress; +#elif defined(HOST_ARM64) + // Make the call to ActivationHandler + arm_thread_state64_set_lr_fptr(ThreadState, ActivationHandlerReturnOffset + (size_t)ActivationHandlerWrapper); + arm_thread_state64_set_pc_fptr(ThreadState, ActivationHandler); + arm_thread_state64_set_sp(ThreadState, contextAddress); + arm_thread_state64_set_fp(ThreadState, fpAddress); + ThreadState.__x[0] = contextAddress; +#else +#error Unexpected architecture +#endif MachRet = thread_set_state(threadPort, - x86_THREAD_STATE64, + threadFlavor, (thread_state_t)&ThreadState, - count); + threadCount); _ASSERT_MSG(MachRet == KERN_SUCCESS, "thread_set_state\n"); } } diff --git a/src/coreclr/src/pal/src/exception/machmessage.cpp b/src/coreclr/src/pal/src/exception/machmessage.cpp index 0c0021855395..049b93500bce 100644 --- a/src/coreclr/src/pal/src/exception/machmessage.cpp +++ b/src/coreclr/src/pal/src/exception/machmessage.cpp @@ -1013,6 +1013,10 @@ thread_act_t MachMessage::GetThreadFromState(thread_state_flavor_t eFlavor, thre case x86_THREAD_STATE64: targetSP = ((x86_thread_state64_t*)pState)->__rsp; break; +#elif defined(HOST_ARM64) + case ARM_THREAD_STATE64: + targetSP = arm_thread_state64_get_sp(*(arm_thread_state64_t*)pState); + break; #else #error Unexpected architecture. #endif @@ -1031,9 +1035,17 @@ thread_act_t MachMessage::GetThreadFromState(thread_state_flavor_t eFlavor, thre for (mach_msg_type_number_t i = 0; i < cThreads; i++) { // Get the general register state of each thread. +#if defined(HOST_AMD64) x86_thread_state_t threadState; mach_msg_type_number_t count = x86_THREAD_STATE_COUNT; machret = thread_get_state(pThreads[i], x86_THREAD_STATE, (thread_state_t)&threadState, &count); +#elif defined(HOST_ARM64) + arm_thread_state64_t threadState; + mach_msg_type_number_t count = ARM_THREAD_STATE64_COUNT; + machret = thread_get_state(pThreads[i], ARM_THREAD_STATE64, (thread_state_t)&threadState, &count); +#else +#error Unexpected architecture +#endif if (machret == KERN_SUCCESS) { // If a thread has the same SP as our target it should be the same thread (otherwise we have two @@ -1044,6 +1056,8 @@ thread_act_t MachMessage::GetThreadFromState(thread_state_flavor_t eFlavor, thre if (threadState.uts.ts32.esp == targetSP) #elif defined(HOST_AMD64) if (threadState.uts.ts64.__rsp == targetSP) +#elif defined(HOST_ARM64) + if (arm_thread_state64_get_sp(threadState) == targetSP) #else #error Unexpected architecture. #endif diff --git a/src/coreclr/src/pal/src/exception/machmessage.h b/src/coreclr/src/pal/src/exception/machmessage.h index bf544d66f98c..ff288ad6f25b 100644 --- a/src/coreclr/src/pal/src/exception/machmessage.h +++ b/src/coreclr/src/pal/src/exception/machmessage.h @@ -87,10 +87,17 @@ struct MachExceptionInfo exception_type_t ExceptionType; mach_msg_type_number_t SubcodeCount; MACH_EH_TYPE(exception_data_type_t) Subcodes[2]; +#if defined(HOST_AMD64) x86_thread_state_t ThreadState; x86_float_state_t FloatState; x86_debug_state_t DebugState; - +#elif defined(HOST_ARM64) + arm_thread_state64_t ThreadState; + arm_neon_state64_t FloatState; + arm_debug_state64_t DebugState; +#else +#error Unexpected architecture +#endif MachExceptionInfo(mach_port_t thread, MachMessage& message); void RestoreState(mach_port_t thread); }; diff --git a/src/coreclr/src/pal/src/exception/remote-unwind.cpp b/src/coreclr/src/pal/src/exception/remote-unwind.cpp index 91f819370f40..46d520f08772 100644 --- a/src/coreclr/src/pal/src/exception/remote-unwind.cpp +++ b/src/coreclr/src/pal/src/exception/remote-unwind.cpp @@ -75,6 +75,11 @@ SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); #define TRACE_VERBOSE +#include "crosscomp.h" + +#define KNONVOLATILE_CONTEXT_POINTERS T_KNONVOLATILE_CONTEXT_POINTERS +#define CONTEXT T_CONTEXT + #else // HOST_UNIX #include @@ -1115,7 +1120,7 @@ SearchCompactEncodingSection( --personalityIndex; // change 1-based to zero-based index if (personalityIndex > sectionHeader.personalityArrayCount) { - ERROR("Invalid personality index\n"); + ERROR("Invalid personality index\n"); return false; } int32_t personalityDelta; @@ -1217,7 +1222,7 @@ GetProcInfo(unw_word_t ip, unw_proc_info_t *pip, const libunwindInfo* info, bool segment_command_64* segment = (segment_command_64*)command; // Calculate the load bias for the module. This is the value to add to the vmaddr of a - // segment to get the actual address. + // segment to get the actual address. if (strcmp(segment->segname, SEG_TEXT) == 0) { loadBias = info->BaseAddress - segment->vmaddr; @@ -1296,6 +1301,7 @@ GetProcInfo(unw_word_t ip, unw_proc_info_t *pip, const libunwindInfo* info, bool return false; } +#if defined(TARGET_AMD64) static bool StepWithCompactEncodingRBPFrame(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding) { @@ -1364,10 +1370,143 @@ StepWithCompactEncodingRBPFrame(const libunwindInfo* info, compact_unwind_encodi compactEncoding, (void*)context->Rip, (void*)context->Rsp, (void*)context->Rbp); return true; } +#endif + +#if defined(TARGET_ARM64) +inline static bool +ReadCompactEncodingRegister(const libunwindInfo* info, unw_word_t* addr, DWORD64* reg) +{ + *addr -= sizeof(uint64_t); + if (!ReadValue64(info, addr, (uint64_t*)reg)) { + return false; + } + return true; +} + +inline static bool +ReadCompactEncodingRegisterPair(const libunwindInfo* info, unw_word_t* addr, DWORD64*second, DWORD64* first) +{ + // Registers are effectively pushed in pairs + // + // *addr -= 8 + // **addr = *first + // *addr -= 8 + // **addr = *second + if (!ReadCompactEncodingRegister(info, addr, first)) { + return false; + } + if (!ReadCompactEncodingRegister(info, addr, second)) { + return false; + } + return true; +} + +inline static bool +ReadCompactEncodingRegisterPair(const libunwindInfo* info, unw_word_t* addr, NEON128*second, NEON128* first) +{ + if (!ReadCompactEncodingRegisterPair(info, addr, &first->Low, &second->Low)) { + return false; + } + first->High = 0; + second->High = 0; + return true; +} + +// Saved registers are pushed +// + in pairs +// + in register number order (after the option frame registers) +// + after the callers SP +// +// Given C++ code that generates this prologue spill sequence +// +// sub sp, sp, #128 ; =128 +// stp d15, d14, [sp, #16] ; 16-byte Folded Spill +// stp d13, d12, [sp, #32] ; 16-byte Folded Spill +// stp d11, d10, [sp, #48] ; 16-byte Folded Spill +// stp d9, d8, [sp, #64] ; 16-byte Folded Spill +// stp x22, x21, [sp, #80] ; 16-byte Folded Spill +// stp x20, x19, [sp, #96] ; 16-byte Folded Spill +// stp x29, x30, [sp, #112] ; 16-byte Folded Spill +// add x29, sp, #112 ; =112 +// +// The compiler generates: +// compactEncoding = 0x04000f03; +static bool +StepWithCompactEncodingArm64(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding, bool hasFrame) +{ + CONTEXT* context = info->Context; + + unw_word_t callerSp; + + if (hasFrame) { + // caller Sp is callee Fp plus saved FP and LR + callerSp = context->Fp + 2 * sizeof(uint64_t); + } else { + // Get the leat significant bit in UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK + uint64_t stackSizeScale = UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK & ~(UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK - 1); + uint64_t stackSize = (compactEncoding & UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK) / stackSizeScale * 16; + + callerSp = context->Sp + stackSize; + } + + context->Sp = callerSp; + + // return address is stored in Lr + context->Pc = context->Lr; + + unw_word_t addr = callerSp; + + if (hasFrame && + !ReadCompactEncodingRegisterPair(info, &addr, &context->Lr, &context->Fp)) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_X19_X20_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->X[19], &context->X[20])) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_X21_X22_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->X[21], &context->X[22])) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_X23_X24_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->X[23], &context->X[24])) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_X25_X26_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->X[25], &context->X[26])) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_X27_X28_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->X[27], &context->X[28])) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_D8_D9_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->V[8], &context->V[9])) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_D10_D11_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->V[10], &context->V[11])) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_D12_D13_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->V[12], &context->V[13])) { + return false; + } + if (compactEncoding & UNWIND_ARM64_FRAME_D14_D15_PAIR && + !ReadCompactEncodingRegisterPair(info, &addr, &context->V[14], &context->V[15])) { + return false; + } + + TRACE("SUCCESS: compact step encoding %08x pc %p sp %p fp %p lr %p\n", + compactEncoding, (void*)context->Pc, (void*)context->Sp, (void*)context->Fp, (void*)context->Lr); + return true; +} +#endif static bool StepWithCompactEncoding(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding, unw_word_t functionStart) { +#if defined(TARGET_AMD64) if (compactEncoding == 0) { TRACE("Compact unwind missing for %p\n", (void*)info->Context->Rip); @@ -1381,8 +1520,30 @@ StepWithCompactEncoding(const libunwindInfo* info, compact_unwind_encoding_t com case UNWIND_X86_64_MODE_STACK_IMMD: case UNWIND_X86_64_MODE_STACK_IND: break; - + + case UNWIND_X86_64_MODE_DWARF: + return false; } +#elif defined(TARGET_ARM64) + if (compactEncoding == 0) + { + TRACE("Compact unwind missing for %p\n", (void*)info->Context->Pc); + return false; + } + switch (compactEncoding & UNWIND_ARM64_MODE_MASK) + { + case UNWIND_ARM64_MODE_FRAME: + return StepWithCompactEncodingArm64(info, compactEncoding, true); + + case UNWIND_ARM64_MODE_FRAMELESS: + return StepWithCompactEncodingArm64(info, compactEncoding, false); + + case UNWIND_ARM64_MODE_DWARF: + return false; + } +#else +#error unsupported architecture +#endif ERROR("Invalid encoding %08x\n", compactEncoding); return false; } @@ -1411,19 +1572,19 @@ static void GetContextPointer(unw_cursor_t *cursor, unw_context_t *unwContext, i static void GetContextPointers(unw_cursor_t *cursor, unw_context_t *unwContext, KNONVOLATILE_CONTEXT_POINTERS *contextPointers) { -#if (defined(HOST_UNIX) && defined(HOST_AMD64)) || (defined(HOST_WINDOWS) && defined(TARGET_AMD64)) +#if defined(TARGET_AMD64) GetContextPointer(cursor, unwContext, UNW_X86_64_RBP, &contextPointers->Rbp); GetContextPointer(cursor, unwContext, UNW_X86_64_RBX, &contextPointers->Rbx); GetContextPointer(cursor, unwContext, UNW_X86_64_R12, &contextPointers->R12); GetContextPointer(cursor, unwContext, UNW_X86_64_R13, &contextPointers->R13); GetContextPointer(cursor, unwContext, UNW_X86_64_R14, &contextPointers->R14); GetContextPointer(cursor, unwContext, UNW_X86_64_R15, &contextPointers->R15); -#elif (defined(HOST_UNIX) && defined(HOST_X86)) || (defined(HOST_WINDOWS) && defined(TARGET_X86)) +#elif defined(TARGET_X86) GetContextPointer(cursor, unwContext, UNW_X86_EBX, &contextPointers->Ebx); GetContextPointer(cursor, unwContext, UNW_X86_EBP, &contextPointers->Ebp); GetContextPointer(cursor, unwContext, UNW_X86_ESI, &contextPointers->Esi); GetContextPointer(cursor, unwContext, UNW_X86_EDI, &contextPointers->Edi); -#elif (defined(HOST_UNIX) && defined(HOST_ARM)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM)) +#elif defined(TARGET_ARM) GetContextPointer(cursor, unwContext, UNW_ARM_R4, &contextPointers->R4); GetContextPointer(cursor, unwContext, UNW_ARM_R5, &contextPointers->R5); GetContextPointer(cursor, unwContext, UNW_ARM_R6, &contextPointers->R6); @@ -1432,7 +1593,7 @@ static void GetContextPointers(unw_cursor_t *cursor, unw_context_t *unwContext, GetContextPointer(cursor, unwContext, UNW_ARM_R9, &contextPointers->R9); GetContextPointer(cursor, unwContext, UNW_ARM_R10, &contextPointers->R10); GetContextPointer(cursor, unwContext, UNW_ARM_R11, &contextPointers->R11); -#elif (defined(HOST_UNIX) && defined(HOST_ARM64)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM64)) +#elif defined(TARGET_ARM64) GetContextPointer(cursor, unwContext, UNW_AARCH64_X19, &contextPointers->X19); GetContextPointer(cursor, unwContext, UNW_AARCH64_X20, &contextPointers->X20); GetContextPointer(cursor, unwContext, UNW_AARCH64_X21, &contextPointers->X21); @@ -1451,7 +1612,7 @@ static void GetContextPointers(unw_cursor_t *cursor, unw_context_t *unwContext, static void UnwindContextToContext(unw_cursor_t *cursor, CONTEXT *winContext) { -#if (defined(HOST_UNIX) && defined(HOST_AMD64)) || (defined(HOST_WINDOWS) && defined(TARGET_AMD64)) +#if defined(TARGET_AMD64) unw_get_reg(cursor, UNW_REG_IP, (unw_word_t *) &winContext->Rip); unw_get_reg(cursor, UNW_REG_SP, (unw_word_t *) &winContext->Rsp); unw_get_reg(cursor, UNW_X86_64_RBP, (unw_word_t *) &winContext->Rbp); @@ -1460,14 +1621,14 @@ static void UnwindContextToContext(unw_cursor_t *cursor, CONTEXT *winContext) unw_get_reg(cursor, UNW_X86_64_R13, (unw_word_t *) &winContext->R13); unw_get_reg(cursor, UNW_X86_64_R14, (unw_word_t *) &winContext->R14); unw_get_reg(cursor, UNW_X86_64_R15, (unw_word_t *) &winContext->R15); -#elif (defined(HOST_UNIX) && defined(HOST_X86)) || (defined(HOST_WINDOWS) && defined(TARGET_X86)) +#elif defined(TARGET_X86) unw_get_reg(cursor, UNW_REG_IP, (unw_word_t *) &winContext->Eip); unw_get_reg(cursor, UNW_REG_SP, (unw_word_t *) &winContext->Esp); unw_get_reg(cursor, UNW_X86_EBP, (unw_word_t *) &winContext->Ebp); unw_get_reg(cursor, UNW_X86_EBX, (unw_word_t *) &winContext->Ebx); unw_get_reg(cursor, UNW_X86_ESI, (unw_word_t *) &winContext->Esi); unw_get_reg(cursor, UNW_X86_EDI, (unw_word_t *) &winContext->Edi); -#elif (defined(HOST_UNIX) && defined(HOST_ARM)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM)) +#elif defined(TARGET_ARM) unw_get_reg(cursor, UNW_REG_IP, (unw_word_t *) &winContext->Pc); unw_get_reg(cursor, UNW_REG_SP, (unw_word_t *) &winContext->Sp); unw_get_reg(cursor, UNW_ARM_R4, (unw_word_t *) &winContext->R4); @@ -1480,7 +1641,7 @@ static void UnwindContextToContext(unw_cursor_t *cursor, CONTEXT *winContext) unw_get_reg(cursor, UNW_ARM_R11, (unw_word_t *) &winContext->R11); unw_get_reg(cursor, UNW_ARM_R14, (unw_word_t *) &winContext->Lr); TRACE("sp %p pc %p lr %p\n", winContext->Sp, winContext->Pc, winContext->Lr); -#elif (defined(HOST_UNIX) && defined(HOST_ARM64)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM64)) +#elif defined(TARGET_ARM64) unw_get_reg(cursor, UNW_REG_IP, (unw_word_t *) &winContext->Pc); unw_get_reg(cursor, UNW_REG_SP, (unw_word_t *) &winContext->Sp); unw_get_reg(cursor, UNW_AARCH64_X19, (unw_word_t *) &winContext->X19); @@ -1541,7 +1702,7 @@ access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t *valp, int write switch (regnum) { -#if (defined(HOST_UNIX) && defined(HOST_AMD64)) || (defined(HOST_WINDOWS) && defined(TARGET_AMD64)) +#if defined(TARGET_AMD64) case UNW_REG_IP: *valp = (unw_word_t)winContext->Rip; break; case UNW_REG_SP: *valp = (unw_word_t)winContext->Rsp; break; case UNW_X86_64_RBP: *valp = (unw_word_t)winContext->Rbp; break; @@ -1550,14 +1711,14 @@ access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t *valp, int write case UNW_X86_64_R13: *valp = (unw_word_t)winContext->R13; break; case UNW_X86_64_R14: *valp = (unw_word_t)winContext->R14; break; case UNW_X86_64_R15: *valp = (unw_word_t)winContext->R15; break; -#elif (defined(HOST_UNIX) && defined(HOST_X86)) || (defined(HOST_WINDOWS) && defined(TARGET_X86)) +#elif defined(TARGET_X86) case UNW_REG_IP: *valp = (unw_word_t)winContext->Eip; break; case UNW_REG_SP: *valp = (unw_word_t)winContext->Esp; break; case UNW_X86_EBX: *valp = (unw_word_t)winContext->Ebx; break; case UNW_X86_ESI: *valp = (unw_word_t)winContext->Esi; break; case UNW_X86_EDI: *valp = (unw_word_t)winContext->Edi; break; case UNW_X86_EBP: *valp = (unw_word_t)winContext->Ebp; break; -#elif (defined(HOST_UNIX) && defined(HOST_ARM)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM)) +#elif defined(TARGET_ARM) case UNW_ARM_R4: *valp = (unw_word_t)winContext->R4; break; case UNW_ARM_R5: *valp = (unw_word_t)winContext->R5; break; case UNW_ARM_R6: *valp = (unw_word_t)winContext->R6; break; @@ -1569,7 +1730,7 @@ access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t *valp, int write case UNW_ARM_R13: *valp = (unw_word_t)winContext->Sp; break; case UNW_ARM_R14: *valp = (unw_word_t)winContext->Lr; break; case UNW_ARM_R15: *valp = (unw_word_t)winContext->Pc; break; -#elif (defined(HOST_UNIX) && defined(HOST_ARM64)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM64)) +#elif defined(TARGET_ARM64) case UNW_AARCH64_X19: *valp = (unw_word_t)winContext->X19; break; case UNW_AARCH64_X20: *valp = (unw_word_t)winContext->X20; break; case UNW_AARCH64_X21: *valp = (unw_word_t)winContext->X21; break; @@ -1709,7 +1870,7 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pip, int nee if (dynamicAddr != nullptr) { - for (;;) + while (true) { Dyn dyn; if (!info->ReadMemory(dynamicAddr, &dyn, sizeof(dyn))) { @@ -1853,10 +2014,17 @@ PAL_VirtualUnwindOutOfProc(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *cont info.ReadMemory = readMemoryCallback; #ifdef __APPLE__ - TRACE("Unwind: rip %p rsp %p rbp %p\n", (void*)context->Rip, (void*)context->Rsp, (void*)context->Rbp); unw_proc_info_t procInfo; bool step; +#if defined(TARGET_AMD64) + TRACE("Unwind: rip %p rsp %p rbp %p\n", (void*)context->Rip, (void*)context->Rsp, (void*)context->Rbp); result = GetProcInfo(context->Rip, &procInfo, &info, &step, false); +#elif defined(TARGET_ARM64) + TRACE("Unwind: pc %p sp %p fp %p\n", (void*)context->Pc, (void*)context->Sp, (void*)context->Fp); + result = GetProcInfo(context->Pc, &procInfo, &info, &step, false); +#else +#error Unexpected architecture +#endif if (!result) { goto exit; diff --git a/src/coreclr/src/pal/src/exception/seh-unwind.cpp b/src/coreclr/src/pal/src/exception/seh-unwind.cpp index 524d7252bbff..5db8a80a88cd 100644 --- a/src/coreclr/src/pal/src/exception/seh-unwind.cpp +++ b/src/coreclr/src/pal/src/exception/seh-unwind.cpp @@ -54,6 +54,27 @@ Module Name: #endif // HOST_UNIX +#if defined(TARGET_OSX) && defined(TARGET_ARM64) +// MacOS uses ARM64 instead of AARCH64 to describe these registers +// Create aliases to reuse more code +enum +{ + UNW_AARCH64_X19 = UNW_ARM64_X19, + UNW_AARCH64_X20 = UNW_ARM64_X20, + UNW_AARCH64_X21 = UNW_ARM64_X21, + UNW_AARCH64_X22 = UNW_ARM64_X22, + UNW_AARCH64_X23 = UNW_ARM64_X23, + UNW_AARCH64_X24 = UNW_ARM64_X24, + UNW_AARCH64_X25 = UNW_ARM64_X25, + UNW_AARCH64_X26 = UNW_ARM64_X26, + UNW_AARCH64_X27 = UNW_ARM64_X27, + UNW_AARCH64_X28 = UNW_ARM64_X28, + UNW_AARCH64_X29 = UNW_ARM64_X29, + UNW_AARCH64_X30 = UNW_ARM64_X30 +}; +#endif // defined(TARGET_OSX) && defined(TARGET_ARM64) + + //---------------------------------------------------------------------- // Virtual Unwinding //---------------------------------------------------------------------- @@ -129,7 +150,7 @@ static void WinContextToUnwindContext(CONTEXT *winContext, unw_context_t *unwCon unwContext->regs[13] = winContext->Sp; unwContext->regs[14] = winContext->Lr; unwContext->regs[15] = winContext->Pc; -#elif defined(HOST_ARM64) +#elif defined(HOST_ARM64) && !defined(TARGET_OSX) unwContext->uc_mcontext.pc = winContext->Pc; unwContext->uc_mcontext.sp = winContext->Sp; unwContext->uc_mcontext.regs[29] = winContext->Fp; @@ -166,6 +187,24 @@ static void WinContextToUnwindCursor(CONTEXT *winContext, unw_cursor_t *cursor) unw_set_reg(cursor, UNW_X86_EBX, winContext->Ebx); unw_set_reg(cursor, UNW_X86_ESI, winContext->Esi); unw_set_reg(cursor, UNW_X86_EDI, winContext->Edi); +#elif defined(HOST_ARM64) && defined(TARGET_OSX) + // unw_cursor_t is an opaque data structure on macOS + // As noted in WinContextToUnwindContext this didn't work for Linux + // TBD whether this will work for macOS. + unw_set_reg(cursor, UNW_REG_IP, winContext->Pc); + unw_set_reg(cursor, UNW_REG_SP, winContext->Sp); + unw_set_reg(cursor, UNW_AARCH64_X29, winContext->Fp); + unw_set_reg(cursor, UNW_AARCH64_X30, winContext->Lr); + unw_set_reg(cursor, UNW_AARCH64_X19, winContext->X19); + unw_set_reg(cursor, UNW_AARCH64_X20, winContext->X20); + unw_set_reg(cursor, UNW_AARCH64_X21, winContext->X21); + unw_set_reg(cursor, UNW_AARCH64_X22, winContext->X22); + unw_set_reg(cursor, UNW_AARCH64_X23, winContext->X23); + unw_set_reg(cursor, UNW_AARCH64_X24, winContext->X24); + unw_set_reg(cursor, UNW_AARCH64_X25, winContext->X25); + unw_set_reg(cursor, UNW_AARCH64_X26, winContext->X26); + unw_set_reg(cursor, UNW_AARCH64_X27, winContext->X27); + unw_set_reg(cursor, UNW_AARCH64_X28, winContext->X28); #endif } #endif @@ -215,6 +254,13 @@ void UnwindContextToWinContext(unw_cursor_t *cursor, CONTEXT *winContext) unw_get_reg(cursor, UNW_AARCH64_X26, (unw_word_t *) &winContext->X26); unw_get_reg(cursor, UNW_AARCH64_X27, (unw_word_t *) &winContext->X27); unw_get_reg(cursor, UNW_AARCH64_X28, (unw_word_t *) &winContext->X28); + +#if defined(TARGET_OSX) && defined(TARGET_ARM64) + // Strip pointer authentication bits which seem to be leaking out of libunwind + // Seems like ptrauth_strip() / __builtin_ptrauth_strip() should work, but currently + // errors with "this target does not support pointer authentication" + winContext->Pc = winContext->Pc & 0x7fffffffffffull; +#endif // defined(TARGET_OSX) && defined(TARGET_ARM64) #else #error unsupported architecture #endif @@ -357,7 +403,7 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP // Check if the frame we have unwound to is a frame that caused // synchronous signal, like a hardware exception and record it // in the context flags. - if (unw_is_signal_frame(&cursor) > 0) + if ((st != 0) && (unw_is_signal_frame(&cursor) > 0)) { context->ContextFlags |= CONTEXT_EXCEPTION_ACTIVE; #if defined(CONTEXT_UNWOUND_TO_CALL) diff --git a/src/coreclr/src/pal/src/exception/signal.cpp b/src/coreclr/src/pal/src/exception/signal.cpp index de2d0ad3b700..de7ab13bdd30 100644 --- a/src/coreclr/src/pal/src/exception/signal.cpp +++ b/src/coreclr/src/pal/src/exception/signal.cpp @@ -539,7 +539,7 @@ static void sigsegv_handler(int code, siginfo_t *siginfo, void *context) } else { - (void)write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1); + (void)!write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1); PROCAbort(); } } diff --git a/src/coreclr/src/pal/src/file/directory.cpp b/src/coreclr/src/pal/src/file/directory.cpp index 5c4c0b2ae9ff..d8279bccbe95 100644 --- a/src/coreclr/src/pal/src/file/directory.cpp +++ b/src/coreclr/src/pal/src/file/directory.cpp @@ -173,52 +173,6 @@ RemoveDirectoryHelper ( return bRet; } -/*++ -Function: - RemoveDirectoryA - -See MSDN doc. ---*/ -BOOL -PALAPI -RemoveDirectoryA( - IN LPCSTR lpPathName) -{ - DWORD dwLastError = 0; - BOOL bRet = FALSE; - PathCharString mb_dirPathString; - - PERF_ENTRY(RemoveDirectoryA); - ENTRY("RemoveDirectoryA(lpPathName=%p (%s))\n", - lpPathName, - lpPathName); - - if (lpPathName == NULL) - { - dwLastError = ERROR_PATH_NOT_FOUND; - goto done; - } - - if (!mb_dirPathString.Set(lpPathName, strlen(lpPathName))) - { - WARN("Set failed !\n"); - dwLastError = ERROR_NOT_ENOUGH_MEMORY; - goto done; - } - - bRet = RemoveDirectoryHelper (mb_dirPathString, &dwLastError); - -done: - if( dwLastError ) - { - SetLastError( dwLastError ); - } - - LOGEXIT("RemoveDirectoryA returns BOOL %d\n", bRet); - PERF_EXIT(RemoveDirectoryA); - return bRet; -} - /*++ Function: RemoveDirectoryW diff --git a/src/coreclr/src/pal/src/file/file.cpp b/src/coreclr/src/pal/src/file/file.cpp index 754b2d1e256e..3adb5b95bd3c 100644 --- a/src/coreclr/src/pal/src/file/file.cpp +++ b/src/coreclr/src/pal/src/file/file.cpp @@ -292,8 +292,6 @@ CorUnix::InternalCanonicalizeRealPath(LPCSTR lpUnixPath, PathCharString& lpBuffe StringHolder lpExistingPath; LPSTR pchSeparator = NULL; LPSTR lpFilename = NULL; - DWORD cchBuffer = 0; - DWORD cchFilename = 0; #endif // !REALPATH_SUPPORTS_NONEXISTENT_FILES if (lpUnixPath == NULL) @@ -1934,8 +1932,6 @@ CorUnix::InternalWriteFile( CFileProcessLocalData *pLocalData = NULL; IDataLock *pLocalDataLock = NULL; int ifd; - - LONG writeOffsetStartLow = 0, writeOffsetStartHigh = 0; int res; if (NULL != lpNumberOfBytesWritten) @@ -2108,8 +2104,6 @@ CorUnix::InternalReadFile( CFileProcessLocalData *pLocalData = NULL; IDataLock *pLocalDataLock = NULL; int ifd; - - LONG readOffsetStartLow = 0, readOffsetStartHigh = 0; int res; if (NULL != lpNumberOfBytesRead) diff --git a/src/coreclr/src/pal/src/include/pal/cert.hpp b/src/coreclr/src/pal/src/include/pal/cert.hpp deleted file mode 100644 index 74bacfe39d73..000000000000 --- a/src/coreclr/src/pal/src/include/pal/cert.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - include/pal/cert.hpp - -Abstract: - Header file for cert structures - - - ---*/ - -#ifndef _PAL_CERT_HPP_ -#define _PAL_CERT_HPP_ - -#include "corunix.hpp" - -#include - -CorUnix::PAL_ERROR OIDToStr(CSSM_DATA &data, CHAR *&oidStrOut); - -CSSM_RETURN InitCSSMModule(const CSSM_GUID *inGuid, CSSM_SERVICE_TYPE inService, - CSSM_MODULE_HANDLE_PTR outModule); -CSSM_RETURN TermCSSMModule(const CSSM_GUID *inGuid, CSSM_MODULE_HANDLE_PTR inModule); - -#endif // !_PAL_CERT_HPP_ diff --git a/src/coreclr/src/pal/src/include/pal/context.h b/src/coreclr/src/pal/src/include/pal/context.h index db0baec11191..73de448dfcf2 100644 --- a/src/coreclr/src/pal/src/include/pal/context.h +++ b/src/coreclr/src/pal/src/include/pal/context.h @@ -305,6 +305,7 @@ inline void *FPREG_Xstate_Ymmh(const ucontext_t *uc) #define MCREG_Cpsr(mc) ((mc).pstate) +#ifndef TARGET_OSX inline fpsimd_context* GetNativeSigSimdContext(native_context_t *mc) { @@ -341,7 +342,9 @@ const fpsimd_context* GetConstNativeSigSimdContext(const native_context_t *mc) return GetNativeSigSimdContext(const_cast(mc)); } -#else +#endif // TARGET_OSX + +#else // HOST_ARM64 // For FreeBSD, as found in x86/ucontext.h #define MCREG_Rbp(mc) ((mc).mc_rbp) #define MCREG_Rip(mc) ((mc).mc_rip) diff --git a/src/coreclr/src/pal/src/include/pal/misc.h b/src/coreclr/src/pal/src/include/pal/misc.h index 1a555f4fb2bb..aa5b2b4852b6 100644 --- a/src/coreclr/src/pal/src/include/pal/misc.h +++ b/src/coreclr/src/pal/src/include/pal/misc.h @@ -42,17 +42,6 @@ Function : --*/ PAL_time_t __cdecl PAL_time(PAL_time_t*); -/*++ -Function: -TIMEInitialize - -Return value: -TRUE if initialize succeeded -FALSE otherwise - ---*/ -BOOL TIMEInitialize( void ); - /*++ Function : MsgBoxInitialize diff --git a/src/coreclr/src/pal/src/include/pal/mutex.hpp b/src/coreclr/src/pal/src/include/pal/mutex.hpp index c0227ff88d06..8aeaf9f62586 100644 --- a/src/coreclr/src/pal/src/include/pal/mutex.hpp +++ b/src/coreclr/src/pal/src/include/pal/mutex.hpp @@ -66,8 +66,62 @@ DWORD SPINLOCKTryAcquire (LONG * lock); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Named mutex +/* +Design + +- On systems that support pthread process-shared robust recursive mutexes, they will be used +- On other systems, file locks are used. File locks unfortunately don't have a timeout in the blocking wait call, and I didn't + find any other sync object with a timed wait with the necessary properties, so polling is done for timed waits. + +Shared memory files +- Session-scoped mutexes (name not prefixed, or prefixed with Local) go in /tmp/coreclr/shm/session/ +- Globally-scoped mutexes (name prefixed with Global) go in /tmp/coreclr/shm/global/ +- Contains shared state, and is mmap'ped into the process, see SharedMemorySharedDataHeader and NamedMutexSharedData for data + stored +- Creation and deletion is synchronized using an exclusive file lock on the shm directory +- Any process using the shared memory file holds a shared file lock on the shared memory file +- Upon creation, if the shared memory file already exists, an exclusive file lock is attempted on it, to see if the file data is + valid. If no other processes have the mutex open, the file is reinitialized. +- Upon releasing the last reference to a mutex in a process, it will try to get an exclusive lock on the shared memory file to + see if any other processes have the mutex opened. If not, the file is deleted, along with the session directory if it's empty. + The coreclr and shm directories are not deleted. +- This allows managing the lifetime of mutex state based on active processes that have the mutex open. Depending on how the + process terminated, the file may still be left over in the tmp directory, I haven't found anything that can be done about + that. + +Lock files when using file locks: +- In addition to the shared memory file, we need another file for the actual synchronization file lock, since a file lock on the + shared memory file is used for lifetime purposes. +- These files go in /tmp/coreclr/lockfiles/session|global/ +- The file is empty, and is only used for file locks + +Process data +- See SharedMemoryProcessDataHeader and NamedMutexProcessData for data stored +- Per mutex name, there is only one instance of process data that is ref-counted. They are currently stored in a linked list in + SharedMemoryManager. It should use a hash table, but of the many hash table implementations that are already there, none seem + to be easily usable in the PAL. I'll look into that and will fix later. +- Refers to the associated shared memory, and knows how to clean up both the process data and shared data +- When using file locks for synchronization, a process-local mutex is also created for synchronizing threads, since file locks + are owned at the file descriptor level and there is only one open file descriptor in the process per mutex name. The + process-local mutex is locked around the file lock, so that only one thread per process is ever trying to flock on a given + file descriptor. + +Abandon detection +- When a lock is acquired, the process data is added to a linked list on the owning thread +- When a thread exits, the list is walked, each mutex is flagged as abandoned and released +- For detecting process abruptly terminating, pthread robust mutexes give us that. When using file locks, the file lock is + automatically released by the system. Upon acquiring a lock, the lock owner info in the shared memory is checked to see if the + mutex was abandoned. + +Miscellaneous +- CreateMutex and OpenMutex both create new handles for each mutex opened. Each handle just refers to the process data header + for the mutex name. +- Some of the above features are already available in the PAL, but not quite in a way that I can use for this purpose. The + existing shared memory, naming, and waiting infrastructure is not suitable for this purpose, and is not used. +*/ + // Temporarily disabling usage of pthread process-shared mutexes on ARM/ARM64 due to functional issues that cannot easily be -// detected with code due to hangs. See https://github.com/dotnet/coreclr/issues/5456. +// detected with code due to hangs. See https://github.com/dotnet/runtime/issues/6014. #if HAVE_FULLY_FEATURED_PTHREAD_MUTEXES && HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES && !(defined(HOST_ARM) || defined(HOST_ARM64) || defined(__FreeBSD__)) #define NAMED_MUTEX_USE_PTHREAD_MUTEX 1 #else diff --git a/src/coreclr/src/pal/src/include/pal/palinternal.h b/src/coreclr/src/pal/src/include/pal/palinternal.h index a672d7ce6253..e73720bec734 100644 --- a/src/coreclr/src/pal/src/include/pal/palinternal.h +++ b/src/coreclr/src/pal/src/include/pal/palinternal.h @@ -729,4 +729,10 @@ const char StackOverflowMessage[] = "Stack overflow.\n"; #endif // __cplusplus +#if __has_cpp_attribute(fallthrough) +#define FALLTHROUGH [[fallthrough]] +#else +#define FALLTHROUGH +#endif + #endif /* _PAL_INTERNAL_H_ */ diff --git a/src/coreclr/src/pal/src/include/pal/stackstring.hpp b/src/coreclr/src/pal/src/include/pal/stackstring.hpp index 20a948480ce7..30aa6fa379c7 100644 --- a/src/coreclr/src/pal/src/include/pal/stackstring.hpp +++ b/src/coreclr/src/pal/src/include/pal/stackstring.hpp @@ -256,9 +256,7 @@ typedef StackString PathWCharString; BOOL PAL_GetPALDirectoryW( PathWCharString& lpDirectoryName); -BOOL -PAL_GetPALDirectoryA( - PathCharString& lpDirectoryName); + DWORD GetCurrentDirectoryA( PathCharString& lpBuffer); diff --git a/src/coreclr/src/pal/src/init/pal.cpp b/src/coreclr/src/pal/src/init/pal.cpp index e040f2fd10e6..488ff6a4d79b 100644 --- a/src/coreclr/src/pal/src/init/pal.cpp +++ b/src/coreclr/src/pal/src/init/pal.cpp @@ -91,6 +91,15 @@ int CacheLineSize; #endif #endif +#if defined(__FreeBSD__) +#include +#include +#include +#endif +#if HAVE_GETAUXVAL +#include +#endif + #include using namespace CorUnix; @@ -125,7 +134,7 @@ static DWORD g_initializeDLLFlags = PAL_INITIALIZE_DLL; static int Initialize(int argc, const char *const argv[], DWORD flags); static BOOL INIT_IncreaseDescriptorLimit(void); static LPWSTR INIT_FormatCommandLine (int argc, const char * const *argv); -static LPWSTR INIT_ConvertEXEPath(LPCSTR exe_name); +static LPWSTR INIT_GetCurrentEXEPath(); static BOOL INIT_SharedFilesPath(void); #ifdef _DEBUG @@ -560,7 +569,7 @@ Initialize( } /* find out the application's full path */ - exe_path = INIT_ConvertEXEPath(argv[0]); + exe_path = INIT_GetCurrentEXEPath(); if (NULL == exe_path) { ERROR("Unable to find exe path\n"); @@ -617,13 +626,6 @@ Initialize( palError = ERROR_GEN_FAILURE; - if (FALSE == TIMEInitialize()) - { - ERROR("Unable to initialize TIME support\n"); - palError = ERROR_PALINIT_TIME; - goto CLEANUP6; - } - /* Initialize the File mapping critical section. */ if (FALSE == MAPInitialize()) { @@ -787,7 +789,7 @@ exit : --*/ PAL_ERROR PALAPI -PAL_InitializeCoreCLR(const char *szExePath, bool runningInExe) +PAL_InitializeCoreCLR(const char *szExePath, BOOL runningInExe) { g_running_in_exe = runningInExe; @@ -1265,45 +1267,160 @@ static LPWSTR INIT_FormatCommandLine (int argc, const char * const *argv) return retval; } +#if defined(__linux__) +#define symlinkEntrypointExecutable "/proc/self/exe" +#elif !defined(__APPLE__) +#define symlinkEntrypointExecutable "/proc/curproc/exe" +#endif + +bool GetAbsolutePath(const char* path, PathCharString& absolutePath) +{ + bool result = false; + + char realPath[PATH_MAX]; + if (realpath(path, realPath) != nullptr && realPath[0] != '\0') + { + absolutePath.Set(realPath, strlen(realPath)); + // realpath should return canonicalized path without the trailing slash + _ASSERTE(absolutePath[absolutePath.GetCount() - 1] != '/'); + + result = true; + } + + return result; +} + +bool GetEntrypointExecutableAbsolutePath(PathCharString& entrypointExecutable) +{ + bool result = false; + + entrypointExecutable.Clear(); + + // Get path to the executable for the current process using + // platform specific means. +#if defined(__APPLE__) + + // On Mac, we ask the OS for the absolute path to the entrypoint executable + uint32_t lenActualPath = 0; + if (_NSGetExecutablePath(nullptr, &lenActualPath) == -1) + { + // OSX has placed the actual path length in lenActualPath, + // so re-attempt the operation + PathCharString resizedPath; + char *pResizedPath = resizedPath.OpenStringBuffer(lenActualPath); + if (_NSGetExecutablePath(pResizedPath, &lenActualPath) == 0) + { + resizedPath.CloseBuffer(lenActualPath - 1); + entrypointExecutable.Set(resizedPath); + result = true; + } + } +#elif defined (__FreeBSD__) + static const int name[] = + { + CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 + }; + char path[PATH_MAX]; + size_t len; + + len = sizeof(path); + if (sysctl(name, 4, path, &len, nullptr, 0) == 0) + { + entrypointExecutable.Set(path, len); + result = true; + } + else + { + // ENOMEM + result = false; + } +#elif defined(__NetBSD__) && defined(KERN_PROC_PATHNAME) + static const int name[] = + { + CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME, + }; + char path[MAXPATHLEN]; + size_t len; + + len = sizeof(path); + if (sysctl(name, __arraycount(name), path, &len, NULL, 0) != -1) + { + entrypointExecutable.Set(path, len); + result = true; + } + else + { + result = false; + } +#elif defined(__sun) + const char *path; + if ((path = getexecname()) == NULL) + { + result = false; + } + else if (*path != '/') + { + char *cwd; + if ((cwd = getcwd(NULL, PATH_MAX)) == NULL) + { + result = false; + } + else + { + entrypointExecutable.Set(cwd, strlen(cwd)); + entrypointExecutable.Append('/'); + entrypointExecutable.Append(path, strlen(path)); + + result = true; + free(cwd); + } + } + else + { + entrypointExecutable.Set(path, strlen(path)); + result = true; + } +#else + +#if HAVE_GETAUXVAL && defined(AT_EXECFN) + const char *execfn = (const char *)getauxval(AT_EXECFN); + + if (execfn) + { + entrypointExecutable.Set(execfn, strlen(execfn)); + result = true; + } + else +#endif + // On other OSs, return the symlink that will be resolved by GetAbsolutePath + // to fetch the entrypoint EXE absolute path, inclusive of filename. + result = GetAbsolutePath(symlinkEntrypointExecutable, entrypointExecutable); +#endif + + return result; +} + /*++ Function: - INIT_ConvertEXEPath + INIT_GetCurrentEXEPath Abstract: - Check whether the executable path is valid, and convert its type (LPCSTR -> LPWSTR) - -Parameters: - LPCSTR exe_name : full path of the current executable + Get the current exe path Return: pointer to buffer containing the full path. This buffer must be released by the caller using free() -Notes : - this function assumes that "exe_name" is in Unix style (no \) --*/ -static LPWSTR INIT_ConvertEXEPath(LPCSTR exe_path) +static LPWSTR INIT_GetCurrentEXEPath() { PathCharString real_path; LPWSTR return_value; INT return_size; - struct stat theStats; - - if (!strchr(exe_path, '/')) - { - ERROR( "The exe path is not fully specified\n" ); - return NULL; - } - - if (-1 == stat(exe_path, &theStats)) - { - ERROR( "The file does not exist\n" ); - return NULL; - } - if (!CorUnix::RealPathHelper(exe_path, real_path)) + if (!GetEntrypointExecutableAbsolutePath(real_path)) { - ERROR("realpath() failed!\n"); + ERROR( "Cannot get current exe path\n" ); return NULL; } diff --git a/src/coreclr/src/pal/src/libunwind/CMakeLists.txt b/src/coreclr/src/pal/src/libunwind/CMakeLists.txt index bf26aca20235..ffb74a04e4cb 100644 --- a/src/coreclr/src/pal/src/libunwind/CMakeLists.txt +++ b/src/coreclr/src/pal/src/libunwind/CMakeLists.txt @@ -32,6 +32,7 @@ if(CLR_CMAKE_HOST_UNIX) # Disable warning due to incorrect format specifier in debugging printf via the Debug macro add_compile_options(-Wno-format -Wno-format-security) + add_compile_options(-Wno-implicit-fallthrough) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wno-header-guard) diff --git a/src/coreclr/src/pal/src/libunwind/README.md b/src/coreclr/src/pal/src/libunwind/README.md index 100b93820ade..e845566c06f9 100644 --- a/src/coreclr/src/pal/src/libunwind/README.md +++ b/src/coreclr/src/pal/src/libunwind/README.md @@ -1 +1 @@ -README \ No newline at end of file +README diff --git a/src/coreclr/src/pal/src/libunwind/config.h.in b/src/coreclr/src/pal/src/libunwind/config.h.in index 5ac6201e08b5..4c06e6987968 100644 --- a/src/coreclr/src/pal/src/libunwind/config.h.in +++ b/src/coreclr/src/pal/src/libunwind/config.h.in @@ -17,4 +17,13 @@ #cmakedefine HAVE_ATOMIC_OPS_H +#cmakedefine HAVE_STDALIGN_H +#cmakedefine HAVE_STDALIGN_ALIGNAS + +#if defined(_MSC_VER) && defined(HAVE_STDALIGN_H) && !defined(HAVE_STDALIGN_ALIGNAS) +// alignment is a performance optimization for the cross compile libunwind +// Simply ignore it if it is not supported by the compiler +#define alignas(x) +#endif + #endif diff --git a/src/coreclr/src/pal/src/libunwind/configure.cmake b/src/coreclr/src/pal/src/libunwind/configure.cmake index ef56247ae166..8e9c00abfbeb 100644 --- a/src/coreclr/src/pal/src/libunwind/configure.cmake +++ b/src/coreclr/src/pal/src/libunwind/configure.cmake @@ -59,6 +59,16 @@ int main(int argc, char **argv) return 0; }" HAVE__BUILTIN_UNREACHABLE) +check_c_source_compiles(" +#include + +int main(void) +{ + alignas(128) char result = 0; + + return result; +}" HAVE_STDALIGN_ALIGNAS) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h) add_definitions(-DHAVE_CONFIG_H=1) diff --git a/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c b/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c index 8399214e4952..9ccb1df07b6e 100644 --- a/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c +++ b/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c @@ -47,11 +47,25 @@ unw_get_accessors_int (unw_addr_space_t as) return unw_get_accessors(as); } +#if defined(TARGET_AMD64) && !defined(HOST_AMD64) +#define X86_64_SCF_NONE 0 +#endif + +#if defined(TARGET_ARM64) && !defined(HOST_ARM64) +#define AARCH64_SCF_NONE 0 +#endif + int unw_is_signal_frame (unw_cursor_t *cursor) { struct cursor *c = (struct cursor *) cursor; +#ifdef TARGET_AMD64 return c->sigcontext_format != X86_64_SCF_NONE; +#elif defined(TARGET_ARM64) + return c->sigcontext_format != AARCH64_SCF_NONE; +#else + #error Unexpected target +#endif } int diff --git a/src/coreclr/src/pal/src/loader/module.cpp b/src/coreclr/src/pal/src/loader/module.cpp index 58126e1cc5a0..f9d6acb21d02 100644 --- a/src/coreclr/src/pal/src/loader/module.cpp +++ b/src/coreclr/src/pal/src/loader/module.cpp @@ -67,13 +67,6 @@ using namespace CorUnix; /* get the full name of a module if available, and the short name otherwise*/ #define MODNAME(x) ((x)->lib_name) -/* Which path should FindLibrary search? */ -#if defined(__APPLE__) -#define LIBSEARCHPATH "DYLD_LIBRARY_PATH" -#else -#define LIBSEARCHPATH "LD_LIBRARY_PATH" -#endif - #define LIBC_NAME_WITHOUT_EXTENSION "libc" /* static variables ***********************************************************/ @@ -662,6 +655,22 @@ PAL_FreeLibraryDirect( return retValue; } +/*++ +Function: + PAL_GetPalHostModule + + Returns the module that hosts the PAL. + That is typically: + - coreclr.dll when coreclr is dynamically linked + - containing executable in the statically linked case +--*/ +HMODULE +PALAPI +PAL_GetPalHostModule() +{ + return (HMODULE)LOADGetPalLibrary(); +} + /* Function: PAL_GetProcAddressDirect @@ -676,7 +685,6 @@ PAL_GetProcAddressDirect( IN NATIVE_LIBRARY_HANDLE dl_handle, IN LPCSTR lpProcName) { - INT name_length; FARPROC address = nullptr; PERF_ENTRY(PAL_GetProcAddressDirect); diff --git a/src/coreclr/src/pal/src/locale/unicode.cpp b/src/coreclr/src/pal/src/locale/unicode.cpp index dea10acfceb3..f29eabc07d9b 100644 --- a/src/coreclr/src/pal/src/locale/unicode.cpp +++ b/src/coreclr/src/pal/src/locale/unicode.cpp @@ -191,56 +191,6 @@ GetConsoleOutputCP( return nRet; } -/*++ -Function: -GetCPInfo - -See MSDN doc. ---*/ -BOOL -PALAPI -GetCPInfo( - IN UINT CodePage, - OUT LPCPINFO lpCPInfo) -{ - BOOL bRet = FALSE; - - PERF_ENTRY(GetCPInfo); - ENTRY("GetCPInfo(CodePage=%hu, lpCPInfo=%p)\n", CodePage, lpCPInfo); - - /*check if the input code page is valid*/ - if( CP_ACP != CodePage && CP_UTF8 != CodePage ) - { - /* error, invalid argument */ - ERROR("CodePage(%d) parameter is invalid\n",CodePage); - SetLastError( ERROR_INVALID_PARAMETER ); - goto done; - } - - /*check if the lpCPInfo parameter is valid. */ - if( !lpCPInfo ) - { - /* error, invalid argument */ - ERROR("lpCPInfo cannot be NULL\n" ); - SetLastError( ERROR_INVALID_PARAMETER ); - goto done; - } - - lpCPInfo->MaxCharSize = 4; - memset( lpCPInfo->LeadByte, 0, MAX_LEADBYTES ); - - /* Don't need to be set, according to the spec. */ - memset( lpCPInfo->DefaultChar, '?', MAX_DEFAULTCHAR ); - - bRet = TRUE; - -done: - LOGEXIT("GetCPInfo returns BOOL %d \n",bRet); - PERF_EXIT(GetCPInfo); - return bRet; -} - - /*++ Function: GetACP @@ -260,70 +210,6 @@ GetACP(VOID) return CP_UTF8; } - -/*++ -Function: -IsDBCSLeadByteEx - -See MSDN doc. ---*/ -BOOL -PALAPI -IsDBCSLeadByteEx( - IN UINT CodePage, - IN BYTE TestChar) -{ - CPINFO cpinfo; - SIZE_T i; - BOOL bRet = FALSE; - - PERF_ENTRY(IsDBCSLeadByteEx); - ENTRY("IsDBCSLeadByteEx(CodePage=%#x, TestChar=%d)\n", CodePage, TestChar); - - /* Get the lead byte info with respect to the given codepage*/ - if( !GetCPInfo( CodePage, &cpinfo ) ) - { - ERROR("Error CodePage(%#x) parameter is invalid\n", CodePage ); - SetLastError( ERROR_INVALID_PARAMETER ); - goto done; - } - - for( i=0; i < sizeof(cpinfo.LeadByte)/sizeof(cpinfo.LeadByte[0]); i += 2 ) - { - if( 0 == cpinfo.LeadByte[ i ] ) - { - goto done; - } - - /*check if the given char is in one of the lead byte ranges*/ - if( cpinfo.LeadByte[i] <= TestChar && TestChar<= cpinfo.LeadByte[i+1] ) - { - bRet = TRUE; - goto done; - } - } -done: - LOGEXIT("IsDBCSLeadByteEx returns BOOL %d\n",bRet); - PERF_EXIT(IsDBCSLeadByteEx); - return bRet; -} - -/*++ -Function: -IsDBCSLeadByte - -See MSDN doc. ---*/ -BOOL -PALAPI -IsDBCSLeadByte( - IN BYTE TestChar) -{ - // UNIXTODO: Implement this! - ERROR("Needs Implementation!!!"); - return FALSE; -} - /*++ Function: MultiByteToWideChar diff --git a/src/coreclr/src/pal/src/locale/utf8.cpp b/src/coreclr/src/pal/src/locale/utf8.cpp index b8a6f7ad5d6f..96a633b165d9 100644 --- a/src/coreclr/src/pal/src/locale/utf8.cpp +++ b/src/coreclr/src/pal/src/locale/utf8.cpp @@ -10,7 +10,7 @@ Module Name: unicode/utf8.c Abstract: - Functions to encode and decode UTF-8 strings. This is a port of the C# version from mscorlib. + Functions to encode and decode UTF-8 strings. This is a port of the C# version from Utf8Encoding.cs. Revision History: @@ -51,7 +51,7 @@ struct Char return (c & 0xFC00) == CharUnicodeInfo::LOW_SURROGATE_START; } - // Test if the wide character is a low surrogate + // Test if the wide character is a surrogate half static bool IsSurrogate(const WCHAR c) { return (c & 0xF800) == CharUnicodeInfo::HIGH_SURROGATE_START; @@ -69,7 +69,7 @@ struct Char return IsLowSurrogate(s[index]); } - // Test if the wide character is a low surrogate + // Test if the wide character is a surrogate half static bool IsSurrogate(const WCHAR* s, int index) { return IsSurrogate(s[index]); @@ -1281,7 +1281,7 @@ class UTF8Encoding int ch = 0; DecoderFallbackBuffer *fallback = nullptr; - for (;;) + while (true) { // SLOWLOOP: does all range checks, handles all special cases, but it is slow if (pSrc >= pEnd) { @@ -1651,7 +1651,7 @@ class UTF8Encoding DecoderFallbackBuffer *fallback = nullptr; - for (;;) + while (true) { // SLOWLOOP: does all range checks, handles all special cases, but it is slow @@ -1836,7 +1836,7 @@ class UTF8Encoding pSrc--; // Throw that we don't have enough room (pSrc could be < chars if we had started to process - // a 4 byte sequence alredy) + // a 4 byte sequence already) Contract::Assert(pSrc >= bytes || pTarget == chars, "[UTF8Encoding.GetChars]Expected pSrc to be within input buffer or throw due to no output]"); ThrowCharsOverflow(pTarget == chars); @@ -2158,7 +2158,7 @@ class UTF8Encoding // assume that JIT will enregister pSrc, pTarget and ch - for (;;) { + while (true) { // SLOWLOOP: does all range checks, handles all special cases, but it is slow if (pSrc >= pEnd) { @@ -2541,7 +2541,7 @@ class UTF8Encoding int ch = 0; - for (;;) { + while (true) { // SLOWLOOP: does all range checks, handles all special cases, but it is slow if (pSrc >= pEnd) { diff --git a/src/coreclr/src/pal/src/map/map.cpp b/src/coreclr/src/pal/src/map/map.cpp index 75405c7407c8..0243bd92ed03 100644 --- a/src/coreclr/src/pal/src/map/map.cpp +++ b/src/coreclr/src/pal/src/map/map.cpp @@ -166,7 +166,6 @@ CFileMappingImmutableDataCopyRoutine( void *pImmDataTarget ) { - PAL_ERROR palError = NO_ERROR; CFileMappingImmutableData *pImmutableData = (CFileMappingImmutableData *) pImmData; CFileMappingImmutableData *pImmutableDataTarget = (CFileMappingImmutableData *) pImmDataTarget; @@ -181,7 +180,6 @@ CFileMappingImmutableDataCleanupRoutine( void *pImmData ) { - PAL_ERROR palError = NO_ERROR; CFileMappingImmutableData *pImmutableData = (CFileMappingImmutableData *) pImmData; free(pImmutableData->lpFileName); @@ -310,73 +308,6 @@ FileMappingInitializationRoutine( return palError; } -/*++ -Function: - CreateFileMappingA - -Note: - File mapping are used to do inter-process communication. - -See MSDN doc. ---*/ -HANDLE -PALAPI -CreateFileMappingA( - IN HANDLE hFile, - IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, - IN DWORD flProtect, - IN DWORD dwMaximumSizeHigh, - IN DWORD dwMaximumSizeLow, - IN LPCSTR lpName) -{ - HANDLE hFileMapping = NULL; - CPalThread *pThread = NULL; - PAL_ERROR palError = NO_ERROR; - - PERF_ENTRY(CreateFileMappingA); - ENTRY("CreateFileMappingA(hFile=%p, lpAttributes=%p, flProtect=%#x, " - "dwMaxSizeH=%d, dwMaxSizeL=%d, lpName=%p (%s))\n", - hFile, lpFileMappingAttributes, flProtect, - dwMaximumSizeHigh, dwMaximumSizeLow, - lpName?lpName:"NULL", - lpName?lpName:"NULL"); - - pThread = InternalGetCurrentThread(); - - if (lpName != nullptr) - { - ASSERT("lpName: Cross-process named objects are not supported in PAL"); - palError = ERROR_NOT_SUPPORTED; - } - else - { - palError = InternalCreateFileMapping( - pThread, - hFile, - lpFileMappingAttributes, - flProtect, - dwMaximumSizeHigh, - dwMaximumSizeLow, - NULL, - &hFileMapping - ); - } - - - // - // We always need to set last error, even on success: - // we need to protect ourselves from the situation - // where last error is set to ERROR_ALREADY_EXISTS on - // entry to the function - // - - pThread->SetLastError(palError); - - LOGEXIT( "CreateFileMappingA returns HANDLE %p. \n", hFileMapping ); - PERF_EXIT(CreateFileMappingA); - return hFileMapping; -} - /*++ Function: CreateFileMappingW @@ -831,50 +762,6 @@ CorUnix::InternalCreateFileMapping( return palError; } -/*++ -Function: - OpenFileMappingA - -See MSDN doc. ---*/ -HANDLE -PALAPI -OpenFileMappingA( - IN DWORD dwDesiredAccess, - IN BOOL bInheritHandle, - IN LPCSTR lpName) -{ - HANDLE hFileMapping = NULL; - CPalThread *pThread = NULL; - PAL_ERROR palError = NO_ERROR; - - PERF_ENTRY(OpenFileMappingA); - ENTRY("OpenFileMappingA(dwDesiredAccess=%u, bInheritHandle=%d, lpName=%p (%s)\n", - dwDesiredAccess, bInheritHandle, lpName?lpName:"NULL", lpName?lpName:"NULL"); - - pThread = InternalGetCurrentThread(); - - if (lpName == nullptr) - { - ERROR("name is NULL\n"); - palError = ERROR_INVALID_PARAMETER; - } - else - { - ASSERT("lpName: Cross-process named objects are not supported in PAL"); - palError = ERROR_NOT_SUPPORTED; - } - - if (NO_ERROR != palError) - { - pThread->SetLastError(palError); - } - LOGEXIT( "OpenFileMappingA returning %p\n", hFileMapping ); - PERF_EXIT(OpenFileMappingA); - return hFileMapping; -} - - /*++ Function: OpenFileMappingW @@ -2137,7 +2024,7 @@ MAPRecordMapping( return palError; } -static size_t OffsetWithinPage(off_t addr) +size_t OffsetWithinPage(off_t addr) { return addr & (GetVirtualPageSize() - 1); } @@ -2173,7 +2060,7 @@ MAPmmapAndRecord( // Ensure address and offset arguments mmap() are page-aligned. _ASSERTE(OffsetWithinPage(offset - adjust) == 0); _ASSERTE(OffsetWithinPage((off_t)pvBaseAddress) == 0); - + #ifdef __APPLE__ if ((prot & PROT_EXEC) != 0 && IsRunningOnMojaveHardenedRuntime()) { diff --git a/src/coreclr/src/pal/src/map/virtual.cpp b/src/coreclr/src/pal/src/map/virtual.cpp index edac87758021..456254bdbbb9 100644 --- a/src/coreclr/src/pal/src/map/virtual.cpp +++ b/src/coreclr/src/pal/src/map/virtual.cpp @@ -1760,6 +1760,23 @@ VirtualProtect( return bRetVal; } +#if defined(HOST_OSX) && defined(HOST_ARM64) +bool +PAL_JITWriteEnableHolder::JITWriteEnable(bool writeEnable) +{ + // Use a thread local to track per thread JIT Write enable state + // Initialize threads to start with MAP_JIT pages readable and executable (R-X) by default. + thread_local bool enabled = (pthread_jit_write_protect_np(1), false); + bool result = enabled; + if (enabled != writeEnable) + { + pthread_jit_write_protect_np(writeEnable ? 0 : 1); + enabled = writeEnable; + } + return result; +} +#endif + #if HAVE_VM_ALLOCATE //--------------------------------------------------------------------------------------- // diff --git a/src/coreclr/src/pal/src/memory/local.cpp b/src/coreclr/src/pal/src/memory/local.cpp index 8ed51b7c1757..fc62ef428b1e 100644 --- a/src/coreclr/src/pal/src/memory/local.cpp +++ b/src/coreclr/src/pal/src/memory/local.cpp @@ -69,52 +69,6 @@ LocalAlloc( return (HLOCAL) lpRetVal; } -/*++ -Function: -LocalReAlloc - -See MSDN doc. ---*/ -HLOCAL -PALAPI -LocalReAlloc( - IN HLOCAL hMem, - IN SIZE_T uBytes, - IN UINT uFlags) -{ - LPVOID lpRetVal = NULL; - PERF_ENTRY(LocalReAlloc); - ENTRY("LocalReAlloc (hMem=%p, uBytes=%u, uFlags=%#x)\n", hMem, uBytes, uFlags); - - if (uFlags != LMEM_MOVEABLE) - { - // Currently valid iff uFlags is LMEM_MOVEABLE - ASSERT("Invalid parameter uFlags=0x%x\n", uFlags); - SetLastError(ERROR_INVALID_PARAMETER); - goto done; - } - - if (uBytes == 0) - { - // PAL's realloc behaves like free for a requested size of zero bytes. Force a nonzero size to get a valid pointer. - uBytes = 1; - } - - lpRetVal = PAL_realloc(hMem, uBytes); - - if (lpRetVal == NULL) - { - ERROR("Not enough memory\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto done; - } - -done: - LOGEXIT("LocalReAlloc returning %p.\n", lpRetVal); - PERF_EXIT(LocalReAlloc); - return (HLOCAL)lpRetVal; -} - /*++ Function: LocalFree diff --git a/src/coreclr/src/pal/src/misc/environ.cpp b/src/coreclr/src/pal/src/misc/environ.cpp index ed13156381e5..a31d6b177760 100644 --- a/src/coreclr/src/pal/src/misc/environ.cpp +++ b/src/coreclr/src/pal/src/misc/environ.cpp @@ -441,65 +441,6 @@ GetEnvironmentStringsW( return wenviron; } -/*++ -Function: - GetEnvironmentStringsA - -See GetEnvironmentStringsW. - ---*/ -LPSTR -PALAPI -GetEnvironmentStringsA( - VOID) -{ - char *environ = nullptr, *tempEnviron; - int i, len, envNum; - - PERF_ENTRY(GetEnvironmentStringsA); - ENTRY("GetEnvironmentStringsA()\n"); - - CPalThread * pthrCurrent = InternalGetCurrentThread(); - InternalEnterCriticalSection(pthrCurrent, &gcsEnvironment); - - envNum = 0; - len = 0; - - /* get total length of the bytes that we need to allocate */ - for (i = 0; palEnvironment[i] != 0; i++) - { - len = strlen(palEnvironment[i]) + 1; - envNum += len; - } - - environ = (char *)PAL_malloc(envNum + 1); - if (environ == nullptr) - { - ERROR("malloc failed\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto EXIT; - } - - len = 0; - tempEnviron = environ; - for (i = 0; palEnvironment[i] != 0; i++) - { - len = strlen(palEnvironment[i]) + 1; - memcpy(tempEnviron, palEnvironment[i], len); - tempEnviron += len; - envNum -= len; - } - - *tempEnviron = 0; /* Put an extra null at the end */ - - EXIT: - InternalLeaveCriticalSection(pthrCurrent, &gcsEnvironment); - - LOGEXIT("GetEnvironmentStringsA returning %p\n", environ); - PERF_EXIT(GetEnvironmentStringsA); - return environ; -} - /*++ Function: FreeEnvironmentStringsW @@ -543,31 +484,6 @@ FreeEnvironmentStringsW( return TRUE; } -/*++ -Function: - FreeEnvironmentStringsA - -See FreeEnvironmentStringsW. - ---*/ -BOOL -PALAPI -FreeEnvironmentStringsA( - IN LPSTR lpValue) -{ - PERF_ENTRY(FreeEnvironmentStringsA); - ENTRY("FreeEnvironmentStringsA(lpValue=%p (%s))\n", lpValue ? lpValue : "NULL", lpValue ? lpValue : "NULL"); - - if (lpValue != nullptr) - { - PAL_free(lpValue); - } - - LOGEXIT("FreeEnvironmentStringA returning BOOL TRUE\n"); - PERF_EXIT(FreeEnvironmentStringsA); - return TRUE; -} - /*++ Function: SetEnvironmentVariableA @@ -915,28 +831,28 @@ char* FindEnvVarValue(const char* name) { if (*name == '\0') return nullptr; - + for (int i = 0; palEnvironment[i] != nullptr; ++i) { const char* pch = name; char* p = palEnvironment[i]; - do + do { - if (*pch == '\0') + if (*pch == '\0') { if (*p == '=') return p + 1; - + if (*p == '\0') // no = sign -> empty value return p; - + break; } } while (*pch++ == *p++); } - + return nullptr; } @@ -969,9 +885,9 @@ char* EnvironGetenv(const char* name, BOOL copyValue) { CPalThread * pthrCurrent = InternalGetCurrentThread(); InternalEnterCriticalSection(pthrCurrent, &gcsEnvironment); - + char* retValue = FindEnvVarValue(name); - + if ((retValue != nullptr) && copyValue) { retValue = strdup(retValue); diff --git a/src/coreclr/src/pal/src/misc/jitsupport.cpp b/src/coreclr/src/pal/src/misc/jitsupport.cpp index 68af6aa1bd6d..8678a479f10d 100644 --- a/src/coreclr/src/pal/src/misc/jitsupport.cpp +++ b/src/coreclr/src/pal/src/misc/jitsupport.cpp @@ -13,6 +13,139 @@ SET_DEFAULT_DEBUG_CHANNEL(MISC); #include #endif +#if HAVE_SYSCTLBYNAME +#include +#endif + +#if defined(HOST_ARM64) && defined(__linux__) +struct CpuCapability +{ + const char* name; + unsigned long hwCapFlag; +}; + +static const CpuCapability CpuCapabilities[] = { + //{ "fp", HWCAP_FP }, +#ifdef HWCAP_ASIMD + { "asimd", HWCAP_ASIMD }, +#endif + //{ "evtstrm", HWCAP_EVTSTRM }, +#ifdef HWCAP_AES + { "aes", HWCAP_AES }, +#endif + //{ "pmull", HWCAP_PMULL }, +#ifdef HWCAP_SHA1 + { "sha1", HWCAP_SHA1 }, +#endif +#ifdef HWCAP_SHA2 + { "sha2", HWCAP_SHA2 }, +#endif +#ifdef HWCAP_CRC32 + { "crc32", HWCAP_CRC32 }, +#endif +#ifdef HWCAP_ATOMICS + { "atomics", HWCAP_ATOMICS }, +#endif + //{ "fphp", HWCAP_FPHP }, + //{ "asimdhp", HWCAP_ASIMDHP }, + //{ "cpuid", HWCAP_CPUID }, +#ifdef HWCAP_ASIMDRDM + { "asimdrdm", HWCAP_ASIMDRDM }, +#endif + //{ "jscvt", HWCAP_JSCVT }, + //{ "fcma", HWCAP_FCMA }, + //{ "lrcpc", HWCAP_LRCPC }, + //{ "dcpop", HWCAP_DCPOP }, + //{ "sha3", HWCAP_SHA3 }, + //{ "sm3", HWCAP_SM3 }, + //{ "sm4", HWCAP_SM4 }, +#ifdef HWCAP_ASIMDDP + { "asimddp", HWCAP_ASIMDDP }, +#endif + //{ "sha512", HWCAP_SHA512 }, + //{ "sve", HWCAP_SVE }, + //{ "asimdfhm", HWCAP_ASIMDFHM }, + //{ "dit", HWCAP_DIT }, + //{ "uscat", HWCAP_USCAT }, + //{ "ilrcpc", HWCAP_ILRCPC }, + //{ "flagm", HWCAP_FLAGM }, + //{ "ssbs", HWCAP_SSBS }, + //{ "sb", HWCAP_SB }, + //{ "paca", HWCAP_PACA }, + //{ "pacg", HWCAP_PACG }, + + // Ensure the array is never empty + { "", 0 } +}; + +// Returns the HWCAP_* flag corresponding to the given capability name. +// 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 (int i = 0; i < _countof(CpuCapabilities); i++) + { + const char* capabilityName = CpuCapabilities[i].name; + if ((length == strlen(capabilityName)) && (memcmp(start, capabilityName, length) == 0)) + { + return CpuCapabilities[i].hwCapFlag; + } + } + return 0; +} + +// Reads the first Features entry from /proc/cpuinfo (assuming other entries are essentially +// identical) and translates it into a set of HWCAP_* flags. +static unsigned long GetCpuCapabilityFlagsFromCpuInfo() +{ + unsigned long capabilityFlags = 0; + FILE* cpuInfoFile = fopen("/proc/cpuinfo", "r"); + + if (cpuInfoFile != NULL) + { + char* line = nullptr; + size_t lineLen = 0; + + while (getline(&line, &lineLen, cpuInfoFile) != -1) + { + char* p = line; + while (isspace(*p)) p++; + + if (memcmp(p, "Features", 8) != 0) + continue; + + // Skip "Features" and look for ':' + p += 8; + + while (isspace(*p)) p++; + if (*p != ':') + continue; + + // Skip ':' and parse the list + p++; + + while (true) + { + while (isspace(*p)) p++; + if (*p == 0) + break; + + char* start = p++; + while ((*p != 0) && !isspace(*p)) p++; + + capabilityFlags |= LookupCpuCapabilityFlag(start, p - start); + } + + break; + } + + free(line); + fclose(cpuInfoFile); + } + + return capabilityFlags; +} +#endif // defined(HOST_ARM64) && defined(__linux__) + PALIMPORT VOID PALAPI @@ -20,116 +153,131 @@ PAL_GetJitCpuCapabilityFlags(CORJIT_FLAGS *flags) { _ASSERTE(flags); - CORJIT_FLAGS &CPUCompileFlags = *flags; - #if defined(HOST_ARM64) #if HAVE_AUXV_HWCAP_H unsigned long hwCap = getauxval(AT_HWCAP); +#if defined(__linux__) + // getauxval(AT_HWCAP) returns zero on WSL1 (https://github.com/microsoft/WSL/issues/3682), + // fall back to reading capabilities from /proc/cpuinfo. + if (hwCap == 0) + hwCap = GetCpuCapabilityFlagsFromCpuInfo(); +#endif + // HWCAP_* flags are introduced by ARM into the Linux kernel as new extensions are published. // For a given kernel, some of these flags may not be present yet. // Use ifdef for each to allow for compilation with any vintage kernel. // From a single binary distribution perspective, compiling with latest kernel asm/hwcap.h should // include all published flags. Given flags are merged to kernel and published before silicon is // available, using the latest kernel for release should be sufficient. - CPUCompileFlags.Set(InstructionSet_ArmBase); + flags->Set(InstructionSet_ArmBase); #ifdef HWCAP_AES if (hwCap & HWCAP_AES) - CPUCompileFlags.Set(InstructionSet_Aes); + flags->Set(InstructionSet_Aes); #endif #ifdef HWCAP_ATOMICS if (hwCap & HWCAP_ATOMICS) - CPUCompileFlags.Set(InstructionSet_Atomics); + flags->Set(InstructionSet_Atomics); #endif #ifdef HWCAP_CRC32 if (hwCap & HWCAP_CRC32) - CPUCompileFlags.Set(InstructionSet_Crc32); + flags->Set(InstructionSet_Crc32); #endif #ifdef HWCAP_DCPOP // if (hwCap & HWCAP_DCPOP) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_DCPOP); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_DCPOP); #endif #ifdef HWCAP_ASIMDDP if (hwCap & HWCAP_ASIMDDP) - CPUCompileFlags.Set(InstructionSet_Dp); + flags->Set(InstructionSet_Dp); #endif #ifdef HWCAP_FCMA // if (hwCap & HWCAP_FCMA) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FCMA); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FCMA); #endif #ifdef HWCAP_FP // if (hwCap & HWCAP_FP) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FP); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FP); #endif #ifdef HWCAP_FPHP // if (hwCap & HWCAP_FPHP) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FP16); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FP16); #endif #ifdef HWCAP_JSCVT // if (hwCap & HWCAP_JSCVT) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_JSCVT); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_JSCVT); #endif #ifdef HWCAP_LRCPC // if (hwCap & HWCAP_LRCPC) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_LRCPC); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_LRCPC); #endif #ifdef HWCAP_PMULL // if (hwCap & HWCAP_PMULL) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_PMULL); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_PMULL); #endif #ifdef HWCAP_SHA1 if (hwCap & HWCAP_SHA1) - CPUCompileFlags.Set(InstructionSet_Sha1); + flags->Set(InstructionSet_Sha1); #endif #ifdef HWCAP_SHA2 if (hwCap & HWCAP_SHA2) - CPUCompileFlags.Set(InstructionSet_Sha256); + flags->Set(InstructionSet_Sha256); #endif #ifdef HWCAP_SHA512 // if (hwCap & HWCAP_SHA512) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SHA512); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SHA512); #endif #ifdef HWCAP_SHA3 // if (hwCap & HWCAP_SHA3) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SHA3); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SHA3); #endif #ifdef HWCAP_ASIMD if (hwCap & HWCAP_ASIMD) - CPUCompileFlags.Set(InstructionSet_AdvSimd); + flags->Set(InstructionSet_AdvSimd); #endif #ifdef HWCAP_ASIMDRDM if (hwCap & HWCAP_ASIMDRDM) - CPUCompileFlags.Set(InstructionSet_Rdm); + flags->Set(InstructionSet_Rdm); #endif #ifdef HWCAP_ASIMDHP // if (hwCap & HWCAP_ASIMDHP) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_ADVSIMD_FP16); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_ADVSIMD_FP16); #endif #ifdef HWCAP_SM3 // if (hwCap & HWCAP_SM3) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SM3); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SM3); #endif #ifdef HWCAP_SM4 // if (hwCap & HWCAP_SM4) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SM4); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SM4); #endif #ifdef HWCAP_SVE // if (hwCap & HWCAP_SVE) -// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SVE); +// flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_SVE); #endif #else // !HAVE_AUXV_HWCAP_H +#if HAVE_SYSCTLBYNAME + int64_t valueFromSysctl = 0; + size_t sz = sizeof(valueFromSysctl); + + if ((sysctlbyname("hw.optional.armv8_1_atomics", &valueFromSysctl, &sz, nullptr, 0) == 0) && (valueFromSysctl != 0)) + flags->Set(InstructionSet_Atomics); + + if ((sysctlbyname("hw.optional.armv8_crc32", &valueFromSysctl, &sz, nullptr, 0) == 0) && (valueFromSysctl != 0)) + flags->Set(InstructionSet_Crc32); +#endif // HAVE_SYSCTLBYNAME // CoreCLR SIMD and FP support is included in ARM64 baseline // On exceptional basis platforms may leave out support, but CoreCLR does not // yet support such platforms // Set baseline flags if OS has not exposed mechanism for us to determine CPU capabilities - CPUCompileFlags.Set(InstructionSet_ArmBase); - CPUCompileFlags.Set(InstructionSet_AdvSimd); - // CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FP); + flags->Set(InstructionSet_ArmBase); + flags->Set(InstructionSet_AdvSimd); + // flags->Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_FP); #endif // HAVE_AUXV_HWCAP_H #elif defined(TARGET_ARM64) // Enable ARM64 based flags by default so we always crossgen // ARM64 intrinsics for Linux - CPUCompileFlags.Set(InstructionSet_ArmBase); - CPUCompileFlags.Set(InstructionSet_AdvSimd); + flags->Set(InstructionSet_ArmBase); + flags->Set(InstructionSet_AdvSimd); #endif // defined(HOST_ARM64) } diff --git a/src/coreclr/src/pal/src/misc/miscpalapi.cpp b/src/coreclr/src/pal/src/misc/miscpalapi.cpp index ce223fdaa66d..090261187813 100644 --- a/src/coreclr/src/pal/src/misc/miscpalapi.cpp +++ b/src/coreclr/src/pal/src/misc/miscpalapi.cpp @@ -106,42 +106,6 @@ PAL_GetPALDirectoryW(PathWCharString& lpDirectoryName) return bRet; } -BOOL -PAL_GetPALDirectoryA(PathCharString& lpDirectoryName) -{ - BOOL bRet; - PathWCharString directory; - - PERF_ENTRY(PAL_GetPALDirectoryA); - - bRet = PAL_GetPALDirectoryW(directory); - - if (bRet) - { - - int length = WideCharToMultiByte(CP_ACP, 0, directory.GetString(), -1, NULL, 0, NULL, 0); - LPSTR DirectoryName = lpDirectoryName.OpenStringBuffer(length); - if (NULL == DirectoryName) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - bRet = FALSE; - } - - length = WideCharToMultiByte(CP_ACP, 0, directory.GetString(), -1, DirectoryName, length, NULL, 0); - - if (0 == length) - { - bRet = FALSE; - length++; - } - - lpDirectoryName.CloseBuffer(length - 1); - } - - PERF_EXIT(PAL_GetPALDirectoryA); - return bRet; -} - /*++ Function : @@ -188,43 +152,6 @@ PAL_GetPALDirectoryW( OUT LPWSTR lpDirectoryName, IN OUT UINT* cchDirectoryName } -PALIMPORT -BOOL -PALAPI -PAL_GetPALDirectoryA( - OUT LPSTR lpDirectoryName, - IN UINT* cchDirectoryName) -{ - BOOL bRet; - PathCharString directory; - - PERF_ENTRY(PAL_GetPALDirectoryA); - ENTRY( "PAL_GetPALDirectoryA( %p, %d )\n", lpDirectoryName, *cchDirectoryName ); - - bRet = PAL_GetPALDirectoryA(directory); - - if (bRet) - { - if (directory.GetCount() > *cchDirectoryName) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - bRet = FALSE; - *cchDirectoryName = directory.GetCount(); - } - else if (strcpy_s(lpDirectoryName, directory.GetCount(), directory.GetString()) == SAFECRT_SUCCESS) - { - } - else - { - bRet = FALSE; - } - } - - LOGEXIT( "PAL_GetPALDirectoryA returns BOOL %d.\n", bRet); - PERF_EXIT(PAL_GetPALDirectoryA); - return bRet; -} - VOID PALAPI PAL_Random( diff --git a/src/coreclr/src/pal/src/misc/sysinfo.cpp b/src/coreclr/src/pal/src/misc/sysinfo.cpp index 4592aa2a1434..1a9ca8fbfba7 100644 --- a/src/coreclr/src/pal/src/misc/sysinfo.cpp +++ b/src/coreclr/src/pal/src/misc/sysinfo.cpp @@ -131,11 +131,8 @@ PAL_GetTotalCpuCount() #elif HAVE_SYSCTL int rc; size_t sz; - int mib[2]; - + int mib[] = { CTL_HW, HW_NCPU }; sz = sizeof(nrcpus); - mib[0] = CTL_HW; - mib[1] = HW_NCPU; rc = sysctl(mib, 2, &nrcpus, &sz, NULL, 0); if (rc != 0) { @@ -337,7 +334,6 @@ GlobalMemoryStatusEx( lpBuffer->ullAvailExtendedVirtual = 0; BOOL fRetVal = FALSE; - int mib[3]; int rc; // Get the physical memory size @@ -351,10 +347,8 @@ GlobalMemoryStatusEx( #elif HAVE_SYSCTL int64_t physical_memory; size_t length; - // Get the Physical memory size - mib[0] = CTL_HW; - mib[1] = HW_MEMSIZE; + int mib[] = { CTL_HW, HW_MEMSIZE }; length = sizeof(INT64); rc = sysctl(mib, 2, &physical_memory, &length, NULL, 0); if (rc != 0) @@ -374,8 +368,7 @@ GlobalMemoryStatusEx( #if HAVE_XSW_USAGE // This is available on OSX struct xsw_usage xsu; - mib[0] = CTL_VM; - mib[1] = VM_SWAPUSAGE; + int mib[] = { CTL_HW, VM_SWAPUSAGE }; size_t length = sizeof(xsu); rc = sysctl(mib, 2, &xsu, &length, NULL, 0); if (rc == 0) @@ -386,7 +379,7 @@ GlobalMemoryStatusEx( #elif HAVE_XSWDEV // E.g. FreeBSD struct xswdev xsw; - + int mib[3]; size_t length = 2; rc = sysctlnametomib("vm.swap_info", mib, &length); if (rc == 0) @@ -517,7 +510,7 @@ ReadMemoryValueFromFile(const char* filename, uint64_t* val) char *line = nullptr; size_t lineLen = 0; char* endptr = nullptr; - uint64_t num = 0, l, multiplier; + uint64_t num = 0, multiplier; if (val == nullptr) return false; @@ -565,9 +558,14 @@ PAL_GetLogicalProcessorCacheSizeFromOS() cacheSize = std::max(cacheSize, (size_t)sysconf(_SC_LEVEL4_CACHE_SIZE)); #endif -#if defined(HOST_ARM64) - if(cacheSize == 0) +#if defined(TARGET_LINUX) && !defined(HOST_ARM) + if (cacheSize == 0) { + // + // Fallback to retrieve cachesize via /sys/.. if sysconf was not available + // for the platform. Currently musl and arm64 should be only cases to use + // this method to determine cache size. + // size_t size; if(ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index0/size", &size)) @@ -581,8 +579,10 @@ PAL_GetLogicalProcessorCacheSizeFromOS() if(ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index4/size", &size)) cacheSize = std::max(cacheSize, size); } +#endif - if(cacheSize == 0) +#if defined(HOST_ARM64) && !defined(TARGET_OSX) + if (cacheSize == 0) { // It is currently expected to be missing cache size info // diff --git a/src/coreclr/src/pal/src/misc/time.cpp b/src/coreclr/src/pal/src/misc/time.cpp index 0d56e411e4cc..ec71e5c72b06 100644 --- a/src/coreclr/src/pal/src/misc/time.cpp +++ b/src/coreclr/src/pal/src/misc/time.cpp @@ -27,45 +27,10 @@ Module Name: #include #include -#if HAVE_MACH_ABSOLUTE_TIME -#include -static mach_timebase_info_data_t s_TimebaseInfo; -#endif - using namespace CorUnix; SET_DEFAULT_DEBUG_CHANNEL(MISC); -/*++ -Function : -TIMEInitialize - -Initialize all Time-related stuff related - -(no parameters) - -Return value : -TRUE if Time support initialization succeeded -FALSE otherwise ---*/ -BOOL TIMEInitialize(void) -{ - BOOL retval = TRUE; - -#if HAVE_MACH_ABSOLUTE_TIME - kern_return_t result = mach_timebase_info(&s_TimebaseInfo); - - if (result != KERN_SUCCESS) - { - ASSERT("mach_timebase_info() failed: %s\n", mach_error_string(result)); - retval = FALSE; - } -#endif - - return retval; -} - - /*++ Function: GetSystemTime @@ -203,8 +168,8 @@ QueryPerformanceCounter( PERF_ENTRY(QueryPerformanceCounter); ENTRY("QueryPerformanceCounter()\n"); -#if HAVE_MACH_ABSOLUTE_TIME - lpPerformanceCount->QuadPart = (LONGLONG)mach_absolute_time(); +#if HAVE_CLOCK_GETTIME_NSEC_NP + lpPerformanceCount->QuadPart = (LONGLONG)clock_gettime_nsec_np(CLOCK_UPTIME_RAW); #elif HAVE_CLOCK_MONOTONIC struct timespec ts; int result = clock_gettime(CLOCK_MONOTONIC, &ts); @@ -238,21 +203,8 @@ QueryPerformanceFrequency( PERF_ENTRY(QueryPerformanceFrequency); ENTRY("QueryPerformanceFrequency()\n"); -#if HAVE_MACH_ABSOLUTE_TIME - // use denom == 0 to indicate that s_TimebaseInfo is uninitialised. - if (s_TimebaseInfo.denom == 0) - { - ASSERT("s_TimebaseInfo is uninitialized.\n"); - retval = FALSE; - } - else - { - // (numer / denom) gives you the nanoseconds per tick, so the below code - // computes the number of ticks per second. We explicitly do the multiplication - // first in order to help minimize the error that is produced by integer division. - - lpFrequency->QuadPart = ((LONGLONG)(tccSecondsToNanoSeconds) * (LONGLONG)(s_TimebaseInfo.denom)) / (LONGLONG)(s_TimebaseInfo.numer); - } +#if HAVE_CLOCK_GETTIME_NSEC_NP + lpFrequency->QuadPart = (LONGLONG)(tccSecondsToNanoSeconds); #elif HAVE_CLOCK_MONOTONIC // clock_gettime() returns a result in terms of nanoseconds rather than a count. This // means that we need to either always scale the result by the actual resolution (to @@ -323,17 +275,8 @@ GetTickCount64() { LONGLONG retval = 0; -#if HAVE_MACH_ABSOLUTE_TIME - // use denom == 0 to indicate that s_TimebaseInfo is uninitialised. - if (s_TimebaseInfo.denom == 0) - { - ASSERT("s_TimebaseInfo is uninitialized.\n"); - retval = FALSE; - } - else - { - retval = ((LONGLONG)mach_absolute_time() * (LONGLONG)(s_TimebaseInfo.numer)) / ((LONGLONG)(tccMillieSecondsToNanoSeconds) * (LONGLONG)(s_TimebaseInfo.denom)); - } +#if HAVE_CLOCK_GETTIME_NSEC_NP + return (LONGLONG)clock_gettime_nsec_np(CLOCK_UPTIME_RAW) / (LONGLONG)(tccMillieSecondsToNanoSeconds); #elif HAVE_CLOCK_MONOTONIC || HAVE_CLOCK_MONOTONIC_COARSE struct timespec ts; diff --git a/src/coreclr/src/pal/src/misc/utils.cpp b/src/coreclr/src/pal/src/misc/utils.cpp index de604fe96dc4..f279ef3d580c 100644 --- a/src/coreclr/src/pal/src/misc/utils.cpp +++ b/src/coreclr/src/pal/src/misc/utils.cpp @@ -332,6 +332,9 @@ void UTIL_SetLastErrorFromMach(kern_return_t MachReturn) --*/ BOOL IsRunningOnMojaveHardenedRuntime() { +#if defined(TARGET_ARM64) + return true; +#else // defined(TARGET_ARM64) static volatile int isRunningOnMojaveHardenedRuntime = -1; if (isRunningOnMojaveHardenedRuntime == -1) @@ -359,6 +362,7 @@ BOOL IsRunningOnMojaveHardenedRuntime() } return (BOOL)isRunningOnMojaveHardenedRuntime; +#endif // defined(TARGET_ARM64) } #endif // __APPLE__ diff --git a/src/coreclr/src/pal/src/objmgr/shmobjectmanager.cpp b/src/coreclr/src/pal/src/objmgr/shmobjectmanager.cpp index 7c4fec93ecb8..ca960617da4a 100644 --- a/src/coreclr/src/pal/src/objmgr/shmobjectmanager.cpp +++ b/src/coreclr/src/pal/src/objmgr/shmobjectmanager.cpp @@ -274,7 +274,7 @@ CSharedMemoryObjectManager::RegisterObject( _ASSERTE(fShared); // - // Check if an object by this name alredy exists + // Check if an object by this name already exists // palError = LocateObject( diff --git a/src/coreclr/src/pal/src/poll/fakepoll.cpp b/src/coreclr/src/pal/src/poll/fakepoll.cpp deleted file mode 100644 index 6b6e5403ce25..000000000000 --- a/src/coreclr/src/pal/src/poll/fakepoll.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// fakepoll.h -// poll using select -// Warning: a call to this poll() takes about 4K of stack space. - -// Greg Parker gparker@cs.stanford.edu December 2000 -// This code is in the public domain and may be copied or modified without -// permission. - -// Located at . - - - -#include "pal/palinternal.h" -#include "pal/fakepoll.h" -#include "pal/dbgmsg.h" -#include -#include -#include -#include -#include -#include - -SET_DEFAULT_DEBUG_CHANNEL(POLL); - -int poll(struct pollfd *pollSet, int pollCount, int pollTimeout) -{ - struct timeval tv; - struct timeval *tvp; - fd_set readFDs, writeFDs, exceptFDs; - fd_set *readp, *writep, *exceptp; - struct pollfd *pollEnd, *p; - int selected; - int result; - int maxFD; - - if (!pollSet) { - pollEnd = NULL; - readp = NULL; - writep = NULL; - exceptp = NULL; - maxFD = 0; - } - else { - pollEnd = pollSet + pollCount; - readp = &readFDs; - writep = &writeFDs; - exceptp = &exceptFDs; - - FD_ZERO(readp); - FD_ZERO(writep); - FD_ZERO(exceptp); - - // Find the biggest fd in the poll set - maxFD = 0; - for (p = pollSet; p < pollEnd; p++) { - if (p->fd > maxFD) maxFD = p->fd; - } - - if (maxFD >= FD_SETSIZE) { - // At least one fd is too big - errno = EINVAL; - return -1; - } - - // Transcribe flags from the poll set to the fd sets - for (p = pollSet; p < pollEnd; p++) { - if (p->fd < 0) { - // Negative fd checks nothing and always reports zero - } else { - if (p->events & POLLIN) FD_SET(p->fd, readp); - if (p->events & POLLOUT) FD_SET(p->fd, writep); - if (p->events != 0) FD_SET(p->fd, exceptp); - // POLLERR is never set coming in; poll() always reports errors. - // But don't report if we're not listening to anything at all. - } - } - } - - // poll timeout is in milliseconds. Convert to struct timeval. - // poll timeout == -1 : wait forever : select timeout of NULL - // poll timeout == 0 : return immediately : select timeout of zero - if (pollTimeout >= 0) { - tv.tv_sec = pollTimeout / 1000; - tv.tv_usec = (pollTimeout % 1000) * 1000; - tvp = &tv; - } else { - tvp = NULL; - } - - selected = select(maxFD+1, readp, writep, exceptp, tvp); - - if (selected < 0) { - // Error during select - result = -1; - } - else if (selected > 0) { - // Select found something - // Transcribe result from fd sets to poll set. - // Also count the number of selected fds. poll returns the - // number of ready fds; select returns the number of bits set. - int polled = 0; - for (p = pollSet; p < pollEnd; p++) { - p->revents = 0; - if (p->fd > -1) { - // Check p->events before setting p->revents. If we - // have multiple pollfds with the same fd, we want to - // set the appropriate revents value for each pollfd. - if (FD_ISSET(p->fd, readp) && (p->events & POLLIN)) - p->revents |= POLLIN; - if (FD_ISSET(p->fd, writep) && (p->events & POLLOUT)) - p->revents |= POLLOUT; - if (FD_ISSET(p->fd, exceptp) && (p->events != 0)) - p->revents |= POLLERR; - if (p->revents) polled++; - } - } - result = polled; - } - else { - // selected == 0, select timed out before anything happened - // Clear all result bits and return zero. - for (p = pollSet; p < pollEnd; p++) { - p->revents = 0; - } - result = 0; - } - - return result; -} diff --git a/src/coreclr/src/pal/src/safecrt/input.inl b/src/coreclr/src/pal/src/safecrt/input.inl index 4e1d243460dd..54b6296b5ca2 100644 --- a/src/coreclr/src/pal/src/safecrt/input.inl +++ b/src/coreclr/src/pal/src/safecrt/input.inl @@ -45,31 +45,6 @@ #define _CVTBUFSIZE (309+40) /* # of digits in max. dp value + slop */ -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include - -//#ifndef _INC_INTERNAL_SAFECRT -//#include -//#endif /* _INC_INTERNAL_SAFECRT */ - -//#ifdef _MBCS -//#undef _MBCS -//#endif /* _MBCS */ -//#include - #define _MBTOWC(x,y,z) _minimal_chartowchar( x, y ) #define _istspace(x) isspace((unsigned char)x) @@ -443,6 +418,7 @@ static int __check_float_string(size_t nFloatStrUsed, ++longone; /* NOBREAK */ } + FALLTHROUGH; case _T('w') : ++widechar; /* set widechar = 1 */ break; @@ -815,6 +791,7 @@ _END_SECURE_CRT_DEPRECATION_DISABLE case _T('i') : /* could be d, o, or x */ comchr = _T('d'); /* use as default */ + FALLTHROUGH; case _T('x'): @@ -869,6 +846,7 @@ x_incwidth: ++integer64; num64 = 0; #endif /* HOST_64BIT */ + FALLTHROUGH; case _T('o') : case _T('u') : case _T('d') : diff --git a/src/coreclr/src/pal/src/safecrt/internal.h b/src/coreclr/src/pal/src/safecrt/internal.h index ab87904b2b80..9537f6f09577 100644 --- a/src/coreclr/src/pal/src/safecrt/internal.h +++ b/src/coreclr/src/pal/src/safecrt/internal.h @@ -459,10 +459,6 @@ _MRTIMP int __cdecl _onexit_process(_CPVFV); _MRTIMP int __cdecl _onexit_app_domain(_CPVFV); #endif /* MRTDLL */ -#ifdef _MBCS -int __cdecl __initmbctable(void); /* mbctype.c */ -#endif /* _MBCS */ - #ifndef _MANAGED_MAIN int __CRTDECL main(__in int _Argc, __in_ecount_z(_Argc) char ** _Argv, __in_z char ** _Env); int __CRTDECL wmain(__in int _Argc, __in_ecount_z(_Argc) char16_t ** _Argv, __in_z char16_t ** _Env); diff --git a/src/coreclr/src/pal/src/safecrt/internal_securecrt.h b/src/coreclr/src/pal/src/safecrt/internal_securecrt.h index f5ca89c4bb32..7d5fd1e25c9b 100644 --- a/src/coreclr/src/pal/src/safecrt/internal_securecrt.h +++ b/src/coreclr/src/pal/src/safecrt/internal_securecrt.h @@ -240,12 +240,6 @@ #define _RETURN_TRUNCATE \ return STRUNCATE -#define _SET_MBCS_ERROR \ - (errno = EILSEQ) - -#define _RETURN_MBCS_ERROR \ - return _SET_MBCS_ERROR - /* locale dependent */ #define _LOCALE_ARG \ _LocInfo @@ -256,26 +250,6 @@ #define _LOCALE_UPDATE \ _LocaleUpdate _LocUpdate(_LOCALE_ARG) -#define _ISMBBLEAD(_Character) \ - _ismbblead_l((_Character), _LocUpdate.GetLocaleT()) - -#define _MBSDEC(_String, _Current) \ - _mbsdec((_String), (_Current)) - -#define _ISMBBLEADPREFIX(_Result, _StringStart, _BytePtr) \ - { \ - unsigned char *_Tmp_VAR, *_StringStart_VAR, *_BytePtr_VAR; \ - \ - _StringStart_VAR = (_StringStart); \ - _BytePtr_VAR = (_BytePtr); \ - _Tmp_VAR = _BytePtr_VAR; \ - while ((_Tmp_VAR >= _StringStart_VAR) && _ISMBBLEAD(*_Tmp_VAR)) \ - { \ - _Tmp_VAR--; \ - } \ - (_Result) = ((_BytePtr_VAR - _Tmp_VAR) & 1) != 0; \ - } - #define _LOCALE_SHORTCUT_TEST \ _LocUpdate.GetLocaleT()->mbcinfo->ismbcodepage == 0 diff --git a/src/coreclr/src/pal/src/safecrt/makepath_s.cpp b/src/coreclr/src/pal/src/safecrt/makepath_s.cpp index 8b39a52d344e..9d91cdadb2cc 100644 --- a/src/coreclr/src/pal/src/safecrt/makepath_s.cpp +++ b/src/coreclr/src/pal/src/safecrt/makepath_s.cpp @@ -25,6 +25,4 @@ #define _SIZE _SizeInBytes #define _T(_Character) _Character -#define _MBS_SUPPORT 0 - #include "tmakepath_s.inl" diff --git a/src/coreclr/src/pal/src/safecrt/output.inl b/src/coreclr/src/pal/src/safecrt/output.inl index 9e90525735ad..9aab6e8f1603 100644 --- a/src/coreclr/src/pal/src/safecrt/output.inl +++ b/src/coreclr/src/pal/src/safecrt/output.inl @@ -79,11 +79,6 @@ Buffer size required to be passed to _gcvt, fcvt and other fp conversion routine #define _CLDCVT _cldcvt #endif /* _CLDCVT */ -#ifdef _MBCS -#undef _MBCS -#endif /* _MBCS */ -//#include - /* this macro defines a function which is private and as fast as possible: */ /* for example, in C 6.0, it might be static _fastcall near. */ #define LOCAL(x) static x __cdecl @@ -852,6 +847,7 @@ int __cdecl _output ( #endif /* _UNICODE */ /* fall into 'c' case */ + FALLTHROUGH; case _T('c'): { /* print a single character specified by int argument */ #ifdef _UNICODE @@ -935,6 +931,7 @@ int __cdecl _output ( if (!(flags & (FL_SHORT|FL_LONG|FL_WIDECHAR))) flags |= FL_SHORT; #endif /* _UNICODE */ + FALLTHROUGH; case _T('s'): { /* print a string -- */ @@ -1034,7 +1031,7 @@ int __cdecl _output ( case _T('A'): capexp = 1; /* capitalize exponent */ ch += _T('a') - _T('A'); /* convert format char to lower */ - /* DROP THROUGH */ + FALLTHROUGH; case _T('e'): case _T('f'): case _T('g'): @@ -1112,6 +1109,7 @@ int __cdecl _output ( flags |= FL_LONG; /* assume we're converting a long */ #endif /* !PTR_IS_INT */ /* DROP THROUGH to hex formatting */ + FALLTHROUGH; case _T('X'): /* unsigned upper hex output */ diff --git a/src/coreclr/src/pal/src/safecrt/safecrt_output_l.cpp b/src/coreclr/src/pal/src/safecrt/safecrt_output_l.cpp index 752ffea173fe..a59bfaaf5430 100644 --- a/src/coreclr/src/pal/src/safecrt/safecrt_output_l.cpp +++ b/src/coreclr/src/pal/src/safecrt/safecrt_output_l.cpp @@ -91,11 +91,6 @@ Buffer size required to be passed to _gcvt, fcvt and other fp conversion routine #define _CLDCVT _cldcvt #endif /* _CLDCVT */ -#ifdef _MBCS -#undef _MBCS -#endif /* _MBCS */ -//#include - /* this macro defines a function which is private and as fast as possible: */ /* for example, in C 6.0, it might be static _fastcall near. */ #define LOCAL(x) static x __cdecl @@ -771,7 +766,7 @@ int __cdecl _output ( flags |= FL_WIDECHAR; /* ISO std. */ #endif /* _UNICODE */ /* fall into 'c' case */ - + FALLTHROUGH; case _T('c'): { /* print a single character specified by int argument */ #ifdef _UNICODE @@ -851,6 +846,7 @@ int __cdecl _output ( if (!(flags & (FL_SHORT|FL_LONG|FL_WIDECHAR))) flags |= FL_SHORT; #endif /* _UNICODE */ + FALLTHROUGH; case _T('s'): { /* print a string -- */ @@ -950,7 +946,7 @@ int __cdecl _output ( case _T('A'): capexp = 1; /* capitalize exponent */ ch += _T('a') - _T('A'); /* convert format char to lower */ - /* DROP THROUGH */ + FALLTHROUGH; case _T('e'): case _T('f'): case _T('g'): @@ -1019,6 +1015,7 @@ int __cdecl _output ( flags |= FL_LONG; /* assume we're converting a long */ #endif /* !PTR_IS_INT */ /* DROP THROUGH to hex formatting */ + FALLTHROUGH; case _T('X'): /* unsigned upper hex output */ diff --git a/src/coreclr/src/pal/src/safecrt/snprintf.cpp b/src/coreclr/src/pal/src/safecrt/snprintf.cpp deleted file mode 100644 index aafa5ca9b0e3..000000000000 --- a/src/coreclr/src/pal/src/safecrt/snprintf.cpp +++ /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. - -/*** -*snprintf.c - "Count" version of sprintf -* - -* -*Purpose: -* The sprintf_s() flavor takes a count argument that is -* the max number of bytes that should be written to the -* user's buffer. -* -*******************************************************************************/ - -#define _COUNT_ 1 -#include "sprintf.c" diff --git a/src/coreclr/src/pal/src/safecrt/splitpath_s.cpp b/src/coreclr/src/pal/src/safecrt/splitpath_s.cpp index 1fe3a384d479..92e6636221fa 100644 --- a/src/coreclr/src/pal/src/safecrt/splitpath_s.cpp +++ b/src/coreclr/src/pal/src/safecrt/splitpath_s.cpp @@ -25,6 +25,4 @@ #define _TCSNCPY_S strncpy_s #define _T(_Character) _Character -#define _MBS_SUPPORT 0 - #include "tsplitpath_s.inl" diff --git a/src/coreclr/src/pal/src/safecrt/sscanf_s.cpp b/src/coreclr/src/pal/src/safecrt/sscanf_s.cpp index 26e5167f4b27..a9d103027686 100644 --- a/src/coreclr/src/pal/src/safecrt/sscanf_s.cpp +++ b/src/coreclr/src/pal/src/safecrt/sscanf_s.cpp @@ -65,45 +65,6 @@ static int __cdecl vscan_fn ( return(retval); } -static int __cdecl vnscan_fn ( - INPUTFN inputfn, - const char *string, - size_t count, - const char *format, - va_list arglist - ) -{ - miniFILE str; - miniFILE *infile = &str; - int retval; - size_t length = strlen(string); - - _VALIDATE_RETURN( (string != NULL), EINVAL, EOF); - _VALIDATE_RETURN( (format != NULL), EINVAL, EOF); - - infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF; - infile->_ptr = infile->_base = (char *) string; - - if ( count > length ) - { - count = length; - } - - if(count>(INT_MAX/sizeof(char))) - { - /* old-style functions allow any large value to mean unbounded */ - infile->_cnt = INT_MAX; - } - else - { - infile->_cnt = (int)count*sizeof(char); - } - - retval = (inputfn(infile, ( const unsigned char* )format, arglist)); - - return(retval); -} - static int __cdecl vwscan_fn ( WINPUTFN inputfn, const char16_t *string, @@ -137,46 +98,6 @@ static int __cdecl vwscan_fn ( return(retval); } -static int __cdecl vnwscan_fn ( - WINPUTFN inputfn, - const char16_t *string, - size_t count, - const char16_t *format, - va_list arglist - ) -{ - miniFILE str; - miniFILE *infile = &str; - int retval; - size_t length = PAL_wcsnlen(string, INT_MAX); - - _VALIDATE_RETURN( (string != NULL), EINVAL, EOF); - _VALIDATE_RETURN( (format != NULL), EINVAL, EOF); - - infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF; - infile->_ptr = infile->_base = (char *) string; - - if ( count > length ) - { - count = length; - } - - if(count>(INT_MAX/sizeof(char16_t))) - { - /* old-style functions allow any large value to mean unbounded */ - infile->_cnt = INT_MAX; - } - else - { - infile->_cnt = (int)count*sizeof(char16_t); - } - - retval = (inputfn(infile, format, arglist)); - - return(retval); -} - - /*** *int sscanf_s(string, format, ...) * Same as sscanf above except that it calls _input_s to do the real work. diff --git a/src/coreclr/src/pal/src/safecrt/tmakepath_s.inl b/src/coreclr/src/pal/src/safecrt/tmakepath_s.inl index 27d2ab731d60..d4b74ef264ad 100644 --- a/src/coreclr/src/pal/src/safecrt/tmakepath_s.inl +++ b/src/coreclr/src/pal/src/safecrt/tmakepath_s.inl @@ -47,11 +47,7 @@ errno_t __cdecl _FUNC_NAME(__out_ecount_z(_SIZE) _CHAR *_DEST, __in_opt size_t _ *d++ = *p++; } while (*p != 0); -#if _MBS_SUPPORT - p = _MBSDEC(_Dir, p); -#else /* _MBS_SUPPORT */ - p = p - 1; -#endif /* _MBS_SUPPORT */ + p--; if (*p != _T('/') && *p != _T('\\')) { if(++written >= _SIZE) diff --git a/src/coreclr/src/pal/src/safecrt/tsplitpath_s.inl b/src/coreclr/src/pal/src/safecrt/tsplitpath_s.inl index 8a447c0d85c5..7bbaf26a99c0 100644 --- a/src/coreclr/src/pal/src/safecrt/tsplitpath_s.inl +++ b/src/coreclr/src/pal/src/safecrt/tsplitpath_s.inl @@ -92,7 +92,7 @@ errno_t __cdecl _FUNC_NAME( /* extract path string, if any. _Path now points to the first character * of the path, if any, or the filename or extension, if no path was - * specified. Scan ahead for the last occurence, if any, of a '/' or + * specified. Scan ahead for the last occurrence, if any, of a '/' or * '\' path separator character. If none is found, there is no path. * We will also note the last '.' character found, if any, to aid in * handling the extension. @@ -102,26 +102,14 @@ errno_t __cdecl _FUNC_NAME( tmp = _Path; for (; *tmp != 0; ++tmp) { -#if _MBS_SUPPORT -#pragma warning(push) -#pragma warning(disable:4127) - if (_ISMBBLEAD(*tmp)) -#pragma warning(pop) + if (*tmp == _T('/') || *tmp == _T('\\')) { - tmp++; + /* point to one beyond for later copy */ + last_slash = tmp + 1; } - else -#endif /* _MBS_SUPPORT */ + else if (*tmp == _T('.')) { - if (*tmp == _T('/') || *tmp == _T('\\')) - { - /* point to one beyond for later copy */ - last_slash = tmp + 1; - } - else if (*tmp == _T('.')) - { - dot = tmp; - } + dot = tmp; } } diff --git a/src/coreclr/src/pal/src/safecrt/wcslwr_s.cpp b/src/coreclr/src/pal/src/safecrt/wcslwr_s.cpp new file mode 100644 index 000000000000..f80ff7bcf344 --- /dev/null +++ b/src/coreclr/src/pal/src/safecrt/wcslwr_s.cpp @@ -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. + +/*** +*wcslwr_s.cpp - contains _wcslwr_s() routine +* +* +*Purpose: +* _wcslwr_s converts, in place, any upper case letters in input string to +* lowercase. +* +*******************************************************************************/ + +#include +#include +#include +#include +#include "internal_securecrt.h" + +#include "mbusafecrt_internal.h" + +DLLEXPORT errno_t __cdecl _wcslwr_s(char16_t *string, size_t sz) +{ + _VALIDATE_RETURN_ERRCODE(string != NULL, EINVAL); + size_t length = PAL_wcsnlen(string, sz); + if (length >= sz) + { + _RETURN_DEST_NOT_NULL_TERMINATED(string, sz); + } + + for (int i = 0; string[i] != 0; i++) + { + string[i] = towlower(string[i]); + } + + _FILL_STRING(string, sz, length + 1); + + return 0; +} diff --git a/src/coreclr/src/pal/src/safecrt/wmakepath_s.cpp b/src/coreclr/src/pal/src/safecrt/wmakepath_s.cpp index ab33c214fc76..cc5445f3054d 100644 --- a/src/coreclr/src/pal/src/safecrt/wmakepath_s.cpp +++ b/src/coreclr/src/pal/src/safecrt/wmakepath_s.cpp @@ -24,6 +24,5 @@ #define _DEST _Dst #define _SIZE _SizeInWords #define _T(_Character) L##_Character -#define _MBS_SUPPORT 0 #include "tmakepath_s.inl" diff --git a/src/coreclr/src/pal/src/safecrt/wsplitpath_s.cpp b/src/coreclr/src/pal/src/safecrt/wsplitpath_s.cpp index 6889723c1473..420d7134acaf 100644 --- a/src/coreclr/src/pal/src/safecrt/wsplitpath_s.cpp +++ b/src/coreclr/src/pal/src/safecrt/wsplitpath_s.cpp @@ -24,6 +24,5 @@ #define _CHAR char16_t #define _TCSNCPY_S wcsncpy_s #define _T(_Character) L##_Character -#define _MBS_SUPPORT 0 #include "tsplitpath_s.inl" diff --git a/src/coreclr/src/pal/src/synchobj/event.cpp b/src/coreclr/src/pal/src/synchobj/event.cpp index a00272c5a454..36205c2558f5 100644 --- a/src/coreclr/src/pal/src/synchobj/event.cpp +++ b/src/coreclr/src/pal/src/synchobj/event.cpp @@ -74,75 +74,12 @@ CObjectType CorUnix::otAutoResetEvent( PalObjectTypeId rgEventIds[] = {otiManualResetEvent, otiAutoResetEvent}; CAllowedObjectTypes aotEvent(rgEventIds, sizeof(rgEventIds)/sizeof(rgEventIds[0])); -/*++ -Function: - CreateEventA - -Note: - lpEventAttributes currentely ignored: - -- Win32 object security not supported - -- handles to event objects are not inheritable - -Parameters: - See MSDN doc. ---*/ - -HANDLE -PALAPI -CreateEventA( - IN LPSECURITY_ATTRIBUTES lpEventAttributes, - IN BOOL bManualReset, - IN BOOL bInitialState, - IN LPCSTR lpName) -{ - HANDLE hEvent = NULL; - CPalThread *pthr = NULL; - PAL_ERROR palError; - - PERF_ENTRY(CreateEventA); - ENTRY("CreateEventA(lpEventAttr=%p, bManualReset=%d, bInitialState=%d, lpName=%p (%s)\n", - lpEventAttributes, bManualReset, bInitialState, lpName, lpName?lpName:"NULL"); - - pthr = InternalGetCurrentThread(); - - if (lpName != nullptr) - { - ASSERT("lpName: Cross-process named objects are not supported in PAL"); - palError = ERROR_NOT_SUPPORTED; - } - else - { - palError = InternalCreateEvent( - pthr, - lpEventAttributes, - bManualReset, - bInitialState, - NULL, - &hEvent - ); - } - - // - // We always need to set last error, even on success: - // we need to protect ourselves from the situation - // where last error is set to ERROR_ALREADY_EXISTS on - // entry to the function - // - - pthr->SetLastError(palError); - - LOGEXIT("CreateEventA returns HANDLE %p\n", hEvent); - PERF_EXIT(CreateEventA); - return hEvent; -} - - /*++ Function: CreateEventW Note: - lpEventAttributes currentely ignored: + lpEventAttributes currently ignored: -- Win32 object security not supported -- handles to event objects are not inheritable @@ -227,7 +164,7 @@ CreateEventExW( InternalCreateEvent Note: - lpEventAttributes currentely ignored: + lpEventAttributes currently ignored: -- Win32 object security not supported -- handles to event objects are not inheritable diff --git a/src/coreclr/src/pal/src/synchobj/mutex.cpp b/src/coreclr/src/pal/src/synchobj/mutex.cpp index b0b4425fc5ba..85bf3da1e79a 100644 --- a/src/coreclr/src/pal/src/synchobj/mutex.cpp +++ b/src/coreclr/src/pal/src/synchobj/mutex.cpp @@ -92,65 +92,12 @@ static CAllowedObjectTypes aotNamedMutex(otiNamedMutex); static PalObjectTypeId anyMutexTypeIds[] = {otiMutex, otiNamedMutex}; static CAllowedObjectTypes aotAnyMutex(anyMutexTypeIds, _countof(anyMutexTypeIds)); -/*++ -Function: - CreateMutexA - -Note: - lpMutexAttributes currentely ignored: - -- Win32 object security not supported - -- handles to mutex objects are not inheritable - -Parameters: - See MSDN doc. ---*/ - -HANDLE -PALAPI -CreateMutexA( - IN LPSECURITY_ATTRIBUTES lpMutexAttributes, - IN BOOL bInitialOwner, - IN LPCSTR lpName) -{ - HANDLE hMutex = NULL; - CPalThread *pthr = NULL; - PAL_ERROR palError; - - PERF_ENTRY(CreateMutexA); - ENTRY("CreateMutexA(lpMutexAttr=%p, bInitialOwner=%d, lpName=%p (%s)\n", - lpMutexAttributes, bInitialOwner, lpName, lpName?lpName:"NULL"); - - pthr = InternalGetCurrentThread(); - - palError = InternalCreateMutex( - pthr, - lpMutexAttributes, - bInitialOwner, - lpName, - &hMutex - ); - - // - // We always need to set last error, even on success: - // we need to protect ourselves from the situation - // where last error is set to ERROR_ALREADY_EXISTS on - // entry to the function - // - - pthr->SetLastError(palError); - - LOGEXIT("CreateMutexA returns HANDLE %p\n", hMutex); - PERF_EXIT(CreateMutexA); - return hMutex; -} - - /*++ Function: CreateMutexW Note: - lpMutexAttributes currentely ignored: + lpMutexAttributes currently ignored: -- Win32 object security not supported -- handles to mutex objects are not inheritable @@ -223,7 +170,7 @@ CreateMutexW( CreateMutexW Note: -lpMutexAttributes currentely ignored: +lpMutexAttributes currently ignored: -- Win32 object security not supported -- handles to mutex objects are not inheritable @@ -247,7 +194,7 @@ CreateMutexExW( InternalCreateMutex Note: - lpMutexAttributes currentely ignored: + lpMutexAttributes currently ignored: -- Win32 object security not supported -- handles to mutex objects are not inheritable diff --git a/src/coreclr/src/pal/src/synchobj/semaphore.cpp b/src/coreclr/src/pal/src/synchobj/semaphore.cpp index bdc3fe8d5278..e42c07240b80 100644 --- a/src/coreclr/src/pal/src/synchobj/semaphore.cpp +++ b/src/coreclr/src/pal/src/synchobj/semaphore.cpp @@ -54,42 +54,7 @@ CAllowedObjectTypes aotSempahore(otiSemaphore); /*++ Function: -CreateSemaphoreExA - -Note: -lpSemaphoreAttributes currently ignored: --- Win32 object security not supported --- handles to semaphore objects are not inheritable - -Parameters: -See MSDN doc. ---*/ - -HANDLE -PALAPI -CreateSemaphoreExA( - IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, - IN LONG lInitialCount, - IN LONG lMaximumCount, - IN LPCSTR lpName, - IN /*_Reserved_*/ DWORD dwFlags, - IN DWORD dwDesiredAccess) -{ - // dwFlags is reserved and unused, and dwDesiredAccess is currently - // only ever used as SEMAPHORE_ALL_ACCESS. The other parameters - // all map to CreateSemaphoreA. - _ASSERTE(SEMAPHORE_ALL_ACCESS == dwDesiredAccess); - - return CreateSemaphoreA( - lpSemaphoreAttributes, - lInitialCount, - lMaximumCount, - lpName); -} - -/*++ -Function: - CreateSemaphoreA + CreateSemaphoreW Note: lpSemaphoreAttributes currently ignored: @@ -100,41 +65,32 @@ CreateSemaphoreExA( See MSDN doc. --*/ -HANDLE -PALAPI -CreateSemaphoreA( +HANDLE CreateSemaphoreW( IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, IN LONG lInitialCount, IN LONG lMaximumCount, - IN LPCSTR lpName) + IN LPCWSTR lpName) { HANDLE hSemaphore = NULL; - CPalThread *pthr = NULL; PAL_ERROR palError; + CPalThread *pthr = NULL; - PERF_ENTRY(CreateSemaphoreA); - ENTRY("CreateSemaphoreA(lpSemaphoreAttributes=%p, lInitialCount=%d, " - "lMaximumCount=%d, lpName=%p (%s))\n", - lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName, lpName?lpName:"NULL"); + PERF_ENTRY(CreateSemaphoreW); + ENTRY("CreateSemaphoreW(lpSemaphoreAttributes=%p, lInitialCount=%d, " + "lMaximumCount=%d, lpName=%p (%S))\n", + lpSemaphoreAttributes, lInitialCount, lMaximumCount, + lpName, lpName?lpName:W16_NULLSTRING); pthr = InternalGetCurrentThread(); - if (lpName != nullptr) - { - ASSERT("lpName: Cross-process named objects are not supported in PAL"); - palError = ERROR_NOT_SUPPORTED; - } - else - { - palError = InternalCreateSemaphore( - pthr, - lpSemaphoreAttributes, - lInitialCount, - lMaximumCount, - NULL, - &hSemaphore - ); - } + palError = InternalCreateSemaphore( + pthr, + lpSemaphoreAttributes, + lInitialCount, + lMaximumCount, + lpName, + &hSemaphore + ); // // We always need to set last error, even on success: @@ -145,8 +101,8 @@ CreateSemaphoreA( pthr->SetLastError(palError); - LOGEXIT("CreateSemaphoreA returns HANDLE %p\n", hSemaphore); - PERF_EXIT(CreateSemaphoreA); + LOGEXIT("CreateSemaphoreW returns HANDLE %p\n", hSemaphore); + PERF_EXIT(CreateSemaphoreW); return hSemaphore; } @@ -155,7 +111,7 @@ CreateSemaphoreA( CreateSemaphoreExW Note: -lpSemaphoreAttributes currentely ignored: +lpSemaphoreAttributes currently ignored: -- Win32 object security not supported -- handles to semaphore objects are not inheritable @@ -182,68 +138,12 @@ CreateSemaphoreExW( lpName); } -/*++ -Function: - CreateSemaphoreW - -Note: - lpSemaphoreAttributes currentely ignored: - -- Win32 object security not supported - -- handles to semaphore objects are not inheritable - -Parameters: - See MSDN doc. ---*/ - -HANDLE -PALAPI -CreateSemaphoreW( - IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, - IN LONG lInitialCount, - IN LONG lMaximumCount, - IN LPCWSTR lpName) -{ - HANDLE hSemaphore = NULL; - PAL_ERROR palError; - CPalThread *pthr = NULL; - - PERF_ENTRY(CreateSemaphoreW); - ENTRY("CreateSemaphoreW(lpSemaphoreAttributes=%p, lInitialCount=%d, " - "lMaximumCount=%d, lpName=%p (%S))\n", - lpSemaphoreAttributes, lInitialCount, lMaximumCount, - lpName, lpName?lpName:W16_NULLSTRING); - - pthr = InternalGetCurrentThread(); - - palError = InternalCreateSemaphore( - pthr, - lpSemaphoreAttributes, - lInitialCount, - lMaximumCount, - lpName, - &hSemaphore - ); - - // - // We always need to set last error, even on success: - // we need to protect ourselves from the situation - // where last error is set to ERROR_ALREADY_EXISTS on - // entry to the function - // - - pthr->SetLastError(palError); - - LOGEXIT("CreateSemaphoreW returns HANDLE %p\n", hSemaphore); - PERF_EXIT(CreateSemaphoreW); - return hSemaphore; -} - /*++ Function: InternalCreateSemaphore Note: - lpSemaphoreAttributes currentely ignored: + lpSemaphoreAttributes currently ignored: -- Win32 object security not supported -- handles to semaphore objects are not inheritable diff --git a/src/coreclr/src/pal/src/thread/context.cpp b/src/coreclr/src/pal/src/thread/context.cpp index ca0b60e44925..5ee0308c7c5a 100644 --- a/src/coreclr/src/pal/src/thread/context.cpp +++ b/src/coreclr/src/pal/src/thread/context.cpp @@ -811,6 +811,7 @@ DWORD CONTEXTGetExceptionCodeForSignal(const siginfo_t *siginfo, default: break; } + break; case SIGTRAP: switch (siginfo->si_code) { @@ -949,12 +950,16 @@ CONTEXT_GetThreadContextFromPort( mach_msg_type_number_t StateCount; thread_state_flavor_t StateFlavor; +#if defined(HOST_AMD64) if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) & CONTEXT_AREA_MASK) { - -#ifdef HOST_AMD64 x86_thread_state64_t State; StateFlavor = x86_THREAD_STATE64; +#elif defined(HOST_ARM64) + if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER) & CONTEXT_AREA_MASK) + { + arm_thread_state64_t State; + StateFlavor = ARM_THREAD_STATE64; #else #error Unexpected architecture. #endif @@ -969,7 +974,9 @@ CONTEXT_GetThreadContextFromPort( CONTEXT_GetThreadContextFromThreadState(StateFlavor, (thread_state_t)&State, lpContext); } - if (lpContext->ContextFlags & CONTEXT_ALL_FLOATING & CONTEXT_AREA_MASK) { + if (lpContext->ContextFlags & CONTEXT_ALL_FLOATING & CONTEXT_AREA_MASK) + { +#if defined(HOST_AMD64) // The thread_get_state for floating point state can fail for some flavors when the processor is not // in the right mode at the time we are taking the state. So we will try to get the AVX state first and // if it fails, get the FLOAT state and if that fails, take AVX512 state. Both AVX and AVX512 states @@ -1008,6 +1015,20 @@ CONTEXT_GetThreadContextFromPort( } } } +#elif defined(HOST_ARM64) + arm_neon_state64_t State; + + StateFlavor = ARM_NEON_STATE64; + StateCount = sizeof(arm_neon_state64_t) / sizeof(natural_t); + MachRet = thread_get_state(Port, StateFlavor, (thread_state_t)&State, &StateCount); + if (MachRet != KERN_SUCCESS) + { + // We were unable to get any floating point state. + lpContext->ContextFlags &= ~((CONTEXT_ALL_FLOATING) & CONTEXT_AREA_MASK); + } +#else +#error Unexpected architecture. +#endif CONTEXT_GetThreadContextFromThreadState(StateFlavor, (thread_state_t)&State, lpContext); } @@ -1029,7 +1050,7 @@ CONTEXT_GetThreadContextFromThreadState( { switch (threadStateFlavor) { -#ifdef HOST_AMD64 +#if defined (HOST_AMD64) case x86_THREAD_STATE64: if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) & CONTEXT_AREA_MASK) { @@ -1073,6 +1094,7 @@ CONTEXT_GetThreadContextFromThreadState( } // Intentional fall-through, the AVX states are supersets of the FLOAT state + FALLTHROUGH; case x86_FLOAT_STATE64: if (lpContext->ContextFlags & CONTEXT_FLOATING_POINT & CONTEXT_AREA_MASK) @@ -1100,9 +1122,6 @@ CONTEXT_GetThreadContextFromThreadState( memcpy(&lpContext->Xmm0, &pState->__fpu_xmm0, 16 * 16); } break; -#else -#error Unexpected architecture. -#endif case x86_THREAD_STATE: { x86_thread_state_t *pState = (x86_thread_state_t *)threadState; @@ -1116,6 +1135,31 @@ CONTEXT_GetThreadContextFromThreadState( CONTEXT_GetThreadContextFromThreadState((thread_state_flavor_t)pState->fsh.flavor, (thread_state_t)&pState->ufs, lpContext); } break; +#elif defined(HOST_ARM64) + case ARM_THREAD_STATE64: + if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER) & CONTEXT_AREA_MASK) + { + arm_thread_state64_t *pState = (arm_thread_state64_t*)threadState; + memcpy(&lpContext->X0, &pState->__x[0], 29 * 8); + lpContext->Cpsr = pState->__cpsr; + lpContext->Fp = arm_thread_state64_get_fp(*pState); + lpContext->Sp = arm_thread_state64_get_sp(*pState); + lpContext->Lr = (uint64_t)arm_thread_state64_get_lr_fptr(*pState); + lpContext->Pc = (uint64_t)arm_thread_state64_get_pc_fptr(*pState); + } + break; + case ARM_NEON_STATE64: + if (lpContext->ContextFlags & CONTEXT_FLOATING_POINT & CONTEXT_AREA_MASK) + { + arm_neon_state64_t *pState = (arm_neon_state64_t*)threadState; + memcpy(&lpContext->V[0], &pState->__v, 32 * 16); + lpContext->Fpsr = pState->__fpsr; + lpContext->Fpcr = pState->__fpcr; + } + break; +#else +#error Unexpected architecture. +#endif default: ASSERT("Invalid thread state flavor %d\n", threadStateFlavor); @@ -1216,6 +1260,16 @@ CONTEXT_SetThreadContextOnPort( // State.es = lpContext->SegEs_PAL_Undefined; State.__fs = lpContext->SegFs; State.__gs = lpContext->SegGs; +#elif defined(HOST_ARM64) + arm_thread_state64_t State; + StateFlavor = ARM_THREAD_STATE64; + + memcpy(&State.__x[0], &lpContext->X0, 29 * 8); + State.__cpsr = lpContext->Cpsr; + arm_thread_state64_set_fp(State, lpContext->Fp); + arm_thread_state64_set_sp(State, lpContext->Sp); + arm_thread_state64_set_lr_fptr(State, lpContext->Lr); + arm_thread_state64_set_pc_fptr(State, lpContext->Pc); #else #error Unexpected architecture. #endif @@ -1261,6 +1315,10 @@ CONTEXT_SetThreadContextOnPort( StateFlavor = x86_FLOAT_STATE64; StateCount = sizeof(State) / sizeof(natural_t); #endif +#elif defined(HOST_ARM64) + arm_neon_state64_t State; + StateFlavor = ARM_NEON_STATE64; + StateCount = sizeof(State) / sizeof(natural_t); #else #error Unexpected architecture. #endif @@ -1306,6 +1364,10 @@ CONTEXT_SetThreadContextOnPort( memcpy((&State.__fpu_stmm0)[i].__mmst_reg, &lpContext->FltSave.FloatRegisters[i], 10); memcpy(&State.__fpu_xmm0, &lpContext->Xmm0, 16 * 16); +#elif defined(HOST_ARM64) + memcpy(&State.__v, &lpContext->V[0], 32 * 16); + State.__fpsr = lpContext->Fpsr; + State.__fpcr = lpContext->Fpcr; #else #error Unexpected architecture. #endif diff --git a/src/coreclr/src/pal/src/thread/process.cpp b/src/coreclr/src/pal/src/thread/process.cpp index 0fd7efae777f..a5253ca8173e 100644 --- a/src/coreclr/src/pal/src/thread/process.cpp +++ b/src/coreclr/src/pal/src/thread/process.cpp @@ -80,6 +80,7 @@ SET_DEFAULT_DEBUG_CHANNEL(PROCESS); // some headers have code with asserts, so d #endif #ifdef __APPLE__ +#include #include #include #endif @@ -351,160 +352,6 @@ GetCurrentProcess( return hPseudoCurrentProcess; } -/*++ -Function: - CreateProcessA - -Note: - Only Standard handles need to be inherited. - Security attributes parameters are not used. - -See MSDN doc. ---*/ -BOOL -PALAPI -CreateProcessA( - IN LPCSTR lpApplicationName, - IN LPSTR lpCommandLine, - IN LPSECURITY_ATTRIBUTES lpProcessAttributes, - IN LPSECURITY_ATTRIBUTES lpThreadAttributes, - IN BOOL bInheritHandles, - IN DWORD dwCreationFlags, - IN LPVOID lpEnvironment, - IN LPCSTR lpCurrentDirectory, - IN LPSTARTUPINFOA lpStartupInfo, - OUT LPPROCESS_INFORMATION lpProcessInformation) -{ - PAL_ERROR palError = NO_ERROR; - CPalThread *pThread; - STARTUPINFOW StartupInfoW; - LPWSTR CommandLineW = NULL; - LPWSTR ApplicationNameW = NULL; - LPWSTR CurrentDirectoryW = NULL; - - int n; - - PERF_ENTRY(CreateProcessA); - ENTRY("CreateProcessA(lpAppName=%p (%s), lpCmdLine=%p (%s), lpProcessAttr=%p, " - "lpThreadAttr=%p, bInherit=%d, dwFlags=%#x, lpEnv=%p, " - "lpCurrentDir=%p (%s), lpStartupInfo=%p, lpProcessInfo=%p)\n", - lpApplicationName?lpApplicationName:"NULL", - lpApplicationName?lpApplicationName:"NULL", - lpCommandLine?lpCommandLine:"NULL", - lpCommandLine?lpCommandLine:"NULL", - lpProcessAttributes, lpThreadAttributes, bInheritHandles, - dwCreationFlags, lpEnvironment, - lpCurrentDirectory?lpCurrentDirectory:"NULL", - lpCurrentDirectory?lpCurrentDirectory:"NULL", - lpStartupInfo, lpProcessInformation); - - pThread = InternalGetCurrentThread(); - - if(lpStartupInfo == NULL) - { - ASSERT("lpStartupInfo is NULL!\n"); - palError = ERROR_INVALID_PARAMETER; - goto done; - } - - /* convert parameters to Unicode */ - - if(lpApplicationName) - { - n = MultiByteToWideChar(CP_ACP, 0, lpApplicationName, -1, NULL, 0); - if(0 == n) - { - ASSERT("MultiByteToWideChar failed!\n"); - palError = ERROR_INTERNAL_ERROR; - goto done; - } - ApplicationNameW = (LPWSTR)InternalMalloc(sizeof(WCHAR)*n); - if(!ApplicationNameW) - { - ERROR("malloc() failed!\n"); - palError = ERROR_NOT_ENOUGH_MEMORY; - goto done; - } - MultiByteToWideChar(CP_ACP, 0, lpApplicationName, -1, ApplicationNameW, - n); - } - - if(lpCommandLine) - { - n = MultiByteToWideChar(CP_ACP, 0, lpCommandLine, -1, NULL, 0); - if(0 == n) - { - ASSERT("MultiByteToWideChar failed!\n"); - palError = ERROR_INTERNAL_ERROR; - goto done; - } - CommandLineW = (LPWSTR)InternalMalloc(sizeof(WCHAR)*n); - if(!CommandLineW) - { - ERROR("malloc() failed!\n"); - palError = ERROR_NOT_ENOUGH_MEMORY; - goto done; - } - MultiByteToWideChar(CP_ACP, 0, lpCommandLine, -1, CommandLineW, n); - } - - if(lpCurrentDirectory) - { - n = MultiByteToWideChar(CP_ACP, 0, lpCurrentDirectory, -1, NULL, 0); - if(0 == n) - { - ASSERT("MultiByteToWideChar failed!\n"); - palError = ERROR_INTERNAL_ERROR; - goto done; - } - CurrentDirectoryW = (LPWSTR)InternalMalloc(sizeof(WCHAR)*n); - if(!CurrentDirectoryW) - { - ERROR("malloc() failed!\n"); - palError = ERROR_NOT_ENOUGH_MEMORY; - goto done; - } - MultiByteToWideChar(CP_ACP, 0, lpCurrentDirectory, -1, - CurrentDirectoryW, n); - } - - // lpEnvironment should remain ansi on the call to CreateProcessW - - StartupInfoW.cb = sizeof StartupInfoW; - StartupInfoW.dwFlags = lpStartupInfo->dwFlags; - StartupInfoW.hStdError = lpStartupInfo->hStdError; - StartupInfoW.hStdInput = lpStartupInfo->hStdInput; - StartupInfoW.hStdOutput = lpStartupInfo->hStdOutput; - /* all other members are PAL_Undefined, we can ignore them */ - - palError = InternalCreateProcess( - pThread, - ApplicationNameW, - CommandLineW, - lpProcessAttributes, - lpThreadAttributes, - dwCreationFlags, - lpEnvironment, - CurrentDirectoryW, - &StartupInfoW, - lpProcessInformation - ); -done: - free(ApplicationNameW); - free(CommandLineW); - free(CurrentDirectoryW); - - if (NO_ERROR != palError) - { - pThread->SetLastError(palError); - } - - LOGEXIT("CreateProcessA returns BOOL %d\n", NO_ERROR == palError); - PERF_EXIT(CreateProcessA); - return NO_ERROR == palError; -} - - /*++ Function: CreateProcessW @@ -1345,7 +1192,7 @@ ExitProcess( /* this should never get executed */ ASSERT("ExitProcess should not return!\n"); - for (;;); + while (true); } /*++ @@ -3005,65 +2852,63 @@ CreateProcessModules( // NOTE: the module path can have spaces in the name // __TEXT 0000000196220000-00000001965b4000 [ 3664K 2340K 0K 0K] r-x/rwx SM=COW /Volumes/Builds/builds/devmain/rawproduct/debug/build/out/Applications/Microsoft Excel.app/Contents/SharedSupport/PowerQuery/libcoreclr.dylib - char *line = NULL; - size_t lineLen = 0; - int count = 0; - ssize_t read; - char vmmapCommand[100]; - int chars = snprintf(vmmapCommand, sizeof(vmmapCommand), "/usr/bin/vmmap -interleaved %d -wide", dwProcessId); - _ASSERTE(chars > 0 && chars <= sizeof(vmmapCommand)); + // NOTE: Sometimes vmmap hides full paths to some process modules (.dylibs in non-system folders), causing debugger not to work. + // __TEXT 000000010d8bd000-000000010ddce000 [ 5188K 5188K 0K 0K] r-x/rwx SM=COW /Users/USER/*/libcoreclr.dylib + // So now we get modules information by iterating over regions using proc_pidinfo(). See dotnet/runtime#42888. + int count = 0; - FILE *vmmapFile = popen(vmmapCommand, "r"); - if (vmmapFile == NULL) + uint64_t addr = 0; + while (true) { - goto exit; - } + struct proc_regionwithpathinfo rwpi; + int sz = proc_pidinfo(dwProcessId, PROC_PIDREGIONPATHINFO, addr, &rwpi, sizeof rwpi); + if (sz != sizeof rwpi) + { + if (sz == 0 && errno == EINVAL) + break; // ok - // Reading maps file line by line - while ((read = getline(&line, &lineLen, vmmapFile)) != -1) - { - void *startAddress, *endAddress; - char moduleName[PATH_MAX]; + DestroyProcessModules(listHead); + listHead = NULL; + count = 0; + break; // unknown error + } + + const char *moduleName = rwpi.prp_vip.vip_path; - if (sscanf_s(line, "__TEXT %p-%p [ %*[0-9K ]] %*[-/rwxsp] SM=%*[A-Z] %[^\n]", &startAddress, &endAddress, moduleName, _countof(moduleName)) == 3) + bool dup = false; + for (ProcessModules *entry = listHead; entry != NULL; entry = entry->Next) { - bool dup = false; - for (ProcessModules *entry = listHead; entry != NULL; entry = entry->Next) + if (strcmp(moduleName, entry->Name) == 0) { - if (strcmp(moduleName, entry->Name) == 0) - { - dup = true; - break; - } + dup = true; + break; } + } - if (!dup) + if (!dup) + { + int cbModuleName = strlen(moduleName) + 1; + ProcessModules *entry = (ProcessModules *)InternalMalloc(sizeof(ProcessModules) + cbModuleName); + if (entry == NULL) { - int cbModuleName = strlen(moduleName) + 1; - ProcessModules *entry = (ProcessModules *)InternalMalloc(sizeof(ProcessModules) + cbModuleName); - if (entry == NULL) - { - DestroyProcessModules(listHead); - listHead = NULL; - count = 0; - break; - } - strcpy_s(entry->Name, cbModuleName, moduleName); - entry->BaseAddress = startAddress; - entry->Next = listHead; - listHead = entry; - count++; + DestroyProcessModules(listHead); + listHead = NULL; + count = 0; + break; // no memory } + memcpy_s(entry->Name, cbModuleName, moduleName, cbModuleName); + entry->BaseAddress = (void *)rwpi.prp_prinfo.pri_address; + entry->Next = listHead; + listHead = entry; + count++; } + + addr = rwpi.prp_prinfo.pri_address + rwpi.prp_prinfo.pri_size; } *lpCount = count; - free(line); // We didn't allocate line, but as per contract of getline we should free it - pclose(vmmapFile); -exit: - #elif HAVE_PROCFS_MAPS // Here we read /proc//maps file in order to parse it and figure out what it says diff --git a/src/coreclr/src/pal/src/thread/thread.cpp b/src/coreclr/src/pal/src/thread/thread.cpp index 6efe93492bc3..8f38a3d352b1 100644 --- a/src/coreclr/src/pal/src/thread/thread.cpp +++ b/src/coreclr/src/pal/src/thread/thread.cpp @@ -539,7 +539,6 @@ CorUnix::InternalCreateThread( pthread_t pthread; pthread_attr_t pthreadAttr; - size_t pthreadStackSize; #if PTHREAD_CREATE_MODIFIES_ERRNO int storedErrno; #endif // PTHREAD_CREATE_MODIFIES_ERRNO @@ -740,41 +739,6 @@ CorUnix::InternalCreateThread( storedErrno = errno; #endif // PTHREAD_CREATE_MODIFIES_ERRNO -#if HAVE_PTHREAD_ATTR_SETAFFINITY_NP && HAVE_SCHED_GETAFFINITY - { - // Threads inherit their parent's affinity mask on Linux. This is not desired, so we reset - // the current thread's affinity mask to the mask of the current process. - cpu_set_t cpuSet; - CPU_ZERO(&cpuSet); - - int st = sched_getaffinity(gPID, sizeof(cpu_set_t), &cpuSet); - if (st != 0) - { - ASSERT("sched_getaffinity failed!\n"); - // the sched_getaffinity should never fail for getting affinity of the current process - palError = ERROR_INTERNAL_ERROR; - goto EXIT; - } - - st = pthread_attr_setaffinity_np(&pthreadAttr, sizeof(cpu_set_t), &cpuSet); - if (st != 0) - { - if (st == ENOMEM) - { - palError = ERROR_NOT_ENOUGH_MEMORY; - } - else - { - ASSERT("pthread_attr_setaffinity_np failed!\n"); - // The pthread_attr_setaffinity_np should never fail except of OOM when - // passed the mask extracted using sched_getaffinity. - palError = ERROR_INTERNAL_ERROR; - } - goto EXIT; - } - } -#endif // HAVE_PTHREAD_GETAFFINITY_NP && HAVE_SCHED_GETAFFINITY - iError = pthread_create(&pthread, &pthreadAttr, CPalThread::ThreadEntry, pNewThread); #if PTHREAD_CREATE_MODIFIES_ERRNO @@ -890,7 +854,7 @@ ExitThread( pthread_exit(NULL); ASSERT("pthread_exit should not return!\n"); - for (;;); + while (true); } /*++ @@ -1286,6 +1250,9 @@ CorUnix::InternalSetThreadPriority( return palError; } +#define SECS_TO_NS 1000000000 /* 10^9 */ +#define USECS_TO_NS 1000 /* 10^3 */ + BOOL CorUnix::GetThreadTimesInternal( IN HANDLE hThread, @@ -1294,8 +1261,6 @@ CorUnix::GetThreadTimesInternal( { __int64 calcTime; BOOL retval = FALSE; - const __int64 SECS_TO_NS = 1000000000; /* 10^9 */ - const __int64 USECS_TO_NS = 1000; /* 10^3 */ #if HAVE_MACH_THREADS thread_basic_info resUsage; @@ -1754,6 +1719,10 @@ CPalThread::ThreadEntry( PTHREAD_START_ROUTINE pfnStartRoutine; LPVOID pvPar; DWORD retValue; +#if HAVE_SCHED_GETAFFINITY && HAVE_SCHED_SETAFFINITY + cpu_set_t cpuSet; + int st; +#endif pThread = reinterpret_cast(pvParam); @@ -1763,6 +1732,42 @@ CPalThread::ThreadEntry( goto fail; } +#if HAVE_SCHED_GETAFFINITY && HAVE_SCHED_SETAFFINITY + // Threads inherit their parent's affinity mask on Linux. This is not desired, so we reset + // the current thread's affinity mask to the mask of the current process. + // + // Typically, we would use pthread_attr_setaffinity_np() and have pthread_create() create the thread with the specified + // affinity. At least one implementation of pthread_create() following a pthread_attr_setaffinity_np() calls + // sched_setaffinity(, ...), which is not allowed under Snap's default strict confinement without manually + // connecting the process-control plug. To work around that, have the thread set the affinity after it starts. + // sched_setaffinity(, ...) is also currently not allowed, only sched_setaffinity(0, ...). + // pthread_setaffinity_np(pthread_self(), ...) seems to call sched_setaffinity(, ...) in at least one + // implementation, and does not work. Use sched_setaffinity(0, ...) instead. See the following for more information: + // - https://github.com/dotnet/runtime/pull/38795 + // - https://github.com/dotnet/runtime/issues/1634 + // - https://forum.snapcraft.io/t/requesting-autoconnect-for-interfaces-in-pigmeat-process-control-home/17987/13 + + CPU_ZERO(&cpuSet); + + st = sched_getaffinity(gPID, sizeof(cpu_set_t), &cpuSet); + if (st != 0) + { + ASSERT("sched_getaffinity failed!\n"); + // The sched_getaffinity should never fail for getting affinity of the current process + palError = ERROR_INTERNAL_ERROR; + goto fail; + } + + st = sched_setaffinity(0, sizeof(cpu_set_t), &cpuSet); + if (st != 0) + { + ASSERT("sched_setaffinity failed!\n"); + // The sched_setaffinity should never fail when passed the mask extracted using sched_getaffinity + palError = ERROR_INTERNAL_ERROR; + goto fail; + } +#endif // HAVE_SCHED_GETAFFINITY && HAVE_SCHED_SETAFFINITY + #if !HAVE_MACH_EXCEPTIONS if (!pThread->EnsureSignalAlternateStack()) { @@ -2946,18 +2951,31 @@ BOOL PALAPI PAL_SetCurrentThreadAffinity(WORD procNo) { -#if HAVE_PTHREAD_GETAFFINITY_NP +#if HAVE_SCHED_SETAFFINITY || HAVE_PTHREAD_SETAFFINITY_NP cpu_set_t cpuSet; CPU_ZERO(&cpuSet); - CPU_SET(procNo, &cpuSet); + + // Snap's default strict confinement does not allow sched_setaffinity(, ...) without manually connecting the + // process-control plug. sched_setaffinity(, ...) is also currently not allowed, only + // sched_setaffinity(0, ...). pthread_setaffinity_np(pthread_self(), ...) seems to call + // sched_setaffinity(, ...) in at least one implementation, and does not work. To work around those + // issues, use sched_setaffinity(0, ...) if available and only otherwise fall back to pthread_setaffinity_np(). See the + // following for more information: + // - https://github.com/dotnet/runtime/pull/38795 + // - https://github.com/dotnet/runtime/issues/1634 + // - https://forum.snapcraft.io/t/requesting-autoconnect-for-interfaces-in-pigmeat-process-control-home/17987/13 +#if HAVE_SCHED_SETAFFINITY + int st = sched_setaffinity(0, sizeof(cpu_set_t), &cpuSet); +#else int st = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuSet); +#endif return st == 0; -#else // HAVE_PTHREAD_GETAFFINITY_NP +#else // !(HAVE_SCHED_SETAFFINITY || HAVE_PTHREAD_SETAFFINITY_NP) // There is no API to manage thread affinity, so let's ignore the request return FALSE; -#endif // HAVE_PTHREAD_GETAFFINITY_NP +#endif // HAVE_SCHED_SETAFFINITY || HAVE_PTHREAD_SETAFFINITY_NP } /*++ diff --git a/src/coreclr/src/pal/tests/palsuite/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/CMakeLists.txt index 091da03fba3c..722a32a3fa59 100644 --- a/src/coreclr/src/pal/tests/palsuite/CMakeLists.txt +++ b/src/coreclr/src/pal/tests/palsuite/CMakeLists.txt @@ -25,21 +25,908 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_options(-Wno-int-to-pointer-cast) endif() -# TODO: make these tests compile -# add_subdirectory(composite) -add_subdirectory(exception_handling) - -add_subdirectory(c_runtime) -add_subdirectory(debug_api) -add_subdirectory(filemapping_memmgt) -add_subdirectory(file_io) -add_subdirectory(loader) -add_subdirectory(locale_info) -add_subdirectory(miscellaneous) -add_subdirectory(pal_specific) -add_subdirectory(samples) -add_subdirectory(threading) +#these PAL tests have special build needs, and are built separately +add_subdirectory(exception_handling/pal_sxs/test1) if(FEATURE_EVENT_TRACE) add_subdirectory(eventprovider) endif(FEATURE_EVENT_TRACE) + +_add_executable(paltests + paltests.cpp + common/palsuite.cpp + #composite/object_management/event/nonshared/event.cpp + #composite/object_management/event/nonshared/main.cpp + #composite/object_management/event/shared/event.cpp + #composite/object_management/event/shared/main.cpp + #composite/object_management/mutex/nonshared/main.cpp + #composite/object_management/mutex/nonshared/mutex.cpp + #composite/object_management/mutex/shared/main.cpp + #composite/object_management/mutex/shared/mutex.cpp + #composite/object_management/semaphore/nonshared/main.cpp + #composite/object_management/semaphore/nonshared/semaphore.cpp + #composite/object_management/semaphore/shared/main.cpp + #composite/object_management/semaphore/shared/semaphore.cpp + #composite/synchronization/criticalsection/criticalsection.cpp + #composite/synchronization/criticalsection/mainWrapper.cpp + #composite/synchronization/nativecriticalsection/mtx_critsect.cpp + #composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp + #composite/synchronization/nativecriticalsection/resultbuffer.cpp + #composite/synchronization/nativecs_interlocked/interlocked.cpp + #composite/synchronization/nativecs_interlocked/mtx_critsect.cpp + #composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp + #composite/synchronization/nativecs_interlocked/resultbuffer.cpp + #composite/threading/threadsuspension/mainWrapper.cpp + #composite/threading/threadsuspension/threadsuspension.cpp + #composite/threading/threadsuspension_switchthread/mainWrapper.cpp + #composite/threading/threadsuspension_switchthread/threadsuspension.cpp + #composite/wfmo/main.cpp + #composite/wfmo/mutex.cpp + c_runtime/abs/test1/abs.cpp + c_runtime/acos/test1/test1.cpp + c_runtime/acosf/test1/test1.cpp + c_runtime/acosh/test1/test1.cpp + c_runtime/acoshf/test1/test1.cpp + c_runtime/asin/test1/test1.cpp + c_runtime/asinf/test1/test1.cpp + c_runtime/asinh/test1/test1.cpp + c_runtime/asinhf/test1/test1.cpp + c_runtime/atan/test1/test1.cpp + c_runtime/atan2/test1/test1.cpp + c_runtime/atan2f/test1/test1.cpp + c_runtime/atanf/test1/test1.cpp + c_runtime/atanh/test1/test1.cpp + c_runtime/atanhf/test1/test1.cpp + c_runtime/atof/test1/test1.cpp + c_runtime/atoi/test1/test1.cpp + c_runtime/bsearch/test1/test1.cpp + c_runtime/bsearch/test2/test2.cpp + c_runtime/cbrt/test1/test1.cpp + c_runtime/cbrtf/test1/test1.cpp + c_runtime/ceil/test1/test1.cpp + c_runtime/ceilf/test1/test1.cpp + c_runtime/cos/test1/test1.cpp + c_runtime/cosf/test1/test1.cpp + c_runtime/cosh/test1/test1.cpp + c_runtime/coshf/test1/test1.cpp + c_runtime/errno/test1/test1.cpp + c_runtime/errno/test2/test2.cpp + c_runtime/exit/test1/test1.cpp + c_runtime/exit/test2/test2.cpp + c_runtime/exp/test1/test1.cpp + c_runtime/expf/test1/test1.cpp + c_runtime/fabs/test1/test1.cpp + c_runtime/fabsf/test1/test1.cpp + c_runtime/fclose/test1/test1.cpp + c_runtime/fclose/test2/test2.cpp + c_runtime/ferror/test1/test1.cpp + c_runtime/ferror/test2/test2.cpp + c_runtime/fflush/test1/test1.cpp + c_runtime/fgets/test1/test1.cpp + c_runtime/fgets/test2/test2.cpp + c_runtime/fgets/test3/test3.cpp + c_runtime/floor/test1/test1.cpp + c_runtime/floorf/test1/test1.cpp + c_runtime/fma/test1/test1.cpp + c_runtime/fmaf/test1/test1.cpp + c_runtime/fmod/test1/test1.cpp + c_runtime/fmodf/test1/test1.cpp + c_runtime/fopen/test1/test1.cpp + c_runtime/fopen/test2/test2.cpp + c_runtime/fopen/test3/test3.cpp + c_runtime/fopen/test4/test4.cpp + c_runtime/fopen/test5/test5.cpp + c_runtime/fopen/test6/test6.cpp + c_runtime/fopen/test7/test7.cpp + c_runtime/fprintf/test1/test1.cpp + c_runtime/fprintf/test10/test10.cpp + c_runtime/fprintf/test11/test11.cpp + c_runtime/fprintf/test12/test12.cpp + c_runtime/fprintf/test13/test13.cpp + c_runtime/fprintf/test14/test14.cpp + c_runtime/fprintf/test15/test15.cpp + c_runtime/fprintf/test16/test16.cpp + c_runtime/fprintf/test17/test17.cpp + c_runtime/fprintf/test18/test18.cpp + c_runtime/fprintf/test19/test19.cpp + c_runtime/fprintf/test2/test2.cpp + c_runtime/fprintf/test3/test3.cpp + c_runtime/fprintf/test4/test4.cpp + c_runtime/fprintf/test5/test5.cpp + c_runtime/fprintf/test6/test6.cpp + c_runtime/fprintf/test7/test7.cpp + c_runtime/fprintf/test8/test8.cpp + c_runtime/fprintf/test9/test9.cpp + c_runtime/fputs/test1/test1.cpp + c_runtime/fputs/test2/test2.cpp + c_runtime/fread/test1/test1.cpp + c_runtime/fread/test2/test2.cpp + c_runtime/fread/test3/test3.cpp + c_runtime/free/test1/test1.cpp + c_runtime/fseek/test1/test1.cpp + c_runtime/ftell/test1/ftell.cpp + c_runtime/fwprintf/test1/test1.cpp + c_runtime/fwprintf/test10/test10.cpp + c_runtime/fwprintf/test11/test11.cpp + c_runtime/fwprintf/test12/test12.cpp + c_runtime/fwprintf/test13/test13.cpp + c_runtime/fwprintf/test14/test14.cpp + c_runtime/fwprintf/test15/test15.cpp + c_runtime/fwprintf/test16/test16.cpp + c_runtime/fwprintf/test17/test17.cpp + c_runtime/fwprintf/test18/test18.cpp + c_runtime/fwprintf/test19/test19.cpp + c_runtime/fwprintf/test2/test2.cpp + c_runtime/fwprintf/test3/test3.cpp + c_runtime/fwprintf/test4/test4.cpp + c_runtime/fwprintf/test5/test5.cpp + c_runtime/fwprintf/test6/test6.cpp + c_runtime/fwprintf/test7/test7.cpp + c_runtime/fwprintf/test8/test8.cpp + c_runtime/fwprintf/test9/test9.cpp + c_runtime/fwrite/test1/test1.cpp + c_runtime/getenv/test1/test1.cpp + c_runtime/getenv/test2/test2.cpp + c_runtime/getenv/test3/test3.cpp + c_runtime/ilogb/test1/test1.cpp + c_runtime/ilogbf/test1/test1.cpp + c_runtime/isalnum/test1/test1.cpp + c_runtime/isalpha/test1/test1.cpp + c_runtime/isdigit/test1/test1.cpp + c_runtime/islower/test1/test1.cpp + c_runtime/isprint/test1/isprint.cpp + c_runtime/isprint/test2/test2.cpp + c_runtime/isspace/test1/test1.cpp + c_runtime/isupper/test1/test1.cpp + c_runtime/iswdigit/test1/test1.cpp + #c_runtime/iswprint/test1/test1.cpp + c_runtime/iswspace/test1/test1.cpp + c_runtime/iswupper/test1/test1.cpp + c_runtime/isxdigit/test1/test1.cpp + c_runtime/llabs/test1/test1.cpp + c_runtime/log/test1/test1.cpp + c_runtime/log10/test1/test1.cpp + c_runtime/log10f/test1/test1.cpp + c_runtime/log2/test1/test1.cpp + c_runtime/log2f/test1/test1.cpp + c_runtime/logf/test1/test1.cpp + c_runtime/malloc/test1/test1.cpp + c_runtime/malloc/test2/test2.cpp + c_runtime/memchr/test1/test1.cpp + c_runtime/memcmp/test1/test1.cpp + c_runtime/memcpy/test1/test1.cpp + c_runtime/memmove/test1/test1.cpp + c_runtime/memset/test1/test1.cpp + c_runtime/modf/test1/test1.cpp + c_runtime/modff/test1/test1.cpp + c_runtime/pow/test1/test1.cpp + c_runtime/powf/test1/test1.cpp + c_runtime/printf/test1/test1.cpp + c_runtime/printf/test10/test10.cpp + c_runtime/printf/test11/test11.cpp + c_runtime/printf/test12/test12.cpp + c_runtime/printf/test13/test13.cpp + c_runtime/printf/test14/test14.cpp + c_runtime/printf/test15/test15.cpp + c_runtime/printf/test16/test16.cpp + c_runtime/printf/test17/test17.cpp + c_runtime/printf/test18/test18.cpp + c_runtime/printf/test19/test19.cpp + c_runtime/printf/test2/test2.cpp + c_runtime/printf/test3/test3.cpp + c_runtime/printf/test4/test4.cpp + c_runtime/printf/test5/test5.cpp + c_runtime/printf/test6/test6.cpp + c_runtime/printf/test7/test7.cpp + c_runtime/printf/test8/test8.cpp + c_runtime/printf/test9/test9.cpp + c_runtime/qsort/test1/test1.cpp + c_runtime/qsort/test2/test2.cpp + c_runtime/rand_srand/test1/test1.cpp + c_runtime/realloc/test1/test1.cpp + c_runtime/scalbn/test1/test1.cpp + c_runtime/scalbnf/test1/test1.cpp + c_runtime/sin/test1/test1.cpp + c_runtime/sinf/test1/test1.cpp + c_runtime/sinh/test1/test1.cpp + c_runtime/sinhf/test1/test1.cpp + c_runtime/sprintf_s/test1/test1.cpp + c_runtime/sprintf_s/test10/test10.cpp + c_runtime/sprintf_s/test11/test11.cpp + c_runtime/sprintf_s/test12/test12.cpp + c_runtime/sprintf_s/test13/test13.cpp + c_runtime/sprintf_s/test14/test14.cpp + c_runtime/sprintf_s/test15/test15.cpp + c_runtime/sprintf_s/test16/test16.cpp + c_runtime/sprintf_s/test17/test17.cpp + c_runtime/sprintf_s/test18/test18.cpp + c_runtime/sprintf_s/test19/test19.cpp + c_runtime/sprintf_s/test2/test2.cpp + c_runtime/sprintf_s/test3/test3.cpp + c_runtime/sprintf_s/test4/test4.cpp + c_runtime/sprintf_s/test6/test6.cpp + c_runtime/sprintf_s/test7/test7.cpp + c_runtime/sprintf_s/test8/test8.cpp + c_runtime/sprintf_s/test9/test9.cpp + c_runtime/sqrt/test1/test1.cpp + c_runtime/sqrtf/test1/test1.cpp + c_runtime/sscanf_s/test1/test1.cpp + c_runtime/sscanf_s/test10/test10.cpp + c_runtime/sscanf_s/test11/test11.cpp + c_runtime/sscanf_s/test12/test12.cpp + c_runtime/sscanf_s/test13/test13.cpp + c_runtime/sscanf_s/test14/test14.cpp + c_runtime/sscanf_s/test15/test15.cpp + c_runtime/sscanf_s/test16/test16.cpp + c_runtime/sscanf_s/test17/test17.cpp + c_runtime/sscanf_s/test2/test2.cpp + c_runtime/sscanf_s/test3/test3.cpp + c_runtime/sscanf_s/test4/test4.cpp + c_runtime/sscanf_s/test5/test5.cpp + c_runtime/sscanf_s/test6/test6.cpp + c_runtime/sscanf_s/test7/test7.cpp + c_runtime/sscanf_s/test8/test8.cpp + c_runtime/sscanf_s/test9/test9.cpp + c_runtime/strcat/test1/test1.cpp + c_runtime/strchr/test1/test1.cpp + c_runtime/strcmp/test1/test1.cpp + c_runtime/strcpy/test1/test1.cpp + c_runtime/strcspn/test1/test1.cpp + c_runtime/strlen/test1/test1.cpp + c_runtime/strncat/test1/test1.cpp + c_runtime/strncmp/test1/test1.cpp + c_runtime/strncpy/test1/test1.cpp + c_runtime/strpbrk/test1/test1.cpp + c_runtime/strrchr/test1/test1.cpp + c_runtime/strspn/test1/test1.cpp + c_runtime/strstr/test1/test1.cpp + c_runtime/strtod/test1/test1.cpp + c_runtime/strtod/test2/test2.cpp + c_runtime/strtok/test1/test1.cpp + c_runtime/strtoul/test1/test1.cpp + c_runtime/swprintf/test1/test1.cpp + c_runtime/swprintf/test10/test10.cpp + c_runtime/swprintf/test11/test11.cpp + c_runtime/swprintf/test12/test12.cpp + c_runtime/swprintf/test13/test13.cpp + c_runtime/swprintf/test14/test14.cpp + c_runtime/swprintf/test15/test15.cpp + c_runtime/swprintf/test16/test16.cpp + c_runtime/swprintf/test17/test17.cpp + c_runtime/swprintf/test18/test18.cpp + c_runtime/swprintf/test19/test19.cpp + c_runtime/swprintf/test2/test2.cpp + c_runtime/swprintf/test3/test3.cpp + c_runtime/swprintf/test4/test4.cpp + c_runtime/swprintf/test6/test6.cpp + c_runtime/swprintf/test7/test7.cpp + c_runtime/swprintf/test8/test8.cpp + c_runtime/swprintf/test9/test9.cpp + c_runtime/swscanf/test1/test1.cpp + c_runtime/swscanf/test10/test10.cpp + c_runtime/swscanf/test11/test11.cpp + c_runtime/swscanf/test12/test12.cpp + c_runtime/swscanf/test13/test13.cpp + c_runtime/swscanf/test14/test14.cpp + c_runtime/swscanf/test15/test15.cpp + c_runtime/swscanf/test16/test16.cpp + c_runtime/swscanf/test17/test17.cpp + c_runtime/swscanf/test2/test2.cpp + c_runtime/swscanf/test3/test3.cpp + c_runtime/swscanf/test4/test4.cpp + c_runtime/swscanf/test5/test5.cpp + c_runtime/swscanf/test6/test6.cpp + c_runtime/swscanf/test7/test7.cpp + c_runtime/swscanf/test8/test8.cpp + c_runtime/swscanf/test9/test9.cpp + c_runtime/tan/test1/test1.cpp + c_runtime/tanf/test1/test1.cpp + c_runtime/tanh/test1/test1.cpp + c_runtime/tanhf/test1/test1.cpp + c_runtime/time/test1/test1.cpp + c_runtime/tolower/test1/test1.cpp + c_runtime/toupper/test1/test1.cpp + c_runtime/towlower/test1/test1.cpp + c_runtime/towupper/test1/test1.cpp + c_runtime/vfprintf/test1/test1.cpp + c_runtime/vfprintf/test10/test10.cpp + c_runtime/vfprintf/test11/test11.cpp + c_runtime/vfprintf/test12/test12.cpp + c_runtime/vfprintf/test13/test13.cpp + c_runtime/vfprintf/test14/test14.cpp + c_runtime/vfprintf/test15/test15.cpp + c_runtime/vfprintf/test16/test16.cpp + c_runtime/vfprintf/test17/test17.cpp + c_runtime/vfprintf/test18/test18.cpp + c_runtime/vfprintf/test19/test19.cpp + c_runtime/vfprintf/test2/test2.cpp + c_runtime/vfprintf/test3/test3.cpp + c_runtime/vfprintf/test4/test4.cpp + c_runtime/vfprintf/test5/test5.cpp + c_runtime/vfprintf/test6/test6.cpp + c_runtime/vfprintf/test7/test7.cpp + c_runtime/vfprintf/test8/test8.cpp + c_runtime/vfprintf/test9/test9.cpp + #c_runtime/vprintf/test1/test1.cpp + c_runtime/vprintf/test10/test10.cpp + c_runtime/vprintf/test11/test11.cpp + c_runtime/vprintf/test12/test12.cpp + c_runtime/vprintf/test13/test13.cpp + c_runtime/vprintf/test14/test14.cpp + c_runtime/vprintf/test15/test15.cpp + c_runtime/vprintf/test16/test16.cpp + c_runtime/vprintf/test17/test17.cpp + c_runtime/vprintf/test18/test18.cpp + c_runtime/vprintf/test19/test19.cpp + c_runtime/vprintf/test2/test2.cpp + c_runtime/vprintf/test3/test3.cpp + c_runtime/vprintf/test4/test4.cpp + c_runtime/vprintf/test5/test5.cpp + c_runtime/vprintf/test6/test6.cpp + c_runtime/vprintf/test7/test7.cpp + c_runtime/vprintf/test8/test8.cpp + c_runtime/vprintf/test9/test9.cpp + c_runtime/vsprintf/test1/test1.cpp + c_runtime/vsprintf/test10/test10.cpp + c_runtime/vsprintf/test11/test11.cpp + c_runtime/vsprintf/test12/test12.cpp + c_runtime/vsprintf/test13/test13.cpp + c_runtime/vsprintf/test14/test14.cpp + c_runtime/vsprintf/test15/test15.cpp + c_runtime/vsprintf/test16/test16.cpp + c_runtime/vsprintf/test17/test17.cpp + c_runtime/vsprintf/test18/test18.cpp + c_runtime/vsprintf/test19/test19.cpp + c_runtime/vsprintf/test2/test2.cpp + c_runtime/vsprintf/test3/test3.cpp + c_runtime/vsprintf/test4/test4.cpp + c_runtime/vsprintf/test6/test6.cpp + c_runtime/vsprintf/test7/test7.cpp + c_runtime/vsprintf/test8/test8.cpp + c_runtime/vsprintf/test9/test9.cpp + c_runtime/vswprintf/test1/test1.cpp + c_runtime/vswprintf/test10/test10.cpp + c_runtime/vswprintf/test11/test11.cpp + c_runtime/vswprintf/test12/test12.cpp + c_runtime/vswprintf/test13/test13.cpp + c_runtime/vswprintf/test14/test14.cpp + c_runtime/vswprintf/test15/test15.cpp + c_runtime/vswprintf/test16/test16.cpp + c_runtime/vswprintf/test17/test17.cpp + c_runtime/vswprintf/test18/test18.cpp + c_runtime/vswprintf/test19/test19.cpp + c_runtime/vswprintf/test2/test2.cpp + c_runtime/vswprintf/test3/test3.cpp + c_runtime/vswprintf/test4/test4.cpp + c_runtime/vswprintf/test6/test6.cpp + c_runtime/vswprintf/test7/test7.cpp + c_runtime/vswprintf/test8/test8.cpp + c_runtime/vswprintf/test9/test9.cpp + c_runtime/wcscat/test1/test1.cpp + c_runtime/wcschr/test1/test1.cpp + c_runtime/wcscmp/test1/test1.cpp + c_runtime/wcscpy/test1/test1.cpp + c_runtime/wcslen/test1/test1.cpp + c_runtime/wcsncmp/test1/test1.cpp + c_runtime/wcsncpy/test1/test1.cpp + c_runtime/wcspbrk/test1/test1.cpp + c_runtime/wcsrchr/test1/test1.cpp + c_runtime/wcsstr/test1/test1.cpp + c_runtime/wcstod/test1/test1.cpp + c_runtime/wcstod/test2/test2.cpp + c_runtime/wcstok/test1/test1.cpp + c_runtime/wcstoul/test1/test1.cpp + c_runtime/wcstoul/test2/test2.cpp + c_runtime/wcstoul/test3/test3.cpp + c_runtime/wcstoul/test4/test4.cpp + c_runtime/wcstoul/test5/test5.cpp + c_runtime/wcstoul/test6/test6.cpp + c_runtime/wprintf/test1/test1.cpp + c_runtime/wprintf/test2/test2.cpp + c_runtime/_alloca/test1/test1.cpp + c_runtime/_fdopen/test1/test1.cpp + c_runtime/_finite/test1/test1.cpp + c_runtime/_finitef/test1/test1.cpp + #c_runtime/_gcvt/test1/_gcvt.cpp + #c_runtime/_gcvt/test2/test2.cpp + c_runtime/_isnan/test1/test1.cpp + c_runtime/_isnanf/test1/test1.cpp + c_runtime/_itow/test1/test1.cpp + c_runtime/_putenv/test1/test1.cpp + c_runtime/_putenv/test2/test2.cpp + c_runtime/_putenv/test3/test3.cpp + c_runtime/_putenv/test4/test4.cpp + c_runtime/_rotl/test1/test1.cpp + c_runtime/_rotr/test1/test1.cpp + c_runtime/_snprintf_s/test1/test1.cpp + c_runtime/_snprintf_s/test10/test10.cpp + c_runtime/_snprintf_s/test11/test11.cpp + c_runtime/_snprintf_s/test12/test12.cpp + c_runtime/_snprintf_s/test13/test13.cpp + c_runtime/_snprintf_s/test14/test14.cpp + c_runtime/_snprintf_s/test15/test15.cpp + c_runtime/_snprintf_s/test16/test16.cpp + c_runtime/_snprintf_s/test17/test17.cpp + c_runtime/_snprintf_s/test18/test18.cpp + c_runtime/_snprintf_s/test19/test19.cpp + c_runtime/_snprintf_s/test2/test2.cpp + c_runtime/_snprintf_s/test3/test3.cpp + c_runtime/_snprintf_s/test4/test4.cpp + c_runtime/_snprintf_s/test6/test6.cpp + c_runtime/_snprintf_s/test7/test7.cpp + c_runtime/_snprintf_s/test8/test8.cpp + c_runtime/_snprintf_s/test9/test9.cpp + c_runtime/_snwprintf_s/test1/test1.cpp + c_runtime/_snwprintf_s/test10/test10.cpp + c_runtime/_snwprintf_s/test11/test11.cpp + c_runtime/_snwprintf_s/test12/test12.cpp + c_runtime/_snwprintf_s/test13/test13.cpp + c_runtime/_snwprintf_s/test14/test14.cpp + c_runtime/_snwprintf_s/test15/test15.cpp + c_runtime/_snwprintf_s/test16/test16.cpp + c_runtime/_snwprintf_s/test17/test17.cpp + c_runtime/_snwprintf_s/test18/test18.cpp + c_runtime/_snwprintf_s/test19/test19.cpp + c_runtime/_snwprintf_s/test2/test2.cpp + c_runtime/_snwprintf_s/test3/test3.cpp + c_runtime/_snwprintf_s/test4/test4.cpp + c_runtime/_snwprintf_s/test6/test6.cpp + c_runtime/_snwprintf_s/test7/test7.cpp + c_runtime/_snwprintf_s/test8/test8.cpp + c_runtime/_snwprintf_s/test9/test9.cpp + c_runtime/_stricmp/test1/test1.cpp + c_runtime/_strnicmp/test1/test1.cpp + c_runtime/_vsnprintf_s/test1/test1.cpp + c_runtime/_vsnprintf_s/test10/test10.cpp + c_runtime/_vsnprintf_s/test11/test11.cpp + c_runtime/_vsnprintf_s/test12/test12.cpp + c_runtime/_vsnprintf_s/test13/test13.cpp + c_runtime/_vsnprintf_s/test14/test14.cpp + c_runtime/_vsnprintf_s/test15/test15.cpp + c_runtime/_vsnprintf_s/test16/test16.cpp + c_runtime/_vsnprintf_s/test17/test17.cpp + c_runtime/_vsnprintf_s/test18/test18.cpp + c_runtime/_vsnprintf_s/test19/test19.cpp + c_runtime/_vsnprintf_s/test2/test2.cpp + c_runtime/_vsnprintf_s/test3/test3.cpp + c_runtime/_vsnprintf_s/test4/test4.cpp + c_runtime/_vsnprintf_s/test6/test6.cpp + c_runtime/_vsnprintf_s/test7/test7.cpp + c_runtime/_vsnprintf_s/test8/test8.cpp + c_runtime/_vsnprintf_s/test9/test9.cpp + c_runtime/_vsnwprintf_s/test1/test1.cpp + c_runtime/_vsnwprintf_s/test10/test10.cpp + c_runtime/_vsnwprintf_s/test11/test11.cpp + c_runtime/_vsnwprintf_s/test12/test12.cpp + c_runtime/_vsnwprintf_s/test13/test13.cpp + c_runtime/_vsnwprintf_s/test14/test14.cpp + c_runtime/_vsnwprintf_s/test15/test15.cpp + c_runtime/_vsnwprintf_s/test16/test16.cpp + c_runtime/_vsnwprintf_s/test17/test17.cpp + c_runtime/_vsnwprintf_s/test18/test18.cpp + c_runtime/_vsnwprintf_s/test19/test19.cpp + c_runtime/_vsnwprintf_s/test2/test2.cpp + c_runtime/_vsnwprintf_s/test3/test3.cpp + c_runtime/_vsnwprintf_s/test4/test4.cpp + c_runtime/_vsnwprintf_s/test6/test6.cpp + c_runtime/_vsnwprintf_s/test7/test7.cpp + c_runtime/_vsnwprintf_s/test8/test8.cpp + c_runtime/_vsnwprintf_s/test9/test9.cpp + c_runtime/_wcsicmp/test1/test1.cpp + c_runtime/_wcslwr_s/test1/test1.cpp + c_runtime/_wcsnicmp/test1/test1.cpp + c_runtime/_wfopen/test1/test1.cpp + c_runtime/_wfopen/test2/test2.cpp + c_runtime/_wfopen/test3/test3.cpp + c_runtime/_wfopen/test4/test4.cpp + c_runtime/_wfopen/test5/test5.cpp + c_runtime/_wfopen/test6/test6.cpp + c_runtime/_wfopen/test7/test7.cpp + c_runtime/_wtoi/test1/test1.cpp + c_runtime/__iscsym/test1/__iscsym.cpp + #debug_api/DebugBreak/test1/test1.cpp + debug_api/OutputDebugStringA/test1/helper.cpp + debug_api/OutputDebugStringA/test1/test1.cpp + debug_api/OutputDebugStringW/test1/test1.cpp + #debug_api/WriteProcessMemory/test1/helper.cpp + #debug_api/WriteProcessMemory/test1/test1.cpp + #debug_api/WriteProcessMemory/test3/helper.cpp + #debug_api/WriteProcessMemory/test3/test3.cpp + #debug_api/WriteProcessMemory/test4/helper.cpp + #debug_api/WriteProcessMemory/test4/test4.cpp + #exception_handling/pal_except/test1/test1.cpp + #exception_handling/pal_except/test2/test2.cpp + #exception_handling/pal_except/test3/test3.cpp + #exception_handling/pal_except/test4/test4.cpp + #exception_handling/pal_except/test5/test5.cpp + #exception_handling/pal_except/test6/test6.cpp + #exception_handling/pal_except/test7/test7.cpp + #exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.cpp + #exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.cpp + #exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.cpp + #exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.cpp + #exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.cpp + #exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.cpp + #exception_handling/pal_finally/test1/pal_finally.cpp + #exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.cpp + #exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.cpp + #exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.cpp + #exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.cpp + #exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.cpp + #exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.cpp + exception_handling/RaiseException/test1/test1.cpp + exception_handling/RaiseException/test2/test2.cpp + exception_handling/RaiseException/test3/test.cpp + filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.cpp + filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.cpp + #filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp + filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.cpp + filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.cpp + filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.cpp + filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.cpp + filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.cpp + filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.cpp + filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.cpp +# filemapping_memmgt/FreeLibrary/test1/dlltest.cpp + filemapping_memmgt/FreeLibrary/test1/FreeLibrary.cpp + filemapping_memmgt/FreeLibrary/test2/test2.cpp +# filemapping_memmgt/FreeLibraryAndExitThread/test1/dlltest.cpp + filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp + filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.cpp + filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.cpp + filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp + filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp + filemapping_memmgt/GetProcAddress/test1/test1.cpp +# filemapping_memmgt/GetProcAddress/test1/testlib.cpp + filemapping_memmgt/GetProcAddress/test2/test2.cpp +# filemapping_memmgt/GetProcAddress/test2/testlib.cpp + filemapping_memmgt/LocalAlloc/test1/LocalAlloc.cpp + filemapping_memmgt/LocalFree/test1/LocalFree.cpp + filemapping_memmgt/LocalFree/test2/LocalFree.cpp + filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp + filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.cpp + filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.cpp + filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.cpp + filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.cpp + filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.cpp + filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.cpp + filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.cpp + filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.cpp + filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp + filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp + filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.cpp + filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.cpp + filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test20/virtualalloc.cpp + filemapping_memmgt/VirtualAlloc/test21/virtualalloc.cpp + filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.cpp + filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.cpp + filemapping_memmgt/VirtualFree/test1/VirtualFree.cpp + filemapping_memmgt/VirtualFree/test2/VirtualFree.cpp + filemapping_memmgt/VirtualFree/test3/VirtualFree.cpp + filemapping_memmgt/VirtualProtect/test1/VirtualProtect.cpp + filemapping_memmgt/VirtualProtect/test2/VirtualProtect.cpp + filemapping_memmgt/VirtualProtect/test3/VirtualProtect.cpp + filemapping_memmgt/VirtualProtect/test4/VirtualProtect.cpp + filemapping_memmgt/VirtualProtect/test6/VirtualProtect.cpp + filemapping_memmgt/VirtualProtect/test7/VirtualProtect.cpp + filemapping_memmgt/VirtualQuery/test1/VirtualQuery.cpp + file_io/CopyFileA/test1/CopyFileA.cpp + file_io/CopyFileA/test2/test2.cpp + file_io/CopyFileA/test3/test3.cpp + file_io/CopyFileA/test4/test4.cpp + file_io/CopyFileW/test1/CopyFileW.cpp + file_io/CopyFileW/test2/test2.cpp + file_io/CopyFileW/test3/test3.cpp + file_io/CreateFileA/test1/CreateFileA.cpp + file_io/CreateFileW/test1/CreateFileW.cpp + file_io/DeleteFileA/test1/DeleteFileA.cpp + file_io/DeleteFileW/test1/DeleteFileW.cpp + file_io/errorpathnotfound/test1/test1.cpp + file_io/errorpathnotfound/test2/test2.cpp + file_io/FILECanonicalizePath/FILECanonicalizePath.cpp + file_io/FindClose/test1/FindClose.cpp + file_io/FindFirstFileA/test1/FindFirstFileA.cpp + file_io/FindFirstFileW/test1/FindFirstFileW.cpp + file_io/FindNextFileA/test1/FindNextFileA.cpp + file_io/FindNextFileA/test2/findnextfilea.cpp + file_io/FindNextFileW/test1/FindNextFileW.cpp + file_io/FindNextFileW/test2/findnextfilew.cpp + file_io/FlushFileBuffers/test1/FlushFileBuffers.cpp + file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.cpp + file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.cpp + file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.cpp + file_io/GetFileAttributesA/test1/GetFileAttributesA.cpp + file_io/GetFileAttributesExW/test1/test1.cpp + file_io/GetFileAttributesExW/test2/test2.cpp + file_io/GetFileAttributesW/test1/GetFileAttributesW.cpp + file_io/GetFileSize/test1/GetFileSize.cpp + file_io/GetFileSizeEx/test1/GetFileSizeEx.cpp + file_io/GetFullPathNameA/test1/GetFullPathNameA.cpp + file_io/GetFullPathNameA/test2/test2.cpp + file_io/GetFullPathNameA/test3/test3.cpp + file_io/GetFullPathNameA/test4/test4.cpp + file_io/GetFullPathNameW/test1/GetFullPathNameW.cpp + file_io/GetFullPathNameW/test2/test2.cpp + file_io/GetFullPathNameW/test3/test3.cpp + file_io/GetFullPathNameW/test4/test4.cpp + file_io/GetStdHandle/test1/GetStdHandle.cpp + file_io/GetStdHandle/test2/GetStdHandle.cpp + file_io/GetSystemTime/test1/test.cpp + file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp + file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp + file_io/GetTempFileNameA/test2/GetTempFileNameA.cpp + file_io/GetTempFileNameA/test3/gettempfilenamea.cpp + file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp + file_io/GetTempFileNameW/test2/GetTempFileNameW.cpp + file_io/GetTempFileNameW/test3/gettempfilenamew.cpp + file_io/gettemppatha/test1/gettemppatha.cpp + file_io/GetTempPathW/test1/GetTempPathW.cpp + file_io/MoveFileExA/test1/MoveFileExA.cpp + file_io/MoveFileExW/test1/MoveFileExW.cpp + file_io/ReadFile/test1/ReadFile.cpp + file_io/ReadFile/test2/ReadFile.cpp + file_io/ReadFile/test3/ReadFile.cpp + file_io/ReadFile/test4/readfile.cpp + file_io/SearchPathW/test1/SearchPathW.cpp + file_io/SetEndOfFile/test1/SetEndOfFile.cpp + file_io/SetEndOfFile/test2/SetEndOfFile.cpp + file_io/SetEndOfFile/test3/SetEndOfFile.cpp + file_io/SetEndOfFile/test4/setendoffile.cpp + file_io/SetEndOfFile/test5/test5.cpp + file_io/SetFilePointer/test1/SetFilePointer.cpp + file_io/SetFilePointer/test2/SetFilePointer.cpp + file_io/SetFilePointer/test3/SetFilePointer.cpp + file_io/SetFilePointer/test4/SetFilePointer.cpp + file_io/SetFilePointer/test5/SetFilePointer.cpp + file_io/SetFilePointer/test6/SetFilePointer.cpp + file_io/SetFilePointer/test7/SetFilePointer.cpp + file_io/WriteFile/test1/WriteFile.cpp + file_io/WriteFile/test2/WriteFile.cpp + file_io/WriteFile/test3/WriteFile.cpp + file_io/WriteFile/test4/writefile.cpp + file_io/WriteFile/test5/writefile.cpp + loader/LoadLibraryA/test1/LoadLibraryA.cpp + loader/LoadLibraryA/test2/LoadLibraryA.cpp + loader/LoadLibraryA/test3/loadlibrarya.cpp + loader/LoadLibraryA/test5/loadlibrarya.cpp + #loader/LoadLibraryA/test6/dlltest.cpp + #loader/LoadLibraryA/test6/loadlibrarya.cpp + loader/LoadLibraryA/test7/LoadLibraryA.cpp + #loader/LoadLibraryA/test8/dlltest.cpp + #loader/LoadLibraryA/test8/loadlibrarya.cpp + loader/LoadLibraryW/test1/LoadLibraryW.cpp + loader/LoadLibraryW/test2/loadlibraryw.cpp + loader/LoadLibraryW/test3/loadlibraryw.cpp + loader/LoadLibraryW/test5/loadlibraryw.cpp + #locale_info/CompareStringA/test1/test1.cpp + #locale_info/CompareStringW/test1/test1.cpp + locale_info/GetACP/test1/test1.cpp + #locale_info/GetLocaleInfoW/test1/test1.cpp + #locale_info/GetLocaleInfoW/test2/test2.cpp + locale_info/MultiByteToWideChar/test1/test1.cpp + locale_info/MultiByteToWideChar/test2/test2.cpp + locale_info/MultiByteToWideChar/test3/test3.cpp + locale_info/MultiByteToWideChar/test4/test4.cpp + locale_info/WideCharToMultiByte/test1/test1.cpp + locale_info/WideCharToMultiByte/test2/test2.cpp + locale_info/WideCharToMultiByte/test3/test3.cpp + locale_info/WideCharToMultiByte/test4/test4.cpp + locale_info/WideCharToMultiByte/test5/test5.cpp + miscellaneous/CGroup/test1/test.cpp + miscellaneous/CloseHandle/test1/test.cpp + miscellaneous/CloseHandle/test2/test.cpp + miscellaneous/CreatePipe/test1/test1.cpp + miscellaneous/FlushInstructionCache/test1/test1.cpp + miscellaneous/FormatMessageW/test1/test.cpp + miscellaneous/FormatMessageW/test2/test.cpp + miscellaneous/FormatMessageW/test3/test.cpp + miscellaneous/FormatMessageW/test4/test.cpp + miscellaneous/FormatMessageW/test5/test.cpp + miscellaneous/FormatMessageW/test6/test.cpp + miscellaneous/FreeEnvironmentStringsW/test1/test.cpp + miscellaneous/FreeEnvironmentStringsW/test2/test.cpp + miscellaneous/GetCommandLineW/test1/test.cpp + miscellaneous/GetEnvironmentStringsW/test1/test.cpp + miscellaneous/GetEnvironmentVariableA/test1/test.cpp + miscellaneous/GetEnvironmentVariableA/test2/test.cpp + miscellaneous/GetEnvironmentVariableA/test3/test.cpp + miscellaneous/GetEnvironmentVariableA/test4/test.cpp + miscellaneous/GetEnvironmentVariableA/test5/test5.cpp + miscellaneous/GetEnvironmentVariableA/test6/test6.cpp + miscellaneous/GetEnvironmentVariableW/test1/test.cpp + miscellaneous/GetEnvironmentVariableW/test2/test.cpp + miscellaneous/GetEnvironmentVariableW/test3/test.cpp + miscellaneous/GetEnvironmentVariableW/test4/test.cpp + miscellaneous/GetEnvironmentVariableW/test5/test5.cpp + miscellaneous/GetEnvironmentVariableW/test6/test6.cpp + miscellaneous/GetLastError/test1/test.cpp + miscellaneous/GetSystemInfo/test1/test.cpp + miscellaneous/GetTickCount/test1/test.cpp + miscellaneous/GlobalMemoryStatusEx/test1/test.cpp + miscellaneous/InterlockedBit/test1/test.cpp + miscellaneous/InterlockedBit/test2/test.cpp + miscellaneous/InterlockedCompareExchange/test1/test.cpp + miscellaneous/InterlockedCompareExchange/test2/test.cpp + miscellaneous/InterlockedCompareExchange64/test1/test.cpp + miscellaneous/InterlockedCompareExchange64/test2/test.cpp + miscellaneous/InterlockedCompareExchangePointer/test1/test.cpp + miscellaneous/InterlockedDecrement/test1/test.cpp + miscellaneous/InterlockedDecrement/test2/test.cpp + miscellaneous/InterlockedDecrement64/test1/test.cpp + miscellaneous/InterlockedDecrement64/test2/test.cpp + miscellaneous/InterlockedExchange/test1/test.cpp + miscellaneous/InterlockedExchange64/test1/test.cpp + miscellaneous/InterLockedExchangeAdd/test1/test.cpp + miscellaneous/InterlockedExchangePointer/test1/InterlockedExchangePointer.cpp + miscellaneous/InterlockedIncrement/test1/test.cpp + miscellaneous/InterlockedIncrement/test2/test.cpp + miscellaneous/InterlockedIncrement64/test1/test.cpp + miscellaneous/InterlockedIncrement64/test2/test.cpp + #miscellaneous/IsBadCodePtr/test1/test1.cpp + #miscellaneous/IsBadReadPtr/test1/test.cpp + #miscellaneous/IsBadWritePtr/test1/test.cpp + #miscellaneous/IsBadWritePtr/test2/test2.cpp + #miscellaneous/IsBadWritePtr/test3/test3.cpp + #miscellaneous/MessageBoxW/test1/test.cpp + #miscellaneous/MessageBoxW/test2/test.cpp + miscellaneous/queryperformancecounter/test1/test1.cpp + miscellaneous/queryperformancefrequency/test1/test1.cpp + miscellaneous/SetEnvironmentVariableA/test1/test1.cpp + miscellaneous/SetEnvironmentVariableA/test2/test2.cpp + miscellaneous/SetEnvironmentVariableA/test3/test3.cpp + miscellaneous/SetEnvironmentVariableA/test4/test4.cpp + miscellaneous/SetEnvironmentVariableW/test1/test.cpp + miscellaneous/SetEnvironmentVariableW/test2/test.cpp + miscellaneous/SetEnvironmentVariableW/test3/test3.cpp + miscellaneous/SetEnvironmentVariableW/test4/test4.cpp + miscellaneous/SetLastError/test1/test.cpp + miscellaneous/_i64tow/test1/test1.cpp + pal_specific/PAL_errno/test1/PAL_errno.cpp + pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp +# pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp + #pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp + #pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp + #pal_specific/PAL_get_stdout/test1/PAL_get_stdout.cpp + pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.cpp + pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.cpp +# pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp +# pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp + samples/test1/test.cpp + samples/test2/test.cpp + threading/CreateEventW/test1/test1.cpp + threading/CreateEventW/test2/test2.cpp + threading/CreateEventW/test3/test3.cpp + threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.cpp + threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.cpp + threading/CreateProcessW/test1/childProcess.cpp + threading/CreateProcessW/test1/parentProcess.cpp + threading/CreateProcessW/test2/childprocess.cpp + threading/CreateProcessW/test2/parentprocess.cpp + threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.cpp + threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.cpp + threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.cpp + threading/CreateThread/test1/test1.cpp + threading/CreateThread/test2/test2.cpp + threading/CreateThread/test3/test3.cpp + threading/CriticalSectionFunctions/test1/InitializeCriticalSection.cpp + threading/CriticalSectionFunctions/test2/test2.cpp + threading/CriticalSectionFunctions/test3/test3.cpp + threading/CriticalSectionFunctions/test4/test4.cpp + threading/CriticalSectionFunctions/test5/test5.cpp + threading/CriticalSectionFunctions/test6/test6.cpp + threading/CriticalSectionFunctions/test7/test7.cpp + threading/CriticalSectionFunctions/test8/test8.cpp + threading/DuplicateHandle/test1/test1.cpp + threading/DuplicateHandle/test10/test10.cpp + threading/DuplicateHandle/test11/childprocess.cpp + threading/DuplicateHandle/test11/test11.cpp + threading/DuplicateHandle/test12/test12.cpp + threading/DuplicateHandle/test2/test2.cpp + threading/DuplicateHandle/test3/test3.cpp + threading/DuplicateHandle/test4/test4.cpp + threading/DuplicateHandle/test5/test5.cpp + threading/DuplicateHandle/test6/test6.cpp + threading/DuplicateHandle/test7/test7.cpp + threading/DuplicateHandle/test8/test8.cpp +# threading/DuplicateHandle/test9/test9.cpp + threading/ExitProcess/test1/ExitProcess.cpp + threading/ExitProcess/test2/test2.cpp + threading/ExitProcess/test3/test3.cpp + threading/ExitThread/test1/test1.cpp + threading/ExitThread/test2/childprocess.cpp + threading/ExitThread/test2/test2.cpp + threading/GetCurrentProcess/test1/process.cpp + threading/GetCurrentProcessId/test1/processId.cpp + threading/GetCurrentThread/test1/thread.cpp + threading/GetCurrentThread/test2/test2.cpp + threading/GetCurrentThreadId/test1/threadId.cpp + threading/GetExitCodeProcess/test1/childProcess.cpp + threading/GetExitCodeProcess/test1/test1.cpp + threading/GetProcessTimes/test2/test2.cpp + threading/GetThreadTimes/test1/test1.cpp + threading/NamedMutex/test1/namedmutex.cpp + threading/NamedMutex/test1/nopal.cpp + threading/OpenEventW/test1/test1.cpp + threading/OpenEventW/test2/test2.cpp + threading/OpenEventW/test3/childprocess.cpp + threading/OpenEventW/test3/test3.cpp + threading/OpenEventW/test4/test4.cpp + threading/OpenEventW/test5/test5.cpp + threading/OpenProcess/test1/childProcess.cpp + threading/OpenProcess/test1/test1.cpp + threading/QueryThreadCycleTime/test1/test1.cpp + threading/QueueUserAPC/test1/test1.cpp + threading/QueueUserAPC/test2/test2.cpp + threading/QueueUserAPC/test3/test3.cpp + threading/QueueUserAPC/test4/test4.cpp + threading/QueueUserAPC/test5/test5.cpp + threading/QueueUserAPC/test6/test6.cpp + threading/QueueUserAPC/test7/test7.cpp + threading/ReleaseMutex/test3/ReleaseMutex.cpp + threading/releasesemaphore/test1/test.cpp + threading/ResetEvent/test1/test1.cpp + threading/ResetEvent/test2/test2.cpp + threading/ResetEvent/test3/test3.cpp + threading/ResetEvent/test4/test4.cpp + threading/ResumeThread/test1/test1.cpp + threading/SetErrorMode/test1/test1.cpp + threading/SetEvent/test1/test1.cpp + threading/SetEvent/test2/test2.cpp + threading/SetEvent/test3/test3.cpp + threading/SetEvent/test4/test4.cpp + threading/SignalObjectAndWait/SignalObjectAndWaitTest.cpp + threading/Sleep/test1/Sleep.cpp + threading/Sleep/test2/sleep.cpp + threading/SleepEx/test1/test1.cpp + threading/SleepEx/test2/test2.cpp + threading/SwitchToThread/test1/test1.cpp + threading/TerminateProcess/test1/TerminateProcess.cpp + threading/ThreadPriority/test1/ThreadPriority.cpp + threading/WaitForMultipleObjects/test1/test1.cpp + threading/WaitForMultipleObjectsEx/test1/test1.cpp + threading/WaitForMultipleObjectsEx/test2/test2.cpp + threading/WaitForMultipleObjectsEx/test3/test3.cpp + threading/WaitForMultipleObjectsEx/test4/test4.cpp + threading/WaitForMultipleObjectsEx/test5/helper.cpp + threading/WaitForMultipleObjectsEx/test5/test5.cpp + threading/WaitForMultipleObjectsEx/test6/child6.cpp + threading/WaitForMultipleObjectsEx/test6/test6.cpp + threading/WaitForSingleObject/test1/test1.cpp + threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp + threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp + threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp + threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp + threading/WaitForSingleObject/WFSOProcessTest/ChildProcess.cpp + threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.cpp + threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp + threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.cpp + threading/YieldProcessor/test1/test1.cpp + +) + +add_dependencies(paltests coreclrpal) + +target_link_libraries(paltests + ${COMMON_TEST_LIBRARIES} +) + +_install (TARGETS paltests DESTINATION paltests) +_install (PROGRAMS runpaltests.sh runpaltestshelix.sh DESTINATION paltests) diff --git a/src/coreclr/src/pal/tests/palsuite/DisabledTests.txt b/src/coreclr/src/pal/tests/palsuite/DisabledTests.txt index babd443380fe..0f7094c4a8e8 100644 --- a/src/coreclr/src/pal/tests/palsuite/DisabledTests.txt +++ b/src/coreclr/src/pal/tests/palsuite/DisabledTests.txt @@ -48,4 +48,4 @@ This test case should be run manually. Requires user input. filemapping_memmgt\MapViewOfFile\test1 ======================================= -Refer this github issue https://github.com/dotnet/coreclr/issues/5176 +Refer this github issue https://github.com/dotnet/runtime/issues/5924 diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/CMakeLists.txt deleted file mode 100644 index 95aa6ac39459..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/CMakeLists.txt +++ /dev/null @@ -1,171 +0,0 @@ -add_subdirectory(abs) -add_subdirectory(acos) -add_subdirectory(acosf) -add_subdirectory(acosh) -add_subdirectory(acoshf) -add_subdirectory(asin) -add_subdirectory(asinf) -add_subdirectory(asinh) -add_subdirectory(asinhf) -add_subdirectory(atan) -add_subdirectory(atan2) -add_subdirectory(atan2f) -add_subdirectory(atanf) -add_subdirectory(atanh) -add_subdirectory(atanhf) -add_subdirectory(atof) -add_subdirectory(atoi) -add_subdirectory(bsearch) -add_subdirectory(cbrt) -add_subdirectory(cbrtf) -add_subdirectory(ceil) -add_subdirectory(ceilf) -add_subdirectory(cos) -add_subdirectory(cosf) -add_subdirectory(cosh) -add_subdirectory(coshf) - -add_subdirectory(errno) -add_subdirectory(exit) -add_subdirectory(exp) -add_subdirectory(expf) -add_subdirectory(fabs) -add_subdirectory(fabsf) -add_subdirectory(fclose) -add_subdirectory(ferror) -add_subdirectory(fflush) -add_subdirectory(fgets) -add_subdirectory(floor) -add_subdirectory(floorf) -add_subdirectory(fma) -add_subdirectory(fmaf) -add_subdirectory(fmod) -add_subdirectory(fmodf) -add_subdirectory(fopen) -add_subdirectory(fprintf) -add_subdirectory(fputs) -add_subdirectory(fread) -add_subdirectory(free) -add_subdirectory(fseek) -add_subdirectory(ftell) -add_subdirectory(fwprintf) -add_subdirectory(fwrite) -add_subdirectory(getenv) -add_subdirectory(ilogb) -add_subdirectory(ilogbf) -add_subdirectory(isalnum) -add_subdirectory(isalpha) -add_subdirectory(isdigit) -add_subdirectory(islower) -add_subdirectory(isprint) -add_subdirectory(isspace) -add_subdirectory(isupper) -add_subdirectory(iswdigit) -add_subdirectory(iswspace) -add_subdirectory(iswupper) -add_subdirectory(isxdigit) -add_subdirectory(llabs) -add_subdirectory(log) -add_subdirectory(log2) -add_subdirectory(log2f) -add_subdirectory(log10) -add_subdirectory(log10f) -add_subdirectory(logf) -add_subdirectory(malloc) -add_subdirectory(memchr) -add_subdirectory(memcmp) -add_subdirectory(memcpy) -add_subdirectory(memmove) -add_subdirectory(memset) -add_subdirectory(modf) -add_subdirectory(modff) -add_subdirectory(pow) -add_subdirectory(powf) -add_subdirectory(printf) -add_subdirectory(qsort) -add_subdirectory(rand_srand) -add_subdirectory(realloc) -add_subdirectory(scalbn) -add_subdirectory(scalbnf) -add_subdirectory(sin) -add_subdirectory(sinf) -add_subdirectory(sinh) -add_subdirectory(sinhf) -add_subdirectory(sprintf_s) -add_subdirectory(sqrt) -add_subdirectory(sqrtf) -add_subdirectory(sscanf_s) -add_subdirectory(strcat) -add_subdirectory(strchr) -add_subdirectory(strcmp) -add_subdirectory(strcpy) -add_subdirectory(strcspn) -add_subdirectory(strlen) -add_subdirectory(strncat) -add_subdirectory(strncmp) -add_subdirectory(strncpy) -add_subdirectory(strpbrk) -add_subdirectory(strrchr) -add_subdirectory(strspn) -add_subdirectory(strstr) -add_subdirectory(strtod) -add_subdirectory(strtok) -add_subdirectory(strtoul) -add_subdirectory(swprintf) -add_subdirectory(swscanf) -add_subdirectory(tan) -add_subdirectory(tanf) -add_subdirectory(tanh) -add_subdirectory(tanhf) -add_subdirectory(time) -add_subdirectory(tolower) -add_subdirectory(toupper) -add_subdirectory(towlower) -add_subdirectory(towupper) -add_subdirectory(vfprintf) -add_subdirectory(vprintf) -add_subdirectory(vsprintf) -add_subdirectory(vswprintf) -add_subdirectory(wcscat) -add_subdirectory(wcschr) -add_subdirectory(wcscmp) -add_subdirectory(wcscpy) -add_subdirectory(wcslen) -add_subdirectory(wcsncmp) -add_subdirectory(wcsncpy) -add_subdirectory(wcspbrk) -add_subdirectory(wcsrchr) -add_subdirectory(wcsstr) -add_subdirectory(wcstod) -add_subdirectory(wcstok) -add_subdirectory(wcstoul) -add_subdirectory(wprintf) -add_subdirectory(_alloca) -add_subdirectory(_fdopen) -add_subdirectory(_finite) -add_subdirectory(_finitef) - -# TODO: make this test compile -# add_subdirectory(_gcvt) - -add_subdirectory(_isnan) -add_subdirectory(_isnanf) -add_subdirectory(_itow) -add_subdirectory(_mbsdec) -add_subdirectory(_mbsinc) -add_subdirectory(_mbsninc) -add_subdirectory(_putenv) -add_subdirectory(_rotl) -add_subdirectory(_rotr) -add_subdirectory(_snprintf_s) -add_subdirectory(_snwprintf_s) -add_subdirectory(_stricmp) -add_subdirectory(_strnicmp) -add_subdirectory(_vsnprintf_s) -add_subdirectory(_vsnwprintf_s) -add_subdirectory(_wcsicmp) -add_subdirectory(_wcslwr) -add_subdirectory(_wcsnicmp) -add_subdirectory(_wfopen) -add_subdirectory(_wtoi) -add_subdirectory(__iscsym) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/CMakeLists.txt deleted file mode 100644 index 431b99e4eb2c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - __iscsym.cpp -) - -add_executable(paltest_iscsym_test1 - ${SOURCES} -) - -add_dependencies(paltest_iscsym_test1 coreclrpal) - -target_link_libraries(paltest_iscsym_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.cpp index 497f281da12f..9244c5f0a32e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.cpp @@ -12,7 +12,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime___iscsym_test1_paltest_iscsym_test1, "c_runtime/__iscsym/test1/paltest_iscsym_test1") { int err; int index; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/testinfo.dat deleted file mode 100644 index 7bf152d2cc7b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/__iscsym/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = __iscsym -Name = Positive test for __iscsym to test letter, digit and underscore -TYPE = DEFAULT -EXE1 = __iscsym -Description -=Test the __iscsym to test letter, digit and underscore diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/CMakeLists.txt deleted file mode 100644 index 41226ab10bab..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_alloca_test1 - ${SOURCES} -) - -add_dependencies(paltest_alloca_test1 coreclrpal) - -target_link_libraries(paltest_alloca_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.cpp index b0552d457f8b..d11b65e99dce 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__alloca_test1_paltest_alloca_test1, "c_runtime/_alloca/test1/paltest_alloca_test1") { char *testA = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/testinfo.dat deleted file mode 100644 index 30ef924f1e90..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_alloca/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _alloca -Name = Positive Test for _alloca -TYPE = DEFAULT -EXE1 = test1 -Description -= Checks that _alloca allocates memory, and that the memory is -= readable and writeable. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/CMakeLists.txt deleted file mode 100644 index c4df126e13ec..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fdopen_test1 - ${SOURCES} -) - -add_dependencies(paltest_fdopen_test1 coreclrpal) - -target_link_libraries(paltest_fdopen_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.cpp index 608f537f25df..9cff3b731d87 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.cpp @@ -21,9 +21,9 @@ #include -const char* cTestString = "one fish, two fish, read fish, blue fish."; +#define cTestString "one fish, two fish, read fish, blue fish." -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__fdopen_test1_paltest_fdopen_test1, "c_runtime/_fdopen/test1/paltest_fdopen_test1") { HANDLE hReadPipe = NULL; HANDLE hWritePipe = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/testinfo.dat deleted file mode 100644 index c2bbdb6b42af..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_fdopen/test1/testinfo.dat +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fdopen -Name = test for fdopen and _close -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the fdopen function. -= This will test fdopen in r (read) mode. This test -= creates and opens a test pipe, to write and read -= from. fdopen requires a file handle(int), therefore -= _open_osfhandle is used to get that handle. -= _open_osfhandle is only used with CreatePipe. The -= test will write and read from the pipe comparing -= the results. -= As a secondary test, _close is tested since it needs -= the handle returned by _open_osfhandle. The handle is -= closed, then a read is attempted on the handle which -= should fail. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/CMakeLists.txt deleted file mode 100644 index 55401112a474..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_finite_test1 - ${SOURCES} -) - -add_dependencies(paltest_finite_test1 coreclrpal) - -target_link_libraries(paltest_finite_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/test1.cpp index 4f86cad2f17d..e21c9551b5c0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/test1.cpp @@ -36,7 +36,7 @@ If E=0 and F is zero and S is 0, then V=0 #define TO_DOUBLE(x) (*((double*)((void*)&x))) -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__finite_test1_paltest_finite_test1, "c_runtime/_finite/test1/paltest_finite_test1") { /*non-finite numbers*/ UINT64 lsnan = UI64(0xffffffffffffffff); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/testinfo.dat deleted file mode 100644 index 3dd6f68f2f3a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finite/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _finite -Name = Positive Test for _finite -TYPE = DEFAULT -EXE1 = test1 -Description -= Checks that _finite correctly classifies all types of floating point -= numbers (NaN, -Infinity, Infinity, finite nonzero, unnormalized, 0, and -0). diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/test1/CMakeLists.txt deleted file mode 100644 index 9e110ede88cc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_finitef_test1 - ${SOURCES} -) - -add_dependencies(paltest_finitef_test1 coreclrpal) - -target_link_libraries(paltest_finitef_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/test1/test1.c deleted file mode 100644 index 5f94ac464e7c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_finitef/test1/test1.c +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: Checks that _finitef correctly classifies all types -** of floating point numbers (NaN, -Infinity, Infinity, -** finite nonzero, unnormalized, 0, and -0) -** -**==========================================================================*/ - -#include - -/* -The IEEE single precision floating point standard looks like this: - - S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF - 0 1 8 9 31 - -S is the sign bit. The E bits are the exponent, and the 23 F bits are -the fraction. These represent a value, V. - -If E=255 and F is nonzero, then V=NaN ("Not a number") -If E=255 and F is zero and S is 1, then V=-Infinity -If E=255 and F is zero and S is 0, then V=Infinity -If 0 + +/* +The IEEE single precision floating point standard looks like this: + + S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF + 0 1 8 9 31 + +S is the sign bit. The E bits are the exponent, and the 23 F bits are +the fraction. These represent a value, V. + +If E=255 and F is nonzero, then V=NaN ("Not a number") +If E=255 and F is zero and S is 1, then V=-Infinity +If E=255 and F is zero and S is 0, then V=Infinity +If 0 -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__gcvt_test1_paltest_gcvt_test1, "c_runtime/_gcvt/test1/paltest_gcvt_test1") { int err; double dValue = -3.1415926535; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test1/testinfo.dat deleted file mode 100644 index b32ac0e38f2a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _gcvt -Name = Positive test for _gcvt API to convert a floatable value to a string -TYPE = DEFAULT -EXE1 = _gcvt -Description -=Test the _gcvt to convert a floatable value to a string -=with specified sigficant digits stored diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/CMakeLists.txt deleted file mode 100644 index 87f84e30f870..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_gcvt_test2 - ${SOURCES} -) - -add_dependencies(paltest_gcvt_test2 coreclrpal) - -target_link_libraries(paltest_gcvt_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.cpp index 9ed63892f81a..af41769786f8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.cpp @@ -24,7 +24,7 @@ struct testCase varies from windows sprintf */ }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__gcvt_test2_paltest_gcvt_test2, "c_runtime/_gcvt/test2/paltest_gcvt_test2") { char result[128]; int i=0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/testinfo.dat deleted file mode 100644 index 1dca549cc93e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_gcvt/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _gcvt -Name = Call _gcvt on normal values, negatives, exponents and hex digits. -TYPE = DEFAULT -EXE1 = test2 -Description -= Call the _gcvt function on a number of cases. Check that it -= handles negatives, exponents and hex digits properly. Also check that -= the 'digit' specification works. (And that it doesn't truncate negative -= signs or decimals) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/CMakeLists.txt deleted file mode 100644 index 31a173cfcbb4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isnan_test1 - ${SOURCES} -) - -add_dependencies(paltest_isnan_test1 coreclrpal) - -target_link_libraries(paltest_isnan_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.cpp index 6640bc4edcf1..98a96cc2474a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.cpp @@ -22,7 +22,7 @@ /* * NaN: any double with maximum exponent (0x7ff) and non-zero fraction */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__isnan_test1_paltest_isnan_test1, "c_runtime/_isnan/test1/paltest_isnan_test1") { /* * Initialize the PAL and return FAIL if this fails diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/testinfo.dat deleted file mode 100644 index 7762c56edb3c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnan/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _isnan -Name = Test #1 for _isnan -TYPE = DEFAULT -EXE1 = test1 -Description -= Test _isnan with a number of trivial values, to ensure they indicated that -= they are numbers. Then try with Positive/Negative Infinite, which should -= also be numbers. Finally set the least and most significant bits of -= the fraction to positive and negative, at which point it should return -= the true value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/CMakeLists.txt deleted file mode 100644 index 2189a703ed58..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_isnanf_test1 - ${SOURCES} -) - -add_dependencies(paltest_isnanf_test1 coreclrpal) - -target_link_libraries(paltest_isnanf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.c deleted file mode 100644 index 6fac5a718caf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.c +++ /dev/null @@ -1,114 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: -** Test _isnanf with a number of trivial values, to ensure they indicated that -** they are numbers. Then try with Positive/Negative Infinite, which should -** also be numbers. Finally set the least and most significant bits of -** the fraction to positive and negative, at which point it should return -** the true value. -** -**==========================================================================*/ - -#include - -#define TO_FLOAT(x) (*((float*)((void*)&x))) -#define TO_I32(x) (*((INT32*)((void*)&x))) - -/* - * NaN: any float with maximum exponent (0x7f8) and non-zero fraction - */ -int __cdecl main(int argc, char *argv[]) -{ - /* - * Initialize the PAL and return FAIL if this fails - */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - /* - * Try some trivial values - */ - if (_isnanf(0.0f)) - { - Fail("_isnanf() incorrectly identified %f as NaN!\n", 0.0f); - } - - if (_isnanf(1.234567f)) - { - Fail("_isnanf() incorrectly identified %f as NaN!\n", 1.234567f); - } - - if (_isnanf(42.0f)) - { - Fail("_isnanf() incorrectly identified %f as NaN!\n", 42.0f); - } - - UINT32 lneginf = 0xff800000u; - UINT32 lposinf = 0x7f800000u; - - float neginf = TO_FLOAT(lneginf); - float posinf = TO_FLOAT(lposinf); - - /* - * Try positive and negative infinity - */ - if (_isnanf(neginf)) - { - Fail("_isnanf() incorrectly identified negative infinity as NaN!\n"); - } - - if (_isnanf(posinf)) - { - Fail("_isnanf() incorrectly identified infinity as NaN!\n"); - } - - /* - * Try setting the least significant bit of the fraction, - * positive and negative - */ - UINT32 lsnan = 0xff800001u; - float snan = TO_FLOAT(lsnan); - - if (!_isnanf(snan)) - { - Fail("_isnanf() failed to identify %I32x as NaN!\n", lsnan); - } - - UINT32 lqnan = 0x7f800001u; - float qnan = TO_FLOAT(lqnan); - - if (!_isnanf(qnan)) - { - Fail("_isnanf() failed to identify %I32x as NaN!\n", lqnan); - } - - /* - * Try setting the most significant bit of the fraction, - * positive and negative - */ - lsnan = 0xffc00000u; - snan = TO_FLOAT(lsnan); - - if (!_isnanf(snan)) - { - Fail ("_isnanf() failed to identify %I32x as NaN!\n", lsnan); - } - - lqnan = 0x7fc00000u; - qnan = TO_FLOAT(lqnan); - - if (!_isnanf(qnan)) - { - Fail ("_isnanf() failed to identify %I32x as NaN!\n", lqnan); - } - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.cpp new file mode 100644 index 000000000000..b46b238342ad --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.cpp @@ -0,0 +1,114 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================ +** +** Source: test1.c +** +** Purpose: +** Test _isnanf with a number of trivial values, to ensure they indicated that +** they are numbers. Then try with Positive/Negative Infinite, which should +** also be numbers. Finally set the least and most significant bits of +** the fraction to positive and negative, at which point it should return +** the true value. +** +**==========================================================================*/ + +#include + +#define TO_FLOAT(x) (*((float*)((void*)&x))) +#define TO_I32(x) (*((INT32*)((void*)&x))) + +/* + * NaN: any float with maximum exponent (0x7f8) and non-zero fraction + */ +PALTEST(c_runtime__isnanf_test1_paltest_isnanf_test1, "c_runtime/_isnanf/test1/paltest_isnanf_test1") +{ + /* + * Initialize the PAL and return FAIL if this fails + */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + /* + * Try some trivial values + */ + if (_isnanf(0.0f)) + { + Fail("_isnanf() incorrectly identified %f as NaN!\n", 0.0f); + } + + if (_isnanf(1.234567f)) + { + Fail("_isnanf() incorrectly identified %f as NaN!\n", 1.234567f); + } + + if (_isnanf(42.0f)) + { + Fail("_isnanf() incorrectly identified %f as NaN!\n", 42.0f); + } + + UINT32 lneginf = 0xff800000u; + UINT32 lposinf = 0x7f800000u; + + float neginf = TO_FLOAT(lneginf); + float posinf = TO_FLOAT(lposinf); + + /* + * Try positive and negative infinity + */ + if (_isnanf(neginf)) + { + Fail("_isnanf() incorrectly identified negative infinity as NaN!\n"); + } + + if (_isnanf(posinf)) + { + Fail("_isnanf() incorrectly identified infinity as NaN!\n"); + } + + /* + * Try setting the least significant bit of the fraction, + * positive and negative + */ + UINT32 lsnan = 0xff800001u; + float snan = TO_FLOAT(lsnan); + + if (!_isnanf(snan)) + { + Fail("_isnanf() failed to identify %I32x as NaN!\n", lsnan); + } + + UINT32 lqnan = 0x7f800001u; + float qnan = TO_FLOAT(lqnan); + + if (!_isnanf(qnan)) + { + Fail("_isnanf() failed to identify %I32x as NaN!\n", lqnan); + } + + /* + * Try setting the most significant bit of the fraction, + * positive and negative + */ + lsnan = 0xffc00000u; + snan = TO_FLOAT(lsnan); + + if (!_isnanf(snan)) + { + Fail ("_isnanf() failed to identify %I32x as NaN!\n", lsnan); + } + + lqnan = 0x7fc00000u; + qnan = TO_FLOAT(lqnan); + + if (!_isnanf(qnan)) + { + Fail ("_isnanf() failed to identify %I32x as NaN!\n", lqnan); + } + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/testinfo.dat deleted file mode 100644 index 362f6426576d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_isnanf/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _isnanf -Name = Test #1 for _isnanf -TYPE = DEFAULT -EXE1 = test1 -Description -= Test _isnanf with a number of trivial values, to ensure they indicated that -= they are numbers. Then try with Positive/Negative Infinite, which should -= also be numbers. Finally set the least and most significant bits of -= the fraction to positive and negative, at which point it should return -= the true value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt deleted file mode 100644 index 2c3d4ac509f2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_itow_test1 - ${SOURCES} -) - -add_dependencies(paltest_itow_test1 coreclrpal) - -target_link_libraries(paltest_itow_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp index bd93868a0e41..15e6aa201799 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp @@ -23,7 +23,7 @@ struct testCase int radix; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__itow_test1_paltest_itow_test1, "c_runtime/_itow/test1/paltest_itow_test1") { char16_t result[20]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat deleted file mode 100644 index 99b24cf89d5a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = C Runtime -Function = _itow_s -Name = Positive Test for _itow_s -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the _itow_s function. -= Test a number of ints with different radix on each, to ensure that the -= string returned is correct. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/CMakeLists.txt deleted file mode 100644 index 37d47680ff5a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_mbsdec_test1 - ${SOURCES} -) - -add_dependencies(paltest_mbsdec_test1 coreclrpal) - -target_link_libraries(paltest_mbsdec_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.cpp deleted file mode 100644 index 460f7159da63..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.cpp +++ /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. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: -** Ensure that this function moves the string pointer back one character. -** First do a basic test to check that the pointer gets moved back the one -** character, given str1 and str+1 as params. Then try with both -** params being the same pointer, which should return NULL. Also test -** when the first pointer is past the second pointer, which should -** return null. Finally try this function on an array of single bytes, -** which it assumes are characters and should work in the same fashion. -** -** -**==========================================================================*/ - -#include - -/* - * Note: it seems like these functions would only be useful if they - * didn't assume a character was equivalent to a single byte. Be that - * as it may, I haven't seen a way to get it to behave otherwise. - */ - -int __cdecl main(int argc, char *argv[]) -{ - unsigned char *str1 = (unsigned char*) "foo"; - unsigned char str2[] = {0xC0, 0x80, 0xC0, 0x80, 0}; - unsigned char str3[] = {0}; - unsigned char *ret = NULL; - - /* - * Initialize the PAL and return FAIL if this fails - */ - if (0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - ret = _mbsdec(str1,str1+1); - if (ret != str1) - { - Fail ("ERROR: _mbsdec returned %p. Expected %p\n", ret, str1); - } - - ret = _mbsdec(str1,str1); - if (ret != NULL) - { - Fail ("ERROR: _mbsdec returned %p. Expected %p\n", ret, NULL); - } - - ret = _mbsdec(str1+100,str1); - if (ret != NULL) - { - Fail ("ERROR: _mbsdec returned %p. Expected %p\n", ret, NULL); - } - - ret = _mbsdec(str2,str2+1); - if (ret != str2) - { - Fail ("ERROR: _mbsdec returned %p. Expected %p\n", ret, str2+1); - } - - ret = _mbsdec(str3,str3+10); - if (ret != str3+9) - { - Fail ("ERROR: _mbsdec returned %p. Expected %p\n", ret, str3+9); - } - - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/testinfo.dat deleted file mode 100644 index b8ac7b283b66..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = C Runtime -Function = _mbsdec -Name = Positive Test for _mbsdec -TYPE = DEFAULT -EXE1 = test1 -Description -= Ensure that this function moves the string pointer back one character. -= First do a basic test to check that the pointer gets moved back the one -= character, given str1 and str+1 as params. Then try with both -= params being the same pointer, which should return NULL. Also test -= when the first pointer is past the second pointer, which should -= return null. Finally try this function on an array of single bytes, -= which it assumes are characters and should work in the same fashion. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/CMakeLists.txt deleted file mode 100644 index d5f7ad303677..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_mbsinc_test1 - ${SOURCES} -) - -add_dependencies(paltest_mbsinc_test1 coreclrpal) - -target_link_libraries(paltest_mbsinc_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.cpp deleted file mode 100644 index 868dfb736d88..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: -** Ensure that this function moves the string pointer ahead one character. -** First do a basic test to check that the pointer gets moved ahead the one -** character. Then try with an array of bytes and a NULL array. Each of -** these should still work by returning a pointer to thePointer+1. -** -** -**==========================================================================*/ - -#include - -/* - * Note: it seems like these functions would only be useful if they - * didn't assume a character was equivalent to a single byte. Be that - * as it may, I haven't seen a way to get it to behave otherwise. - */ - -int __cdecl main(int argc, char *argv[]) -{ - unsigned char *str1 = (unsigned char*) "foo"; - unsigned char str2[] = {0xC0, 0x80, 0xC0, 0x80, 0}; - unsigned char str3[] = {0}; - unsigned char *ret=NULL; - - /* - * Initialize the PAL and return FAIL if this fails - */ - if (0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - ret = _mbsinc(str1); - if (ret != str1 + 1) - { - Fail ("ERROR: _mbsinc returned %p. Expected %p\n", ret, str1); - } - - ret = _mbsinc(str2); - if (ret != str2 + 1) - { - Fail ("ERROR: _mbsinc returned %p. Expected %p\n", ret, str1); - } - - ret = _mbsinc(str3); - if (ret != str3 + 1) - { - Fail ("ERROR: _mbsinc returned %p. Expected %p\n", ret, str1); - } - - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/testinfo.dat deleted file mode 100644 index 179f66828326..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _mbsinc -Name = Positive Test for _mbsinc -TYPE = DEFAULT -EXE1 = test1 -Description -= Ensure that this function moves the string pointer ahead one character. -= First do a basic test to check that the pointer gets moved ahead the one -= character. Then try with an array of bytes and a NULL array. Each of -= these should still work by returning a pointer to thePointer+1. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/CMakeLists.txt deleted file mode 100644 index 523e862d020c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_mbsninc_test1 - ${SOURCES} -) - -add_dependencies(paltest_mbsninc_test1 coreclrpal) - -target_link_libraries(paltest_mbsninc_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.cpp deleted file mode 100644 index 5949a550ab40..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: -** Ensure that this functions increases a string pointer by n characters. -** Use a for loop, and increase the pointer by a different number of characters -** on each iteration, ensure that it is indeed pointing to the correct location -** each time. The second test checks to see if you attempt to increase the -** pointer past the end of the string, the pointer should just point at the -** last character. -** -** -**==========================================================================*/ - -#include - -/* - * Note: it seems like these functions would only be useful if they - * didn't assume a character was equivalent to a single byte. Be that - * as it may, I haven't seen a way to get it to behave otherwise. - */ - -int __cdecl main(int argc, char *argv[]) -{ - unsigned char str[] = {0xC0, 0x80, 0xC0, 0x80, 0}; - int i=0; - unsigned char *ret=NULL; - - /* - * Initialize the PAL and return FAIL if this fails - */ - if (0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - for (i=0; i<5; i++) - { - ret = _mbsninc(str, i); - if (ret != str + i) - { - Fail ("ERROR: _mbsninc returned %p. Expected %p\n", ret, str+i); - } - } - - /* - * trying to advance past the end of the string should just - * return the end. - */ - ret = _mbsninc(str, 5); - if (ret != str + 4) - { - Fail ("ERROR: _mbsninc returned %p. Expected %p\n", ret, str+4); - } - - - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/testinfo.dat deleted file mode 100644 index aea76f11eca0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _mbsninc -Name = Positive Test for _mbsninc -TYPE = DEFAULT -EXE1 = test1 -Description -= Ensure that this functions increases a string pointer by n characters. -= Use a for loop, and increase the pointer by a different number of characters -= on each iteration, ensure that it is indeed pointing to the correct location -= each time. The second test checks to see if you attempt to increase the -= pointer past the end of the string, the pointer should just point at the -= last character. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/CMakeLists.txt deleted file mode 100644 index 2d7d38315123..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_putenv_test1 - ${SOURCES} -) - -add_dependencies(paltest_putenv_test1 coreclrpal) - -target_link_libraries(paltest_putenv_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.cpp index 596c0e8dcfcb..a7ebbe4fa618 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.cpp @@ -21,19 +21,18 @@ struct TestElement BOOL bValidString; /* valid argument string identifier */ }; -struct TestElement TestCases[] = +PALTEST(c_runtime__putenv_test1_paltest_putenv_test1, "c_runtime/_putenv/test1/paltest_putenv_test1") { - {"PalTestingEnvironmentVariable=A value", "PalTestingEnvironmentVariable", - "A value", TRUE}, - {"AnotherVariable=", "AnotherVariable", "", TRUE}, - {"YetAnotherVariable", "", "", FALSE}, - {"=ADifferentVariable", "", "ADifferentVariable", FALSE}, - {"", "", "", FALSE} - -}; + struct TestElement TestCases[] = + { + {"PalTestingEnvironmentVariable=A value", "PalTestingEnvironmentVariable", + "A value", TRUE}, + {"AnotherVariable=", "AnotherVariable", "", TRUE}, + {"YetAnotherVariable", "", "", FALSE}, + {"=ADifferentVariable", "", "ADifferentVariable", FALSE}, + {"", "", "", FALSE} -int __cdecl main(int argc, char **argv) -{ + }; int i; char *variableValue; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/testinfo.dat deleted file mode 100644 index bf2e6c42ffa4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _putenv -Name = Positive test for _putenv -TYPE = DEFAULT -EXE1 = test1 -Description -= Create an environment variable with _putenv and then use getenv to -= check it. Check that we get the expected errors with invalid input. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/CMakeLists.txt deleted file mode 100644 index 41a75fa877b6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_putenv_test2 - ${SOURCES} -) - -add_dependencies(paltest_putenv_test2 coreclrpal) - -target_link_libraries(paltest_putenv_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.cpp index 170e55ff93b8..ee84e375c2e2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.cpp @@ -18,7 +18,7 @@ const char *_putenvString1 = "AnUnusualVariable="; const char *variable = "AnUnusualVariable"; const char *value = "AnUnusualValue"; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__putenv_test2_paltest_putenv_test2, "c_runtime/_putenv/test2/paltest_putenv_test2") { char *variableValue; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/testinfo.dat deleted file mode 100644 index 7f033b4ca243..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _putenv -Name = Positive test for _putenv -TYPE = DEFAULT -EXE1 = test2 -Description -= Create an environment variable with _putenv and then use getenv to -= check it. This test resets an environment variable. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/CMakeLists.txt deleted file mode 100644 index a3bab40990f3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_putenv_test3 - ${SOURCES} -) - -add_dependencies(paltest_putenv_test3 coreclrpal) - -target_link_libraries(paltest_putenv_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.cpp index c6889821d4db..74d057dadd44 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__putenv_test3_paltest_putenv_test3, "c_runtime/_putenv/test3/paltest_putenv_test3") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/testinfo.dat deleted file mode 100644 index c1a8b91e1ee1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _putenv -Name = Positive test for _putenv -TYPE = DEFAULT -EXE1 = test3 -Description -= Create environment variables that only differ by case -= and check that the BSD operating system treats them -= as two separate variables. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/CMakeLists.txt deleted file mode 100644 index 78d1d7050436..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_putenv_test4 - ${SOURCES} -) - -add_dependencies(paltest_putenv_test4 coreclrpal) - -target_link_libraries(paltest_putenv_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.cpp index c7b9994a8e10..85fb19a171f6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.cpp @@ -15,7 +15,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__putenv_test4_paltest_putenv_test4, "c_runtime/_putenv/test4/paltest_putenv_test4") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/testinfo.dat deleted file mode 100644 index 04ca0daad7e9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_putenv/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _putenv -Name = Positive test for _putenv -TYPE = DEFAULT -EXE1 = test4 -Description -= Create an environment variable and check -= that trying to retrieve it using a name with different -= case, returns the correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/CMakeLists.txt deleted file mode 100644 index bb0484752a3a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_rotl_test1 - ${SOURCES} -) - -add_dependencies(paltest_rotl_test1 coreclrpal) - -target_link_libraries(paltest_rotl_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/test1.cpp index 19e5cdb805d4..52f321ec9706 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/test1.cpp @@ -17,7 +17,7 @@ **===================================================================*/ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__rotl_test1_paltest_rotl_test1, "c_runtime/_rotl/test1/paltest_rotl_test1") { unsigned results = 0; int i,j; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/testinfo.dat deleted file mode 100644 index 4232c58bbdf3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotl/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _rtol -Name = Positive Test for _rotl -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the _rotl function. -= The _rotl function rotates the unsigned value. _rotl -= rotates the value left and "wraps" bits rotated off -= one end of value to the other end. -= This test compares the result to a previously determined -= value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/CMakeLists.txt deleted file mode 100644 index c01bd9824954..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_rotr_test1 - ${SOURCES} -) - -add_dependencies(paltest_rotr_test1 coreclrpal) - -target_link_libraries(paltest_rotr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/test1.cpp index e90ca0e853bb..2f753c56b6c1 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/test1.cpp @@ -16,7 +16,7 @@ **===================================================================*/ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__rotr_test1_paltest_rotr_test1, "c_runtime/_rotr/test1/paltest_rotr_test1") { unsigned results = 0; int i,j; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/testinfo.dat deleted file mode 100644 index e56d80e95800..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_rotr/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _rtor -Name = Positive Test for _rotr -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the _rotr function. -= The _rotr function rotates the unsigned value. _rotr -= rotates the value right and "wraps" bits rotated off -= one end of value to the other end. -= This test compares the result to a previously determined -= value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/CMakeLists.txt deleted file mode 100644 index b29c7c438bd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/_snprintf_s.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/_snprintf_s.h index 35aeffe24e4f..747d50a1e7fc 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/_snprintf_s.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/_snprintf_s.h @@ -13,7 +13,7 @@ #ifndef __STRINGTEST_H__ #define __STRINGTEST_H__ -void DoStrTest(const char *formatstr, char* param, const char *checkstr) +inline void DoStrTest_snprintf_s(const char *formatstr, char* param, const char *checkstr) { char buf[256] = { 0 }; @@ -25,8 +25,9 @@ void DoStrTest(const char *formatstr, char* param, const char *checkstr) param, formatstr, checkstr, buf); } } +#define DoStrTest DoStrTest_snprintf_s -void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_snprintf_s(const char *formatstr, WCHAR* param, const char *checkstr) { char buf[256] = { 0 }; @@ -38,9 +39,9 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) convertC(param), formatstr, checkstr, buf); } } +#define DoWStrTest DoWStrTest_snprintf_s - -void DoPointerTest(const char *formatstr, void* param, char* paramstr, char +inline void DoPointerTest_snprintf_s(const char *formatstr, void* param, char* paramstr, char *checkstr1) { char buf[256] = { 0 }; @@ -53,8 +54,9 @@ void DoPointerTest(const char *formatstr, void* param, char* paramstr, char paramstr, formatstr, checkstr1, buf); } } +#define DoPointerTest DoPointerTest_snprintf_s -void DoCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoCountTest_snprintf_s(const char *formatstr, int param, const char *checkstr) { char buf[512] = { 0 }; int n = -1; @@ -71,8 +73,9 @@ void DoCountTest(const char *formatstr, int param, const char *checkstr) Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf); } } +#define DoCountTest DoCountTest_snprintf_s -void DoShortCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoShortCountTest_snprintf_s(const char *formatstr, int param, const char *checkstr) { char buf[256] = { 0 }; short int n = -1; @@ -89,8 +92,9 @@ void DoShortCountTest(const char *formatstr, int param, const char *checkstr) Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf); } } +#define DoShortCountTest DoShortCountTest_snprintf_s -void DoCharTest(const char *formatstr, char param, const char *checkstr) +inline void DoCharTest_snprintf_s(const char *formatstr, char param, const char *checkstr) { char buf[256] = { 0 }; @@ -102,8 +106,9 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr) param, param, formatstr, checkstr, buf); } } +#define DoCharTest DoCharTest_snprintf_s -void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_snprintf_s(const char *formatstr, WCHAR param, const char *checkstr) { char buf[256] = { 0 }; @@ -115,8 +120,9 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) (char)param, param, formatstr, checkstr, buf); } } +#define DoWCharTest DoWCharTest_snprintf_s -void DoNumTest(const char *formatstr, int value, const char *checkstr) +inline void DoNumTest_snprintf_s(const char *formatstr, int value, const char *checkstr) { char buf[256] = { 0 }; @@ -128,8 +134,9 @@ void DoNumTest(const char *formatstr, int value, const char *checkstr) value, formatstr, checkstr, buf); } } +#define DoNumTest DoNumTest_snprintf_s -void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1) +inline void DoI64Test_snprintf_s(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1) { char buf[256] = { 0 }; @@ -141,8 +148,9 @@ void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *c valuestr, formatstr, checkstr1, buf); } } +#define DoI64Test DoI64Test_snprintf_s -void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, char +inline void DoDoubleTest_snprintf_s(const char *formatstr, double value, const char *checkstr1, char *checkstr2) { char buf[256] = { 0 }; @@ -156,8 +164,9 @@ void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, ch value, formatstr, checkstr1, checkstr2, buf); } } +#define DoDoubleTest DoDoubleTest_snprintf_s -void DoArgumentPrecTest(const char *formatstr, int precision, void *param, char +inline void DoArgumentPrecTest_snprintf_s(const char *formatstr, int precision, void *param, char *paramstr, const char *checkstr1, const char *checkstr2) { char buf[256]; @@ -172,8 +181,9 @@ void DoArgumentPrecTest(const char *formatstr, int precision, void *param, char } } +#define DoArgumentPrecTest DoArgumentPrecTest_snprintf_s -void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_snprintf_s(const char *formatstr, int precision, double param, const char *checkstr1, const char *checkstr2) { char buf[256]; @@ -188,6 +198,7 @@ const char *checkstr1, const char *checkstr2) } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_snprintf_s #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/CMakeLists.txt deleted file mode 100644 index 01802902dced..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_snprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test1 coreclrpal) - -target_link_libraries(paltest_snprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/test1.cpp index 39f91711b561..e7fc958b2166 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/test1.cpp @@ -19,7 +19,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test1_paltest_snprintf_test1, "c_runtime/_snprintf_s/test1/paltest_snprintf_test1") { char checkstr[] = "hello world"; char buf[256] = { 0 }; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/testinfo.dat deleted file mode 100644 index dd7e48e96b2d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test1 -Description -= General test to see if sprintf_s works correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/CMakeLists.txt deleted file mode 100644 index 2378bee2d0c6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_snprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test10 coreclrpal) - -target_link_libraries(paltest_snprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/test10.cpp index e2f7d4aca34e..1ed1831232e5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/test10.cpp @@ -20,7 +20,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test10_paltest_snprintf_test10, "c_runtime/_snprintf_s/test10/paltest_snprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/testinfo.dat deleted file mode 100644 index 5bef07c257d6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests sprintf_s with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/CMakeLists.txt deleted file mode 100644 index 0eea7017a3a0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_snprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test11 coreclrpal) - -target_link_libraries(paltest_snprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/test11.cpp index fc93a3c668df..2576460d7aa9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/test11.cpp @@ -19,7 +19,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test11_paltest_snprintf_test11, "c_runtime/_snprintf_s/test11/paltest_snprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/testinfo.dat deleted file mode 100644 index c65a26c70812..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests sprintf_s with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/CMakeLists.txt deleted file mode 100644 index 5d824381ee85..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_snprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test12 coreclrpal) - -target_link_libraries(paltest_snprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/test12.cpp index c1bee9c77f92..de62e6e2317e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/test12.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test12_paltest_snprintf_test12, "c_runtime/_snprintf_s/test12/paltest_snprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/testinfo.dat deleted file mode 100644 index 99db86d551db..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests sprintf_s with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/CMakeLists.txt deleted file mode 100644 index 74d1bc8454d8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_snprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test13 coreclrpal) - -target_link_libraries(paltest_snprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/test13.cpp index 1e0f0e5383a9..59c26ca4bbe1 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/test13.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test13_paltest_snprintf_test13, "c_runtime/_snprintf_s/test13/paltest_snprintf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/testinfo.dat deleted file mode 100644 index 9ec9a9f53d91..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests sprintf_s with hex numbers (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/CMakeLists.txt deleted file mode 100644 index b9592c99eea3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_snprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test14 coreclrpal) - -target_link_libraries(paltest_snprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/test14.cpp index 6bcf181a6155..b3b5044a35e4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/test14.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test14_paltest_snprintf_test14, "c_runtime/_snprintf_s/test14/paltest_snprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/testinfo.dat deleted file mode 100644 index d9d2d7dd4ebd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests sprintf_s with exponential format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/CMakeLists.txt deleted file mode 100644 index fe3736055c23..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_snprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test15 coreclrpal) - -target_link_libraries(paltest_snprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/test15.cpp index 818cb14c8707..407af8cd797b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/test15.cpp @@ -19,7 +19,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test15_paltest_snprintf_test15, "c_runtime/_snprintf_s/test15/paltest_snprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/testinfo.dat deleted file mode 100644 index 458ef784771d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests sprintf_s with exponential format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/CMakeLists.txt deleted file mode 100644 index 049abeba07c5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_snprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test16 coreclrpal) - -target_link_libraries(paltest_snprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/test16.cpp index e47bb777dab7..4ea8909c1147 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/test16.cpp @@ -19,7 +19,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test16_paltest_snprintf_test16, "c_runtime/_snprintf_s/test16/paltest_snprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/testinfo.dat deleted file mode 100644 index a40e69e53105..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests sprintf_s with decimal point format doubles diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/CMakeLists.txt deleted file mode 100644 index 7bd8a420aecf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_snprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test17 coreclrpal) - -target_link_libraries(paltest_snprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/test17.cpp index aef1be6a9015..496744c04489 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/test17.cpp @@ -19,7 +19,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test17_paltest_snprintf_test17, "c_runtime/_snprintf_s/test17/paltest_snprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/testinfo.dat deleted file mode 100644 index 2782f03bb863..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests sprintf_s with compact format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/CMakeLists.txt deleted file mode 100644 index d61038daf85d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_snprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test18 coreclrpal) - -target_link_libraries(paltest_snprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/test18.cpp index 34c67f43c15e..0a96a010407c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/test18.cpp @@ -19,7 +19,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test18_paltest_snprintf_test18, "c_runtime/_snprintf_s/test18/paltest_snprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/testinfo.dat deleted file mode 100644 index e93e01f2b11c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests sprintf_s with compact format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/CMakeLists.txt deleted file mode 100644 index 6d274d8a0de0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_snprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test19 coreclrpal) - -target_link_libraries(paltest_snprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/test19.cpp index 480b83fd2764..f3335fa7000e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/test19.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test19_paltest_snprintf_test19, "c_runtime/_snprintf_s/test19/paltest_snprintf_test19") { int n = -1; if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/testinfo.dat deleted file mode 100644 index ea56b0bb8f03..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests sprintf_s with argument specified precision diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/CMakeLists.txt deleted file mode 100644 index 5ce56484bd85..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_snprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test2 coreclrpal) - -target_link_libraries(paltest_snprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/test2.cpp index 1c8888ee3881..4f8a95d2905e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/test2.cpp @@ -18,7 +18,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test2_paltest_snprintf_test2, "c_runtime/_snprintf_s/test2/paltest_snprintf_test2") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/testinfo.dat deleted file mode 100644 index 1ec448495ffc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests sprintf_s with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/CMakeLists.txt deleted file mode 100644 index ff4049e339b4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_snprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test3 coreclrpal) - -target_link_libraries(paltest_snprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/test3.cpp index ed515e7bcd26..485ddfafc9e8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/test3.cpp @@ -19,7 +19,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test3_paltest_snprintf_test3, "c_runtime/_snprintf_s/test3/paltest_snprintf_test3") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/testinfo.dat deleted file mode 100644 index cc56fe26478f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests sprintf_s with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/CMakeLists.txt deleted file mode 100644 index 2cbef279f12c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_snprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test4 coreclrpal) - -target_link_libraries(paltest_snprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/test4.cpp index 56b2a0c955ba..3cc097d6af00 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/test4.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test4_paltest_snprintf_test4, "c_runtime/_snprintf_s/test4/paltest_snprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/testinfo.dat deleted file mode 100644 index 617c9b2d3e5b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests sprintf_s with pointers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/CMakeLists.txt deleted file mode 100644 index 2fdc6641c267..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_snprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test6 coreclrpal) - -target_link_libraries(paltest_snprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/test6.cpp index b7ce3fac92ea..69cd3a43fd40 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/test6.cpp @@ -19,7 +19,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test6_paltest_snprintf_test6, "c_runtime/_snprintf_s/test6/paltest_snprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/testinfo.dat deleted file mode 100644 index 0c520ade03e5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name =Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests sprintf_s with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/CMakeLists.txt deleted file mode 100644 index 2e1636bf13b2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_snprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test7 coreclrpal) - -target_link_libraries(paltest_snprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/test7.cpp index 0831dfa74961..76fb298bed9f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/test7.cpp @@ -19,7 +19,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test7_paltest_snprintf_test7, "c_runtime/_snprintf_s/test7/paltest_snprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/testinfo.dat deleted file mode 100644 index 38fa9371fe59..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests sprintf_s with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/CMakeLists.txt deleted file mode 100644 index cf431206bde2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_snprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test8 coreclrpal) - -target_link_libraries(paltest_snprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/test8.cpp index d034f7572b14..d167949f0d3b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/test8.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test8_paltest_snprintf_test8, "c_runtime/_snprintf_s/test8/paltest_snprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/testinfo.dat deleted file mode 100644 index 8c9e8cff321b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests sprintf_s with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/CMakeLists.txt deleted file mode 100644 index 646c6de4bae4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_snprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_snprintf_test9 coreclrpal) - -target_link_libraries(paltest_snprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/test9.cpp index 1877ff9a8071..82a1a10697ce 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/test9.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snprintf_s_test9_paltest_snprintf_test9, "c_runtime/_snprintf_s/test9/paltest_snprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/testinfo.dat deleted file mode 100644 index beb708ae943c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests sprintf_s with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/CMakeLists.txt deleted file mode 100644 index b29c7c438bd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/_snwprintf_s.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/_snwprintf_s.h index 021dde0666f0..45b5d2e2212a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/_snwprintf_s.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/_snwprintf_s.h @@ -13,7 +13,7 @@ #ifndef ___SNWPRINTF_H__ #define ___SNWPRINTF_H__ -void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) +inline void DoWStrTest_snwprintf_s(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -26,8 +26,9 @@ void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) convertC(formatstr), convertC(checkstr), convertC(buf)); } } +#define DoWStrTest DoWStrTest_snwprintf_s -void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) +inline void DoStrTest_snwprintf_s(const WCHAR *formatstr, char *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -40,8 +41,9 @@ void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) param, convertC(formatstr), convertC(checkstr), convertC(buf)); } } +#define DoStrTest DoStrTest_snwprintf_s -void DoPointerTest(const WCHAR *formatstr, void* param, const WCHAR *checkstr1) +inline void DoPointerTest_snwprintf_s(const WCHAR *formatstr, void* param, const WCHAR *checkstr1) { WCHAR buf[256] = { 0 }; @@ -53,8 +55,9 @@ void DoPointerTest(const WCHAR *formatstr, void* param, const WCHAR *checkstr1) convertC(checkstr1), convertC(buf)); } } +#define DoPointerTest DoPointerTest_snwprintf_s -void DoCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) +inline void DoCountTest_snwprintf_s(const WCHAR *formatstr, int param, const WCHAR *checkstr) { WCHAR buf[512] = { 0 }; int n = -1; @@ -73,8 +76,9 @@ void DoCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoCountTest DoCountTest_snwprintf_s -void DoShortCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) +inline void DoShortCountTest_snwprintf_s(const WCHAR *formatstr, int param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; short int n = -1; @@ -93,8 +97,9 @@ void DoShortCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoShortCountTest DoShortCountTest_snwprintf_s -void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) +inline void DoCharTest_snwprintf_s(const WCHAR *formatstr, char param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -106,8 +111,9 @@ void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) convertC(formatstr), convertC(checkstr), convertC(buf)); } } +#define DoCharTest DoCharTest_snwprintf_s -void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) +inline void DoWCharTest_snwprintf_s(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -119,8 +125,9 @@ void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) convertC(formatstr), convertC(checkstr), convertC(buf)); } } +#define DoWCharTest DoWCharTest_snwprintf_s -void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) +inline void DoNumTest_snwprintf_s(const WCHAR *formatstr, int value, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -132,9 +139,9 @@ void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoNumTest DoNumTest_snwprintf_s - -void DoI64Test(const WCHAR *formatstr, INT64 param, char *paramdesc, +inline void DoI64Test_snwprintf_s(const WCHAR *formatstr, INT64 param, char *paramdesc, const WCHAR *checkstr1) { WCHAR buf[256] = { 0 }; @@ -147,8 +154,9 @@ void DoI64Test(const WCHAR *formatstr, INT64 param, char *paramdesc, convertC(formatstr), convertC(checkstr1), convertC(buf)); } } +#define DoI64Test DoI64Test_snwprintf_s -void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1, +inline void DoDoubleTest_snwprintf_s(const WCHAR *formatstr, double value, const WCHAR *checkstr1, const WCHAR *checkstr2) { WCHAR buf[256] = { 0 }; @@ -163,8 +171,9 @@ void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1, convertC(checkstr2), convertC(buf)); } } +#define DoDoubleTest DoDoubleTest_snwprintf_s -void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_snwprintf_s(const WCHAR *formatstr, int precision, void *param, char *paramstr, const WCHAR *checkstr1, const WCHAR *checkstr2) { WCHAR buf[256]; @@ -179,8 +188,9 @@ void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, convertC(checkstr1), convertC(checkstr2) ,convertC(buf)); } } +#define DoArgumentPrecTest DoArgumentPrecTest_snwprintf_s -void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_snwprintf_s(const WCHAR *formatstr, int precision, double param, const WCHAR *checkstr) { WCHAR buf[256]; @@ -193,6 +203,7 @@ void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double para precision, convertC(checkstr), convertC(buf)); } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_snwprintf_s #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/CMakeLists.txt deleted file mode 100644 index 9650c18970a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_snwprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test1 coreclrpal) - -target_link_libraries(paltest_snwprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/test1.cpp index 27a6f7ccaf99..07bf99ca6230 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/test1.cpp @@ -19,7 +19,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test1_paltest_snwprintf_test1, "c_runtime/_snwprintf_s/test1/paltest_snwprintf_test1") { WCHAR *checkstr; WCHAR buf[256] = { 0 }; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/testinfo.dat deleted file mode 100644 index 5c5d41c9beb2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test1 -Description -= General test to see if swprintf_s works correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/CMakeLists.txt deleted file mode 100644 index aa799bd52276..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_snwprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test10 coreclrpal) - -target_link_libraries(paltest_snwprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/test10.cpp index c5c9fcd2d114..a872426e23e4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/test10.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test10_paltest_snwprintf_test10, "c_runtime/_snwprintf_s/test10/paltest_snwprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/testinfo.dat deleted file mode 100644 index c84916bba073..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests swprintf_s with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/CMakeLists.txt deleted file mode 100644 index 7e2ef006b6ff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_snwprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test11 coreclrpal) - -target_link_libraries(paltest_snwprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/test11.cpp index d82edff596f0..c05140698c76 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/test11.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test11_paltest_snwprintf_test11, "c_runtime/_snwprintf_s/test11/paltest_snwprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/testinfo.dat deleted file mode 100644 index eb4cbfbda2ba..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests swprintf_s with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/CMakeLists.txt deleted file mode 100644 index e43e34781851..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_snwprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test12 coreclrpal) - -target_link_libraries(paltest_snwprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/test12.cpp index 695275bf3e28..fd898e577e4d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/test12.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test12_paltest_snwprintf_test12, "c_runtime/_snwprintf_s/test12/paltest_snwprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/testinfo.dat deleted file mode 100644 index b2d41d2d1d43..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests swprintf_s with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/CMakeLists.txt deleted file mode 100644 index a1bb54ce0130..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_snwprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test13 coreclrpal) - -target_link_libraries(paltest_snwprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/test13.cpp index ce579b154874..2c28531146a3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/test13.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test13_paltest_snwprintf_test13, "c_runtime/_snwprintf_s/test13/paltest_snwprintf_test13") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/testinfo.dat deleted file mode 100644 index 6e0760f01c16..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests swprintf_s with hex numbers (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/CMakeLists.txt deleted file mode 100644 index c6811a57736b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_snwprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test14 coreclrpal) - -target_link_libraries(paltest_snwprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/test14.cpp index 87e44f45fcc9..30475b8ff861 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/test14.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test14_paltest_snwprintf_test14, "c_runtime/_snwprintf_s/test14/paltest_snwprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/testinfo.dat deleted file mode 100644 index 1ac436cb395e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests swprintf_s with exponential format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/CMakeLists.txt deleted file mode 100644 index 2f682050a9d6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_snwprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test15 coreclrpal) - -target_link_libraries(paltest_snwprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/test15.cpp index 58e94f6f73d3..5f52e1bae048 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/test15.cpp @@ -19,7 +19,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test15_paltest_snwprintf_test15, "c_runtime/_snwprintf_s/test15/paltest_snwprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/testinfo.dat deleted file mode 100644 index 654c853070ae..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests swprintf_s with exponential format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/CMakeLists.txt deleted file mode 100644 index f2c44ff154ed..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_snwprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test16 coreclrpal) - -target_link_libraries(paltest_snwprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/test16.cpp index 22ddff25770a..cc4c4f5649b4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/test16.cpp @@ -17,7 +17,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test16_paltest_snwprintf_test16, "c_runtime/_snwprintf_s/test16/paltest_snwprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/testinfo.dat deleted file mode 100644 index 8a0b2e720cdb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests swprintf_s with decimal point format doubles diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/CMakeLists.txt deleted file mode 100644 index 285b75044c71..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_snwprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test17 coreclrpal) - -target_link_libraries(paltest_snwprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/test17.cpp index 8a4d4c2af4b9..d86213f8bec3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/test17.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test17_paltest_snwprintf_test17, "c_runtime/_snwprintf_s/test17/paltest_snwprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/testinfo.dat deleted file mode 100644 index fa7eef03965c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests swprintf_s with compact format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/CMakeLists.txt deleted file mode 100644 index 4b51cbdeba0f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_snwprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test18 coreclrpal) - -target_link_libraries(paltest_snwprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/test18.cpp index d07f8b351a7b..93c17a4cf9ec 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/test18.cpp @@ -19,7 +19,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test18_paltest_snwprintf_test18, "c_runtime/_snwprintf_s/test18/paltest_snwprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/testinfo.dat deleted file mode 100644 index eaa0af13cd65..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests swprintf_s with compact format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/CMakeLists.txt deleted file mode 100644 index 966fbb81a728..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_snwprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test19 coreclrpal) - -target_link_libraries(paltest_snwprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/test19.cpp index 62a55f7b8f4d..eac6828a6301 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/test19.cpp @@ -15,7 +15,7 @@ #include #include "../_snwprintf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test19_paltest_snwprintf_test19, "c_runtime/_snwprintf_s/test19/paltest_snwprintf_test19") { int n = -1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/testinfo.dat deleted file mode 100644 index a18b094dc559..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests swprintf_s with argument specified precision diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/CMakeLists.txt deleted file mode 100644 index b4d384484602..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_snwprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test2 coreclrpal) - -target_link_libraries(paltest_snwprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/test2.cpp index b8c269016861..5d87d8abef8a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/test2.cpp @@ -19,7 +19,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test2_paltest_snwprintf_test2, "c_runtime/_snwprintf_s/test2/paltest_snwprintf_test2") { if (PAL_Initialize(argc, argv) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/testinfo.dat deleted file mode 100644 index f63b59e2929a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests swprintf_s with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/CMakeLists.txt deleted file mode 100644 index 115f0d8c70f7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_snwprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test3 coreclrpal) - -target_link_libraries(paltest_snwprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/test3.cpp index 9439f4c92d28..4eaf305d2094 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/test3.cpp @@ -19,7 +19,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test3_paltest_snwprintf_test3, "c_runtime/_snwprintf_s/test3/paltest_snwprintf_test3") { if (PAL_Initialize(argc, argv) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/testinfo.dat deleted file mode 100644 index 3d707741633c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests swprintf_s with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/CMakeLists.txt deleted file mode 100644 index 27d9761fe670..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_snwprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test4 coreclrpal) - -target_link_libraries(paltest_snwprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/test4.cpp index 18317f107b8c..95224422d1e2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/test4.cpp @@ -19,7 +19,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test4_paltest_snwprintf_test4, "c_runtime/_snwprintf_s/test4/paltest_snwprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/testinfo.dat deleted file mode 100644 index 4b175bd46b83..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests swprintf_s with pointers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/CMakeLists.txt deleted file mode 100644 index 45d428f5a1ee..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_snwprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test6 coreclrpal) - -target_link_libraries(paltest_snwprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/test6.cpp index d30c670f0742..1b2c375905ad 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/test6.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test6_paltest_snwprintf_test6, "c_runtime/_snwprintf_s/test6/paltest_snwprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/testinfo.dat deleted file mode 100644 index aeb753f2dbfa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests swprintf_s with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/CMakeLists.txt deleted file mode 100644 index 09a2acf00f70..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_snwprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test7 coreclrpal) - -target_link_libraries(paltest_snwprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/test7.cpp index f3516b44c351..cca130c14024 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/test7.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test7_paltest_snwprintf_test7, "c_runtime/_snwprintf_s/test7/paltest_snwprintf_test7") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/testinfo.dat deleted file mode 100644 index e145f4b113e7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests swprintf_s with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/CMakeLists.txt deleted file mode 100644 index ab283e6e4229..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_snwprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test8 coreclrpal) - -target_link_libraries(paltest_snwprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/test8.cpp index 3495d2a8c270..c727f7982245 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/test8.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test8_paltest_snwprintf_test8, "c_runtime/_snwprintf_s/test8/paltest_snwprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/testinfo.dat deleted file mode 100644 index ed8ba1174378..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests swprintf_s with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/CMakeLists.txt deleted file mode 100644 index d714bd9665da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_snwprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_snwprintf_test9 coreclrpal) - -target_link_libraries(paltest_snwprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/test9.cpp index 36f14c2a44c9..b523b2886e6c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/test9.cpp @@ -18,7 +18,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__snwprintf_s_test9_paltest_snwprintf_test9, "c_runtime/_snwprintf_s/test9/paltest_snwprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/testinfo.dat deleted file mode 100644 index d5f7922809ba..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf_s -Name = Positive Test for swprintf_s -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests swprintf_s with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/CMakeLists.txt deleted file mode 100644 index 03585f622991..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_stricmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_stricmp_test1 coreclrpal) - -target_link_libraries(paltest_stricmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.cpp index af73788e3b53..c8b1c16b0d4e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.cpp @@ -19,7 +19,7 @@ * Note: The _stricmp is dependent on the LC_CTYPE category of the locale, * and this is ignored by these tests. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__stricmp_test1_paltest_stricmp_test1, "c_runtime/_stricmp/test1/paltest_stricmp_test1") { char *str1 = "foo"; char *str2 = "fOo"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/testinfo.dat deleted file mode 100644 index e3f3fdc903fa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_stricmp/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _stricmp -Name = Positive Test for _stricmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Do a lower case compare. Check two strings, only different because they -= have different capitalization, and they should return 0. Try two strings -= which will return less than 0 (one is smaller than the other). Also try -= the opposite, to get a return value greater than 0. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/CMakeLists.txt deleted file mode 100644 index 6d0e196ec441..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strnicmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_strnicmp_test1 coreclrpal) - -target_link_libraries(paltest_strnicmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.cpp index a2d213359a4d..4954abfb980d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__strnicmp_test1_paltest_strnicmp_test1, "c_runtime/_strnicmp/test1/paltest_strnicmp_test1") { char str1[] = "foo"; char str2[] = "foox"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/testinfo.dat deleted file mode 100644 index 716886c7e2da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = C Runtime -Function = _strnicmp -Name = Test #1 for _strnicmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Take two strings and compare them, giving different lengths. -= Comparing str1 and str2 with str2 length, should return <0 -= Comparing str2 and str1 with str2 length, should return >0 -= Comparing str1 and str2 with str1 lenght, should return 0 -= Bring in str3, which has a capital, but this function is doing a lower -= case compare. Just ensure that two strings which differ only by capitals -= return 0. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/CMakeLists.txt deleted file mode 100644 index b29c7c438bd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/_vsnprintf_s.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/_vsnprintf_s.h index 2d644f963456..ebb1b66bae46 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/_vsnprintf_s.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/_vsnprintf_s.h @@ -14,7 +14,7 @@ #define __STRINGTEST_H__ /* These functions leaks memory a lot. C'est la vie. */ -int Testvsnprintf(char* buf, size_t count, const char* format, ...) +inline int Testvsnprintf(char* buf, size_t count, const char* format, ...) { int retVal; va_list arglist; @@ -27,7 +27,7 @@ int Testvsnprintf(char* buf, size_t count, const char* format, ...) } -void DoStrTest(const char *formatstr, char* param, const char *checkstr) +inline void DoStrTest_vsnprintf_s(const char *formatstr, char* param, const char *checkstr) { char buf[256] = { 0 }; @@ -39,8 +39,9 @@ void DoStrTest(const char *formatstr, char* param, const char *checkstr) param, formatstr, checkstr, buf); } } +#define DoStrTest DoStrTest_vsnprintf_s -void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_vsnprintf_s(const char *formatstr, WCHAR* param, const char *checkstr) { char buf[256] = { 0 }; @@ -52,9 +53,10 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) convertC(param), formatstr, checkstr, buf); } } +#define DoWStrTest DoWStrTest_vsnprintf_s -void DoCharTest(const char *formatstr, char param, const char *checkstr) +inline void DoCharTest_vsnprintf_s(const char *formatstr, char param, const char *checkstr) { char buf[256] = { 0 }; @@ -66,8 +68,9 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr) param, param, formatstr, checkstr, buf); } } +#define DoCharTest DoCharTest_vsnprintf_s -void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_vsnprintf_s(const char *formatstr, WCHAR param, const char *checkstr) { char buf[256] = { 0 }; @@ -79,8 +82,9 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) (char)param, param, formatstr, checkstr, buf); } } +#define DoWCharTest DoWCharTest_vsnprintf_s -void DoNumTest(const char *formatstr, int value, const char *checkstr) +inline void DoNumTest_vsnprintf_s(const char *formatstr, int value, const char *checkstr) { char buf[256] = { 0 }; @@ -92,8 +96,9 @@ void DoNumTest(const char *formatstr, int value, const char *checkstr) value, formatstr, checkstr, buf); } } +#define DoNumTest DoNumTest_vsnprintf_s -void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr) +inline void DoI64Test_vsnprintf_s(const char *formatstr, INT64 value, char *valuestr, const char *checkstr) { char buf[256] = { 0 }; @@ -105,7 +110,9 @@ void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *c valuestr, formatstr, checkstr, buf); } } -void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, char +#define DoI64Test DoI64Test_vsnprintf_s + +inline void DoDoubleTest_vsnprintf_s(const char *formatstr, double value, const char *checkstr1, char *checkstr2) { char buf[256] = { 0 }; @@ -119,5 +126,6 @@ void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, ch value, formatstr, checkstr1, checkstr2, buf); } } +#define DoDoubleTest DoDoubleTest_vsnprintf_s #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/CMakeLists.txt deleted file mode 100644 index ebd4ae1f3570..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_vsnprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test1 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/test1.cpp index 37119ac11e27..a94a7aa8e08e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/test1.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test1_paltest_vsnprintf_test1, "c_runtime/_vsnprintf_s/test1/paltest_vsnprintf_test1") { char checkstr[] = "hello world"; char buf[256] = { 0 }; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/testinfo.dat deleted file mode 100644 index 8afb6aa8bd07..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the _vsnprintf function. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/CMakeLists.txt deleted file mode 100644 index 58ac92e5f669..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_vsnprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test10 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp index dd0eb89b0337..2fcf19765030 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/test10.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test10_paltest_vsnprintf_test10, "c_runtime/_vsnprintf_s/test10/paltest_vsnprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/testinfo.dat deleted file mode 100644 index af151c49530e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test10/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with octal numbers. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/CMakeLists.txt deleted file mode 100644 index e278c6e55130..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_vsnprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test11 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp index ffb8fb029239..3f3ae0386455 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/test11.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test11_paltest_vsnprintf_test11, "c_runtime/_vsnprintf_s/test11/paltest_vsnprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/testinfo.dat deleted file mode 100644 index d1c5c14be03a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test11/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with unsigned numbers. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/CMakeLists.txt deleted file mode 100644 index 5541c2b68721..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_vsnprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test12 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp index b0af9dc01681..621963f2c7f7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/test12.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test12_paltest_vsnprintf_test12, "c_runtime/_vsnprintf_s/test12/paltest_vsnprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/testinfo.dat deleted file mode 100644 index 0fd1c9c1d014..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test12/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with hex numbers (lowercase). -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/CMakeLists.txt deleted file mode 100644 index 1a17849365e8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_vsnprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test13 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp index c029b277cfe6..f053c514a601 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/test13.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test13_paltest_vsnprintf_test13, "c_runtime/_vsnprintf_s/test13/paltest_vsnprintf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/testinfo.dat deleted file mode 100644 index 1e72c5117850..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test13/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with hex numbers (uppercase). -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/CMakeLists.txt deleted file mode 100644 index 831b5f5c1784..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_vsnprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test14 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp index 74994e0ede33..0e08acd6e4e2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/test14.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test14_paltest_vsnprintf_test14, "c_runtime/_vsnprintf_s/test14/paltest_vsnprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/testinfo.dat deleted file mode 100644 index abcbead26d2e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test14/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with exponential format doubles (lowercase). -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/CMakeLists.txt deleted file mode 100644 index 437a16abc36e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_vsnprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test15 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp index e1010894d86f..7850806b292b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/test15.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test15_paltest_vsnprintf_test15, "c_runtime/_vsnprintf_s/test15/paltest_vsnprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/testinfo.dat deleted file mode 100644 index 6e2e53c902df..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test15/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with exponential format doubles (uppercase). -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/CMakeLists.txt deleted file mode 100644 index 991e9f1553e1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_vsnprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test16 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp index 8d71d155e50b..5892a0c01d84 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/test16.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test16_paltest_vsnprintf_test16, "c_runtime/_vsnprintf_s/test16/paltest_vsnprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/testinfo.dat deleted file mode 100644 index 5738e44f8f20..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test16/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with decimal point format doubles. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/CMakeLists.txt deleted file mode 100644 index 381620edae17..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_vsnprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test17 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp index 658fb109add7..0522158f736b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/test17.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test17_paltest_vsnprintf_test17, "c_runtime/_vsnprintf_s/test17/paltest_vsnprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/testinfo.dat deleted file mode 100644 index 34d783aaf935..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test17/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with compact format doubles (lowercase). -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/CMakeLists.txt deleted file mode 100644 index ebaa8963c383..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_vsnprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test18 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp index 0fc57a75f15b..27566712c094 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/test18.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test18_paltest_vsnprintf_test18, "c_runtime/_vsnprintf_s/test18/paltest_vsnprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/testinfo.dat deleted file mode 100644 index cd04495f958e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test18/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with compact format doubles (uppercase). -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/CMakeLists.txt deleted file mode 100644 index cd9a2ba7d1b8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_vsnprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test19 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/test19.cpp index 9b2227ea0596..731dfe0bb5d5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/test19.cpp @@ -53,7 +53,7 @@ void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param, -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test19_paltest_vsnprintf_test19, "c_runtime/_vsnprintf_s/test19/paltest_vsnprintf_test19") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/testinfo.dat deleted file mode 100644 index 73c4a9d0e3ec..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test19/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with argument specified precision. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/CMakeLists.txt deleted file mode 100644 index c44669c8714e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_vsnprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test2 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp index f23d4c9f932f..b9fe80c76359 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/test2.cpp @@ -16,7 +16,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test2_paltest_vsnprintf_test2, "c_runtime/_vsnprintf_s/test2/paltest_vsnprintf_test2") { WCHAR szwStr[] = {'b','a','r','\0'}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/testinfo.dat deleted file mode 100644 index 6e79fd7692d1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with strings. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/CMakeLists.txt deleted file mode 100644 index 29f08e6c5e1d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_vsnprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test3 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/test3.cpp index ec00c09d9c02..decb64aa3c7f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/test3.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test3_paltest_vsnprintf_test3, "c_runtime/_vsnprintf_s/test3/paltest_vsnprintf_test3") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/testinfo.dat deleted file mode 100644 index 7acd05dcfdf4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with wide strings. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/CMakeLists.txt deleted file mode 100644 index f81e2618e4ed..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_vsnprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test4 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/test4.cpp index 1478dbaab79a..37c4a63f0b61 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/test4.cpp @@ -45,7 +45,7 @@ static void DoI64DoubleTest(char *formatstr, INT64 value, char *valuestr, char } } -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test4_paltest_vsnprintf_test4, "c_runtime/_vsnprintf_s/test4/paltest_vsnprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/testinfo.dat deleted file mode 100644 index 8e63da1a8d21..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with pointers. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/CMakeLists.txt deleted file mode 100644 index cdd8b82d0f56..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_vsnprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test6 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp index 1482bc722d57..88a1fa1bee9c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/test6.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test6_paltest_vsnprintf_test6, "c_runtime/_vsnprintf_s/test6/paltest_vsnprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/testinfo.dat deleted file mode 100644 index 9611f432d3e7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test6/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with characters. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/CMakeLists.txt deleted file mode 100644 index d28f93823060..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_vsnprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test7 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/test7.cpp index f56aa497e92e..87ac8d4994fa 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/test7.cpp @@ -17,7 +17,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test7_paltest_vsnprintf_test7, "c_runtime/_vsnprintf_s/test7/paltest_vsnprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/testinfo.dat deleted file mode 100644 index 2eea64b74ac2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test7/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with wide characters. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/CMakeLists.txt deleted file mode 100644 index 39ea287c434b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_vsnprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test8 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp index 073be3fc0299..beb5420d8d4d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/test8.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test8_paltest_vsnprintf_test8, "c_runtime/_vsnprintf_s/test8/paltest_vsnprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/testinfo.dat deleted file mode 100644 index 691c02d3b128..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test8/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with decimal numbers. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/CMakeLists.txt deleted file mode 100644 index 9eb5316ae8ec..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_vsnprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_vsnprintf_test9 coreclrpal) - -target_link_libraries(paltest_vsnprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp index f8afbe0409a6..b84c24e509b6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/test9.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnprintf_s_test9_paltest_vsnprintf_test9, "c_runtime/_vsnprintf_s/test9/paltest_vsnprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/testinfo.dat deleted file mode 100644 index 03141bca19db..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnprintf_s/test9/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnprintf -Name = Positive Test for _vsnprintf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests the PAL implementation of the _vsnprintf function. -= Tests _vsnprintf with integer numbers. -= This test is modeled after sprintf_s. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/CMakeLists.txt deleted file mode 100644 index b29c7c438bd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/_vsnwprintf_s.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/_vsnwprintf_s.h index 657fbd948ef1..6b230412a27f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/_vsnwprintf_s.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/_vsnwprintf_s.h @@ -14,7 +14,7 @@ #define ___VSNWPRINTF_H__ /* These functions leaks memory a lot. C'est la vie. */ -int TestVsnwprintf_s(char16_t* buf, size_t count, const char16_t* format, ...) +inline int TestVsnwprintf_s(char16_t* buf, size_t count, const char16_t* format, ...) { int retVal = 0; va_list arglist; @@ -26,8 +26,7 @@ int TestVsnwprintf_s(char16_t* buf, size_t count, const char16_t* format, ...) return( retVal); } - -void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) +inline void DoWStrTest_vsnwprintf_s(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -41,8 +40,9 @@ void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoWStrTest DoWStrTest_vsnwprintf_s -void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) +inline void DoStrTest_vsnwprintf_s(const WCHAR *formatstr, char *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -56,8 +56,9 @@ void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) convertC(buf)); } } +#define DoStrTest DoStrTest_vsnwprintf_s -void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) +inline void DoCharTest_vsnwprintf_s(const WCHAR *formatstr, char param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -70,8 +71,9 @@ void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) convertC(buf)); } } +#define DoCharTest DoCharTest_vsnwprintf_s -void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) +inline void DoWCharTest_vsnwprintf_s(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -84,8 +86,9 @@ void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoWCharTest DoWCharTest_vsnwprintf_s -void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) +inline void DoNumTest_vsnwprintf_s(const WCHAR *formatstr, int value, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -97,8 +100,9 @@ void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoNumTest DoNumTest_vsnwprintf_s -void DoI64NumTest(const WCHAR *formatstr, INT64 value, char *valuestr, const WCHAR *checkstr) +inline void DoI64NumTest_vsnwprintf_s(const WCHAR *formatstr, INT64 value, char *valuestr, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -110,7 +114,9 @@ void DoI64NumTest(const WCHAR *formatstr, INT64 value, char *valuestr, const WCH convertC(checkstr), convertC(buf)); } } -void DoDoubleTest(const WCHAR *formatstr, double value, +#define DoI64NumTest DoI64NumTest_vsnwprintf_s + +inline void DoDoubleTest_vsnwprintf_s(const WCHAR *formatstr, double value, const WCHAR *checkstr1, const WCHAR *checkstr2) { WCHAR buf[256] = { 0 }; @@ -128,5 +134,6 @@ void DoDoubleTest(const WCHAR *formatstr, double value, convertC(buf)); } } +#define DoDoubleTest DoDoubleTest_vsnwprintf_s #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/CMakeLists.txt deleted file mode 100644 index de610ede2f53..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_vsnwprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test1 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/test1.cpp index 1a70f3c95bc4..970a099d80cb 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/test1.cpp @@ -17,7 +17,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test1_paltest_vsnwprintf_test1, "c_runtime/_vsnwprintf_s/test1/paltest_vsnwprintf_test1") { WCHAR *checkstr; WCHAR buf[256] = { 0 }; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/testinfo.dat deleted file mode 100644 index a96b906db649..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= General test to see if _vsnwprintf_s works correctly. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/CMakeLists.txt deleted file mode 100644 index d67ddba72496..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_vsnwprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test10 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/test10.cpp index 38df25d6aafe..e4edbb8c5273 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/test10.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test10_paltest_vsnwprintf_test10, "c_runtime/_vsnwprintf_s/test10/paltest_vsnwprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/testinfo.dat deleted file mode 100644 index 100bc35dcc25..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with octal numbers. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/CMakeLists.txt deleted file mode 100644 index f237ff3ed949..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_vsnwprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test11 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/test11.cpp index c3d0c5e2efcf..fd3f5bf9f994 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/test11.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test11_paltest_vsnwprintf_test11, "c_runtime/_vsnwprintf_s/test11/paltest_vsnwprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/testinfo.dat deleted file mode 100644 index 15c728006029..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with unsigned numbers. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/CMakeLists.txt deleted file mode 100644 index 6f2b3dad1654..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_vsnwprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test12 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/test12.cpp index b2f989f405bb..d2e6d547ea64 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/test12.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test12_paltest_vsnwprintf_test12, "c_runtime/_vsnwprintf_s/test12/paltest_vsnwprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/testinfo.dat deleted file mode 100644 index 581702733687..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with hex numbers (lowercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/CMakeLists.txt deleted file mode 100644 index b5e07b3962a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_vsnwprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test13 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/test13.cpp index a505316da632..64f89cd57149 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/test13.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test13_paltest_vsnwprintf_test13, "c_runtime/_vsnwprintf_s/test13/paltest_vsnwprintf_test13") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/testinfo.dat deleted file mode 100644 index 3c689872d099..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with hex numbers (uppercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/CMakeLists.txt deleted file mode 100644 index 77592622ffa3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_vsnwprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test14 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/test14.cpp index e5b14b24d004..8fca1904231c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/test14.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test14_paltest_vsnwprintf_test14, "c_runtime/_vsnwprintf_s/test14/paltest_vsnwprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/testinfo.dat deleted file mode 100644 index bc7c6aecee79..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with exponential format doubles (lowercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/CMakeLists.txt deleted file mode 100644 index bceb26c2cdf1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_vsnwprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test15 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/test15.cpp index a61648d43d3e..9fe695ae86ca 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/test15.cpp @@ -17,7 +17,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test15_paltest_vsnwprintf_test15, "c_runtime/_vsnwprintf_s/test15/paltest_vsnwprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/testinfo.dat deleted file mode 100644 index b5f6a0e40101..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with exponential format doubles (uppercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/CMakeLists.txt deleted file mode 100644 index fb0c75e66bbb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_vsnwprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test16 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/test16.cpp index 4cc272b478ae..ac20afefb22d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/test16.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test16_paltest_vsnwprintf_test16, "c_runtime/_vsnwprintf_s/test16/paltest_vsnwprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/testinfo.dat deleted file mode 100644 index 17bbd3f69629..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with decimal point format doubles. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/CMakeLists.txt deleted file mode 100644 index 41e35b4b866a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_vsnwprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test17 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/test17.cpp index 41edb8f05180..d4317b17c174 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/test17.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test17_paltest_vsnwprintf_test17, "c_runtime/_vsnwprintf_s/test17/paltest_vsnwprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/testinfo.dat deleted file mode 100644 index e8ca626f7934..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with compact format doubles (lowercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/CMakeLists.txt deleted file mode 100644 index 0c99b5576387..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_vsnwprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test18 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/test18.cpp index fdac25414a56..7ae932f57d79 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/test18.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test18_paltest_vsnwprintf_test18, "c_runtime/_vsnwprintf_s/test18/paltest_vsnwprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/testinfo.dat deleted file mode 100644 index be1034930430..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with compact format doubles (uppercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/CMakeLists.txt deleted file mode 100644 index f4b0562b3fab..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_vsnwprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test19 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/test19.cpp index dcb6d758e319..158ff1a644e0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/test19.cpp @@ -18,7 +18,7 @@ #define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e) -void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param, +void DoArgumentPrecTest_vsnwprintf_s(WCHAR *formatstr, int precision, void *param, WCHAR *paramstr, WCHAR *checkstr1, WCHAR *checkstr2) { WCHAR buf[256]; @@ -37,7 +37,7 @@ void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param, convertC(buf)); } } -void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param, +void DoArgumentPrecDoubleTest_vsnwprintf_s(WCHAR *formatstr, int precision, double param, WCHAR *checkstr1, WCHAR *checkstr2) { WCHAR buf[256]; @@ -60,7 +60,7 @@ void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param, * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test19_paltest_vsnwprintf_test19, "c_runtime/_vsnwprintf_s/test19/paltest_vsnwprintf_test19") { if (PAL_Initialize(argc, argv) != 0) @@ -68,69 +68,69 @@ int __cdecl main(int argc, char *argv[]) return(FAIL); } - DoArgumentPrecTest(convert("%.*s"), 2, (void*)convert("bar"), convert("bar"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*s"), 2, (void*)convert("bar"), convert("bar"), convert("ba"), convert("ba")); - DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', convert("a"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*c"), 0, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', convert("a"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*c"), 4, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', convert("a"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*C"), 0, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', convert("a"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*C"), 4, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, convert("42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*d"), 1, (void*)42, convert("42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, convert("42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*d"), 3, (void*)42, convert("42"), convert("042"), convert("042")); - DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, convert("42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*i"), 1, (void*)42, convert("42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, convert("42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*i"), 3, (void*)42, convert("42"), convert("042"), convert("042")); - DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, convert("42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*o"), 1, (void*)42, convert("42"), convert("52"), convert("52")); - DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, convert("42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*o"), 3, (void*)42, convert("42"), convert("052"), convert("052")); - DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, convert("42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*u"), 1, (void*)42, convert("42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, convert("42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*u"), 3, (void*)42, convert("42"), convert("042"), convert("042")); - DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*x"), 1, (void*)0x42, convert("0x42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*x"), 3, (void*)0x42, convert("0x42"), convert("042"), convert("042")); - DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*X"), 1, (void*)0x42, convert("0x42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vsnwprintf_s(convert("%.*X"), 3, (void*)0x42, convert("0x42"), convert("042"), convert("042")); - DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*e"), 1, 2.01, convert("2.0e+000"), convert("2.0e+00")); - DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*e"), 3, 2.01, convert("2.010e+000"), convert("2.010e+00")); - DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*E"), 1, 2.01, convert("2.0E+000"), convert("2.0E+00")); - DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*E"), 3, 2.01, convert("2.010E+000"), convert("2.010E+00")); - DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*f"), 1, 2.01, convert("2.0"), convert("2.0")); - DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*f"), 3, 2.01, convert("2.010"), convert("2.010")); - DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*g"), 1, 256.01, convert("3e+002"), convert("3e+02")); - DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*g"), 3, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*g"), 4, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*g"), 6, 256.01, convert("256.01"), convert("256.01")); - DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*G"), 1, 256.01, convert("3E+002"), convert("3E+02")); - DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*G"), 3, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*G"), 4, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"), + DoArgumentPrecDoubleTest_vsnwprintf_s(convert("%.*G"), 6, 256.01, convert("256.01"), convert("256.01")); PAL_Terminate(); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/testinfo.dat deleted file mode 100644 index ef3e466d6c1e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with argument specified precision. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/CMakeLists.txt deleted file mode 100644 index d2838142c3cd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_vsnwprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test2 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/test2.cpp index 6f0026ec34a4..ce5a74cc080c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/test2.cpp @@ -17,7 +17,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test2_paltest_vsnwprintf_test2, "c_runtime/_vsnwprintf_s/test2/paltest_vsnwprintf_test2") { if (PAL_Initialize(argc, argv) != 0) return(FAIL); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/testinfo.dat deleted file mode 100644 index 9d30e1c586de..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with strings. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/CMakeLists.txt deleted file mode 100644 index 8c2c5c954fcd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_vsnwprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test3 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/test3.cpp index e238a35194d0..30aa2d87c5e3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/test3.cpp @@ -17,7 +17,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test3_paltest_vsnwprintf_test3, "c_runtime/_vsnwprintf_s/test3/paltest_vsnwprintf_test3") { if (PAL_Initialize(argc, argv) != 0) return(FAIL); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/testinfo.dat deleted file mode 100644 index 22e9b85ee0ea..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with wide strings. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/CMakeLists.txt deleted file mode 100644 index eafb0796099a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_vsnwprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test4 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/test4.cpp index fa553982b931..1caa4829db0a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/test4.cpp @@ -50,7 +50,7 @@ static void DoI64DoubleTest(WCHAR *formatstr, INT64 value, WCHAR *valuestr, } } -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test4_paltest_vsnwprintf_test4, "c_runtime/_vsnwprintf_s/test4/paltest_vsnwprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/testinfo.dat deleted file mode 100644 index 991a73ce90a2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with pointers. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/CMakeLists.txt deleted file mode 100644 index 98faea5200ee..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_vsnwprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test6 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/test6.cpp index 79335d0b2d22..cc0faddf7180 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/test6.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test6_paltest_vsnwprintf_test6, "c_runtime/_vsnwprintf_s/test6/paltest_vsnwprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/testinfo.dat deleted file mode 100644 index c93821024e66..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with characters. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/CMakeLists.txt deleted file mode 100644 index d36a9ff26aab..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_vsnwprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test7 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/test7.cpp index 898f3f0f411f..d31e77bb322b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/test7.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test7_paltest_vsnwprintf_test7, "c_runtime/_vsnwprintf_s/test7/paltest_vsnwprintf_test7") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/testinfo.dat deleted file mode 100644 index 3b36ecec6a60..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with wide characters. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/CMakeLists.txt deleted file mode 100644 index 0c0440d35426..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_vsnwprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test8 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/test8.cpp index 9bf5f6c37c95..e26b49ab8d63 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/test8.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test8_paltest_vsnwprintf_test8, "c_runtime/_vsnwprintf_s/test8/paltest_vsnwprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/testinfo.dat deleted file mode 100644 index c09cdac6277b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with decimal numbers. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/CMakeLists.txt deleted file mode 100644 index e8117b5bde57..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_vsnwprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_vsnwprintf_test9 coreclrpal) - -target_link_libraries(paltest_vsnwprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/test9.cpp index f3cfb5dbb79b..12e8c46aa554 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/test9.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__vsnwprintf_s_test9_paltest_vsnwprintf_test9, "c_runtime/_vsnwprintf_s/test9/paltest_vsnwprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/testinfo.dat deleted file mode 100644 index a166a92cc7f0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _vsnwprintf_s -Name = Positive Test for _vsnwprintf_s -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests the PAL implementation of the _vsnwprintf_s function. -= Tests _vsnwprintf_s with integer numbers -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/CMakeLists.txt deleted file mode 100644 index b3f31074d594..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcsicmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcsicmp_test1 coreclrpal) - -target_link_libraries(paltest_wcsicmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.cpp index 3b063b469fdc..54f38f32d482 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.cpp @@ -17,7 +17,7 @@ * Note: The _wcsicmp is dependent on the LC_CTYPE category of the locale, * and this is ignored by these tests. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__wcsicmp_test1_paltest_wcsicmp_test1, "c_runtime/_wcsicmp/test1/paltest_wcsicmp_test1") { WCHAR str1[] = {'f','o','o',0}; WCHAR str2[] = {'f','O','o',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/testinfo.dat deleted file mode 100644 index 0fbf1a06c17a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wcsicmp -Name = Test #1 for _wcsicmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that _wcsicmp correctly compares two strings with case insensitivity. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/CMakeLists.txt deleted file mode 100644 index c2ed3092367e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcslwr_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcslwr_test1 coreclrpal) - -target_link_libraries(paltest_wcslwr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.cpp deleted file mode 100644 index 9426c1eb4334..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: Using memcmp to check the result, convert a wide character string -** with capitals, to all lowercase using this function. Test #1 for the -** wcslwr function -** -** -**==========================================================================*/ - -#include - -/* uses memcmp,wcslen */ - -int __cdecl main(int argc, char *argv[]) -{ - WCHAR *test_str = NULL; - WCHAR *expect_str = NULL; - WCHAR *result_str = NULL; - - /* - * Initialize the PAL and return FAIL if this fails - */ - if (0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - test_str = convert("aSdF 1#"); - expect_str = convert("asdf 1#"); - - result_str = _wcslwr(test_str); - if (memcmp(result_str, expect_str, wcslen(expect_str)*2 + 2) != 0) - { - Fail ("ERROR: Expected to get \"%s\", got \"%s\".\n", - convertC(expect_str), convertC(result_str)); - } - - free(result_str); - free(expect_str); - - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/testinfo.dat deleted file mode 100644 index 3579b4d4a058..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wcslwr -Name = Positive Test for _wcslwr -TYPE = DEFAULT -EXE1 = test1 -Description -= Using memcmp to check the result, convert a wide character string -= with capitals, to all lowercase using this function. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr_s/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr_s/test1/test1.cpp new file mode 100644 index 000000000000..4303e6851f83 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcslwr_s/test1/test1.cpp @@ -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. + +/*============================================================================ +** +** Source: test1.c +** +** Purpose: Using memcmp to check the result, convert a wide character string +** with capitals, to all lowercase using this function. Test #1 for the +** _wcslwr_s function +** +** +**==========================================================================*/ + +#include + +/* uses memcmp,wcslen */ + +PALTEST(c_runtime__wcslwr_s_test1_paltest_wcslwr_s_test1, "c_runtime/_wcslwr_s/test1/paltest_wcslwr_s_test1") +{ + WCHAR *test_str = NULL; + WCHAR *expect_str = NULL; + + /* + * Initialize the PAL and return FAIL if this fails + */ + if (0 != (PAL_Initialize(argc, argv))) + { + return FAIL; + } + + test_str = convert("aSdF 1#"); + expect_str = convert("asdf 1#"); + + errno_t ret = _wcslwr_s(test_str, 8); + if (ret != 0 || memcmp(test_str, expect_str, wcslen(expect_str)*2 + 2) != 0) + { + Fail ("ERROR: Expected to get \"%s\", got \"%s\".\n", + convertC(expect_str), convertC(test_str)); + } + + free(test_str); + free(expect_str); + + PAL_Terminate(); + return PASS; +} + diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/CMakeLists.txt deleted file mode 100644 index 692e0d332c7a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcsnicmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcsnicmp_test1 coreclrpal) - -target_link_libraries(paltest_wcsnicmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.cpp index 05ef6c24df06..052526613273 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.cpp @@ -22,7 +22,7 @@ * Notes: uses wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime__wcsnicmp_test1_paltest_wcsnicmp_test1, "c_runtime/_wcsnicmp/test1/paltest_wcsnicmp_test1") { WCHAR str1[] = {'f','o','o',0}; WCHAR str2[] = {'f','o','o','x',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/testinfo.dat deleted file mode 100644 index 9f3f97a570f6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = C Runtime -Function = _wcsnicmp -Name = Positive Test for _wcsnicmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Take two wide strings and compare them, giving different lengths. -= Comparing str1 and str2 with str2 length, should return <0 -= Comparing str2 and str1 with str2 length, should return >0 -= Comparing str1 and str2 with str1 lenght, should return 0 -= Bring in str3, which has a capital, but this function is doing a lower -= case compare. Just ensure that two strings which differ only by capitals -= return 0. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/CMakeLists.txt deleted file mode 100644 index 7cd88f8e86da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/CMakeLists.txt deleted file mode 100644 index 505ed8461c2c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wfopen_test1 - ${SOURCES} -) - -add_dependencies(paltest_wfopen_test1 coreclrpal) - -target_link_libraries(paltest_wfopen_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.cpp index a13f222fccd5..7b96770bc54a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.cpp @@ -25,7 +25,7 @@ struct testCase WCHAR mode[20]; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__wfopen_test1_paltest_wfopen_test1, "c_runtime/_wfopen/test1/paltest_wfopen_test1") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/testinfo.dat deleted file mode 100644 index 2ca737be79b4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wfopen -Name = Positive Test for _wfopen -TYPE = DEFAULT -EXE1 = test1 -Description -= This test simply attempts to open a number of files with different -= modes. It checks to ensure a valid file pointer is returned. It -= doesn't do any checking to ensure the mode is really what it claims. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/CMakeLists.txt deleted file mode 100644 index 427988b2b6bc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_wfopen_test2 - ${SOURCES} -) - -add_dependencies(paltest_wfopen_test2 coreclrpal) - -target_link_libraries(paltest_wfopen_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.cpp index 6f46cd74e846..ccc1a105502e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.cpp @@ -21,7 +21,7 @@ #define UNICODE #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__wfopen_test2_paltest_wfopen_test2, "c_runtime/_wfopen/test2/paltest_wfopen_test2") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/testinfo.dat deleted file mode 100644 index ab79c00e6d83..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wfopen -Name = Positive Test for _wfopen -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to ensure that you can write to a 'w' mode file. And that you can't -= read from a 'w' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/CMakeLists.txt deleted file mode 100644 index fb3c532ca4e0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_wfopen_test3 - ${SOURCES} -) - -add_dependencies(paltest_wfopen_test3 coreclrpal) - -target_link_libraries(paltest_wfopen_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.cpp index bda512add38a..081f9d9bb964 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.cpp @@ -22,7 +22,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__wfopen_test3_paltest_wfopen_test3, "c_runtime/_wfopen/test3/paltest_wfopen_test3") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/testinfo.dat deleted file mode 100644 index cc8ca9137594..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wfopen -Name = Positive Test for _wfopen -TYPE = DEFAULT -EXE1 = test3 -Description -= Test to ensure that you can write to a 'w+' mode file. And that you can -= read from a 'w+' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/CMakeLists.txt deleted file mode 100644 index 3f7839c2cd14..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_wfopen_test4 - ${SOURCES} -) - -add_dependencies(paltest_wfopen_test4 coreclrpal) - -target_link_libraries(paltest_wfopen_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.cpp index e865cbcb9787..93f137f0a9a8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.cpp @@ -22,7 +22,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__wfopen_test4_paltest_wfopen_test4, "c_runtime/_wfopen/test4/paltest_wfopen_test4") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/testinfo.dat deleted file mode 100644 index 9413f99556d8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test4/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wfopen -Name = Positive Test for _wfopen -TYPE = DEFAULT -EXE1 = test4 -Description -= Test to ensure that you can't write to a 'r' mode file. And that you can -= read from a 'r' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/CMakeLists.txt deleted file mode 100644 index 00e4a074c84b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_wfopen_test5 - ${SOURCES} -) - -add_dependencies(paltest_wfopen_test5 coreclrpal) - -target_link_libraries(paltest_wfopen_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.cpp index 58abf0a5eafb..10839d1c6c9f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.cpp @@ -22,7 +22,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__wfopen_test5_paltest_wfopen_test5, "c_runtime/_wfopen/test5/paltest_wfopen_test5") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/testinfo.dat deleted file mode 100644 index dc3574984454..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test5/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wfopen -Name = Positive Test for _wfopen -TYPE = DEFAULT -EXE1 = test5 -Description -= Test to ensure that you can write to a 'r+' mode file. And that you can -= read from a 'r+' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/CMakeLists.txt deleted file mode 100644 index 1eb7eca3c85e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_wfopen_test6 - ${SOURCES} -) - -add_dependencies(paltest_wfopen_test6 coreclrpal) - -target_link_libraries(paltest_wfopen_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.cpp index c64c4a0a9c21..269ca1f5cc1a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.cpp @@ -20,7 +20,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__wfopen_test6_paltest_wfopen_test6, "c_runtime/_wfopen/test6/paltest_wfopen_test6") { FILE *fp; char buffer[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/testinfo.dat deleted file mode 100644 index 4201a2e168da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test6/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wfopen -Name = Positive Test for _wfopen -TYPE = DEFAULT -EXE1 = test6 -Description -= Test to ensure that you can write to a 'a' mode file. And that you can't -= read from a 'a' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/CMakeLists.txt deleted file mode 100644 index 9afa9976119f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_wfopen_test7 - ${SOURCES} -) - -add_dependencies(paltest_wfopen_test7 coreclrpal) - -target_link_libraries(paltest_wfopen_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.cpp index 7f13df415238..419707a13acd 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.cpp @@ -21,7 +21,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__wfopen_test7_paltest_wfopen_test7, "c_runtime/_wfopen/test7/paltest_wfopen_test7") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/testinfo.dat deleted file mode 100644 index 33d6252de83a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wfopen/test7/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wfopen -Name = Positive Test for _wfopen -TYPE = DEFAULT -EXE1 = test7 -Description -= Test to ensure that you can write to a 'a+' mode file. And that you can -= read from a 'a+' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/CMakeLists.txt deleted file mode 100644 index a7243e7d51b2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wtoi_test1 - ${SOURCES} -) - -add_dependencies(paltest_wtoi_test1 coreclrpal) - -target_link_libraries(paltest_wtoi_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.cpp index 0829af706060..3d0ff1f5ed26 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.cpp @@ -24,7 +24,7 @@ struct testCase char avalue[20]; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime__wtoi_test1_paltest_wtoi_test1, "c_runtime/_wtoi/test1/paltest_wtoi_test1") { int result=0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/testinfo.dat deleted file mode 100644 index 5d2801d5d1f9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/_wtoi/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = _wtoi -Name = Test _wtoi on valid and invalid ints in a variety of formats -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the _wtoi function. -= Check to ensure that the different ints are handled properly. -= Exponents and decimals should be treated as invalid characters, -= causing the conversion to quit. Whitespace before the int is valid. -= Check would-be octal/hex digits to ensure they're treated no -= differently than other strings. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/CMakeLists.txt deleted file mode 100644 index 89bccbbe69b9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - abs.cpp -) - -add_executable(paltest_abs_test1 - ${SOURCES} -) - -add_dependencies(paltest_abs_test1 coreclrpal) - -target_link_libraries(paltest_abs_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/abs.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/abs.cpp index b567c37a93d3..9ad83d64e3a7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/abs.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/abs.cpp @@ -18,7 +18,7 @@ struct TESTS int nResult; }; -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_abs_test1_paltest_abs_test1, "c_runtime/abs/test1/paltest_abs_test1") { int i = 0; int nRc = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/testinfo.dat deleted file mode 100644 index 1719a0c55056..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/abs/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C runtime -Function = abs -Name = test for abs (test 1) -Type = DEFAULT -EXE1 = abs -Description -= Test abs by passing a list of values and ensuring the -= proper absolute value is returned. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/CMakeLists.txt deleted file mode 100644 index e654dc3ab29f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_acos_test1 - ${SOURCES} -) - -add_dependencies(paltest_acos_test1 coreclrpal) - -target_link_libraries(paltest_acos_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/test1.cpp index 4c6cceb4d1c4..5de46458e505 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * acos_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl acos_test1_validate(double value, double expected, double variance) { double result = acos(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * acos_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl acos_test1_validate_isnan(double value) { double result = acos(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_acos_test1_paltest_acos_test1, "c_runtime/acos/test1/paltest_acos_test1") { struct test tests[] = { @@ -117,12 +117,12 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected, tests[i].variance); + acos_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); + acos_test1_validate_isnan(PAL_NEGINF); + acos_test1_validate_isnan(PAL_NAN); + acos_test1_validate_isnan(PAL_POSINF); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/testinfo.dat deleted file mode 100644 index 877437d8f390..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acos/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = acos -Name = Positive Test for acos -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the acos() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/CMakeLists.txt deleted file mode 100644 index 2952068d8163..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_acosf_test1 - ${SOURCES} -) - -add_dependencies(paltest_acosf_test1 coreclrpal) - -target_link_libraries(paltest_acosf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.c deleted file mode 100644 index 8d612ab40d1d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.c +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that acosf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = acosf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("acosf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = acosf(value); - - if (!_isnanf(result)) - { - Fail("acosf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { -1, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi - { -0.911733915f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { -0.668201510f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) - { 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { 0.127751218f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 0.155943695f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 0.428125148f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 0.540302306f, 1, PAL_EPSILON * 10 }, - { 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2) - { 0.760244597f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 0.769238901f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 0.804109828f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 0.907167129f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e) - { 0.949765715f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 1, 0, PAL_EPSILON }, - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.cpp new file mode 100644 index 000000000000..909d43cab78a --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.cpp @@ -0,0 +1,128 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that acosf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * acosf_test1_validate + * + * test validation function + */ +void __cdecl acosf_test1_validate(float value, float expected, float variance) +{ + float result = acosf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("acosf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * acosf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl acosf_test1_validate_isnan(float value) +{ + float result = acosf(value); + + if (!_isnanf(result)) + { + Fail("acosf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_acosf_test1_paltest_acosf_test1, "c_runtime/acosf/test1/paltest_acosf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { -1, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi + { -0.911733915f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { -0.668201510f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) + { 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { 0.127751218f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 0.155943695f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 0.428125148f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 0.540302306f, 1, PAL_EPSILON * 10 }, + { 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2) + { 0.760244597f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 0.769238901f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 0.804109828f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 0.907167129f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e) + { 0.949765715f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 1, 0, PAL_EPSILON }, + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + acosf_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + } + + acosf_test1_validate_isnan(PAL_NEGINF); + acosf_test1_validate_isnan(PAL_NAN); + acosf_test1_validate_isnan(PAL_POSINF); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/testinfo.dat deleted file mode 100644 index de8fedaed3cc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = acosf -Name = Positive Test for acosf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the acosf() function, -= checking each for the expfected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/CMakeLists.txt deleted file mode 100644 index dfd040565bf4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_acosh_test1 - ${SOURCES} -) - -add_dependencies(paltest_acosh_test1 coreclrpal) - -target_link_libraries(paltest_acosh_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/test1.cpp index 4ffa84211fdf..3d9368fcd94f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * acosh_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl acosh_test1_validate(double value, double expected, double variance) { double result = acosh(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * acosh_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl acosh_test1_validate_isnan(double value) { double result = acosh(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_acosh_test1_paltest_acosh_test1, "c_runtime/acosh/test1/paltest_acosh_test1") { struct test tests[] = { @@ -118,10 +118,10 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected, tests[i].variance); + acosh_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + acosh_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/testinfo.dat deleted file mode 100644 index e20077a9a89e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acosh/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = acosh -Name = Positive Test for acosh -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the acosh() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/CMakeLists.txt deleted file mode 100644 index 3b692e358448..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_acoshf_test1 - ${SOURCES} -) - -add_dependencies(paltest_acoshf_test1 coreclrpal) - -target_link_libraries(paltest_acoshf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/test1.c deleted file mode 100644 index 6f6b7f59a869..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/test1.c +++ /dev/null @@ -1,127 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that acoshf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = acoshf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("acoshf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = acoshf(value); - - if (!_isnanf(result)) - { - Fail("acoshf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 1, 0, PAL_EPSILON }, - { 1.05108979f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 1.09579746f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) - { 1.20957949f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 1.25f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 1.26059184f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 1.32460909f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { 1.54308063f, 1, PAL_EPSILON * 10 }, - { 1.70710014f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 2.17818356f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 2.23418810f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 2.50917848f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { 5.05f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) - { 7.61012514f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { 11.5919533f, 3.14159265f, PAL_EPSILON * 100 }, // expected: pi - { PAL_POSINF, PAL_POSINF, 0 }, - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/test1.cpp new file mode 100644 index 000000000000..78bab37dbf37 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/test1.cpp @@ -0,0 +1,127 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that acoshf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * acoshf_test1_validate + * + * test validation function + */ +void __cdecl acoshf_test1_validate(float value, float expected, float variance) +{ + float result = acoshf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("acoshf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * acoshf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl acoshf_test1_validate_isnan(float value) +{ + float result = acoshf(value); + + if (!_isnanf(result)) + { + Fail("acoshf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_acoshf_test1_paltest_acoshf_test1, "c_runtime/acoshf/test1/paltest_acoshf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 1, 0, PAL_EPSILON }, + { 1.05108979f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 1.09579746f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) + { 1.20957949f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 1.25f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 1.26059184f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 1.32460909f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { 1.54308063f, 1, PAL_EPSILON * 10 }, + { 1.70710014f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 2.17818356f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 2.23418810f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 2.50917848f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { 5.05f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) + { 7.61012514f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { 11.5919533f, 3.14159265f, PAL_EPSILON * 100 }, // expected: pi + { PAL_POSINF, PAL_POSINF, 0 }, + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + acoshf_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + } + + acoshf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/testinfo.dat deleted file mode 100644 index c6968845412d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/acoshf/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = acoshf -Name = Positive Test for acoshf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the acoshf() function, -= checking each for the expfected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/CMakeLists.txt deleted file mode 100644 index 92ba84512d81..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_asin_test1 - ${SOURCES} -) - -add_dependencies(paltest_asin_test1 coreclrpal) - -target_link_libraries(paltest_asin_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/test1.cpp index 4c1856721318..b72599ad33d3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * asin_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl asin_test1_validate(double value, double expected, double variance) { double result = asin(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * asin_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl asin_test1_validate_isnan(double value) { double result = asin(value); @@ -83,11 +83,11 @@ void __cdecl validate_isnan(double value) } /** - * validate + * asin_test1_validate * * test validation function for values returning +INF */ -void __cdecl validate_isinf_positive(double value) +void __cdecl asin_test1_validate_isinf_positive(double value) { double result = asin(value); @@ -103,7 +103,7 @@ void __cdecl validate_isinf_positive(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_asin_test1_paltest_asin_test1, "c_runtime/asin/test1/paltest_asin_test1") { struct test tests[] = { @@ -132,13 +132,13 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + asin_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + asin_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); + asin_test1_validate_isnan(PAL_NEGINF); + asin_test1_validate_isnan(PAL_NAN); + asin_test1_validate_isnan(PAL_POSINF); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/testinfo.dat deleted file mode 100644 index 54b0ac574daf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asin/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = asin -Name = Positive Test for asin -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the asin() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/CMakeLists.txt deleted file mode 100644 index 178bbe75933d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_asinf_test1 - ${SOURCES} -) - -add_dependencies(paltest_asinf_test1 coreclrpal) - -target_link_libraries(paltest_asinf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.c deleted file mode 100644 index e249cb7f1e4a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.c +++ /dev/null @@ -1,144 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that asinf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = asinf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("asinf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = asinf(value); - - if (!_isnanf(result)) - { - Fail("asinf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * validate - * - * test validation function for values returning +INF - */ -void __cdecl validate_isinf_positive(float value) -{ - float result = asinf(value); - - if (result != PAL_POSINF) - { - Fail("asinf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_POSINF); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 0, PAL_EPSILON }, - { 0.312961796f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 0.410781291f, 0.423310825f, PAL_EPSILON }, // expected: pi - e - { 0.420770483f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e) - { 0.594480769f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 0.638961276f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 0.649636939f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2) - { 0.743980337f, 0.839007561f, PAL_EPSILON }, // expected: pi - ln(10) - { 0.841470985f, 1, PAL_EPSILON * 10 }, - { 0.903719457f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 0.987765946f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 0.991806244f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 1, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.cpp new file mode 100644 index 000000000000..abf35c261851 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.cpp @@ -0,0 +1,144 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that asinf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * asinf_test1_validate + * + * test validation function + */ +void __cdecl asinf_test1_validate(float value, float expected, float variance) +{ + float result = asinf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("asinf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * asinf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl asinf_test1_validate_isnan(float value) +{ + float result = asinf(value); + + if (!_isnanf(result)) + { + Fail("asinf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * asinf_test1_validate + * + * test validation function for values returning +INF + */ +void __cdecl asinf_test1_validate_isinf_positive(float value) +{ + float result = asinf(value); + + if (result != PAL_POSINF) + { + Fail("asinf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_POSINF); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_asinf_test1_paltest_asinf_test1, "c_runtime/asinf/test1/paltest_asinf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 0, PAL_EPSILON }, + { 0.312961796f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 0.410781291f, 0.423310825f, PAL_EPSILON }, // expected: pi - e + { 0.420770483f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e) + { 0.594480769f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 0.638961276f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 0.649636939f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2) + { 0.743980337f, 0.839007561f, PAL_EPSILON }, // expected: pi - ln(10) + { 0.841470985f, 1, PAL_EPSILON * 10 }, + { 0.903719457f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 0.987765946f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 0.991806244f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 1, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + asinf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + asinf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + asinf_test1_validate_isnan(PAL_NEGINF); + asinf_test1_validate_isnan(PAL_NAN); + asinf_test1_validate_isnan(PAL_POSINF); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/testinfo.dat deleted file mode 100644 index 2e6622d7a551..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinf/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = asinf -Name = Positive Test for asinf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the asinf() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/CMakeLists.txt deleted file mode 100644 index c1b9f952f882..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_asinh_test1 - ${SOURCES} -) - -add_dependencies(paltest_asinh_test1 coreclrpal) - -target_link_libraries(paltest_asinh_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/test1.cpp index 28304f108d47..a0ed7953d2ed 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * asinh_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl asinh_test1_validate(double value, double expected, double variance) { double result = asinh(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * asinh_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl asinh_test1_validate_isnan(double value) { double result = asinh(value); @@ -83,11 +83,11 @@ void __cdecl validate_isnan(double value) } /** - * validate + * asinh_test1_validate * * test validation function for values returning +INF */ -void __cdecl validate_isinf_positive(double value) +void __cdecl asinh_test1_validate_isinf_positive(double value) { double result = asinh(value); @@ -103,7 +103,7 @@ void __cdecl validate_isinf_positive(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_asinh_test1_paltest_asinh_test1, "c_runtime/asinh/test1/paltest_asinh_test1") { struct test tests[] = { @@ -134,11 +134,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + asinh_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + asinh_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + asinh_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/testinfo.dat deleted file mode 100644 index 871186907070..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinh/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = asinh -Name = Positive Test for asinh -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the asinh() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/CMakeLists.txt deleted file mode 100644 index 92df683b802b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_asinhf_test1 - ${SOURCES} -) - -add_dependencies(paltest_asinhf_test1 coreclrpal) - -target_link_libraries(paltest_asinhf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/test1.c deleted file mode 100644 index d052781e5849..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/test1.c +++ /dev/null @@ -1,144 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that asinhf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = asinhf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("asinhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = asinhf(value); - - if (!_isnanf(result)) - { - Fail("asinhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * validate - * - * test validation function for values returning +INF - */ -void __cdecl validate_isinf_positive(float value) -{ - float result = asinhf(value); - - if (result != PAL_POSINF) - { - Fail("asinhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_POSINF); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 0, PAL_EPSILON }, - { 0.323712439f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 0.448075979f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) - { 0.680501678f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 0.75, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 0.767523145f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 0.868670961f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { 1.17520119f, 1, PAL_EPSILON * 10 }, - { 1.38354288f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 1.93506682f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 1.99789801f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 2.30129890f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { 4.95f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) - { 7.54413710f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { 11.5487394f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi - { PAL_POSINF, PAL_POSINF, 0 }, - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/test1.cpp new file mode 100644 index 000000000000..eb2af42b98c7 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/test1.cpp @@ -0,0 +1,144 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that asinhf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * asinhf_test1_validate + * + * test validation function + */ +void __cdecl asinhf_test1_validate(float value, float expected, float variance) +{ + float result = asinhf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("asinhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * asinhf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl asinhf_test1_validate_isnan(float value) +{ + float result = asinhf(value); + + if (!_isnanf(result)) + { + Fail("asinhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * asinhf_test1_validate + * + * test validation function for values returning +INF + */ +void __cdecl asinhf_test1_validate_isinf_positive(float value) +{ + float result = asinhf(value); + + if (result != PAL_POSINF) + { + Fail("asinhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_POSINF); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_asinhf_test1_paltest_asinhf_test1, "c_runtime/asinhf/test1/paltest_asinhf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 0, PAL_EPSILON }, + { 0.323712439f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 0.448075979f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) + { 0.680501678f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 0.75, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 0.767523145f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 0.868670961f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { 1.17520119f, 1, PAL_EPSILON * 10 }, + { 1.38354288f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 1.93506682f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 1.99789801f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 2.30129890f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { 4.95f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) + { 7.54413710f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { 11.5487394f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi + { PAL_POSINF, PAL_POSINF, 0 }, + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + asinhf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + asinhf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + asinhf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/testinfo.dat deleted file mode 100644 index 0e56de6faffe..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/asinhf/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = asinhf -Name = Positive Test for asinhf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the asinhf() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/CMakeLists.txt deleted file mode 100644 index 582906052918..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_atan_test1 - ${SOURCES} -) - -add_dependencies(paltest_atan_test1 coreclrpal) - -target_link_libraries(paltest_atan_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/test1.cpp index 8677c52acd8a..0e65933bc894 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * atan_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl atan_test1_validate(double value, double expected, double variance) { double result = atan(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * atan_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl atan_test1_validate_isnan(double value) { double result = atan(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_atan_test1_paltest_atan_test1, "c_runtime/atan/test1/paltest_atan_test1") { struct test tests[] = { @@ -116,11 +116,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + atan_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + atan_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + atan_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/testinfo.dat deleted file mode 100644 index e823c2d55a8f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = atan -Name = Positive Test for atan -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the atan() function, -= checking each for the expected result. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/CMakeLists.txt deleted file mode 100644 index 655c7012a000..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_atan2_test1 - ${SOURCES} -) - -add_dependencies(paltest_atan2_test1 coreclrpal) - -target_link_libraries(paltest_atan2_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/test1.cpp index 889ea90c9ca3..6298487994d5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/test1.cpp @@ -40,11 +40,11 @@ struct test }; /** - * validate + * atan2_test1_validate * * test validation function */ -void __cdecl validate(double y, double x, double expected, double variance) +void __cdecl atan2_test1_validate(double y, double x, double expected, double variance) { double result = atan2(y, x); @@ -62,11 +62,11 @@ void __cdecl validate(double y, double x, double expected, double variance) } /** - * validate + * atan2_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double y, double x) +void __cdecl atan2_test1_validate_isnan(double y, double x) { double result = atan2(y, x); @@ -82,7 +82,7 @@ void __cdecl validate_isnan(double y, double x) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_atan2_test1_paltest_atan2_test1, "c_runtime/atan2/test1/paltest_atan2_test1") { struct test tests[] = { @@ -119,28 +119,28 @@ int __cdecl main(int argc, char **argv) { const double pi = 3.1415926535897932; - validate( tests[i].y, tests[i].x, tests[i].expected, tests[i].variance); - validate(-tests[i].y, tests[i].x, -tests[i].expected, tests[i].variance); - validate( tests[i].y, -tests[i].x, pi - tests[i].expected, tests[i].variance); - validate(-tests[i].y, -tests[i].x, tests[i].expected - pi, tests[i].variance); + atan2_test1_validate( tests[i].y, tests[i].x, tests[i].expected, tests[i].variance); + atan2_test1_validate(-tests[i].y, tests[i].x, -tests[i].expected, tests[i].variance); + atan2_test1_validate( tests[i].y, -tests[i].x, pi - tests[i].expected, tests[i].variance); + atan2_test1_validate(-tests[i].y, -tests[i].x, tests[i].expected - pi, tests[i].variance); } - validate_isnan(PAL_NEGINF, PAL_NAN); - validate_isnan(PAL_NAN, PAL_NEGINF); - validate_isnan(PAL_NAN, PAL_POSINF); - validate_isnan(PAL_POSINF, PAL_NAN); + atan2_test1_validate_isnan(PAL_NEGINF, PAL_NAN); + atan2_test1_validate_isnan(PAL_NAN, PAL_NEGINF); + atan2_test1_validate_isnan(PAL_NAN, PAL_POSINF); + atan2_test1_validate_isnan(PAL_POSINF, PAL_NAN); - validate_isnan(PAL_NAN, -1); - validate_isnan(PAL_NAN, -0.0); - validate_isnan(PAL_NAN, 0); - validate_isnan(PAL_NAN, 1); + atan2_test1_validate_isnan(PAL_NAN, -1); + atan2_test1_validate_isnan(PAL_NAN, -0.0); + atan2_test1_validate_isnan(PAL_NAN, 0); + atan2_test1_validate_isnan(PAL_NAN, 1); - validate_isnan(-1, PAL_NAN); - validate_isnan(-0.0, PAL_NAN); - validate_isnan( 0, PAL_NAN); - validate_isnan( 1, PAL_NAN); + atan2_test1_validate_isnan(-1, PAL_NAN); + atan2_test1_validate_isnan(-0.0, PAL_NAN); + atan2_test1_validate_isnan( 0, PAL_NAN); + atan2_test1_validate_isnan( 1, PAL_NAN); - validate_isnan(PAL_NAN, PAL_NAN); + atan2_test1_validate_isnan(PAL_NAN, PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/testinfo.dat deleted file mode 100644 index 45241063cc88..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = atan2 -Name = Test #1 for atan2 -Type = DEFAULT -EXE1 = test1 -Description -=Tests that atan2 returns correct values for a subset of values. -=Tests with positive and negative values of x and y to ensure -=atan2 is returning results from the correct quadrant. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/CMakeLists.txt deleted file mode 100644 index d5b28ce4e6b5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_atan2f_test1 - ${SOURCES} -) - -add_dependencies(paltest_atan2f_test1 coreclrpal) - -target_link_libraries(paltest_atan2f_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.c deleted file mode 100644 index b00d4e55eeee..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.c +++ /dev/null @@ -1,146 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Tests that atan2f returns correct values for a subset of values. -** Tests with positive and negative values of x and y to ensure -** atan2f is returning results from the correct quadrant. -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -struct test -{ - float y; /* second component of the value to test the function with */ - float x; /* first component of the value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float y, float x, float expected, float variance) -{ - float result = atan2f(y, x); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("atan2f(%g, %g) returned %10.9g when it should have returned %10.9g", - y, x, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float y, float x) -{ - float result = atan2f(y, x); - - if (!_isnanf(result)) - { - Fail("atan2f(%g, %g) returned %10.9g when it should have returned %10.9g", - y, x, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* y x expected variance */ - { 0, PAL_POSINF, 0, PAL_EPSILON }, - { 0, 0, 0, PAL_EPSILON }, - { 0.312961796f, 0.949765715f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 0.420770483f, 0.907167129f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e) - { 0.594480769f, 0.804109828f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 0.638961276f, 0.769238901f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 0.649636939f, 0.760244597f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 0.707106781f, 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2) - { 1, 1, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { PAL_POSINF, PAL_POSINF, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { 0.841470985f, 0.540302306f, 1, PAL_EPSILON * 10 }, - { 0.903719457f, 0.428125148f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 0.987765946f, 0.155943695f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 0.991806244f, 0.127751218f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 1, 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { PAL_POSINF, 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { PAL_POSINF, 1, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { 0.743980337f, -0.668201510f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) - { 0.410781291f, -0.911733915f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { 0, -1, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi - { 1, PAL_POSINF, 0, PAL_EPSILON }, - }; - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - const float pi = 3.14159265f; - - validate( tests[i].y, tests[i].x, tests[i].expected, tests[i].variance); - validate(-tests[i].y, tests[i].x, -tests[i].expected, tests[i].variance); - validate( tests[i].y, -tests[i].x, pi - tests[i].expected, tests[i].variance); - validate(-tests[i].y, -tests[i].x, tests[i].expected - pi, tests[i].variance); - } - - validate_isnan(PAL_NEGINF, PAL_NAN); - validate_isnan(PAL_NAN, PAL_NEGINF); - validate_isnan(PAL_NAN, PAL_POSINF); - validate_isnan(PAL_POSINF, PAL_NAN); - - validate_isnan(PAL_NAN, -1); - validate_isnan(PAL_NAN, -0.0f); - validate_isnan(PAL_NAN, 0); - validate_isnan(PAL_NAN, 1); - - validate_isnan(-1, PAL_NAN); - validate_isnan(-0.0f, PAL_NAN); - validate_isnan( 0, PAL_NAN); - validate_isnan( 1, PAL_NAN); - - validate_isnan(PAL_NAN, PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.cpp new file mode 100644 index 000000000000..f5915b3a0e1c --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.cpp @@ -0,0 +1,146 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Tests that atan2f returns correct values for a subset of values. +** Tests with positive and negative values of x and y to ensure +** atan2f is returning results from the correct quadrant. +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +struct test +{ + float y; /* second component of the value to test the function with */ + float x; /* first component of the value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * atan2f_test1_validate + * + * test validation function + */ +void __cdecl atan2f_test1_validate(float y, float x, float expected, float variance) +{ + float result = atan2f(y, x); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("atan2f(%g, %g) returned %10.9g when it should have returned %10.9g", + y, x, result, expected); + } +} + +/** + * atan2f_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl atan2f_test1_validate_isnan(float y, float x) +{ + float result = atan2f(y, x); + + if (!_isnanf(result)) + { + Fail("atan2f(%g, %g) returned %10.9g when it should have returned %10.9g", + y, x, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_atan2f_test1_paltest_atan2f_test1, "c_runtime/atan2f/test1/paltest_atan2f_test1") +{ + struct test tests[] = + { + /* y x expected variance */ + { 0, PAL_POSINF, 0, PAL_EPSILON }, + { 0, 0, 0, PAL_EPSILON }, + { 0.312961796f, 0.949765715f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 0.420770483f, 0.907167129f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e) + { 0.594480769f, 0.804109828f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 0.638961276f, 0.769238901f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 0.649636939f, 0.760244597f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 0.707106781f, 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2) + { 1, 1, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { PAL_POSINF, PAL_POSINF, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { 0.841470985f, 0.540302306f, 1, PAL_EPSILON * 10 }, + { 0.903719457f, 0.428125148f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 0.987765946f, 0.155943695f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 0.991806244f, 0.127751218f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 1, 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { PAL_POSINF, 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { PAL_POSINF, 1, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { 0.743980337f, -0.668201510f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) + { 0.410781291f, -0.911733915f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { 0, -1, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi + { 1, PAL_POSINF, 0, PAL_EPSILON }, + }; + + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + const float pi = 3.14159265f; + + atan2f_test1_validate( tests[i].y, tests[i].x, tests[i].expected, tests[i].variance); + atan2f_test1_validate(-tests[i].y, tests[i].x, -tests[i].expected, tests[i].variance); + atan2f_test1_validate( tests[i].y, -tests[i].x, pi - tests[i].expected, tests[i].variance); + atan2f_test1_validate(-tests[i].y, -tests[i].x, tests[i].expected - pi, tests[i].variance); + } + + atan2f_test1_validate_isnan(PAL_NEGINF, PAL_NAN); + atan2f_test1_validate_isnan(PAL_NAN, PAL_NEGINF); + atan2f_test1_validate_isnan(PAL_NAN, PAL_POSINF); + atan2f_test1_validate_isnan(PAL_POSINF, PAL_NAN); + + atan2f_test1_validate_isnan(PAL_NAN, -1); + atan2f_test1_validate_isnan(PAL_NAN, -0.0f); + atan2f_test1_validate_isnan(PAL_NAN, 0); + atan2f_test1_validate_isnan(PAL_NAN, 1); + + atan2f_test1_validate_isnan(-1, PAL_NAN); + atan2f_test1_validate_isnan(-0.0f, PAL_NAN); + atan2f_test1_validate_isnan( 0, PAL_NAN); + atan2f_test1_validate_isnan( 1, PAL_NAN); + + atan2f_test1_validate_isnan(PAL_NAN, PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/testinfo.dat deleted file mode 100644 index 225a3c7b4fca..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atan2f/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = atan2f -Name = Test #1 for atan2f -Type = DEFAULT -EXE1 = test1 -Description -=Tests that atan2f returns correct values for a subset of values. -=Tests with positive and negative values of x and y to ensure -=atan2f is returning results from the correct quadrant. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/CMakeLists.txt deleted file mode 100644 index 70df46a79905..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_atanf_test1 - ${SOURCES} -) - -add_dependencies(paltest_atanf_test1 coreclrpal) - -target_link_libraries(paltest_atanf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.c deleted file mode 100644 index 3d460d3e25c6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.c +++ /dev/null @@ -1,126 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that atanf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = atanf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("atanf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = atanf(value); - - if (!_isnanf(result)) - { - Fail("atanf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 0, PAL_EPSILON }, - { 0.329514733f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 0.450549534f, 0.423310825f, PAL_EPSILON }, // expected: pi - e - { 0.463829067f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e) - { 0.739302950f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 0.830640878f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 0.854510432f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 1, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { 1.11340715f, 0.839007561f, PAL_EPSILON }, // expected: pi - ln(10) - { 1.55740772f, 1, PAL_EPSILON * 10 }, - { 2.11087684f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 6.33411917f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 7.76357567f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { PAL_POSINF, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.cpp new file mode 100644 index 000000000000..518775f1f9c3 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.cpp @@ -0,0 +1,126 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that atanf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * atanf_test1_validate + * + * test validation function + */ +void __cdecl atanf_test1_validate(float value, float expected, float variance) +{ + float result = atanf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("atanf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * atanf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl atanf_test1_validate_isnan(float value) +{ + float result = atanf(value); + + if (!_isnanf(result)) + { + Fail("atanf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_atanf_test1_paltest_atanf_test1, "c_runtime/atanf/test1/paltest_atanf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 0, PAL_EPSILON }, + { 0.329514733f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 0.450549534f, 0.423310825f, PAL_EPSILON }, // expected: pi - e + { 0.463829067f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e) + { 0.739302950f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 0.830640878f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 0.854510432f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 1, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { 1.11340715f, 0.839007561f, PAL_EPSILON }, // expected: pi - ln(10) + { 1.55740772f, 1, PAL_EPSILON * 10 }, + { 2.11087684f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 6.33411917f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 7.76357567f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { PAL_POSINF, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + atanf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + atanf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + atanf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/testinfo.dat deleted file mode 100644 index 4924a2a15d93..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = atanf -Name = Positive Test for atanf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the atanf() function, -= checking each for the expected result. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/CMakeLists.txt deleted file mode 100644 index e55fc35c1b29..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_atanh_test1 - ${SOURCES} -) - -add_dependencies(paltest_atanh_test1 coreclrpal) - -target_link_libraries(paltest_atanh_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/test1.cpp index 3531e765ff8f..24a042826e09 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * atanh_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl atanh_test1_validate(double value, double expected, double variance) { double result = atanh(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * atanh_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl atanh_test1_validate_isnan(double value) { double result = atanh(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_atanh_test1_paltest_atanh_test1, "c_runtime/atanh/test1/paltest_atanh_test1") { struct test tests[] = { @@ -118,11 +118,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + atanh_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + atanh_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + atanh_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/testinfo.dat deleted file mode 100644 index 32a68acb851b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanh/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = atanh -Name = Positive Test for atanh -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the atanh() function, -= checking each for the expected result. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/CMakeLists.txt deleted file mode 100644 index 88e7a36b48bb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_atanhf_test1 - ${SOURCES} -) - -add_dependencies(paltest_atanhf_test1 coreclrpal) - -target_link_libraries(paltest_atanhf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/test1.c deleted file mode 100644 index 3c3a156035ad..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/test1.c +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that atanhf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = atanhf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("atanhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = atanhf(value); - - if (!_isnanf(result)) - { - Fail("atanhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 0, PAL_EPSILON }, - { 0.307977913f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 0.408904012f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) - { 0.562593600f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 0.6f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 0.608859365f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 0.655794203f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { 0.761594156f, 1, PAL_EPSILON * 10 }, - { 0.810463806f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 0.888385562f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 0.894238946f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 0.917152336f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { 0.980198020f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) - { 0.991328916f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { 0.996272076f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi - { 1, PAL_POSINF, PAL_EPSILON * 10 } - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/test1.cpp new file mode 100644 index 000000000000..d8d184f905fb --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/test1.cpp @@ -0,0 +1,128 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that atanhf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * atanhf_test1_validate + * + * test validation function + */ +void __cdecl atanhf_test1_validate(float value, float expected, float variance) +{ + float result = atanhf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("atanhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * atanhf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl atanhf_test1_validate_isnan(float value) +{ + float result = atanhf(value); + + if (!_isnanf(result)) + { + Fail("atanhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_atanhf_test1_paltest_atanhf_test1, "c_runtime/atanhf/test1/paltest_atanhf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 0, PAL_EPSILON }, + { 0.307977913f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 0.408904012f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) + { 0.562593600f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 0.6f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 0.608859365f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 0.655794203f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { 0.761594156f, 1, PAL_EPSILON * 10 }, + { 0.810463806f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 0.888385562f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 0.894238946f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 0.917152336f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { 0.980198020f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) + { 0.991328916f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { 0.996272076f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi + { 1, PAL_POSINF, PAL_EPSILON * 10 } + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + atanhf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + atanhf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + atanhf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/testinfo.dat deleted file mode 100644 index 4f8217652a3b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atanhf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = atanhf -Name = Positive Test for atanhf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the atanhf() function, -= checking each for the expected result. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/CMakeLists.txt deleted file mode 100644 index dbc898a8aaa3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_atof_test1 - ${SOURCES} -) - -add_dependencies(paltest_atof_test1 coreclrpal) - -target_link_libraries(paltest_atof_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/test1.cpp index e708d7a42fb6..6d8becb3d955 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/test1.cpp @@ -20,7 +20,7 @@ struct testCase char avalue[20]; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_atof_test1_paltest_atof_test1, "c_runtime/atof/test1/paltest_atof_test1") { int i = 0; double f = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/testinfo.dat deleted file mode 100644 index d108278e93b2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atof/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = atof -Name = Positive Test for atof -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to atof() a series of strings containing floats, checking that -= each one is correctly extracted. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/CMakeLists.txt deleted file mode 100644 index 92426e1d9fff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_atoi_test1 - ${SOURCES} -) - -add_dependencies(paltest_atoi_test1 coreclrpal) - -target_link_libraries(paltest_atoi_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/test1.cpp index 38e42862cc4c..3137bf903e68 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/test1.cpp @@ -22,7 +22,7 @@ struct testCase char avalue[20]; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_atoi_test1_paltest_atoi_test1, "c_runtime/atoi/test1/paltest_atoi_test1") { int result=0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/testinfo.dat deleted file mode 100644 index 161812238f14..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/atoi/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = atoi -Name = Positive Test for atoi -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the atoi function. -= Check to ensure that the different ints (normal, negative, decimal, -= exponent), all work as expected with this function. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/CMakeLists.txt deleted file mode 100644 index c24a88cf0c1d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_bsearch_test1 - ${SOURCES} -) - -add_dependencies(paltest_bsearch_test1 coreclrpal) - -target_link_libraries(paltest_bsearch_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.cpp index b00ec2832122..eacb660dee09 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.cpp @@ -13,12 +13,12 @@ #include -int __cdecl charcmp(const void *pa, const void *pb) +int __cdecl charcmp_bsearch_test1(const void *pa, const void *pb) { return memcmp(pa, pb, 1); } -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_bsearch_test1_paltest_bsearch_test1, "c_runtime/bsearch/test1/paltest_bsearch_test1") { const char array[] = "abcdefghij"; @@ -33,7 +33,7 @@ int __cdecl main(int argc, char **argv) } found = (char *)bsearch(&"d", array, sizeof(array) - 1, (sizeof(char)) - , charcmp); + , charcmp_bsearch_test1); if (found != array + 3) { Fail ("bsearch was unable to find a specified character in a " diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/testinfo.dat deleted file mode 100644 index eaae5e0add98..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = bsearch -Name = Positive Test for bsearch -TYPE = DEFAULT -EXE1 = test1 -Description -= Calls bsearch to find a character in a sorted buffer, and -= verifies that the correct position is returned. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/CMakeLists.txt deleted file mode 100644 index 3f86291bb384..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_bsearch_test2 - ${SOURCES} -) - -add_dependencies(paltest_bsearch_test2 coreclrpal) - -target_link_libraries(paltest_bsearch_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.cpp index 08440728c067..a916e61362ee 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.cpp @@ -13,12 +13,12 @@ #include -int __cdecl charcmp(const void *pa, const void *pb) +int __cdecl charcmp_bsearch_test2(const void *pa, const void *pb) { return *(const char *)pa - *(const char *)pb; } -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_bsearch_test2_paltest_bsearch_test2, "c_runtime/bsearch/test2/paltest_bsearch_test2") { const char array[] = "abcefghij"; @@ -36,7 +36,7 @@ int __cdecl main(int argc, char **argv) while (*candidate) { found = (char *)bsearch(candidate, array, sizeof(array) - 1, - (sizeof(char)), charcmp); + (sizeof(char)), charcmp_bsearch_test2); if (found != NULL) { Fail ("ERROR: bsearch was able to find a specified character '%c' " diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/testinfo.dat deleted file mode 100644 index 4d149e26a4fe..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/bsearch/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = bsearch -Name = Negative Test for bsearch -TYPE = DEFAULT -EXE1 = test2 -Description -= Calls bsearch to find a character in a sorted buffer, -= that does not exist. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/CMakeLists.txt deleted file mode 100644 index e53845485e34..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_cbrt_test1 - ${SOURCES} -) - -add_dependencies(paltest_cbrt_test1 coreclrpal) - -target_link_libraries(paltest_cbrt_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/test1.cpp index aca178fc1afb..157bc0b14959 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/test1.cpp @@ -42,11 +42,11 @@ struct test }; /** - * validate + * cbrt_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl cbrt_test1_validate(double value, double expected, double variance) { double result = cbrt(value); @@ -64,11 +64,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * cbrt_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl cbrt_test1_validate_isnan(double value) { double result = cbrt(value); @@ -79,7 +79,7 @@ void __cdecl validate_isnan(double value) } } -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_cbrt_test1_paltest_cbrt_test1, "c_runtime/cbrt/test1/paltest_cbrt_test1") { struct test tests[] = { @@ -106,16 +106,16 @@ int __cdecl main(int argc, char **argv) return FAIL; } - validate(-0.0, -0.0, PAL_EPSILON); - validate( 0.0, 0.0, PAL_EPSILON); + cbrt_test1_validate(-0.0, -0.0, PAL_EPSILON); + cbrt_test1_validate( 0.0, 0.0, PAL_EPSILON); for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + cbrt_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + cbrt_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + cbrt_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/testinfo.dat deleted file mode 100644 index 03981d2f1535..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrt/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = cbrt -Name = Call cbrt on positive values and zero. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the cbrt function on a positive value, a positive value -= with a decimal and on the maxium possible double value. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/CMakeLists.txt deleted file mode 100644 index 1d909e076c10..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_cbrtf_test1 - ${SOURCES} -) - -add_dependencies(paltest_cbrtf_test1 coreclrpal) - -target_link_libraries(paltest_cbrtf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/test1.c deleted file mode 100644 index a4acb920d7dc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/test1.c +++ /dev/null @@ -1,121 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Call the cbrtf function on a positive value, a positive value -** with a decimal and on the maxium possible float value. -** -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = cbrtf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("cbrtf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = cbrtf(value); - - if (!_isnanf(result)) - { - Fail("cbrtf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0.318309886f, 0.682784063f, PAL_EPSILON }, // value: 1 / pi - { 0.434294482f, 0.757288631f, PAL_EPSILON }, // value: log10f(e) - { 0.636619772f, 0.860254014f, PAL_EPSILON }, // value: 2 / pi - { 0.693147181f, 0.884997045f, PAL_EPSILON }, // value: ln(2) - { 0.707106781f, 0.890898718f, PAL_EPSILON }, // value: 1 / sqrtf(2) - { 0.785398163f, 0.922635074f, PAL_EPSILON }, // value: pi / 4 - { 1, 1, PAL_EPSILON * 10 }, - { 1.12837917f, 1.04108220f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) - { 1.41421356f, 1.12246205f, PAL_EPSILON * 10 }, // value: sqrtf(2) - { 1.44269504f, 1.12994728f, PAL_EPSILON * 10 }, // value: logf2(e) - { 1.57079633f, 1.16244735f, PAL_EPSILON * 10 }, // value: pi / 2 - { 2.30258509f, 1.32050048f, PAL_EPSILON * 10 }, // value: ln(10) - { 2.71828183f, 1.39561243f, PAL_EPSILON * 10 }, // value: e - { 3.14159265f, 1.46459189f, PAL_EPSILON * 10 }, // value: pi - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - validate(-0.0f, -0.0f, PAL_EPSILON); - validate( 0.0f, 0.0f, PAL_EPSILON); - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/test1.cpp new file mode 100644 index 000000000000..2fa3f25a467c --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/test1.cpp @@ -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. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Call the cbrtf function on a positive value, a positive value +** with a decimal and on the maxium possible float value. +** +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * cbrtf_test1_validate + * + * test validation function + */ +void __cdecl cbrtf_test1_validate(float value, float expected, float variance) +{ + float result = cbrtf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("cbrtf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * cbrtf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl cbrtf_test1_validate_isnan(float value) +{ + float result = cbrtf(value); + + if (!_isnanf(result)) + { + Fail("cbrtf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +PALTEST(c_runtime_cbrtf_test1_paltest_cbrtf_test1, "c_runtime/cbrtf/test1/paltest_cbrtf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0.318309886f, 0.682784063f, PAL_EPSILON }, // value: 1 / pi + { 0.434294482f, 0.757288631f, PAL_EPSILON }, // value: log10f(e) + { 0.636619772f, 0.860254014f, PAL_EPSILON }, // value: 2 / pi + { 0.693147181f, 0.884997045f, PAL_EPSILON }, // value: ln(2) + { 0.707106781f, 0.890898718f, PAL_EPSILON }, // value: 1 / sqrtf(2) + { 0.785398163f, 0.922635074f, PAL_EPSILON }, // value: pi / 4 + { 1, 1, PAL_EPSILON * 10 }, + { 1.12837917f, 1.04108220f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) + { 1.41421356f, 1.12246205f, PAL_EPSILON * 10 }, // value: sqrtf(2) + { 1.44269504f, 1.12994728f, PAL_EPSILON * 10 }, // value: logf2(e) + { 1.57079633f, 1.16244735f, PAL_EPSILON * 10 }, // value: pi / 2 + { 2.30258509f, 1.32050048f, PAL_EPSILON * 10 }, // value: ln(10) + { 2.71828183f, 1.39561243f, PAL_EPSILON * 10 }, // value: e + { 3.14159265f, 1.46459189f, PAL_EPSILON * 10 }, // value: pi + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + cbrtf_test1_validate(-0.0f, -0.0f, PAL_EPSILON); + cbrtf_test1_validate( 0.0f, 0.0f, PAL_EPSILON); + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + cbrtf_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + cbrtf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + cbrtf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/testinfo.dat deleted file mode 100644 index 73264ba8478c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cbrtf/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = cbrtf -Name = Call cbrtf on positive values and zero. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the cbrtf function on a positive value, a positive value -= with a decimal and on the maxium possible float value. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/CMakeLists.txt deleted file mode 100644 index 10c9045af8db..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_ceil_test1 - ${SOURCES} -) - -add_dependencies(paltest_ceil_test1 coreclrpal) - -target_link_libraries(paltest_ceil_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/test1.cpp index 594c4d794792..3f1d71e625c7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/test1.cpp @@ -43,11 +43,11 @@ struct test }; /** - * validate + * ceil_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl ceil_test1_validate(double value, double expected, double variance) { double result = ceil(value); @@ -65,11 +65,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * ceil_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl ceil_test1_validate_isnan(double value) { double result = ceil(value); @@ -85,7 +85,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_ceil_test1_paltest_ceil_test1, "c_runtime/ceil/test1/paltest_ceil_test1") { struct test tests[] = { @@ -112,19 +112,19 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - validate( 0, 0, PAL_EPSILON); - validate(-0.0, 0, PAL_EPSILON); + ceil_test1_validate( 0, 0, PAL_EPSILON); + ceil_test1_validate(-0.0, 0, PAL_EPSILON); - validate( 1, 1, PAL_EPSILON * 10); - validate(-1.0, -1, PAL_EPSILON * 10); + ceil_test1_validate( 1, 1, PAL_EPSILON * 10); + ceil_test1_validate(-1.0, -1, PAL_EPSILON * 10); for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, 1 - tests[i].expected, tests[i].variance); + ceil_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + ceil_test1_validate(-tests[i].value, 1 - tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + ceil_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/testinfo.dat deleted file mode 100644 index e3a13421a13c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceil/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = ceil -Name = Test #1 for ceil -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests ceil with simple positive and negative values. Also tests -=extreme cases like extremely small values and positive and negative -=infinity. Makes sure that calling ceil on NaN returns NaN diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/CMakeLists.txt deleted file mode 100644 index ecfef17c3dcf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_ceilf_test1 - ${SOURCES} -) - -add_dependencies(paltest_ceilf_test1 coreclrpal) - -target_link_libraries(paltest_ceilf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.c deleted file mode 100644 index 2b3534dd8304..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.c +++ /dev/null @@ -1,130 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: Tests ceilf with simple positive and negative values. Also tests -** extreme cases like extremely small values and positive and -** negative infinity. Makes sure that calling ceilf on NaN returns -** NaN -** -**==========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = ceilf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("ceilf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = ceilf(value); - - if (!_isnanf(result)) - { - Fail("ceilf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char *argv[]) -{ - struct test tests[] = - { - /* value expected variance */ - { 0.318309886f, 1, PAL_EPSILON * 10 }, // value: 1 / pi - { 0.434294482f, 1, PAL_EPSILON * 10 }, // value: log10f(e) - { 0.636619772f, 1, PAL_EPSILON * 10 }, // value: 2 / pi - { 0.693147181f, 1, PAL_EPSILON * 10 }, // value: ln(2) - { 0.707106781f, 1, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2) - { 0.785398163f, 1, PAL_EPSILON * 10 }, // value: pi / 4 - { 1.12837917f, 2, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) - { 1.41421356f, 2, PAL_EPSILON * 10 }, // value: sqrtf(2) - { 1.44269504f, 2, PAL_EPSILON * 10 }, // value: logf2(e) - { 1.57079633f, 2, PAL_EPSILON * 10 }, // value: pi / 2 - { 2.30258509f, 3, PAL_EPSILON * 10 }, // value: ln(10) - { 2.71828183f, 3, PAL_EPSILON * 10 }, // value: e - { 3.14159265f, 4, PAL_EPSILON * 10 }, // value: pi - { PAL_POSINF, PAL_POSINF, 0 } - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - validate( 0, 0, PAL_EPSILON); - validate(-0.0f, 0, PAL_EPSILON); - - validate( 1, 1, PAL_EPSILON * 10); - validate(-1.0f, -1, PAL_EPSILON * 10); - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, 1 - tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.cpp new file mode 100644 index 000000000000..cf237ea8eb95 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.cpp @@ -0,0 +1,130 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================ +** +** Source: test1.c +** +** Purpose: Tests ceilf with simple positive and negative values. Also tests +** extreme cases like extremely small values and positive and +** negative infinity. Makes sure that calling ceilf on NaN returns +** NaN +** +**==========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * ceilf_test1_validate + * + * test validation function + */ +void __cdecl ceilf_test1_validate(float value, float expected, float variance) +{ + float result = ceilf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("ceilf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * ceilf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl ceilf_test1_validate_isnan(float value) +{ + float result = ceilf(value); + + if (!_isnanf(result)) + { + Fail("ceilf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_ceilf_test1_paltest_ceilf_test1, "c_runtime/ceilf/test1/paltest_ceilf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0.318309886f, 1, PAL_EPSILON * 10 }, // value: 1 / pi + { 0.434294482f, 1, PAL_EPSILON * 10 }, // value: log10f(e) + { 0.636619772f, 1, PAL_EPSILON * 10 }, // value: 2 / pi + { 0.693147181f, 1, PAL_EPSILON * 10 }, // value: ln(2) + { 0.707106781f, 1, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2) + { 0.785398163f, 1, PAL_EPSILON * 10 }, // value: pi / 4 + { 1.12837917f, 2, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) + { 1.41421356f, 2, PAL_EPSILON * 10 }, // value: sqrtf(2) + { 1.44269504f, 2, PAL_EPSILON * 10 }, // value: logf2(e) + { 1.57079633f, 2, PAL_EPSILON * 10 }, // value: pi / 2 + { 2.30258509f, 3, PAL_EPSILON * 10 }, // value: ln(10) + { 2.71828183f, 3, PAL_EPSILON * 10 }, // value: e + { 3.14159265f, 4, PAL_EPSILON * 10 }, // value: pi + { PAL_POSINF, PAL_POSINF, 0 } + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + ceilf_test1_validate( 0, 0, PAL_EPSILON); + ceilf_test1_validate(-0.0f, 0, PAL_EPSILON); + + ceilf_test1_validate( 1, 1, PAL_EPSILON * 10); + ceilf_test1_validate(-1.0f, -1, PAL_EPSILON * 10); + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + ceilf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + ceilf_test1_validate(-tests[i].value, 1 - tests[i].expected, tests[i].variance); + } + + ceilf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/testinfo.dat deleted file mode 100644 index c10be6890b1f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ceilf/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = ceilf -Name = Test #1 for ceilf -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests ceilf with simple positive and negative values. Also tests -=extreme cases like extremely small values and positive and negative -=infinity. Makes sure that calling ceilf on NaN returns NaN diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/CMakeLists.txt deleted file mode 100644 index 6ca4befb8783..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_cos_test1 - ${SOURCES} -) - -add_dependencies(paltest_cos_test1 coreclrpal) - -target_link_libraries(paltest_cos_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/test1.cpp index ffbd61bdcb16..d574895731d5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * cos_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl cos_test1_validate(double value, double expected, double variance) { double result = cos(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * cos_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl cos_test1_validate_isnan(double value) { double result = cos(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_cos_test1_paltest_cos_test1, "c_runtime/cos/test1/paltest_cos_test1") { struct test tests[] = { @@ -117,13 +117,13 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, tests[i].expected, tests[i].variance); + cos_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + cos_test1_validate(-tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); + cos_test1_validate_isnan(PAL_NEGINF); + cos_test1_validate_isnan(PAL_NAN); + cos_test1_validate_isnan(PAL_POSINF); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/testinfo.dat deleted file mode 100644 index 39a176459fd7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cos/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = cos -Name = Positive Test for cos -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to cos() a series of angle value, checking that -= each one return the correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/CMakeLists.txt deleted file mode 100644 index bf3756cfeacc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_cosf_test1 - ${SOURCES} -) - -add_dependencies(paltest_cosf_test1 coreclrpal) - -target_link_libraries(paltest_cosf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.c deleted file mode 100644 index d9c75152c189..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.c +++ /dev/null @@ -1,129 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that cosf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = cosf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("cosf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = cosf(value); - - if (!_isnanf(result)) - { - Fail("cosf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 1, PAL_EPSILON * 10 }, - { 0.318309886f, 0.949765715f, PAL_EPSILON }, // value: 1 / pi - { 0.434294482f, 0.907167129f, PAL_EPSILON }, // value: log10f(e) - { 0.636619772f, 0.804109828f, PAL_EPSILON }, // value: 2 / pi - { 0.693147181f, 0.769238901f, PAL_EPSILON }, // value: ln(2) - { 0.707106781f, 0.760244597f, PAL_EPSILON }, // value: 1 / sqrtf(2) - { 0.785398163f, 0.707106781f, PAL_EPSILON }, // value: pi / 4, expected: 1 / sqrtf(2) - { 1, 0.540302306f, PAL_EPSILON }, - { 1.12837917f, 0.428125148f, PAL_EPSILON }, // value: 2 / sqrtf(pi) - { 1.41421356f, 0.155943695f, PAL_EPSILON }, // value: sqrtf(2) - { 1.44269504f, 0.127751218f, PAL_EPSILON }, // value: logf2(e) - { 1.57079633f, 0, PAL_EPSILON }, // value: pi / 2 - { 2.30258509f, -0.668201510f, PAL_EPSILON }, // value: ln(10) - { 2.71828183f, -0.911733918f, PAL_EPSILON }, // value: e - { 3.14159265f, -1, PAL_EPSILON * 10 }, // value: pi - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.cpp new file mode 100644 index 000000000000..ed3a4512b7fe --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.cpp @@ -0,0 +1,129 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that cosf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * cosf_test1_validate + * + * test validation function + */ +void __cdecl cosf_test1_validate(float value, float expected, float variance) +{ + float result = cosf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("cosf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * cosf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl cosf_test1_validate_isnan(float value) +{ + float result = cosf(value); + + if (!_isnanf(result)) + { + Fail("cosf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_cosf_test1_paltest_cosf_test1, "c_runtime/cosf/test1/paltest_cosf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 1, PAL_EPSILON * 10 }, + { 0.318309886f, 0.949765715f, PAL_EPSILON }, // value: 1 / pi + { 0.434294482f, 0.907167129f, PAL_EPSILON }, // value: log10f(e) + { 0.636619772f, 0.804109828f, PAL_EPSILON }, // value: 2 / pi + { 0.693147181f, 0.769238901f, PAL_EPSILON }, // value: ln(2) + { 0.707106781f, 0.760244597f, PAL_EPSILON }, // value: 1 / sqrtf(2) + { 0.785398163f, 0.707106781f, PAL_EPSILON }, // value: pi / 4, expected: 1 / sqrtf(2) + { 1, 0.540302306f, PAL_EPSILON }, + { 1.12837917f, 0.428125148f, PAL_EPSILON }, // value: 2 / sqrtf(pi) + { 1.41421356f, 0.155943695f, PAL_EPSILON }, // value: sqrtf(2) + { 1.44269504f, 0.127751218f, PAL_EPSILON }, // value: logf2(e) + { 1.57079633f, 0, PAL_EPSILON }, // value: pi / 2 + { 2.30258509f, -0.668201510f, PAL_EPSILON }, // value: ln(10) + { 2.71828183f, -0.911733918f, PAL_EPSILON }, // value: e + { 3.14159265f, -1, PAL_EPSILON * 10 }, // value: pi + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + cosf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + cosf_test1_validate(-tests[i].value, tests[i].expected, tests[i].variance); + } + + cosf_test1_validate_isnan(PAL_NEGINF); + cosf_test1_validate_isnan(PAL_NAN); + cosf_test1_validate_isnan(PAL_POSINF); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/testinfo.dat deleted file mode 100644 index f6596c47bacf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = cosf -Name = Positive Test for cosf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to cosf() a series of angle value, checking that -= each one return the correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/CMakeLists.txt deleted file mode 100644 index daa88d205a69..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_cosh_test1 - ${SOURCES} -) - -add_dependencies(paltest_cosh_test1 coreclrpal) - -target_link_libraries(paltest_cosh_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/test1.cpp index 4c23816621a9..78518b78e0e4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * cosh_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl cosh_test1_validate(double value, double expected, double variance) { double result = cosh(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * cosh_test1_validate * * test validation function for values returning PAL_NAN */ -void __cdecl validate_isnan(double value) +void __cdecl cosh_test1_validate_isnan(double value) { double result = cosh(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_cosh_test1_paltest_cosh_test1, "c_runtime/cosh/test1/paltest_cosh_test1") { struct test tests[] = { @@ -118,11 +118,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, tests[i].expected, tests[i].variance); + cosh_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + cosh_test1_validate(-tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + cosh_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/testinfo.dat deleted file mode 100644 index 1308e92e3a45..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/cosh/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = cosh -Name = Positive Test for cosh -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to cosh() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/CMakeLists.txt deleted file mode 100644 index 0754fad0dbdd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_coshf_test1 - ${SOURCES} -) - -add_dependencies(paltest_coshf_test1 coreclrpal) - -target_link_libraries(paltest_coshf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.c deleted file mode 100644 index f62e7377420b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.c +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that coshf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = coshf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("coshf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning PAL_NAN - */ -void __cdecl validate_isnan(float value) -{ - float result = coshf(value); - - if (!_isnanf(result)) - { - Fail("coshf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 1, PAL_EPSILON * 10 }, - { 0.318309886f, 1.05108979f, PAL_EPSILON * 10 }, // value: 1 / pi - { 0.434294482f, 1.09579746f, PAL_EPSILON * 10 }, // value: log10f(e) - { 0.636619772f, 1.20957949f, PAL_EPSILON * 10 }, // value: 2 / pi - { 0.693147181f, 1.25f, PAL_EPSILON * 10 }, // value: ln(2) - { 0.707106781f, 1.26059184f, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2) - { 0.785398163f, 1.32460909f, PAL_EPSILON * 10 }, // value: pi / 4 - { 1, 1.54308063f, PAL_EPSILON * 10 }, - { 1.12837917f, 1.70710014f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) - { 1.41421356f, 2.17818356f, PAL_EPSILON * 10 }, // value: sqrtf(2) - { 1.44269504f, 2.23418810f, PAL_EPSILON * 10 }, // value: logf2(e) - { 1.57079633f, 2.50917848f, PAL_EPSILON * 10 }, // value: pi / 2 - { 2.30258509f, 5.05f, PAL_EPSILON * 10 }, // value: ln(10) - { 2.71828183f, 7.61012514f, PAL_EPSILON * 10 }, // value: e - { 3.14159265f, 11.5919533f, PAL_EPSILON * 100 }, // value: pi - { PAL_POSINF, PAL_POSINF, 0 }, - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.cpp new file mode 100644 index 000000000000..27ba18c080f4 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.cpp @@ -0,0 +1,128 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that coshf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * coshf_test1_validate + * + * test validation function + */ +void __cdecl coshf_test1_validate(float value, float expected, float variance) +{ + float result = coshf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("coshf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * coshf_test1_validate + * + * test validation function for values returning PAL_NAN + */ +void __cdecl coshf_test1_validate_isnan(float value) +{ + float result = coshf(value); + + if (!_isnanf(result)) + { + Fail("coshf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_coshf_test1_paltest_coshf_test1, "c_runtime/coshf/test1/paltest_coshf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 1, PAL_EPSILON * 10 }, + { 0.318309886f, 1.05108979f, PAL_EPSILON * 10 }, // value: 1 / pi + { 0.434294482f, 1.09579746f, PAL_EPSILON * 10 }, // value: log10f(e) + { 0.636619772f, 1.20957949f, PAL_EPSILON * 10 }, // value: 2 / pi + { 0.693147181f, 1.25f, PAL_EPSILON * 10 }, // value: ln(2) + { 0.707106781f, 1.26059184f, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2) + { 0.785398163f, 1.32460909f, PAL_EPSILON * 10 }, // value: pi / 4 + { 1, 1.54308063f, PAL_EPSILON * 10 }, + { 1.12837917f, 1.70710014f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) + { 1.41421356f, 2.17818356f, PAL_EPSILON * 10 }, // value: sqrtf(2) + { 1.44269504f, 2.23418810f, PAL_EPSILON * 10 }, // value: logf2(e) + { 1.57079633f, 2.50917848f, PAL_EPSILON * 10 }, // value: pi / 2 + { 2.30258509f, 5.05f, PAL_EPSILON * 10 }, // value: ln(10) + { 2.71828183f, 7.61012514f, PAL_EPSILON * 10 }, // value: e + { 3.14159265f, 11.5919533f, PAL_EPSILON * 100 }, // value: pi + { PAL_POSINF, PAL_POSINF, 0 }, + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + coshf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + coshf_test1_validate(-tests[i].value, tests[i].expected, tests[i].variance); + } + + coshf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/testinfo.dat deleted file mode 100644 index a953630cda9f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/coshf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = coshf -Name = Positive Test for coshf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to coshf() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/CMakeLists.txt deleted file mode 100644 index d5968e089529..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_errno_test1 - ${SOURCES} -) - -add_dependencies(paltest_errno_test1 coreclrpal) - -target_link_libraries(paltest_errno_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/test1.cpp index 0a7da4a644c7..7daab481ef10 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_errno_test1_paltest_errno_test1, "c_runtime/errno/test1/paltest_errno_test1") { WCHAR overstr[] = {'4','2','9','4','9','6','7','2','9','6',0}; WCHAR *end; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/testinfo.dat deleted file mode 100644 index 21bcff79efc3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = errno -Name = Positive Test for errno -TYPE = DEFAULT -EXE1 = test1 -Description -= Test that errno begins as 0, and sets to ERANGE when that -= error is forced with wcstoul. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/CMakeLists.txt deleted file mode 100644 index ebb4b65dde39..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_errno_test2 - ${SOURCES} -) - -add_dependencies(paltest_errno_test2 coreclrpal) - -target_link_libraries(paltest_errno_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/test2.cpp index 2c5e42d00592..7a0e27007f71 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/test2.cpp @@ -16,7 +16,7 @@ This thread function just checks that errno is initially 0 and then sets it to a new value before returning. */ -DWORD PALAPI ThreadFunc( LPVOID lpParam ) +DWORD PALAPI ThreadFunc_errno_test2( LPVOID lpParam ) { if(errno != 0) @@ -30,7 +30,7 @@ DWORD PALAPI ThreadFunc( LPVOID lpParam ) } -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_errno_test2_paltest_errno_test2, "c_runtime/errno/test2/paltest_errno_test2") { DWORD dwThreadId, dwThrdParam = 0; HANDLE hThread; @@ -45,7 +45,7 @@ int __cdecl main(int argc, char *argv[]) errno = 50; - hThread = CreateThread(NULL, 0, ThreadFunc, &dwThrdParam, 0, &dwThreadId); + hThread = CreateThread(NULL, 0, ThreadFunc_errno_test2, &dwThrdParam, 0, &dwThreadId); if (hThread == NULL) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/testinfo.dat deleted file mode 100644 index 1b79738d96ab..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/errno/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = errno -Name = Positive Test for errno -TYPE = DEFAULT -EXE1 = test2 -Description -= Test that errno is 'per-thread' as noted in the documentation. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/CMakeLists.txt deleted file mode 100644 index 0bfd0d0192e4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_exit_test1 - ${SOURCES} -) - -add_dependencies(paltest_exit_test1 coreclrpal) - -target_link_libraries(paltest_exit_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/test1.cpp index 201e798e909f..2bb42e3563c4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/test1.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_exit_test1_paltest_exit_test1, "c_runtime/exit/test1/paltest_exit_test1") { /* * Initialize the PAL and return FAIL if this fails diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/testinfo.dat deleted file mode 100644 index 8ee95bdcb9d2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = exit -Name = Positive Test for exit -TYPE = DEFAULT -EXE1 = test1 -Description -= Calls exit, and verifies that it actually stops program execution. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/CMakeLists.txt deleted file mode 100644 index 216befb07791..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_exit_test2 - ${SOURCES} -) - -add_dependencies(paltest_exit_test2 coreclrpal) - -target_link_libraries(paltest_exit_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/test2.cpp index c5cb862740e6..6125b3c38899 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/test2.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_exit_test2_paltest_exit_test2, "c_runtime/exit/test2/paltest_exit_test2") { /* * Initialize the PAL and return FAIL if this fails diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/testinfo.dat deleted file mode 100644 index c913ec694644..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exit/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = exit -Name = Positive Test for exit -TYPE = DEFAULT -EXE1 = test2 -Description -= Calls exit on fail, and verifies that it actually stops program execution, -= and return 1. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/CMakeLists.txt deleted file mode 100644 index 1830cc2ca7af..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_exp_test1 - ${SOURCES} -) - -add_dependencies(paltest_exp_test1 coreclrpal) - -target_link_libraries(paltest_exp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/test1.cpp index c18e31b97830..b3c8bb9307e0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/test1.cpp @@ -40,11 +40,11 @@ struct test }; /** - * validate + * exp_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl exp_test1_validate(double value, double expected, double variance) { double result = exp(value); @@ -62,11 +62,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * exp_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl exp_test1_validate_isnan(double value) { double result = exp(value); @@ -82,7 +82,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_exp_test1_paltest_exp_test1, "c_runtime/exp/test1/paltest_exp_test1") { struct test tests[] = { @@ -127,10 +127,10 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected, tests[i].variance); + exp_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + exp_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/testinfo.dat deleted file mode 100644 index 9014536f5017..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/exp/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = exp -Name = Test #1 for exp -Type = DEFAULT -EXE1 = test1 -Description -=Tests exp with a normal set of values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/CMakeLists.txt deleted file mode 100644 index f598831ec067..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_expf_test1 - ${SOURCES} -) - -add_dependencies(paltest_expf_test1 coreclrpal) - -target_link_libraries(paltest_expf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/test1.c deleted file mode 100644 index 1ef28a44085a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/test1.c +++ /dev/null @@ -1,136 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Tests expf with a normal set of values. -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = expf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("expf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = expf(value); - - if (!_isnanf(result)) - { - Fail("expf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { PAL_NEGINF, 0, PAL_EPSILON }, - { -3.14159265f, 0.0432139183f, PAL_EPSILON / 10 }, // value: -(pi) - { -2.71828183f, 0.0659880358f, PAL_EPSILON / 10 }, // value: -(e) - { -2.30258509f, 0.1f, PAL_EPSILON }, // value: -(ln(10)) - { -1.57079633f, 0.207879576f, PAL_EPSILON }, // value: -(pi / 2) - { -1.44269504f, 0.236290088f, PAL_EPSILON }, // value: -(logf2(e)) - { -1.41421356f, 0.243116734f, PAL_EPSILON }, // value: -(sqrtf(2)) - { -1.12837917f, 0.323557264f, PAL_EPSILON }, // value: -(2 / sqrtf(pi)) - { -1, 0.367879441f, PAL_EPSILON }, // value: -(1) - { -0.785398163f, 0.455938128f, PAL_EPSILON }, // value: -(pi / 4) - { -0.707106781f, 0.493068691f, PAL_EPSILON }, // value: -(1 / sqrtf(2)) - { -0.693147181f, 0.5f, PAL_EPSILON }, // value: -(ln(2)) - { -0.636619772f, 0.529077808f, PAL_EPSILON }, // value: -(2 / pi) - { -0.434294482f, 0.647721485f, PAL_EPSILON }, // value: -(log10f(e)) - { -0.318309886f, 0.727377349f, PAL_EPSILON }, // value: -(1 / pi) - { 0, 1, PAL_EPSILON * 10 }, - { 0.318309886f, 1.37480223f, PAL_EPSILON * 10 }, // value: 1 / pi - { 0.434294482f, 1.54387344f, PAL_EPSILON * 10 }, // value: log10f(e) - { 0.636619772f, 1.89008116f, PAL_EPSILON * 10 }, // value: 2 / pi - { 0.693147181f, 2, PAL_EPSILON * 10 }, // value: ln(2) - { 0.707106781f, 2.02811498f, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2) - { 0.785398163f, 2.19328005f, PAL_EPSILON * 10 }, // value: pi / 4 - { 1, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { 1.12837917f, 3.09064302f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) - { 1.41421356f, 4.11325038f, PAL_EPSILON * 10 }, // value: sqrtf(2) - { 1.44269504f, 4.23208611f, PAL_EPSILON * 10 }, // value: logf2(e) - { 1.57079633f, 4.81047738f, PAL_EPSILON * 10 }, // value: pi / 2 - { 2.30258509f, 10, PAL_EPSILON * 100 }, // value: ln(10) - { 2.71828183f, 15.1542622f, PAL_EPSILON * 100 }, // value: e - { 3.14159265f, 23.1406926f, PAL_EPSILON * 100 }, // value: pi - { PAL_POSINF, PAL_POSINF, 0 }, - }; - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/test1.cpp new file mode 100644 index 000000000000..72d417ff180a --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/test1.cpp @@ -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. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Tests expf with a normal set of values. +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * expf_test1_validate + * + * test validation function + */ +void __cdecl expf_test1_validate(float value, float expected, float variance) +{ + float result = expf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("expf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * expf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl expf_test1_validate_isnan(float value) +{ + float result = expf(value); + + if (!_isnanf(result)) + { + Fail("expf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_expf_test1_paltest_expf_test1, "c_runtime/expf/test1/paltest_expf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { PAL_NEGINF, 0, PAL_EPSILON }, + { -3.14159265f, 0.0432139183f, PAL_EPSILON / 10 }, // value: -(pi) + { -2.71828183f, 0.0659880358f, PAL_EPSILON / 10 }, // value: -(e) + { -2.30258509f, 0.1f, PAL_EPSILON }, // value: -(ln(10)) + { -1.57079633f, 0.207879576f, PAL_EPSILON }, // value: -(pi / 2) + { -1.44269504f, 0.236290088f, PAL_EPSILON }, // value: -(logf2(e)) + { -1.41421356f, 0.243116734f, PAL_EPSILON }, // value: -(sqrtf(2)) + { -1.12837917f, 0.323557264f, PAL_EPSILON }, // value: -(2 / sqrtf(pi)) + { -1, 0.367879441f, PAL_EPSILON }, // value: -(1) + { -0.785398163f, 0.455938128f, PAL_EPSILON }, // value: -(pi / 4) + { -0.707106781f, 0.493068691f, PAL_EPSILON }, // value: -(1 / sqrtf(2)) + { -0.693147181f, 0.5f, PAL_EPSILON }, // value: -(ln(2)) + { -0.636619772f, 0.529077808f, PAL_EPSILON }, // value: -(2 / pi) + { -0.434294482f, 0.647721485f, PAL_EPSILON }, // value: -(log10f(e)) + { -0.318309886f, 0.727377349f, PAL_EPSILON }, // value: -(1 / pi) + { 0, 1, PAL_EPSILON * 10 }, + { 0.318309886f, 1.37480223f, PAL_EPSILON * 10 }, // value: 1 / pi + { 0.434294482f, 1.54387344f, PAL_EPSILON * 10 }, // value: log10f(e) + { 0.636619772f, 1.89008116f, PAL_EPSILON * 10 }, // value: 2 / pi + { 0.693147181f, 2, PAL_EPSILON * 10 }, // value: ln(2) + { 0.707106781f, 2.02811498f, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2) + { 0.785398163f, 2.19328005f, PAL_EPSILON * 10 }, // value: pi / 4 + { 1, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { 1.12837917f, 3.09064302f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) + { 1.41421356f, 4.11325038f, PAL_EPSILON * 10 }, // value: sqrtf(2) + { 1.44269504f, 4.23208611f, PAL_EPSILON * 10 }, // value: logf2(e) + { 1.57079633f, 4.81047738f, PAL_EPSILON * 10 }, // value: pi / 2 + { 2.30258509f, 10, PAL_EPSILON * 100 }, // value: ln(10) + { 2.71828183f, 15.1542622f, PAL_EPSILON * 100 }, // value: e + { 3.14159265f, 23.1406926f, PAL_EPSILON * 100 }, // value: pi + { PAL_POSINF, PAL_POSINF, 0 }, + }; + + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + expf_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + } + + expf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/testinfo.dat deleted file mode 100644 index 9ed119e12975..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/expf/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = expf -Name = Test #1 for expf -Type = DEFAULT -EXE1 = test1 -Description -=Tests expf with a normal set of values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/CMakeLists.txt deleted file mode 100644 index c3d4d81a3c53..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fabs_test1 - ${SOURCES} -) - -add_dependencies(paltest_fabs_test1 coreclrpal) - -target_link_libraries(paltest_fabs_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/test1.cpp index e505a21d3bb8..f3997dea0191 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/test1.cpp @@ -44,11 +44,11 @@ struct test }; /** - * validate + * fabs_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl fabs_test1_validate(double value, double expected, double variance) { double result = fabs(value); @@ -66,11 +66,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * fabs_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl fabs_test1_validate_isnan(double value) { double result = fabs(value); @@ -86,7 +86,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -INT __cdecl main(INT argc, CHAR **argv) +PALTEST(c_runtime_fabs_test1_paltest_fabs_test1, "c_runtime/fabs/test1/paltest_fabs_test1") { struct test tests[] = { @@ -118,11 +118,11 @@ INT __cdecl main(INT argc, CHAR **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, tests[i].expected, tests[i].variance); + fabs_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + fabs_test1_validate(-tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + fabs_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/testinfo.dat deleted file mode 100644 index 41ba9d82fbad..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabs/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fabs -Name = Positive Test for fabs -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to fabs() a series of values, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/CMakeLists.txt deleted file mode 100644 index df01190dc0a0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fabsf_test1 - ${SOURCES} -) - -add_dependencies(paltest_fabsf_test1 coreclrpal) - -target_link_libraries(paltest_fabsf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.cpp index db46814c87a4..68481ca97cef 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.cpp @@ -44,11 +44,11 @@ struct test }; /** - * validate + * fabsf_test1_validate * * test validation function */ -void __cdecl validate(float value, float expected, float variance) +void __cdecl fabsf_test1_validate(float value, float expected, float variance) { float result = fabsf(value); @@ -66,11 +66,11 @@ void __cdecl validate(float value, float expected, float variance) } /** - * validate + * fabsf_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(float value) +void __cdecl fabsf_test1_validate_isnan(float value) { float result = fabsf(value); @@ -86,7 +86,7 @@ void __cdecl validate_isnan(float value) * * executable entry point */ -INT __cdecl main(INT argc, CHAR **argv) +PALTEST(c_runtime_fabsf_test1_paltest_fabsf_test1, "c_runtime/fabsf/test1/paltest_fabsf_test1") { struct test tests[] = { @@ -118,11 +118,11 @@ INT __cdecl main(INT argc, CHAR **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, tests[i].expected, tests[i].variance); + fabsf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + fabsf_test1_validate(-tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + fabsf_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/testinfo.dat deleted file mode 100644 index e58a7b95df1b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fabsf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fabsf -Name = Positive Test for fabsf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to fabsf() a series of values, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/CMakeLists.txt deleted file mode 100644 index 907694baf186..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fclose_test1 - ${SOURCES} -) - -add_dependencies(paltest_fclose_test1 coreclrpal) - -target_link_libraries(paltest_fclose_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/test1.cpp index 9771dc5e3113..fe615787c724 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/test1.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fclose_test1_paltest_fclose_test1, "c_runtime/fclose/test1/paltest_fclose_test1") { HANDLE hReadPipe = NULL; HANDLE hWritePipe = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/testinfo.dat deleted file mode 100644 index 8854bfb0eeb2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = C Runtime -Function = fclose -Name = Test for fclose -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the fclose function. -= This test will use fdopen to create a file stream, -= that will be used to test fclose. fclose will also -= be passed a closed file handle to make sure it handle -= it accordingly. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/CMakeLists.txt deleted file mode 100644 index e3cf723eff1e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_fclose_test2 - ${SOURCES} -) - -add_dependencies(paltest_fclose_test2 coreclrpal) - -target_link_libraries(paltest_fclose_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/test2.cpp index 0ba288485890..d27349a2448d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/test2.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fclose_test2_paltest_fclose_test2, "c_runtime/fclose/test2/paltest_fclose_test2") { HANDLE hReadPipe = NULL; HANDLE hWritePipe = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/testinfo.dat deleted file mode 100644 index d487fec74152..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fclose/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fclose -Name = Test for fclose -TYPE = DEFAULT -EXE1 = test2 -LANG = cpp -Description -= Tests the PAL implementation of the fclose function. -= fclose will be passed a closed file handle to -= make sure it handles it accordingly. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/CMakeLists.txt deleted file mode 100644 index a492a643a676..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_ferror_test1 - ${SOURCES} -) - -add_dependencies(paltest_ferror_test1 coreclrpal) - -target_link_libraries(paltest_ferror_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/test1.cpp index dbc8a6e240fd..5863d51d0c09 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/test1.cpp @@ -18,7 +18,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_ferror_test1_paltest_ferror_test1, "c_runtime/ferror/test1/paltest_ferror_test1") { const char filename[] = "testfile"; char buffer[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/testinfo.dat deleted file mode 100644 index eba507af4ab7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = ferror -Name = Positive Test for ferror -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the ferror function. -= Open a file, and read some characters. Check that ferror states that -= no error has occurred. Then close the file pointer. Attempt to read -= some more. Check ferror now, and it should indicate that an error has -= occurred. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/CMakeLists.txt deleted file mode 100644 index 313ad09d3d16..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_ferror_test2 - ${SOURCES} -) - -add_dependencies(paltest_ferror_test2 coreclrpal) - -target_link_libraries(paltest_ferror_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/test2.cpp index 2e597e788856..3ac444b0ec35 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/test2.cpp @@ -19,7 +19,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_ferror_test2_paltest_ferror_test2, "c_runtime/ferror/test2/paltest_ferror_test2") { const char filename[] = "testfile"; FILE * fp = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/testinfo.dat deleted file mode 100644 index c230d3009635..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ferror/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = ferror -Name = Positive Test for ferror, call write on a readonly file. -TYPE = DEFAULT -EXE1 = test2 -Description -= Open a read-only file and attempt to write some data to it. -= Check to ensure that an ferror occurs. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/CMakeLists.txt deleted file mode 100644 index 807a5c3bbded..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fflush_test1 - ${SOURCES} -) - -add_dependencies(paltest_fflush_test1 coreclrpal) - -target_link_libraries(paltest_fflush_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/test1.cpp index d9a22dae857e..716a151b5f8f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/test1.cpp @@ -21,7 +21,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fflush_test1_paltest_fflush_test1, "c_runtime/fflush/test1/paltest_fflush_test1") { int TheReturn; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/testinfo.dat deleted file mode 100644 index 1bde5c32bac6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fflush/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fflush -Name = Positive Test for fflush -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests to see that fflush is working properly. Flushes a couple -= buffers and checks the return value. Can't figure out a way to test -= and ensure it is really dropping the buffers, since the system -= does this automatically most of the time ... diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/CMakeLists.txt deleted file mode 100644 index 3fc2acbd717e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fgets_test1 - ${SOURCES} -) - -add_dependencies(paltest_fgets_test1 coreclrpal) - -target_link_libraries(paltest_fgets_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/test1.cpp index 55759e9e9b48..e16c9e2ad9d0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/test1.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fgets_test1_paltest_fgets_test1, "c_runtime/fgets/test1/paltest_fgets_test1") { const char outBuf1[] = "This is a test.\n"; const char outBuf2[] = "This is too."; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/testinfo.dat deleted file mode 100644 index f319b9445a82..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fgets -Name = Positive Test for fgets -TYPE = DEFAULT -EXE1 = test1 -Description -= Writes a simple file and calls fgets() to get a string shorter than -= the first line of the file. Verifies that the correct string is -= returned. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/CMakeLists.txt deleted file mode 100644 index 240ec613d703..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_fgets_test2 - ${SOURCES} -) - -add_dependencies(paltest_fgets_test2 coreclrpal) - -target_link_libraries(paltest_fgets_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/test2.cpp index 36c21fc56bbe..7f21d0758175 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/test2.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fgets_test2_paltest_fgets_test2, "c_runtime/fgets/test2/paltest_fgets_test2") { const char outBuf1[] = "This is a test.\n"; const char outBuf2[] = "This is too."; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/testinfo.dat deleted file mode 100644 index 8687e6aedcf2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fgets -Name = Positive Test for fgets -TYPE = DEFAULT -EXE1 = test2 -Description -= Calls fgets to read a full line from a file. A maximum length -= parameter greater than the length of the line is passed. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/CMakeLists.txt deleted file mode 100644 index 57e774ed9b0c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_fgets_test3 - ${SOURCES} -) - -add_dependencies(paltest_fgets_test3 coreclrpal) - -target_link_libraries(paltest_fgets_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/test3.cpp index bf8074f4a4a2..f46b179de1dd 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/test3.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fgets_test3_paltest_fgets_test3, "c_runtime/fgets/test3/paltest_fgets_test3") { char inBuf[10]; const char filename[] = "testfile.tmp"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/testinfo.dat deleted file mode 100644 index f4549d917336..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fgets/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fgets -Name = Positive Test for fgets -TYPE = DEFAULT -EXE1 = test3 -Description -= Tries to read from an empty file using fgets(), to verify handling of -= EOF condition. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/CMakeLists.txt deleted file mode 100644 index 4a7631516cef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_floor_test1 - ${SOURCES} -) - -add_dependencies(paltest_floor_test1 coreclrpal) - -target_link_libraries(paltest_floor_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/test1.cpp index a9837bfcd55a..549a2d83a0de 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/test1.cpp @@ -43,11 +43,11 @@ struct test }; /** - * validate + * floor_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl floor_test1_validate(double value, double expected, double variance) { double result = floor(value); @@ -65,11 +65,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * floor_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl floor_test1_validate_isnan(double value) { double result = floor(value); @@ -85,7 +85,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_floor_test1_paltest_floor_test1, "c_runtime/floor/test1/paltest_floor_test1") { struct test tests[] = { @@ -112,19 +112,19 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - validate( 0, 0, PAL_EPSILON); - validate(-0.0, 0, PAL_EPSILON); + floor_test1_validate( 0, 0, PAL_EPSILON); + floor_test1_validate(-0.0, 0, PAL_EPSILON); - validate( 1, 1, PAL_EPSILON * 10); - validate(-1.0, -1, PAL_EPSILON * 10); + floor_test1_validate( 1, 1, PAL_EPSILON * 10); + floor_test1_validate(-1.0, -1, PAL_EPSILON * 10); for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -(tests[i].expected + 1), tests[i].variance); + floor_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + floor_test1_validate(-tests[i].value, -(tests[i].expected + 1), tests[i].variance); } - validate_isnan(PAL_NAN); + floor_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/testinfo.dat deleted file mode 100644 index 250ad8a28426..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/floor/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = floor -Name = Positive Test for floor -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to floor() a series of value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/CMakeLists.txt deleted file mode 100644 index 374115643965..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_floorf_test1 - ${SOURCES} -) - -add_dependencies(paltest_floorf_test1 coreclrpal) - -target_link_libraries(paltest_floorf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.c deleted file mode 100644 index 0a1e722e0801..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.c +++ /dev/null @@ -1,130 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: Tests floorf with simple positive and negative values. Also tests -** extreme cases like extremely small values and positive and -** negative infinity. Makes sure that calling floorf on NaN returns -** NaN -** -**==========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = floorf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("floorf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = floorf(value); - - if (!_isnanf(result)) - { - Fail("floorf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char *argv[]) -{ - struct test tests[] = - { - /* value expected variance */ - { 0.318309886f, 0, PAL_EPSILON }, // value: 1 / pi - { 0.434294482f, 0, PAL_EPSILON }, // value: log10f(e) - { 0.636619772f, 0, PAL_EPSILON }, // value: 2 / pi - { 0.693147181f, 0, PAL_EPSILON }, // value: ln(2) - { 0.707106781f, 0, PAL_EPSILON }, // value: 1 / sqrtf(2) - { 0.785398163f, 0, PAL_EPSILON }, // value: pi / 4 - { 1.12837917f, 1, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) - { 1.41421356f, 1, PAL_EPSILON * 10 }, // value: sqrtf(2) - { 1.44269504f, 1, PAL_EPSILON * 10 }, // value: logf2(e) - { 1.57079633f, 1, PAL_EPSILON * 10 }, // value: pi / 2 - { 2.30258509f, 2, PAL_EPSILON * 10 }, // value: ln(10) - { 2.71828183f, 2, PAL_EPSILON * 10 }, // value: e - { 3.14159265f, 3, PAL_EPSILON * 10 }, // value: pi - { PAL_POSINF, PAL_POSINF, 0 } - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - validate( 0, 0, PAL_EPSILON); - validate(-0.0f, 0, PAL_EPSILON); - - validate( 1, 1, PAL_EPSILON * 10); - validate(-1.0f, -1, PAL_EPSILON * 10); - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -(tests[i].expected + 1), tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.cpp new file mode 100644 index 000000000000..b80320c7de31 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.cpp @@ -0,0 +1,130 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================ +** +** Source: test1.c +** +** Purpose: Tests floorf with simple positive and negative values. Also tests +** extreme cases like extremely small values and positive and +** negative infinity. Makes sure that calling floorf on NaN returns +** NaN +** +**==========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * floorf_test1_validate + * + * test validation function + */ +void __cdecl floorf_test1_validate(float value, float expected, float variance) +{ + float result = floorf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("floorf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * floorf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl floorf_test1_validate_isnan(float value) +{ + float result = floorf(value); + + if (!_isnanf(result)) + { + Fail("floorf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_floorf_test1_paltest_floorf_test1, "c_runtime/floorf/test1/paltest_floorf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0.318309886f, 0, PAL_EPSILON }, // value: 1 / pi + { 0.434294482f, 0, PAL_EPSILON }, // value: log10f(e) + { 0.636619772f, 0, PAL_EPSILON }, // value: 2 / pi + { 0.693147181f, 0, PAL_EPSILON }, // value: ln(2) + { 0.707106781f, 0, PAL_EPSILON }, // value: 1 / sqrtf(2) + { 0.785398163f, 0, PAL_EPSILON }, // value: pi / 4 + { 1.12837917f, 1, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) + { 1.41421356f, 1, PAL_EPSILON * 10 }, // value: sqrtf(2) + { 1.44269504f, 1, PAL_EPSILON * 10 }, // value: logf2(e) + { 1.57079633f, 1, PAL_EPSILON * 10 }, // value: pi / 2 + { 2.30258509f, 2, PAL_EPSILON * 10 }, // value: ln(10) + { 2.71828183f, 2, PAL_EPSILON * 10 }, // value: e + { 3.14159265f, 3, PAL_EPSILON * 10 }, // value: pi + { PAL_POSINF, PAL_POSINF, 0 } + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + floorf_test1_validate( 0, 0, PAL_EPSILON); + floorf_test1_validate(-0.0f, 0, PAL_EPSILON); + + floorf_test1_validate( 1, 1, PAL_EPSILON * 10); + floorf_test1_validate(-1.0f, -1, PAL_EPSILON * 10); + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + floorf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + floorf_test1_validate(-tests[i].value, -(tests[i].expected + 1), tests[i].variance); + } + + floorf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/testinfo.dat deleted file mode 100644 index b64c1789f4eb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/floorf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = floorf -Name = Positive Test for floorf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to floorf() a series of value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/CMakeLists.txt deleted file mode 100644 index 0bb96a360c86..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fma_test1 - ${SOURCES} -) - -add_dependencies(paltest_fma_test1 coreclrpal) - -target_link_libraries(paltest_fma_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/test1.cpp index 67aced025353..a82adc4b6caa 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/test1.cpp @@ -44,11 +44,11 @@ struct test }; /** - * validate + * fma_test1_validate * * test validation function */ -void __cdecl validate(double x, double y, double z, double expected, double variance) +void __cdecl fma_test1_validate(double x, double y, double z, double expected, double variance) { double result = fma(x, y, z); @@ -66,11 +66,11 @@ void __cdecl validate(double x, double y, double z, double expected, double vari } /** - * validate + * fma_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double x, double y, double z) +void __cdecl fma_test1_validate_isnan(double x, double y, double z) { double result = fma(x, y, z); @@ -86,7 +86,7 @@ void __cdecl validate_isnan(double x, double y, double z) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fma_test1_paltest_fma_test1, "c_runtime/fma/test1/paltest_fma_test1") { struct test tests[] = { @@ -104,41 +104,41 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].x, tests[i].y, tests[i].z, tests[i].expected, tests[i].variance); + fma_test1_validate(tests[i].x, tests[i].y, tests[i].z, tests[i].expected, tests[i].variance); } // Returns NaN if x or y is infinite, the other is zero, and z is NaN - validate_isnan(PAL_NEGINF, 0, PAL_NAN); - validate_isnan(PAL_POSINF, 0, PAL_NAN); - validate_isnan(0, PAL_NEGINF, PAL_NAN); - validate_isnan(0, PAL_POSINF, PAL_NAN); + fma_test1_validate_isnan(PAL_NEGINF, 0, PAL_NAN); + fma_test1_validate_isnan(PAL_POSINF, 0, PAL_NAN); + fma_test1_validate_isnan(0, PAL_NEGINF, PAL_NAN); + fma_test1_validate_isnan(0, PAL_POSINF, PAL_NAN); // Returns NaN if x or y is infinite, the other is zero, and z is not-NaN - validate_isnan(PAL_POSINF, 0, PAL_NEGINF); - validate_isnan(PAL_NEGINF, 0, PAL_NEGINF); - validate_isnan(0, PAL_POSINF, PAL_NEGINF); - validate_isnan(0, PAL_NEGINF, PAL_NEGINF); + fma_test1_validate_isnan(PAL_POSINF, 0, PAL_NEGINF); + fma_test1_validate_isnan(PAL_NEGINF, 0, PAL_NEGINF); + fma_test1_validate_isnan(0, PAL_POSINF, PAL_NEGINF); + fma_test1_validate_isnan(0, PAL_NEGINF, PAL_NEGINF); - validate_isnan(PAL_POSINF, 0, 0); - validate_isnan(PAL_NEGINF, 0, 0); - validate_isnan(0, PAL_POSINF, 0); - validate_isnan(0, PAL_NEGINF, 0); + fma_test1_validate_isnan(PAL_POSINF, 0, 0); + fma_test1_validate_isnan(PAL_NEGINF, 0, 0); + fma_test1_validate_isnan(0, PAL_POSINF, 0); + fma_test1_validate_isnan(0, PAL_NEGINF, 0); - validate_isnan(PAL_POSINF, 0, PAL_POSINF); - validate_isnan(PAL_NEGINF, 0, PAL_POSINF); - validate_isnan(0, PAL_POSINF, PAL_POSINF); - validate_isnan(0, PAL_NEGINF, PAL_POSINF); + fma_test1_validate_isnan(PAL_POSINF, 0, PAL_POSINF); + fma_test1_validate_isnan(PAL_NEGINF, 0, PAL_POSINF); + fma_test1_validate_isnan(0, PAL_POSINF, PAL_POSINF); + fma_test1_validate_isnan(0, PAL_NEGINF, PAL_POSINF); // Returns NaN if (x * y) is infinite, and z is an infinite of the opposite sign - validate_isnan(PAL_POSINF, PAL_POSINF, PAL_NEGINF); - validate_isnan(PAL_NEGINF, PAL_NEGINF, PAL_NEGINF); - validate_isnan(PAL_POSINF, PAL_NEGINF, PAL_POSINF); - validate_isnan(PAL_NEGINF, PAL_POSINF, PAL_POSINF); - - validate_isnan(PAL_POSINF, 1, PAL_NEGINF); - validate_isnan(PAL_NEGINF, 1, PAL_POSINF); - validate_isnan(1, PAL_POSINF, PAL_NEGINF); - validate_isnan(1, PAL_NEGINF, PAL_POSINF); + fma_test1_validate_isnan(PAL_POSINF, PAL_POSINF, PAL_NEGINF); + fma_test1_validate_isnan(PAL_NEGINF, PAL_NEGINF, PAL_NEGINF); + fma_test1_validate_isnan(PAL_POSINF, PAL_NEGINF, PAL_POSINF); + fma_test1_validate_isnan(PAL_NEGINF, PAL_POSINF, PAL_POSINF); + + fma_test1_validate_isnan(PAL_POSINF, 1, PAL_NEGINF); + fma_test1_validate_isnan(PAL_NEGINF, 1, PAL_POSINF); + fma_test1_validate_isnan(1, PAL_POSINF, PAL_NEGINF); + fma_test1_validate_isnan(1, PAL_NEGINF, PAL_POSINF); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/testinfo.dat deleted file mode 100644 index daa452056d55..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fma/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fma -Name = Call fma with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the fma function with various num/exponent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/CMakeLists.txt deleted file mode 100644 index 3d6be05aa53b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_fmaf_test1 - ${SOURCES} -) - -add_dependencies(paltest_fmaf_test1 coreclrpal) - -target_link_libraries(paltest_fmaf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/test1.c deleted file mode 100644 index 34b63f6c0d28..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/test1.c +++ /dev/null @@ -1,144 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Tests that fmaf returns correct values for a subset of values. -** Tests with positive and negative values of x, y, and z to ensure -** fmaf is returning correct results. -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float x; /* first component of the value to test the function with */ - float y; /* second component of the value to test the function with */ - float z; /* third component of the value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float x, float y, float z, float expected, float variance) -{ - float result = fmaf(x, y, z); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("fmaf(%g, %g, %g) returned %10.9g when it should have returned %10.9g", - x, y, z, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float x, float y, float z) -{ - float result = fmaf(x, y, z); - - if (!_isnanf(result)) - { - Fail("fmaf(%g, %g, %g) returned %10.9g when it should have returned %10.9g", - x, y, z, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* x y z expected variance */ - { PAL_NEGINF, PAL_NEGINF, PAL_NEGINF, PAL_NEGINF, 0 }, - { -1e38, 2, 1e38, -1e38, 0 }, - { 1e38, 2, -1e38, 1e38, 0 }, - { PAL_POSINF, PAL_POSINF, PAL_POSINF, PAL_POSINF, 0 }, - }; - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].x, tests[i].y, tests[i].z, tests[i].expected, tests[i].variance); - } - - // Returns NaN if x or y is infinite, the other is zero, and z is NaN - validate_isnan(PAL_NEGINF, 0, PAL_NAN); - validate_isnan(PAL_POSINF, 0, PAL_NAN); - validate_isnan(0, PAL_NEGINF, PAL_NAN); - validate_isnan(0, PAL_POSINF, PAL_NAN); - - // Returns NaN if x or y is infinite, the other is zero, and z is not-NaN - validate_isnan(PAL_POSINF, 0, PAL_NEGINF); - validate_isnan(PAL_NEGINF, 0, PAL_NEGINF); - validate_isnan(0, PAL_POSINF, PAL_NEGINF); - validate_isnan(0, PAL_NEGINF, PAL_NEGINF); - - validate_isnan(PAL_POSINF, 0, 0); - validate_isnan(PAL_NEGINF, 0, 0); - validate_isnan(0, PAL_POSINF, 0); - validate_isnan(0, PAL_NEGINF, 0); - - validate_isnan(PAL_POSINF, 0, PAL_POSINF); - validate_isnan(PAL_NEGINF, 0, PAL_POSINF); - validate_isnan(0, PAL_POSINF, PAL_POSINF); - validate_isnan(0, PAL_NEGINF, PAL_POSINF); - - // Returns NaN if (x * y) is infinite, and z is an infinite of the opposite sign - validate_isnan(PAL_POSINF, PAL_POSINF, PAL_NEGINF); - validate_isnan(PAL_NEGINF, PAL_NEGINF, PAL_NEGINF); - validate_isnan(PAL_POSINF, PAL_NEGINF, PAL_POSINF); - validate_isnan(PAL_NEGINF, PAL_POSINF, PAL_POSINF); - - validate_isnan(PAL_POSINF, 1, PAL_NEGINF); - validate_isnan(PAL_NEGINF, 1, PAL_POSINF); - validate_isnan(1, PAL_POSINF, PAL_NEGINF); - validate_isnan(1, PAL_NEGINF, PAL_POSINF); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/test1.cpp new file mode 100644 index 000000000000..10015a585118 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/test1.cpp @@ -0,0 +1,144 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Tests that fmaf returns correct values for a subset of values. +** Tests with positive and negative values of x, y, and z to ensure +** fmaf is returning correct results. +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float x; /* first component of the value to test the function with */ + float y; /* second component of the value to test the function with */ + float z; /* third component of the value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * fmaf_test1_validate + * + * test validation function + */ +void __cdecl fmaf_test1_validate(float x, float y, float z, float expected, float variance) +{ + float result = fmaf(x, y, z); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("fmaf(%g, %g, %g) returned %10.9g when it should have returned %10.9g", + x, y, z, result, expected); + } +} + +/** + * fmaf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl fmaf_test1_validate_isnan(float x, float y, float z) +{ + float result = fmaf(x, y, z); + + if (!_isnanf(result)) + { + Fail("fmaf(%g, %g, %g) returned %10.9g when it should have returned %10.9g", + x, y, z, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_fmaf_test1_paltest_fmaf_test1, "c_runtime/fmaf/test1/paltest_fmaf_test1") +{ + struct test tests[] = + { + /* x y z expected variance */ + { PAL_NEGINF, PAL_NEGINF, PAL_NEGINF, PAL_NEGINF, 0 }, + { -1e38, 2, 1e38, -1e38, 0 }, + { 1e38, 2, -1e38, 1e38, 0 }, + { PAL_POSINF, PAL_POSINF, PAL_POSINF, PAL_POSINF, 0 }, + }; + + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + fmaf_test1_validate(tests[i].x, tests[i].y, tests[i].z, tests[i].expected, tests[i].variance); + } + + // Returns NaN if x or y is infinite, the other is zero, and z is NaN + fmaf_test1_validate_isnan(PAL_NEGINF, 0, PAL_NAN); + fmaf_test1_validate_isnan(PAL_POSINF, 0, PAL_NAN); + fmaf_test1_validate_isnan(0, PAL_NEGINF, PAL_NAN); + fmaf_test1_validate_isnan(0, PAL_POSINF, PAL_NAN); + + // Returns NaN if x or y is infinite, the other is zero, and z is not-NaN + fmaf_test1_validate_isnan(PAL_POSINF, 0, PAL_NEGINF); + fmaf_test1_validate_isnan(PAL_NEGINF, 0, PAL_NEGINF); + fmaf_test1_validate_isnan(0, PAL_POSINF, PAL_NEGINF); + fmaf_test1_validate_isnan(0, PAL_NEGINF, PAL_NEGINF); + + fmaf_test1_validate_isnan(PAL_POSINF, 0, 0); + fmaf_test1_validate_isnan(PAL_NEGINF, 0, 0); + fmaf_test1_validate_isnan(0, PAL_POSINF, 0); + fmaf_test1_validate_isnan(0, PAL_NEGINF, 0); + + fmaf_test1_validate_isnan(PAL_POSINF, 0, PAL_POSINF); + fmaf_test1_validate_isnan(PAL_NEGINF, 0, PAL_POSINF); + fmaf_test1_validate_isnan(0, PAL_POSINF, PAL_POSINF); + fmaf_test1_validate_isnan(0, PAL_NEGINF, PAL_POSINF); + + // Returns NaN if (x * y) is infinite, and z is an infinite of the opposite sign + fmaf_test1_validate_isnan(PAL_POSINF, PAL_POSINF, PAL_NEGINF); + fmaf_test1_validate_isnan(PAL_NEGINF, PAL_NEGINF, PAL_NEGINF); + fmaf_test1_validate_isnan(PAL_POSINF, PAL_NEGINF, PAL_POSINF); + fmaf_test1_validate_isnan(PAL_NEGINF, PAL_POSINF, PAL_POSINF); + + fmaf_test1_validate_isnan(PAL_POSINF, 1, PAL_NEGINF); + fmaf_test1_validate_isnan(PAL_NEGINF, 1, PAL_POSINF); + fmaf_test1_validate_isnan(1, PAL_POSINF, PAL_NEGINF); + fmaf_test1_validate_isnan(1, PAL_NEGINF, PAL_POSINF); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/testinfo.dat deleted file mode 100644 index d62caa5bc545..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmaf/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fmaf -Name = Call fmaf with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the fmaf function with various num/expfonent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/CMakeLists.txt deleted file mode 100644 index 099b0981b3d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fmod_test1 - ${SOURCES} -) - -add_dependencies(paltest_fmod_test1 coreclrpal) - -target_link_libraries(paltest_fmod_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/test1.cpp index cf4ec5891dfc..d02b09d0e0d0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/test1.cpp @@ -46,11 +46,11 @@ struct test }; /** - * validate + * fmod_test1_validate * * test validation function */ -void __cdecl validate(double numerator, double denominator, double expected, double variance) +void __cdecl fmod_test1_validate(double numerator, double denominator, double expected, double variance) { double result = fmod(numerator, denominator); @@ -68,11 +68,11 @@ void __cdecl validate(double numerator, double denominator, double expected, dou } /** - * validate + * fmod_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double numerator, double denominator) +void __cdecl fmod_test1_validate_isnan(double numerator, double denominator) { double result = fmod(numerator, denominator); @@ -88,7 +88,7 @@ void __cdecl validate_isnan(double numerator, double denominator) * * executable entry point */ -INT __cdecl main(INT argc, CHAR **argv) +PALTEST(c_runtime_fmod_test1_paltest_fmod_test1, "c_runtime/fmod/test1/paltest_fmod_test1") { struct test tests[] = { @@ -120,36 +120,36 @@ INT __cdecl main(INT argc, CHAR **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].numerator, tests[i].denominator, tests[i].expected, tests[i].variance); - validate(-tests[i].numerator, tests[i].denominator, -tests[i].expected, tests[i].variance); - validate( tests[i].numerator, -tests[i].denominator, tests[i].expected, tests[i].variance); - validate(-tests[i].numerator, -tests[i].denominator, -tests[i].expected, tests[i].variance); + fmod_test1_validate( tests[i].numerator, tests[i].denominator, tests[i].expected, tests[i].variance); + fmod_test1_validate(-tests[i].numerator, tests[i].denominator, -tests[i].expected, tests[i].variance); + fmod_test1_validate( tests[i].numerator, -tests[i].denominator, tests[i].expected, tests[i].variance); + fmod_test1_validate(-tests[i].numerator, -tests[i].denominator, -tests[i].expected, tests[i].variance); } - validate_isnan( 0, 0); - validate_isnan(-0.0, 0); - validate_isnan( 0, -0.0); - validate_isnan(-0.0, -0.0); + fmod_test1_validate_isnan( 0, 0); + fmod_test1_validate_isnan(-0.0, 0); + fmod_test1_validate_isnan( 0, -0.0); + fmod_test1_validate_isnan(-0.0, -0.0); - validate_isnan( 1, 0); - validate_isnan(-1.0, 0); - validate_isnan( 1, -0.0); - validate_isnan(-1.0, -0.0); + fmod_test1_validate_isnan( 1, 0); + fmod_test1_validate_isnan(-1.0, 0); + fmod_test1_validate_isnan( 1, -0.0); + fmod_test1_validate_isnan(-1.0, -0.0); - validate_isnan(PAL_POSINF, PAL_POSINF); - validate_isnan(PAL_NEGINF, PAL_POSINF); - validate_isnan(PAL_POSINF, PAL_NEGINF); - validate_isnan(PAL_NEGINF, PAL_NEGINF); + fmod_test1_validate_isnan(PAL_POSINF, PAL_POSINF); + fmod_test1_validate_isnan(PAL_NEGINF, PAL_POSINF); + fmod_test1_validate_isnan(PAL_POSINF, PAL_NEGINF); + fmod_test1_validate_isnan(PAL_NEGINF, PAL_NEGINF); - validate_isnan(PAL_POSINF, 0); - validate_isnan(PAL_NEGINF, 0); - validate_isnan(PAL_POSINF, -0.0); - validate_isnan(PAL_NEGINF, -0.0); + fmod_test1_validate_isnan(PAL_POSINF, 0); + fmod_test1_validate_isnan(PAL_NEGINF, 0); + fmod_test1_validate_isnan(PAL_POSINF, -0.0); + fmod_test1_validate_isnan(PAL_NEGINF, -0.0); - validate_isnan(PAL_POSINF, 1); - validate_isnan(PAL_NEGINF, 1); - validate_isnan(PAL_POSINF, -1.0); - validate_isnan(PAL_NEGINF, -1.0); + fmod_test1_validate_isnan(PAL_POSINF, 1); + fmod_test1_validate_isnan(PAL_NEGINF, 1); + fmod_test1_validate_isnan(PAL_POSINF, -1.0); + fmod_test1_validate_isnan(PAL_NEGINF, -1.0); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/testinfo.dat deleted file mode 100644 index ff196cad90ad..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmod/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fmod -Name = Positive Test for fmod -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to fmod() a series of values, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/CMakeLists.txt deleted file mode 100644 index ac125ab52754..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fmodf_test1 - ${SOURCES} -) - -add_dependencies(paltest_fmodf_test1 coreclrpal) - -target_link_libraries(paltest_fmodf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.cpp index 9768db041b75..b73f7824f166 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * fmodf_test1_validate * * test validation function */ -void __cdecl validate(float numerator, float denominator, float expected, float variance) +void __cdecl fmodf_test1_validate(float numerator, float denominator, float expected, float variance) { float result = fmodf(numerator, denominator); @@ -67,11 +67,11 @@ void __cdecl validate(float numerator, float denominator, float expected, float } /** - * validate + * fmodf_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(float numerator, float denominator) +void __cdecl fmodf_test1_validate_isnan(float numerator, float denominator) { float result = fmodf(numerator, denominator); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(float numerator, float denominator) * * executable entry point */ -INT __cdecl main(INT argc, CHAR **argv) +PALTEST(c_runtime_fmodf_test1_paltest_fmodf_test1, "c_runtime/fmodf/test1/paltest_fmodf_test1") { struct test tests[] = { @@ -119,36 +119,36 @@ INT __cdecl main(INT argc, CHAR **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].numerator, tests[i].denominator, tests[i].expected, tests[i].variance); - validate(-tests[i].numerator, tests[i].denominator, -tests[i].expected, tests[i].variance); - validate( tests[i].numerator, -tests[i].denominator, tests[i].expected, tests[i].variance); - validate(-tests[i].numerator, -tests[i].denominator, -tests[i].expected, tests[i].variance); + fmodf_test1_validate( tests[i].numerator, tests[i].denominator, tests[i].expected, tests[i].variance); + fmodf_test1_validate(-tests[i].numerator, tests[i].denominator, -tests[i].expected, tests[i].variance); + fmodf_test1_validate( tests[i].numerator, -tests[i].denominator, tests[i].expected, tests[i].variance); + fmodf_test1_validate(-tests[i].numerator, -tests[i].denominator, -tests[i].expected, tests[i].variance); } - validate_isnan( 0, 0); - validate_isnan(-0.0f, 0); - validate_isnan( 0, -0.0f); - validate_isnan(-0.0f, -0.0f); + fmodf_test1_validate_isnan( 0, 0); + fmodf_test1_validate_isnan(-0.0f, 0); + fmodf_test1_validate_isnan( 0, -0.0f); + fmodf_test1_validate_isnan(-0.0f, -0.0f); - validate_isnan( 1, 0); - validate_isnan(-1, 0); - validate_isnan( 1, -0.0f); - validate_isnan(-1, -0.0f); + fmodf_test1_validate_isnan( 1, 0); + fmodf_test1_validate_isnan(-1, 0); + fmodf_test1_validate_isnan( 1, -0.0f); + fmodf_test1_validate_isnan(-1, -0.0f); - validate_isnan(PAL_POSINF, PAL_POSINF); - validate_isnan(PAL_NEGINF, PAL_POSINF); - validate_isnan(PAL_POSINF, PAL_NEGINF); - validate_isnan(PAL_NEGINF, PAL_NEGINF); + fmodf_test1_validate_isnan(PAL_POSINF, PAL_POSINF); + fmodf_test1_validate_isnan(PAL_NEGINF, PAL_POSINF); + fmodf_test1_validate_isnan(PAL_POSINF, PAL_NEGINF); + fmodf_test1_validate_isnan(PAL_NEGINF, PAL_NEGINF); - validate_isnan(PAL_POSINF, 0); - validate_isnan(PAL_NEGINF, 0); - validate_isnan(PAL_POSINF, -0.0f); - validate_isnan(PAL_NEGINF, -0.0f); + fmodf_test1_validate_isnan(PAL_POSINF, 0); + fmodf_test1_validate_isnan(PAL_NEGINF, 0); + fmodf_test1_validate_isnan(PAL_POSINF, -0.0f); + fmodf_test1_validate_isnan(PAL_NEGINF, -0.0f); - validate_isnan(PAL_POSINF, 1); - validate_isnan(PAL_NEGINF, 1); - validate_isnan(PAL_POSINF, -1); - validate_isnan(PAL_NEGINF, -1); + fmodf_test1_validate_isnan(PAL_POSINF, 1); + fmodf_test1_validate_isnan(PAL_NEGINF, 1); + fmodf_test1_validate_isnan(PAL_POSINF, -1); + fmodf_test1_validate_isnan(PAL_NEGINF, -1); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/testinfo.dat deleted file mode 100644 index 6c9ac05fe63c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fmodf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fmodf -Name = Positive Test for fmodf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to fmodf() a series of values, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/CMakeLists.txt deleted file mode 100644 index 7cd88f8e86da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/CMakeLists.txt deleted file mode 100644 index b0bae9fcb26e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fopen_test1 - ${SOURCES} -) - -add_dependencies(paltest_fopen_test1 coreclrpal) - -target_link_libraries(paltest_fopen_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/test1.cpp index 42009e8acf0d..abbc328d5946 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/test1.cpp @@ -24,7 +24,7 @@ struct testCase char mode[20]; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fopen_test1_paltest_fopen_test1, "c_runtime/fopen/test1/paltest_fopen_test1") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/testinfo.dat deleted file mode 100644 index efff7c8005ca..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fopen -Name = Positive Test for fopen -TYPE = DEFAULT -EXE1 = test1 -Description -= This test simply attempts to open a number of files with different -= modes. It checks to ensure a valid file pointer is returned. It -= doesn't do any checking to ensure the mode is really what it claims. -= Checks for returned value when attempts to open a directory. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/CMakeLists.txt deleted file mode 100644 index a3efc8863515..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_fopen_test2 - ${SOURCES} -) - -add_dependencies(paltest_fopen_test2 coreclrpal) - -target_link_libraries(paltest_fopen_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/test2.cpp index 8c66c66fcd69..b588c41fd23e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/test2.cpp @@ -20,7 +20,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fopen_test2_paltest_fopen_test2, "c_runtime/fopen/test2/paltest_fopen_test2") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/testinfo.dat deleted file mode 100644 index 0201327fb163..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fopen -Name = Positive Test for fopen -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to ensure that you can write to a 'w' mode file. And that you can't -= read from a 'w' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/CMakeLists.txt deleted file mode 100644 index c6686ac4cce3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_fopen_test3 - ${SOURCES} -) - -add_dependencies(paltest_fopen_test3 coreclrpal) - -target_link_libraries(paltest_fopen_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/test3.cpp index fd1a7976d619..3be80f161099 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/test3.cpp @@ -20,7 +20,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fopen_test3_paltest_fopen_test3, "c_runtime/fopen/test3/paltest_fopen_test3") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/testinfo.dat deleted file mode 100644 index 3b9864641b35..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fopen -Name = Positive Test for fopen -TYPE = DEFAULT -EXE1 = test3 -Description -= Test to ensure that you can write to a 'w+' mode file. And that you can -= read from a 'w+' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/CMakeLists.txt deleted file mode 100644 index ab92939643c0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_fopen_test4 - ${SOURCES} -) - -add_dependencies(paltest_fopen_test4 coreclrpal) - -target_link_libraries(paltest_fopen_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/test4.cpp index 83c6987397d1..24f8bfa11e79 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/test4.cpp @@ -20,7 +20,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fopen_test4_paltest_fopen_test4, "c_runtime/fopen/test4/paltest_fopen_test4") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/testinfo.dat deleted file mode 100644 index ba3a6c59518f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test4/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fopen -Name = Positive Test for fopen -TYPE = DEFAULT -EXE1 = test4 -Description -= Test to ensure that you can't write to a 'r' mode file. And that you can -= read from a 'r' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/CMakeLists.txt deleted file mode 100644 index ccbce5d6ba45..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_fopen_test5 - ${SOURCES} -) - -add_dependencies(paltest_fopen_test5 coreclrpal) - -target_link_libraries(paltest_fopen_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/test5.cpp index 81428a4dcfca..04205aca8335 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/test5.cpp @@ -21,7 +21,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fopen_test5_paltest_fopen_test5, "c_runtime/fopen/test5/paltest_fopen_test5") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/testinfo.dat deleted file mode 100644 index 5528ec39b500..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test5/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fopen -Name = Positive Test for fopen -TYPE = DEFAULT -EXE1 = test5 -Description -= Test to ensure that you can write to a 'r+' mode file. And that you can -= read from a 'r+' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/CMakeLists.txt deleted file mode 100644 index 7e373e71fa90..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_fopen_test6 - ${SOURCES} -) - -add_dependencies(paltest_fopen_test6 coreclrpal) - -target_link_libraries(paltest_fopen_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/test6.cpp index 7e55b0963c47..13f00cc9300b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/test6.cpp @@ -22,7 +22,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fopen_test6_paltest_fopen_test6, "c_runtime/fopen/test6/paltest_fopen_test6") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/testinfo.dat deleted file mode 100644 index c28ce15b9750..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test6/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fopen -Name = Positive Test for fopen -TYPE = DEFAULT -EXE1 = test6 -Description -= Test to ensure that you can write to a 'a' mode file. And that you can't -= read from a 'a' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/CMakeLists.txt deleted file mode 100644 index 8c8d1c2c37dc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_fopen_test7 - ${SOURCES} -) - -add_dependencies(paltest_fopen_test7 coreclrpal) - -target_link_libraries(paltest_fopen_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/test7.cpp index 719ed7d08252..0cf274d8c6b7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/test7.cpp @@ -22,7 +22,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fopen_test7_paltest_fopen_test7, "c_runtime/fopen/test7/paltest_fopen_test7") { FILE *fp; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/testinfo.dat deleted file mode 100644 index 642695288ed3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fopen/test7/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fopen -Name = Positive Test for fopen -TYPE = DEFAULT -EXE1 = test7 -Description -= Test to ensure that you can write to a 'a+' mode file. And that you can -= read from a 'a+' mode file. - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/CMakeLists.txt deleted file mode 100644 index 256753a63646..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h index beead0eee58c..fe19a4d74589 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h @@ -10,7 +10,7 @@ function with this as a return type. #ifndef __FPRINTF_H__ #define __FPRINTF_H__ -void DoStrTest(const char *formatstr, char* param, const char *checkstr) +inline void DoStrTest_fprintf(const char *formatstr, char* param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -32,8 +32,9 @@ void DoStrTest(const char *formatstr, char* param, const char *checkstr) } fclose(fp); } +#define DoStrTest DoStrTest_fprintf -void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_fprintf(const char *formatstr, WCHAR* param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -55,9 +56,9 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) } fclose(fp); } +#define DoWStrTest DoWStrTest_fprintf - -void DoCharTest(const char *formatstr, char param, const char *checkstr) +inline void DoCharTest_fprintf(const char *formatstr, char param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -79,8 +80,9 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr) } fclose(fp); } +#define DoCharTest DoCharTest_fprintf -void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_fprintf(const char *formatstr, WCHAR param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -102,8 +104,9 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) } fclose(fp); } +#define DoWCharTest DoWCharTest_fprintf -void DoNumTest(const char *formatstr, int value, const char *checkstr) +inline void DoNumTest_fprintf(const char *formatstr, int value, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -125,8 +128,9 @@ void DoNumTest(const char *formatstr, int value, const char *checkstr) } fclose(fp); } +#define DoNumTest DoNumTest_fprintf -void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1, const char *checkstr2) +inline void DoI64Test_fprintf(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1, const char *checkstr2) { FILE *fp; char buf[256] = { 0 }; @@ -149,8 +153,9 @@ void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *c } fclose(fp); } +#define DoI64Test DoI64Test_fprintf -void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, const char *checkstr2) +inline void DoDoubleTest_fprintf(const char *formatstr, double value, const char *checkstr1, const char *checkstr2) { FILE *fp; char buf[256] = { 0 }; @@ -173,4 +178,5 @@ void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, co } fclose(fp); } +#define DoDoubleTest DoDoubleTest_fprintf #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/CMakeLists.txt deleted file mode 100644 index c092aaf9eeee..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test1 coreclrpal) - -target_link_libraries(paltest_fprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.cpp index b97ed0e1b923..8fa9ef72fc7e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fgets, fseek and fclose. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test1_paltest_fprintf_test1, "c_runtime/fprintf/test1/paltest_fprintf_test1") { FILE *fp; char testfile[] = "testfile.txt"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/testinfo.dat deleted file mode 100644 index e5049fea0506..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= A single, basic, test case with no formatting. -= Test modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/CMakeLists.txt deleted file mode 100644 index c095555ed6f9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_fprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test10 coreclrpal) - -target_link_libraries(paltest_fprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.cpp index b7061b62ac02..b94ee2e7a7ee 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test10_paltest_fprintf_test10, "c_runtime/fprintf/test10/paltest_fprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/testinfo.dat deleted file mode 100644 index f7704dd56738..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test10/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests the octal specifier (%o). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/CMakeLists.txt deleted file mode 100644 index 32559bf8003e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_fprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test11 coreclrpal) - -target_link_libraries(paltest_fprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.cpp index 4451ccdb5ac7..4b987fcb2663 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test11_paltest_fprintf_test11, "c_runtime/fprintf/test11/paltest_fprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/testinfo.dat deleted file mode 100644 index 8a7084e1b04e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test11/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test11 -Description -= Test the unsigned int specifier (%u). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/CMakeLists.txt deleted file mode 100644 index 1ee3cb295d27..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_fprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test12 coreclrpal) - -target_link_libraries(paltest_fprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.cpp index db65b1c44582..368de6987a48 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test12_paltest_fprintf_test12, "c_runtime/fprintf/test12/paltest_fprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/testinfo.dat deleted file mode 100644 index 80f855c05872..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test12/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests the (lowercase) hexadecimal specifier (%x). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/CMakeLists.txt deleted file mode 100644 index 1c4049e992df..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_fprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test13 coreclrpal) - -target_link_libraries(paltest_fprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.cpp index 7a29345aa777..52cca2d9e79f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test13_paltest_fprintf_test13, "c_runtime/fprintf/test13/paltest_fprintf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/testinfo.dat deleted file mode 100644 index 49c0c469fda3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test13/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests the (uppercase) hexadecimal specifier (%X). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/CMakeLists.txt deleted file mode 100644 index 3266d846d1b8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_fprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test14 coreclrpal) - -target_link_libraries(paltest_fprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.cpp index 1396181e467f..2d230acbc32c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.cpp @@ -19,7 +19,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test14_paltest_fprintf_test14, "c_runtime/fprintf/test14/paltest_fprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/testinfo.dat deleted file mode 100644 index 0628542f3e3e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test14/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests the lowercase exponential -= notation double specifier (%e). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/CMakeLists.txt deleted file mode 100644 index 51e744493959..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_fprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test15 coreclrpal) - -target_link_libraries(paltest_fprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.cpp index 0a1d25880d14..c5b15723c5e0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.cpp @@ -19,7 +19,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test15_paltest_fprintf_test15, "c_runtime/fprintf/test15/paltest_fprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/testinfo.dat deleted file mode 100644 index af6d4f56bd46..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test15/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests the uppercase exponential -= notation double specifier (%E). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/CMakeLists.txt deleted file mode 100644 index 388ff218ef38..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_fprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test16 coreclrpal) - -target_link_libraries(paltest_fprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.cpp index e68876a12f55..fd56b5b54fe6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test16_paltest_fprintf_test16, "c_runtime/fprintf/test16/paltest_fprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/testinfo.dat deleted file mode 100644 index 1bbed723c366..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test16/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests the decimal notation double specifier (%f). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/CMakeLists.txt deleted file mode 100644 index b2f46f51057f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_fprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test17 coreclrpal) - -target_link_libraries(paltest_fprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.cpp index a2b366c184c3..e12048d25cef 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test17_paltest_fprintf_test17, "c_runtime/fprintf/test17/paltest_fprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/testinfo.dat deleted file mode 100644 index 014c9c60d00b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test17/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests the lowercase shorthand notation double specifier (%g). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/CMakeLists.txt deleted file mode 100644 index 65a2329b235c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_fprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test18 coreclrpal) - -target_link_libraries(paltest_fprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.cpp index 6c28d6d8d3f1..62e4b6622f2d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test18_paltest_fprintf_test18, "c_runtime/fprintf/test18/paltest_fprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/testinfo.dat deleted file mode 100644 index a1bd6109c49e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test18/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests the uppercase shorthand notation double specifier (%G). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/CMakeLists.txt deleted file mode 100644 index 934285871ef7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_fprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test19 coreclrpal) - -target_link_libraries(paltest_fprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.cpp index 7e82b98311db..26a92db5142e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.cpp @@ -104,7 +104,7 @@ void DoublePrecTest(char *formatstr, int precision, } -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test19_paltest_fprintf_test19, "c_runtime/fprintf/test19/paltest_fprintf_test19") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/testinfo.dat deleted file mode 100644 index d30e57dfa2e3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test19/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests the variable length precision argument. -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/CMakeLists.txt deleted file mode 100644 index daa9a5fd991e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_fprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test2 coreclrpal) - -target_link_libraries(paltest_fprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.cpp index 79c638027dee..8d08177463a6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test2_paltest_fprintf_test2, "c_runtime/fprintf/test2/paltest_fprintf_test2") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/testinfo.dat deleted file mode 100644 index eac39643ac94..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the string specifier (%s). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/CMakeLists.txt deleted file mode 100644 index 7b3ed7b3096c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_fprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test3 coreclrpal) - -target_link_libraries(paltest_fprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.cpp index 8819aa36c352..6f15affb4d93 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test3_paltest_fprintf_test3, "c_runtime/fprintf/test3/paltest_fprintf_test3") { if (PAL_Initialize(argc, argv) != 0) return(FAIL); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/testinfo.dat deleted file mode 100644 index 9fa452afa34b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests the wide string specifier (%S). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/CMakeLists.txt deleted file mode 100644 index 10a3c948b699..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_fprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test4 coreclrpal) - -target_link_libraries(paltest_fprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.cpp index 00450ba852f1..2717de09db49 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.cpp @@ -62,7 +62,7 @@ static void DoTest(char *formatstr, void* param, char* paramstr, } -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test4_paltest_fprintf_test4, "c_runtime/fprintf/test4/paltest_fprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/testinfo.dat deleted file mode 100644 index cbea30319754..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test4/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests the pointer specifier (%p). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/CMakeLists.txt deleted file mode 100644 index 87536616d0d5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_fprintf_test5 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test5 coreclrpal) - -target_link_libraries(paltest_fprintf_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.cpp index 8318b1a83ef7..1834f248db1e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.cpp @@ -108,7 +108,7 @@ static void DoShortTest(char *formatstr, int param, char *checkstr) } } -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test5_paltest_fprintf_test5, "c_runtime/fprintf/test5/paltest_fprintf_test5") { if (PAL_Initialize(argc, argv) != 0) return(FAIL); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/testinfo.dat deleted file mode 100644 index ac3e1e9dafd7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test5/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests the count specifier (%n). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/CMakeLists.txt deleted file mode 100644 index 8c7253cd7821..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_fprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test6 coreclrpal) - -target_link_libraries(paltest_fprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.cpp index 0de4fedc065e..5cf185cd5c88 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test6_paltest_fprintf_test6, "c_runtime/fprintf/test6/paltest_fprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/testinfo.dat deleted file mode 100644 index cbad94d74a86..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test6/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests the char specifier (%c). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/CMakeLists.txt deleted file mode 100644 index 7e803e709d5c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_fprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test7 coreclrpal) - -target_link_libraries(paltest_fprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.cpp index 12bb0e595d4f..d81916c8a28e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test7_paltest_fprintf_test7, "c_runtime/fprintf/test7/paltest_fprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/testinfo.dat deleted file mode 100644 index aef742a3dcb7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test7/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests the wide char specifier (%C). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/CMakeLists.txt deleted file mode 100644 index 0dd9501e474b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_fprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test8 coreclrpal) - -target_link_libraries(paltest_fprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.cpp index a59cee3caa3a..3392affaef75 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test8_paltest_fprintf_test8, "c_runtime/fprintf/test8/paltest_fprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/testinfo.dat deleted file mode 100644 index e18af7dd2ad7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test8/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests the decimal specifier (%d). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/CMakeLists.txt deleted file mode 100644 index 60ad74927927..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_fprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_fprintf_test9 coreclrpal) - -target_link_libraries(paltest_fprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.cpp index 978a06177d2a..7e42d5daf697 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fprintf_test9_paltest_fprintf_test9, "c_runtime/fprintf/test9/paltest_fprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/testinfo.dat deleted file mode 100644 index 6a8ae9653a82..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fprintf/test9/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fprintf -Name = Positive Test for fprintf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests the integer specifier (%i). -= This test is modeled after the fprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/CMakeLists.txt deleted file mode 100644 index 1a9ccfa12356..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fputs_test1 - ${SOURCES} -) - -add_dependencies(paltest_fputs_test1 coreclrpal) - -target_link_libraries(paltest_fputs_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/test1.cpp index e4e0443faa60..c746daff9e6d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/test1.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fputs_test1_paltest_fputs_test1, "c_runtime/fputs/test1/paltest_fputs_test1") { FILE* TheFile; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/testinfo.dat deleted file mode 100644 index 199eb4684af6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fputs -Name = Check that fputs writes correctly to a valid stream -TYPE = DEFAULT -EXE1 = test1 -Description -= Call fputs twice and write two strings to a file. Then -= call fread on the file and check that the data which was written is what -= we expect it to be. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/CMakeLists.txt deleted file mode 100644 index 261b420e015f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_fputs_test2 - ${SOURCES} -) - -add_dependencies(paltest_fputs_test2 coreclrpal) - -target_link_libraries(paltest_fputs_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/test2.cpp index 3b1c8baf4bcf..aa8d36a5115b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/test2.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fputs_test2_paltest_fputs_test2, "c_runtime/fputs/test2/paltest_fputs_test2") { FILE* TheFile; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/testinfo.dat deleted file mode 100644 index 923eaf11afd9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fputs/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fputs -Name = Check that fputs returns EOF when called on closed/readonly streams -TYPE = DEFAULT -EXE1 = test2 -Description -= Check to see that fputs fails and returns EOF when called on -= a closed file stream and a read-only file stream. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/CMakeLists.txt deleted file mode 100644 index a4e54c42feae..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fread_test1 - ${SOURCES} -) - -add_dependencies(paltest_fread_test1 coreclrpal) - -target_link_libraries(paltest_fread_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/test1.cpp index 95d60d544eb7..3cfe9fa444a5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/test1.cpp @@ -29,7 +29,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fread_test1_paltest_fread_test1, "c_runtime/fread/test1/paltest_fread_test1") { const char filename[] = "testfile"; char buffer[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/testinfo.dat deleted file mode 100644 index 79351d10fc3a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fread -Name = Positive Test for fread -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the fread function. -= Open a file in READ mode, and then try to read all the characters, -= more than all the characters, 0 characters and 0 sized characters and -= check that the return values are correct. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/CMakeLists.txt deleted file mode 100644 index 01fd7c77765f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_fread_test2 - ${SOURCES} -) - -add_dependencies(paltest_fread_test2 coreclrpal) - -target_link_libraries(paltest_fread_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/test2.cpp index 53f5f6b1cbfd..de372204eb66 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/test2.cpp @@ -31,7 +31,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fread_test2_paltest_fread_test2, "c_runtime/fread/test2/paltest_fread_test2") { const char filename[] = "testfile"; char buffer[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/testinfo.dat deleted file mode 100644 index 06205cef6692..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test2/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fread -Name = Positive Test for fread -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the fread function. -= Open a file in READ mode, and then try to read all -= the characters, more than all the characters, -= 0 characters and 0 sized characters and check that -= the strings read in are correct. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/CMakeLists.txt deleted file mode 100644 index 07615a3d285b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_fread_test3 - ${SOURCES} -) - -add_dependencies(paltest_fread_test3 coreclrpal) - -target_link_libraries(paltest_fread_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/test3.cpp index c4998ab8230c..75ae9c6ad1b3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/test3.cpp @@ -25,7 +25,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fread_test3_paltest_fread_test3, "c_runtime/fread/test3/paltest_fread_test3") { const char filename[] = "testfile"; char buffer[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/testinfo.dat deleted file mode 100644 index 9662aeb5b6e6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fread/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fread -Name = Positive Test for fread -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests the PAL implementation of the fread function. -= Open a file in READ mode, then try to read from the file with -= different 'size' params. Check to ensure the return values and -= the text in the buffer is correct diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/free/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/free/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/free/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/CMakeLists.txt deleted file mode 100644 index c8c5aa9be9d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_free_test1 - ${SOURCES} -) - -add_dependencies(paltest_free_test1 coreclrpal) - -target_link_libraries(paltest_free_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/test1.cpp index ca49da436fd4..dc8d13158862 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_free_test1_paltest_free_test1, "c_runtime/free/test1/paltest_free_test1") { char *testA; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/testinfo.dat deleted file mode 100644 index a220635ee5cb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/free/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = free -Name = Positive Test for free -TYPE = DEFAULT -EXE1 = test1 -Description -= Repeatedly allocates and frees a chunk of memory, to verify that free -= is really returning memory to the heap - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/CMakeLists.txt deleted file mode 100644 index b175d42a660b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fseek_test1 - ${SOURCES} -) - -add_dependencies(paltest_fseek_test1 coreclrpal) - -target_link_libraries(paltest_fseek_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.cpp index 2fd1144571a8..7fdfc2fef2fe 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.cpp @@ -39,7 +39,7 @@ static BOOL Cleanup(HANDLE hFile) return result; } -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fseek_test1_paltest_fseek_test1, "c_runtime/fseek/test1/paltest_fseek_test1") { char outBuf[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char inBuf[20]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/testinfo.dat deleted file mode 100644 index 32e862db75e1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fseek/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fseek -Name = Positive Test for fseek -TYPE = DEFAULT -EXE1 = test1 -Description -= Call seek to move a file pointer to the start of a file, a position -= offset from the start, a position offset from the current position, and -= a position offset from the end of the file. Check that the file -= pointer is at the correct position after each seek. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/CMakeLists.txt deleted file mode 100644 index 4167741726b9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ftell.cpp -) - -add_executable(paltest_ftell_test1 - ${SOURCES} -) - -add_dependencies(paltest_ftell_test1 coreclrpal) - -target_link_libraries(paltest_ftell_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.cpp index b5900887e5d9..1c60fab20791 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.cpp @@ -82,7 +82,7 @@ BOOL MovePointer(long lDist, int nFrom) -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_ftell_test1_paltest_ftell_test1, "c_runtime/ftell/test1/paltest_ftell_test1") { const char szFileName[] = {"testfile.txt"}; long lPos = -1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/testinfo.dat deleted file mode 100644 index e4f2333213c8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ftell/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = c_runtime -Function = ftell -Name = test for ftell (test 1) -Type = DEFAULT -EXE1 = ftell -Description -= Use fseek and a static list of distances to move, direction -= to move and expected results to test the ftell function. A typical -= test will move the file pointer with fseek then call ftell. The -= results from ftell will then be compared to the expected result to -= determine whether the test passed or failed. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/CMakeLists.txt deleted file mode 100644 index 256753a63646..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h index f6bfc10918b4..25376de5e9f7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h @@ -13,7 +13,7 @@ #ifndef __fwprintf_H__ #define __fwprintf_H__ -void DoStrTest(const WCHAR *formatstr, char* param, const char *checkstr) +inline void DoStrTest_fwprintf(const WCHAR *formatstr, char* param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -43,8 +43,9 @@ void DoStrTest(const WCHAR *formatstr, char* param, const char *checkstr) } fclose(fp); } +#define DoStrTest DoStrTest_fwprintf -void DoWStrTest(const WCHAR *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_fwprintf(const WCHAR *formatstr, WCHAR* param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -74,9 +75,9 @@ void DoWStrTest(const WCHAR *formatstr, WCHAR* param, const char *checkstr) } fclose(fp); } +#define DoWStrTest DoWStrTest_fwprintf - -void DoPointerTest(const WCHAR *formatstr, void* param, char* paramstr, +inline void DoPointerTest_fwprintf(const WCHAR *formatstr, void* param, char* paramstr, const char *checkstr1, const char *checkstr2) { FILE *fp; @@ -115,10 +116,10 @@ void DoPointerTest(const WCHAR *formatstr, void* param, char* paramstr, Fail("ERROR: fclose failed to close \"testfile.txt\"\n"); } } +#define DoPointerTest DoPointerTest_fwprintf - -void DoCountTest(const WCHAR *formatstr, int param, const char *checkstr) +inline void DoCountTest_fwprintf(const WCHAR *formatstr, int param, const char *checkstr) { FILE *fp; char buf[512] = { 0 }; @@ -160,8 +161,9 @@ void DoCountTest(const WCHAR *formatstr, int param, const char *checkstr) Fail("ERROR: fclose failed to close \"testfile.txt\"\n"); } } +#define DoCountTest DoCountTest_fwprintf -void DoShortCountTest(const WCHAR *formatstr, int param, const char *checkstr) +inline void DoShortCountTest_fwprintf(const WCHAR *formatstr, int param, const char *checkstr) { FILE *fp; char buf[512] = { 0 }; @@ -203,9 +205,9 @@ void DoShortCountTest(const WCHAR *formatstr, int param, const char *checkstr) Fail("ERROR: fclose failed to close \"testfile.txt\"\n"); } } +#define DoShortCountTest DoShortCountTest_fwprintf - -void DoCharTest(const WCHAR *formatstr, char param, const char *checkstr) +inline void DoCharTest_fwprintf(const WCHAR *formatstr, char param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -235,8 +237,9 @@ void DoCharTest(const WCHAR *formatstr, char param, const char *checkstr) } fclose(fp); } +#define DoCharTest DoCharTest_fwprintf -void DoWCharTest(const WCHAR *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_fwprintf(const WCHAR *formatstr, WCHAR param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -266,8 +269,9 @@ void DoWCharTest(const WCHAR *formatstr, WCHAR param, const char *checkstr) } fclose(fp); } +#define DoWCharTest DoWCharTest_fwprintf -void DoNumTest(const WCHAR *formatstr, int value, const char *checkstr) +inline void DoNumTest_fwprintf(const WCHAR *formatstr, int value, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -297,8 +301,9 @@ void DoNumTest(const WCHAR *formatstr, int value, const char *checkstr) } fclose(fp); } +#define DoNumTest DoNumTest_fwprintf -void DoI64Test(const WCHAR *formatstr, INT64 value, char *valuestr, const char *checkstr1, +inline void DoI64Test_fwprintf(const WCHAR *formatstr, INT64 value, char *valuestr, const char *checkstr1, const char *checkstr2) { FILE *fp; @@ -330,8 +335,9 @@ void DoI64Test(const WCHAR *formatstr, INT64 value, char *valuestr, const char * } fclose(fp); } +#define DoI64Test DoI64Test_fwprintf -void DoDoubleTest(const WCHAR *formatstr, double value, const char *checkstr1, +inline void DoDoubleTest_fwprintf(const WCHAR *formatstr, double value, const char *checkstr1, const char *checkstr2) { FILE *fp; @@ -364,9 +370,9 @@ void DoDoubleTest(const WCHAR *formatstr, double value, const char *checkstr1, } fclose(fp); } +#define DoDoubleTest DoDoubleTest_fwprintf - -void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_fwprintf(const WCHAR *formatstr, int precision, void *param, char *paramstr, const char *checkstr1, const char *checkstr2) { FILE *fp; @@ -407,8 +413,9 @@ void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, } } +#define DoArgumentPrecTest DoArgumentPrecTest_fwprintf -void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_fwprintf(const WCHAR *formatstr, int precision, double param, const char *checkstr1, const char *checkstr2) { FILE *fp; @@ -448,5 +455,5 @@ void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double para } } - +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_fwprintf #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/CMakeLists.txt deleted file mode 100644 index b337d8a40c55..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fwprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test1 coreclrpal) - -target_link_libraries(paltest_fwprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.cpp index 784ddbfcab4c..907c009b1177 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fgets, fseek and fclose. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test1_paltest_fwprintf_test1, "c_runtime/fwprintf/test1/paltest_fwprintf_test1") { FILE *fp; char testfile[] = "testfile.txt"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/testinfo.dat deleted file mode 100644 index 0e86460b2c02..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= A single, basic, test case with no formatting. -= Test modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/CMakeLists.txt deleted file mode 100644 index a17b9641fbb2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_fwprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test10 coreclrpal) - -target_link_libraries(paltest_fwprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.cpp index 1e1574df0d99..eb3c30217028 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test10_paltest_fwprintf_test10, "c_runtime/fwprintf/test10/paltest_fwprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/testinfo.dat deleted file mode 100644 index 43032b16964f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test10/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests the octal specifier (%o). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/CMakeLists.txt deleted file mode 100644 index 9ba381ff663a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_fwprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test11 coreclrpal) - -target_link_libraries(paltest_fwprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.cpp index ba01c9e5274d..43d3c8931766 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test11_paltest_fwprintf_test11, "c_runtime/fwprintf/test11/paltest_fwprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/testinfo.dat deleted file mode 100644 index e8a4ac891887..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test11/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test11 -Description -= Test the unsigned int specifier (%u). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/CMakeLists.txt deleted file mode 100644 index da0f985e2730..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_fwprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test12 coreclrpal) - -target_link_libraries(paltest_fwprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.cpp index 86ae29c159d2..eda46590a180 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test12_paltest_fwprintf_test12, "c_runtime/fwprintf/test12/paltest_fwprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/testinfo.dat deleted file mode 100644 index b33156ad2ecc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test12/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests the (lowercase) hexadecimal specifier (%x). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/CMakeLists.txt deleted file mode 100644 index 08c287adf0ee..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_fwprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test13 coreclrpal) - -target_link_libraries(paltest_fwprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.cpp index ee8a0d7fb2a7..0a9d214181bc 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test13_paltest_fwprintf_test13, "c_runtime/fwprintf/test13/paltest_fwprintf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/testinfo.dat deleted file mode 100644 index b8e7eaca0c3e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test13/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests the (uppercase) hexadecimal specifier (%X). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/CMakeLists.txt deleted file mode 100644 index dacbfead240a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_fwprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test14 coreclrpal) - -target_link_libraries(paltest_fwprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.cpp index 397f7a1e2b67..ea1436239d7a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.cpp @@ -19,7 +19,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test14_paltest_fwprintf_test14, "c_runtime/fwprintf/test14/paltest_fwprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/testinfo.dat deleted file mode 100644 index fc9947b4cee6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test14/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests the lowercase exponential -= notation double specifier (%e). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/CMakeLists.txt deleted file mode 100644 index 4d42e736588f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_fwprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test15 coreclrpal) - -target_link_libraries(paltest_fwprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.cpp index 672eb51402c7..34f78cc3dbac 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.cpp @@ -19,7 +19,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test15_paltest_fwprintf_test15, "c_runtime/fwprintf/test15/paltest_fwprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/testinfo.dat deleted file mode 100644 index d9370d186b78..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test15/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests the uppercase exponential -= notation double specifier (%E). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/CMakeLists.txt deleted file mode 100644 index 2b47be549043..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_fwprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test16 coreclrpal) - -target_link_libraries(paltest_fwprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.cpp index 1aa29b82c053..8f90e162874c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test16_paltest_fwprintf_test16, "c_runtime/fwprintf/test16/paltest_fwprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/testinfo.dat deleted file mode 100644 index 7b9b7cf57756..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test16/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests the decimal notation double specifier (%f). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/CMakeLists.txt deleted file mode 100644 index 89e557b77668..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_fwprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test17 coreclrpal) - -target_link_libraries(paltest_fwprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.cpp index 67d3156a6df7..002bbcd034ab 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test17_paltest_fwprintf_test17, "c_runtime/fwprintf/test17/paltest_fwprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/testinfo.dat deleted file mode 100644 index 6d12af33a776..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test17/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests the lowercase shorthand notation double specifier (%g). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/CMakeLists.txt deleted file mode 100644 index 8e677c9c455d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_fwprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test18 coreclrpal) - -target_link_libraries(paltest_fwprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.cpp index 001acd1eb600..fd9955b218d7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test18_paltest_fwprintf_test18, "c_runtime/fwprintf/test18/paltest_fwprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/testinfo.dat deleted file mode 100644 index 839f5edcae34..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test18/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests the uppercase shorthand notation double specifier (%G). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/CMakeLists.txt deleted file mode 100644 index 0d0c420c262f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_fwprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test19 coreclrpal) - -target_link_libraries(paltest_fwprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.cpp index 1c4ac0122846..c53509d22754 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.cpp @@ -20,7 +20,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test19_paltest_fwprintf_test19, "c_runtime/fwprintf/test19/paltest_fwprintf_test19") { int n = -1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/testinfo.dat deleted file mode 100644 index 4161de7f43a6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test19/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests the variable length precision argument. -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/CMakeLists.txt deleted file mode 100644 index 308d58e38b24..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_fwprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test2 coreclrpal) - -target_link_libraries(paltest_fwprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.cpp index 79e1c3825040..e591a71ab587 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test2_paltest_fwprintf_test2, "c_runtime/fwprintf/test2/paltest_fwprintf_test2") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/testinfo.dat deleted file mode 100644 index 22e41fd9e3e6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the string specifier (%s). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/CMakeLists.txt deleted file mode 100644 index ac5531efdeac..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_fwprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test3 coreclrpal) - -target_link_libraries(paltest_fwprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.cpp index 425526ad8ce0..21876d28b1ac 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test3_paltest_fwprintf_test3, "c_runtime/fwprintf/test3/paltest_fwprintf_test3") { if (PAL_Initialize(argc, argv) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/testinfo.dat deleted file mode 100644 index 12d078a5c70e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests the wide string specifier (%S). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/CMakeLists.txt deleted file mode 100644 index 61b49dfd1e10..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_fwprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test4 coreclrpal) - -target_link_libraries(paltest_fwprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.cpp index 389e3ed81adc..35053ad0df38 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test4_paltest_fwprintf_test4, "c_runtime/fwprintf/test4/paltest_fwprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/testinfo.dat deleted file mode 100644 index 75caf169182a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test4/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests the pointer specifier (%p). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/CMakeLists.txt deleted file mode 100644 index d136abd14598..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_fwprintf_test5 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test5 coreclrpal) - -target_link_libraries(paltest_fwprintf_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.cpp index 635c0128eece..d7ee738f8a18 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test5_paltest_fwprintf_test5, "c_runtime/fwprintf/test5/paltest_fwprintf_test5") { WCHAR *longStr; char *longResult = diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/testinfo.dat deleted file mode 100644 index 1136506c4f79..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test5/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests the count specifier (%n). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/CMakeLists.txt deleted file mode 100644 index 128ec07fb448..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_fwprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test6 coreclrpal) - -target_link_libraries(paltest_fwprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.cpp index b8cf52e8bfd1..5baa96b229f5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test6_paltest_fwprintf_test6, "c_runtime/fwprintf/test6/paltest_fwprintf_test6") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/testinfo.dat deleted file mode 100644 index 30b4cae7da93..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test6/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests the char specifier (%c). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/CMakeLists.txt deleted file mode 100644 index 85d45bf01c58..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_fwprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test7 coreclrpal) - -target_link_libraries(paltest_fwprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.cpp index 87beeb630d26..aff34340f63a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test7_paltest_fwprintf_test7, "c_runtime/fwprintf/test7/paltest_fwprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/testinfo.dat deleted file mode 100644 index 23ae9df79851..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test7/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests the wide char specifier (%C). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/CMakeLists.txt deleted file mode 100644 index 3d0ecc294235..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_fwprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test8 coreclrpal) - -target_link_libraries(paltest_fwprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.cpp index 242e0ca9a8b1..a7d253166e48 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test8_paltest_fwprintf_test8, "c_runtime/fwprintf/test8/paltest_fwprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/testinfo.dat deleted file mode 100644 index e5bc8f086eaf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test8/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests the decimal specifier (%d). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/CMakeLists.txt deleted file mode 100644 index 502acf38d1e2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_fwprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_fwprintf_test9 coreclrpal) - -target_link_libraries(paltest_fwprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.cpp index 3c252af99638..74fbdfc57e89 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.cpp @@ -18,7 +18,7 @@ * Depends on memcmp, strlen, fopen, fseek and fgets. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_fwprintf_test9_paltest_fwprintf_test9, "c_runtime/fwprintf/test9/paltest_fwprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/testinfo.dat deleted file mode 100644 index 266f1176ace2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwprintf/test9/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwprintf -Name = Positive Test for fwprintf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests the integer specifier (%i). -= This test is modeled after the sprintf series. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/CMakeLists.txt deleted file mode 100644 index 7ed1e9a496a9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_fwrite_test1 - ${SOURCES} -) - -add_dependencies(paltest_fwrite_test1 coreclrpal) - -target_link_libraries(paltest_fwrite_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.cpp index 70e7deb245e5..5b74faa8eac9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_fwrite_test1_paltest_fwrite_test1, "c_runtime/fwrite/test1/paltest_fwrite_test1") { const char filename[] = "testfile.tmp"; const char outBuffer[] = "This is a test."; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/testinfo.dat deleted file mode 100644 index c14a988fd4a2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/fwrite/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = fwrite -Name = Positive Test for fwrite -TYPE = DEFAULT -EXE1 = test1 -Description -= Write a short string to a file and check that it was written properly. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/CMakeLists.txt deleted file mode 100644 index 70ae0e18ab9d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_getenv_test1 - ${SOURCES} -) - -add_dependencies(paltest_getenv_test1 coreclrpal) - -target_link_libraries(paltest_getenv_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/test1.cpp index d7361d7de178..88f66e9d3cff 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/test1.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_getenv_test1_paltest_getenv_test1, "c_runtime/getenv/test1/paltest_getenv_test1") { const char* SetVariable = "PalTestingEnvironmentVariable=The value"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/testinfo.dat deleted file mode 100644 index 9d0485bd8b05..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = getenv -Name = Test retrieval of variables correctly, and failure if they don't exist -TYPE = DEFAULT -EXE1 = test1 -Description -= Create an environment variable and then use getenv to get -= a pointer to it. Check that the pointer is valid and that the string -= is what we expected. Also check that searching for a non-existent -= variable will cause getenv to return NULL. Also check that changing -= the case (upper or lower) of a variable does not effect functionality. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/CMakeLists.txt deleted file mode 100644 index a5ebccd658b6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_getenv_test2 - ${SOURCES} -) - -add_dependencies(paltest_getenv_test2 coreclrpal) - -target_link_libraries(paltest_getenv_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/test2.cpp index c0d2d27733fc..250d7191603d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/test2.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_getenv_test2_paltest_getenv_test2, "c_runtime/getenv/test2/paltest_getenv_test2") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/testinfo.dat deleted file mode 100644 index 1151f19590a7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = getenv -Name = Test retrieval of variables differing only by case. -TYPE = DEFAULT -EXE1 = test2 -Description -= Check that environment variables differing only by their -= case are interpreted as separate variables by the BSD Operationg -= System. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/CMakeLists.txt deleted file mode 100644 index a0e620dc2765..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_getenv_test3 - ${SOURCES} -) - -add_dependencies(paltest_getenv_test3 coreclrpal) - -target_link_libraries(paltest_getenv_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/test3.cpp index ca734748b0bd..e4c98c66adff 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/test3.cpp @@ -15,7 +15,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_getenv_test3_paltest_getenv_test3, "c_runtime/getenv/test3/paltest_getenv_test3") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/testinfo.dat deleted file mode 100644 index ccec02c70cdb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/getenv/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = getenv -Name = Test retrieval of variables differing only by case. -TYPE = DEFAULT -EXE1 = test3 -Description -= Check that environment variables differing only by their -= case are interpreted as the same variables in the WIN32 -= platform. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/CMakeLists.txt deleted file mode 100644 index d6485d927c3e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_ilogb_test1 - ${SOURCES} -) - -add_dependencies(paltest_ilogb_test1 coreclrpal) - -target_link_libraries(paltest_ilogb_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/test1.cpp index 67290f598f9c..9fbd270d5257 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/test1.cpp @@ -25,11 +25,11 @@ struct test }; /** - * validate + * ilogb_test1_validate * * test validation function */ -void __cdecl validate(double value, int expected) +void __cdecl ilogb_test1_validate(double value, int expected) { int result = ilogb(value); @@ -45,7 +45,7 @@ void __cdecl validate(double value, int expected) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_ilogb_test1_paltest_ilogb_test1, "c_runtime/ilogb/test1/paltest_ilogb_test1") { struct test tests[] = { @@ -92,7 +92,7 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected); + ilogb_test1_validate(tests[i].value, tests[i].expected); } PAL_Terminate(); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/testinfo.dat deleted file mode 100644 index 4d224a437db8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogb/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = ilogb -Name = Call ilogb with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the ilogb function with various num/exponent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/CMakeLists.txt deleted file mode 100644 index 634ad8dc04f7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_ilogbf_test1 - ${SOURCES} -) - -add_dependencies(paltest_ilogbf_test1 coreclrpal) - -target_link_libraries(paltest_ilogbf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/test1.cpp index b224e2059902..c5022056c97e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/test1.cpp @@ -25,11 +25,11 @@ struct test }; /** - * validate + * ilogbf_test1_validate * * test validation function */ -void __cdecl validate(float value, int expected) +void __cdecl ilogbf_test1_validate(float value, int expected) { int result = ilogbf(value); @@ -45,7 +45,7 @@ void __cdecl validate(float value, int expected) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_ilogbf_test1_paltest_ilogbf_test1, "c_runtime/ilogbf/test1/paltest_ilogbf_test1") { struct test tests[] = { @@ -92,7 +92,7 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected); + ilogbf_test1_validate(tests[i].value, tests[i].expected); } PAL_Terminate(); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/testinfo.dat deleted file mode 100644 index a34d80a551d6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/ilogbf/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = ilogbf -Name = Call ilogbf with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the ilogbf function with various num/expfonent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/CMakeLists.txt deleted file mode 100644 index d8b68ab50839..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isalnum_test1 - ${SOURCES} -) - -add_dependencies(paltest_isalnum_test1 coreclrpal) - -target_link_libraries(paltest_isalnum_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.cpp index 78560d5320d3..b7ec330ae947 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.cpp @@ -21,7 +21,7 @@ struct testCase int character; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_isalnum_test1_paltest_isalnum_test1, "c_runtime/isalnum/test1/paltest_isalnum_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/testinfo.dat deleted file mode 100644 index 78d8cd2ee423..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalnum/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = isalnum -Name = Positive Test for isalnum -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the isalnum function -= Check that a number of characters return the correct values for whether -= they are alpha/numeric or not. - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/CMakeLists.txt deleted file mode 100644 index 5d5170d473e4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isalpha_test1 - ${SOURCES} -) - -add_dependencies(paltest_isalpha_test1 coreclrpal) - -target_link_libraries(paltest_isalpha_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.cpp index 7e125b4817b9..581f5d3e277a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.cpp @@ -20,7 +20,7 @@ struct testCase int character; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_isalpha_test1_paltest_isalpha_test1, "c_runtime/isalpha/test1/paltest_isalpha_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/testinfo.dat deleted file mode 100644 index 3c1ea87c2cd8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isalpha/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = isalpha -Name = Positive Test for isalpha -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the isalpha function -= Check that a number of characters return the correct values for whether -= they are alpha or not. - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/CMakeLists.txt deleted file mode 100644 index 94b40753a983..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isdigit_test1 - ${SOURCES} -) - -add_dependencies(paltest_isdigit_test1 coreclrpal) - -target_link_libraries(paltest_isdigit_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.cpp index 28f2b08a8b3f..d84029f9322d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_isdigit_test1_paltest_isdigit_test1, "c_runtime/isdigit/test1/paltest_isdigit_test1") { int i; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/testinfo.dat deleted file mode 100644 index 66e1e117e002..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isdigit/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = isdigit -Name = Test #1 for isdigit -TYPE = DEFAULT -EXE1 = test1 -Description -=Checks every character against the known range of digits. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/CMakeLists.txt deleted file mode 100644 index e0b01f7eacac..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_islower_test1 - ${SOURCES} -) - -add_dependencies(paltest_islower_test1 coreclrpal) - -target_link_libraries(paltest_islower_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/test1.cpp index 77b99843b550..f8f6a7a4df2e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/test1.cpp @@ -20,7 +20,7 @@ struct testCase int character; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_islower_test1_paltest_islower_test1, "c_runtime/islower/test1/paltest_islower_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/testinfo.dat deleted file mode 100644 index 72caf94d43c5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/islower/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = islower -Name = Positive Test for islower -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the islower function -= Check that a number of characters return the correct values for whether -= they are lower case or not. - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/CMakeLists.txt deleted file mode 100644 index 58505f15d943..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - isprint.cpp -) - -add_executable(paltest_isprint_test1 - ${SOURCES} -) - -add_dependencies(paltest_isprint_test1 coreclrpal) - -target_link_libraries(paltest_isprint_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.cpp index 57d1d5159565..0d3f0618024c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.cpp @@ -12,7 +12,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_isprint_test1_paltest_isprint_test1, "c_runtime/isprint/test1/paltest_isprint_test1") { int err; int index; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/testinfo.dat deleted file mode 100644 index 15e53e398142..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = miscellaneous -Function = isprint -Name = Positive test for isprint API to check if a character is printable -TYPE = DEFAULT -EXE1 = isprint -Description -=Test the isprint to check if a character is printable diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/CMakeLists.txt deleted file mode 100644 index d06c0d36ee18..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_isprint_test2 - ${SOURCES} -) - -add_dependencies(paltest_isprint_test2 coreclrpal) - -target_link_libraries(paltest_isprint_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/test2.cpp index 08591afc7f21..9871c1d221a6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/test2.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_isprint_test2_paltest_isprint_test2, "c_runtime/isprint/test2/paltest_isprint_test2") { int err; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/testinfo.dat deleted file mode 100644 index ebd114d38f06..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isprint/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = miscellaneous -Function = isprint -Name = Test isprint API to check if out of range characters are not printable. -TYPE = DEFAULT -EXE1 = test2 -Description -=Test the isprint function to verify that out of range characters -=are not printable. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/CMakeLists.txt deleted file mode 100644 index 678ea87bc96c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isspace_test1 - ${SOURCES} -) - -add_dependencies(paltest_isspace_test1 coreclrpal) - -target_link_libraries(paltest_isspace_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/test1.cpp index d5806ad72847..a5bdf2cb2187 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/test1.cpp @@ -22,7 +22,7 @@ struct testCase -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_isspace_test1_paltest_isspace_test1, "c_runtime/isspace/test1/paltest_isspace_test1") { int i=0; long result = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/testinfo.dat deleted file mode 100644 index 2ac42ae0f7cb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isspace/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = isspace -Name = Positive Test for isspace -TYPE = DEFAULT -EXE1 = test1 -Description -= Run through every possible character. For each time that isspace returns -= >0, check through a list of the known space characters to ensure that it -= is really a space. Also, when it returns <=0, ensure that that character -= isn't a space. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/CMakeLists.txt deleted file mode 100644 index 0eded6e61d60..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isupper_test1 - ${SOURCES} -) - -add_dependencies(paltest_isupper_test1 coreclrpal) - -target_link_libraries(paltest_isupper_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/test1.cpp index b48944299196..6b297ebba481 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/test1.cpp @@ -20,7 +20,7 @@ struct testCase int character; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_isupper_test1_paltest_isupper_test1, "c_runtime/isupper/test1/paltest_isupper_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/testinfo.dat deleted file mode 100644 index 7cd4c66bb58f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isupper/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = isupper -Name = Positive Test for isupper -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the isupper function -= Check that a number of characters return the correct values for whether -= they are upper case or not. - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/CMakeLists.txt deleted file mode 100644 index dce86a1f1cfa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_iswdigit_test1 - ${SOURCES} -) - -add_dependencies(paltest_iswdigit_test1 coreclrpal) - -target_link_libraries(paltest_iswdigit_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.cpp index 8b82b11e9401..d7ea8d5513a2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.cpp @@ -20,7 +20,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_iswdigit_test1_paltest_iswdigit_test1, "c_runtime/iswdigit/test1/paltest_iswdigit_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/testinfo.dat deleted file mode 100644 index c9bf834b0d91..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswdigit/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = iswdigit -Name = Positive Test for iswdigit -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the iswdigit function. -= Tests the passed parameter to iswdigit for being a -= digit ('0' - '9'). Also passes non-digits to make sure -= iswdigit picks them up. -= NOTE: There are three ASCII values that under Windows, -= iswdigit will return non-zero, indicating a digit. -= These values are quite apparently not digits: -= 178, 179, 185. These are not tested. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/CMakeLists.txt deleted file mode 100644 index 8605249190d6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_iswprint_test1 - ${SOURCES} -) - -add_dependencies(paltest_iswprint_test1 coreclrpal) - -target_link_libraries(paltest_iswprint_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.cpp index ac6e9246227b..cdc249a62727 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_iswprint_test1_paltest_iswprint_test1, "c_runtime/iswprint/test1/paltest_iswprint_test1") { WORD Info; int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/testinfo.dat deleted file mode 100644 index e99abf3a5e55..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswprint/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = iswprint -Name = Positive Test for iswprint -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests iswprint with all wide characters, ensuring they are -=consistent with GetStringTypeExW. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/CMakeLists.txt deleted file mode 100644 index f5eef10caeef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_iswspace_test1 - ${SOURCES} -) - -add_dependencies(paltest_iswspace_test1 coreclrpal) - -target_link_libraries(paltest_iswspace_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.cpp index 14b78b4ec540..4d9de5d01a67 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.cpp @@ -15,7 +15,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_iswspace_test1_paltest_iswspace_test1, "c_runtime/iswspace/test1/paltest_iswspace_test1") { int ret; int i; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/testinfo.dat deleted file mode 100644 index d401868b2dea..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswspace/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = iswspace -Name = Positive Test for iswspace -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests iswspace with a range of wide characters. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/CMakeLists.txt deleted file mode 100644 index 94c0cafa89b8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_iswupper_test1 - ${SOURCES} -) - -add_dependencies(paltest_iswupper_test1 coreclrpal) - -target_link_libraries(paltest_iswupper_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.cpp index 116021306674..7106aef6cd1b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.cpp @@ -22,7 +22,7 @@ struct testCase WCHAR character; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_iswupper_test1_paltest_iswupper_test1, "c_runtime/iswupper/test1/paltest_iswupper_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/testinfo.dat deleted file mode 100644 index 14c4ac8c95e7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/iswupper/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = isupper -Name = Positive Test for iswupper -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the iswupper function -= Check that a number of characters return the correct values for whether -= they are upper case or not. - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/CMakeLists.txt deleted file mode 100644 index 95a78d400d1e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isxdigit_test1 - ${SOURCES} -) - -add_dependencies(paltest_isxdigit_test1 coreclrpal) - -target_link_libraries(paltest_isxdigit_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.cpp index bbca8e1d2254..c4c245cd255d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.cpp @@ -19,7 +19,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_isxdigit_test1_paltest_isxdigit_test1, "c_runtime/isxdigit/test1/paltest_isxdigit_test1") { int i; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/testinfo.dat deleted file mode 100644 index 983902fde35d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/isxdigit/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = isxdigit -Name = Positive Test for isxdigit -TYPE = DEFAULT -EXE1 = test1 -Description -= Run through every possible character. For each time that isxdigit returns -= 1, check through a list of the known hex characters to ensure that it -= is really a hex char. Also, when it returns 0, ensure that that character -= isn't a hex character. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/CMakeLists.txt deleted file mode 100644 index 1255c58eee4f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_llabs_test1 - ${SOURCES} -) - -add_dependencies(paltest_llabs_test1 coreclrpal) - -target_link_libraries(paltest_llabs_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/test1.cpp index a6ea7d475e50..05c23c0c7b27 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/test1.cpp @@ -20,7 +20,7 @@ struct testCase __int64 AbsoluteLongLongValue; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_llabs_test1_paltest_llabs_test1, "c_runtime/llabs/test1/paltest_llabs_test1") { __int64 result=0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/testinfo.dat deleted file mode 100644 index 9d3b744cb3b0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/llabs/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = labs -Name = Series of tests for labs: positive, negative, zero, maximum __int64 value. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call llabs on a series of values -- negative, positive, zero, -= and the largest negative value of an __int64. Ensure that they are all -= changed properly to their absoulte value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/CMakeLists.txt deleted file mode 100644 index 9550b086213d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_log_test1 - ${SOURCES} -) - -add_dependencies(paltest_log_test1 coreclrpal) - -target_link_libraries(paltest_log_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/test1.cpp index 9c8f72cafccb..a780558a049b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/test1.cpp @@ -40,11 +40,11 @@ struct test }; /** - * validate + * log_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl log_test1_validate(double value, double expected, double variance) { double result = log(value); @@ -62,11 +62,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * log_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl log_test1_validate_isnan(double value) { double result = log(value); @@ -82,7 +82,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_log_test1_paltest_log_test1, "c_runtime/log/test1/paltest_log_test1") { struct test tests[] = { @@ -128,11 +128,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected, tests[i].variance); + log_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); + log_test1_validate_isnan(PAL_NEGINF); + log_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/testinfo.dat deleted file mode 100644 index 674932298799..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = log -Name = Positive Test for log -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the log() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/CMakeLists.txt deleted file mode 100644 index 75092a2f3657..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_log10_test1 - ${SOURCES} -) - -add_dependencies(paltest_log10_test1 coreclrpal) - -target_link_libraries(paltest_log10_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/test1.cpp index b1444528c618..26d13508cc4b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/test1.cpp @@ -46,11 +46,11 @@ struct test }; /** - * validate + * log10_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl log10_test1_validate(double value, double expected, double variance) { double result = log10(value); @@ -68,11 +68,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * log10_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl log10_test1_validate_isnan(double value) { double result = log10(value); @@ -88,7 +88,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_log10_test1_paltest_log10_test1, "c_runtime/log10/test1/paltest_log10_test1") { struct test tests[] = { @@ -134,11 +134,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected, tests[i].variance); + log10_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); + log10_test1_validate_isnan(PAL_NEGINF); + log10_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/testinfo.dat deleted file mode 100644 index 1068593a04f4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = log10 -Name = Positive Test for log10 -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the log10() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/CMakeLists.txt deleted file mode 100644 index 4c0350869865..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_log10f_test1 - ${SOURCES} -) - -add_dependencies(paltest_log10f_test1 coreclrpal) - -target_link_libraries(paltest_log10f_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.c deleted file mode 100644 index d43ef2f43e9e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.c +++ /dev/null @@ -1,143 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that log10f returns correct values. -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** _isnanf -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = log10f(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("log10f(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = log10f(value); - - if (!_isnanf(result)) - { - Fail("log10f(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, PAL_NEGINF, 0 }, - { 0.000721784159f, -3.14159265f, PAL_EPSILON * 10 }, // expected: -(pi) - { 0.00191301410f, -2.71828183f, PAL_EPSILON * 10 }, // expected: -(e) - { 0.00498212830f, -2.30258509f, PAL_EPSILON * 10 }, // expected: -(ln(10)) - { 0.0268660410f, -1.57079633f, PAL_EPSILON * 10 }, // expected: -(pi / 2) - { 0.0360831928f, -1.44269504f, PAL_EPSILON * 10 }, // expected: -(logf2(e)) - { 0.0385288847f, -1.41421356f, PAL_EPSILON * 10 }, // expected: -(sqrtf(2)) - { 0.0744082059f, -1.12837917f, PAL_EPSILON * 10 }, // expected: -(2 / sqrtf(pi)) - { 0.1f, -1, PAL_EPSILON * 10 }, // expected: -(1) - { 0.163908636f, -0.785398163f, PAL_EPSILON }, // expected: -(pi / 4) - { 0.196287760f, -0.707106781f, PAL_EPSILON }, // expected: -(1 / sqrtf(2)) - { 0.202699566f, -0.693147181f, PAL_EPSILON }, // expected: -(ln(2)) - { 0.230876765f, -0.636619772f, PAL_EPSILON }, // expected: -(2 / pi) - { 0.367879441f, -0.434294482f, PAL_EPSILON }, // expected: -(log10f(e)) - { 0.480496373f, -0.318309886f, PAL_EPSILON }, // expected: -(1 / pi) - { 1, 0, PAL_EPSILON }, - { 2.08118116f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 2.71828183f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) value: e - { 4.33131503f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 4.93340967f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 5.09456117f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 6.10095980f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { 10, 1, PAL_EPSILON * 10 }, - { 13.4393779f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 25.9545535f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 27.7137338f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 37.2217105f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { 200.717432f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) - { 522.735300f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { 1385.45573f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi - { PAL_POSINF, PAL_POSINF, 0 }, - }; - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.cpp new file mode 100644 index 000000000000..a503ebaab744 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.cpp @@ -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. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that log10f returns correct values. +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** _isnanf +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * log10f_test1_validate + * + * test validation function + */ +void __cdecl log10f_test1_validate(float value, float expected, float variance) +{ + float result = log10f(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("log10f(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * log10f_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl log10f_test1_validate_isnan(float value) +{ + float result = log10f(value); + + if (!_isnanf(result)) + { + Fail("log10f(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_log10f_test1_paltest_log10f_test1, "c_runtime/log10f/test1/paltest_log10f_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, PAL_NEGINF, 0 }, + { 0.000721784159f, -3.14159265f, PAL_EPSILON * 10 }, // expected: -(pi) + { 0.00191301410f, -2.71828183f, PAL_EPSILON * 10 }, // expected: -(e) + { 0.00498212830f, -2.30258509f, PAL_EPSILON * 10 }, // expected: -(ln(10)) + { 0.0268660410f, -1.57079633f, PAL_EPSILON * 10 }, // expected: -(pi / 2) + { 0.0360831928f, -1.44269504f, PAL_EPSILON * 10 }, // expected: -(logf2(e)) + { 0.0385288847f, -1.41421356f, PAL_EPSILON * 10 }, // expected: -(sqrtf(2)) + { 0.0744082059f, -1.12837917f, PAL_EPSILON * 10 }, // expected: -(2 / sqrtf(pi)) + { 0.1f, -1, PAL_EPSILON * 10 }, // expected: -(1) + { 0.163908636f, -0.785398163f, PAL_EPSILON }, // expected: -(pi / 4) + { 0.196287760f, -0.707106781f, PAL_EPSILON }, // expected: -(1 / sqrtf(2)) + { 0.202699566f, -0.693147181f, PAL_EPSILON }, // expected: -(ln(2)) + { 0.230876765f, -0.636619772f, PAL_EPSILON }, // expected: -(2 / pi) + { 0.367879441f, -0.434294482f, PAL_EPSILON }, // expected: -(log10f(e)) + { 0.480496373f, -0.318309886f, PAL_EPSILON }, // expected: -(1 / pi) + { 1, 0, PAL_EPSILON }, + { 2.08118116f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 2.71828183f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) value: e + { 4.33131503f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 4.93340967f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 5.09456117f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 6.10095980f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { 10, 1, PAL_EPSILON * 10 }, + { 13.4393779f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 25.9545535f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 27.7137338f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 37.2217105f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { 200.717432f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) + { 522.735300f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { 1385.45573f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi + { PAL_POSINF, PAL_POSINF, 0 }, + }; + + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + log10f_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + } + + log10f_test1_validate_isnan(PAL_NEGINF); + log10f_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/testinfo.dat deleted file mode 100644 index 591853bc1dd8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log10f/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = log10f -Name = Positive Test for log10f -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the log10f() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/CMakeLists.txt deleted file mode 100644 index efee18bc6206..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_log2_test1 - ${SOURCES} -) - -add_dependencies(paltest_log2_test1 coreclrpal) - -target_link_libraries(paltest_log2_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/test1.cpp index c453e102a5fb..8ca12f4dd54c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/test1.cpp @@ -40,11 +40,11 @@ struct test }; /** - * validate + * log2_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl log2_test1_validate(double value, double expected, double variance) { double result = log2(value); @@ -62,11 +62,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * log2_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl log2_test1_validate_isnan(double value) { double result = log2(value); @@ -82,7 +82,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_log2_test1_paltest_log2_test1, "c_runtime/log2/test1/paltest_log2_test1") { struct test tests[] = { @@ -127,11 +127,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected, tests[i].variance); + log2_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); + log2_test1_validate_isnan(PAL_NEGINF); + log2_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/testinfo.dat deleted file mode 100644 index 14c34b08a0ef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = log2 -Name = Call log2 with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the log2 function with various num/exponent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/CMakeLists.txt deleted file mode 100644 index 6002cf7ad8c9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_log2f_test1 - ${SOURCES} -) - -add_dependencies(paltest_log2f_test1 coreclrpal) - -target_link_libraries(paltest_log2f_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/test1.c deleted file mode 100644 index a4195d051b7e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/test1.c +++ /dev/null @@ -1,137 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Tests that log2f returns correct values. -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = log2f(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("log2f(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = log2f(value); - - if (!_isnanf(result)) - { - Fail("log2f(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, PAL_NEGINF, 0 }, - { 0.113314732f, -3.14159265f, PAL_EPSILON * 10 }, // expected: -(pi) - { 0.151955223f, -2.71828183f, PAL_EPSILON * 10 }, // expected: -(e) - { 0.202699566f, -2.30258509f, PAL_EPSILON * 10 }, // expected: -(ln(10)) - { 0.336622537f, -1.57079633f, PAL_EPSILON * 10 }, // expected: -(pi / 2) - { 0.367879441f, -1.44269504f, PAL_EPSILON * 10 }, // expected: -(logf2(e)) - { 0.375214227f, -1.41421356f, PAL_EPSILON * 10 }, // expected: -(sqrtf(2)) - { 0.457429347f, -1.12837917f, PAL_EPSILON * 10 }, // expected: -(2 / sqrtf(pi)) - { 0.5f, -1, PAL_EPSILON * 10 }, // expected: -(1) - { 0.580191810f, -0.785398163f, PAL_EPSILON }, // expected: -(pi / 4) - { 0.612547327f, -0.707106781f, PAL_EPSILON }, // expected: -(1 / sqrtf(2)) - { 0.618503138f, -0.693147181f, PAL_EPSILON }, // expected: -(ln(2)) - { 0.643218242f, -0.636619772f, PAL_EPSILON }, // expected: -(2 / pi) - { 0.740055574f, -0.434294482f, PAL_EPSILON }, // expected: -(log10f(e)) - { 0.802008879f, -0.318309886f, PAL_EPSILON }, // expected: -(1 / pi) - { 1, 0, PAL_EPSILON }, - { 1.24686899f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 1.35124987f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) value: e - { 1.55468228f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 1.61680667f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 1.63252692f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 1.72356793f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { 2, 1, PAL_EPSILON * 10 }, - { 2.18612996f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 2.66514414f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 2.71828183f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 2.97068642f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { 4.93340967f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) - { 6.58088599f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { 8.82497783f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi - { PAL_POSINF, PAL_POSINF, 0 }, - }; - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/test1.cpp new file mode 100644 index 000000000000..29de3c76de79 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/test1.cpp @@ -0,0 +1,137 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Tests that log2f returns correct values. +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * log2f_test1_validate + * + * test validation function + */ +void __cdecl log2f_test1_validate(float value, float expected, float variance) +{ + float result = log2f(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("log2f(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * log2f_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl log2f_test1_validate_isnan(float value) +{ + float result = log2f(value); + + if (!_isnanf(result)) + { + Fail("log2f(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_log2f_test1_paltest_log2f_test1, "c_runtime/log2f/test1/paltest_log2f_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, PAL_NEGINF, 0 }, + { 0.113314732f, -3.14159265f, PAL_EPSILON * 10 }, // expected: -(pi) + { 0.151955223f, -2.71828183f, PAL_EPSILON * 10 }, // expected: -(e) + { 0.202699566f, -2.30258509f, PAL_EPSILON * 10 }, // expected: -(ln(10)) + { 0.336622537f, -1.57079633f, PAL_EPSILON * 10 }, // expected: -(pi / 2) + { 0.367879441f, -1.44269504f, PAL_EPSILON * 10 }, // expected: -(logf2(e)) + { 0.375214227f, -1.41421356f, PAL_EPSILON * 10 }, // expected: -(sqrtf(2)) + { 0.457429347f, -1.12837917f, PAL_EPSILON * 10 }, // expected: -(2 / sqrtf(pi)) + { 0.5f, -1, PAL_EPSILON * 10 }, // expected: -(1) + { 0.580191810f, -0.785398163f, PAL_EPSILON }, // expected: -(pi / 4) + { 0.612547327f, -0.707106781f, PAL_EPSILON }, // expected: -(1 / sqrtf(2)) + { 0.618503138f, -0.693147181f, PAL_EPSILON }, // expected: -(ln(2)) + { 0.643218242f, -0.636619772f, PAL_EPSILON }, // expected: -(2 / pi) + { 0.740055574f, -0.434294482f, PAL_EPSILON }, // expected: -(log10f(e)) + { 0.802008879f, -0.318309886f, PAL_EPSILON }, // expected: -(1 / pi) + { 1, 0, PAL_EPSILON }, + { 1.24686899f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 1.35124987f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) value: e + { 1.55468228f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 1.61680667f, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 1.63252692f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 1.72356793f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { 2, 1, PAL_EPSILON * 10 }, + { 2.18612996f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 2.66514414f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 2.71828183f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 2.97068642f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { 4.93340967f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) + { 6.58088599f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { 8.82497783f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi + { PAL_POSINF, PAL_POSINF, 0 }, + }; + + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + log2f_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + } + + log2f_test1_validate_isnan(PAL_NEGINF); + log2f_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/testinfo.dat deleted file mode 100644 index ebda8b49d0e2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/log2f/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = log2f -Name = Call log2f with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the log2f function with various num/expfonent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/CMakeLists.txt deleted file mode 100644 index 5cb727d05137..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_logf_test1 - ${SOURCES} -) - -add_dependencies(paltest_logf_test1 coreclrpal) - -target_link_libraries(paltest_logf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/test1.c deleted file mode 100644 index 3c7f10f0e9bd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/test1.c +++ /dev/null @@ -1,138 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Tests logf with a normal set of values. -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = logf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("logf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = logf(value); - - if (!_isnanf(result)) - { - Fail("logf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, PAL_NEGINF, 0 }, - { 0.0432139183f, -3.14159265f, PAL_EPSILON * 10 }, // expected: -(pi) - { 0.0659880358f, -2.71828183f, PAL_EPSILON * 10 }, // expected: -(e) - { 0.1f, -2.30258509f, PAL_EPSILON * 10 }, // expected: -(ln(10)) - { 0.207879576f, -1.57079633f, PAL_EPSILON * 10 }, // expected: -(pi / 2) - { 0.236290088f, -1.44269504f, PAL_EPSILON * 10 }, // expected: -(logf2(e)) - { 0.243116734f, -1.41421356f, PAL_EPSILON * 10 }, // expected: -(sqrtf(2)) - { 0.323557264f, -1.12837917f, PAL_EPSILON * 10 }, // expected: -(2 / sqrtf(pi)) - { 0.367879441f, -1, PAL_EPSILON * 10 }, // expected: -(1) - { 0.455938128f, -0.785398163f, PAL_EPSILON }, // expected: -(pi / 4) - { 0.493068691f, -0.707106781f, PAL_EPSILON }, // expected: -(1 / sqrtf(2)) - { 0.5f, -0.693147181f, PAL_EPSILON }, // expected: -(ln(2)) - { 0.529077808f, -0.636619772f, PAL_EPSILON }, // expected: -(2 / pi) - { 0.647721485f, -0.434294482f, PAL_EPSILON }, // expected: -(log10f(e)) - { 0.727377349f, -0.318309886f, PAL_EPSILON }, // expected: -(1 / pi) - { 1, 0, PAL_EPSILON }, - { 1.37480223f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi - { 1.54387344f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) - { 1.89008116f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi - { 2, 0.693147181f, PAL_EPSILON }, // expected: ln(2) - { 2.02811498f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) - { 2.19328005f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 - { 2.71828183f, 1, PAL_EPSILON * 10 }, // value: e - { 3.09064302f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) - { 4.11325038f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) - { 4.23208611f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) - { 4.81047738f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 - { 10, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) - { 15.1542622f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e - { 23.1406926f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi - { PAL_POSINF, PAL_POSINF, 0 }, - }; - - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/test1.cpp new file mode 100644 index 000000000000..7980ae1b28e9 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/test1.cpp @@ -0,0 +1,138 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Tests logf with a normal set of values. +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * logf_test1_validate + * + * test validation function + */ +void __cdecl logf_test1_validate(float value, float expected, float variance) +{ + float result = logf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("logf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * logf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl logf_test1_validate_isnan(float value) +{ + float result = logf(value); + + if (!_isnanf(result)) + { + Fail("logf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_logf_test1_paltest_logf_test1, "c_runtime/logf/test1/paltest_logf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, PAL_NEGINF, 0 }, + { 0.0432139183f, -3.14159265f, PAL_EPSILON * 10 }, // expected: -(pi) + { 0.0659880358f, -2.71828183f, PAL_EPSILON * 10 }, // expected: -(e) + { 0.1f, -2.30258509f, PAL_EPSILON * 10 }, // expected: -(ln(10)) + { 0.207879576f, -1.57079633f, PAL_EPSILON * 10 }, // expected: -(pi / 2) + { 0.236290088f, -1.44269504f, PAL_EPSILON * 10 }, // expected: -(logf2(e)) + { 0.243116734f, -1.41421356f, PAL_EPSILON * 10 }, // expected: -(sqrtf(2)) + { 0.323557264f, -1.12837917f, PAL_EPSILON * 10 }, // expected: -(2 / sqrtf(pi)) + { 0.367879441f, -1, PAL_EPSILON * 10 }, // expected: -(1) + { 0.455938128f, -0.785398163f, PAL_EPSILON }, // expected: -(pi / 4) + { 0.493068691f, -0.707106781f, PAL_EPSILON }, // expected: -(1 / sqrtf(2)) + { 0.5f, -0.693147181f, PAL_EPSILON }, // expected: -(ln(2)) + { 0.529077808f, -0.636619772f, PAL_EPSILON }, // expected: -(2 / pi) + { 0.647721485f, -0.434294482f, PAL_EPSILON }, // expected: -(log10f(e)) + { 0.727377349f, -0.318309886f, PAL_EPSILON }, // expected: -(1 / pi) + { 1, 0, PAL_EPSILON }, + { 1.37480223f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi + { 1.54387344f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) + { 1.89008116f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi + { 2, 0.693147181f, PAL_EPSILON }, // expected: ln(2) + { 2.02811498f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2) + { 2.19328005f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4 + { 2.71828183f, 1, PAL_EPSILON * 10 }, // value: e + { 3.09064302f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi) + { 4.11325038f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2) + { 4.23208611f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e) + { 4.81047738f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2 + { 10, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10) + { 15.1542622f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e + { 23.1406926f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi + { PAL_POSINF, PAL_POSINF, 0 }, + }; + + + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + logf_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + } + + logf_test1_validate_isnan(PAL_NEGINF); + logf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/testinfo.dat deleted file mode 100644 index 52236efce0d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/logf/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = logf -Name = Positive Test for logf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes a series of values to the logf() function, -= checking each for the expected result. Also checks -= for proper handling of out-of-range values. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/CMakeLists.txt deleted file mode 100644 index 198ff68b42fc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_malloc_test1 - ${SOURCES} -) - -add_dependencies(paltest_malloc_test1 coreclrpal) - -target_link_libraries(paltest_malloc_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp index be71d783297f..2f713a0ee96f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_malloc_test1_paltest_malloc_test1, "c_runtime/malloc/test1/paltest_malloc_test1") { char *testA; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/testinfo.dat deleted file mode 100644 index d815414e38c7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = malloc -Name = Positive Test for malloc -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that malloc properly allocates memory. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/CMakeLists.txt deleted file mode 100644 index 03b0648f17f5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_malloc_test2 - ${SOURCES} -) - -add_dependencies(paltest_malloc_test2 coreclrpal) - -target_link_libraries(paltest_malloc_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/test2.cpp index 6aa3e3f6b200..9f94f1050d6a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/test2.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_malloc_test2_paltest_malloc_test2, "c_runtime/malloc/test2/paltest_malloc_test2") { char *testA; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/testinfo.dat deleted file mode 100644 index c4fad6844f2a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/malloc/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = malloc -Name = Positive Test for malloc -TYPE = DEFAULT -EXE1 = test2 -Description -= Test that malloc(0) returns non-zero value diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/CMakeLists.txt deleted file mode 100644 index 9fcc0837408f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_memchr_test1 - ${SOURCES} -) - -add_dependencies(paltest_memchr_test1 coreclrpal) - -target_link_libraries(paltest_memchr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/test1.cpp index 924e5c80a554..a7e44dbd911f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/test1.cpp @@ -25,7 +25,7 @@ struct testCase }; -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_memchr_test1_paltest_memchr_test1, "c_runtime/memchr/test1/paltest_memchr_test1") { int i = 0; char *result = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/testinfo.dat deleted file mode 100644 index d5e074c6ae7c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memchr/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = memchr -Name = Positive Test for memchr -TYPE = DEFAULT -EXE1 = test1 -Description -= Create a string buffer, and check for a number of characters in it. -= Test to ensure it returns NULL if it can't find the character, and that -= the size argument works properly. - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/CMakeLists.txt deleted file mode 100644 index f48bac8058cb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_memcmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_memcmp_test1 coreclrpal) - -target_link_libraries(paltest_memcmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.cpp index 41c16d98e0f8..c1a17f30a659 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_memcmp_test1_paltest_memcmp_test1, "c_runtime/memcmp/test1/paltest_memcmp_test1") { char testA[] = "aaaaaaaaaaaaaaaaaaaa"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/testinfo.dat deleted file mode 100644 index 852ea669788e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcmp/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = memcmp -Name = Positive Test for memcmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Check that memcmp find identical buffers to be identical, -= and that it correctly orders different buffers. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/CMakeLists.txt deleted file mode 100644 index d7471acb984d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_memcpy_test1 - ${SOURCES} -) - -add_dependencies(paltest_memcpy_test1 coreclrpal) - -target_link_libraries(paltest_memcpy_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.cpp index 26d59aa94ea4..bbf674cedd8f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_memcpy_test1_paltest_memcpy_test1, "c_runtime/memcpy/test1/paltest_memcpy_test1") { char testA[20]; char testB[20]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/testinfo.dat deleted file mode 100644 index f4ea0f1ee23d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memcpy/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = memcpy -Name = Positive Test for memcpy -TYPE = DEFAULT -EXE1 = test1 -Description -= Calls memcpy and verifies that the buffer was copied correctly. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/CMakeLists.txt deleted file mode 100644 index b5f8d4c7bf18..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_memmove_test1 - ${SOURCES} -) - -add_dependencies(paltest_memmove_test1 coreclrpal) - -target_link_libraries(paltest_memmove_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.cpp index 8bb0ee231532..476ba01f5f27 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_memmove_test1_paltest_memmove_test1, "c_runtime/memmove/test1/paltest_memmove_test1") { char testA[11] = "abcdefghij"; char testB[15] = "aabbccddeeffgg"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/testinfo.dat deleted file mode 100644 index 777c1aacf311..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memmove/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = memmove -Name = Positive Test for memmove -TYPE = DEFAULT -EXE1 = test1 -Description -= Test that memmove correctly copies text from one buffer to another -= even when the buffers overlap. - - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/CMakeLists.txt deleted file mode 100644 index bc24ed87b43c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_memset_test1 - ${SOURCES} -) - -add_dependencies(paltest_memset_test1 coreclrpal) - -target_link_libraries(paltest_memset_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/test1.cpp index 483e3b9c3559..ee8d92fd4ab5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_memset_test1_paltest_memset_test1, "c_runtime/memset/test1/paltest_memset_test1") { char testA[22] = "bbbbbbbbbbbbbbbbbbbbb"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/testinfo.dat deleted file mode 100644 index 647bcd87f92d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/memset/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = memset -Name = Positive Test for memset -TYPE = DEFAULT -EXE1 = test1 -Description -= Check that memset correctly fills a destination buffer without overflowing it. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/CMakeLists.txt deleted file mode 100644 index bc9e8870f961..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_modf_test1 - ${SOURCES} -) - -add_dependencies(paltest_modf_test1 coreclrpal) - -target_link_libraries(paltest_modf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/test1.cpp index b0beb7cabe13..726e524d0a4e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/test1.cpp @@ -47,11 +47,11 @@ struct test }; /** - * validate + * modf_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance, double expected_intpart, double variance_intpart) +void __cdecl modf_test1_validate(double value, double expected, double variance, double expected_intpart, double variance_intpart) { double result_intpart; double result = modf(value, &result_intpart); @@ -71,11 +71,11 @@ void __cdecl validate(double value, double expected, double variance, double exp } /** - * validate + * modf_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl modf_test1_validate_isnan(double value) { double result_intpart; double result = modf(value, &result_intpart); @@ -92,7 +92,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_modf_test1_paltest_modf_test1, "c_runtime/modf/test1/paltest_modf_test1") { struct test tests[] = { @@ -124,11 +124,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance, tests[i].expected_intpart, tests[i].variance_intpart); - validate(-tests[i].value, -tests[i].expected, tests[i].variance, -tests[i].expected_intpart, tests[i].variance_intpart); + modf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance, tests[i].expected_intpart, tests[i].variance_intpart); + modf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance, -tests[i].expected_intpart, tests[i].variance_intpart); } - validate_isnan(PAL_NAN); + modf_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/testinfo.dat deleted file mode 100644 index ad8b36486fca..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/modf/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = modf -Name = Positive Test for modf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to modf() a series of values, checking that -= each one return to correct value. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/CMakeLists.txt deleted file mode 100644 index a86d7e70a363..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_modff_test1 - ${SOURCES} -) - -add_dependencies(paltest_modff_test1 coreclrpal) - -target_link_libraries(paltest_modff_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/test1.cpp index a96cf7c78d75..898566b27398 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/test1.cpp @@ -46,11 +46,11 @@ struct test }; /** - * validate + * modff_test1_validate * * test validation function */ -void __cdecl validate(float value, float expected, float variance, float expected_intpart, float variance_intpart) +void __cdecl modff_test1_validate(float value, float expected, float variance, float expected_intpart, float variance_intpart) { float result_intpart; float result = modff(value, &result_intpart); @@ -70,11 +70,11 @@ void __cdecl validate(float value, float expected, float variance, float expecte } /** - * validate + * modff_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(float value) +void __cdecl modff_test1_validate_isnan(float value) { float result_intpart; float result = modff(value, &result_intpart); @@ -91,7 +91,7 @@ void __cdecl validate_isnan(float value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_modff_test1_paltest_modff_test1, "c_runtime/modff/test1/paltest_modff_test1") { struct test tests[] = { @@ -123,11 +123,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance, tests[i].expected_intpart, tests[i].variance_intpart); - validate(-tests[i].value, -tests[i].expected, tests[i].variance, -tests[i].expected_intpart, tests[i].variance_intpart); + modff_test1_validate( tests[i].value, tests[i].expected, tests[i].variance, tests[i].expected_intpart, tests[i].variance_intpart); + modff_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance, -tests[i].expected_intpart, tests[i].variance_intpart); } - validate_isnan(PAL_NAN); + modff_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/testinfo.dat deleted file mode 100644 index 26429e91f486..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/modff/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = modff -Name = Positive Test for modff -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to modff() a series of values, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/CMakeLists.txt deleted file mode 100644 index 86ae740da67c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_pow_test1 - ${SOURCES} -) - -add_dependencies(paltest_pow_test1 coreclrpal) - -target_link_libraries(paltest_pow_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/test1.cpp index 159d3956ea9c..22f482868b3d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/test1.cpp @@ -43,11 +43,11 @@ struct test }; /** - * validate + * pow_test1_validate * * test validation function */ -void __cdecl validate(double x, double y, double expected, double variance) +void __cdecl pow_test1_validate(double x, double y, double expected, double variance) { double result = pow(x, y); @@ -65,11 +65,11 @@ void __cdecl validate(double x, double y, double expected, double variance) } /** - * validate + * pow_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double x, double y) +void __cdecl pow_test1_validate_isnan(double x, double y) { double result = pow(x, y); @@ -85,7 +85,7 @@ void __cdecl validate_isnan(double x, double y) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_pow_test1_paltest_pow_test1, "c_runtime/pow/test1/paltest_pow_test1") { struct test tests[] = { @@ -203,26 +203,26 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].x, tests[i].y, tests[i].expected, tests[i].variance); + pow_test1_validate(tests[i].x, tests[i].y, tests[i].expected, tests[i].variance); } - validate_isnan(-10, -1.5707963267948966); // y: -(pi / 2) - validate_isnan(-10, -0.78539816339744828); // y: -(pi / 4) - validate_isnan(-10, 0.78539816339744828); // y: pi / 4 - validate_isnan(-10, 1.5707963267948966); // y: pi / 2 + pow_test1_validate_isnan(-10, -1.5707963267948966); // y: -(pi / 2) + pow_test1_validate_isnan(-10, -0.78539816339744828); // y: -(pi / 4) + pow_test1_validate_isnan(-10, 0.78539816339744828); // y: pi / 4 + pow_test1_validate_isnan(-10, 1.5707963267948966); // y: pi / 2 - validate_isnan(-2.7182818284590452, -1.5707963267948966); // x: -(e) y: -(pi / 2) - validate_isnan(-2.7182818284590452, -0.78539816339744828); // x: -(e) y: -(pi / 4) - validate_isnan(-2.7182818284590452, 0.78539816339744828); // x: -(e) y: pi / 4 - validate_isnan(-2.7182818284590452, 1.5707963267948966); // x: -(e) y: pi / 2 + pow_test1_validate_isnan(-2.7182818284590452, -1.5707963267948966); // x: -(e) y: -(pi / 2) + pow_test1_validate_isnan(-2.7182818284590452, -0.78539816339744828); // x: -(e) y: -(pi / 4) + pow_test1_validate_isnan(-2.7182818284590452, 0.78539816339744828); // x: -(e) y: pi / 4 + pow_test1_validate_isnan(-2.7182818284590452, 1.5707963267948966); // x: -(e) y: pi / 2 - validate_isnan(PAL_NEGINF, PAL_NAN); - validate_isnan(PAL_NAN, PAL_NEGINF); + pow_test1_validate_isnan(PAL_NEGINF, PAL_NAN); + pow_test1_validate_isnan(PAL_NAN, PAL_NEGINF); - validate_isnan(PAL_POSINF, PAL_NAN); - validate_isnan(PAL_NAN, PAL_POSINF); + pow_test1_validate_isnan(PAL_POSINF, PAL_NAN); + pow_test1_validate_isnan(PAL_NAN, PAL_POSINF); - validate_isnan(PAL_NAN, PAL_NAN); + pow_test1_validate_isnan(PAL_NAN, PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/testinfo.dat deleted file mode 100644 index 0dae5d524606..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/pow/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = pow -Name = Call pow with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the pow function with various num/exponent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/CMakeLists.txt deleted file mode 100644 index 53443f15598c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_powf_test1 - ${SOURCES} -) - -add_dependencies(paltest_powf_test1 coreclrpal) - -target_link_libraries(paltest_powf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/test1.c deleted file mode 100644 index 24a23e04f9e1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/test1.c +++ /dev/null @@ -1,228 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Tests that atan2f returns correct values for a subset of values. -** Tests with positive and negative values of x and y to ensure -** atan2f is returning results from the correct quadrant. -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float x; /* first component of the value to test the function with */ - float y; /* second component of the value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float x, float y, float expected, float variance) -{ - float result = powf(x, y); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("powf(%g, %g) returned %10.9g when it should have returned %10.9g", - x, y, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float x, float y) -{ - float result = powf(x, y); - - if (!_isnanf(result)) - { - Fail("powf(%g, %g) returned %10.9g when it should have returned %10.9g", - x, y, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* x y expected variance */ - { PAL_NEGINF, PAL_NEGINF, 0, PAL_EPSILON }, - { PAL_NEGINF, PAL_POSINF, PAL_POSINF, 0 }, - - { -10, PAL_NEGINF, 0, PAL_EPSILON }, - { -10, -1, -0.1f, PAL_EPSILON }, - { -10, 0, 1, PAL_EPSILON * 10 }, - { -10, 1, -10, PAL_EPSILON * 100 }, - { -10, PAL_POSINF, PAL_POSINF, 0 }, - - { -2.71828183f, PAL_NEGINF, 0, PAL_EPSILON }, // x: -(e) - { -2.71828183f, -1, -0.367879441f, PAL_EPSILON }, // x: -(e) - { -2.71828183f, 0, 1, PAL_EPSILON * 10 }, // x: -(e) - { -2.71828183f, 1, -2.71828183f, PAL_EPSILON * 10 }, // x: -(e) expected: e - { -2.71828183f, PAL_POSINF, PAL_POSINF, 0 }, // x: -(e) - - { -1.0, PAL_NEGINF, 1.0, PAL_EPSILON * 10 }, - { -1.0, PAL_POSINF, 1.0, PAL_EPSILON * 10 }, - - { -0.0, PAL_NEGINF, PAL_POSINF, 0 }, - { -0.0, -1, PAL_NEGINF, 0 }, - { -0.0f, -0.0f, 1, PAL_EPSILON * 10 }, - { -0.0f, 0, 1, PAL_EPSILON * 10 }, - { -0.0, 1, -0.0, PAL_EPSILON }, - { -0.0, PAL_POSINF, 0, PAL_EPSILON }, - - { PAL_NAN, -0.0, 1.0, PAL_EPSILON * 10 }, - { PAL_NAN, 0, 1.0, PAL_EPSILON * 10 }, - - { 0.0, PAL_NEGINF, PAL_POSINF, 0 }, - { 0.0, -1, PAL_POSINF, 0 }, - { 0, -0.0f, 1, PAL_EPSILON * 10 }, - { 0, 0, 1, PAL_EPSILON * 10 }, - { 0.0, 1, 0, PAL_EPSILON }, - { 0.0, PAL_POSINF, 0, PAL_EPSILON }, - - { 1, PAL_NEGINF, 1, PAL_EPSILON * 10 }, - { 1, PAL_POSINF, 1, PAL_EPSILON * 10 }, - - { 2.71828183f, PAL_NEGINF, 0, PAL_EPSILON }, - { 2.71828183f, -3.14159265f, 0.0432139183f, PAL_EPSILON / 10 }, // x: e y: -(pi) - { 2.71828183f, -2.71828183f, 0.0659880358f, PAL_EPSILON / 10 }, // x: e y: -(e) - { 2.71828183f, -2.30258509f, 0.1f, PAL_EPSILON }, // x: e y: -(ln(10)) - { 2.71828183f, -1.57079633f, 0.207879576f, PAL_EPSILON }, // x: e y: -(pi / 2) - { 2.71828183f, -1.44269504f, 0.236290088f, PAL_EPSILON }, // x: e y: -(logf2(e)) - { 2.71828183f, -1.41421356f, 0.243116734f, PAL_EPSILON }, // x: e y: -(sqrtf(2)) - { 2.71828183f, -1.12837917f, 0.323557264f, PAL_EPSILON }, // x: e y: -(2 / sqrtf(pi)) - { 2.71828183f, -1, 0.367879441f, PAL_EPSILON }, // x: e y: -(1) - { 2.71828183f, -0.785398163f, 0.455938128f, PAL_EPSILON }, // x: e y: -(pi / 4) - { 2.71828183f, -0.707106781f, 0.493068691f, PAL_EPSILON }, // x: e y: -(1 / sqrtf(2)) - { 2.71828183f, -0.693147181f, 0.5f, PAL_EPSILON }, // x: e y: -(ln(2)) - { 2.71828183f, -0.636619772f, 0.529077808f, PAL_EPSILON }, // x: e y: -(2 / pi) - { 2.71828183f, -0.434294482f, 0.647721485f, PAL_EPSILON }, // x: e y: -(log10f(e)) - { 2.71828183f, -0.318309886f, 0.727377349f, PAL_EPSILON }, // x: e y: -(1 / pi) - { 2.71828183f, 0, 1, PAL_EPSILON * 10 }, // x: e - { 2.71828183f, 0.318309886f, 1.37480223f, PAL_EPSILON * 10 }, // x: e y: 1 / pi - { 2.71828183f, 0.434294482f, 1.54387344f, PAL_EPSILON * 10 }, // x: e y: log10f(e) - { 2.71828183f, 0.636619772f, 1.89008116f, PAL_EPSILON * 10 }, // x: e y: 2 / pi - { 2.71828183f, 0.693147181f, 2, PAL_EPSILON * 10 }, // x: e y: ln(2) - { 2.71828183f, 0.707106781f, 2.02811498f, PAL_EPSILON * 10 }, // x: e y: 1 / sqrtf(2) - { 2.71828183f, 0.785398163f, 2.19328005f, PAL_EPSILON * 10 }, // x: e y: pi / 4 - { 2.71828183f, 1, 2.71828183f, PAL_EPSILON * 10 }, // x: e expected: e - { 2.71828183f, 1.12837917f, 3.09064302f, PAL_EPSILON * 10 }, // x: e y: 2 / sqrtf(pi) - { 2.71828183f, 1.41421356f, 4.11325038f, PAL_EPSILON * 10 }, // x: e y: sqrtf(2) - { 2.71828183f, 1.44269504f, 4.23208611f, PAL_EPSILON * 10 }, // x: e y: logf2(e) - { 2.71828183f, 1.57079633f, 4.81047738f, PAL_EPSILON * 10 }, // x: e y: pi / 2 - { 2.71828183f, 2.30258509f, 10, PAL_EPSILON * 100 }, // x: e y: ln(10) - { 2.71828183f, 2.71828183f, 15.1542622f, PAL_EPSILON * 100 }, // x: e y: e - { 2.71828183f, 3.14159265f, 23.1406926f, PAL_EPSILON * 100 }, // x: e y: pi - { 2.71828183f, PAL_POSINF, PAL_POSINF, 0 }, // x: e - - { 10, PAL_NEGINF, 0, 0 }, - { 10, -3.14159265f, 0.000721784159f, PAL_EPSILON / 1000 }, // y: -(pi) - { 10, -2.71828183f, 0.00191301410f, PAL_EPSILON / 100 }, // y: -(e) - { 10, -2.30258509f, 0.00498212830f, PAL_EPSILON / 100 }, // y: -(ln(10)) - { 10, -1.57079633f, 0.0268660410f, PAL_EPSILON / 10 }, // y: -(pi / 2) - { 10, -1.44269504f, 0.0360831928f, PAL_EPSILON / 10 }, // y: -(logf2(e)) - { 10, -1.41421356f, 0.0385288847f, PAL_EPSILON / 10 }, // y: -(sqrtf(2)) - { 10, -1.12837917f, 0.0744082059f, PAL_EPSILON / 10 }, // y: -(2 / sqrtf(pi)) - { 10, -1, 0.1f, PAL_EPSILON }, // y: -(1) - { 10, -0.785398163f, 0.163908636f, PAL_EPSILON }, // y: -(pi / 4) - { 10, -0.707106781f, 0.196287760f, PAL_EPSILON }, // y: -(1 / sqrtf(2)) - { 10, -0.693147181f, 0.202699566f, PAL_EPSILON }, // y: -(ln(2)) - { 10, -0.636619772f, 0.230876765f, PAL_EPSILON }, // y: -(2 / pi) - { 10, -0.434294482f, 0.367879441f, PAL_EPSILON }, // y: -(log10f(e)) - { 10, -0.318309886f, 0.480496373f, PAL_EPSILON }, // y: -(1 / pi) - { 10, 0, 1, PAL_EPSILON * 10 }, - { 10, 0.318309886f, 2.08118116f, PAL_EPSILON * 10 }, // y: 1 / pi - { 10, 0.434294482f, 2.71828183f, PAL_EPSILON * 10 }, // y: log10f(e) expected: e - { 10, 0.636619772f, 4.33131503f, PAL_EPSILON * 10 }, // y: 2 / pi - { 10, 0.693147181f, 4.93340967f, PAL_EPSILON * 10 }, // y: ln(2) - { 10, 0.707106781f, 5.09456117f, PAL_EPSILON * 10 }, // y: 1 / sqrtf(2) - { 10, 0.785398163f, 6.10095980f, PAL_EPSILON * 10 }, // y: pi / 4 - { 10, 1, 10, PAL_EPSILON * 100 }, - { 10, 1.12837917f, 13.4393779f, PAL_EPSILON * 100 }, // y: 2 / sqrtf(pi) - { 10, 1.41421356f, 25.9545535f, PAL_EPSILON * 100 }, // y: sqrtf(2) - { 10, 1.44269504f, 27.7137338f, PAL_EPSILON * 100 }, // y: logf2(e) - { 10, 1.57079633f, 37.2217105f, PAL_EPSILON * 100 }, // y: pi / 2 - { 10, 2.30258509f, 200.717432f, PAL_EPSILON * 1000 }, // y: ln(10) - { 10, 2.71828183f, 522.735300f, PAL_EPSILON * 1000 }, // y: e - { 10, 3.14159265f, 1385.45573f, PAL_EPSILON * 10000 }, // y: pi - { 10, PAL_POSINF, PAL_POSINF, 0 }, - - { PAL_POSINF, PAL_NEGINF, 0, PAL_EPSILON }, - { PAL_POSINF, PAL_POSINF, PAL_POSINF, 0 }, - }; - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].x, tests[i].y, tests[i].expected, tests[i].variance); - } - - validate_isnan(-10, -1.57079633f); // y: -(pi / 2) - validate_isnan(-10, -0.785398163f); // y: -(pi / 4) - validate_isnan(-10, 0.785398163f); // y: pi / 4 - validate_isnan(-10, 1.57079633f); // y: pi / 2 - - validate_isnan(-2.71828183f, -1.57079633f); // x: -(e) y: -(pi / 2) - validate_isnan(-2.71828183f, -0.785398163f); // x: -(e) y: -(pi / 4) - validate_isnan(-2.71828183f, 0.785398163f); // x: -(e) y: pi / 4 - validate_isnan(-2.71828183f, 1.57079633f); // x: -(e) y: pi / 2 - - validate_isnan(PAL_NEGINF, PAL_NAN); - validate_isnan(PAL_NAN, PAL_NEGINF); - - validate_isnan(PAL_POSINF, PAL_NAN); - validate_isnan(PAL_NAN, PAL_POSINF); - - validate_isnan(PAL_NAN, PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/test1.cpp new file mode 100644 index 000000000000..5e704f2d59b6 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/test1.cpp @@ -0,0 +1,228 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Tests that atan2f returns correct values for a subset of values. +** Tests with positive and negative values of x and y to ensure +** atan2f is returning results from the correct quadrant. +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float x; /* first component of the value to test the function with */ + float y; /* second component of the value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * powf_test1_validate + * + * test validation function + */ +void __cdecl powf_test1_validate(float x, float y, float expected, float variance) +{ + float result = powf(x, y); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("powf(%g, %g) returned %10.9g when it should have returned %10.9g", + x, y, result, expected); + } +} + +/** + * powf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl powf_test1_validate_isnan(float x, float y) +{ + float result = powf(x, y); + + if (!_isnanf(result)) + { + Fail("powf(%g, %g) returned %10.9g when it should have returned %10.9g", + x, y, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_powf_test1_paltest_powf_test1, "c_runtime/powf/test1/paltest_powf_test1") +{ + struct test tests[] = + { + /* x y expected variance */ + { PAL_NEGINF, PAL_NEGINF, 0, PAL_EPSILON }, + { PAL_NEGINF, PAL_POSINF, PAL_POSINF, 0 }, + + { -10, PAL_NEGINF, 0, PAL_EPSILON }, + { -10, -1, -0.1f, PAL_EPSILON }, + { -10, 0, 1, PAL_EPSILON * 10 }, + { -10, 1, -10, PAL_EPSILON * 100 }, + { -10, PAL_POSINF, PAL_POSINF, 0 }, + + { -2.71828183f, PAL_NEGINF, 0, PAL_EPSILON }, // x: -(e) + { -2.71828183f, -1, -0.367879441f, PAL_EPSILON }, // x: -(e) + { -2.71828183f, 0, 1, PAL_EPSILON * 10 }, // x: -(e) + { -2.71828183f, 1, -2.71828183f, PAL_EPSILON * 10 }, // x: -(e) expected: e + { -2.71828183f, PAL_POSINF, PAL_POSINF, 0 }, // x: -(e) + + { -1.0, PAL_NEGINF, 1.0, PAL_EPSILON * 10 }, + { -1.0, PAL_POSINF, 1.0, PAL_EPSILON * 10 }, + + { -0.0, PAL_NEGINF, PAL_POSINF, 0 }, + { -0.0, -1, PAL_NEGINF, 0 }, + { -0.0f, -0.0f, 1, PAL_EPSILON * 10 }, + { -0.0f, 0, 1, PAL_EPSILON * 10 }, + { -0.0, 1, -0.0, PAL_EPSILON }, + { -0.0, PAL_POSINF, 0, PAL_EPSILON }, + + { PAL_NAN, -0.0, 1.0, PAL_EPSILON * 10 }, + { PAL_NAN, 0, 1.0, PAL_EPSILON * 10 }, + + { 0.0, PAL_NEGINF, PAL_POSINF, 0 }, + { 0.0, -1, PAL_POSINF, 0 }, + { 0, -0.0f, 1, PAL_EPSILON * 10 }, + { 0, 0, 1, PAL_EPSILON * 10 }, + { 0.0, 1, 0, PAL_EPSILON }, + { 0.0, PAL_POSINF, 0, PAL_EPSILON }, + + { 1, PAL_NEGINF, 1, PAL_EPSILON * 10 }, + { 1, PAL_POSINF, 1, PAL_EPSILON * 10 }, + + { 2.71828183f, PAL_NEGINF, 0, PAL_EPSILON }, + { 2.71828183f, -3.14159265f, 0.0432139183f, PAL_EPSILON / 10 }, // x: e y: -(pi) + { 2.71828183f, -2.71828183f, 0.0659880358f, PAL_EPSILON / 10 }, // x: e y: -(e) + { 2.71828183f, -2.30258509f, 0.1f, PAL_EPSILON }, // x: e y: -(ln(10)) + { 2.71828183f, -1.57079633f, 0.207879576f, PAL_EPSILON }, // x: e y: -(pi / 2) + { 2.71828183f, -1.44269504f, 0.236290088f, PAL_EPSILON }, // x: e y: -(logf2(e)) + { 2.71828183f, -1.41421356f, 0.243116734f, PAL_EPSILON }, // x: e y: -(sqrtf(2)) + { 2.71828183f, -1.12837917f, 0.323557264f, PAL_EPSILON }, // x: e y: -(2 / sqrtf(pi)) + { 2.71828183f, -1, 0.367879441f, PAL_EPSILON }, // x: e y: -(1) + { 2.71828183f, -0.785398163f, 0.455938128f, PAL_EPSILON }, // x: e y: -(pi / 4) + { 2.71828183f, -0.707106781f, 0.493068691f, PAL_EPSILON }, // x: e y: -(1 / sqrtf(2)) + { 2.71828183f, -0.693147181f, 0.5f, PAL_EPSILON }, // x: e y: -(ln(2)) + { 2.71828183f, -0.636619772f, 0.529077808f, PAL_EPSILON }, // x: e y: -(2 / pi) + { 2.71828183f, -0.434294482f, 0.647721485f, PAL_EPSILON }, // x: e y: -(log10f(e)) + { 2.71828183f, -0.318309886f, 0.727377349f, PAL_EPSILON }, // x: e y: -(1 / pi) + { 2.71828183f, 0, 1, PAL_EPSILON * 10 }, // x: e + { 2.71828183f, 0.318309886f, 1.37480223f, PAL_EPSILON * 10 }, // x: e y: 1 / pi + { 2.71828183f, 0.434294482f, 1.54387344f, PAL_EPSILON * 10 }, // x: e y: log10f(e) + { 2.71828183f, 0.636619772f, 1.89008116f, PAL_EPSILON * 10 }, // x: e y: 2 / pi + { 2.71828183f, 0.693147181f, 2, PAL_EPSILON * 10 }, // x: e y: ln(2) + { 2.71828183f, 0.707106781f, 2.02811498f, PAL_EPSILON * 10 }, // x: e y: 1 / sqrtf(2) + { 2.71828183f, 0.785398163f, 2.19328005f, PAL_EPSILON * 10 }, // x: e y: pi / 4 + { 2.71828183f, 1, 2.71828183f, PAL_EPSILON * 10 }, // x: e expected: e + { 2.71828183f, 1.12837917f, 3.09064302f, PAL_EPSILON * 10 }, // x: e y: 2 / sqrtf(pi) + { 2.71828183f, 1.41421356f, 4.11325038f, PAL_EPSILON * 10 }, // x: e y: sqrtf(2) + { 2.71828183f, 1.44269504f, 4.23208611f, PAL_EPSILON * 10 }, // x: e y: logf2(e) + { 2.71828183f, 1.57079633f, 4.81047738f, PAL_EPSILON * 10 }, // x: e y: pi / 2 + { 2.71828183f, 2.30258509f, 10, PAL_EPSILON * 100 }, // x: e y: ln(10) + { 2.71828183f, 2.71828183f, 15.1542622f, PAL_EPSILON * 100 }, // x: e y: e + { 2.71828183f, 3.14159265f, 23.1406926f, PAL_EPSILON * 100 }, // x: e y: pi + { 2.71828183f, PAL_POSINF, PAL_POSINF, 0 }, // x: e + + { 10, PAL_NEGINF, 0, 0 }, + { 10, -3.14159265f, 0.000721784159f, PAL_EPSILON / 1000 }, // y: -(pi) + { 10, -2.71828183f, 0.00191301410f, PAL_EPSILON / 100 }, // y: -(e) + { 10, -2.30258509f, 0.00498212830f, PAL_EPSILON / 100 }, // y: -(ln(10)) + { 10, -1.57079633f, 0.0268660410f, PAL_EPSILON / 10 }, // y: -(pi / 2) + { 10, -1.44269504f, 0.0360831928f, PAL_EPSILON / 10 }, // y: -(logf2(e)) + { 10, -1.41421356f, 0.0385288847f, PAL_EPSILON / 10 }, // y: -(sqrtf(2)) + { 10, -1.12837917f, 0.0744082059f, PAL_EPSILON / 10 }, // y: -(2 / sqrtf(pi)) + { 10, -1, 0.1f, PAL_EPSILON }, // y: -(1) + { 10, -0.785398163f, 0.163908636f, PAL_EPSILON }, // y: -(pi / 4) + { 10, -0.707106781f, 0.196287760f, PAL_EPSILON }, // y: -(1 / sqrtf(2)) + { 10, -0.693147181f, 0.202699566f, PAL_EPSILON }, // y: -(ln(2)) + { 10, -0.636619772f, 0.230876765f, PAL_EPSILON }, // y: -(2 / pi) + { 10, -0.434294482f, 0.367879441f, PAL_EPSILON }, // y: -(log10f(e)) + { 10, -0.318309886f, 0.480496373f, PAL_EPSILON }, // y: -(1 / pi) + { 10, 0, 1, PAL_EPSILON * 10 }, + { 10, 0.318309886f, 2.08118116f, PAL_EPSILON * 10 }, // y: 1 / pi + { 10, 0.434294482f, 2.71828183f, PAL_EPSILON * 10 }, // y: log10f(e) expected: e + { 10, 0.636619772f, 4.33131503f, PAL_EPSILON * 10 }, // y: 2 / pi + { 10, 0.693147181f, 4.93340967f, PAL_EPSILON * 10 }, // y: ln(2) + { 10, 0.707106781f, 5.09456117f, PAL_EPSILON * 10 }, // y: 1 / sqrtf(2) + { 10, 0.785398163f, 6.10095980f, PAL_EPSILON * 10 }, // y: pi / 4 + { 10, 1, 10, PAL_EPSILON * 100 }, + { 10, 1.12837917f, 13.4393779f, PAL_EPSILON * 100 }, // y: 2 / sqrtf(pi) + { 10, 1.41421356f, 25.9545535f, PAL_EPSILON * 100 }, // y: sqrtf(2) + { 10, 1.44269504f, 27.7137338f, PAL_EPSILON * 100 }, // y: logf2(e) + { 10, 1.57079633f, 37.2217105f, PAL_EPSILON * 100 }, // y: pi / 2 + { 10, 2.30258509f, 200.717432f, PAL_EPSILON * 1000 }, // y: ln(10) + { 10, 2.71828183f, 522.735300f, PAL_EPSILON * 1000 }, // y: e + { 10, 3.14159265f, 1385.45573f, PAL_EPSILON * 10000 }, // y: pi + { 10, PAL_POSINF, PAL_POSINF, 0 }, + + { PAL_POSINF, PAL_NEGINF, 0, PAL_EPSILON }, + { PAL_POSINF, PAL_POSINF, PAL_POSINF, 0 }, + }; + + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + powf_test1_validate(tests[i].x, tests[i].y, tests[i].expected, tests[i].variance); + } + + powf_test1_validate_isnan(-10, -1.57079633f); // y: -(pi / 2) + powf_test1_validate_isnan(-10, -0.785398163f); // y: -(pi / 4) + powf_test1_validate_isnan(-10, 0.785398163f); // y: pi / 4 + powf_test1_validate_isnan(-10, 1.57079633f); // y: pi / 2 + + powf_test1_validate_isnan(-2.71828183f, -1.57079633f); // x: -(e) y: -(pi / 2) + powf_test1_validate_isnan(-2.71828183f, -0.785398163f); // x: -(e) y: -(pi / 4) + powf_test1_validate_isnan(-2.71828183f, 0.785398163f); // x: -(e) y: pi / 4 + powf_test1_validate_isnan(-2.71828183f, 1.57079633f); // x: -(e) y: pi / 2 + + powf_test1_validate_isnan(PAL_NEGINF, PAL_NAN); + powf_test1_validate_isnan(PAL_NAN, PAL_NEGINF); + + powf_test1_validate_isnan(PAL_POSINF, PAL_NAN); + powf_test1_validate_isnan(PAL_NAN, PAL_POSINF); + + powf_test1_validate_isnan(PAL_NAN, PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/testinfo.dat deleted file mode 100644 index 2194e1084654..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/powf/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = powf -Name = Call powf with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the powf function with various num/expfonent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/CMakeLists.txt deleted file mode 100644 index 256753a63646..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/printf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/printf.h index 780cf8f01cf3..7d6a9c75c4e3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/printf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/printf.h @@ -13,7 +13,7 @@ #ifndef __printf_H__ #define __printf_H__ -void DoStrTest(const char *formatstr, char* param, const char *checkstr) +inline void DoStrTest_printf(const char *formatstr, char* param, const char *checkstr) { int ret; @@ -24,8 +24,9 @@ void DoStrTest(const char *formatstr, char* param, const char *checkstr) strlen(checkstr), ret); } } +#define DoStrTest DoStrTest_printf -void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_printf(const char *formatstr, WCHAR* param, const char *checkstr) { int ret; @@ -36,8 +37,9 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) strlen(checkstr), ret); } } +#define DoWStrTest DoWStrTest_printf -void DoPointerTest(const char *formatstr, void* param, char* paramstr, +inline void DoPointerTest_printf(const char *formatstr, void* param, char* paramstr, const char *checkstr1) { int ret; @@ -49,8 +51,9 @@ void DoPointerTest(const char *formatstr, void* param, char* paramstr, strlen(checkstr1), ret); } } +#define DoPointerTest DoPointerTest_printf -void DoCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoCountTest_printf(const char *formatstr, int param, const char *checkstr) { int ret; int n = -1; @@ -68,8 +71,9 @@ void DoCountTest(const char *formatstr, int param, const char *checkstr) strlen(checkstr), ret); } } +#define DoCountTest DoCountTest_printf -void DoShortCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoShortCountTest_printf(const char *formatstr, int param, const char *checkstr) { int ret; short int n = -1; @@ -87,9 +91,9 @@ void DoShortCountTest(const char *formatstr, int param, const char *checkstr) strlen(checkstr), ret); } } +#define DoShortCountTest DoShortCountTest_printf - -void DoCharTest(const char *formatstr, char param, const char *checkstr) +inline void DoCharTest_printf(const char *formatstr, char param, const char *checkstr) { int ret; @@ -100,8 +104,9 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr) strlen(checkstr), ret); } } +#define DoCharTest DoCharTest_printf -void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_printf(const char *formatstr, WCHAR param, const char *checkstr) { int ret; @@ -112,8 +117,9 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) strlen(checkstr), ret); } } +#define DoWCharTest DoWCharTest_printf -void DoNumTest(const char *formatstr, int param, const char *checkstr) +inline void DoNumTest_printf(const char *formatstr, int param, const char *checkstr) { int ret; @@ -124,8 +130,9 @@ void DoNumTest(const char *formatstr, int param, const char *checkstr) strlen(checkstr), ret); } } +#define DoNumTest DoNumTest_printf -void DoI64Test(const char *formatstr, INT64 param, char *valuestr, +inline void DoI64Test_printf(const char *formatstr, INT64 param, char *valuestr, const char *checkstr1) { int ret; @@ -137,8 +144,9 @@ void DoI64Test(const char *formatstr, INT64 param, char *valuestr, strlen(checkstr1), ret); } } +#define DoI64Test DoI64Test_printf -void DoDoubleTest(const char *formatstr, double param, +inline void DoDoubleTest_printf(const char *formatstr, double param, const char *checkstr1, const char *checkstr2) { int ret; @@ -150,8 +158,9 @@ void DoDoubleTest(const char *formatstr, double param, strlen(checkstr1), strlen(checkstr2), ret); } } +#define DoDoubleTest DoDoubleTest_printf -void DoArgumentPrecTest(const char *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_printf(const char *formatstr, int precision, void *param, char *paramstr, const char *checkstr1, const char *checkstr2) { int ret; @@ -163,8 +172,9 @@ void DoArgumentPrecTest(const char *formatstr, int precision, void *param, strlen(checkstr1), strlen(checkstr2), ret); } } +#define DoArgumentPrecTest DoArgumentPrecTest_printf -void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_printf(const char *formatstr, int precision, double param, const char *checkstr1, const char *checkstr2) { int ret; @@ -176,6 +186,7 @@ void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param strlen(checkstr1), strlen(checkstr2), ret); } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_printf #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/CMakeLists.txt deleted file mode 100644 index f3cce9c786a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_printf_test1 - ${SOURCES} -) - -add_dependencies(paltest_printf_test1 coreclrpal) - -target_link_libraries(paltest_printf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/test1.cpp index 3b941ae215bc..6523995e5585 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/test1.cpp @@ -16,7 +16,7 @@ #include #include "../printf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test1_paltest_printf_test1, "c_runtime/printf/test1/paltest_printf_test1") { char checkstr[] = "hello world"; int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/testinfo.dat deleted file mode 100644 index dedc3cff90e1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test1 -Description -= General test to see if printf works correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/CMakeLists.txt deleted file mode 100644 index 5fa23114334e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_printf_test10 - ${SOURCES} -) - -add_dependencies(paltest_printf_test10 coreclrpal) - -target_link_libraries(paltest_printf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/test10.cpp index 122eacd7d07e..acad7053b5c3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/test10.cpp @@ -17,7 +17,7 @@ #include "../printf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test10_paltest_printf_test10, "c_runtime/printf/test10/paltest_printf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/testinfo.dat deleted file mode 100644 index 994c781b0566..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests printf with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/CMakeLists.txt deleted file mode 100644 index 52b7202b48ae..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_printf_test11 - ${SOURCES} -) - -add_dependencies(paltest_printf_test11 coreclrpal) - -target_link_libraries(paltest_printf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/test11.cpp index be94cb6b6d7a..36dbdf3197c7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/test11.cpp @@ -16,7 +16,7 @@ #include #include "../printf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test11_paltest_printf_test11, "c_runtime/printf/test11/paltest_printf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/testinfo.dat deleted file mode 100644 index aeb1aba1d1b9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests printf with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/CMakeLists.txt deleted file mode 100644 index aa19c4bb77f5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_printf_test12 - ${SOURCES} -) - -add_dependencies(paltest_printf_test12 coreclrpal) - -target_link_libraries(paltest_printf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/test12.cpp index 00328193ef1a..5d6ed79be125 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/test12.cpp @@ -17,7 +17,7 @@ #include "../printf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test12_paltest_printf_test12, "c_runtime/printf/test12/paltest_printf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/testinfo.dat deleted file mode 100644 index 100e1bf35feb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests printf with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/CMakeLists.txt deleted file mode 100644 index e715bdde8135..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_printf_test13 - ${SOURCES} -) - -add_dependencies(paltest_printf_test13 coreclrpal) - -target_link_libraries(paltest_printf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/test13.cpp index d42313f90c06..dbda8dc22769 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/test13.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test13_paltest_printf_test13, "c_runtime/printf/test13/paltest_printf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/testinfo.dat deleted file mode 100644 index eb8dd5351f0e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests printf with hex numbers (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/CMakeLists.txt deleted file mode 100644 index 878392a4cbd2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_printf_test14 - ${SOURCES} -) - -add_dependencies(paltest_printf_test14 coreclrpal) - -target_link_libraries(paltest_printf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/test14.cpp index 5a999122324f..dcfa4a54a927 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/test14.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test14_paltest_printf_test14, "c_runtime/printf/test14/paltest_printf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/testinfo.dat deleted file mode 100644 index d13bbd2ec685..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests printf with exponential format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/CMakeLists.txt deleted file mode 100644 index 7630cbbb69e5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_printf_test15 - ${SOURCES} -) - -add_dependencies(paltest_printf_test15 coreclrpal) - -target_link_libraries(paltest_printf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/test15.cpp index 03ba391fde54..a53c4a4c9de4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/test15.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test15_paltest_printf_test15, "c_runtime/printf/test15/paltest_printf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/testinfo.dat deleted file mode 100644 index 2c917d7b30b1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests printf with exponential format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/CMakeLists.txt deleted file mode 100644 index 6d4082e2e0ef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_printf_test16 - ${SOURCES} -) - -add_dependencies(paltest_printf_test16 coreclrpal) - -target_link_libraries(paltest_printf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/test16.cpp index 186568262a8c..a2fbc429e8b9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/test16.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test16_paltest_printf_test16, "c_runtime/printf/test16/paltest_printf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/testinfo.dat deleted file mode 100644 index c7e2f771b3f8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests printf with decimal point format doubles diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/CMakeLists.txt deleted file mode 100644 index 3873af8f4145..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_printf_test17 - ${SOURCES} -) - -add_dependencies(paltest_printf_test17 coreclrpal) - -target_link_libraries(paltest_printf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/test17.cpp index 58dbc37feaa2..70a574aaa7e8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/test17.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test17_paltest_printf_test17, "c_runtime/printf/test17/paltest_printf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/testinfo.dat deleted file mode 100644 index 203125deed7f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests printf with compact format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/CMakeLists.txt deleted file mode 100644 index 75791354e7d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_printf_test18 - ${SOURCES} -) - -add_dependencies(paltest_printf_test18 coreclrpal) - -target_link_libraries(paltest_printf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/test18.cpp index 25f3c91ee3d4..17e9aabe8e86 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/test18.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test18_paltest_printf_test18, "c_runtime/printf/test18/paltest_printf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/testinfo.dat deleted file mode 100644 index f8af9313962d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test18/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests printf with compact format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/CMakeLists.txt deleted file mode 100644 index 98321bc653e7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_printf_test19 - ${SOURCES} -) - -add_dependencies(paltest_printf_test19 coreclrpal) - -target_link_libraries(paltest_printf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/test19.cpp index ecef021d658b..d70aad2bd720 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/test19.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test19_paltest_printf_test19, "c_runtime/printf/test19/paltest_printf_test19") { int n = -1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/testinfo.dat deleted file mode 100644 index bf57331b4a40..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test19/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests printf with argument specified precision diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/CMakeLists.txt deleted file mode 100644 index 7208d56ca8dd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_printf_test2 - ${SOURCES} -) - -add_dependencies(paltest_printf_test2 coreclrpal) - -target_link_libraries(paltest_printf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/test2.cpp index 5ddcce29c336..b32f36d30721 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/test2.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test2_paltest_printf_test2, "c_runtime/printf/test2/paltest_printf_test2") { if (PAL_Initialize(argc, argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/testinfo.dat deleted file mode 100644 index b1813b134f3b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests printf with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/CMakeLists.txt deleted file mode 100644 index b75a50ed076e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_printf_test3 - ${SOURCES} -) - -add_dependencies(paltest_printf_test3 coreclrpal) - -target_link_libraries(paltest_printf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/test3.cpp index 5778ebc0ab89..b7ff6bf60e6a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/test3.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test3_paltest_printf_test3, "c_runtime/printf/test3/paltest_printf_test3") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/testinfo.dat deleted file mode 100644 index db5f9770184e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests printf with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/CMakeLists.txt deleted file mode 100644 index 6ce28017e285..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_printf_test4 - ${SOURCES} -) - -add_dependencies(paltest_printf_test4 coreclrpal) - -target_link_libraries(paltest_printf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/test4.cpp index d673fdda4412..507308779bd6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/test4.cpp @@ -16,7 +16,7 @@ #include #include "../printf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test4_paltest_printf_test4, "c_runtime/printf/test4/paltest_printf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/testinfo.dat deleted file mode 100644 index 2aef0fe76668..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests printf with pointers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/CMakeLists.txt deleted file mode 100644 index 885448a4a546..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_printf_test5 - ${SOURCES} -) - -add_dependencies(paltest_printf_test5 coreclrpal) - -target_link_libraries(paltest_printf_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/test5.cpp index b02195a02f1c..15e806bf0e84 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/test5.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test5_paltest_printf_test5, "c_runtime/printf/test5/paltest_printf_test5") { char *longStr = "really-long-string-that-just-keeps-going-on-and-on-and-on.." diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/testinfo.dat deleted file mode 100644 index a0eec3662381..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test5/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests printf with the count specifier diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/CMakeLists.txt deleted file mode 100644 index 21224fda5826..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_printf_test6 - ${SOURCES} -) - -add_dependencies(paltest_printf_test6 coreclrpal) - -target_link_libraries(paltest_printf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/test6.cpp index ab55cb65b912..8ba3d68004c1 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/test6.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test6_paltest_printf_test6, "c_runtime/printf/test6/paltest_printf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/testinfo.dat deleted file mode 100644 index a39fbd8cff51..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests printf with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/CMakeLists.txt deleted file mode 100644 index 3a8f15e7e2be..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_printf_test7 - ${SOURCES} -) - -add_dependencies(paltest_printf_test7 coreclrpal) - -target_link_libraries(paltest_printf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/test7.cpp index 6ec7a29a5674..1e34f0aaef88 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/test7.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test7_paltest_printf_test7, "c_runtime/printf/test7/paltest_printf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/testinfo.dat deleted file mode 100644 index 62dfef223a74..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests printf with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/CMakeLists.txt deleted file mode 100644 index b79c169cf95a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_printf_test8 - ${SOURCES} -) - -add_dependencies(paltest_printf_test8 coreclrpal) - -target_link_libraries(paltest_printf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/test8.cpp index bf3f76d4c9be..7b93fda0e801 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/test8.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test8_paltest_printf_test8, "c_runtime/printf/test8/paltest_printf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/testinfo.dat deleted file mode 100644 index 70d987668823..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests printf with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/CMakeLists.txt deleted file mode 100644 index f7aea6862d1c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_printf_test9 - ${SOURCES} -) - -add_dependencies(paltest_printf_test9 coreclrpal) - -target_link_libraries(paltest_printf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/test9.cpp index bad50d00a9ee..00de8a2abc19 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/test9.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_printf_test9_paltest_printf_test9, "c_runtime/printf/test9/paltest_printf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/testinfo.dat deleted file mode 100644 index 4737eb08553d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/printf/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = printf -Name = Positive Test for printf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests printf with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/CMakeLists.txt deleted file mode 100644 index 56e2de25e505..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_qsort_test1 - ${SOURCES} -) - -add_dependencies(paltest_qsort_test1 coreclrpal) - -target_link_libraries(paltest_qsort_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/test1.cpp index 674ec965fc8c..57b288a809ea 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/test1.cpp @@ -13,12 +13,12 @@ #include -int __cdecl charcmp(const void *pa, const void *pb) +int __cdecl charcmp_qsort_test1(const void *pa, const void *pb) { return memcmp(pa, pb, 1); } -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_qsort_test1_paltest_qsort_test1, "c_runtime/qsort/test1/paltest_qsort_test1") { char before[] = "cgaiehdbjf"; const char after[] = "abcdefghij"; @@ -29,7 +29,7 @@ int __cdecl main(int argc, char **argv) } - qsort(before, sizeof(before) - 1, sizeof(char), charcmp); + qsort(before, sizeof(before) - 1, sizeof(char), charcmp_qsort_test1); if (memcmp(before, after, sizeof(before)) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/testinfo.dat deleted file mode 100644 index d15798b1a92e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = qsort -Name = Positive Test for qsort -TYPE = DEFAULT -EXE1 = test1 -Description -= Calls qsort to sort a buffer, and verifies that it has done the job correctly. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/CMakeLists.txt deleted file mode 100644 index f3f899347931..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_qsort_test2 - ${SOURCES} -) - -add_dependencies(paltest_qsort_test2 coreclrpal) - -target_link_libraries(paltest_qsort_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/test2.cpp index 9500002a939b..20d76c5677e3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/test2.cpp @@ -13,12 +13,12 @@ #include -int __cdecl twocharcmp(const void *pa, const void *pb) +int __cdecl twocharcmp_qsort_test2(const void *pa, const void *pb) { return memcmp(pa, pb, 2); } -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_qsort_test2_paltest_qsort_test2, "c_runtime/qsort/test2/paltest_qsort_test2") { char before[] = "ccggaaiieehhddbbjjff"; const char after[] = "aabbccddeeffgghhiijj"; @@ -29,7 +29,7 @@ int __cdecl main(int argc, char **argv) } - qsort(before, (sizeof(before) - 1) / 2, 2 * sizeof(char), twocharcmp); + qsort(before, (sizeof(before) - 1) / 2, 2 * sizeof(char), twocharcmp_qsort_test2); if (memcmp(before, after, sizeof(before)) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/testinfo.dat deleted file mode 100644 index 8946ab67a5b6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/qsort/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = qsort -Name = Positive Test for qsort -TYPE = DEFAULT -EXE1 = test2 -Description -= Calls qsort to sort a buffer, and verifies that it has done the job correctly. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/CMakeLists.txt deleted file mode 100644 index fd44b33443ba..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_rand_srand_test1 - ${SOURCES} -) - -add_dependencies(paltest_rand_srand_test1 coreclrpal) - -target_link_libraries(paltest_rand_srand_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.cpp index 68888ca8e5fb..fea66560c1fd 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.cpp @@ -21,7 +21,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_rand_srand_test1_paltest_rand_srand_test1, "c_runtime/rand_srand/test1/paltest_rand_srand_test1") { int RandNumber[10]; int TempRandNumber; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/testinfo.dat deleted file mode 100644 index 272e23f038f7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/rand_srand/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = rand and srand -Name = Positive Test for rand and srand -TYPE = DEFAULT -EXE1 = test1 -Description -= Call rand without srand and get 10 random number batch 1. -= call srand with seed 2, get 10 other random number and verify -= that numbers are different from the batch 1. -= Set the seed to 1, get 10 other random number and verify -= that the generated number are the same as batch 1. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/CMakeLists.txt deleted file mode 100644 index b57d84b91b5a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_realloc_test1 - ${SOURCES} -) - -add_dependencies(paltest_realloc_test1 coreclrpal) - -target_link_libraries(paltest_realloc_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.cpp index ff812e1f0d50..edd075da23f7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_realloc_test1_paltest_realloc_test1, "c_runtime/realloc/test1/paltest_realloc_test1") { char *testA; const int len1 = 10; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/testinfo.dat deleted file mode 100644 index 710109597425..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/realloc/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = realloc -Name = Positive Test for realloc -TYPE = DEFAULT -EXE1 = test1 -Description -= Uses realloc to allocate and realloate memory, checking that memory -= contents are copied when the memory is reallocated. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/CMakeLists.txt deleted file mode 100644 index 96abef47fc14..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_scalbn_test1 - ${SOURCES} -) - -add_dependencies(paltest_scalbn_test1 coreclrpal) - -target_link_libraries(paltest_scalbn_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/test1.cpp index 22c61328edd0..a36f2de02ede 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/test1.cpp @@ -41,11 +41,11 @@ struct test }; /** - * validate + * scalbn_test1_validate * * test validation function */ -void __cdecl validate(double value, int exponent, double expected, double variance) +void __cdecl scalbn_test1_validate(double value, int exponent, double expected, double variance) { double result = scalbn(value, exponent); @@ -63,11 +63,11 @@ void __cdecl validate(double value, int exponent, double expected, double varian } /** - * validate + * scalbn_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value, int exponent) +void __cdecl scalbn_test1_validate_isnan(double value, int exponent) { double result = scalbn(value, exponent); @@ -83,7 +83,7 @@ void __cdecl validate_isnan(double value, int exponent) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_scalbn_test1_paltest_scalbn_test1, "c_runtime/scalbn/test1/paltest_scalbn_test1") { struct test tests[] = { @@ -129,10 +129,10 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].exponent, tests[i].expected, tests[i].variance); + scalbn_test1_validate(tests[i].value, tests[i].exponent, tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN, 2147483647); + scalbn_test1_validate_isnan(PAL_NAN, 2147483647); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/testinfo.dat deleted file mode 100644 index d39477b81d81..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbn/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = scalbn -Name = Call scalbn with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the scalbn function with various num/exponent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/CMakeLists.txt deleted file mode 100644 index c5a1dc2872cd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_scalbnf_test1 - ${SOURCES} -) - -add_dependencies(paltest_scalbnf_test1 coreclrpal) - -target_link_libraries(paltest_scalbnf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/test1.c deleted file mode 100644 index 10c7b2a7178e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/test1.c +++ /dev/null @@ -1,138 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Tests that scalbnf returns correct values. -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - int exponent; /* exponent to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, int exponent, float expected, float variance) -{ - float result = scalbnf(value, exponent); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("scalbnf(%g, %g) returned %10.9g when it should have returned %10.9g", - value, exponent, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value, int exponent) -{ - float result = scalbnf(value, exponent); - - if (!_isnanf(result)) - { - Fail("scalbnf(%g, %g) returned %10.9g when it should have returned %10.9g", - value, exponent, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value exponent expected variance */ - { PAL_NEGINF, 0x80000000, PAL_NEGINF, 0 }, - { 0, 0x80000000, 0, 0 }, - { 0.113314732f, -3, 0.0141643415f, PAL_EPSILON / 10 }, - { 0.151955223f, -2, 0.0379888058f, PAL_EPSILON / 10 }, - { 0.202699566f, -2, 0.0506748916f, PAL_EPSILON / 10 }, - { 0.336622537f, -1, 0.168311268f, PAL_EPSILON }, - { 0.367879441f, -1, 0.183939721f, PAL_EPSILON }, - { 0.375214227f, -1, 0.187607114f, PAL_EPSILON }, - { 0.457429347f, -1, 0.228714674f, PAL_EPSILON }, - { 0.5f, -1, 0.25f, PAL_EPSILON }, - { 0.580191810f, 0, 0.580191810f, PAL_EPSILON }, - { 0.612547327f, 0, 0.612547327f, PAL_EPSILON }, - { 0.618503138f, 0, 0.618503138f, PAL_EPSILON }, - { 0.643218242f, 0, 0.643218242f, PAL_EPSILON }, - { 0.740055574f, 0, 0.740055574f, PAL_EPSILON }, - { 0.802008879f, 0, 0.802008879f, PAL_EPSILON }, - { 1, 0, 1, PAL_EPSILON * 10 }, - { 1.24686899f, 0, 1.24686899f, PAL_EPSILON * 10 }, - { 1.35124987f, 0, 1.35124987f, PAL_EPSILON * 10 }, - { 1.55468228f, 0, 1.55468228f, PAL_EPSILON * 10 }, - { 1.61680667f, 0, 1.61680667f, PAL_EPSILON * 10 }, - { 1.63252692f, 0, 1.63252692f, PAL_EPSILON * 10 }, - { 1.72356793f, 0, 1.72356793f, PAL_EPSILON * 10 }, - { 2, 1, 4, PAL_EPSILON * 10 }, - { 2.18612996f, 1, 4.37225992f, PAL_EPSILON * 10 }, - { 2.66514414f, 1, 5.33028829f, PAL_EPSILON * 10 }, - { 2.71828183f, 1, 5.43656366f, PAL_EPSILON * 10 }, - { 2.97068642f, 1, 5.94137285f, PAL_EPSILON * 10 }, - { 4.93340967f, 2, 19.7336387f, PAL_EPSILON * 100 }, - { 6.58088599f, 2, 26.3235440f, PAL_EPSILON * 100 }, - { 8.82497783f, 3, 70.5998226f, PAL_EPSILON * 100 }, - { PAL_POSINF, 0x80000000, PAL_POSINF, 0 }, - }; - - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].exponent, tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN, 2147483647); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/test1.cpp new file mode 100644 index 000000000000..28ac6405bfeb --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/test1.cpp @@ -0,0 +1,138 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Tests that scalbnf returns correct values. +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + int exponent; /* exponent to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * scalbnf_test1_validate + * + * test validation function + */ +void __cdecl scalbnf_test1_validate(float value, int exponent, float expected, float variance) +{ + float result = scalbnf(value, exponent); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("scalbnf(%g, %g) returned %10.9g when it should have returned %10.9g", + value, exponent, result, expected); + } +} + +/** + * scalbnf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl scalbnf_test1_validate_isnan(float value, int exponent) +{ + float result = scalbnf(value, exponent); + + if (!_isnanf(result)) + { + Fail("scalbnf(%g, %g) returned %10.9g when it should have returned %10.9g", + value, exponent, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_scalbnf_test1_paltest_scalbnf_test1, "c_runtime/scalbnf/test1/paltest_scalbnf_test1") +{ + struct test tests[] = + { + /* value exponent expected variance */ + { PAL_NEGINF, 0x80000000, PAL_NEGINF, 0 }, + { 0, 0x80000000, 0, 0 }, + { 0.113314732f, -3, 0.0141643415f, PAL_EPSILON / 10 }, + { 0.151955223f, -2, 0.0379888058f, PAL_EPSILON / 10 }, + { 0.202699566f, -2, 0.0506748916f, PAL_EPSILON / 10 }, + { 0.336622537f, -1, 0.168311268f, PAL_EPSILON }, + { 0.367879441f, -1, 0.183939721f, PAL_EPSILON }, + { 0.375214227f, -1, 0.187607114f, PAL_EPSILON }, + { 0.457429347f, -1, 0.228714674f, PAL_EPSILON }, + { 0.5f, -1, 0.25f, PAL_EPSILON }, + { 0.580191810f, 0, 0.580191810f, PAL_EPSILON }, + { 0.612547327f, 0, 0.612547327f, PAL_EPSILON }, + { 0.618503138f, 0, 0.618503138f, PAL_EPSILON }, + { 0.643218242f, 0, 0.643218242f, PAL_EPSILON }, + { 0.740055574f, 0, 0.740055574f, PAL_EPSILON }, + { 0.802008879f, 0, 0.802008879f, PAL_EPSILON }, + { 1, 0, 1, PAL_EPSILON * 10 }, + { 1.24686899f, 0, 1.24686899f, PAL_EPSILON * 10 }, + { 1.35124987f, 0, 1.35124987f, PAL_EPSILON * 10 }, + { 1.55468228f, 0, 1.55468228f, PAL_EPSILON * 10 }, + { 1.61680667f, 0, 1.61680667f, PAL_EPSILON * 10 }, + { 1.63252692f, 0, 1.63252692f, PAL_EPSILON * 10 }, + { 1.72356793f, 0, 1.72356793f, PAL_EPSILON * 10 }, + { 2, 1, 4, PAL_EPSILON * 10 }, + { 2.18612996f, 1, 4.37225992f, PAL_EPSILON * 10 }, + { 2.66514414f, 1, 5.33028829f, PAL_EPSILON * 10 }, + { 2.71828183f, 1, 5.43656366f, PAL_EPSILON * 10 }, + { 2.97068642f, 1, 5.94137285f, PAL_EPSILON * 10 }, + { 4.93340967f, 2, 19.7336387f, PAL_EPSILON * 100 }, + { 6.58088599f, 2, 26.3235440f, PAL_EPSILON * 100 }, + { 8.82497783f, 3, 70.5998226f, PAL_EPSILON * 100 }, + { PAL_POSINF, 0x80000000, PAL_POSINF, 0 }, + }; + + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + scalbnf_test1_validate(tests[i].value, tests[i].exponent, tests[i].expected, tests[i].variance); + } + + scalbnf_test1_validate_isnan(PAL_NAN, 2147483647); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/testinfo.dat deleted file mode 100644 index 3fe3745eacfd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/scalbnf/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = scalbnf -Name = Call scalbnf with some std input/output. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the scalbnf function with various num/expfonent pairs -= that should produce std answers. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/CMakeLists.txt deleted file mode 100644 index 6a7549a6bdb9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_sin_test1 - ${SOURCES} -) - -add_dependencies(paltest_sin_test1 coreclrpal) - -target_link_libraries(paltest_sin_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/test1.cpp index 7c83f7281f55..bcfeb4baa051 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * sin_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl sin_test1_validate(double value, double expected, double variance) { double result = sin(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * sin_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl sin_test1_validate_isnan(double value) { double result = sin(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_sin_test1_paltest_sin_test1, "c_runtime/sin/test1/paltest_sin_test1") { struct test tests[] = { @@ -117,13 +117,13 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + sin_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + sin_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); + sin_test1_validate_isnan(PAL_NEGINF); + sin_test1_validate_isnan(PAL_NAN); + sin_test1_validate_isnan(PAL_POSINF); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/testinfo.dat deleted file mode 100644 index 8ec3977815bd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sin/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sin -Name = Positive Test for sin -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to sin() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/CMakeLists.txt deleted file mode 100644 index 76ceb1e94d10..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_sinf_test1 - ${SOURCES} -) - -add_dependencies(paltest_sinf_test1 coreclrpal) - -target_link_libraries(paltest_sinf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.c deleted file mode 100644 index 0fa2935f1907..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.c +++ /dev/null @@ -1,129 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that sinf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = sinf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("sinf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = sinf(value); - - if (!_isnanf(result)) - { - Fail("sinf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 0, PAL_EPSILON }, - { 0.318309886f, 0.312961796f, PAL_EPSILON }, // value: 1 / pi - { 0.434294482f, 0.420770483f, PAL_EPSILON }, // value: log10f(e) - { 0.636619772f, 0.594480769f, PAL_EPSILON }, // value: 2 / pi - { 0.693147181f, 0.638961276f, PAL_EPSILON }, // value: ln(2) - { 0.707106781f, 0.649636939f, PAL_EPSILON }, // value: 1 / sqrtf(2) - { 0.785398163f, 0.707106781f, PAL_EPSILON }, // value: pi / 4, expected: 1 / sqrtf(2) - { 1, 0.841470985f, PAL_EPSILON }, - { 1.12837917f, 0.903719457f, PAL_EPSILON }, // value: 2 / sqrtf(pi) - { 1.41421356f, 0.987765946f, PAL_EPSILON }, // value: sqrtf(2) - { 1.44269504f, 0.991806244f, PAL_EPSILON }, // value: logf2(e) - { 1.57079633f, 1, PAL_EPSILON * 10 }, // value: pi / 2 - { 2.30258509f, 0.743980337f, PAL_EPSILON }, // value: ln(10) - { 2.71828183f, 0.410781291f, PAL_EPSILON }, // value: e - { 3.14159265f, 0, PAL_EPSILON }, // value: pi - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.cpp new file mode 100644 index 000000000000..1481843fed47 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.cpp @@ -0,0 +1,129 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that sinf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * sinf_test1_validate + * + * test validation function + */ +void __cdecl sinf_test1_validate(float value, float expected, float variance) +{ + float result = sinf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("sinf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * sinf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl sinf_test1_validate_isnan(float value) +{ + float result = sinf(value); + + if (!_isnanf(result)) + { + Fail("sinf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_sinf_test1_paltest_sinf_test1, "c_runtime/sinf/test1/paltest_sinf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 0, PAL_EPSILON }, + { 0.318309886f, 0.312961796f, PAL_EPSILON }, // value: 1 / pi + { 0.434294482f, 0.420770483f, PAL_EPSILON }, // value: log10f(e) + { 0.636619772f, 0.594480769f, PAL_EPSILON }, // value: 2 / pi + { 0.693147181f, 0.638961276f, PAL_EPSILON }, // value: ln(2) + { 0.707106781f, 0.649636939f, PAL_EPSILON }, // value: 1 / sqrtf(2) + { 0.785398163f, 0.707106781f, PAL_EPSILON }, // value: pi / 4, expected: 1 / sqrtf(2) + { 1, 0.841470985f, PAL_EPSILON }, + { 1.12837917f, 0.903719457f, PAL_EPSILON }, // value: 2 / sqrtf(pi) + { 1.41421356f, 0.987765946f, PAL_EPSILON }, // value: sqrtf(2) + { 1.44269504f, 0.991806244f, PAL_EPSILON }, // value: logf2(e) + { 1.57079633f, 1, PAL_EPSILON * 10 }, // value: pi / 2 + { 2.30258509f, 0.743980337f, PAL_EPSILON }, // value: ln(10) + { 2.71828183f, 0.410781291f, PAL_EPSILON }, // value: e + { 3.14159265f, 0, PAL_EPSILON }, // value: pi + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + sinf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + sinf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + sinf_test1_validate_isnan(PAL_NEGINF); + sinf_test1_validate_isnan(PAL_NAN); + sinf_test1_validate_isnan(PAL_POSINF); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/testinfo.dat deleted file mode 100644 index 2d70efaab928..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sinf -Name = Positive Test for sinf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to sinf() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/CMakeLists.txt deleted file mode 100644 index bd74171f4252..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_sinh_test1 - ${SOURCES} -) - -add_dependencies(paltest_sinh_test1 coreclrpal) - -target_link_libraries(paltest_sinh_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/test1.cpp index 5dc6282a0221..2879bf16aea9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * sinh_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl sinh_test1_validate(double value, double expected, double variance) { double result = sinh(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * sinh_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl sinh_test1_validate_isnan(double value) { double result = sinh(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_sinh_test1_paltest_sinh_test1, "c_runtime/sinh/test1/paltest_sinh_test1") { struct test tests[] = { @@ -118,11 +118,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + sinh_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + sinh_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + sinh_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/testinfo.dat deleted file mode 100644 index a8f09d8fc28b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinh/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sinh -Name = Positive Test for sinh -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to sinh() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/CMakeLists.txt deleted file mode 100644 index 811324b05db5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_sinhf_test1 - ${SOURCES} -) - -add_dependencies(paltest_sinhf_test1 coreclrpal) - -target_link_libraries(paltest_sinhf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.c deleted file mode 100644 index 6c00b8599697..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.c +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that sinhf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = sinhf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("sinhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = sinhf(value); - - if (!_isnanf(result)) - { - Fail("sinhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 0, PAL_EPSILON }, - { 0.318309886f, 0.323712439f, PAL_EPSILON }, // value: 1 / pi - { 0.434294482f, 0.448075979f, PAL_EPSILON }, // value: log10f(e) - { 0.636619772f, 0.680501678f, PAL_EPSILON }, // value: 2 / pi - { 0.693147181f, 0.75, PAL_EPSILON }, // value: ln(2) - { 0.707106781f, 0.767523145f, PAL_EPSILON }, // value: 1 / sqrtf(2) - { 0.785398163f, 0.868670961f, PAL_EPSILON }, // value: pi / 4 - { 1, 1.17520119f, PAL_EPSILON * 10 }, - { 1.12837917f, 1.38354288f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) - { 1.41421356f, 1.93506682f, PAL_EPSILON * 10 }, // value: sqrtf(2) - { 1.44269504f, 1.99789801f, PAL_EPSILON * 10 }, // value: logf2(e) - { 1.57079633f, 2.30129890f, PAL_EPSILON * 10 }, // value: pi / 2 - { 2.30258509f, 4.95f, PAL_EPSILON * 10 }, // value: ln(10) - { 2.71828183f, 7.54413710f, PAL_EPSILON * 10 }, // value: e - { 3.14159265f, 11.5487394f, PAL_EPSILON * 100 }, // value: pi - { PAL_POSINF, PAL_POSINF, 0 }, - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.cpp new file mode 100644 index 000000000000..a67ab96a4101 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.cpp @@ -0,0 +1,128 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that sinhf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * sinhf_test1_validate + * + * test validation function + */ +void __cdecl sinhf_test1_validate(float value, float expected, float variance) +{ + float result = sinhf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("sinhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * sinhf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl sinhf_test1_validate_isnan(float value) +{ + float result = sinhf(value); + + if (!_isnanf(result)) + { + Fail("sinhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_sinhf_test1_paltest_sinhf_test1, "c_runtime/sinhf/test1/paltest_sinhf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 0, PAL_EPSILON }, + { 0.318309886f, 0.323712439f, PAL_EPSILON }, // value: 1 / pi + { 0.434294482f, 0.448075979f, PAL_EPSILON }, // value: log10f(e) + { 0.636619772f, 0.680501678f, PAL_EPSILON }, // value: 2 / pi + { 0.693147181f, 0.75, PAL_EPSILON }, // value: ln(2) + { 0.707106781f, 0.767523145f, PAL_EPSILON }, // value: 1 / sqrtf(2) + { 0.785398163f, 0.868670961f, PAL_EPSILON }, // value: pi / 4 + { 1, 1.17520119f, PAL_EPSILON * 10 }, + { 1.12837917f, 1.38354288f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) + { 1.41421356f, 1.93506682f, PAL_EPSILON * 10 }, // value: sqrtf(2) + { 1.44269504f, 1.99789801f, PAL_EPSILON * 10 }, // value: logf2(e) + { 1.57079633f, 2.30129890f, PAL_EPSILON * 10 }, // value: pi / 2 + { 2.30258509f, 4.95f, PAL_EPSILON * 10 }, // value: ln(10) + { 2.71828183f, 7.54413710f, PAL_EPSILON * 10 }, // value: e + { 3.14159265f, 11.5487394f, PAL_EPSILON * 100 }, // value: pi + { PAL_POSINF, PAL_POSINF, 0 }, + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + sinhf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + sinhf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + sinhf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/testinfo.dat deleted file mode 100644 index 1af96771ef91..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sinhf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sinhf -Name = Positive Test for sinhf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to sinhf() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt deleted file mode 100644 index b29c7c438bd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h index cc3eff5fd954..8cfe4507ac1b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h @@ -13,7 +13,7 @@ #ifndef __SPRINTF_S_H__ #define __SPRINTF_S_H__ -void DoStrTest(const char *formatstr, char* param, const char *checkstr) +inline void DoStrTest_sprintf_s(const char *formatstr, char* param, const char *checkstr) { char buf[256] = { 0 }; @@ -25,8 +25,9 @@ void DoStrTest(const char *formatstr, char* param, const char *checkstr) param, formatstr, checkstr, buf); } } +#define DoStrTest DoStrTest_sprintf_s -void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_sprintf_s(const char *formatstr, WCHAR* param, const char *checkstr) { char buf[256] = { 0 }; @@ -38,8 +39,9 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) convertC(param), formatstr, checkstr, buf); } } +#define DoWStrTest DoWStrTest_sprintf_s -void DoPointerTest(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 }; @@ -52,8 +54,9 @@ void DoPointerTest(const char *formatstr, void* param, char* paramstr, paramstr, formatstr, checkstr1, buf); } } +#define DoPointerTest DoPointerTest_sprintf_s -void DoCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoCountTest_sprintf_s(const char *formatstr, int param, const char *checkstr) { char buf[512] = { 0 }; int n = -1; @@ -70,8 +73,9 @@ void DoCountTest(const char *formatstr, int param, const char *checkstr) Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf); } } +#define DoCountTest DoCountTest_sprintf_s -void DoShortCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoShortCountTest_sprintf_s(const char *formatstr, int param, const char *checkstr) { char buf[256] = { 0 }; short int n = -1; @@ -88,9 +92,9 @@ void DoShortCountTest(const char *formatstr, int param, const char *checkstr) Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf); } } +#define DoShortCountTest DoShortCountTest_sprintf_s - -void DoCharTest(const char *formatstr, char param, const char *checkstr) +inline void DoCharTest_sprintf_s(const char *formatstr, char param, const char *checkstr) { char buf[256] = { 0 }; @@ -102,8 +106,9 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr) param, param, formatstr, checkstr, buf); } } +#define DoCharTest DoCharTest_sprintf_s -void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_sprintf_s(const char *formatstr, WCHAR param, const char *checkstr) { char buf[256] = { 0 }; @@ -115,8 +120,9 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) (char)param, param, formatstr, checkstr, buf); } } +#define DoWCharTest DoWCharTest_sprintf_s -void DoNumTest(const char *formatstr, int value, const char *checkstr) +inline void DoNumTest_sprintf_s(const char *formatstr, int value, const char *checkstr) { char buf[256] = { 0 }; @@ -128,8 +134,9 @@ void DoNumTest(const char *formatstr, int value, const char *checkstr) value, formatstr, checkstr, buf); } } +#define DoNumTest DoNumTest_sprintf_s -void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1) +inline void DoI64Test_sprintf_s(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1) { char buf[256] = { 0 }; @@ -141,8 +148,9 @@ void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *c valuestr, formatstr, checkstr1, buf); } } +#define DoI64Test DoI64Test_sprintf_s -void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, +inline void DoDoubleTest_sprintf_s(const char *formatstr, double value, const char *checkstr1, const char *checkstr2) { char buf[256] = { 0 }; @@ -156,8 +164,9 @@ void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, value, formatstr, checkstr1, checkstr2, buf); } } +#define DoDoubleTest DoDoubleTest_sprintf_s -void DoArgumentPrecTest(const char *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_sprintf_s(const char *formatstr, int precision, void *param, char *paramstr, const char *checkstr1, const char *checkstr2) { char buf[256]; @@ -172,8 +181,9 @@ void DoArgumentPrecTest(const char *formatstr, int precision, void *param, } } +#define DoArgumentPrecTest DoArgumentPrecTest_sprintf_s -void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_sprintf_s(const char *formatstr, int precision, double param, const char *checkstr1, const char *checkstr2) { char buf[256]; @@ -188,6 +198,7 @@ void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_sprintf_s #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt deleted file mode 100644 index d190fd7beb52..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_sprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test1 coreclrpal) - -target_link_libraries(paltest_sprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp index 95cabe068c3b..12342858aff7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test1_paltest_sprintf_test1, "c_runtime/sprintf_s/test1/paltest_sprintf_test1") { char checkstr[] = "hello world"; char buf[256]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat deleted file mode 100644 index dd7e48e96b2d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test1 -Description -= General test to see if sprintf_s works correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt deleted file mode 100644 index 6ebb55591293..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_sprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test10 coreclrpal) - -target_link_libraries(paltest_sprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp index fec212368755..915fae9900ec 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test10_paltest_sprintf_test10, "c_runtime/sprintf_s/test10/paltest_sprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat deleted file mode 100644 index 5bef07c257d6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests sprintf_s with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt deleted file mode 100644 index 417db26057c4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_sprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test11 coreclrpal) - -target_link_libraries(paltest_sprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp index d2d21e3222c6..4ce47e7ae3fa 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test11_paltest_sprintf_test11, "c_runtime/sprintf_s/test11/paltest_sprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat deleted file mode 100644 index c65a26c70812..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests sprintf_s with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt deleted file mode 100644 index c9c1025217bf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_sprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test12 coreclrpal) - -target_link_libraries(paltest_sprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp index 44da16677ac0..b41cf9b631fa 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test12_paltest_sprintf_test12, "c_runtime/sprintf_s/test12/paltest_sprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat deleted file mode 100644 index 99db86d551db..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests sprintf_s with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt deleted file mode 100644 index 7c5c01483cdb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_sprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test13 coreclrpal) - -target_link_libraries(paltest_sprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp index 7542bb6fa78a..be0ba077bea8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test13_paltest_sprintf_test13, "c_runtime/sprintf_s/test13/paltest_sprintf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat deleted file mode 100644 index 9ec9a9f53d91..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests sprintf_s with hex numbers (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt deleted file mode 100644 index f85869a52bcb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_sprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test14 coreclrpal) - -target_link_libraries(paltest_sprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp index 21b900d87d06..74c7b199f357 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test14_paltest_sprintf_test14, "c_runtime/sprintf_s/test14/paltest_sprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat deleted file mode 100644 index d9d2d7dd4ebd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests sprintf_s with exponential format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt deleted file mode 100644 index 99bd4cf858ae..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_sprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test15 coreclrpal) - -target_link_libraries(paltest_sprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp index 17b4020ec0dd..1854436ee804 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test15_paltest_sprintf_test15, "c_runtime/sprintf_s/test15/paltest_sprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat deleted file mode 100644 index 458ef784771d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests sprintf_s with exponential format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt deleted file mode 100644 index 1d57f8134f99..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_sprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test16 coreclrpal) - -target_link_libraries(paltest_sprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp index b25a48633b4f..b3cea7ebf163 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp @@ -19,7 +19,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test16_paltest_sprintf_test16, "c_runtime/sprintf_s/test16/paltest_sprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat deleted file mode 100644 index a40e69e53105..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests sprintf_s with decimal point format doubles diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt deleted file mode 100644 index 336639aef6fd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_sprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test17 coreclrpal) - -target_link_libraries(paltest_sprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp index 1cf0aaa4f31c..daa05ba7a0f6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test17_paltest_sprintf_test17, "c_runtime/sprintf_s/test17/paltest_sprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat deleted file mode 100644 index 2782f03bb863..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests sprintf_s with compact format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt deleted file mode 100644 index abf954908f7b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_sprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test18 coreclrpal) - -target_link_libraries(paltest_sprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp index e3130105f9c2..abb9a0b7b70a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp @@ -19,7 +19,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test18_paltest_sprintf_test18, "c_runtime/sprintf_s/test18/paltest_sprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat deleted file mode 100644 index e93e01f2b11c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests sprintf_s with compact format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt deleted file mode 100644 index 79d22af70b0a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_sprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test19 coreclrpal) - -target_link_libraries(paltest_sprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp index 98be4e8e1ed9..f5976c996e30 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test19_paltest_sprintf_test19, "c_runtime/sprintf_s/test19/paltest_sprintf_test19") { int n = -1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat deleted file mode 100644 index ea56b0bb8f03..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests sprintf_s with argument specified precision diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt deleted file mode 100644 index da08f52ca795..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_sprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test2 coreclrpal) - -target_link_libraries(paltest_sprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp index efa9e484a9cc..56371a906e79 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp @@ -19,7 +19,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test2_paltest_sprintf_test2, "c_runtime/sprintf_s/test2/paltest_sprintf_test2") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat deleted file mode 100644 index 1ec448495ffc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests sprintf_s with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt deleted file mode 100644 index 5a298edae22b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_sprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test3 coreclrpal) - -target_link_libraries(paltest_sprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp index f39d667386b9..5f1ec06d4b31 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test3_paltest_sprintf_test3, "c_runtime/sprintf_s/test3/paltest_sprintf_test3") { if (PAL_Initialize(argc, argv) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat deleted file mode 100644 index cc56fe26478f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests sprintf_s with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt deleted file mode 100644 index ad306088e0ba..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_sprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test4 coreclrpal) - -target_link_libraries(paltest_sprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp index 67f664d59bec..6d9f3ebe35f0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp @@ -19,7 +19,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test4_paltest_sprintf_test4, "c_runtime/sprintf_s/test4/paltest_sprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat deleted file mode 100644 index 617c9b2d3e5b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests sprintf_s with pointers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt deleted file mode 100644 index 631282956ce7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_sprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test6 coreclrpal) - -target_link_libraries(paltest_sprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp index 9682e61f543d..a535777952e7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp @@ -19,7 +19,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test6_paltest_sprintf_test6, "c_runtime/sprintf_s/test6/paltest_sprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat deleted file mode 100644 index 8a8a3f4c9863..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests sprintf_s with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt deleted file mode 100644 index c4261ef4cc40..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_sprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test7 coreclrpal) - -target_link_libraries(paltest_sprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp index b9dc0a810d57..91d18837660c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test7_paltest_sprintf_test7, "c_runtime/sprintf_s/test7/paltest_sprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat deleted file mode 100644 index 38fa9371fe59..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests sprintf_s with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt deleted file mode 100644 index dc12c5dae591..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_sprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test8 coreclrpal) - -target_link_libraries(paltest_sprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp index 70d0c6e1e095..1a5153c343da 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test8_paltest_sprintf_test8, "c_runtime/sprintf_s/test8/paltest_sprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat deleted file mode 100644 index 8c9e8cff321b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests sprintf_s with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt deleted file mode 100644 index 28f2802953de..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_sprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_sprintf_test9 coreclrpal) - -target_link_libraries(paltest_sprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp index d7e67a245b8d..5804db818d4d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp @@ -20,7 +20,7 @@ * Depends on memcmp and strlen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sprintf_s_test9_paltest_sprintf_test9, "c_runtime/sprintf_s/test9/paltest_sprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat deleted file mode 100644 index beb708ae943c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sprintf_s -Name = Positive Test for sprintf_s -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests sprintf_s with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/CMakeLists.txt deleted file mode 100644 index 2af8b93d08b1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_sqrt_test1 - ${SOURCES} -) - -add_dependencies(paltest_sqrt_test1 coreclrpal) - -target_link_libraries(paltest_sqrt_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.cpp index ae1b92fd12e5..c86c2cb29bb2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.cpp @@ -42,11 +42,11 @@ struct test }; /** - * validate + * sqrt_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl sqrt_test1_validate(double value, double expected, double variance) { double result = sqrt(value); @@ -64,11 +64,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * sqrt_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl sqrt_test1_validate_isnan(double value) { double result = sqrt(value); @@ -79,7 +79,7 @@ void __cdecl validate_isnan(double value) } } -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_sqrt_test1_paltest_sqrt_test1, "c_runtime/sqrt/test1/paltest_sqrt_test1") { struct test tests[] = { @@ -106,16 +106,16 @@ int __cdecl main(int argc, char **argv) return FAIL; } - validate(-0.0, -0.0, PAL_EPSILON); - validate( 0.0, 0.0, PAL_EPSILON); + sqrt_test1_validate(-0.0, -0.0, PAL_EPSILON); + sqrt_test1_validate( 0.0, 0.0, PAL_EPSILON); for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate(tests[i].value, tests[i].expected, tests[i].variance); - validate_isnan(-tests[i].value); + sqrt_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + sqrt_test1_validate_isnan(-tests[i].value); } - validate_isnan(PAL_NAN); + sqrt_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/testinfo.dat deleted file mode 100644 index 65001382b9aa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrt/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sqrt -Name = Call sqrt on positive values and zero. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the sqrt function on a positive value, a positive value -= with a decimal and on the maxium possible double value. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/CMakeLists.txt deleted file mode 100644 index 5790f709239a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_sqrtf_test1 - ${SOURCES} -) - -add_dependencies(paltest_sqrtf_test1 coreclrpal) - -target_link_libraries(paltest_sqrtf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.c deleted file mode 100644 index ac3941b55f61..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.c +++ /dev/null @@ -1,121 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*===================================================================== -** -** Source: test1.c -** -** Purpose: Call the sqrtf function on a positive value, a positive value -** with a decimal and on the maxium possible float value. -** -** -**===================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = sqrtf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("sqrtf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = sqrtf(value); - - if (!_isnanf(result)) - { - Fail("sqrtf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0.318309886f, 0.564189584f, PAL_EPSILON }, // value: 1 / pi - { 0.434294482f, 0.659010229f, PAL_EPSILON }, // value: log10f(e) - { 0.636619772f, 0.797884561f, PAL_EPSILON }, // value: 2 / pi - { 0.693147181f, 0.832554611f, PAL_EPSILON }, // value: ln(2) - { 0.707106781f, 0.840896415f, PAL_EPSILON }, // value: 1 / sqrtf(2) - { 0.785398163f, 0.886226925f, PAL_EPSILON }, // value: pi / 4 - { 1, 1, PAL_EPSILON * 10 }, - { 1.12837917f, 1.06225193f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) - { 1.41421356f, 1.18920712f, PAL_EPSILON * 10 }, // value: sqrtf(2) - { 1.44269504f, 1.20112241f, PAL_EPSILON * 10 }, // value: logf2(e) - { 1.57079633f, 1.25331414f, PAL_EPSILON * 10 }, // value: pi / 2 - { 2.30258509f, 1.51742713f, PAL_EPSILON * 10 }, // value: ln(10) - { 2.71828183f, 1.64872127f, PAL_EPSILON * 10 }, // value: e - { 3.14159265f, 1.77245385F, PAL_EPSILON * 10 }, // value: pi - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - validate(-0.0f, -0.0f, PAL_EPSILON); - validate( 0.0f, 0.0f, PAL_EPSILON); - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate(tests[i].value, tests[i].expected, tests[i].variance); - validate_isnan(-tests[i].value); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.cpp new file mode 100644 index 000000000000..03cfffda1ee8 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.cpp @@ -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. + +/*===================================================================== +** +** Source: test1.c +** +** Purpose: Call the sqrtf function on a positive value, a positive value +** with a decimal and on the maxium possible float value. +** +** +**===================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * sqrtf_test1_validate + * + * test validation function + */ +void __cdecl sqrtf_test1_validate(float value, float expected, float variance) +{ + float result = sqrtf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("sqrtf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * sqrtf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl sqrtf_test1_validate_isnan(float value) +{ + float result = sqrtf(value); + + if (!_isnanf(result)) + { + Fail("sqrtf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +PALTEST(c_runtime_sqrtf_test1_paltest_sqrtf_test1, "c_runtime/sqrtf/test1/paltest_sqrtf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0.318309886f, 0.564189584f, PAL_EPSILON }, // value: 1 / pi + { 0.434294482f, 0.659010229f, PAL_EPSILON }, // value: log10f(e) + { 0.636619772f, 0.797884561f, PAL_EPSILON }, // value: 2 / pi + { 0.693147181f, 0.832554611f, PAL_EPSILON }, // value: ln(2) + { 0.707106781f, 0.840896415f, PAL_EPSILON }, // value: 1 / sqrtf(2) + { 0.785398163f, 0.886226925f, PAL_EPSILON }, // value: pi / 4 + { 1, 1, PAL_EPSILON * 10 }, + { 1.12837917f, 1.06225193f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) + { 1.41421356f, 1.18920712f, PAL_EPSILON * 10 }, // value: sqrtf(2) + { 1.44269504f, 1.20112241f, PAL_EPSILON * 10 }, // value: logf2(e) + { 1.57079633f, 1.25331414f, PAL_EPSILON * 10 }, // value: pi / 2 + { 2.30258509f, 1.51742713f, PAL_EPSILON * 10 }, // value: ln(10) + { 2.71828183f, 1.64872127f, PAL_EPSILON * 10 }, // value: e + { 3.14159265f, 1.77245385F, PAL_EPSILON * 10 }, // value: pi + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + sqrtf_test1_validate(-0.0f, -0.0f, PAL_EPSILON); + sqrtf_test1_validate( 0.0f, 0.0f, PAL_EPSILON); + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + sqrtf_test1_validate(tests[i].value, tests[i].expected, tests[i].variance); + sqrtf_test1_validate_isnan(-tests[i].value); + } + + sqrtf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/testinfo.dat deleted file mode 100644 index 1bda2dabe57c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sqrtf/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sqrtf -Name = Call sqrtf on positive values and zero. -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the sqrtf function on a positive value, a positive value -= with a decimal and on the maxium possible float value. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt deleted file mode 100644 index 56b4848b303a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h index 6ef638c3fabb..8c66c98fcb0c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h @@ -13,7 +13,7 @@ #ifndef __SSCANF_S_H__ #define __SSCANF_S_H__ -void DoVoidTest(char *inputstr, const char *formatstr) +inline void DoVoidTest_scanf_s(char *inputstr, const char *formatstr) { char buf[256] = { 0 }; int i; @@ -36,8 +36,9 @@ void DoVoidTest(char *inputstr, const char *formatstr) } } +#define DoVoidTest DoVoidTest_scanf_s -void DoStrTest(char *inputstr, const char *formatstr, const char *checkstr) +inline void DoStrTest_scanf_s(char *inputstr, const char *formatstr, const char *checkstr) { char buf[256] = { 0 }; int ret; @@ -57,8 +58,9 @@ void DoStrTest(char *inputstr, const char *formatstr, const char *checkstr) } } +#define DoStrTest DoStrTest_scanf_s -void DoWStrTest(char *inputstr, const char *formatstr, const WCHAR *checkstr) +inline void DoWStrTest_scanf_s(char *inputstr, const char *formatstr, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; int ret; @@ -78,8 +80,9 @@ void DoWStrTest(char *inputstr, const char *formatstr, const WCHAR *checkstr) } } +#define DoWStrTest DoWStrTest_scanf_s -void DoNumTest(char *inputstr, const char *formatstr, int checknum) +inline void DoNumTest_scanf_s(char *inputstr, const char *formatstr, int checknum) { int num; int ret; @@ -97,8 +100,9 @@ void DoNumTest(char *inputstr, const char *formatstr, int checknum) "Expected %d, got %d.\n", inputstr, formatstr, checknum, num); } } +#define DoNumTest DoNumTest_scanf_s -void DoShortNumTest(char *inputstr, const char *formatstr, short checknum) +inline void DoShortNumTest_scanf_s(char *inputstr, const char *formatstr, short checknum) { short num; int ret; @@ -116,8 +120,9 @@ void DoShortNumTest(char *inputstr, const char *formatstr, short checknum) "Expected %hd, got %hd.\n", inputstr, formatstr, checknum, num); } } +#define DoShortNumTest DoShortNumTest_scanf_s -void DoI64NumTest(char *inputstr, const char *formatstr, INT64 checknum) +inline void DoI64NumTest_scanf_s(char *inputstr, const char *formatstr, INT64 checknum) { char buf[256]; char check[256]; @@ -139,8 +144,9 @@ void DoI64NumTest(char *inputstr, const char *formatstr, INT64 checknum) "Expected %s, got %s.\n", inputstr, formatstr, check, buf); } } +#define DoI64NumTest DoI64NumTest_scanf_s -void DoCharTest(char *inputstr, const char *formatstr, char* checkchars, int numchars) +inline void DoCharTest_scanf_s(char *inputstr, const char *formatstr, char* checkchars, int numchars) { char buf[256]; int ret; @@ -172,8 +178,9 @@ void DoCharTest(char *inputstr, const char *formatstr, char* checkchars, int num numchars); } } +#define DoCharTest DoCharTest_scanf_s -void DoWCharTest(char *inputstr, const char *formatstr, WCHAR* checkchars, int numchars) +inline void DoWCharTest_scanf_s(char *inputstr, const char *formatstr, WCHAR* checkchars, int numchars) { WCHAR buf[256]; int ret; @@ -205,9 +212,9 @@ void DoWCharTest(char *inputstr, const char *formatstr, WCHAR* checkchars, int n numchars); } } +#define DoWCharTest DoWCharTest_scanf_s - -void DoFloatTest(char *inputstr, const char *formatstr, float checkval) +inline void DoFloatTest_scanf_s(char *inputstr, const char *formatstr, float checkval) { char buf[256] = { 0 }; float val; @@ -240,6 +247,6 @@ void DoFloatTest(char *inputstr, const char *formatstr, float checkval) } } - +#define DoFloatTest DoFloatTest_scanf_s #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt deleted file mode 100644 index 6069fc86a7bc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_sscanf_test1 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test1 coreclrpal) - -target_link_libraries(paltest_sscanf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp index c8c12aa854a8..a359003e135b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp @@ -16,7 +16,7 @@ #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test1_paltest_sscanf_test1, "c_runtime/sscanf_s/test1/paltest_sscanf_test1") { int num; int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat deleted file mode 100644 index 03ccc14eb200..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test1 -Description -= General test of sscanf_s diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt deleted file mode 100644 index ba3dbad611d8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_sscanf_test10 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test10 coreclrpal) - -target_link_libraries(paltest_sscanf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp index fb710429db18..caa94e497429 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test10_paltest_sscanf_test10, "c_runtime/sscanf_s/test10/paltest_sscanf_test10") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat deleted file mode 100644 index ef47b2b5ab7c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests sscanf_s with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt deleted file mode 100644 index 69f212567b26..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_sscanf_test11 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test11 coreclrpal) - -target_link_libraries(paltest_sscanf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp index 665f006ee076..1561351ac1e4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test11_paltest_sscanf_test11, "c_runtime/sscanf_s/test11/paltest_sscanf_test11") { if (PAL_Initialize(argc, argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat deleted file mode 100644 index 6dadb849e37a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests sscanf_s with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt deleted file mode 100644 index 21dbb424e296..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_sscanf_test12 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test12 coreclrpal) - -target_link_libraries(paltest_sscanf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp index 912dac26f6d4..337c8300083a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test12_paltest_sscanf_test12, "c_runtime/sscanf_s/test12/paltest_sscanf_test12") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat deleted file mode 100644 index 816f51ee6713..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests sscanf_s with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt deleted file mode 100644 index 56a1adc73c29..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_sscanf_test13 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test13 coreclrpal) - -target_link_libraries(paltest_sscanf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp index f7deec83c78e..0b7648a51738 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test13_paltest_sscanf_test13, "c_runtime/sscanf_s/test13/paltest_sscanf_test13") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat deleted file mode 100644 index 1e62e1a5c703..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests sscanf_s with floats (decimal notation) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt deleted file mode 100644 index 17cc710e79b9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_sscanf_test14 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test14 coreclrpal) - -target_link_libraries(paltest_sscanf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp index 091afd61535e..f3a975caff34 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test14_paltest_sscanf_test14, "c_runtime/sscanf_s/test14/paltest_sscanf_test14") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat deleted file mode 100644 index cf144fe46272..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests sscanf_s with floats (exponential notation, lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt deleted file mode 100644 index d33cbb76d38c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_sscanf_test15 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test15 coreclrpal) - -target_link_libraries(paltest_sscanf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp index cf2a30de87b1..1cd69a4c7bdc 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test15_paltest_sscanf_test15, "c_runtime/sscanf_s/test15/paltest_sscanf_test15") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat deleted file mode 100644 index 1e7ac43310c7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests sscanf_s with floats (exponential notation, uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt deleted file mode 100644 index fc8d924d1695..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_sscanf_test16 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test16 coreclrpal) - -target_link_libraries(paltest_sscanf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp index 546d9fb6206f..ff603f82eee4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test16_paltest_sscanf_test16, "c_runtime/sscanf_s/test16/paltest_sscanf_test16") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat deleted file mode 100644 index 6cc77ce70511..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests sscanf_s with floats (compact notation, lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt deleted file mode 100644 index 8f8f02fd77b2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_sscanf_test17 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test17 coreclrpal) - -target_link_libraries(paltest_sscanf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp index 0205d4e4210f..a9a4bd99d259 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test17_paltest_sscanf_test17, "c_runtime/sscanf_s/test17/paltest_sscanf_test17") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat deleted file mode 100644 index 555e5e318430..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests sscanf_s with floats (compact notation, uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt deleted file mode 100644 index 26b23fd358cb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_sscanf_test2 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test2 coreclrpal) - -target_link_libraries(paltest_sscanf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp index 162521a83999..3579c4b83422 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp @@ -22,7 +22,7 @@ * feed), even if it says it only wants spaces tabs and newlines. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test2_paltest_sscanf_test2, "c_runtime/sscanf_s/test2/paltest_sscanf_test2") { if (PAL_Initialize(argc, argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat deleted file mode 100644 index d3442af41368..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to see if sscanf_s handles whitespace correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt deleted file mode 100644 index 030b000e9d97..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_sscanf_test3 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test3 coreclrpal) - -target_link_libraries(paltest_sscanf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp index 85e6d8d0cbee..eb3b34a10988 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test3_paltest_sscanf_test3, "c_runtime/sscanf_s/test3/paltest_sscanf_test3") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat deleted file mode 100644 index 0125372264cb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests sscanf_s with bracketed set strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt deleted file mode 100644 index a9fa199e48a4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_sscanf_test4 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test4 coreclrpal) - -target_link_libraries(paltest_sscanf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp index 9caa663f5fba..a6348c982bc2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp @@ -16,7 +16,7 @@ #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test4_paltest_sscanf_test4, "c_runtime/sscanf_s/test4/paltest_sscanf_test4") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat deleted file mode 100644 index 24436214cd32..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests sscanf_s with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt deleted file mode 100644 index 704116833651..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_sscanf_test5 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test5 coreclrpal) - -target_link_libraries(paltest_sscanf_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp index 35a4498f1578..4679714df8a3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test5_paltest_sscanf_test5, "c_runtime/sscanf_s/test5/paltest_sscanf_test5") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat deleted file mode 100644 index 54577ae93e3d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests sscanf_s with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt deleted file mode 100644 index 7c18d1375a9a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_sscanf_test6 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test6 coreclrpal) - -target_link_libraries(paltest_sscanf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp index d0a75282e449..56e0e778f0ec 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test6_paltest_sscanf_test6, "c_runtime/sscanf_s/test6/paltest_sscanf_test6") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat deleted file mode 100644 index 7e33d024408e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests sscanf_s with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt deleted file mode 100644 index d80c1386ced6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_sscanf_test7 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test7 coreclrpal) - -target_link_libraries(paltest_sscanf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp index 609a29613c03..5be10dcc50d4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test7_paltest_sscanf_test7, "c_runtime/sscanf_s/test7/paltest_sscanf_test7") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat deleted file mode 100644 index e2b55a7fd7a1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests sscanf_s with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt deleted file mode 100644 index d9759d9a43cd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_sscanf_test8 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test8 coreclrpal) - -target_link_libraries(paltest_sscanf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp index b447442a924c..c5c0b9122d91 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp @@ -15,7 +15,7 @@ #include #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test8_paltest_sscanf_test8, "c_runtime/sscanf_s/test8/paltest_sscanf_test8") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat deleted file mode 100644 index d68933dd5408..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests sscanf_s with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt deleted file mode 100644 index 37b4ad87d639..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_sscanf_test9 - ${SOURCES} -) - -add_dependencies(paltest_sscanf_test9 coreclrpal) - -target_link_libraries(paltest_sscanf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp index 0fcab98f0247..0c53cf84d3d9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp @@ -16,7 +16,7 @@ #include "../sscanf_s.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_sscanf_s_test9_paltest_sscanf_test9, "c_runtime/sscanf_s/test9/paltest_sscanf_test9") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat deleted file mode 100644 index 371cd5e31288..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section =C Runtime -Function = sscanf_s -Name = Positive Test for sscanf_s -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests sscanf_s with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/CMakeLists.txt deleted file mode 100644 index a08cb2b9054e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strcat_test1 - ${SOURCES} -) - -add_dependencies(paltest_strcat_test1 coreclrpal) - -target_link_libraries(paltest_strcat_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/test1.cpp index f5c00c5be447..7c8ec61fe9f6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/test1.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strcat_test1_paltest_strcat_test1, "c_runtime/strcat/test1/paltest_strcat_test1") { char dest[80]; char *test = "foo bar baz"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/testinfo.dat deleted file mode 100644 index 145816d7cb70..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcat/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strcat -Name = Test #1 for strcat -TYPE = DEFAULT -EXE1 = test1 -Description -= Concatenate three strings into one string. Each time, check to ensure -= the pointer returned was what we expected. When finished, compare the -= newly formed string to what it should be to ensure no characters were -= lost. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/CMakeLists.txt deleted file mode 100644 index a3e6cf8ed7c1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strchr_test1 - ${SOURCES} -) - -add_dependencies(paltest_strchr_test1 coreclrpal) - -target_link_libraries(paltest_strchr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/test1.cpp index 0d75dd81dfb1..44d0b6053c81 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/test1.cpp @@ -25,7 +25,7 @@ struct testCase -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strchr_test1_paltest_strchr_test1, "c_runtime/strchr/test1/paltest_strchr_test1") { int i = 0; char *result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/testinfo.dat deleted file mode 100644 index 8c5f6a1214b8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strchr/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strchr -Name = Test #1 for strchr -TYPE = DEFAULT -EXE1 = test1 -Description -= Test this on a character which is in a string, and ensure the pointer -= points to that character. Then check the string for the null character, -= which the return pointer should point to. Then search for a character not -= in the string and check that the return value is NULL. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/CMakeLists.txt deleted file mode 100644 index 74d260cc62b8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strcmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_strcmp_test1 coreclrpal) - -target_link_libraries(paltest_strcmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.cpp index 26e00d939cfe..dadbeb5cb5b3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.cpp @@ -21,24 +21,24 @@ typedef struct char string2[50]; } testCase; -testCase testCases[]= +PALTEST(c_runtime_strcmp_test1_paltest_strcmp_test1, "c_runtime/strcmp/test1/paltest_strcmp_test1") { - {0,"Hello","Hello"}, - {1,"hello","Hello"}, - {-1,"Hello","hello"}, - {0,"0Test","0Test"}, - {0,"***???","***???"}, - {0,"Testing the string for string comparison","Testing the string for " - "string comparison"}, - {-1,"Testing the string for string comparison","Testing the string for " - "string comparsioa"}, - {1,"Testing the string for string comparison","Testing the string for " - "comparison"}, - {-1,"aaaabbbbb","aabcdefeccg"} -}; + testCase testCases[]= + { + {0,"Hello","Hello"}, + {1,"hello","Hello"}, + {-1,"Hello","hello"}, + {0,"0Test","0Test"}, + {0,"***???","***???"}, + {0,"Testing the string for string comparison","Testing the string for " + "string comparison"}, + {-1,"Testing the string for string comparison","Testing the string for " + "string comparsioa"}, + {1,"Testing the string for string comparison","Testing the string for " + "comparison"}, + {-1,"aaaabbbbb","aabcdefeccg"} + }; -int __cdecl main(int argc, char *argv[]) -{ int i = 0; int result = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/testinfo.dat deleted file mode 100644 index ed6838e42050..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcmp/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strcmp -Name = Test #1 for strcmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Compare a number of different strings against each other, ensure that the -= three return values are given at the appropriate times. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/CMakeLists.txt deleted file mode 100644 index 3fc0bfcd4875..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strcpy_test1 - ${SOURCES} -) - -add_dependencies(paltest_strcpy_test1 coreclrpal) - -target_link_libraries(paltest_strcpy_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.cpp index af9f88b1edee..969c360ac0ff 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strcpy_test1_paltest_strcpy_test1, "c_runtime/strcpy/test1/paltest_strcpy_test1") { char dest[80]; char *result = "foo"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/testinfo.dat deleted file mode 100644 index 2327a8ca83e9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcpy/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strcpy -Name = Test #1 for strcpy -TYPE = DEFAULT -EXE1 = test1 -Description -= Call the function to copy into an empty buffer. Check that the return value -= is pointing at the destination buffer. Also compare the string copied to -= the origional string, to ensure they are the same. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/CMakeLists.txt deleted file mode 100644 index f2fe19a07306..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strcspn_test1 - ${SOURCES} -) - -add_dependencies(paltest_strcspn_test1 coreclrpal) - -target_link_libraries(paltest_strcspn_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.cpp index cd321f1e80e7..2c7f7e609c1e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.cpp @@ -22,7 +22,7 @@ struct testCase char *string2; }; -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strcspn_test1_paltest_strcspn_test1, "c_runtime/strcspn/test1/paltest_strcspn_test1") { int i=0; long TheResult = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/testinfo.dat deleted file mode 100644 index 54fbb7f34906..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strcspn/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strcspn -Name = Test #1 for strcspn -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests strcspn with a character set that should give an index into -=the middle of the original string. Also tests with character sets -=that are not in the string at all, and character sets that match -=with the very first character. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/CMakeLists.txt deleted file mode 100644 index 4ecbbd2d2014..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strlen_test1 - ${SOURCES} -) - -add_dependencies(paltest_strlen_test1 coreclrpal) - -target_link_libraries(paltest_strlen_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/test1.cpp index 9fea613f9560..b19b3fec3445 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/test1.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strlen_test1_paltest_strlen_test1, "c_runtime/strlen/test1/paltest_strlen_test1") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/testinfo.dat deleted file mode 100644 index b55bc8e8a5b8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strlen/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strlen -Name = Positive Test for strlen -TYPE = DEFAULT -EXE1 = test1 -Description -= Check the length of a string and the length of a 0 character string to -= see that this function returns the correct values for each. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/CMakeLists.txt deleted file mode 100644 index 7221b15ae0d7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strncat_test1 - ${SOURCES} -) - -add_dependencies(paltest_strncat_test1 coreclrpal) - -target_link_libraries(paltest_strncat_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/test1.cpp index 505db1e60880..240a78f9fef2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/test1.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strncat_test1_paltest_strncat_test1, "c_runtime/strncat/test1/paltest_strncat_test1") { char dest[80]; char *test = "foo barbaz"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/testinfo.dat deleted file mode 100644 index da8476d66496..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncat/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strncat -Name = Test #1 for strncat -TYPE = DEFAULT -EXE1 = test1 -Description -= Concatenate a few strings together, setting different lengths to be -= used for each one. Check to ensure the pointers which are returned are -= correct, and that the final string is what was expected. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/CMakeLists.txt deleted file mode 100644 index 3787d50cfb8c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strncmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_strncmp_test1 coreclrpal) - -target_link_libraries(paltest_strncmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.cpp index 66d947edff9f..c39498739f1d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.cpp @@ -23,29 +23,28 @@ typedef struct int number; } testCase; -testCase testCases[]= +PALTEST(c_runtime_strncmp_test1_paltest_strncmp_test1, "c_runtime/strncmp/test1/paltest_strncmp_test1") { - {0,"Hello","Hello",5}, - {1,"hello","Hello",3}, - {-1,"Hello","hello",5}, - {0,"heLLo","heLLo",5}, - {1,"hello","heLlo",5}, - {-1,"heLlo","hello",5}, - {0,"0Test","0Test",5}, - {0,"***???","***???",6}, - {0,"Testing the string for string comparison","Testing the string for " - "string comparison",40}, - {-1,"Testing the string for string comparison","Testing the string for " - "string comparsioa",40}, - {1,"Testing the string for string comparison","Testing the string for " - "comparison",34}, - {0,"aaaabbbbb","aabcdefeccg",2}, - {0,"abcd","abcd",10} -}; - + testCase testCases[]= + { + {0,"Hello","Hello",5}, + {1,"hello","Hello",3}, + {-1,"Hello","hello",5}, + {0,"heLLo","heLLo",5}, + {1,"hello","heLlo",5}, + {-1,"heLlo","hello",5}, + {0,"0Test","0Test",5}, + {0,"***???","***???",6}, + {0,"Testing the string for string comparison","Testing the string for " + "string comparison",40}, + {-1,"Testing the string for string comparison","Testing the string for " + "string comparsioa",40}, + {1,"Testing the string for string comparison","Testing the string for " + "comparison",34}, + {0,"aaaabbbbb","aabcdefeccg",2}, + {0,"abcd","abcd",10} + }; -int __cdecl main(int argc, char *argv[]) -{ int i=0; int iresult=0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/testinfo.dat deleted file mode 100644 index 0aabf93e4f81..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncmp/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strncmp -Name = Test #1 for strncmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Test to ensure all three possible return values are given under the -= appropriate circumstance. Also, uses different sizes, to only compare -= portions of strings, checking to make sure these return the correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/CMakeLists.txt deleted file mode 100644 index fac100451f0b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strncpy_test1 - ${SOURCES} -) - -add_dependencies(paltest_strncpy_test1 coreclrpal) - -target_link_libraries(paltest_strncpy_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.cpp index 96f8f9b3bfe2..b934d3cfb655 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strncpy_test1_paltest_strncpy_test1, "c_runtime/strncpy/test1/paltest_strncpy_test1") { char dest[80]; char *result = "foobar"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/testinfo.dat deleted file mode 100644 index eeb078773085..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strncpy/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strncpy -Name = Test #1 for strncpy -TYPE = DEFAULT -EXE1 = test1 -Description -= Test to see that you can copy a portion of a string into a new buffer. -= Also check that the strncpy function doesn't overflow when it is used. -= Finally check that if the number of characters given is greater than the -= amount to copy, that the destination buffer is padded with NULLs. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/CMakeLists.txt deleted file mode 100644 index 6748bea94727..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strpbrk_test1 - ${SOURCES} -) - -add_dependencies(paltest_strpbrk_test1 coreclrpal) - -target_link_libraries(paltest_strpbrk_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.cpp index 88bb3da1e13c..b2b90edea7e9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.cpp @@ -22,7 +22,7 @@ struct testCase char *string2; }; -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strpbrk_test1_paltest_strpbrk_test1, "c_runtime/strpbrk/test1/paltest_strpbrk_test1") { char *ptr = NULL; int i = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/testinfo.dat deleted file mode 100644 index 291f23458d18..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strpbrk/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strpbrk -Name = Test #1 for strpbrk -TYPE = DEFAULT -EXE1 = test1 -Description -= Search a string for characters in a given character set and ensure the -= pointer returned points to the first occurrence. Check to see that the -= function returns NULL if the character is not found. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/CMakeLists.txt deleted file mode 100644 index 25e8916030b5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strrchr_test1 - ${SOURCES} -) - -add_dependencies(paltest_strrchr_test1 coreclrpal) - -target_link_libraries(paltest_strrchr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.cpp index b7014848d9f0..85e53eb2a863 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.cpp @@ -18,7 +18,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strrchr_test1_paltest_strrchr_test1, "c_runtime/strrchr/test1/paltest_strrchr_test1") { char *str = "foo bar baz"; char *ptr; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/testinfo.dat deleted file mode 100644 index 8c35087963b1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strrchr/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strrchr -Name = Test #1 for strrchr -TYPE = DEFAULT -EXE1 = test1 -Description -= Search a string for a given character. Search for a character contained -= in the string, and ensure the pointer returned points to it. Then search -= for the null character, and ensure the pointer points to that. Finally -= search for a character which is not in the string and ensure that it -= returns NULL. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/CMakeLists.txt deleted file mode 100644 index e984a6e578f5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strspn_test1 - ${SOURCES} -) - -add_dependencies(paltest_strspn_test1 coreclrpal) - -target_link_libraries(paltest_strspn_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/test1.cpp index cc841696284b..64bac75258e9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/test1.cpp @@ -23,7 +23,7 @@ struct testCase char *string2; }; -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strspn_test1_paltest_strspn_test1, "c_runtime/strspn/test1/paltest_strspn_test1") { int i=0; long TheResult = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/testinfo.dat deleted file mode 100644 index a5c178867111..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strspn/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strspn -Name = Test #1 for strspn -TYPE = DEFAULT -EXE1 = test1 -Description -= Check a character set against a string to see that the function returns -= the length of the substring which consists of all characters in the string. -= Also check that if the character set doesn't match the string at all, that -= the value is 0. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/CMakeLists.txt deleted file mode 100644 index 4efe7105b4e2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strstr_test1 - ${SOURCES} -) - -add_dependencies(paltest_strstr_test1 coreclrpal) - -target_link_libraries(paltest_strstr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/test1.cpp index cfd71ac57fb5..e50d5bda12b8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/test1.cpp @@ -28,7 +28,7 @@ struct testCase }; -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strstr_test1_paltest_strstr_test1, "c_runtime/strstr/test1/paltest_strstr_test1") { int i=0; char *ptr=NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/testinfo.dat deleted file mode 100644 index 45bdf71da1fa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strstr/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strstr -Name = Positive Test for strstr -TYPE = DEFAULT -EXE1 = test1 -Description -= Check three cases of searching for a string within a string. First when -= the string is contained, check that the pointer returned points to it. -= Then when it isn't contained, ensure it returns null. And when the string -= we're searching for is empty, it should return a pointer to the string -= we're searching through. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/CMakeLists.txt deleted file mode 100644 index 8914dd1e17d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strtod_test1 - ${SOURCES} -) - -add_dependencies(paltest_strtod_test1 coreclrpal) - -target_link_libraries(paltest_strtod_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/test1.cpp index e4d7d66623f4..d5b6d0a66f6f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/test1.cpp @@ -23,7 +23,7 @@ struct testCase }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_strtod_test1_paltest_strtod_test1, "c_runtime/strtod/test1/paltest_strtod_test1") { char * endptr; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/testinfo.dat deleted file mode 100644 index a5141e07a347..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strtod -Name = Positive Test for strtod -TYPE = DEFAULT -EXE1 = test1 -Description -= Purpose: Tests the PAL implementation of the strtod function. -= Convert a number of strings to doubles. Ensure they convert correctly. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/CMakeLists.txt deleted file mode 100644 index aabfd1829311..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_strtod_test2 - ${SOURCES} -) - -add_dependencies(paltest_strtod_test2 coreclrpal) - -target_link_libraries(paltest_strtod_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/test2.cpp index 71915dbbd5c2..038bbe07a1a1 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/test2.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_strtod_test2_paltest_strtod_test2, "c_runtime/strtod/test2/paltest_strtod_test2") { /* Representation of positive infinty for a IEEE 64-bit double */ INT64 PosInifity = (INT64)(0x7ff00000) << 32; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/testinfo.dat deleted file mode 100644 index 892df776dfc7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtod/test2/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strtod -Name = Negative test for strtod with overflows -TYPE = DEFAULT -EXE1 = test2 -Description -= Test strtod with overflows. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/CMakeLists.txt deleted file mode 100644 index 322203c4827f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strtok_test1 - ${SOURCES} -) - -add_dependencies(paltest_strtok_test1 coreclrpal) - -target_link_libraries(paltest_strtok_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/test1.cpp index de157a531db1..b14222931ad3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/test1.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_strtok_test1_paltest_strtok_test1, "c_runtime/strtok/test1/paltest_strtok_test1") { char str[] = "foo bar baz"; char *result1= "foo \0ar baz"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/testinfo.dat deleted file mode 100644 index 78c82d75a07f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtok/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strtok -Name = Test #1 for strtok -TYPE = DEFAULT -EXE1 = test1 -Description -= Search for a number of tokens within strings. Check that the return values -= are what is expect, and also that the strings match up with our expected -= results. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/CMakeLists.txt deleted file mode 100644 index 4d58d74b1408..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_strtoul_test1 - ${SOURCES} -) - -add_dependencies(paltest_strtoul_test1 coreclrpal) - -target_link_libraries(paltest_strtoul_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.cpp index 4db4401a5ec8..c18b550d1e14 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.cpp @@ -27,20 +27,19 @@ typedef struct ULONG result; } TestCase; -TestCase TestCases[] = +PALTEST(c_runtime_strtoul_test1_paltest_strtoul_test1, "c_runtime/strtoul/test1/paltest_strtoul_test1") { - { teststr1, teststr1 + 3, 4, 27}, - { teststr1, teststr1 + 5, 10, 12345}, - { teststr2, teststr2, 10, 0}, - { teststr3, teststr3+10, 10, 4294967295ul}, - { teststr4, teststr4+10, 10, 4294967295ul} -}; - -int NumCases = sizeof(TestCases) / sizeof(TestCases[0]); + TestCase TestCases[] = + { + { teststr1, teststr1 + 3, 4, 27}, + { teststr1, teststr1 + 5, 10, 12345}, + { teststr2, teststr2, 10, 0}, + { teststr3, teststr3+10, 10, 4294967295ul}, + { teststr4, teststr4+10, 10, 4294967295ul} + }; + int NumCases = sizeof(TestCases) / sizeof(TestCases[0]); -int __cdecl main(int argc, char *argv[]) -{ char *end; ULONG l; int i; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/testinfo.dat deleted file mode 100644 index df7165719dbd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/strtoul/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = strtoul -Name = Test #1 for strtoul -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests stroul with different bases and overflows, as well as valid input. -= Makes sure that the end pointer is correct. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/CMakeLists.txt deleted file mode 100644 index b29c7c438bd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h index 74ab02977aee..5ca39606e8b2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h @@ -13,7 +13,7 @@ #ifndef __SWPRINTF_H__ #define __SWPRINTF_H__ -void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) +inline void DoWStrTest_swprintf_s(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -27,8 +27,9 @@ void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoWStrTest DoWStrTest_swprintf_s -void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) +inline void DoStrTest_swprintf_s(const WCHAR *formatstr, char *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -42,8 +43,9 @@ void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) convertC(buf)); } } +#define DoStrTest DoStrTest_swprintf_s -void DoPointerTest(const WCHAR *formatstr, void* param, const WCHAR *checkstr1) +inline void DoPointerTest_swprintf_s(const WCHAR *formatstr, void* param, const WCHAR *checkstr1) { WCHAR buf[256] = { 0 }; @@ -55,8 +57,9 @@ void DoPointerTest(const WCHAR *formatstr, void* param, const WCHAR *checkstr1) convertC(formatstr), convertC(checkstr1), convertC(buf)); } } +#define DoPointerTest DoPointerTest_swprintf_s -void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) +inline void DoCharTest_swprintf_s(const WCHAR *formatstr, char param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -68,8 +71,9 @@ void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) convertC(formatstr), convertC(checkstr), convertC(buf)); } } +#define DoCharTest DoCharTest_swprintf_s -void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) +inline void DoWCharTest_swprintf_s(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -81,8 +85,9 @@ void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) convertC(formatstr), convertC(checkstr), convertC(buf)); } } +#define DoWCharTest DoWCharTest_swprintf_s -void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) +inline void DoNumTest_swprintf_s(const WCHAR *formatstr, int value, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -94,8 +99,9 @@ void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoNumTest DoNumTest_swprintf_s -void DoI64Test(const WCHAR *formatstr, INT64 param, char *paramdesc, +inline void DoI64Test_swprintf_s(const WCHAR *formatstr, INT64 param, char *paramdesc, const WCHAR *checkstr1) { WCHAR buf[256] = { 0 }; @@ -108,8 +114,9 @@ void DoI64Test(const WCHAR *formatstr, INT64 param, char *paramdesc, convertC(formatstr), convertC(checkstr1), convertC(buf)); } } +#define DoI64Test DoI64Test_swprintf_s -void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1, +inline void DoDoubleTest_swprintf_s(const WCHAR *formatstr, double value, const WCHAR *checkstr1, const WCHAR *checkstr2) { WCHAR buf[256] = { 0 }; @@ -124,8 +131,9 @@ void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1, convertC(checkstr2), convertC(buf)); } } +#define DoDoubleTest DoDoubleTest_swprintf_s -void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_swprintf_s(const WCHAR *formatstr, int precision, void *param, char *paramstr, const WCHAR *checkstr1, const WCHAR *checkstr2) { WCHAR buf[256]; @@ -140,8 +148,9 @@ void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, convertC(checkstr1), convertC(checkstr2), convertC(buf)); } } +#define DoArgumentPrecTest DoArgumentPrecTest_swprintf_s -void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_swprintf_s(const WCHAR *formatstr, int precision, double param, const WCHAR *checkstr1, const WCHAR *checkstr2) { WCHAR buf[256]; @@ -156,6 +165,7 @@ void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double para convertC(checkstr1), convertC(checkstr2), convertC(buf)); } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_swprintf_s #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt deleted file mode 100644 index 6427bdbd989b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_swprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test1 coreclrpal) - -target_link_libraries(paltest_swprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp index 7353646b31b8..62ec881dfca3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test1_paltest_swprintf_test1, "c_runtime/swprintf/test1/paltest_swprintf_test1") { WCHAR *checkstr; WCHAR buf[256]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/testinfo.dat deleted file mode 100644 index e80446528413..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= General test to see if swprintf works correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt deleted file mode 100644 index 23190da6ce14..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_swprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test10 coreclrpal) - -target_link_libraries(paltest_swprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.cpp index aaf472c0e908..0231e7b6e9b3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test10_paltest_swprintf_test10, "c_runtime/swprintf/test10/paltest_swprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/testinfo.dat deleted file mode 100644 index 7f8ec90c67b5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests swprintf with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt deleted file mode 100644 index f18db3311981..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_swprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test11 coreclrpal) - -target_link_libraries(paltest_swprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.cpp index 63592c542bf8..10b442fc39a2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test11_paltest_swprintf_test11, "c_runtime/swprintf/test11/paltest_swprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/testinfo.dat deleted file mode 100644 index 54b90d78845c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests swprintf with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt deleted file mode 100644 index 23d4177c998d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_swprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test12 coreclrpal) - -target_link_libraries(paltest_swprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.cpp index d3789b5f7065..4c755c7f808e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test12_paltest_swprintf_test12, "c_runtime/swprintf/test12/paltest_swprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/testinfo.dat deleted file mode 100644 index 91439b8928c1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests swprintf with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt deleted file mode 100644 index 828270fd98df..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_swprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test13 coreclrpal) - -target_link_libraries(paltest_swprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.cpp index d404eb95d2b7..7cd455f8cac4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test13_paltest_swprintf_test13, "c_runtime/swprintf/test13/paltest_swprintf_test13") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/testinfo.dat deleted file mode 100644 index d22b3a6175e3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests swprintf with hex numbers (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt deleted file mode 100644 index a3caec6c10cd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_swprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test14 coreclrpal) - -target_link_libraries(paltest_swprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.cpp index f17e42e0cc02..22fd903faa3b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test14_paltest_swprintf_test14, "c_runtime/swprintf/test14/paltest_swprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/testinfo.dat deleted file mode 100644 index 9b069ec89943..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests swprintf with exponential format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt deleted file mode 100644 index 62cdc8daeb9f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_swprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test15 coreclrpal) - -target_link_libraries(paltest_swprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.cpp index 2aab51237fa3..0aa939d70a68 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test15_paltest_swprintf_test15, "c_runtime/swprintf/test15/paltest_swprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/testinfo.dat deleted file mode 100644 index 3f917fc4054a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests swprintf with exponential format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt deleted file mode 100644 index 19773af43813..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_swprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test16 coreclrpal) - -target_link_libraries(paltest_swprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.cpp index a97e51669567..2edce8b2b518 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test16_paltest_swprintf_test16, "c_runtime/swprintf/test16/paltest_swprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/testinfo.dat deleted file mode 100644 index 0047513d65ed..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests swprintf with decimal point format doubles diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt deleted file mode 100644 index 745cebcc15de..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_swprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test17 coreclrpal) - -target_link_libraries(paltest_swprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.cpp index b6c0aef6e51e..5fc26e57ff21 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test17_paltest_swprintf_test17, "c_runtime/swprintf/test17/paltest_swprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/testinfo.dat deleted file mode 100644 index ba8b0542bec8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests swprintf with compact format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt deleted file mode 100644 index d2257435b64e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_swprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test18 coreclrpal) - -target_link_libraries(paltest_swprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.cpp index fd51bb0a4a6d..717ca688b829 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test18_paltest_swprintf_test18, "c_runtime/swprintf/test18/paltest_swprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/testinfo.dat deleted file mode 100644 index 5aa2c3436f7b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test18/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests swprintf with compact format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt deleted file mode 100644 index 0e125d705277..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_swprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test19 coreclrpal) - -target_link_libraries(paltest_swprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp index 936a4ef6f8e8..43a38d747746 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test19_paltest_swprintf_test19, "c_runtime/swprintf/test19/paltest_swprintf_test19") { int n = -1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/testinfo.dat deleted file mode 100644 index 83c17566a57c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test19/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests swprintf with argument specified precision diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt deleted file mode 100644 index cd04e49dc6dd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_swprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test2 coreclrpal) - -target_link_libraries(paltest_swprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp index e2721b0a177f..e6eee392eb4c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test2_paltest_swprintf_test2, "c_runtime/swprintf/test2/paltest_swprintf_test2") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/testinfo.dat deleted file mode 100644 index cf9413bb2bde..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests swprintf with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt deleted file mode 100644 index 47ee916d275f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_swprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test3 coreclrpal) - -target_link_libraries(paltest_swprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp index fd8a82af34de..16b37c8da33d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test3_paltest_swprintf_test3, "c_runtime/swprintf/test3/paltest_swprintf_test3") { if (PAL_Initialize(argc, argv) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/testinfo.dat deleted file mode 100644 index d8b74f0a0834..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests swprintf with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt deleted file mode 100644 index d33c2d22d7ef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_swprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test4 coreclrpal) - -target_link_libraries(paltest_swprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp index c461fab0ab2a..ce5a2b24939c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test4_paltest_swprintf_test4, "c_runtime/swprintf/test4/paltest_swprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/testinfo.dat deleted file mode 100644 index 68d4d11fb2d4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests swprintf with pointers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt deleted file mode 100644 index 2ff88fced247..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_swprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test6 coreclrpal) - -target_link_libraries(paltest_swprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp index 9fe4f14af509..2e2465c942f7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test6_paltest_swprintf_test6, "c_runtime/swprintf/test6/paltest_swprintf_test6") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/testinfo.dat deleted file mode 100644 index 4b30cd1c61a5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests swprintf with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt deleted file mode 100644 index 28454845eb16..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_swprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test7 coreclrpal) - -target_link_libraries(paltest_swprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.cpp index f547877e464f..ff9133197c68 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.cpp @@ -20,7 +20,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test7_paltest_swprintf_test7, "c_runtime/swprintf/test7/paltest_swprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/testinfo.dat deleted file mode 100644 index ab8f20d1628e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests swprintf with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt deleted file mode 100644 index 72c922ca0e63..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_swprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test8 coreclrpal) - -target_link_libraries(paltest_swprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.cpp index e861c92cb4fe..2ad8b05de662 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test8_paltest_swprintf_test8, "c_runtime/swprintf/test8/paltest_swprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/testinfo.dat deleted file mode 100644 index 1626ffd89591..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests swprintf with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt deleted file mode 100644 index 7236065bd0e2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_swprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_swprintf_test9 coreclrpal) - -target_link_libraries(paltest_swprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.cpp index e49e788df043..970f3d70269d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.cpp @@ -19,7 +19,7 @@ * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swprintf_test9_paltest_swprintf_test9, "c_runtime/swprintf/test9/paltest_swprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/testinfo.dat deleted file mode 100644 index 2c3207e0f33c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swprintf/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swprintf -Name = Positive Test for swprintf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests swprintf with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/CMakeLists.txt deleted file mode 100644 index 56b4848b303a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h index 20c99092e1a3..a5b0228bc01f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h @@ -13,7 +13,7 @@ #ifndef __SWSCANF_H__ #define __SWSCANF_H__ -void DoVoidTest(WCHAR *inputstr, const WCHAR *formatstr) +inline void DoVoidTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr) { char buf[256] = { 0 }; int i; @@ -38,8 +38,9 @@ void DoVoidTest(WCHAR *inputstr, const WCHAR *formatstr) } } +#define DoVoidTest DoVoidTest_swscanf -void DoStrTest(WCHAR *inputstr, const WCHAR *formatstr, const char *checkstr) +inline void DoStrTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, const char *checkstr) { char buf[256] = { 0 }; int ret; @@ -61,8 +62,9 @@ void DoStrTest(WCHAR *inputstr, const WCHAR *formatstr, const char *checkstr) } } +#define DoStrTest DoStrTest_swscanf -void DoWStrTest(WCHAR *inputstr, const WCHAR *formatstr, const WCHAR *checkstr) +inline void DoWStrTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; int ret; @@ -84,8 +86,9 @@ void DoWStrTest(WCHAR *inputstr, const WCHAR *formatstr, const WCHAR *checkstr) } } +#define DoWStrTest DoWStrTest_swscanf -void DoNumTest(WCHAR *inputstr, const WCHAR *formatstr, int checknum) +inline void DoNumTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, int checknum) { int num = 0; int ret; @@ -105,8 +108,9 @@ void DoNumTest(WCHAR *inputstr, const WCHAR *formatstr, int checknum) convertC(formatstr), checknum, num); } } +#define DoNumTest DoNumTest_swscanf -void DoShortNumTest(WCHAR *inputstr, const WCHAR *formatstr, short checknum) +inline void DoShortNumTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, short checknum) { short num = 0; int ret; @@ -126,8 +130,9 @@ void DoShortNumTest(WCHAR *inputstr, const WCHAR *formatstr, short checknum) convertC(formatstr), checknum, num); } } +#define DoShortNumTest DoShortNumTest_swscanf -void DoI64NumTest(WCHAR *inputstr, const WCHAR *formatstr, INT64 checknum) +inline void DoI64NumTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, INT64 checknum) { char buf[256]; char check[256]; @@ -151,8 +156,9 @@ void DoI64NumTest(WCHAR *inputstr, const WCHAR *formatstr, INT64 checknum) convertC(formatstr), check, buf); } } +#define DoI64NumTest DoI64NumTest_swscanf -void DoCharTest(WCHAR *inputstr, const WCHAR *formatstr, char* checkchars, int numchars) +inline void DoCharTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, char* checkchars, int numchars) { char buf[256]; int ret; @@ -185,8 +191,9 @@ void DoCharTest(WCHAR *inputstr, const WCHAR *formatstr, char* checkchars, int n convertC(inputstr), convertC(formatstr), numchars); } } +#define DoCharTest DoCharTest_swscanf -void DoWCharTest(WCHAR *inputstr, const WCHAR *formatstr, const WCHAR *checkchars, int numchars) +inline void DoWCharTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, const WCHAR *checkchars, int numchars) { WCHAR buf[256]; int ret; @@ -220,9 +227,9 @@ void DoWCharTest(WCHAR *inputstr, const WCHAR *formatstr, const WCHAR *checkchar convertC(inputstr), convertC(formatstr), numchars); } } +#define DoWCharTest DoWCharTest_swscanf - -void DoFloatTest(WCHAR *inputstr, const WCHAR *formatstr, float checkval) +inline void DoFloatTest_swscanf(WCHAR *inputstr, const WCHAR *formatstr, float checkval) { char buf[256] = { 0 }; float val; @@ -256,6 +263,6 @@ void DoFloatTest(WCHAR *inputstr, const WCHAR *formatstr, float checkval) } } - +#define DoFloatTest DoFloatTest_swscanf #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/CMakeLists.txt deleted file mode 100644 index ce24b1ea3fda..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_swscanf_test1 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test1 coreclrpal) - -target_link_libraries(paltest_swscanf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.cpp index 790284a01741..257706ae4cd3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.cpp @@ -16,7 +16,7 @@ #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test1_paltest_swscanf_test1, "c_runtime/swscanf/test1/paltest_swscanf_test1") { int num; int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/testinfo.dat deleted file mode 100644 index 607f2641d620..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test1 -Description -= General test of swscanf diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/CMakeLists.txt deleted file mode 100644 index f250da5a9c4e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_swscanf_test10 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test10 coreclrpal) - -target_link_libraries(paltest_swscanf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.cpp index 0c7c6cbd755c..0e9422950bd7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.cpp @@ -15,7 +15,7 @@ #include #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test10_paltest_swscanf_test10, "c_runtime/swscanf/test10/paltest_swscanf_test10") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/testinfo.dat deleted file mode 100644 index 45ed1aea593b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests swscanf with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/CMakeLists.txt deleted file mode 100644 index c5fed9e9e8f0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_swscanf_test11 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test11 coreclrpal) - -target_link_libraries(paltest_swscanf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.cpp index a5044d82c436..e24ca297f493 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.cpp @@ -15,7 +15,7 @@ #include #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test11_paltest_swscanf_test11, "c_runtime/swscanf/test11/paltest_swscanf_test11") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/testinfo.dat deleted file mode 100644 index 03ac4b1eab33..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests swscanf with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/CMakeLists.txt deleted file mode 100644 index 33e2949f70aa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_swscanf_test12 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test12 coreclrpal) - -target_link_libraries(paltest_swscanf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.cpp index 2ab7d910409a..857c1386f9ff 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.cpp @@ -15,7 +15,7 @@ #include #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test12_paltest_swscanf_test12, "c_runtime/swscanf/test12/paltest_swscanf_test12") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/testinfo.dat deleted file mode 100644 index a5ce40ced2cb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests swscanf with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/CMakeLists.txt deleted file mode 100644 index 5dc8b64984f1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_swscanf_test13 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test13 coreclrpal) - -target_link_libraries(paltest_swscanf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.cpp index 2c89bcaaf402..1e4d6021eb77 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.cpp @@ -15,7 +15,7 @@ #include #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test13_paltest_swscanf_test13, "c_runtime/swscanf/test13/paltest_swscanf_test13") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/testinfo.dat deleted file mode 100644 index 92c9888305f9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests swscanf with floats (decimal notation) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/CMakeLists.txt deleted file mode 100644 index ca377515ecec..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_swscanf_test14 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test14 coreclrpal) - -target_link_libraries(paltest_swscanf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.cpp index a21976c0937e..a8cfc9040177 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.cpp @@ -16,7 +16,7 @@ #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test14_paltest_swscanf_test14, "c_runtime/swscanf/test14/paltest_swscanf_test14") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/testinfo.dat deleted file mode 100644 index 0a95899ad8b8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests swscanf with floats (exponential notation, lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/CMakeLists.txt deleted file mode 100644 index 4b56b9a76add..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_swscanf_test15 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test15 coreclrpal) - -target_link_libraries(paltest_swscanf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.cpp index ef50e91905ff..73a4e536ca41 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.cpp @@ -15,7 +15,7 @@ #include #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test15_paltest_swscanf_test15, "c_runtime/swscanf/test15/paltest_swscanf_test15") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/testinfo.dat deleted file mode 100644 index b022abba5684..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests swscanf with floats (exponential notation, uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/CMakeLists.txt deleted file mode 100644 index 6004b38e67c1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_swscanf_test16 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test16 coreclrpal) - -target_link_libraries(paltest_swscanf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.cpp index 1a21fa915387..aff2ce3e0e50 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.cpp @@ -15,7 +15,7 @@ #include #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test16_paltest_swscanf_test16, "c_runtime/swscanf/test16/paltest_swscanf_test16") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/testinfo.dat deleted file mode 100644 index 186db5ba433b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests swscanf with floats (compact notation, lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt deleted file mode 100644 index 70226c27485d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_swscanf_test17 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test17 coreclrpal) - -target_link_libraries(paltest_swscanf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.cpp index ffa8b9e2dded..e50bf8a924f5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.cpp @@ -15,7 +15,7 @@ #include #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test17_paltest_swscanf_test17, "c_runtime/swscanf/test17/paltest_swscanf_test17") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/testinfo.dat deleted file mode 100644 index 6b393940febb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests swscanf with floats (compact notation, uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/CMakeLists.txt deleted file mode 100644 index 42c2d6ce2750..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_swscanf_test2 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test2 coreclrpal) - -target_link_libraries(paltest_swscanf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.cpp index 3263341f7158..2661d0205da0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.cpp @@ -21,7 +21,7 @@ * feed), even if it says it only wants spaces tabs and newlines. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test2_paltest_swscanf_test2, "c_runtime/swscanf/test2/paltest_swscanf_test2") { if (PAL_Initialize(argc, argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/testinfo.dat deleted file mode 100644 index 188db3736802..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to see if swscanf handles whitespace correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/CMakeLists.txt deleted file mode 100644 index 3777c35d0a12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_swscanf_test3 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test3 coreclrpal) - -target_link_libraries(paltest_swscanf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.cpp index 0413f150276a..f1fc330fc2ec 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.cpp @@ -16,7 +16,7 @@ #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test3_paltest_swscanf_test3, "c_runtime/swscanf/test3/paltest_swscanf_test3") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/testinfo.dat deleted file mode 100644 index c84dda67d8d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests swscanf with bracketed set strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/CMakeLists.txt deleted file mode 100644 index e17b9beb3429..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_swscanf_test4 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test4 coreclrpal) - -target_link_libraries(paltest_swscanf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.cpp index 11f86c4f6216..be65035d4b7e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.cpp @@ -16,7 +16,7 @@ #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test4_paltest_swscanf_test4, "c_runtime/swscanf/test4/paltest_swscanf_test4") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/testinfo.dat deleted file mode 100644 index 84639a1c25c3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests swscanf with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/CMakeLists.txt deleted file mode 100644 index 736ce1135cc2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_swscanf_test5 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test5 coreclrpal) - -target_link_libraries(paltest_swscanf_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.cpp index 8b8be9a318a7..396c862fef12 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.cpp @@ -16,7 +16,7 @@ #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test5_paltest_swscanf_test5, "c_runtime/swscanf/test5/paltest_swscanf_test5") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/testinfo.dat deleted file mode 100644 index ffe131d17889..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test5/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests swscanf with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/CMakeLists.txt deleted file mode 100644 index 48c2750676b9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_swscanf_test6 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test6 coreclrpal) - -target_link_libraries(paltest_swscanf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.cpp index d1a2540ca8a2..8cf2063f0178 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.cpp @@ -16,7 +16,7 @@ #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test6_paltest_swscanf_test6, "c_runtime/swscanf/test6/paltest_swscanf_test6") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/testinfo.dat deleted file mode 100644 index d4969b1ba081..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests swscanf with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/CMakeLists.txt deleted file mode 100644 index 4453e248993d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_swscanf_test7 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test7 coreclrpal) - -target_link_libraries(paltest_swscanf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.cpp index 954c1820b02d..404eeecf13ca 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.cpp @@ -16,7 +16,7 @@ #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test7_paltest_swscanf_test7, "c_runtime/swscanf/test7/paltest_swscanf_test7") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/testinfo.dat deleted file mode 100644 index fa3d1fc1145e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests swscanf with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/CMakeLists.txt deleted file mode 100644 index 8d4e51b77ef7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_swscanf_test8 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test8 coreclrpal) - -target_link_libraries(paltest_swscanf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.cpp index 9f02ac9efb32..9c54283c09f9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.cpp @@ -16,7 +16,7 @@ #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test8_paltest_swscanf_test8, "c_runtime/swscanf/test8/paltest_swscanf_test8") { int n65535 = 65535; /* Walkaround compiler strictness */ diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/testinfo.dat deleted file mode 100644 index 2363091e712c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests swscanf with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/CMakeLists.txt deleted file mode 100644 index 4b5e4c5fcb21..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_swscanf_test9 - ${SOURCES} -) - -add_dependencies(paltest_swscanf_test9 coreclrpal) - -target_link_libraries(paltest_swscanf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.cpp index 0d7cd508816f..c6cab41fe267 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.cpp @@ -15,7 +15,7 @@ #include #include "../swscanf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_swscanf_test9_paltest_swscanf_test9, "c_runtime/swscanf/test9/paltest_swscanf_test9") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/testinfo.dat deleted file mode 100644 index 9e3006447a5a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/swscanf/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = swscanf -Name = Positive Test for swscanf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests swscanf with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/CMakeLists.txt deleted file mode 100644 index c7bffa5dda5e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_tan_test1 - ${SOURCES} -) - -add_dependencies(paltest_tan_test1 coreclrpal) - -target_link_libraries(paltest_tan_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/test1.cpp index 4724f0567c8c..11f9123354ea 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * tan_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl tan_test1_validate(double value, double expected, double variance) { double result = tan(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * tan_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl tan_test1_validate_isnan(double value) { double result = tan(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_tan_test1_paltest_tan_test1, "c_runtime/tan/test1/paltest_tan_test1") { struct test tests[] = { @@ -117,19 +117,19 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + tan_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + tan_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } // -- SPECIAL CASE -- // Normally, tan(pi / 2) would return PAL_POSINF (atan2(PAL_POSINF) does return (pi / 2)). // However, it seems instead (on all supported systems), we get a different number entirely. - validate( 1.5707963267948966, 16331239353195370.0, 0); - validate(-1.5707963267948966, -16331239353195370.0, 0); + tan_test1_validate( 1.5707963267948966, 16331239353195370.0, 0); + tan_test1_validate(-1.5707963267948966, -16331239353195370.0, 0); - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); + tan_test1_validate_isnan(PAL_NEGINF); + tan_test1_validate_isnan(PAL_NAN); + tan_test1_validate_isnan(PAL_POSINF); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/testinfo.dat deleted file mode 100644 index 61ce69e24f3d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tan/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = tan -Name = Positive Test for tan -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to tan() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/CMakeLists.txt deleted file mode 100644 index e6a4ee55af14..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_tanf_test1 - ${SOURCES} -) - -add_dependencies(paltest_tanf_test1 coreclrpal) - -target_link_libraries(paltest_tanf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.c deleted file mode 100644 index 7fb8b859e82a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.c +++ /dev/null @@ -1,135 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that tanf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = tanf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("tanf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = tanf(value); - - if (!_isnanf(result)) - { - Fail("tanf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 0, PAL_EPSILON }, - { 0.318309886f, 0.329514733f, PAL_EPSILON }, // value: 1 / pi - { 0.434294482f, 0.463829067f, PAL_EPSILON }, // value: log10f(e) - { 0.636619772f, 0.739302950f, PAL_EPSILON }, // value: 2 / pi - { 0.693147181f, 0.830640878f, PAL_EPSILON }, // value: ln(2) - { 0.707106781f, 0.854510432f, PAL_EPSILON }, // value: 1 / sqrtf(2) - { 0.785398163f, 1, PAL_EPSILON * 10 }, // value: pi / 4 - { 1, 1.55740772f, PAL_EPSILON * 10 }, - { 1.12837917f, 2.11087684f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) - { 1.41421356f, 6.33411917f, PAL_EPSILON * 10 }, // value: sqrtf(2) - { 1.44269504f, 7.76357567f, PAL_EPSILON * 10 }, // value: logf2(e) - // SEE BELOW -- { 1.57079633f, PAL_POSINF, 0 }, // value: pi / 2 - { 2.30258509f, -1.11340715f, PAL_EPSILON * 10 }, // value: ln(10) - { 2.71828183f, -0.450549534f, PAL_EPSILON }, // value: e - { 3.14159265f, 0, PAL_EPSILON }, // value: pi - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - // -- SPECIAL CASE -- - // Normally, tanf(pi / 2) would return PAL_POSINF (atan2f(PAL_POSINF) does return (pi / 2)). - // However, it seems instead (on all supported systems), we get a different number entirely. - validate( 1.57079633f, -22877332.0, PAL_EPSILON * 100000000); - validate(-1.57079633f, 22877332.0, PAL_EPSILON * 100000000); - - validate_isnan(PAL_NEGINF); - validate_isnan(PAL_NAN); - validate_isnan(PAL_POSINF); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.cpp new file mode 100644 index 000000000000..2f7358cc2774 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.cpp @@ -0,0 +1,135 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that tanf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * tanf_test1_validate + * + * test validation function + */ +void __cdecl tanf_test1_validate(float value, float expected, float variance) +{ + float result = tanf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("tanf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * tanf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl tanf_test1_validate_isnan(float value) +{ + float result = tanf(value); + + if (!_isnanf(result)) + { + Fail("tanf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_tanf_test1_paltest_tanf_test1, "c_runtime/tanf/test1/paltest_tanf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 0, PAL_EPSILON }, + { 0.318309886f, 0.329514733f, PAL_EPSILON }, // value: 1 / pi + { 0.434294482f, 0.463829067f, PAL_EPSILON }, // value: log10f(e) + { 0.636619772f, 0.739302950f, PAL_EPSILON }, // value: 2 / pi + { 0.693147181f, 0.830640878f, PAL_EPSILON }, // value: ln(2) + { 0.707106781f, 0.854510432f, PAL_EPSILON }, // value: 1 / sqrtf(2) + { 0.785398163f, 1, PAL_EPSILON * 10 }, // value: pi / 4 + { 1, 1.55740772f, PAL_EPSILON * 10 }, + { 1.12837917f, 2.11087684f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi) + { 1.41421356f, 6.33411917f, PAL_EPSILON * 10 }, // value: sqrtf(2) + { 1.44269504f, 7.76357567f, PAL_EPSILON * 10 }, // value: logf2(e) + // SEE BELOW -- { 1.57079633f, PAL_POSINF, 0 }, // value: pi / 2 + { 2.30258509f, -1.11340715f, PAL_EPSILON * 10 }, // value: ln(10) + { 2.71828183f, -0.450549534f, PAL_EPSILON }, // value: e + { 3.14159265f, 0, PAL_EPSILON }, // value: pi + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + tanf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + tanf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + // -- SPECIAL CASE -- + // Normally, tanf(pi / 2) would return PAL_POSINF (atan2f(PAL_POSINF) does return (pi / 2)). + // However, it seems instead (on all supported systems), we get a different number entirely. + tanf_test1_validate( 1.57079633f, -22877332.0, PAL_EPSILON * 100000000); + tanf_test1_validate(-1.57079633f, 22877332.0, PAL_EPSILON * 100000000); + + tanf_test1_validate_isnan(PAL_NEGINF); + tanf_test1_validate_isnan(PAL_NAN); + tanf_test1_validate_isnan(PAL_POSINF); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/testinfo.dat deleted file mode 100644 index d0b661feb425..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = tanf -Name = Positive Test for tanf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to tanf() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/CMakeLists.txt deleted file mode 100644 index ee8f76a2562b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_tanh_test1 - ${SOURCES} -) - -add_dependencies(paltest_tanh_test1 coreclrpal) - -target_link_libraries(paltest_tanh_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/test1.cpp index 5c6102478af5..a2df3885803c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/test1.cpp @@ -45,11 +45,11 @@ struct test }; /** - * validate + * tanh_test1_validate * * test validation function */ -void __cdecl validate(double value, double expected, double variance) +void __cdecl tanh_test1_validate(double value, double expected, double variance) { double result = tanh(value); @@ -67,11 +67,11 @@ void __cdecl validate(double value, double expected, double variance) } /** - * validate + * tanh_test1_validate * * test validation function for values returning NaN */ -void __cdecl validate_isnan(double value) +void __cdecl tanh_test1_validate_isnan(double value) { double result = tanh(value); @@ -87,7 +87,7 @@ void __cdecl validate_isnan(double value) * * executable entry point */ -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_tanh_test1_paltest_tanh_test1, "c_runtime/tanh/test1/paltest_tanh_test1") { struct test tests[] = { @@ -118,11 +118,11 @@ int __cdecl main(int argc, char **argv) for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); + tanh_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + tanh_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); } - validate_isnan(PAL_NAN); + tanh_test1_validate_isnan(PAL_NAN); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/testinfo.dat deleted file mode 100644 index 4bd3bfcd8428..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanh/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = tanh -Name = Positive Test for tanh -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to tanh() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/CMakeLists.txt deleted file mode 100644 index 5ee8f067682e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.c -) - -add_executable(paltest_tanhf_test1 - ${SOURCES} -) - -add_dependencies(paltest_tanhf_test1 coreclrpal) - -target_link_libraries(paltest_tanhf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.c b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.c deleted file mode 100644 index 01649aea5937..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.c +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: test1.c -** -** Purpose: Test to ensure that tanhf return the correct values -** -** Dependencies: PAL_Initialize -** PAL_Terminate -** Fail -** fabs -** -**===========================================================================*/ - -#include - -// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this -// is slightly too accurate when writing tests meant to run against libm implementations -// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. -// -// The tests themselves will take PAL_EPSILON and adjust it according to the expected result -// so that the delta used for comparison will compare the most significant digits and ignore -// any digits that are outside the double precision range (6-9 digits). - -// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON -// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use -// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. -#define PAL_EPSILON 4.76837158e-07 - -#define PAL_NAN sqrtf(-1.0f) -#define PAL_POSINF -logf(0.0f) -#define PAL_NEGINF logf(0.0f) - -/** - * Helper test structure - */ -struct test -{ - float value; /* value to test the function with */ - float expected; /* expected result */ - float variance; /* maximum delta between the expected and actual result */ -}; - -/** - * validate - * - * test validation function - */ -void __cdecl validate(float value, float expected, float variance) -{ - float result = tanhf(value); - - /* - * The test is valid when the difference between result - * and expected is less than or equal to variance - */ - float delta = fabsf(result - expected); - - if (delta > variance) - { - Fail("tanhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, expected); - } -} - -/** - * validate - * - * test validation function for values returning NaN - */ -void __cdecl validate_isnan(float value) -{ - float result = tanhf(value); - - if (!_isnanf(result)) - { - Fail("tanhf(%g) returned %10.9g when it should have returned %10.9g", - value, result, PAL_NAN); - } -} - -/** - * main - * - * executable entry point - */ -int __cdecl main(int argc, char **argv) -{ - struct test tests[] = - { - /* value expected variance */ - { 0, 0, PAL_EPSILON }, - { 0.318309886f, 0.307977913f, PAL_EPSILON }, // value: 1 / pi - { 0.434294482f, 0.408904012f, PAL_EPSILON }, // value: log10f(e) - { 0.636619772f, 0.562593600f, PAL_EPSILON }, // value: 2 / pi - { 0.693147181f, 0.6f, PAL_EPSILON }, // value: ln(2) - { 0.707106781f, 0.608859365f, PAL_EPSILON }, // value: 1 / sqrtf(2) - { 0.785398163f, 0.655794203f, PAL_EPSILON }, // value: pi / 4 - { 1, 0.761594156f, PAL_EPSILON }, - { 1.12837917f, 0.810463806f, PAL_EPSILON }, // value: 2 / sqrtf(pi) - { 1.41421356f, 0.888385562f, PAL_EPSILON }, // value: sqrtf(2) - { 1.44269504f, 0.894238946f, PAL_EPSILON }, // value: logf2(e) - { 1.57079633f, 0.917152336f, PAL_EPSILON }, // value: pi / 2 - { 2.30258509f, 0.980198020f, PAL_EPSILON }, // value: ln(10) - { 2.71828183f, 0.991328916f, PAL_EPSILON }, // value: e - { 3.14159265f, 0.996272076f, PAL_EPSILON }, // value: pi - { PAL_POSINF, 1, PAL_EPSILON * 10 } - }; - - /* PAL initialization */ - if (PAL_Initialize(argc, argv) != 0) - { - return FAIL; - } - - for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) - { - validate( tests[i].value, tests[i].expected, tests[i].variance); - validate(-tests[i].value, -tests[i].expected, tests[i].variance); - } - - validate_isnan(PAL_NAN); - - PAL_Terminate(); - return PASS; -} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.cpp new file mode 100644 index 000000000000..646e743fa418 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.cpp @@ -0,0 +1,128 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================= +** +** Source: test1.c +** +** Purpose: Test to ensure that tanhf return the correct values +** +** Dependencies: PAL_Initialize +** PAL_Terminate +** Fail +** fabs +** +**===========================================================================*/ + +#include + +// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this +// is slightly too accurate when writing tests meant to run against libm implementations +// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get. +// +// The tests themselves will take PAL_EPSILON and adjust it according to the expected result +// so that the delta used for comparison will compare the most significant digits and ignore +// any digits that are outside the double precision range (6-9 digits). + +// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON +// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use +// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10. +#define PAL_EPSILON 4.76837158e-07 + +#define PAL_NAN sqrtf(-1.0f) +#define PAL_POSINF -logf(0.0f) +#define PAL_NEGINF logf(0.0f) + +/** + * Helper test structure + */ +struct test +{ + float value; /* value to test the function with */ + float expected; /* expected result */ + float variance; /* maximum delta between the expected and actual result */ +}; + +/** + * tanhf_test1_validate + * + * test validation function + */ +void __cdecl tanhf_test1_validate(float value, float expected, float variance) +{ + float result = tanhf(value); + + /* + * The test is valid when the difference between result + * and expected is less than or equal to variance + */ + float delta = fabsf(result - expected); + + if (delta > variance) + { + Fail("tanhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, expected); + } +} + +/** + * tanhf_test1_validate + * + * test validation function for values returning NaN + */ +void __cdecl tanhf_test1_validate_isnan(float value) +{ + float result = tanhf(value); + + if (!_isnanf(result)) + { + Fail("tanhf(%g) returned %10.9g when it should have returned %10.9g", + value, result, PAL_NAN); + } +} + +/** + * main + * + * executable entry point + */ +PALTEST(c_runtime_tanhf_test1_paltest_tanhf_test1, "c_runtime/tanhf/test1/paltest_tanhf_test1") +{ + struct test tests[] = + { + /* value expected variance */ + { 0, 0, PAL_EPSILON }, + { 0.318309886f, 0.307977913f, PAL_EPSILON }, // value: 1 / pi + { 0.434294482f, 0.408904012f, PAL_EPSILON }, // value: log10f(e) + { 0.636619772f, 0.562593600f, PAL_EPSILON }, // value: 2 / pi + { 0.693147181f, 0.6f, PAL_EPSILON }, // value: ln(2) + { 0.707106781f, 0.608859365f, PAL_EPSILON }, // value: 1 / sqrtf(2) + { 0.785398163f, 0.655794203f, PAL_EPSILON }, // value: pi / 4 + { 1, 0.761594156f, PAL_EPSILON }, + { 1.12837917f, 0.810463806f, PAL_EPSILON }, // value: 2 / sqrtf(pi) + { 1.41421356f, 0.888385562f, PAL_EPSILON }, // value: sqrtf(2) + { 1.44269504f, 0.894238946f, PAL_EPSILON }, // value: logf2(e) + { 1.57079633f, 0.917152336f, PAL_EPSILON }, // value: pi / 2 + { 2.30258509f, 0.980198020f, PAL_EPSILON }, // value: ln(10) + { 2.71828183f, 0.991328916f, PAL_EPSILON }, // value: e + { 3.14159265f, 0.996272076f, PAL_EPSILON }, // value: pi + { PAL_POSINF, 1, PAL_EPSILON * 10 } + }; + + /* PAL initialization */ + if (PAL_Initialize(argc, argv) != 0) + { + return FAIL; + } + + for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++) + { + tanhf_test1_validate( tests[i].value, tests[i].expected, tests[i].variance); + tanhf_test1_validate(-tests[i].value, -tests[i].expected, tests[i].variance); + } + + tanhf_test1_validate_isnan(PAL_NAN); + + PAL_Terminate(); + return PASS; +} diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/testinfo.dat deleted file mode 100644 index 0aff99938749..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tanhf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = tanhf -Name = Positive Test for tanhf -TYPE = DEFAULT -EXE1 = test1 -Description -= Passes to tanhf() a series of angle value, checking that -= each one return to correct value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/time/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/time/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/time/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/CMakeLists.txt deleted file mode 100644 index 7b43d7a7f211..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_time_test1 - ${SOURCES} -) - -add_dependencies(paltest_time_test1 coreclrpal) - -target_link_libraries(paltest_time_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/test1.cpp index 540794557ffd..72d905be0a51 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/test1.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_time_test1_paltest_time_test1, "c_runtime/time/test1/paltest_time_test1") { time_t t = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/testinfo.dat deleted file mode 100644 index 664cbde01102..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/time/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = time -Name = Positive Test for time -TYPE = DEFAULT -EXE1 = test1 -Description -= Calls the time function and verifies that the time returned is at -= least a positive value. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/CMakeLists.txt deleted file mode 100644 index 8fb53906389c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_tolower_test1 - ${SOURCES} -) - -add_dependencies(paltest_tolower_test1 coreclrpal) - -target_link_libraries(paltest_tolower_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/test1.cpp index 6e3f0a50b6ef..b6723786245d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/test1.cpp @@ -21,7 +21,7 @@ struct testCase int start; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_tolower_test1_paltest_tolower_test1, "c_runtime/tolower/test1/paltest_tolower_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/testinfo.dat deleted file mode 100644 index 2abccb349950..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/tolower/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = tolower -Name = Positive Test for tolower -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the tolower function. -= Check that the tolower function makes capital character lower case. -= Also check that it has no effect on lower case letters and special -= characters. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/CMakeLists.txt deleted file mode 100644 index 68541eb562b0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_toupper_test1 - ${SOURCES} -) - -add_dependencies(paltest_toupper_test1 coreclrpal) - -target_link_libraries(paltest_toupper_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/test1.cpp index 546f898949bb..1683aa3b9fc6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/test1.cpp @@ -22,7 +22,7 @@ struct testCase int start; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_toupper_test1_paltest_toupper_test1, "c_runtime/toupper/test1/paltest_toupper_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/testinfo.dat deleted file mode 100644 index 285f8555e7c5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/toupper/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = toupper -Name = Positive Test for toupper -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the toupper function. -= Check that the toupper function makes lower case character a capital. -= Also check that it has no effect on upper case letters and special -= characters. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/CMakeLists.txt deleted file mode 100644 index 279882d712f0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_towlower_test1 - ${SOURCES} -) - -add_dependencies(paltest_towlower_test1 coreclrpal) - -target_link_libraries(paltest_towlower_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/test1.cpp index 6900a8fd4347..e17aad88bc46 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/test1.cpp @@ -21,7 +21,7 @@ struct testCase WCHAR start; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_towlower_test1_paltest_towlower_test1, "c_runtime/towlower/test1/paltest_towlower_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/testinfo.dat deleted file mode 100644 index f6ea60afb687..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/towlower/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = towlower -Name = Positive Test for towlower -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the towlower function. -= Check that the tolower function makes capital character lower case. -= Also check that it has no effect on lower case letters and special -= characters. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/CMakeLists.txt deleted file mode 100644 index 95df931f4bd0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_towupper_test1 - ${SOURCES} -) - -add_dependencies(paltest_towupper_test1 coreclrpal) - -target_link_libraries(paltest_towupper_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/test1.cpp index a463a69d2ec5..d2fd880d1714 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/test1.cpp @@ -22,7 +22,7 @@ struct testCase WCHAR start; }; -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_towupper_test1_paltest_towupper_test1, "c_runtime/towupper/test1/paltest_towupper_test1") { int result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/testinfo.dat deleted file mode 100644 index b5977214b29b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/towupper/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = towupper -Name = Positive Test for towupper -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the towupper function. -= Check that the towupper function makes lower case character a capital. -= Also check that it has no effect on upper case letters and special -= characters. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/CMakeLists.txt deleted file mode 100644 index 256753a63646..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/CMakeLists.txt deleted file mode 100644 index 2bc1d344163b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_vfprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test1 coreclrpal) - -target_link_libraries(paltest_vfprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.cpp index 28432f87e65d..8b088ba9a11a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.cpp @@ -16,7 +16,7 @@ #include #include "../vfprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test1_paltest_vfprintf_test1, "c_runtime/vfprintf/test1/paltest_vfprintf_test1") { FILE *fp; char testfile[] = "testfile.txt"; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/testinfo.dat deleted file mode 100644 index fec5d5471f9c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= General test to see if vfprintf works correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/CMakeLists.txt deleted file mode 100644 index f15dcfec6bda..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_vfprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test10 coreclrpal) - -target_link_libraries(paltest_vfprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.cpp index 9065352728aa..17d5a3f00af8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.cpp @@ -17,7 +17,7 @@ #include "../vfprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test10_paltest_vfprintf_test10, "c_runtime/vfprintf/test10/paltest_vfprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/testinfo.dat deleted file mode 100644 index 4e310b6f0b53..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests vfprintf with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/CMakeLists.txt deleted file mode 100644 index fdefd96a8cb0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_vfprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test11 coreclrpal) - -target_link_libraries(paltest_vfprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.cpp index 657d47baf9a0..e545dba311ab 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.cpp @@ -16,7 +16,7 @@ #include #include "../vfprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test11_paltest_vfprintf_test11, "c_runtime/vfprintf/test11/paltest_vfprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/testinfo.dat deleted file mode 100644 index 56a486fc9888..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests vfprintf with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/CMakeLists.txt deleted file mode 100644 index d53b2c1275c6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_vfprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test12 coreclrpal) - -target_link_libraries(paltest_vfprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.cpp index 9063acf7b091..167c4b28635b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.cpp @@ -17,7 +17,7 @@ #include "../vfprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test12_paltest_vfprintf_test12, "c_runtime/vfprintf/test12/paltest_vfprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/testinfo.dat deleted file mode 100644 index 1e0579e381cd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests vfprintf with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/CMakeLists.txt deleted file mode 100644 index 7e07a5034ca4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_vfprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test13 coreclrpal) - -target_link_libraries(paltest_vfprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.cpp index c25896974171..6c5e4ac24e73 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test13_paltest_vfprintf_test13, "c_runtime/vfprintf/test13/paltest_vfprintf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/testinfo.dat deleted file mode 100644 index 337b3eed7ba7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests vfprintf with hex numbers (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/CMakeLists.txt deleted file mode 100644 index eea6912b8e23..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_vfprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test14 coreclrpal) - -target_link_libraries(paltest_vfprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.cpp index 194d47a285a7..9602a0a1bd2a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test14_paltest_vfprintf_test14, "c_runtime/vfprintf/test14/paltest_vfprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/testinfo.dat deleted file mode 100644 index 21a6782a11a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests vfprintf with exponential format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/CMakeLists.txt deleted file mode 100644 index 1e88f42ff13e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_vfprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test15 coreclrpal) - -target_link_libraries(paltest_vfprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.cpp index de90698c9bb6..050324de2a46 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test15_paltest_vfprintf_test15, "c_runtime/vfprintf/test15/paltest_vfprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/testinfo.dat deleted file mode 100644 index eeb64d431ec5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests vfprintf with exponential format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/CMakeLists.txt deleted file mode 100644 index d34097b4573a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_vfprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test16 coreclrpal) - -target_link_libraries(paltest_vfprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.cpp index eba3cbaae460..cc7dab4a4d6b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test16_paltest_vfprintf_test16, "c_runtime/vfprintf/test16/paltest_vfprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/testinfo.dat deleted file mode 100644 index bcfa56f113c0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests vfprintf with decimal point format doubles diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/CMakeLists.txt deleted file mode 100644 index 15c53b877491..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_vfprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test17 coreclrpal) - -target_link_libraries(paltest_vfprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.cpp index add1f54cd02a..e60694909eea 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test17_paltest_vfprintf_test17, "c_runtime/vfprintf/test17/paltest_vfprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/testinfo.dat deleted file mode 100644 index 6f4159a01187..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests vfprintf with compact format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/CMakeLists.txt deleted file mode 100644 index 1e91c5e043a2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_vfprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test18 coreclrpal) - -target_link_libraries(paltest_vfprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.cpp index 6b4eea397255..e634c02aac5f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test18_paltest_vfprintf_test18, "c_runtime/vfprintf/test18/paltest_vfprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/testinfo.dat deleted file mode 100644 index 41c470542d40..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test18/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests vfprintf with compact format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/CMakeLists.txt deleted file mode 100644 index 41315534c928..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_vfprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test19 coreclrpal) - -target_link_libraries(paltest_vfprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.cpp index 53b1209364fd..1e83dc6259ea 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test19_paltest_vfprintf_test19, "c_runtime/vfprintf/test19/paltest_vfprintf_test19") { int n = -1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/testinfo.dat deleted file mode 100644 index b8bccc7b2cac..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test19/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests vfprintf with argument specified precision diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/CMakeLists.txt deleted file mode 100644 index 3c2c738bf705..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_vfprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test2 coreclrpal) - -target_link_libraries(paltest_vfprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.cpp index f19665b6e1f3..df7ba73ee1c0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test2_paltest_vfprintf_test2, "c_runtime/vfprintf/test2/paltest_vfprintf_test2") { if (PAL_Initialize(argc, argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/testinfo.dat deleted file mode 100644 index 7fbe6596a7f1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests vfprintf with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/CMakeLists.txt deleted file mode 100644 index 85a4265b5574..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_vfprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test3 coreclrpal) - -target_link_libraries(paltest_vfprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.cpp index b9ab319f2f94..96a08df5e3a9 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test3_paltest_vfprintf_test3, "c_runtime/vfprintf/test3/paltest_vfprintf_test3") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/testinfo.dat deleted file mode 100644 index 721c7c9e48ce..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests vfprintf with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/CMakeLists.txt deleted file mode 100644 index 5907a8d71c50..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_vfprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test4 coreclrpal) - -target_link_libraries(paltest_vfprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.cpp index 8afbca483339..410c6ec15805 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test4_paltest_vfprintf_test4, "c_runtime/vfprintf/test4/paltest_vfprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/testinfo.dat deleted file mode 100644 index 7413dcc4f0ef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests vfprintf with pointers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/CMakeLists.txt deleted file mode 100644 index 97e5e4b00431..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_vfprintf_test5 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test5 coreclrpal) - -target_link_libraries(paltest_vfprintf_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.cpp index 03a8bd60b552..ccea60e93e3b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test5_paltest_vfprintf_test5, "c_runtime/vfprintf/test5/paltest_vfprintf_test5") { char *longStr = "really-long-string-that-just-keeps-going-on-and-on-and-on.." diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/testinfo.dat deleted file mode 100644 index bd5d1e00a5d5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test5/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests vfprintf with the count specifier diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/CMakeLists.txt deleted file mode 100644 index afe4f1aeb47f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_vfprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test6 coreclrpal) - -target_link_libraries(paltest_vfprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.cpp index afa0909d6485..6404e8fca89e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test6_paltest_vfprintf_test6, "c_runtime/vfprintf/test6/paltest_vfprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/testinfo.dat deleted file mode 100644 index 3a6f60d2a3f3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests vfprintf with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/CMakeLists.txt deleted file mode 100644 index e528033157d4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_vfprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test7 coreclrpal) - -target_link_libraries(paltest_vfprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.cpp index e8871b71600d..05e88dcb1f5b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test7_paltest_vfprintf_test7, "c_runtime/vfprintf/test7/paltest_vfprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/testinfo.dat deleted file mode 100644 index 0bfd81343a55..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests vfprintf with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/CMakeLists.txt deleted file mode 100644 index d131025ef00f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_vfprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test8 coreclrpal) - -target_link_libraries(paltest_vfprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.cpp index 3c6896417446..ce046df8950e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test8_paltest_vfprintf_test8, "c_runtime/vfprintf/test8/paltest_vfprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/testinfo.dat deleted file mode 100644 index 05bfce9c1932..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests vfprintf with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/CMakeLists.txt deleted file mode 100644 index 68c07179a8fc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_vfprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_vfprintf_test9 coreclrpal) - -target_link_libraries(paltest_vfprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.cpp index f77ad5710ba6..6a4bc39a52de 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vfprintf_test9_paltest_vfprintf_test9, "c_runtime/vfprintf/test9/paltest_vfprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/testinfo.dat deleted file mode 100644 index af803d0ef2ea..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vfprintf -Name = Positive Test for vfprintf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests vfprintf with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h index 1e5bac108cab..f8aa9dc8aecb 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h @@ -13,7 +13,7 @@ #ifndef __vfprintf_H__ #define __vfprintf_H__ -int DoVfprintf(FILE *fp, const char *format, ...) +inline int DoVfprintf(FILE *fp, const char *format, ...) { int retVal; va_list arglist; @@ -25,7 +25,7 @@ int DoVfprintf(FILE *fp, const char *format, ...) return (retVal); } -void DoStrTest(const char *formatstr, char* param, const char *checkstr) +inline void DoStrTest_vfprintf(const char *formatstr, char* param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -55,8 +55,9 @@ void DoStrTest(const char *formatstr, char* param, const char *checkstr) } fclose(fp); } +#define DoStrTest DoStrTest_vfprintf -void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_vfprintf(const char *formatstr, WCHAR* param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -86,9 +87,9 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) } fclose(fp); } +#define DoWStrTest DoWStrTest_vfprintf - -void DoPointerTest(const char *formatstr, void* param, char* paramstr, +inline void DoPointerTest_vfprintf(const char *formatstr, void* param, char* paramstr, const char *checkstr1) { FILE *fp; @@ -126,10 +127,9 @@ void DoPointerTest(const char *formatstr, void* param, char* paramstr, Fail("ERROR: fclose failed to close \"testfile.txt\"\n"); } } +#define DoPointerTest DoPointerTest_vfprintf - - -void DoCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoCountTest_vfprintf(const char *formatstr, int param, const char *checkstr) { FILE *fp; char buf[512] = { 0 }; @@ -171,8 +171,9 @@ void DoCountTest(const char *formatstr, int param, const char *checkstr) Fail("ERROR: fclose failed to close \"testfile.txt\"\n"); } } +#define DoCountTest DoCountTest_vfprintf -void DoShortCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoShortCountTest_vfprintf(const char *formatstr, int param, const char *checkstr) { FILE *fp; char buf[512] = { 0 }; @@ -214,9 +215,9 @@ void DoShortCountTest(const char *formatstr, int param, const char *checkstr) Fail("ERROR: fclose failed to close \"testfile.txt\"\n"); } } +#define DoShortCountTest DoShortCountTest_vfprintf - -void DoCharTest(const char *formatstr, char param, const char *checkstr) +inline void DoCharTest_vfprintf(const char *formatstr, char param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -246,8 +247,9 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr) } fclose(fp); } +#define DoCharTest DoCharTest_vfprintf -void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_vfprintf(const char *formatstr, WCHAR param, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -277,8 +279,9 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) } fclose(fp); } +#define DoWCharTest DoWCharTest_vfprintf -void DoNumTest(const char *formatstr, int value, const char *checkstr) +inline void DoNumTest_vfprintf(const char *formatstr, int value, const char *checkstr) { FILE *fp; char buf[256] = { 0 }; @@ -308,8 +311,9 @@ void DoNumTest(const char *formatstr, int value, const char *checkstr) } fclose(fp); } +#define DoNumTest DoNumTest_vfprintf -void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1) +inline void DoI64Test_vfprintf(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1) { FILE *fp; char buf[256] = { 0 }; @@ -339,8 +343,9 @@ void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *c } fclose(fp); } +#define DoI64Test DoI64Test_vfprintf -void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, +inline void DoDoubleTest_vfprintf(const char *formatstr, double value, const char *checkstr1, const char *checkstr2) { FILE *fp; @@ -373,9 +378,9 @@ void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, } fclose(fp); } +#define DoDoubleTest DoDoubleTest_vfprintf - -void DoArgumentPrecTest(const char *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_vfprintf(const char *formatstr, int precision, void *param, char *paramstr, const char *checkstr1, const char *checkstr2) { FILE *fp; @@ -416,8 +421,9 @@ void DoArgumentPrecTest(const char *formatstr, int precision, void *param, } } +#define DoArgumentPrecTest DoArgumentPrecTest_vfprintf -void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_vfprintf(const char *formatstr, int precision, double param, const char *checkstr1, const char *checkstr2) { FILE *fp; @@ -457,6 +463,7 @@ void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_vfprintf #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/CMakeLists.txt deleted file mode 100644 index 12016659f6be..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# This test fails to build on ARM -#add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/CMakeLists.txt deleted file mode 100644 index 12e210b906d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_vprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test1 coreclrpal) - -target_link_libraries(paltest_vprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.cpp index 721ea27c12ae..018055ca30d4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.cpp @@ -16,7 +16,7 @@ #include #include "../vprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test1_paltest_vprintf_test1, "c_runtime/vprintf/test1/paltest_vprintf_test1") { char checkstr[] = "hello world"; int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/testinfo.dat deleted file mode 100644 index 36105e5acdd9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= General test to see if vprintf works correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/CMakeLists.txt deleted file mode 100644 index debfd71a7c46..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_vprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test10 coreclrpal) - -target_link_libraries(paltest_vprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.cpp index b7a6a1e2a252..e58ac1816dbf 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.cpp @@ -17,7 +17,7 @@ #include "../vprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test10_paltest_vprintf_test10, "c_runtime/vprintf/test10/paltest_vprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/testinfo.dat deleted file mode 100644 index e6a506774d78..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test10/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests vprintf with octal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/CMakeLists.txt deleted file mode 100644 index 55d59ef7ba53..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_vprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test11 coreclrpal) - -target_link_libraries(paltest_vprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.cpp index 61b370236b0f..b2718c995dad 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.cpp @@ -16,7 +16,7 @@ #include #include "../vprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test11_paltest_vprintf_test11, "c_runtime/vprintf/test11/paltest_vprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/testinfo.dat deleted file mode 100644 index 19b15fb39275..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test11/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests vprintf with unsigned numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/CMakeLists.txt deleted file mode 100644 index 1211a7d55ac8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_vprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test12 coreclrpal) - -target_link_libraries(paltest_vprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.cpp index a44a60abf60e..1cf22fef0327 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.cpp @@ -17,7 +17,7 @@ #include "../vprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test12_paltest_vprintf_test12, "c_runtime/vprintf/test12/paltest_vprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/testinfo.dat deleted file mode 100644 index 0b2af43a4ffa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test12/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests vprintf with hex numbers (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/CMakeLists.txt deleted file mode 100644 index 0d7943d61be0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_vprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test13 coreclrpal) - -target_link_libraries(paltest_vprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.cpp index 8267a21f6f82..9919fab52a16 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test13_paltest_vprintf_test13, "c_runtime/vprintf/test13/paltest_vprintf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/testinfo.dat deleted file mode 100644 index e962e3176304..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test13/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests vprintf with hex numbers (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/CMakeLists.txt deleted file mode 100644 index abf54434848d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_vprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test14 coreclrpal) - -target_link_libraries(paltest_vprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.cpp index bba973a1e7f1..874fc00dc45c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test14_paltest_vprintf_test14, "c_runtime/vprintf/test14/paltest_vprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/testinfo.dat deleted file mode 100644 index 6d8fd63fdb61..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test14/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests vprintf with exponential format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/CMakeLists.txt deleted file mode 100644 index 51e3c5501013..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_vprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test15 coreclrpal) - -target_link_libraries(paltest_vprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.cpp index 6ea26bab57ff..d5b0d14c1330 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test15_paltest_vprintf_test15, "c_runtime/vprintf/test15/paltest_vprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/testinfo.dat deleted file mode 100644 index bd474baf7d27..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test15/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests vprintf with exponential format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/CMakeLists.txt deleted file mode 100644 index 54588ed1c998..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_vprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test16 coreclrpal) - -target_link_libraries(paltest_vprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.cpp index 7cb28491017f..4834d8002f09 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test16_paltest_vprintf_test16, "c_runtime/vprintf/test16/paltest_vprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/testinfo.dat deleted file mode 100644 index f70e7de261f9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test16/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests vprintf with decimal point format doubles diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/CMakeLists.txt deleted file mode 100644 index 657a41c442c3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_vprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test17 coreclrpal) - -target_link_libraries(paltest_vprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.cpp index 0d178b935f77..1711b0f013ba 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test17_paltest_vprintf_test17, "c_runtime/vprintf/test17/paltest_vprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/testinfo.dat deleted file mode 100644 index 75c5bf43e34e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test17/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests vprintf with compact format doubles (lowercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/CMakeLists.txt deleted file mode 100644 index d0ad8fcb9a67..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_vprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test18 coreclrpal) - -target_link_libraries(paltest_vprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.cpp index 67d491140aa2..a5b7f54d5da3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test18_paltest_vprintf_test18, "c_runtime/vprintf/test18/paltest_vprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/testinfo.dat deleted file mode 100644 index 81e9efbf1fbf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test18/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests vprintf with compact format doubles (uppercase) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/CMakeLists.txt deleted file mode 100644 index f07d23607ca5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_vprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test19 coreclrpal) - -target_link_libraries(paltest_vprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.cpp index abeb7ead6e3e..d99abe7b8e03 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test19_paltest_vprintf_test19, "c_runtime/vprintf/test19/paltest_vprintf_test19") { int n = -1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/testinfo.dat deleted file mode 100644 index cbd8547ae944..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test19/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests vprintf with argument specified precision diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/CMakeLists.txt deleted file mode 100644 index 13edb26ca950..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_vprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test2 coreclrpal) - -target_link_libraries(paltest_vprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.cpp index 7b4b133f9928..ca43ae83fde3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test2_paltest_vprintf_test2, "c_runtime/vprintf/test2/paltest_vprintf_test2") { if (PAL_Initialize(argc, argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/testinfo.dat deleted file mode 100644 index 6abd0066b556..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests vprintf with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/CMakeLists.txt deleted file mode 100644 index c704c2ffd327..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_vprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test3 coreclrpal) - -target_link_libraries(paltest_vprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.cpp index 62826cfbc5ae..1348eb40b518 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test3_paltest_vprintf_test3, "c_runtime/vprintf/test3/paltest_vprintf_test3") { if (PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/testinfo.dat deleted file mode 100644 index c5776a92eb44..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests vprintf with wide strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/CMakeLists.txt deleted file mode 100644 index fdb5acd9a748..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_vprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test4 coreclrpal) - -target_link_libraries(paltest_vprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.cpp index 6a915b82fde0..bf98ec23ba9c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.cpp @@ -19,7 +19,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test4_paltest_vprintf_test4, "c_runtime/vprintf/test4/paltest_vprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/testinfo.dat deleted file mode 100644 index 30c18365d8ec..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests vprintf with pointers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/CMakeLists.txt deleted file mode 100644 index 13c660c1b51e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_vprintf_test5 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test5 coreclrpal) - -target_link_libraries(paltest_vprintf_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.cpp index 69a9f0d2405a..a2b3233b5ac3 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test5_paltest_vprintf_test5, "c_runtime/vprintf/test5/paltest_vprintf_test5") { char *longStr = "really-long-string-that-just-keeps-going-on-and-on-and-on.." diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/testinfo.dat deleted file mode 100644 index b1c3e8cf4974..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test5/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests vprintf with the count specifier diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/CMakeLists.txt deleted file mode 100644 index df9ec1916cdb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_vprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test6 coreclrpal) - -target_link_libraries(paltest_vprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.cpp index 3a04a5142056..5c6bec8c493c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test6_paltest_vprintf_test6, "c_runtime/vprintf/test6/paltest_vprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/testinfo.dat deleted file mode 100644 index f762bc6e9cbb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests vprintf with characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/CMakeLists.txt deleted file mode 100644 index d0086a9b3628..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_vprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test7 coreclrpal) - -target_link_libraries(paltest_vprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.cpp index 14bef0bf9650..d735623d082d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test7_paltest_vprintf_test7, "c_runtime/vprintf/test7/paltest_vprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/testinfo.dat deleted file mode 100644 index 399518e6ffd9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests vprintf with wide characters diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/CMakeLists.txt deleted file mode 100644 index c47e2cf16ec3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_vprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test8 coreclrpal) - -target_link_libraries(paltest_vprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.cpp index bed3b18b3099..7c1128d3653f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test8_paltest_vprintf_test8, "c_runtime/vprintf/test8/paltest_vprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/testinfo.dat deleted file mode 100644 index 0bb7038786f6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test8/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests vprintf with decimal numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/CMakeLists.txt deleted file mode 100644 index 521e354c3bac..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_vprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_vprintf_test9 coreclrpal) - -target_link_libraries(paltest_vprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.cpp index 4f8a05e4ce56..44004d35ce1c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vprintf_test9_paltest_vprintf_test9, "c_runtime/vprintf/test9/paltest_vprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/testinfo.dat deleted file mode 100644 index 38b887dd1c24..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vprintf -Name = Positive Test for vprintf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests vprintf with integer numbers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h index 87e7956b7622..cdb0f4e5ee34 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h @@ -13,7 +13,7 @@ #ifndef __vprintf_H__ #define __vprintf_H__ -int DoVprintf(const char *format, ...) +inline int DoVprintf(const char *format, ...) { int retVal; va_list arglist; @@ -25,7 +25,7 @@ int DoVprintf(const char *format, ...) return (retVal); } -void DoStrTest(const char *formatstr, char* param, const char *checkstr) +inline void DoStrTest_vprintf(const char *formatstr, char* param, const char *checkstr) { int ret; @@ -36,8 +36,9 @@ void DoStrTest(const char *formatstr, char* param, const char *checkstr) strlen(checkstr), ret); } } +#define DoStrTest DoStrTest_vprintf -void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_vprintf(const char *formatstr, WCHAR* param, const char *checkstr) { int ret; @@ -48,8 +49,9 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) strlen(checkstr), ret); } } +#define DoWStrTest DoWStrTest_vprintf -void DoPointerTest(const char *formatstr, void* param, char* paramstr, +inline void DoPointerTest_vprintf(const char *formatstr, void* param, char* paramstr, const char *checkstr1) { int ret; @@ -61,8 +63,9 @@ void DoPointerTest(const char *formatstr, void* param, char* paramstr, strlen(checkstr1), ret); } } +#define DoPointerTest DoPointerTest_vprintf -void DoCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoCountTest_vprintf(const char *formatstr, int param, const char *checkstr) { int ret; int n = -1; @@ -80,8 +83,9 @@ void DoCountTest(const char *formatstr, int param, const char *checkstr) strlen(checkstr), ret); } } +#define DoCountTest DoCountTest_vprintf -void DoShortCountTest(const char *formatstr, int param, const char *checkstr) +inline void DoShortCountTest_vprintf(const char *formatstr, int param, const char *checkstr) { int ret; short int n = -1; @@ -99,9 +103,9 @@ void DoShortCountTest(const char *formatstr, int param, const char *checkstr) strlen(checkstr), ret); } } +#define DoShortCountTest DoShortCountTest_vprintf - -void DoCharTest(const char *formatstr, char param, const char *checkstr) +inline void DoCharTest_vprintf(const char *formatstr, char param, const char *checkstr) { int ret; @@ -112,8 +116,9 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr) strlen(checkstr), ret); } } +#define DoCharTest DoCharTest_vprintf -void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_vprintf(const char *formatstr, WCHAR param, const char *checkstr) { int ret; @@ -124,8 +129,9 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) strlen(checkstr), ret); } } +#define DoWCharTest DoWCharTest_vprintf -void DoNumTest(const char *formatstr, int param, const char *checkstr) +inline void DoNumTest_vprintf(const char *formatstr, int param, const char *checkstr) { int ret; @@ -136,8 +142,9 @@ void DoNumTest(const char *formatstr, int param, const char *checkstr) strlen(checkstr), ret); } } +#define DoNumTest DoNumTest_vprintf -void DoI64Test(const char *formatstr, INT64 param, char *valuestr, const char *checkstr1) +inline void DoI64Test_vprintf(const char *formatstr, INT64 param, char *valuestr, const char *checkstr1) { int ret; @@ -148,8 +155,9 @@ void DoI64Test(const char *formatstr, INT64 param, char *valuestr, const char *c strlen(checkstr1), ret); } } +#define DoI64Test DoI64Test_vprintf -void DoDoubleTest(const char *formatstr, double param, const char *checkstr1, +inline void DoDoubleTest_vprintf(const char *formatstr, double param, const char *checkstr1, const char *checkstr2) { int ret; @@ -161,8 +169,9 @@ void DoDoubleTest(const char *formatstr, double param, const char *checkstr1, strlen(checkstr1), strlen(checkstr2), ret); } } +#define DoDoubleTest DoDoubleTest_vprintf -void DoArgumentPrecTest(const char *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_vprintf(const char *formatstr, int precision, void *param, char *paramstr, const char *checkstr1, const char *checkstr2) { int ret; @@ -174,8 +183,9 @@ void DoArgumentPrecTest(const char *formatstr, int precision, void *param, strlen(checkstr1), strlen(checkstr2), ret); } } +#define DoArgumentPrecTest DoArgumentPrecTest_vprintf -void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_vprintf(const char *formatstr, int precision, double param, const char *checkstr1, const char *checkstr2) { int ret; @@ -187,6 +197,7 @@ void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param strlen(checkstr1), strlen(checkstr2), ret); } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_vprintf #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/CMakeLists.txt deleted file mode 100644 index b29c7c438bd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/CMakeLists.txt deleted file mode 100644 index cc1afb752457..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_vsprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test1 coreclrpal) - -target_link_libraries(paltest_vsprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp index b210afe7ce45..09b0b9f01114 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test1_paltest_vsprintf_test1, "c_runtime/vsprintf/test1/paltest_vsprintf_test1") { char checkstr[] = "hello world"; char buf[256] = { 0 }; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/testinfo.dat deleted file mode 100644 index a8986b564e36..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the vsprintf function. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/CMakeLists.txt deleted file mode 100644 index 2ef1be6ffd0d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_vsprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test10 coreclrpal) - -target_link_libraries(paltest_vsprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.cpp index 81e3f833bae3..57523d775268 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test10_paltest_vsprintf_test10, "c_runtime/vsprintf/test10/paltest_vsprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/testinfo.dat deleted file mode 100644 index 51c02697aa02..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test10/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with octal numbers. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/CMakeLists.txt deleted file mode 100644 index 80825409db24..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_vsprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test11 coreclrpal) - -target_link_libraries(paltest_vsprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.cpp index da58cbad4e46..8524870ebe56 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test11_paltest_vsprintf_test11, "c_runtime/vsprintf/test11/paltest_vsprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/testinfo.dat deleted file mode 100644 index a43d38bc04fe..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test11/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with unsigned numbers. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/CMakeLists.txt deleted file mode 100644 index 4f84c438dfc3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_vsprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test12 coreclrpal) - -target_link_libraries(paltest_vsprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.cpp index 77852434416a..5b82544f1087 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test12_paltest_vsprintf_test12, "c_runtime/vsprintf/test12/paltest_vsprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/testinfo.dat deleted file mode 100644 index 4415fa60459e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test12/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with hex numbers (lowercase). -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/CMakeLists.txt deleted file mode 100644 index 53779dc7bb0d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_vsprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test13 coreclrpal) - -target_link_libraries(paltest_vsprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.cpp index 6422543f795d..b3b700173622 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test13_paltest_vsprintf_test13, "c_runtime/vsprintf/test13/paltest_vsprintf_test13") { int neg = -42; int pos = 0x1234AB; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/testinfo.dat deleted file mode 100644 index 9fd558e0da2c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test13/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with hex numbers (uppercase). -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/CMakeLists.txt deleted file mode 100644 index d08d6069e424..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_vsprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test14 coreclrpal) - -target_link_libraries(paltest_vsprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.cpp index de8395aa7f6a..7c8ed0e8b020 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test14_paltest_vsprintf_test14, "c_runtime/vsprintf/test14/paltest_vsprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/testinfo.dat deleted file mode 100644 index 81232f2e7dc5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test14/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with exponential format doubles (lowercase). -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/CMakeLists.txt deleted file mode 100644 index f45c76840e90..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_vsprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test15 coreclrpal) - -target_link_libraries(paltest_vsprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.cpp index 760fa0081bcc..ccf2a329bbb6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test15_paltest_vsprintf_test15, "c_runtime/vsprintf/test15/paltest_vsprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/testinfo.dat deleted file mode 100644 index 01063b6a8f70..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test15/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with exponential format doubles (uppercase). -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/CMakeLists.txt deleted file mode 100644 index c80de4710793..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_vsprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test16 coreclrpal) - -target_link_libraries(paltest_vsprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.cpp index 65159efe590b..813077192bbc 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test16_paltest_vsprintf_test16, "c_runtime/vsprintf/test16/paltest_vsprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/testinfo.dat deleted file mode 100644 index 28828b2f4943..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test16/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with decimal point format doubles. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/CMakeLists.txt deleted file mode 100644 index 6eceb5b2c5ea..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_vsprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test17 coreclrpal) - -target_link_libraries(paltest_vsprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.cpp index d37c27b3a2e4..efc3344d71e5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test17_paltest_vsprintf_test17, "c_runtime/vsprintf/test17/paltest_vsprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/testinfo.dat deleted file mode 100644 index 26d759bed51d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test17/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with compact format doubles (lowercase). -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/CMakeLists.txt deleted file mode 100644 index 2fd06bc144fd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_vsprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test18 coreclrpal) - -target_link_libraries(paltest_vsprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.cpp index 31fc132a5e15..318df0680644 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test18_paltest_vsprintf_test18, "c_runtime/vsprintf/test18/paltest_vsprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/testinfo.dat deleted file mode 100644 index fb05cb1966c9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test18/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with compact format doubles (uppercase). -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/CMakeLists.txt deleted file mode 100644 index ed0920635c1b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_vsprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test19 coreclrpal) - -target_link_libraries(paltest_vsprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.cpp index 4136033c29e4..622e2f050431 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test19_paltest_vsprintf_test19, "c_runtime/vsprintf/test19/paltest_vsprintf_test19") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/testinfo.dat deleted file mode 100644 index 262786d91a0d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test19/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with argument specified precision. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/CMakeLists.txt deleted file mode 100644 index ccc24cdf207a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_vsprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test2 coreclrpal) - -target_link_libraries(paltest_vsprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.cpp index e2dea2c655ec..0c91e8f2ac86 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.cpp @@ -16,7 +16,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test2_paltest_vsprintf_test2, "c_runtime/vsprintf/test2/paltest_vsprintf_test2") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/testinfo.dat deleted file mode 100644 index eeb5836831a1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with strings. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/CMakeLists.txt deleted file mode 100644 index 16436779de28..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_vsprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test3 coreclrpal) - -target_link_libraries(paltest_vsprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.cpp index be9e5270bee8..adfe6fb2555f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test3_paltest_vsprintf_test3, "c_runtime/vsprintf/test3/paltest_vsprintf_test3") { if (PAL_Initialize(argc, argv) != 0) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/testinfo.dat deleted file mode 100644 index ecb6acb657a2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with wide strings. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/CMakeLists.txt deleted file mode 100644 index b53a17b14e49..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_vsprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test4 coreclrpal) - -target_link_libraries(paltest_vsprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.cpp index 5b71f63390ef..9318f0659e90 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test4_paltest_vsprintf_test4, "c_runtime/vsprintf/test4/paltest_vsprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/testinfo.dat deleted file mode 100644 index 63581f71eaff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with pointers. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/CMakeLists.txt deleted file mode 100644 index 3e2d95a50d8d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_vsprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test6 coreclrpal) - -target_link_libraries(paltest_vsprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.cpp index 8b68bc9c9153..4560fb27fdb8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.cpp @@ -17,7 +17,7 @@ * Notes: memcmp is used, as is strlen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test6_paltest_vsprintf_test6, "c_runtime/vsprintf/test6/paltest_vsprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/testinfo.dat deleted file mode 100644 index 0afdeaa83283..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test6/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with characters. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/CMakeLists.txt deleted file mode 100644 index 740a1dcead2e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_vsprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test7 coreclrpal) - -target_link_libraries(paltest_vsprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.cpp index 5bb113376dfe..9bdd339535c8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.cpp @@ -17,7 +17,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test7_paltest_vsprintf_test7, "c_runtime/vsprintf/test7/paltest_vsprintf_test7") { WCHAR wb = (WCHAR) 'b'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/testinfo.dat deleted file mode 100644 index 239796200ad3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test7/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with wide characters. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/CMakeLists.txt deleted file mode 100644 index 455311cf5be2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_vsprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test8 coreclrpal) - -target_link_libraries(paltest_vsprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.cpp index e83e6b5c9f1a..c805dc5259ea 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test8_paltest_vsprintf_test8, "c_runtime/vsprintf/test8/paltest_vsprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/testinfo.dat deleted file mode 100644 index 37cecfa8dadf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test8/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with decimal numbers. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/CMakeLists.txt deleted file mode 100644 index 7c5fc6c57690..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_vsprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_vsprintf_test9 coreclrpal) - -target_link_libraries(paltest_vsprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.cpp index 16fc3db29f7b..5f27679174a4 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.cpp @@ -18,7 +18,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vsprintf_test9_paltest_vsprintf_test9, "c_runtime/vsprintf/test9/paltest_vsprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/testinfo.dat deleted file mode 100644 index 922474c8368d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/test9/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vsprintf -Name = Positive Test for vsprintf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests the PAL implementation of the vsprintf function. -= Tests vsprintf with integer numbers. -= This test is modeled after _snprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h index f5556691efd6..00e459b3db0c 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h @@ -13,7 +13,7 @@ #define __VSPRINTF_H__ /* These functions leaks memory a lot. C'est la vie. */ -int testvsp(char* buf, size_t buffSize, const char* format, ...) +inline int testvsp(char* buf, size_t buffSize, const char* format, ...) { int retVal; va_list arglist; @@ -25,7 +25,7 @@ int testvsp(char* buf, size_t buffSize, const char* format, ...) return (retVal); } -void DoStrTest(const char *formatstr, char* param, const char *checkstr) +inline void DoStrTest_vsprintf(const char *formatstr, char* param, const char *checkstr) { char buf[256] = { 0 }; @@ -37,8 +37,9 @@ void DoStrTest(const char *formatstr, char* param, const char *checkstr) param, formatstr, checkstr, buf); } } +#define DoStrTest DoStrTest_vsprintf -void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) +inline void DoWStrTest_vsprintf(const char *formatstr, WCHAR* param, const char *checkstr) { char buf[256] = { 0 }; @@ -50,9 +51,9 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr) convertC(param), formatstr, checkstr, buf); } } +#define DoWStrTest DoWStrTest_vsprintf - -void DoCharTest(const char *formatstr, char param, const char *checkstr) +inline void DoCharTest_vsprintf(const char *formatstr, char param, const char *checkstr) { char buf[256] = { 0 }; @@ -64,8 +65,9 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr) param, param, formatstr, checkstr, buf); } } +#define DoCharTest DoCharTest_vsprintf -void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) +inline void DoWCharTest_vsprintf(const char *formatstr, WCHAR param, const char *checkstr) { char buf[256] = { 0 }; @@ -77,8 +79,9 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr) (char)param, param, formatstr, checkstr, buf); } } +#define DoWCharTest DoWCharTest_vsprintf -void DoNumTest(const char *formatstr, int value, const char *checkstr) +inline void DoNumTest_vsprintf(const char *formatstr, int value, const char *checkstr) { char buf[256] = { 0 }; @@ -90,8 +93,9 @@ void DoNumTest(const char *formatstr, int value, const char *checkstr) value, formatstr, checkstr, buf); } } +#define DoNumTest DoNumTest_vsprintf -void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr) +inline void DoI64Test_vsprintf(const char *formatstr, INT64 value, char *valuestr, const char *checkstr) { char buf[256] = { 0 }; @@ -103,7 +107,9 @@ void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *c valuestr, formatstr, checkstr, buf); } } -void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, char +#define DoI64Test DoI64Test_vsprintf + +inline void DoDoubleTest_vsprintf(const char *formatstr, double value, const char *checkstr1, char *checkstr2) { char buf[256] = { 0 }; @@ -117,8 +123,10 @@ void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, ch value, formatstr, checkstr1, checkstr2, buf); } } +#define DoDoubleTest DoDoubleTest_vsprintf + /*FROM TEST 9*/ -void DoArgumentPrecTest(const char *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_vsprintf(const char *formatstr, int precision, void *param, char *paramstr, const char *checkstr1, const char *checkstr2) { char buf[256]; @@ -133,8 +141,9 @@ void DoArgumentPrecTest(const char *formatstr, int precision, void *param, } } +#define DoArgumentPrecTest DoArgumentPrecTest_vsprintf -void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_vsprintf(const char *formatstr, int precision, double param, const char *checkstr1, const char *checkstr2) { char buf[256]; @@ -148,8 +157,10 @@ void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param precision, checkstr1, checkstr2, buf); } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_vsprintf + /*FROM TEST4*/ -void DoPointerTest(const char *formatstr, void* param, char* paramstr, +inline void DoPointerTest_vsprintf(const char *formatstr, void* param, char* paramstr, const char *checkstr1) { char buf[256] = { 0 }; @@ -162,8 +173,9 @@ void DoPointerTest(const char *formatstr, void* param, char* paramstr, paramstr, formatstr, checkstr1, buf); } } +#define DoPointerTest DoPointerTest_vsprintf -void DoI64DoubleTest(const char *formatstr, INT64 value, char *valuestr, +inline void DoI64DoubleTest_vsprintf(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1) { char buf[256] = { 0 }; @@ -176,8 +188,9 @@ void DoI64DoubleTest(const char *formatstr, INT64 value, char *valuestr, valuestr, formatstr, checkstr1, buf); } } +#define DoI64DoubleTest DoI64DoubleTest_vsprintf -void DoTest(const char *formatstr, int param, const char *checkstr) +inline void DoTest_vsprintf(const char *formatstr, int param, const char *checkstr) { char buf[256] = { 0 }; int n = -1; @@ -194,8 +207,9 @@ void DoTest(const char *formatstr, int param, const char *checkstr) Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf); } } +#define DoTest DoTest_vsprintf -void DoShortTest(const char *formatstr, int param, const char *checkstr) +inline void DoShortTest_vsprintf(const char *formatstr, int param, const char *checkstr) { char buf[256] = { 0 }; short int n = -1; @@ -212,6 +226,7 @@ void DoShortTest(const char *formatstr, int param, const char *checkstr) Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf); } } +#define DoShortTest DoShortTest_vsprintf #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/CMakeLists.txt deleted file mode 100644 index b29c7c438bd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/CMakeLists.txt deleted file mode 100644 index 3bb7e5f97195..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_vswprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test1 coreclrpal) - -target_link_libraries(paltest_vswprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp index 988c0e0e17fb..954f8f99f13e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test1_paltest_vswprintf_test1, "c_runtime/vswprintf/test1/paltest_vswprintf_test1") { WCHAR *checkstr = NULL; WCHAR buf[256] = { 0 }; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/testinfo.dat deleted file mode 100644 index ca72ebc538b3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the vswprintf function. -= General test to see if vswprintf works correctly. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/CMakeLists.txt deleted file mode 100644 index 3a17ef2fa4b0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_vswprintf_test10 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test10 coreclrpal) - -target_link_libraries(paltest_vswprintf_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.cpp index 58ea624ee9c1..2ace47428947 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test10_paltest_vswprintf_test10, "c_runtime/vswprintf/test10/paltest_vswprintf_test10") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/testinfo.dat deleted file mode 100644 index 994dead97da4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test10/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with octal numbers. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/CMakeLists.txt deleted file mode 100644 index 7040c2e01b30..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test11.cpp -) - -add_executable(paltest_vswprintf_test11 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test11 coreclrpal) - -target_link_libraries(paltest_vswprintf_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.cpp index a78b5963ff8d..2e24f5bfd712 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test11_paltest_vswprintf_test11, "c_runtime/vswprintf/test11/paltest_vswprintf_test11") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/testinfo.dat deleted file mode 100644 index d7182fedf7a6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test11/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test11 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with unsigned numbers. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/CMakeLists.txt deleted file mode 100644 index 40778fa304f7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_vswprintf_test12 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test12 coreclrpal) - -target_link_libraries(paltest_vswprintf_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.cpp index c5e0b1680857..e80c70617568 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test12_paltest_vswprintf_test12, "c_runtime/vswprintf/test12/paltest_vswprintf_test12") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/testinfo.dat deleted file mode 100644 index e23f936c182d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test12/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test12 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with hex numbers (lowercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/CMakeLists.txt deleted file mode 100644 index 26b85809e0fe..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test13.cpp -) - -add_executable(paltest_vswprintf_test13 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test13 coreclrpal) - -target_link_libraries(paltest_vswprintf_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.cpp index b84836b214ff..081c63ea0cb5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test13_paltest_vswprintf_test13, "c_runtime/vswprintf/test13/paltest_vswprintf_test13") { int neg = -42; int pos = 0x1234ab; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/testinfo.dat deleted file mode 100644 index a4a46b7329e3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test13/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test13 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with hex numbers (uppercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/CMakeLists.txt deleted file mode 100644 index 0e5366e131d7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test14.cpp -) - -add_executable(paltest_vswprintf_test14 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test14 coreclrpal) - -target_link_libraries(paltest_vswprintf_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.cpp index 5e948e8768ca..5e00bf55963e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test14_paltest_vswprintf_test14, "c_runtime/vswprintf/test14/paltest_vswprintf_test14") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/testinfo.dat deleted file mode 100644 index 8194ceee56c0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test14/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test14 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with exponential format doubles (lowercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/CMakeLists.txt deleted file mode 100644 index 23e9595a7df2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test15.cpp -) - -add_executable(paltest_vswprintf_test15 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test15 coreclrpal) - -target_link_libraries(paltest_vswprintf_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.cpp index fcfac5497ac4..2dddd1a937d8 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.cpp @@ -17,7 +17,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test15_paltest_vswprintf_test15, "c_runtime/vswprintf/test15/paltest_vswprintf_test15") { double val = 256.0; double neg = -256.0; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/testinfo.dat deleted file mode 100644 index 0f1e42efff0e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test15/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test15 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with exponential format doubles (uppercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/CMakeLists.txt deleted file mode 100644 index b398fdc1d813..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test16.cpp -) - -add_executable(paltest_vswprintf_test16 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test16 coreclrpal) - -target_link_libraries(paltest_vswprintf_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.cpp index e0f0fea2a2bd..a8f7f8f1b160 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test16_paltest_vswprintf_test16, "c_runtime/vswprintf/test16/paltest_vswprintf_test16") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/testinfo.dat deleted file mode 100644 index 2c2f716d0e9c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test16/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test16 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with decimal point format doubles. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/CMakeLists.txt deleted file mode 100644 index 8b505dee0b6a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test17.cpp -) - -add_executable(paltest_vswprintf_test17 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test17 coreclrpal) - -target_link_libraries(paltest_vswprintf_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.cpp index 635fb2b00eee..08ec3fe1b81b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test17_paltest_vswprintf_test17, "c_runtime/vswprintf/test17/paltest_vswprintf_test17") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/testinfo.dat deleted file mode 100644 index a99a9d150e80..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test17/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test17 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with compact format doubles (lowercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/CMakeLists.txt deleted file mode 100644 index 0fc1f0dad4d6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test18.cpp -) - -add_executable(paltest_vswprintf_test18 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test18 coreclrpal) - -target_link_libraries(paltest_vswprintf_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.cpp index 4318a5f4e67e..cf59b137da15 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test18_paltest_vswprintf_test18, "c_runtime/vswprintf/test18/paltest_vswprintf_test18") { double val = 2560.001; double neg = -2560.001; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/testinfo.dat deleted file mode 100644 index b022db560eed..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test18/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test18 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with compact format doubles (uppercase). -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/CMakeLists.txt deleted file mode 100644 index b974935de7f8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test19.cpp -) - -add_executable(paltest_vswprintf_test19 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test19 coreclrpal) - -target_link_libraries(paltest_vswprintf_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp index 70f586f77b5d..482c442f03a2 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp @@ -18,7 +18,7 @@ #define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e) -void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param, +void DoArgumentPrecTest_vswprintf(WCHAR *formatstr, int precision, void *param, WCHAR *paramstr, WCHAR *checkstr1, WCHAR *checkstr2) { WCHAR buf[256]; @@ -37,7 +37,7 @@ void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param, convertC(buf)); } } -void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param, +void DoArgumentPrecDoubleTest_vswprintf(WCHAR *formatstr, int precision, double param, WCHAR *checkstr1, WCHAR *checkstr2) { WCHAR buf[256]; @@ -60,75 +60,75 @@ void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param, * Uses memcmp & wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test19_paltest_vswprintf_test19, "c_runtime/vswprintf/test19/paltest_vswprintf_test19") { if (PAL_Initialize(argc, argv) != 0) return(FAIL); - DoArgumentPrecTest(convert("%.*s"), 2, (void*)convert("bar"), convert("bar"), + DoArgumentPrecTest_vswprintf(convert("%.*s"), 2, (void*)convert("bar"), convert("bar"), convert("ba"), convert("ba")); - DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', convert("a"), + DoArgumentPrecTest_vswprintf(convert("%.*c"), 0, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', convert("a"), + DoArgumentPrecTest_vswprintf(convert("%.*c"), 4, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', convert("a"), + DoArgumentPrecTest_vswprintf(convert("%.*C"), 0, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', convert("a"), + DoArgumentPrecTest_vswprintf(convert("%.*C"), 4, (void*)'a', convert("a"), convert("a"), convert("a")); - DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, convert("42"), + DoArgumentPrecTest_vswprintf(convert("%.*d"), 1, (void*)42, convert("42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, convert("42"), + DoArgumentPrecTest_vswprintf(convert("%.*d"), 3, (void*)42, convert("42"), convert("042"), convert("042")); - DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, convert("42"), + DoArgumentPrecTest_vswprintf(convert("%.*i"), 1, (void*)42, convert("42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, convert("42"), + DoArgumentPrecTest_vswprintf(convert("%.*i"), 3, (void*)42, convert("42"), convert("042"), convert("042")); - DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, convert("42"), + DoArgumentPrecTest_vswprintf(convert("%.*o"), 1, (void*)42, convert("42"), convert("52"), convert("52")); - DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, convert("42"), + DoArgumentPrecTest_vswprintf(convert("%.*o"), 3, (void*)42, convert("42"), convert("052"), convert("052")); - DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, convert("42"), + DoArgumentPrecTest_vswprintf(convert("%.*u"), 1, (void*)42, convert("42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, convert("42"), + DoArgumentPrecTest_vswprintf(convert("%.*u"), 3, (void*)42, convert("42"), convert("042"), convert("042")); - DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vswprintf(convert("%.*x"), 1, (void*)0x42, convert("0x42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vswprintf(convert("%.*x"), 3, (void*)0x42, convert("0x42"), convert("042"), convert("042")); - DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vswprintf(convert("%.*X"), 1, (void*)0x42, convert("0x42"), convert("42"), convert("42")); - DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, convert("0x42"), + DoArgumentPrecTest_vswprintf(convert("%.*X"), 3, (void*)0x42, convert("0x42"), convert("042"), convert("042")); - DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*e"), 1, 2.01, convert("2.0e+000"), convert("2.0e+00")); - DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*e"), 3, 2.01, convert("2.010e+000"), convert("2.010e+00")); - DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*E"), 1, 2.01, convert("2.0E+000"), convert("2.0E+00")); - DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*E"), 3, 2.01, convert("2.010E+000"), convert("2.010E+00")); - DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*f"), 1, 2.01, convert("2.0"), convert("2.0")); - DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*f"), 3, 2.01, convert("2.010"), convert("2.010")); - DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*g"), 1, 256.01, convert("3e+002"), convert("3e+02")); - DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*g"), 3, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*g"), 4, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*g"), 6, 256.01, convert("256.01"), convert("256.01")); - DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*G"), 1, 256.01, convert("3E+002"), convert("3E+02")); - DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*G"), 3, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*G"), 4, 256.01, convert("256"), convert("256")); - DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"), + DoArgumentPrecDoubleTest_vswprintf(convert("%.*G"), 6, 256.01, convert("256.01"), convert("256.01")); PAL_Terminate(); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/testinfo.dat deleted file mode 100644 index 37ad02278b32..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test19/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test19 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with argument specified precision. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/CMakeLists.txt deleted file mode 100644 index 78550ca27b4d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_vswprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test2 coreclrpal) - -target_link_libraries(paltest_vswprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.cpp index 215c26b679f0..4b1b09619e5d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.cpp @@ -17,7 +17,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test2_paltest_vswprintf_test2, "c_runtime/vswprintf/test2/paltest_vswprintf_test2") { if (PAL_Initialize(argc, argv) != 0) return(FAIL); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/testinfo.dat deleted file mode 100644 index f10b42f6fbf9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with strings. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/CMakeLists.txt deleted file mode 100644 index 95247ceaea14..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_vswprintf_test3 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test3 coreclrpal) - -target_link_libraries(paltest_vswprintf_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.cpp index e361074ec26f..2644c4a96be6 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.cpp @@ -17,7 +17,7 @@ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test3_paltest_vswprintf_test3, "c_runtime/vswprintf/test3/paltest_vswprintf_test3") { if (PAL_Initialize(argc, argv) != 0) return(FAIL); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/testinfo.dat deleted file mode 100644 index 31fbe7cb21b5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with wide strings. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/CMakeLists.txt deleted file mode 100644 index dbaa6ac69ae2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_vswprintf_test4 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test4 coreclrpal) - -target_link_libraries(paltest_vswprintf_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp index aea717f105b7..8e72f735224a 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp @@ -50,7 +50,7 @@ static void DoI64DoubleTest(WCHAR *formatstr, INT64 value, WCHAR *valuestr, } } -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test4_paltest_vswprintf_test4, "c_runtime/vswprintf/test4/paltest_vswprintf_test4") { void *ptr = (void*) 0x123456; INT64 lptr = I64(0x1234567887654321); diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/testinfo.dat deleted file mode 100644 index f0a23f0f146f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with pointers. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/CMakeLists.txt deleted file mode 100644 index 40b3b50f0174..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_vswprintf_test6 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test6 coreclrpal) - -target_link_libraries(paltest_vswprintf_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.cpp index d9e47a156181..e6c3de0641bc 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test6_paltest_vswprintf_test6, "c_runtime/vswprintf/test6/paltest_vswprintf_test6") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/testinfo.dat deleted file mode 100644 index 2b7032408c29..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test6/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with characters. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/CMakeLists.txt deleted file mode 100644 index 96ef5052d844..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_vswprintf_test7 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test7 coreclrpal) - -target_link_libraries(paltest_vswprintf_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.cpp index 789e32983e3f..22f87093de34 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test7_paltest_vswprintf_test7, "c_runtime/vswprintf/test7/paltest_vswprintf_test7") { WCHAR wc = (WCHAR) 'c'; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/testinfo.dat deleted file mode 100644 index 71011f070f03..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test7/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with wide characters. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/CMakeLists.txt deleted file mode 100644 index 2fb6548b62b2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_vswprintf_test8 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test8 coreclrpal) - -target_link_libraries(paltest_vswprintf_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.cpp index a500b073b7ab..7ffcf2355e42 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test8_paltest_vswprintf_test8, "c_runtime/vswprintf/test8/paltest_vswprintf_test8") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/testinfo.dat deleted file mode 100644 index 0293f2dc0a48..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test8/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test8 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with decimal numbers. -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/CMakeLists.txt deleted file mode 100644 index ef38e3cceb55..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_vswprintf_test9 - ${SOURCES} -) - -add_dependencies(paltest_vswprintf_test9 coreclrpal) - -target_link_libraries(paltest_vswprintf_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.cpp index 07754e2f63f8..b965466afffb 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.cpp @@ -16,7 +16,7 @@ /* memcmp is used to verify the results, so this test is dependent on it. */ /* ditto with wcslen */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_vswprintf_test9_paltest_vswprintf_test9, "c_runtime/vswprintf/test9/paltest_vswprintf_test9") { int neg = -42; int pos = 42; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/testinfo.dat deleted file mode 100644 index a05265d7967b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/test9/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = vswprintf -Name = Positive Test for vswprintf -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests the PAL implementation of the vswprintf function. -= Tests vswprintf with integer numbers -= This test is modeled after _snwprintf. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h index ac72491695e8..c360c00db4e0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h @@ -14,7 +14,7 @@ #define __vswprintf_H__ /* These functions leaks memory a lot. C'est la vie. */ -int testvswp(char16_t* buf, size_t buffSize, const char16_t* format, ...) +inline int testvswp(char16_t* buf, size_t buffSize, const char16_t* format, ...) { int retVal = 0; va_list arglist; @@ -26,7 +26,7 @@ int testvswp(char16_t* buf, size_t buffSize, const char16_t* format, ...) return( retVal); } -void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) +inline void DoWStrTest_vswprintf_s(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -40,8 +40,9 @@ void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoWStrTest DoWStrTest_vswprintf_s -void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) +inline void DoStrTest_vswprintf_s(const WCHAR *formatstr, char *param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -55,8 +56,9 @@ void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr) convertC(buf)); } } +#define DoStrTest DoStrTest_vswprintf_s -void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) +inline void DoCharTest_vswprintf_s(const WCHAR *formatstr, char param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -69,8 +71,9 @@ void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr) convertC(buf)); } } +#define DoCharTest DoCharTest_vswprintf_s -void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) +inline void DoWCharTest_vswprintf_s(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -83,8 +86,9 @@ void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) convertC(buf)); } } +#define DoWCharTest DoWCharTest_vswprintf_s -void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) +inline void DoNumTest_vswprintf_s(const WCHAR *formatstr, int value, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -96,8 +100,9 @@ void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr) convertC(checkstr), convertC(buf)); } } +#define DoNumTest DoNumTest_vswprintf_s -void DoI64NumTest(const WCHAR *formatstr, INT64 value, char *valuestr, const WCHAR *checkstr) +inline void DoI64NumTest_vswprintf_s(const WCHAR *formatstr, INT64 value, char *valuestr, const WCHAR *checkstr) { WCHAR buf[256] = { 0 }; @@ -109,7 +114,9 @@ void DoI64NumTest(const WCHAR *formatstr, INT64 value, char *valuestr, const WCH convertC(checkstr), convertC(buf)); } } -void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1, WCHAR +#define DoI64NumTest DoI64NumTest_vswprintf_s + +inline void DoDoubleTest_vswprintf_s(const WCHAR *formatstr, double value, const WCHAR *checkstr1, WCHAR *checkstr2) { WCHAR buf[256] = { 0 }; @@ -127,5 +134,6 @@ void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1, convertC(buf)); } } +#define DoDoubleTest DoDoubleTest_vswprintf_s #endif diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/CMakeLists.txt deleted file mode 100644 index 08cd49f05dce..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcscat_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcscat_test1 coreclrpal) - -target_link_libraries(paltest_wcscat_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp index c1f6f169f77e..da8f581554b5 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp @@ -20,7 +20,7 @@ * Notes: uses memcmp and the (pal) sprintf_s */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcscat_test1_paltest_wcscat_test1, "c_runtime/wcscat/test1/paltest_wcscat_test1") { WCHAR dest[80]; WCHAR test[] = {'f','o','o',' ','b','a','r',' ','b','a','z',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/testinfo.dat deleted file mode 100644 index 8f5cff0e9d67..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscat/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcscat -Name = Positive Test for wcscat -TYPE = DEFAULT -EXE1 = test1 -Description -= Test to that wcscat correctly concatanates wide strings, including placing -= null pointers diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/CMakeLists.txt deleted file mode 100644 index 1687e57b87b1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcschr_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcschr_test1 coreclrpal) - -target_link_libraries(paltest_wcschr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.cpp index eeecf331a104..02276da03a51 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcschr_test1_paltest_wcschr_test1, "c_runtime/wcschr/test1/paltest_wcschr_test1") { WCHAR str[] = {'f','o','o',' ','b','a','r',' ',0}; WCHAR c = (WCHAR)' '; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/testinfo.dat deleted file mode 100644 index 59e4d32dd313..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcschr/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcschr -Name = Positive Test for wcschr -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that wcschr correctly finds the first occurrence of a character in a -= string. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/CMakeLists.txt deleted file mode 100644 index a556133020a7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcscmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcscmp_test1 coreclrpal) - -target_link_libraries(paltest_wcscmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.cpp index 0b374518b05d..f7d2c12aa566 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcscmp_test1_paltest_wcscmp_test1, "c_runtime/wcscmp/test1/paltest_wcscmp_test1") { WCHAR str1[] = {'f','o','o',0}; WCHAR str2[] = {'f','o','o','x',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/testinfo.dat deleted file mode 100644 index 9d5c60a03521..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscmp/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcscmp -Name = Test #1 for wcscmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that wcscmp correctly compares two strings with case sensitivity. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/CMakeLists.txt deleted file mode 100644 index 8a004085eacb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcscpy_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcscpy_test1 coreclrpal) - -target_link_libraries(paltest_wcscpy_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp index a2b98c5b6d4a..2c0c9afa8749 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp @@ -17,7 +17,7 @@ * Notes: uses memcmp and sprintf_s. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcscpy_test1_paltest_wcscpy_test1, "c_runtime/wcscpy/test1/paltest_wcscpy_test1") { WCHAR str[] = {'f','o','o',0,'b','a','r',0}; WCHAR dest[80]; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/testinfo.dat deleted file mode 100644 index b989c1455691..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcscpy/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcscpy -Name = Positive Test for wcscpy -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that wcscpy correctly copies a null-terminated wide string. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/CMakeLists.txt deleted file mode 100644 index 474f226fcc2f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcslen_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcslen_test1 coreclrpal) - -target_link_libraries(paltest_wcslen_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.cpp index ca2047b3c2d2..df7613dcae2d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcslen_test1_paltest_wcslen_test1, "c_runtime/wcslen/test1/paltest_wcslen_test1") { WCHAR str1[] = {'f','o','o',' ',0}; WCHAR str2[] = {0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/testinfo.dat deleted file mode 100644 index baefcff664d7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcslen/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcslen -Name = Positive Test for wcslen -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that wcslen correctly returns the length (in wide characters, not byte) -= of a wide string diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/CMakeLists.txt deleted file mode 100644 index b730673d3859..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcsncmp_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcsncmp_test1 coreclrpal) - -target_link_libraries(paltest_wcsncmp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.cpp index 51ab8a371323..ff6a69e57f4f 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.cpp @@ -20,7 +20,7 @@ * Notes: uses wcslen. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcsncmp_test1_paltest_wcsncmp_test1, "c_runtime/wcsncmp/test1/paltest_wcsncmp_test1") { WCHAR str1[] = {'f','o','o',0}; WCHAR str2[] = {'f','o','o','x',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/testinfo.dat deleted file mode 100644 index 4ff561aee846..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcsncmp -Name = Positive Test for wcsncmp -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that wcsncmp case-sensitively compares wide strings, making sure that -= the count argument is handled correctly. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/CMakeLists.txt deleted file mode 100644 index 8c70fdffaa12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcsncpy_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcsncpy_test1 coreclrpal) - -target_link_libraries(paltest_wcsncpy_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.cpp index 85c531ff043f..1d514672bc37 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcsncpy_test1_paltest_wcsncpy_test1, "c_runtime/wcsncpy/test1/paltest_wcsncpy_test1") { WCHAR dest[80]; WCHAR result[] = {'f','o','o','b','a','r',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/testinfo.dat deleted file mode 100644 index 7bb0faaae94d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcsncpy -Name = Test #1 for wcsncpy -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests to see that wcsncpy correctly copies wide strings, including handling -= the count argument correctly (copying no more that count characters, not -= automatically adding a null, and padding if necessary). - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/CMakeLists.txt deleted file mode 100644 index d2f75eacb994..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcspbrk_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcspbrk_test1 coreclrpal) - -target_link_libraries(paltest_wcspbrk_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.cpp index 56773fce640f..780d737d5b9d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcspbrk_test1_paltest_wcspbrk_test1, "c_runtime/wcspbrk/test1/paltest_wcspbrk_test1") { WCHAR *string; WCHAR *key1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/testinfo.dat deleted file mode 100644 index 281570d87e78..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcspbrk -Name = Positive Test for wcspbrk -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that wcspbrk returns a pointer to the first element in the first -= string that matches a character in the second (or NULL). diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/CMakeLists.txt deleted file mode 100644 index 931dcc014836..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcsrchr_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcsrchr_test1 coreclrpal) - -target_link_libraries(paltest_wcsrchr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.cpp index fc28893ed0f6..70081453c9be 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.cpp @@ -5,8 +5,8 @@ ** ** Source: test1.c ** -** Purpose: -** Tests to see that wcsrchr correctly returns a pointer to the last occurence +** Purpose: +** Tests to see that wcsrchr correctly returns a pointer to the last occurrence ** of a character in a a string. ** ** @@ -16,13 +16,13 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcsrchr_test1_paltest_wcsrchr_test1, "c_runtime/wcsrchr/test1/paltest_wcsrchr_test1") { WCHAR str[] = {'f','o','o',' ','b','a','r',' ','b','a','z',0}; WCHAR c = (WCHAR)' '; WCHAR c2 = (WCHAR)'$'; WCHAR *ptr; - + if (PAL_Initialize(argc, argv)) { return FAIL; @@ -32,14 +32,14 @@ int __cdecl main(int argc, char *argv[]) ptr = wcsrchr(str, c); if (ptr != str + 7) { - Fail("ERROR: expected wcsrchr to return pointer to %p, got %p\n", + Fail("ERROR: expected wcsrchr to return pointer to %p, got %p\n", str + 7, ptr); } ptr = wcsrchr(str, c2); if (ptr != NULL) { - Fail("ERROR: expected wcsrchr to return pointer to %p, got %p\n", + Fail("ERROR: expected wcsrchr to return pointer to %p, got %p\n", NULL, ptr); } diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/testinfo.dat deleted file mode 100644 index 8ed25b99e003..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcsrchr -Name = Positive Test for wcsrchr -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests to see that wcsrchr correctly returns a pointer to the last occurence -= of a character in a a string. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/CMakeLists.txt deleted file mode 100644 index 2da56d9b7770..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcsstr_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcsstr_test1 coreclrpal) - -target_link_libraries(paltest_wcsstr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.cpp index ab41299982c8..73264f6d1279 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcsstr_test1_paltest_wcsstr_test1, "c_runtime/wcsstr/test1/paltest_wcsstr_test1") { WCHAR *string; WCHAR *key1; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/testinfo.dat deleted file mode 100644 index 3d3d5d1f90b4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcsstr/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcsstr -Name = Positive Test for wcsstr -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that wcsstr correctly find substrings in wide stings, including -= returning NULL when the substring can't be found. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/CMakeLists.txt deleted file mode 100644 index 1087e1139079..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcstod_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcstod_test1 coreclrpal) - -target_link_libraries(paltest_wcstod_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.cpp index d49c9038752e..b1c1b9557c31 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.cpp @@ -19,23 +19,23 @@ struct testCase int stopChar; }; -struct testCase testCases[] = +PALTEST(c_runtime_wcstod_test1_paltest_wcstod_test1, "c_runtime/wcstod/test1/paltest_wcstod_test1") { - {1234,"1234", 4}, - {-1234,"-1234", 5}, - {1234.44,"1234.44", 7}, - {1234e-5,"1234e-5", 7}, - {1234e+5,"1234e+5", 7}, - {1234E5,"1234E5", 6}, - {1234.657e-8, "1234.657e-8", 11}, - {0, "1e-800", 6}, - {0, "-1e-800", 7}, - {1234567e-8, " 1234567e-8 foo", 13}, - {0, " foo 32 bar", 0}, -}; + struct testCase testCases[] = + { + {1234,"1234", 4}, + {-1234,"-1234", 5}, + {1234.44,"1234.44", 7}, + {1234e-5,"1234e-5", 7}, + {1234e+5,"1234e+5", 7}, + {1234E5,"1234E5", 6}, + {1234.657e-8, "1234.657e-8", 11}, + {0, "1e-800", 6}, + {0, "-1e-800", 7}, + {1234567e-8, " 1234567e-8 foo", 13}, + {0, " foo 32 bar", 0}, + }; -int __cdecl main(int argc, char **argv) -{ WCHAR *wideStr; WCHAR *endptr; double result; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/testinfo.dat deleted file mode 100644 index 91eb1c62dd5d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstod -Name = Positive Test for wcstod -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests wcstod with a number of sample strings. - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/CMakeLists.txt deleted file mode 100644 index 76840320d274..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_wcstod_test2 - ${SOURCES} -) - -add_dependencies(paltest_wcstod_test2 coreclrpal) - -target_link_libraries(paltest_wcstod_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.cpp index 3bd972c1b2d3..8da0a902174e 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(c_runtime_wcstod_test2_paltest_wcstod_test2, "c_runtime/wcstod/test2/paltest_wcstod_test2") { /* Representation of positive infinty for a IEEE 64-bit double */ INT64 PosInifity = (INT64)(0x7ff00000) << 32; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/testinfo.dat deleted file mode 100644 index 1aa32d0b01e4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstod/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstod -Name = Positive Test for wcstod -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests wcstod with overflows - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/CMakeLists.txt deleted file mode 100644 index 5e30ed3f64d8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcstok_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcstok_test1 coreclrpal) - -target_link_libraries(paltest_wcstok_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.cpp index 725669c36d56..564466c2a4e7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.cpp @@ -15,7 +15,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcstok_test1_paltest_wcstok_test1, "c_runtime/wcstok/test1/paltest_wcstok_test1") { /* foo bar baz */ WCHAR str[] = {'f','o','o',' ','b','a','r',' ','b','a','z','\0'}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/testinfo.dat deleted file mode 100644 index f28611680755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstok/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstok -Name = wcstok test- tokenize a string and ensure the string takes correct form. -TYPE = DEFAULT -EXE1 = test1 -Description -= Search for a number of tokens within strings. Check that the return values -= are what is expect, and also that the strings match up with our expected -= results. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/CMakeLists.txt deleted file mode 100644 index 828a2878bf12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/CMakeLists.txt deleted file mode 100644 index 7157a2ae801c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wcstoul_test1 - ${SOURCES} -) - -add_dependencies(paltest_wcstoul_test1 coreclrpal) - -target_link_libraries(paltest_wcstoul_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.cpp index 190e05e373a7..e985ca2103af 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.cpp @@ -17,7 +17,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcstoul_test1_paltest_wcstoul_test1, "c_runtime/wcstoul/test1/paltest_wcstoul_test1") { WCHAR teststr[] = {'1','2','3','4','5',0}; WCHAR *end; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/testinfo.dat deleted file mode 100644 index 1912c4332fba..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstoul -Name = Positive Test for wcstoul -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests wcstoul with base 4 and a string that includes some invalid characters. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/CMakeLists.txt deleted file mode 100644 index 30442349fbc3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_wcstoul_test2 - ${SOURCES} -) - -add_dependencies(paltest_wcstoul_test2 coreclrpal) - -target_link_libraries(paltest_wcstoul_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.cpp index 5464ee32869f..c1b74ca01c77 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.cpp @@ -17,7 +17,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcstoul_test2_paltest_wcstoul_test2, "c_runtime/wcstoul/test2/paltest_wcstoul_test2") { WCHAR teststr[] = {'1','2','3','4','5',0}; WCHAR *end; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/testinfo.dat deleted file mode 100644 index 699cc4090a3e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstoul -Name = Positive Test for wcstoul -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests wcstoul with base 10 and a completely valid string. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/CMakeLists.txt deleted file mode 100644 index 30de2310e937..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_wcstoul_test3 - ${SOURCES} -) - -add_dependencies(paltest_wcstoul_test3 coreclrpal) - -target_link_libraries(paltest_wcstoul_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.cpp index 8e8916021d4e..5c09075ce9f7 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.cpp @@ -17,7 +17,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcstoul_test3_paltest_wcstoul_test3, "c_runtime/wcstoul/test3/paltest_wcstoul_test3") { WCHAR str[] = {'Z',0}; WCHAR *end; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/testinfo.dat deleted file mode 100644 index c4671d63a09a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstoul -Name = Positive Test for wcstoul -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests wcstoul with a completely invalid string (base 10). diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/CMakeLists.txt deleted file mode 100644 index 1be7efdc815e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_wcstoul_test4 - ${SOURCES} -) - -add_dependencies(paltest_wcstoul_test4 coreclrpal) - -target_link_libraries(paltest_wcstoul_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.cpp index 5aa380669ccd..32055fb8bb5b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.cpp @@ -16,7 +16,7 @@ * this is not currently tested. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcstoul_test4_paltest_wcstoul_test4, "c_runtime/wcstoul/test4/paltest_wcstoul_test4") { WCHAR maxstr[] = {'4','2','9','4','9','6','7','2','9','5',0}; ULONG max = 4294967295ul; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/testinfo.dat deleted file mode 100644 index 2ae5a8b03f2f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstoul -Name = Positive Test for wcstoul -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests wcstoul with base 10 and the highest possible value. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/CMakeLists.txt deleted file mode 100644 index fde5be4a19c3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_wcstoul_test5 - ${SOURCES} -) - -add_dependencies(paltest_wcstoul_test5 coreclrpal) - -target_link_libraries(paltest_wcstoul_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.cpp index 0f9ce043c94b..2ffab4b9de05 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.cpp @@ -17,7 +17,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcstoul_test5_paltest_wcstoul_test5, "c_runtime/wcstoul/test5/paltest_wcstoul_test5") { WCHAR overstr[] = {'4','2','9','4','9','6','7','2','9','6',0}; WCHAR understr[] = {'-','1',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/testinfo.dat deleted file mode 100644 index 8f69b2ae9475..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test5/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstoul -Name = Positive Test for wcstoul -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests wcstoul (base 10) with underflowing and overflowing. -= Chesks that errno gets set to ERANGE. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/CMakeLists.txt deleted file mode 100644 index 199744cc3da1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_wcstoul_test6 - ${SOURCES} -) - -add_dependencies(paltest_wcstoul_test6 coreclrpal) - -target_link_libraries(paltest_wcstoul_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.cpp index 716dfef7cbdc..8ffd4c0b314d 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.cpp @@ -19,7 +19,7 @@ */ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wcstoul_test6_paltest_wcstoul_test6, "c_runtime/wcstoul/test6/paltest_wcstoul_test6") { WCHAR test1[] = {'0','x','1','2', 0}; WCHAR test2[] = {'0','1','2',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/testinfo.dat deleted file mode 100644 index 255a584c9016..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wcstoul/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wcstoul -Name = Positive Test for wcstoul -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests wcstoul with hex and octal strings, with different bases. diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/CMakeLists.txt deleted file mode 100644 index 63b44d817f86..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_wprintf_test1 - ${SOURCES} -) - -add_dependencies(paltest_wprintf_test1 coreclrpal) - -target_link_libraries(paltest_wprintf_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.cpp index 22b459eabf68..75717a5e6236 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.cpp @@ -16,7 +16,7 @@ #include #include "../wprintf.h" -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wprintf_test1_paltest_wprintf_test1, "c_runtime/wprintf/test1/paltest_wprintf_test1") { char checkstr[] = "hello world"; WCHAR *wcheckstr; diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/testinfo.dat deleted file mode 100644 index 5f807eee705e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wprintf -Name = Positive Test for wprintf -TYPE = DEFAULT -EXE1 = test1 -Description -= General test to see if wprintf works correctly diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/CMakeLists.txt deleted file mode 100644 index bd529b79977e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_wprintf_test2 - ${SOURCES} -) - -add_dependencies(paltest_wprintf_test2 coreclrpal) - -target_link_libraries(paltest_wprintf_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.cpp index d1943902692e..9f9dd0e6dc4b 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.cpp @@ -17,7 +17,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(c_runtime_wprintf_test2_paltest_wprintf_test2, "c_runtime/wprintf/test2/paltest_wprintf_test2") { if (PAL_Initialize(argc, argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/testinfo.dat deleted file mode 100644 index 7bbfe64e6cda..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = C Runtime -Function = wprintf -Name = Positive Test for wprintf -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests wprintf with strings diff --git a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h index 440d62c5a3e8..aa7889e4fae0 100644 --- a/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h +++ b/src/coreclr/src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h @@ -13,7 +13,7 @@ #ifndef __wprintf_H__ #define __wprintf_H__ -void DoStrTest(const WCHAR *formatstr, const WCHAR *param, const WCHAR *checkstr) +inline void DoStrTest_wprintf(const WCHAR *formatstr, const WCHAR *param, const WCHAR *checkstr) { int ret; @@ -24,9 +24,9 @@ void DoStrTest(const WCHAR *formatstr, const WCHAR *param, const WCHAR *checkstr wcslen(checkstr), ret); } } +#define DoStrTest DoStrTest_wprintf - -void DoPointerTest(const WCHAR *formatstr, void* param, WCHAR* paramstr, +inline void DoPointerTest_wprintf(const WCHAR *formatstr, void* param, WCHAR* paramstr, const WCHAR *checkstr1) { int ret; @@ -38,8 +38,9 @@ void DoPointerTest(const WCHAR *formatstr, void* param, WCHAR* paramstr, wcslen(checkstr1), ret); } } +#define DoPointerTest DoPointerTest_wprintf -void DoCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) +inline void DoCountTest_wprintf(const WCHAR *formatstr, int param, const WCHAR *checkstr) { int ret; int n = -1; @@ -57,8 +58,9 @@ void DoCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) wcslen(checkstr), ret); } } +#define DoCountTest DoCountTest_wprintf -void DoShortCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) +inline void DoShortCountTest_wprintf(const WCHAR *formatstr, int param, const WCHAR *checkstr) { int ret; short int n = -1; @@ -76,9 +78,9 @@ void DoShortCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) wcslen(checkstr), ret); } } +#define DoShortCountTest DoShortCountTest_wprintf - -void DoCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) +inline void DoCharTest_wprintf(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) { int ret; @@ -89,8 +91,9 @@ void DoCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) wcslen(checkstr), ret); } } +#define DoCharTest DoCharTest_wprintf -void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) +inline void DoWCharTest_wprintf(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) { int ret; @@ -101,8 +104,9 @@ void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr) wcslen(checkstr), ret); } } +#define DoWCharTest DoWCharTest_wprintf -void DoNumTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) +inline void DoNumTest_wprintf(const WCHAR *formatstr, int param, const WCHAR *checkstr) { int ret; @@ -113,8 +117,9 @@ void DoNumTest(const WCHAR *formatstr, int param, const WCHAR *checkstr) wcslen(checkstr), ret); } } +#define DoNumTest DoNumTest_wprintf -void DoI64Test(const WCHAR *formatstr, INT64 param, const WCHAR *valuestr, +inline void DoI64Test_wprintf(const WCHAR *formatstr, INT64 param, const WCHAR *valuestr, const WCHAR *checkstr1) { int ret; @@ -126,8 +131,9 @@ void DoI64Test(const WCHAR *formatstr, INT64 param, const WCHAR *valuestr, wcslen(checkstr1), ret); } } +#define DoI64Test DoI64Test_wprintf -void DoDoubleTest(const WCHAR *formatstr, double param, +inline void DoDoubleTest_wprintf(const WCHAR *formatstr, double param, const WCHAR *checkstr1, const WCHAR *checkstr2) { int ret; @@ -139,8 +145,9 @@ void DoDoubleTest(const WCHAR *formatstr, double param, wcslen(checkstr1), wcslen(checkstr2), ret); } } +#define DoDoubleTest DoDoubleTest_wprintf -void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, +inline void DoArgumentPrecTest_wprintf(const WCHAR *formatstr, int precision, void *param, WCHAR *paramstr, const WCHAR *checkstr1, const WCHAR *checkstr2) { int ret; @@ -152,8 +159,9 @@ void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param, wcslen(checkstr1), wcslen(checkstr2), ret); } } +#define DoArgumentPrecTest DoArgumentPrecTest_wprintf -void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double param, +inline void DoArgumentPrecDoubleTest_wprintf(const WCHAR *formatstr, int precision, double param, const WCHAR *checkstr1, const WCHAR *checkstr2) { int ret; @@ -165,6 +173,7 @@ void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double para wcslen(checkstr1), wcslen(checkstr2), ret); } } +#define DoArgumentPrecDoubleTest DoArgumentPrecDoubleTest_wprintf #endif diff --git a/src/coreclr/src/pal/tests/palsuite/common/ResultBuffer.cpp b/src/coreclr/src/pal/tests/palsuite/common/ResultBuffer.cpp deleted file mode 100644 index 4119399b3618..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/common/ResultBuffer.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -//#include "stdafx.h" -#include "resultbuffer.h" -// -//#using -// -//using namespace System; - - -ResultBuffer:: ResultBuffer(int ThreadCount, int ThreadLogSize) - { - // Declare an internal status variable - int Status=0; - - // Update the maximum thread count - MaxThreadCount = ThreadCount; - - // Allocate the memory buffer based on the passed in thread and process counts - // and the specified size of the thread specific buffer - buffer = NULL; - buffer = (char*)malloc(ThreadCount*ThreadLogSize); - // Check to see if the buffer memory was allocated - if (buffer == NULL) - Status = -1; - // Initialize the buffer to 0 to prevent bogus data - memset(buffer,0,ThreadCount*ThreadLogSize); - - // The ThreadOffset is equal to the total number of bytes that will be stored per thread - ThreadOffset = ThreadLogSize; - - } - - - int ResultBuffer::LogResult(int Thread, char* Data) - { - // Declare an internal status flad - int status = 0; - - // Declare an object to store the offset address into the buffer - int Offset; - - // Check to make sure the Thread index is not out of range - if(Thread > MaxThreadCount) - { - Trace("Thread index is out of range, Value of Thread[%d], Value of MaxThreadCount[%d]\n", Thread, MaxThreadCount); - status = -1; - return(status); - } - - // Caculate the offset into the shared buffer based on the process and thread indices - Offset = (Thread)*ThreadOffset; - - // Write the passed in data to the reserved buffer - memcpy(buffer+Offset,Data,ThreadOffset); - - return(status); - } - - - char* ResultBuffer::getResultBuffer(int threadId) - { - - return (buffer + threadId*ThreadOffset); - - } - diff --git a/src/coreclr/src/pal/tests/palsuite/common/ResultBuffer.h b/src/coreclr/src/pal/tests/palsuite/common/ResultBuffer.h deleted file mode 100644 index 0eb80f9e06bf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/common/ResultBuffer.h +++ /dev/null @@ -1,42 +0,0 @@ -// 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 -#ifndef _RESULT_BUFFER_H_ -#define _RESULT_BUFFER_H_ - -#include - -struct ResultData -{ - int value; - int size; -// ResultData* NextResult; -}; - - class ResultBuffer -{ - // Declare a pointer to a memory buffer to store the logged results - char* buffer; - // Declare an object to store the maximum Thread count - int MaxThreadCount; - // Declare and internal data object to store the calculated offset between adjacent threads data sets - int ThreadOffset; - - // Declare a linked list object to store the parameter values -public: - - // Declare a constructor for the single process case - ResultBuffer(int ThreadCount, int ThreadLogSize); - // Declare a method to log data for the single process instance - int LogResult(int Thread, char* Data); - - char* getResultBuffer(int threadId); -}; - -#include "resultbuffer.cpp" -#endif // _RESULT_BUFFER_H_ - - diff --git a/src/coreclr/src/pal/tests/palsuite/common/ResultTime.h b/src/coreclr/src/pal/tests/palsuite/common/ResultTime.h deleted file mode 100644 index 3d19d0f31681..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/common/ResultTime.h +++ /dev/null @@ -1,82 +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 _RESULT_TIME_H_ -#define _RESULT_TIME_H_ - -#include - -#define DWORD_MAX ((DWORD) 0xFFFFFFFF) -const char *szDotNetInstallEnvVar = "DOTNET_INSTALL"; -const char *szQASupportDirEnvVar = "QA_SUPPORT_DIR"; - -#define SEPERATOR "/" -char *getBuildNumber() -{ - char *szBuildFileName = "buildinfo.txt"; - char *pDirectoryName = NULL; - char szBuildFileLoc[256]; - - char szTemp[100]; - // buildinfo.txt contains information in key/value pair - char szTempKey[100]; - char *szTempValue; - FILE *fp; - - szTempValue = (char *) malloc (sizeof(char) *100); - if (szTempValue == NULL) - { - Fail("ERROR: Couldn't allocate enough memory to potentially store build number\n"); - } - - pDirectoryName = getenv(szQASupportDirEnvVar); - if (pDirectoryName == NULL) - { - Trace("WARNING: Coriolis Test Environment may not be setup correctly. Variable QA_SUPPORT_DIR not set\n"); - _snprintf(szTempValue, 99, "0000.00"); - return szTempValue; - } - - // To avoid buffer overruns for pDirectoryName - _snprintf(szBuildFileLoc, MAX_PATH, "%s/../1.0%s%s", pDirectoryName, SEPERATOR, szBuildFileName); - fp = fopen( szBuildFileLoc, "r"); - if( fp == NULL) - { - Trace("WARNING: Couldn't open szBuildFileLoc [%s]\n", szBuildFileLoc); - _snprintf(szTempValue, 99, "0000.00"); - return szTempValue; - } - - while( fgets( szTemp, 100, fp ) != NULL) - { - sscanf(szTemp, "%s %s\n", szTempKey, szTempValue); - if(strcmp(szTempKey, "Build-Number:") == 0) - { - fclose(fp); - return szTempValue; - } - } - - fclose(fp); - return szTempValue; - -} - -DWORD GetTimeDiff( DWORD dwStartTime) -{ - DWORD dwDiffTime = 0; - DWORD dwEndTime = GetTickCount(); - - if( dwEndTime < dwStartTime) - { - // To account for overflow, we add one - dwDiffTime = dwEndTime + (DWORD_MAX - dwStartTime) + 1; - } - else - { - dwDiffTime = dwEndTime - dwStartTime; - } - - return dwDiffTime; -} -#endif // _RESULT_TIME_H_ diff --git a/src/coreclr/src/pal/tests/palsuite/common/pal_stdclib.h b/src/coreclr/src/pal/tests/palsuite/common/pal_stdclib.h deleted file mode 100644 index a1bde4bdd3c7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/common/pal_stdclib.h +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: pal_stdlib.h -** -** Purpose: -** -** -**==========================================================================*/ - - -#ifndef __PAL_STDCLIB_H__ -#define __PAL_STDCLIB_H__ - -/* - * definitions & functions - */ - -#define EOF (-1) - -#endif // __PAL_STDCLIB_H__ diff --git a/src/coreclr/src/pal/tests/palsuite/common/palsuite.cpp b/src/coreclr/src/pal/tests/palsuite/common/palsuite.cpp new file mode 100644 index 000000000000..a3c2d7186441 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/common/palsuite.cpp @@ -0,0 +1,207 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================================ +** +** Source: palsuite.cpp +** +** Purpose: Define constants and implement functions that are useful to +** multiple function categories. +** +**==========================================================================*/ + + +#include "palsuite.h" + +const char* szTextFile = "text.txt"; + +HANDLE hToken[NUM_TOKENS]; +CRITICAL_SECTION CriticalSection; + +WCHAR* convert(const char * aString) +{ + int size; + WCHAR* wideBuffer; + + size = MultiByteToWideChar(CP_ACP,0,aString,-1,NULL,0); + wideBuffer = (WCHAR*) malloc(size*sizeof(WCHAR)); + if (wideBuffer == NULL) + { + Fail("ERROR: Unable to allocate memory!\n"); + } + MultiByteToWideChar(CP_ACP,0,aString,-1,wideBuffer,size); + return wideBuffer; +} + +char* convertC(const WCHAR * wString) +{ + int size; + char * MultiBuffer = NULL; + + size = WideCharToMultiByte(CP_ACP,0,wString,-1,MultiBuffer,0,NULL,NULL); + MultiBuffer = (char*) malloc(size); + if (MultiBuffer == NULL) + { + Fail("ERROR: Unable to allocate memory!\n"); + } + WideCharToMultiByte(CP_ACP,0,wString,-1,MultiBuffer,size,NULL,NULL); + return MultiBuffer; +} + +UINT64 GetHighPrecisionTimeStamp(LARGE_INTEGER performanceFrequency) +{ + LARGE_INTEGER ts; + if (!QueryPerformanceCounter(&ts)) + { + Fail("ERROR: Unable to query performance counter!\n"); + } + + return ts.QuadPart / (performanceFrequency.QuadPart / 1000); +} + +static const char* rgchPathDelim = "\\"; + + +int +mkAbsoluteFilename( LPSTR dirName, + DWORD dwDirLength, + LPCSTR fileName, + DWORD dwFileLength, + LPSTR absPathName ) +{ + DWORD sizeDN, sizeFN, sizeAPN; + + sizeDN = strlen( dirName ); + sizeFN = strlen( fileName ); + sizeAPN = (sizeDN + 1 + sizeFN + 1); + + /* ensure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ + if( sizeAPN > _MAX_PATH ) + { + return ( 0 ); + } + + strncpy( absPathName, dirName, dwDirLength +1 ); + strncpy( absPathName, rgchPathDelim, 2 ); + strncpy( absPathName, fileName, dwFileLength +1 ); + + return (sizeAPN); + +} + + +BOOL CleanupHelper (HANDLE *hArray, DWORD dwIndex) +{ + BOOL bCHRet; + + bCHRet = CloseHandle(hArray[dwIndex]); + if (!bCHRet) + { + Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " + "clean up.\nGetLastError returned '%u'.\n", hArray[dwIndex], + GetLastError()); + } + + return (bCHRet); +} + +BOOL Cleanup(HANDLE *hArray, DWORD dwIndex) +{ + BOOL bCRet; + BOOL bCHRet = 0; + + while (--dwIndex > 0) + { + bCHRet = CleanupHelper(&hArray[0], dwIndex); + } + + bCRet = CloseHandle(hArray[0]); + if (!bCRet) + { + Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " + "clean up.\nGetLastError returned '%u'.\n", hArray[dwIndex], + GetLastError()); + } + + return (bCRet&&bCHRet); +} + +/* + * Take two wide strings representing file and directory names + * (dirName, fileName), join the strings with the appropriate path + * delimiter and populate a wide character buffer (absPathName) with + * the resulting string. + * + * Returns: The number of wide characters in the resulting string. + * 0 is returned on Error. + */ +int +mkAbsoluteFilenameW ( + LPWSTR dirName, + DWORD dwDirLength, + LPCWSTR fileName, + DWORD dwFileLength, + LPWSTR absPathName ) +{ + const WCHAR szPathDelimW[] = {'\\','\0'}; + + DWORD sizeDN, sizeFN, sizeAPN; + + sizeDN = wcslen( dirName ); + sizeFN = wcslen( fileName ); + sizeAPN = (sizeDN + 1 + sizeFN + 1); + + /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ + if ( sizeAPN > _MAX_PATH ) + { + return ( 0 ); + } + + wcsncpy(absPathName, dirName, dwDirLength +1); + wcsncpy(absPathName, szPathDelimW, 2); + wcsncpy(absPathName, fileName, dwFileLength +1); + + return (sizeAPN); + +} + +/* + * Take two wide strings representing file and directory names + * (dirName, fileName), join the strings with the appropriate path + * delimiter and populate a wide character buffer (absPathName) with + * the resulting string. + * + * Returns: The number of wide characters in the resulting string. + * 0 is returned on Error. + */ +int +mkAbsoluteFilenameA ( + LPSTR dirName, + DWORD dwDirLength, + LPCSTR fileName, + DWORD dwFileLength, + LPSTR absPathName ) +{ + const char *szPathDelimA = "\\"; + + DWORD sizeDN; + DWORD sizeFN; + DWORD sizeAPN; + + sizeDN = strlen( dirName ); + sizeFN = strlen( fileName ); + sizeAPN = (sizeDN + 1 + sizeFN + 1); + + /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ + if ( sizeAPN > _MAX_PATH ) + { + return ( 0 ); + } + + strncpy(absPathName, dirName, dwDirLength +1); + strcat(absPathName, szPathDelimA); + strcat(absPathName, fileName); + + return (sizeAPN); + +} diff --git a/src/coreclr/src/pal/tests/palsuite/common/palsuite.h b/src/coreclr/src/pal/tests/palsuite/common/palsuite.h index 34bf3a5fa1a4..d5e5a921ef14 100644 --- a/src/coreclr/src/pal/tests/palsuite/common/palsuite.h +++ b/src/coreclr/src/pal/tests/palsuite/common/palsuite.h @@ -24,14 +24,18 @@ typedef unsigned short char16_t; #include #include +#define PALTEST(testfunc, testname) \ + int __cdecl testfunc(int argc, char* argv[]); \ + static PALTest testfunc##_lookup(testfunc, testname); \ + int __cdecl testfunc(int argc, char* argv[]) \ + enum { PASS = 0, FAIL = 1 }; - -void Trace(const char *format, ...) +inline void Trace(const char *format, ...) { va_list arglist; @@ -42,7 +46,7 @@ void Trace(const char *format, ...) va_end(arglist); } -void Fail(const char *format, ...) +inline void Fail(const char *format, ...) { va_list arglist; @@ -57,6 +61,23 @@ void Fail(const char *format, ...) PAL_TerminateEx(FAIL); } +typedef int __cdecl(*PALTestEntrypoint)(int argc, char*[]); + +struct PALTest +{ + static PALTest* s_tests; + PALTest *_next; + PALTestEntrypoint _entrypoint; + const char *_name; + PALTest(PALTestEntrypoint entrypoint, const char *entrypointName) + { + _entrypoint = entrypoint; + _name = entrypointName; + _next = s_tests; + s_tests = this; + } +}; + #ifdef PAL_PERF int __cdecl Test_Main(int argc, char **argv); @@ -138,46 +159,65 @@ inline ULONG VAL32(ULONG x) #define _countof(_array) (sizeof(_array)/sizeof(_array[0])) -WCHAR* convert(const char * aString) -{ - int size; - WCHAR* wideBuffer; - - size = MultiByteToWideChar(CP_ACP,0,aString,-1,NULL,0); - wideBuffer = (WCHAR*) malloc(size*sizeof(WCHAR)); - if (wideBuffer == NULL) - { - Fail("ERROR: Unable to allocate memory!\n"); - } - MultiByteToWideChar(CP_ACP,0,aString,-1,wideBuffer,size); - return wideBuffer; -} - -char* convertC(const WCHAR * wString) -{ - int size; - char * MultiBuffer = NULL; - - size = WideCharToMultiByte(CP_ACP,0,wString,-1,MultiBuffer,0,NULL,NULL); - MultiBuffer = (char*) malloc(size); - if (MultiBuffer == NULL) - { - Fail("ERROR: Unable to allocate memory!\n"); - } - WideCharToMultiByte(CP_ACP,0,wString,-1,MultiBuffer,size,NULL,NULL); - return MultiBuffer; -} - -UINT64 GetHighPrecisionTimeStamp(LARGE_INTEGER performanceFrequency) -{ - LARGE_INTEGER ts; - if (!QueryPerformanceCounter(&ts)) - { - Fail("ERROR: Unable to query performance counter!\n"); - } - - return ts.QuadPart / (performanceFrequency.QuadPart / 1000); -} +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, + LPCSTR fileName, + DWORD dwFileLength, + LPSTR absPathName ); + +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 + +extern HANDLE hToken[NUM_TOKENS]; +extern CRITICAL_SECTION CriticalSection; + +/* + * Take two wide strings representing file and directory names + * (dirName, fileName), join the strings with the appropriate path + * delimiter and populate a wide character buffer (absPathName) with + * the resulting string. + * + * Returns: The number of wide characters in the resulting string. + * 0 is returned on Error. + */ +int +mkAbsoluteFilenameW ( + LPWSTR dirName, + DWORD dwDirLength, + LPCWSTR fileName, + DWORD dwFileLength, + LPWSTR absPathName ); + +/* + * Take two wide strings representing file and directory names + * (dirName, fileName), join the strings with the appropriate path + * delimiter and populate a wide character buffer (absPathName) with + * the resulting string. + * + * Returns: The number of wide characters in the resulting string. + * 0 is returned on Error. + */ +int +mkAbsoluteFilenameA ( + LPSTR dirName, + DWORD dwDirLength, + LPCSTR fileName, + DWORD dwFileLength, + LPSTR absPathName ); #endif diff --git a/src/coreclr/src/pal/tests/palsuite/compilableTests.txt b/src/coreclr/src/pal/tests/palsuite/compilableTests.txt new file mode 100644 index 000000000000..40e1d573e572 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/compilableTests.txt @@ -0,0 +1,804 @@ +c_runtime/abs/test1/paltest_abs_test1 +c_runtime/acos/test1/paltest_acos_test1 +c_runtime/acosf/test1/paltest_acosf_test1 +c_runtime/acosh/test1/paltest_acosh_test1 +c_runtime/acoshf/test1/paltest_acoshf_test1 +c_runtime/asin/test1/paltest_asin_test1 +c_runtime/asinf/test1/paltest_asinf_test1 +c_runtime/asinh/test1/paltest_asinh_test1 +c_runtime/asinhf/test1/paltest_asinhf_test1 +c_runtime/atan/test1/paltest_atan_test1 +c_runtime/atan2/test1/paltest_atan2_test1 +c_runtime/atan2f/test1/paltest_atan2f_test1 +c_runtime/atanf/test1/paltest_atanf_test1 +c_runtime/atanh/test1/paltest_atanh_test1 +c_runtime/atanhf/test1/paltest_atanhf_test1 +c_runtime/atof/test1/paltest_atof_test1 +c_runtime/atoi/test1/paltest_atoi_test1 +c_runtime/bsearch/test1/paltest_bsearch_test1 +c_runtime/bsearch/test2/paltest_bsearch_test2 +c_runtime/cbrt/test1/paltest_cbrt_test1 +c_runtime/cbrtf/test1/paltest_cbrtf_test1 +c_runtime/ceil/test1/paltest_ceil_test1 +c_runtime/ceilf/test1/paltest_ceilf_test1 +c_runtime/cos/test1/paltest_cos_test1 +c_runtime/cosf/test1/paltest_cosf_test1 +c_runtime/cosh/test1/paltest_cosh_test1 +c_runtime/coshf/test1/paltest_coshf_test1 +c_runtime/errno/test1/paltest_errno_test1 +c_runtime/errno/test2/paltest_errno_test2 +c_runtime/exit/test1/paltest_exit_test1 +c_runtime/exit/test2/paltest_exit_test2 +c_runtime/exp/test1/paltest_exp_test1 +c_runtime/expf/test1/paltest_expf_test1 +c_runtime/fabs/test1/paltest_fabs_test1 +c_runtime/fabsf/test1/paltest_fabsf_test1 +c_runtime/fclose/test1/paltest_fclose_test1 +c_runtime/fclose/test2/paltest_fclose_test2 +c_runtime/ferror/test1/paltest_ferror_test1 +c_runtime/ferror/test2/paltest_ferror_test2 +c_runtime/fflush/test1/paltest_fflush_test1 +c_runtime/fgets/test1/paltest_fgets_test1 +c_runtime/fgets/test2/paltest_fgets_test2 +c_runtime/fgets/test3/paltest_fgets_test3 +c_runtime/floor/test1/paltest_floor_test1 +c_runtime/floorf/test1/paltest_floorf_test1 +c_runtime/fma/test1/paltest_fma_test1 +c_runtime/fmaf/test1/paltest_fmaf_test1 +c_runtime/fmod/test1/paltest_fmod_test1 +c_runtime/fmodf/test1/paltest_fmodf_test1 +c_runtime/fopen/test1/paltest_fopen_test1 +c_runtime/fopen/test2/paltest_fopen_test2 +c_runtime/fopen/test3/paltest_fopen_test3 +c_runtime/fopen/test4/paltest_fopen_test4 +c_runtime/fopen/test5/paltest_fopen_test5 +c_runtime/fopen/test6/paltest_fopen_test6 +c_runtime/fopen/test7/paltest_fopen_test7 +c_runtime/fprintf/test1/paltest_fprintf_test1 +c_runtime/fprintf/test10/paltest_fprintf_test10 +c_runtime/fprintf/test11/paltest_fprintf_test11 +c_runtime/fprintf/test12/paltest_fprintf_test12 +c_runtime/fprintf/test13/paltest_fprintf_test13 +c_runtime/fprintf/test14/paltest_fprintf_test14 +c_runtime/fprintf/test15/paltest_fprintf_test15 +c_runtime/fprintf/test16/paltest_fprintf_test16 +c_runtime/fprintf/test17/paltest_fprintf_test17 +c_runtime/fprintf/test18/paltest_fprintf_test18 +c_runtime/fprintf/test19/paltest_fprintf_test19 +c_runtime/fprintf/test2/paltest_fprintf_test2 +c_runtime/fprintf/test3/paltest_fprintf_test3 +c_runtime/fprintf/test4/paltest_fprintf_test4 +c_runtime/fprintf/test5/paltest_fprintf_test5 +c_runtime/fprintf/test6/paltest_fprintf_test6 +c_runtime/fprintf/test7/paltest_fprintf_test7 +c_runtime/fprintf/test8/paltest_fprintf_test8 +c_runtime/fprintf/test9/paltest_fprintf_test9 +c_runtime/fputs/test1/paltest_fputs_test1 +c_runtime/fputs/test2/paltest_fputs_test2 +c_runtime/fread/test1/paltest_fread_test1 +c_runtime/fread/test2/paltest_fread_test2 +c_runtime/fread/test3/paltest_fread_test3 +c_runtime/free/test1/paltest_free_test1 +c_runtime/fseek/test1/paltest_fseek_test1 +c_runtime/ftell/test1/paltest_ftell_test1 +c_runtime/fwprintf/test1/paltest_fwprintf_test1 +c_runtime/fwprintf/test10/paltest_fwprintf_test10 +c_runtime/fwprintf/test11/paltest_fwprintf_test11 +c_runtime/fwprintf/test12/paltest_fwprintf_test12 +c_runtime/fwprintf/test13/paltest_fwprintf_test13 +c_runtime/fwprintf/test14/paltest_fwprintf_test14 +c_runtime/fwprintf/test15/paltest_fwprintf_test15 +c_runtime/fwprintf/test16/paltest_fwprintf_test16 +c_runtime/fwprintf/test17/paltest_fwprintf_test17 +c_runtime/fwprintf/test18/paltest_fwprintf_test18 +c_runtime/fwprintf/test19/paltest_fwprintf_test19 +c_runtime/fwprintf/test2/paltest_fwprintf_test2 +c_runtime/fwprintf/test3/paltest_fwprintf_test3 +c_runtime/fwprintf/test4/paltest_fwprintf_test4 +c_runtime/fwprintf/test5/paltest_fwprintf_test5 +c_runtime/fwprintf/test6/paltest_fwprintf_test6 +c_runtime/fwprintf/test7/paltest_fwprintf_test7 +c_runtime/fwprintf/test8/paltest_fwprintf_test8 +c_runtime/fwprintf/test9/paltest_fwprintf_test9 +c_runtime/fwrite/test1/paltest_fwrite_test1 +c_runtime/getenv/test1/paltest_getenv_test1 +c_runtime/getenv/test2/paltest_getenv_test2 +c_runtime/getenv/test3/paltest_getenv_test3 +c_runtime/ilogb/test1/paltest_ilogb_test1 +c_runtime/ilogbf/test1/paltest_ilogbf_test1 +c_runtime/isalnum/test1/paltest_isalnum_test1 +c_runtime/isalpha/test1/paltest_isalpha_test1 +c_runtime/isdigit/test1/paltest_isdigit_test1 +c_runtime/islower/test1/paltest_islower_test1 +c_runtime/isprint/test1/paltest_isprint_test1 +c_runtime/isprint/test2/paltest_isprint_test2 +c_runtime/isspace/test1/paltest_isspace_test1 +c_runtime/isupper/test1/paltest_isupper_test1 +c_runtime/iswdigit/test1/paltest_iswdigit_test1 +c_runtime/iswspace/test1/paltest_iswspace_test1 +c_runtime/iswupper/test1/paltest_iswupper_test1 +c_runtime/isxdigit/test1/paltest_isxdigit_test1 +c_runtime/llabs/test1/paltest_llabs_test1 +c_runtime/log/test1/paltest_log_test1 +c_runtime/log10/test1/paltest_log10_test1 +c_runtime/log10f/test1/paltest_log10f_test1 +c_runtime/log2/test1/paltest_log2_test1 +c_runtime/log2f/test1/paltest_log2f_test1 +c_runtime/logf/test1/paltest_logf_test1 +c_runtime/malloc/test1/paltest_malloc_test1 +c_runtime/malloc/test2/paltest_malloc_test2 +c_runtime/memchr/test1/paltest_memchr_test1 +c_runtime/memcmp/test1/paltest_memcmp_test1 +c_runtime/memcpy/test1/paltest_memcpy_test1 +c_runtime/memmove/test1/paltest_memmove_test1 +c_runtime/memset/test1/paltest_memset_test1 +c_runtime/modf/test1/paltest_modf_test1 +c_runtime/modff/test1/paltest_modff_test1 +c_runtime/pow/test1/paltest_pow_test1 +c_runtime/powf/test1/paltest_powf_test1 +c_runtime/printf/test1/paltest_printf_test1 +c_runtime/printf/test10/paltest_printf_test10 +c_runtime/printf/test11/paltest_printf_test11 +c_runtime/printf/test12/paltest_printf_test12 +c_runtime/printf/test13/paltest_printf_test13 +c_runtime/printf/test14/paltest_printf_test14 +c_runtime/printf/test15/paltest_printf_test15 +c_runtime/printf/test16/paltest_printf_test16 +c_runtime/printf/test17/paltest_printf_test17 +c_runtime/printf/test18/paltest_printf_test18 +c_runtime/printf/test19/paltest_printf_test19 +c_runtime/printf/test2/paltest_printf_test2 +c_runtime/printf/test3/paltest_printf_test3 +c_runtime/printf/test4/paltest_printf_test4 +c_runtime/printf/test5/paltest_printf_test5 +c_runtime/printf/test6/paltest_printf_test6 +c_runtime/printf/test7/paltest_printf_test7 +c_runtime/printf/test8/paltest_printf_test8 +c_runtime/printf/test9/paltest_printf_test9 +c_runtime/qsort/test1/paltest_qsort_test1 +c_runtime/qsort/test2/paltest_qsort_test2 +c_runtime/rand_srand/test1/paltest_rand_srand_test1 +c_runtime/realloc/test1/paltest_realloc_test1 +c_runtime/scalbn/test1/paltest_scalbn_test1 +c_runtime/scalbnf/test1/paltest_scalbnf_test1 +c_runtime/sin/test1/paltest_sin_test1 +c_runtime/sinf/test1/paltest_sinf_test1 +c_runtime/sinh/test1/paltest_sinh_test1 +c_runtime/sinhf/test1/paltest_sinhf_test1 +c_runtime/sprintf_s/test1/paltest_sprintf_test1 +c_runtime/sprintf_s/test10/paltest_sprintf_test10 +c_runtime/sprintf_s/test11/paltest_sprintf_test11 +c_runtime/sprintf_s/test12/paltest_sprintf_test12 +c_runtime/sprintf_s/test13/paltest_sprintf_test13 +c_runtime/sprintf_s/test14/paltest_sprintf_test14 +c_runtime/sprintf_s/test15/paltest_sprintf_test15 +c_runtime/sprintf_s/test16/paltest_sprintf_test16 +c_runtime/sprintf_s/test17/paltest_sprintf_test17 +c_runtime/sprintf_s/test18/paltest_sprintf_test18 +c_runtime/sprintf_s/test19/paltest_sprintf_test19 +c_runtime/sprintf_s/test2/paltest_sprintf_test2 +c_runtime/sprintf_s/test3/paltest_sprintf_test3 +c_runtime/sprintf_s/test4/paltest_sprintf_test4 +c_runtime/sprintf_s/test6/paltest_sprintf_test6 +c_runtime/sprintf_s/test7/paltest_sprintf_test7 +c_runtime/sprintf_s/test8/paltest_sprintf_test8 +c_runtime/sprintf_s/test9/paltest_sprintf_test9 +c_runtime/sqrt/test1/paltest_sqrt_test1 +c_runtime/sqrtf/test1/paltest_sqrtf_test1 +c_runtime/sscanf_s/test1/paltest_sscanf_test1 +c_runtime/sscanf_s/test10/paltest_sscanf_test10 +c_runtime/sscanf_s/test11/paltest_sscanf_test11 +c_runtime/sscanf_s/test12/paltest_sscanf_test12 +c_runtime/sscanf_s/test13/paltest_sscanf_test13 +c_runtime/sscanf_s/test14/paltest_sscanf_test14 +c_runtime/sscanf_s/test15/paltest_sscanf_test15 +c_runtime/sscanf_s/test16/paltest_sscanf_test16 +c_runtime/sscanf_s/test17/paltest_sscanf_test17 +c_runtime/sscanf_s/test2/paltest_sscanf_test2 +c_runtime/sscanf_s/test3/paltest_sscanf_test3 +c_runtime/sscanf_s/test4/paltest_sscanf_test4 +c_runtime/sscanf_s/test5/paltest_sscanf_test5 +c_runtime/sscanf_s/test6/paltest_sscanf_test6 +c_runtime/sscanf_s/test7/paltest_sscanf_test7 +c_runtime/sscanf_s/test8/paltest_sscanf_test8 +c_runtime/sscanf_s/test9/paltest_sscanf_test9 +c_runtime/strcat/test1/paltest_strcat_test1 +c_runtime/strchr/test1/paltest_strchr_test1 +c_runtime/strcmp/test1/paltest_strcmp_test1 +c_runtime/strcpy/test1/paltest_strcpy_test1 +c_runtime/strcspn/test1/paltest_strcspn_test1 +c_runtime/strlen/test1/paltest_strlen_test1 +c_runtime/strncat/test1/paltest_strncat_test1 +c_runtime/strncmp/test1/paltest_strncmp_test1 +c_runtime/strncpy/test1/paltest_strncpy_test1 +c_runtime/strpbrk/test1/paltest_strpbrk_test1 +c_runtime/strrchr/test1/paltest_strrchr_test1 +c_runtime/strspn/test1/paltest_strspn_test1 +c_runtime/strstr/test1/paltest_strstr_test1 +c_runtime/strtod/test1/paltest_strtod_test1 +c_runtime/strtod/test2/paltest_strtod_test2 +c_runtime/strtok/test1/paltest_strtok_test1 +c_runtime/strtoul/test1/paltest_strtoul_test1 +c_runtime/swprintf/test1/paltest_swprintf_test1 +c_runtime/swprintf/test10/paltest_swprintf_test10 +c_runtime/swprintf/test11/paltest_swprintf_test11 +c_runtime/swprintf/test12/paltest_swprintf_test12 +c_runtime/swprintf/test13/paltest_swprintf_test13 +c_runtime/swprintf/test14/paltest_swprintf_test14 +c_runtime/swprintf/test15/paltest_swprintf_test15 +c_runtime/swprintf/test16/paltest_swprintf_test16 +c_runtime/swprintf/test17/paltest_swprintf_test17 +c_runtime/swprintf/test18/paltest_swprintf_test18 +c_runtime/swprintf/test19/paltest_swprintf_test19 +c_runtime/swprintf/test2/paltest_swprintf_test2 +c_runtime/swprintf/test3/paltest_swprintf_test3 +c_runtime/swprintf/test4/paltest_swprintf_test4 +c_runtime/swprintf/test6/paltest_swprintf_test6 +c_runtime/swprintf/test7/paltest_swprintf_test7 +c_runtime/swprintf/test8/paltest_swprintf_test8 +c_runtime/swprintf/test9/paltest_swprintf_test9 +c_runtime/swscanf/test1/paltest_swscanf_test1 +c_runtime/swscanf/test10/paltest_swscanf_test10 +c_runtime/swscanf/test11/paltest_swscanf_test11 +c_runtime/swscanf/test12/paltest_swscanf_test12 +c_runtime/swscanf/test13/paltest_swscanf_test13 +c_runtime/swscanf/test14/paltest_swscanf_test14 +c_runtime/swscanf/test15/paltest_swscanf_test15 +c_runtime/swscanf/test16/paltest_swscanf_test16 +c_runtime/swscanf/test17/paltest_swscanf_test17 +c_runtime/swscanf/test2/paltest_swscanf_test2 +c_runtime/swscanf/test3/paltest_swscanf_test3 +c_runtime/swscanf/test4/paltest_swscanf_test4 +c_runtime/swscanf/test5/paltest_swscanf_test5 +c_runtime/swscanf/test6/paltest_swscanf_test6 +c_runtime/swscanf/test7/paltest_swscanf_test7 +c_runtime/swscanf/test8/paltest_swscanf_test8 +c_runtime/swscanf/test9/paltest_swscanf_test9 +c_runtime/tan/test1/paltest_tan_test1 +c_runtime/tanf/test1/paltest_tanf_test1 +c_runtime/tanh/test1/paltest_tanh_test1 +c_runtime/tanhf/test1/paltest_tanhf_test1 +c_runtime/time/test1/paltest_time_test1 +c_runtime/tolower/test1/paltest_tolower_test1 +c_runtime/toupper/test1/paltest_toupper_test1 +c_runtime/towlower/test1/paltest_towlower_test1 +c_runtime/towupper/test1/paltest_towupper_test1 +c_runtime/vfprintf/test1/paltest_vfprintf_test1 +c_runtime/vfprintf/test10/paltest_vfprintf_test10 +c_runtime/vfprintf/test11/paltest_vfprintf_test11 +c_runtime/vfprintf/test12/paltest_vfprintf_test12 +c_runtime/vfprintf/test13/paltest_vfprintf_test13 +c_runtime/vfprintf/test14/paltest_vfprintf_test14 +c_runtime/vfprintf/test15/paltest_vfprintf_test15 +c_runtime/vfprintf/test16/paltest_vfprintf_test16 +c_runtime/vfprintf/test17/paltest_vfprintf_test17 +c_runtime/vfprintf/test18/paltest_vfprintf_test18 +c_runtime/vfprintf/test19/paltest_vfprintf_test19 +c_runtime/vfprintf/test2/paltest_vfprintf_test2 +c_runtime/vfprintf/test3/paltest_vfprintf_test3 +c_runtime/vfprintf/test4/paltest_vfprintf_test4 +c_runtime/vfprintf/test5/paltest_vfprintf_test5 +c_runtime/vfprintf/test6/paltest_vfprintf_test6 +c_runtime/vfprintf/test7/paltest_vfprintf_test7 +c_runtime/vfprintf/test8/paltest_vfprintf_test8 +c_runtime/vfprintf/test9/paltest_vfprintf_test9 +c_runtime/vprintf/test10/paltest_vprintf_test10 +c_runtime/vprintf/test11/paltest_vprintf_test11 +c_runtime/vprintf/test12/paltest_vprintf_test12 +c_runtime/vprintf/test13/paltest_vprintf_test13 +c_runtime/vprintf/test14/paltest_vprintf_test14 +c_runtime/vprintf/test15/paltest_vprintf_test15 +c_runtime/vprintf/test16/paltest_vprintf_test16 +c_runtime/vprintf/test17/paltest_vprintf_test17 +c_runtime/vprintf/test18/paltest_vprintf_test18 +c_runtime/vprintf/test19/paltest_vprintf_test19 +c_runtime/vprintf/test2/paltest_vprintf_test2 +c_runtime/vprintf/test3/paltest_vprintf_test3 +c_runtime/vprintf/test4/paltest_vprintf_test4 +c_runtime/vprintf/test5/paltest_vprintf_test5 +c_runtime/vprintf/test6/paltest_vprintf_test6 +c_runtime/vprintf/test7/paltest_vprintf_test7 +c_runtime/vprintf/test8/paltest_vprintf_test8 +c_runtime/vprintf/test9/paltest_vprintf_test9 +c_runtime/vsprintf/test1/paltest_vsprintf_test1 +c_runtime/vsprintf/test10/paltest_vsprintf_test10 +c_runtime/vsprintf/test11/paltest_vsprintf_test11 +c_runtime/vsprintf/test12/paltest_vsprintf_test12 +c_runtime/vsprintf/test13/paltest_vsprintf_test13 +c_runtime/vsprintf/test14/paltest_vsprintf_test14 +c_runtime/vsprintf/test15/paltest_vsprintf_test15 +c_runtime/vsprintf/test16/paltest_vsprintf_test16 +c_runtime/vsprintf/test17/paltest_vsprintf_test17 +c_runtime/vsprintf/test18/paltest_vsprintf_test18 +c_runtime/vsprintf/test19/paltest_vsprintf_test19 +c_runtime/vsprintf/test2/paltest_vsprintf_test2 +c_runtime/vsprintf/test3/paltest_vsprintf_test3 +c_runtime/vsprintf/test4/paltest_vsprintf_test4 +c_runtime/vsprintf/test6/paltest_vsprintf_test6 +c_runtime/vsprintf/test7/paltest_vsprintf_test7 +c_runtime/vsprintf/test8/paltest_vsprintf_test8 +c_runtime/vsprintf/test9/paltest_vsprintf_test9 +c_runtime/vswprintf/test1/paltest_vswprintf_test1 +c_runtime/vswprintf/test10/paltest_vswprintf_test10 +c_runtime/vswprintf/test11/paltest_vswprintf_test11 +c_runtime/vswprintf/test12/paltest_vswprintf_test12 +c_runtime/vswprintf/test13/paltest_vswprintf_test13 +c_runtime/vswprintf/test14/paltest_vswprintf_test14 +c_runtime/vswprintf/test15/paltest_vswprintf_test15 +c_runtime/vswprintf/test16/paltest_vswprintf_test16 +c_runtime/vswprintf/test17/paltest_vswprintf_test17 +c_runtime/vswprintf/test18/paltest_vswprintf_test18 +c_runtime/vswprintf/test19/paltest_vswprintf_test19 +c_runtime/vswprintf/test2/paltest_vswprintf_test2 +c_runtime/vswprintf/test3/paltest_vswprintf_test3 +c_runtime/vswprintf/test4/paltest_vswprintf_test4 +c_runtime/vswprintf/test6/paltest_vswprintf_test6 +c_runtime/vswprintf/test7/paltest_vswprintf_test7 +c_runtime/vswprintf/test8/paltest_vswprintf_test8 +c_runtime/vswprintf/test9/paltest_vswprintf_test9 +c_runtime/wcscat/test1/paltest_wcscat_test1 +c_runtime/wcschr/test1/paltest_wcschr_test1 +c_runtime/wcscmp/test1/paltest_wcscmp_test1 +c_runtime/wcscpy/test1/paltest_wcscpy_test1 +c_runtime/wcslen/test1/paltest_wcslen_test1 +c_runtime/wcsncmp/test1/paltest_wcsncmp_test1 +c_runtime/wcsncpy/test1/paltest_wcsncpy_test1 +c_runtime/wcspbrk/test1/paltest_wcspbrk_test1 +c_runtime/wcsrchr/test1/paltest_wcsrchr_test1 +c_runtime/wcsstr/test1/paltest_wcsstr_test1 +c_runtime/wcstod/test1/paltest_wcstod_test1 +c_runtime/wcstod/test2/paltest_wcstod_test2 +c_runtime/wcstok/test1/paltest_wcstok_test1 +c_runtime/wcstoul/test1/paltest_wcstoul_test1 +c_runtime/wcstoul/test2/paltest_wcstoul_test2 +c_runtime/wcstoul/test3/paltest_wcstoul_test3 +c_runtime/wcstoul/test4/paltest_wcstoul_test4 +c_runtime/wcstoul/test5/paltest_wcstoul_test5 +c_runtime/wcstoul/test6/paltest_wcstoul_test6 +c_runtime/wprintf/test1/paltest_wprintf_test1 +c_runtime/wprintf/test2/paltest_wprintf_test2 +c_runtime/_alloca/test1/paltest_alloca_test1 +c_runtime/_fdopen/test1/paltest_fdopen_test1 +c_runtime/_finite/test1/paltest_finite_test1 +c_runtime/_finitef/test1/paltest_finitef_test1 +c_runtime/_isnan/test1/paltest_isnan_test1 +c_runtime/_isnanf/test1/paltest_isnanf_test1 +c_runtime/_itow/test1/paltest_itow_test1 +c_runtime/_putenv/test1/paltest_putenv_test1 +c_runtime/_putenv/test2/paltest_putenv_test2 +c_runtime/_putenv/test3/paltest_putenv_test3 +c_runtime/_putenv/test4/paltest_putenv_test4 +c_runtime/_rotl/test1/paltest_rotl_test1 +c_runtime/_rotr/test1/paltest_rotr_test1 +c_runtime/_snprintf_s/test1/paltest_snprintf_test1 +c_runtime/_snprintf_s/test10/paltest_snprintf_test10 +c_runtime/_snprintf_s/test11/paltest_snprintf_test11 +c_runtime/_snprintf_s/test12/paltest_snprintf_test12 +c_runtime/_snprintf_s/test13/paltest_snprintf_test13 +c_runtime/_snprintf_s/test14/paltest_snprintf_test14 +c_runtime/_snprintf_s/test15/paltest_snprintf_test15 +c_runtime/_snprintf_s/test16/paltest_snprintf_test16 +c_runtime/_snprintf_s/test17/paltest_snprintf_test17 +c_runtime/_snprintf_s/test18/paltest_snprintf_test18 +c_runtime/_snprintf_s/test19/paltest_snprintf_test19 +c_runtime/_snprintf_s/test2/paltest_snprintf_test2 +c_runtime/_snprintf_s/test3/paltest_snprintf_test3 +c_runtime/_snprintf_s/test4/paltest_snprintf_test4 +c_runtime/_snprintf_s/test6/paltest_snprintf_test6 +c_runtime/_snprintf_s/test7/paltest_snprintf_test7 +c_runtime/_snprintf_s/test8/paltest_snprintf_test8 +c_runtime/_snprintf_s/test9/paltest_snprintf_test9 +c_runtime/_snwprintf_s/test1/paltest_snwprintf_test1 +c_runtime/_snwprintf_s/test10/paltest_snwprintf_test10 +c_runtime/_snwprintf_s/test11/paltest_snwprintf_test11 +c_runtime/_snwprintf_s/test12/paltest_snwprintf_test12 +c_runtime/_snwprintf_s/test13/paltest_snwprintf_test13 +c_runtime/_snwprintf_s/test14/paltest_snwprintf_test14 +c_runtime/_snwprintf_s/test15/paltest_snwprintf_test15 +c_runtime/_snwprintf_s/test16/paltest_snwprintf_test16 +c_runtime/_snwprintf_s/test17/paltest_snwprintf_test17 +c_runtime/_snwprintf_s/test18/paltest_snwprintf_test18 +c_runtime/_snwprintf_s/test19/paltest_snwprintf_test19 +c_runtime/_snwprintf_s/test2/paltest_snwprintf_test2 +c_runtime/_snwprintf_s/test3/paltest_snwprintf_test3 +c_runtime/_snwprintf_s/test4/paltest_snwprintf_test4 +c_runtime/_snwprintf_s/test6/paltest_snwprintf_test6 +c_runtime/_snwprintf_s/test7/paltest_snwprintf_test7 +c_runtime/_snwprintf_s/test8/paltest_snwprintf_test8 +c_runtime/_snwprintf_s/test9/paltest_snwprintf_test9 +c_runtime/_stricmp/test1/paltest_stricmp_test1 +c_runtime/_strnicmp/test1/paltest_strnicmp_test1 +c_runtime/_vsnprintf_s/test1/paltest_vsnprintf_test1 +c_runtime/_vsnprintf_s/test10/paltest_vsnprintf_test10 +c_runtime/_vsnprintf_s/test11/paltest_vsnprintf_test11 +c_runtime/_vsnprintf_s/test12/paltest_vsnprintf_test12 +c_runtime/_vsnprintf_s/test13/paltest_vsnprintf_test13 +c_runtime/_vsnprintf_s/test14/paltest_vsnprintf_test14 +c_runtime/_vsnprintf_s/test15/paltest_vsnprintf_test15 +c_runtime/_vsnprintf_s/test16/paltest_vsnprintf_test16 +c_runtime/_vsnprintf_s/test17/paltest_vsnprintf_test17 +c_runtime/_vsnprintf_s/test18/paltest_vsnprintf_test18 +c_runtime/_vsnprintf_s/test19/paltest_vsnprintf_test19 +c_runtime/_vsnprintf_s/test2/paltest_vsnprintf_test2 +c_runtime/_vsnprintf_s/test3/paltest_vsnprintf_test3 +c_runtime/_vsnprintf_s/test4/paltest_vsnprintf_test4 +c_runtime/_vsnprintf_s/test6/paltest_vsnprintf_test6 +c_runtime/_vsnprintf_s/test7/paltest_vsnprintf_test7 +c_runtime/_vsnprintf_s/test8/paltest_vsnprintf_test8 +c_runtime/_vsnprintf_s/test9/paltest_vsnprintf_test9 +c_runtime/_vsnwprintf_s/test1/paltest_vsnwprintf_test1 +c_runtime/_vsnwprintf_s/test10/paltest_vsnwprintf_test10 +c_runtime/_vsnwprintf_s/test11/paltest_vsnwprintf_test11 +c_runtime/_vsnwprintf_s/test12/paltest_vsnwprintf_test12 +c_runtime/_vsnwprintf_s/test13/paltest_vsnwprintf_test13 +c_runtime/_vsnwprintf_s/test14/paltest_vsnwprintf_test14 +c_runtime/_vsnwprintf_s/test15/paltest_vsnwprintf_test15 +c_runtime/_vsnwprintf_s/test16/paltest_vsnwprintf_test16 +c_runtime/_vsnwprintf_s/test17/paltest_vsnwprintf_test17 +c_runtime/_vsnwprintf_s/test18/paltest_vsnwprintf_test18 +c_runtime/_vsnwprintf_s/test19/paltest_vsnwprintf_test19 +c_runtime/_vsnwprintf_s/test2/paltest_vsnwprintf_test2 +c_runtime/_vsnwprintf_s/test3/paltest_vsnwprintf_test3 +c_runtime/_vsnwprintf_s/test4/paltest_vsnwprintf_test4 +c_runtime/_vsnwprintf_s/test6/paltest_vsnwprintf_test6 +c_runtime/_vsnwprintf_s/test7/paltest_vsnwprintf_test7 +c_runtime/_vsnwprintf_s/test8/paltest_vsnwprintf_test8 +c_runtime/_vsnwprintf_s/test9/paltest_vsnwprintf_test9 +c_runtime/_wcsicmp/test1/paltest_wcsicmp_test1 +c_runtime/_wcslwr_s/test1/paltest_wcslwr_s_test1 +c_runtime/_wcsnicmp/test1/paltest_wcsnicmp_test1 +c_runtime/_wfopen/test1/paltest_wfopen_test1 +c_runtime/_wfopen/test2/paltest_wfopen_test2 +c_runtime/_wfopen/test3/paltest_wfopen_test3 +c_runtime/_wfopen/test4/paltest_wfopen_test4 +c_runtime/_wfopen/test5/paltest_wfopen_test5 +c_runtime/_wfopen/test6/paltest_wfopen_test6 +c_runtime/_wfopen/test7/paltest_wfopen_test7 +c_runtime/_wtoi/test1/paltest_wtoi_test1 +c_runtime/__iscsym/test1/paltest_iscsym_test1 +debug_api/OutputDebugStringA/test1/paltest_outputdebugstringa_test1 +debug_api/OutputDebugStringW/test1/paltest_outputdebugstringw_test1 +exception_handling/RaiseException/test1/paltest_raiseexception_test1 +exception_handling/RaiseException/test2/paltest_raiseexception_test2 +exception_handling/RaiseException/test3/paltest_raiseexception_test3 +filemapping_memmgt/CreateFileMappingA/test1/paltest_createfilemappinga_test1 +filemapping_memmgt/CreateFileMappingA/test3/paltest_createfilemappinga_test3 +filemapping_memmgt/CreateFileMappingA/test4/paltest_createfilemappinga_test4 +filemapping_memmgt/CreateFileMappingA/test5/paltest_createfilemappinga_test5 +filemapping_memmgt/CreateFileMappingA/test6/paltest_createfilemappinga_test6 +filemapping_memmgt/CreateFileMappingA/test7/paltest_createfilemappinga_test7 +filemapping_memmgt/CreateFileMappingA/test8/paltest_createfilemappinga_test8 +filemapping_memmgt/CreateFileMappingA/test9/paltest_createfilemappinga_test9 +filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/paltest_createfilemappingw_createfilemapping_neg1 +filemapping_memmgt/CreateFileMappingW/test1/paltest_createfilemappingw_test1 +filemapping_memmgt/CreateFileMappingW/test3/paltest_createfilemappingw_test3 +filemapping_memmgt/CreateFileMappingW/test4/paltest_createfilemappingw_test4 +filemapping_memmgt/CreateFileMappingW/test5/paltest_createfilemappingw_test5 +filemapping_memmgt/CreateFileMappingW/test6/paltest_createfilemappingw_test6 +filemapping_memmgt/CreateFileMappingW/test7/paltest_createfilemappingw_test7 +filemapping_memmgt/CreateFileMappingW/test8/paltest_createfilemappingw_test8 +filemapping_memmgt/CreateFileMappingW/test9/paltest_createfilemappingw_test9 +filemapping_memmgt/FreeLibrary/test1/paltest_freelibrary_test1 +filemapping_memmgt/FreeLibrary/test2/paltest_freelibrary_test2 +filemapping_memmgt/FreeLibraryAndExitThread/test1/paltest_freelibraryandexitthread_test1 +filemapping_memmgt/GetModuleFileNameA/test1/paltest_getmodulefilenamea_test1 +filemapping_memmgt/GetModuleFileNameA/test2/paltest_getmodulefilenamea_test2 +filemapping_memmgt/GetModuleFileNameW/test1/paltest_getmodulefilenamew_test1 +filemapping_memmgt/GetModuleFileNameW/test2/paltest_getmodulefilenamew_test2 +filemapping_memmgt/GetProcAddress/test1/paltest_getprocaddress_test1 +filemapping_memmgt/GetProcAddress/test2/paltest_getprocaddress_test2 +filemapping_memmgt/LocalAlloc/test1/paltest_localalloc_test1 +filemapping_memmgt/LocalFree/test1/paltest_localfree_test1 +filemapping_memmgt/LocalFree/test2/paltest_localfree_test2 +filemapping_memmgt/MapViewOfFile/test1/paltest_mapviewoffile_test1 +filemapping_memmgt/MapViewOfFile/test2/paltest_mapviewoffile_test2 +filemapping_memmgt/MapViewOfFile/test3/paltest_mapviewoffile_test3 +filemapping_memmgt/MapViewOfFile/test4/paltest_mapviewoffile_test4 +filemapping_memmgt/MapViewOfFile/test5/paltest_mapviewoffile_test5 +filemapping_memmgt/MapViewOfFile/test6/paltest_mapviewoffile_test6 +filemapping_memmgt/OpenFileMappingA/test1/paltest_openfilemappinga_test1 +filemapping_memmgt/OpenFileMappingA/test2/paltest_openfilemappinga_test2 +filemapping_memmgt/OpenFileMappingA/test3/paltest_openfilemappinga_test3 +filemapping_memmgt/OpenFileMappingW/test1/paltest_openfilemappingw_test1 +filemapping_memmgt/OpenFileMappingW/test2/paltest_openfilemappingw_test2 +filemapping_memmgt/OpenFileMappingW/test3/paltest_openfilemappingw_test3 +filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/paltest_probememory_probememory_neg1 +filemapping_memmgt/ProbeMemory/test1/paltest_probememory_test1 +filemapping_memmgt/UnmapViewOfFile/test1/paltest_unmapviewoffile_test1 +filemapping_memmgt/UnmapViewOfFile/test2/paltest_unmapviewoffile_test2 +filemapping_memmgt/VirtualAlloc/test1/paltest_virtualalloc_test1 +filemapping_memmgt/VirtualAlloc/test10/paltest_virtualalloc_test10 +filemapping_memmgt/VirtualAlloc/test11/paltest_virtualalloc_test11 +filemapping_memmgt/VirtualAlloc/test12/paltest_virtualalloc_test12 +filemapping_memmgt/VirtualAlloc/test13/paltest_virtualalloc_test13 +filemapping_memmgt/VirtualAlloc/test14/paltest_virtualalloc_test14 +filemapping_memmgt/VirtualAlloc/test15/paltest_virtualalloc_test15 +filemapping_memmgt/VirtualAlloc/test16/paltest_virtualalloc_test16 +filemapping_memmgt/VirtualAlloc/test17/paltest_virtualalloc_test17 +filemapping_memmgt/VirtualAlloc/test18/paltest_virtualalloc_test18 +filemapping_memmgt/VirtualAlloc/test19/paltest_virtualalloc_test19 +filemapping_memmgt/VirtualAlloc/test2/paltest_virtualalloc_test2 +filemapping_memmgt/VirtualAlloc/test20/paltest_virtualalloc_test20 +filemapping_memmgt/VirtualAlloc/test21/paltest_virtualalloc_test21 +filemapping_memmgt/VirtualAlloc/test22/paltest_virtualalloc_test22 +filemapping_memmgt/VirtualAlloc/test3/paltest_virtualalloc_test3 +filemapping_memmgt/VirtualAlloc/test4/paltest_virtualalloc_test4 +filemapping_memmgt/VirtualAlloc/test5/paltest_virtualalloc_test5 +filemapping_memmgt/VirtualAlloc/test6/paltest_virtualalloc_test6 +filemapping_memmgt/VirtualAlloc/test7/paltest_virtualalloc_test7 +filemapping_memmgt/VirtualAlloc/test8/paltest_virtualalloc_test8 +filemapping_memmgt/VirtualAlloc/test9/paltest_virtualalloc_test9 +filemapping_memmgt/VirtualFree/test1/paltest_virtualfree_test1 +filemapping_memmgt/VirtualFree/test2/paltest_virtualfree_test2 +filemapping_memmgt/VirtualFree/test3/paltest_virtualfree_test3 +filemapping_memmgt/VirtualProtect/test1/paltest_virtualprotect_test1 +filemapping_memmgt/VirtualProtect/test2/paltest_virtualprotect_test2 +filemapping_memmgt/VirtualProtect/test3/paltest_virtualprotect_test3 +filemapping_memmgt/VirtualProtect/test4/paltest_virtualprotect_test4 +filemapping_memmgt/VirtualProtect/test6/paltest_virtualprotect_test6 +filemapping_memmgt/VirtualProtect/test7/paltest_virtualprotect_test7 +filemapping_memmgt/VirtualQuery/test1/paltest_virtualquery_test1 +file_io/CopyFileA/test1/paltest_copyfilea_test1 +file_io/CopyFileA/test2/paltest_copyfilea_test2 +file_io/CopyFileA/test3/paltest_copyfilea_test3 +file_io/CopyFileA/test4/paltest_copyfilea_test4 +file_io/CopyFileW/test1/paltest_copyfilew_test1 +file_io/CopyFileW/test2/paltest_copyfilew_test2 +file_io/CopyFileW/test3/paltest_copyfilew_test3 +file_io/CreateFileA/test1/paltest_createfilea_test1 +file_io/CreateFileW/test1/paltest_createfilew_test1 +file_io/DeleteFileA/test1/paltest_deletefilea_test1 +file_io/DeleteFileW/test1/paltest_deletefilew_test1 +file_io/errorpathnotfound/test1/paltest_errorpathnotfound_test1 +file_io/errorpathnotfound/test2/paltest_errorpathnotfound_test2 +file_io/FILECanonicalizePath/paltest_filecanonicalizepath_test1 +file_io/FindClose/test1/paltest_findclose_test1 +file_io/FindFirstFileA/test1/paltest_findfirstfilea_test1 +file_io/FindFirstFileW/test1/paltest_findfirstfilew_test1 +file_io/FindNextFileA/test1/paltest_findnextfilea_test1 +file_io/FindNextFileA/test2/paltest_findnextfilea_test2 +file_io/FindNextFileW/test1/paltest_findnextfilew_test1 +file_io/FindNextFileW/test2/paltest_findnextfilew_test2 +file_io/FlushFileBuffers/test1/paltest_flushfilebuffers_test1 +file_io/GetConsoleOutputCP/test1/paltest_getconsoleoutputcp_test1 +file_io/GetCurrentDirectoryA/test1/paltest_getcurrentdirectorya_test1 +file_io/GetCurrentDirectoryW/test1/paltest_getcurrentdirectoryw_test1 +file_io/GetFileAttributesA/test1/paltest_getfileattributesa_test1 +file_io/GetFileAttributesExW/test1/paltest_getfileattributesexw_test1 +file_io/GetFileAttributesExW/test2/paltest_getfileattributesexw_test2 +file_io/GetFileAttributesW/test1/paltest_getfileattributesw_test1 +file_io/GetFileSize/test1/paltest_getfilesize_test1 +file_io/GetFileSizeEx/test1/paltest_getfilesizeex_test1 +file_io/GetFullPathNameA/test1/paltest_getfullpathnamea_test1 +file_io/GetFullPathNameA/test2/paltest_getfullpathnamea_test2 +file_io/GetFullPathNameA/test3/paltest_getfullpathnamea_test3 +file_io/GetFullPathNameA/test4/paltest_getfullpathnamea_test4 +file_io/GetFullPathNameW/test1/paltest_getfullpathnamew_test1 +file_io/GetFullPathNameW/test2/paltest_getfullpathnamew_test2 +file_io/GetFullPathNameW/test3/paltest_getfullpathnamew_test3 +file_io/GetFullPathNameW/test4/paltest_getfullpathnamew_test4 +file_io/GetStdHandle/test1/paltest_getstdhandle_test1 +file_io/GetStdHandle/test2/paltest_getstdhandle_test2 +file_io/GetSystemTime/test1/paltest_getsystemtime_test1 +file_io/GetSystemTimeAsFileTime/test1/paltest_getsystemtimeasfiletime_test1 +file_io/GetTempFileNameA/test1/paltest_gettempfilenamea_test1 +file_io/GetTempFileNameA/test2/paltest_gettempfilenamea_test2 +file_io/GetTempFileNameA/test3/paltest_gettempfilenamea_test3 +file_io/GetTempFileNameW/test1/paltest_gettempfilenamew_test1 +file_io/GetTempFileNameW/test2/paltest_gettempfilenamew_test2 +file_io/GetTempFileNameW/test3/paltest_gettempfilenamew_test3 +file_io/gettemppatha/test1/paltest_gettemppatha_test1 +file_io/GetTempPathW/test1/paltest_gettemppathw_test1 +file_io/MoveFileExA/test1/paltest_movefileexa_test1 +file_io/MoveFileExW/test1/paltest_movefileexw_test1 +file_io/ReadFile/test1/paltest_readfile_test1 +file_io/ReadFile/test2/paltest_readfile_test2 +file_io/ReadFile/test3/paltest_readfile_test3 +file_io/ReadFile/test4/paltest_readfile_test4 +file_io/SearchPathW/test1/paltest_searchpathw_test1 +file_io/SetEndOfFile/test1/paltest_setendoffile_test1 +file_io/SetEndOfFile/test2/paltest_setendoffile_test2 +file_io/SetEndOfFile/test3/paltest_setendoffile_test3 +file_io/SetEndOfFile/test4/paltest_setendoffile_test4 +file_io/SetEndOfFile/test5/paltest_setendoffile_test5 +file_io/SetFilePointer/test1/paltest_setfilepointer_test1 +file_io/SetFilePointer/test2/paltest_setfilepointer_test2 +file_io/SetFilePointer/test3/paltest_setfilepointer_test3 +file_io/SetFilePointer/test4/paltest_setfilepointer_test4 +file_io/SetFilePointer/test5/paltest_setfilepointer_test5 +file_io/SetFilePointer/test6/paltest_setfilepointer_test6 +file_io/SetFilePointer/test7/paltest_setfilepointer_test7 +file_io/WriteFile/test1/paltest_writefile_test1 +file_io/WriteFile/test2/paltest_writefile_test2 +file_io/WriteFile/test3/paltest_writefile_test3 +file_io/WriteFile/test4/paltest_writefile_test4 +file_io/WriteFile/test5/paltest_writefile_test5 +loader/LoadLibraryA/test1/paltest_loadlibrarya_test1 +loader/LoadLibraryA/test2/paltest_loadlibrarya_test2 +loader/LoadLibraryA/test3/paltest_loadlibrarya_test3 +loader/LoadLibraryA/test5/paltest_loadlibrarya_test5 +loader/LoadLibraryA/test7/paltest_loadlibrarya_test7 +loader/LoadLibraryW/test1/paltest_loadlibraryw_test1 +loader/LoadLibraryW/test2/paltest_loadlibraryw_test2 +loader/LoadLibraryW/test3/paltest_loadlibraryw_test3 +loader/LoadLibraryW/test5/paltest_loadlibraryw_test5 +locale_info/GetACP/test1/paltest_getacp_test1 +locale_info/MultiByteToWideChar/test1/paltest_multibytetowidechar_test1 +locale_info/MultiByteToWideChar/test2/paltest_multibytetowidechar_test2 +locale_info/MultiByteToWideChar/test3/paltest_multibytetowidechar_test3 +locale_info/MultiByteToWideChar/test4/paltest_multibytetowidechar_test4 +locale_info/WideCharToMultiByte/test1/paltest_widechartomultibyte_test1 +locale_info/WideCharToMultiByte/test2/paltest_widechartomultibyte_test2 +locale_info/WideCharToMultiByte/test3/paltest_widechartomultibyte_test3 +locale_info/WideCharToMultiByte/test4/paltest_widechartomultibyte_test4 +locale_info/WideCharToMultiByte/test5/paltest_widechartomultibyte_test5 +miscellaneous/CGroup/test1/paltest_cgroup_test1 +miscellaneous/CloseHandle/test1/paltest_closehandle_test1 +miscellaneous/CloseHandle/test2/paltest_closehandle_test2 +miscellaneous/CreatePipe/test1/paltest_createpipe_test1 +miscellaneous/FlushInstructionCache/test1/paltest_flushinstructioncache_test1 +miscellaneous/FormatMessageW/test1/paltest_formatmessagew_test1 +miscellaneous/FormatMessageW/test2/paltest_formatmessagew_test2 +miscellaneous/FormatMessageW/test3/paltest_formatmessagew_test3 +miscellaneous/FormatMessageW/test4/paltest_formatmessagew_test4 +miscellaneous/FormatMessageW/test5/paltest_formatmessagew_test5 +miscellaneous/FormatMessageW/test6/paltest_formatmessagew_test6 +miscellaneous/FreeEnvironmentStringsW/test1/paltest_freeenvironmentstringsw_test1 +miscellaneous/FreeEnvironmentStringsW/test2/paltest_freeenvironmentstringsw_test2 +miscellaneous/GetCommandLineW/test1/paltest_getcommandlinew_test1 +miscellaneous/GetEnvironmentStringsW/test1/paltest_getenvironmentstringsw_test1 +miscellaneous/GetEnvironmentVariableA/test1/paltest_getenvironmentvariablea_test1 +miscellaneous/GetEnvironmentVariableA/test2/paltest_getenvironmentvariablea_test2 +miscellaneous/GetEnvironmentVariableA/test3/paltest_getenvironmentvariablea_test3 +miscellaneous/GetEnvironmentVariableA/test4/paltest_getenvironmentvariablea_test4 +miscellaneous/GetEnvironmentVariableA/test5/paltest_getenvironmentvariablea_test5 +miscellaneous/GetEnvironmentVariableA/test6/paltest_getenvironmentvariablea_test6 +miscellaneous/GetEnvironmentVariableW/test1/paltest_getenvironmentvariablew_test1 +miscellaneous/GetEnvironmentVariableW/test2/paltest_getenvironmentvariablew_test2 +miscellaneous/GetEnvironmentVariableW/test3/paltest_getenvironmentvariablew_test3 +miscellaneous/GetEnvironmentVariableW/test4/paltest_getenvironmentvariablew_test4 +miscellaneous/GetEnvironmentVariableW/test5/paltest_getenvironmentvariablew_test5 +miscellaneous/GetEnvironmentVariableW/test6/paltest_getenvironmentvariablew_test6 +miscellaneous/GetLastError/test1/paltest_getlasterror_test1 +miscellaneous/GetSystemInfo/test1/paltest_getsysteminfo_test1 +miscellaneous/GetTickCount/test1/paltest_gettickcount_test1 +miscellaneous/GlobalMemoryStatusEx/test1/paltest_globalmemorystatusex_test1 +miscellaneous/InterlockedBit/test1/paltest_interlockedbit_test1 +miscellaneous/InterlockedBit/test2/paltest_interlockedbit_test2 +miscellaneous/InterlockedCompareExchange/test1/paltest_interlockedcompareexchange_test1 +miscellaneous/InterlockedCompareExchange/test2/paltest_interlockedcompareexchange_test2 +miscellaneous/InterlockedCompareExchange64/test1/paltest_interlockedcompareexchange64_test1 +miscellaneous/InterlockedCompareExchange64/test2/paltest_interlockedcompareexchange64_test2 +miscellaneous/InterlockedCompareExchangePointer/test1/paltest_interlockedcompareexchangepointer_test1 +miscellaneous/InterlockedDecrement/test1/paltest_interlockeddecrement_test1 +miscellaneous/InterlockedDecrement/test2/paltest_interlockeddecrement_test2 +miscellaneous/InterlockedDecrement64/test1/paltest_interlockeddecrement64_test1 +miscellaneous/InterlockedDecrement64/test2/paltest_interlockeddecrement64_test2 +miscellaneous/InterlockedExchange/test1/paltest_interlockedexchange_test1 +miscellaneous/InterlockedExchange64/test1/paltest_interlockedexchange64_test1 +miscellaneous/InterLockedExchangeAdd/test1/paltest_interlockedexchangeadd_test1 +miscellaneous/InterlockedExchangePointer/test1/paltest_interlockedexchangepointer_test1 +miscellaneous/InterlockedIncrement/test1/paltest_interlockedincrement_test1 +miscellaneous/InterlockedIncrement/test2/paltest_interlockedincrement_test2 +miscellaneous/InterlockedIncrement64/test1/paltest_interlockedincrement64_test1 +miscellaneous/InterlockedIncrement64/test2/paltest_interlockedincrement64_test2 +miscellaneous/queryperformancecounter/test1/paltest_queryperformancecounter_test1 +miscellaneous/queryperformancefrequency/test1/paltest_queryperformancefrequency_test1 +miscellaneous/SetEnvironmentVariableA/test1/paltest_setenvironmentvariablea_test1 +miscellaneous/SetEnvironmentVariableA/test2/paltest_setenvironmentvariablea_test2 +miscellaneous/SetEnvironmentVariableA/test3/paltest_setenvironmentvariablea_test3 +miscellaneous/SetEnvironmentVariableA/test4/paltest_setenvironmentvariablea_test4 +miscellaneous/SetEnvironmentVariableW/test1/paltest_setenvironmentvariablew_test1 +miscellaneous/SetEnvironmentVariableW/test2/paltest_setenvironmentvariablew_test2 +miscellaneous/SetEnvironmentVariableW/test3/paltest_setenvironmentvariablew_test3 +miscellaneous/SetEnvironmentVariableW/test4/paltest_setenvironmentvariablew_test4 +miscellaneous/SetLastError/test1/paltest_setlasterror_test1 +miscellaneous/_i64tow/test1/paltest_i64tow_test1 +pal_specific/PAL_errno/test1/paltest_pal_errno_test1 +pal_specific/PAL_GetPALDirectoryW/test1/paltest_pal_getpaldirectoryw_test1 +pal_specific/PAL_GetUserTempDirectoryW/test1/paltest_pal_getusertempdirectoryw_test1 +pal_specific/PAL_Initialize_Terminate/test1/paltest_pal_initialize_terminate_test1 +pal_specific/PAL_Initialize_Terminate/test2/paltest_pal_initialize_terminate_test2 +pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/paltest_pal_registerlibraryw_unregisterlibraryw_test1 +pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/paltest_reg_unreg_libraryw_neg +samples/test1/paltest_samples_test1 +samples/test2/paltest_samples_test2 +threading/CreateEventW/test1/paltest_createeventw_test1 +threading/CreateEventW/test2/paltest_createeventw_test2 +threading/CreateEventW/test3/paltest_createeventw_test3 +threading/CreateMutexW_ReleaseMutex/test1/paltest_createmutexw_releasemutex_test1 +threading/CreateMutexW_ReleaseMutex/test2/paltest_createmutexw_releasemutex_test2 +threading/CreateProcessA/test1/paltest_createprocessa_test1 +threading/CreateProcessA/test2/paltest_createprocessa_test2 +threading/CreateProcessW/test1/paltest_createprocessw_test1 +threading/CreateProcessW/test2/paltest_createprocessw_test2 +threading/CreateSemaphoreW_ReleaseSemaphore/test1/paltest_createsemaphorew_releasesemaphore_test1 +threading/CreateSemaphoreW_ReleaseSemaphore/test2/paltest_createsemaphorew_releasesemaphore_test2 +threading/CreateSemaphoreW_ReleaseSemaphore/test3/paltest_createsemaphorew_releasesemaphore_test3 +threading/CreateThread/test1/paltest_createthread_test1 +threading/CreateThread/test2/paltest_createthread_test2 +threading/CreateThread/test3/paltest_createthread_test3 +threading/CriticalSectionFunctions/test1/paltest_criticalsectionfunctions_test1 +threading/CriticalSectionFunctions/test2/paltest_criticalsectionfunctions_test2 +threading/CriticalSectionFunctions/test3/paltest_criticalsectionfunctions_test3 +threading/CriticalSectionFunctions/test4/paltest_criticalsectionfunctions_test4 +threading/CriticalSectionFunctions/test5/paltest_criticalsectionfunctions_test5 +threading/CriticalSectionFunctions/test6/paltest_criticalsectionfunctions_test6 +threading/CriticalSectionFunctions/test7/paltest_criticalsectionfunctions_test7 +threading/CriticalSectionFunctions/test8/paltest_criticalsectionfunctions_test8 +threading/DuplicateHandle/test1/paltest_duplicatehandle_test1 +threading/DuplicateHandle/test10/paltest_duplicatehandle_test10 +threading/DuplicateHandle/test11/paltest_duplicatehandle_test11 +threading/DuplicateHandle/test12/paltest_duplicatehandle_test12 +threading/DuplicateHandle/test2/paltest_duplicatehandle_test2 +threading/DuplicateHandle/test3/paltest_duplicatehandle_test3 +threading/DuplicateHandle/test4/paltest_duplicatehandle_test4 +threading/DuplicateHandle/test5/paltest_duplicatehandle_test5 +threading/DuplicateHandle/test6/paltest_duplicatehandle_test6 +threading/DuplicateHandle/test7/paltest_duplicatehandle_test7 +threading/DuplicateHandle/test8/paltest_duplicatehandle_test8 +threading/DuplicateHandle/test9/paltest_duplicatehandle_test9 +threading/ExitProcess/test1/paltest_exitprocess_test1 +threading/ExitProcess/test2/paltest_exitprocess_test2 +threading/ExitProcess/test3/paltest_exitprocess_test3 +threading/ExitThread/test1/paltest_exitthread_test1 +threading/ExitThread/test2/paltest_exitthread_test2 +threading/GetCurrentProcess/test1/paltest_getcurrentprocess_test1 +threading/GetCurrentProcessId/test1/paltest_getcurrentprocessid_test1 +threading/GetCurrentThread/test1/paltest_getcurrentthread_test1 +threading/GetCurrentThread/test2/paltest_getcurrentthread_test2 +threading/GetCurrentThreadId/test1/paltest_getcurrentthreadid_test1 +threading/GetExitCodeProcess/test1/paltest_getexitcodeprocess_test1 +threading/GetProcessTimes/test2/paltest_getprocesstimes_test2 +threading/GetThreadTimes/test1/paltest_getthreadtimes_test1 +threading/NamedMutex/test1/paltest_namedmutex_test1 +threading/OpenEventW/test1/paltest_openeventw_test1 +threading/OpenEventW/test2/paltest_openeventw_test2 +threading/OpenEventW/test3/paltest_openeventw_test3 +threading/OpenEventW/test4/paltest_openeventw_test4 +threading/OpenEventW/test5/paltest_openeventw_test5 +threading/OpenProcess/test1/paltest_openprocess_test1 +threading/QueryThreadCycleTime/test1/paltest_querythreadcycletime_test1 +threading/QueueUserAPC/test1/paltest_queueuserapc_test1 +threading/QueueUserAPC/test2/paltest_queueuserapc_test2 +threading/QueueUserAPC/test3/paltest_queueuserapc_test3 +threading/QueueUserAPC/test4/paltest_queueuserapc_test4 +threading/QueueUserAPC/test5/paltest_queueuserapc_test5 +threading/QueueUserAPC/test6/paltest_queueuserapc_test6 +threading/QueueUserAPC/test7/paltest_queueuserapc_test7 +threading/ReleaseMutex/test3/paltest_releasemutex_test3 +threading/releasesemaphore/test1/paltest_releasesemaphore_test1 +threading/ResetEvent/test1/paltest_resetevent_test1 +threading/ResetEvent/test2/paltest_resetevent_test2 +threading/ResetEvent/test3/paltest_resetevent_test3 +threading/ResetEvent/test4/paltest_resetevent_test4 +threading/ResumeThread/test1/paltest_resumethread_test1 +threading/SetErrorMode/test1/paltest_seterrormode_test1 +threading/SetEvent/test1/paltest_setevent_test1 +threading/SetEvent/test2/paltest_setevent_test2 +threading/SetEvent/test3/paltest_setevent_test3 +threading/SetEvent/test4/paltest_setevent_test4 +threading/SignalObjectAndWait/paltest_signalobjectandwaittest +threading/Sleep/test1/paltest_sleep_test1 +threading/Sleep/test2/paltest_sleep_test2 +threading/SleepEx/test1/paltest_sleepex_test1 +threading/SleepEx/test2/paltest_sleepex_test2 +threading/SwitchToThread/test1/paltest_switchtothread_test1 +threading/TerminateProcess/test1/paltest_terminateprocess_test1 +threading/ThreadPriority/test1/paltest_threadpriority_test1 +threading/WaitForMultipleObjects/test1/paltest_waitformultipleobjects_test1 +threading/WaitForMultipleObjectsEx/test1/paltest_waitformultipleobjectsex_test1 +threading/WaitForMultipleObjectsEx/test2/paltest_waitformultipleobjectsex_test2 +threading/WaitForMultipleObjectsEx/test3/paltest_waitformultipleobjectsex_test3 +threading/WaitForMultipleObjectsEx/test4/paltest_waitformultipleobjectsex_test4 +threading/WaitForMultipleObjectsEx/test5/paltest_waitformultipleobjectsex_test5 +threading/WaitForMultipleObjectsEx/test6/paltest_waitformultipleobjectsex_test6 +threading/WaitForSingleObject/test1/paltest_waitforsingleobject_test1 +threading/WaitForSingleObject/WFSOExMutexTest/paltest_waitforsingleobject_wfsoexmutextest +threading/WaitForSingleObject/WFSOExSemaphoreTest/paltest_waitforsingleobject_wfsoexsemaphoretest +threading/WaitForSingleObject/WFSOExThreadTest/paltest_waitforsingleobject_wfsoexthreadtest +threading/WaitForSingleObject/WFSOMutexTest/paltest_waitforsingleobject_wfsomutextest +threading/WaitForSingleObject/WFSOProcessTest/paltest_waitforsingleobject_wfsoprocesstest +threading/WaitForSingleObject/WFSOSemaphoreTest/paltest_waitforsingleobject_wfsosemaphoretest +threading/WaitForSingleObject/WFSOThreadTest/paltest_waitforsingleobject_wfsothreadtest +threading/YieldProcessor/test1/paltest_yieldprocessor_test1 diff --git a/src/coreclr/src/pal/tests/palsuite/compileDisabledTests.txt b/src/coreclr/src/pal/tests/palsuite/compileDisabledTests.txt new file mode 100644 index 000000000000..1daa91173ee5 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/compileDisabledTests.txt @@ -0,0 +1,57 @@ +composite/object_management/event/nonshared/paltest_event_nonshared +composite/object_management/event/shared/paltest_event_shared +composite/object_management/mutex/nonshared/paltest_mutex_nonshared +composite/object_management/mutex/shared/paltest_mutex_shared +composite/object_management/semaphore/nonshared/paltest_semaphore_nonshared +composite/object_management/semaphore/shared/paltest_semaphore_shared +composite/synchronization/criticalsection/paltest_synchronization_criticalsection +composite/synchronization/nativecriticalsection/paltest_synchronization_nativecriticalsection +composite/synchronization/nativecs_interlocked/paltest_synchronization_nativecs_interlocked +composite/threading/threadsuspension/paltest_threading_threadsuspension +composite/threading/threadsuspension_switchthread/paltest_threading_threadsuspension_switchthread +composite/wfmo/paltest_composite_wfmo +c_runtime/iswprint/test1/paltest_iswprint_test1 +c_runtime/vprintf/test1/paltest_vprintf_test1 +c_runtime/_gcvt/test1/paltest_gcvt_test1 +c_runtime/_gcvt/test2/paltest_gcvt_test2 +debug_api/DebugBreak/test1/paltest_debugbreak_test1 +debug_api/WriteProcessMemory/test1/paltest_writeprocessmemory_test1 +debug_api/WriteProcessMemory/test3/paltest_writeprocessmemory_test3 +debug_api/WriteProcessMemory/test4/paltest_writeprocessmemory_test4 +exception_handling/pal_except/test1/paltest_pal_except_test1 +exception_handling/pal_except/test2/paltest_pal_except_test2 +exception_handling/pal_except/test3/paltest_pal_except_test3 +exception_handling/pal_except/test4/paltest_pal_except_test4 +exception_handling/pal_except/test5/paltest_pal_except_test5 +exception_handling/pal_except/test6/paltest_pal_except_test6 +exception_handling/pal_except/test7/paltest_pal_except_test7 +exception_handling/PAL_EXCEPT_FILTER/test1/paltest_pal_except_filter_test1 +exception_handling/PAL_EXCEPT_FILTER/test2/paltest_pal_except_filter_test2 +exception_handling/PAL_EXCEPT_FILTER/test3/paltest_pal_except_filter_test3 +exception_handling/PAL_EXCEPT_FILTER_EX/test1/paltest_pal_except_filter_ex_test1 +exception_handling/PAL_EXCEPT_FILTER_EX/test2/paltest_pal_except_filter_ex_test2 +exception_handling/PAL_EXCEPT_FILTER_EX/test3/paltest_pal_except_filter_ex_test3 +exception_handling/pal_finally/test1/paltest_pal_finally_test1 +exception_handling/PAL_TRY_EXCEPT/test1/paltest_pal_try_except_test1 +exception_handling/PAL_TRY_EXCEPT/test2/paltest_pal_try_except_test2 +exception_handling/PAL_TRY_EXCEPT_EX/test1/paltest_pal_try_except_ex_test1 +exception_handling/PAL_TRY_EXCEPT_EX/test2/paltest_pal_try_except_ex_test2 +exception_handling/PAL_TRY_EXCEPT_EX/test3/paltest_pal_try_except_ex_test3 +exception_handling/PAL_TRY_LEAVE_FINALLY/test1/paltest_pal_try_leave_finally_test1 +filemapping_memmgt/CreateFileMappingW/test2/paltest_createfilemappingw_test2 +loader/LoadLibraryA/test6/paltest_loadlibrarya_test6 +loader/LoadLibraryA/test8/paltest_loadlibrarya_test8 +locale_info/CompareStringA/test1/paltest_comparestringa_test1 +locale_info/CompareStringW/test1/paltest_comparestringw_test1 +locale_info/GetLocaleInfoW/test1/paltest_getlocaleinfow_test1 +locale_info/GetLocaleInfoW/test2/paltest_getlocaleinfow_test2 +miscellaneous/IsBadCodePtr/test1/paltest_isbadcodeptr_test1 +miscellaneous/IsBadReadPtr/test1/paltest_isbadreadptr_test1 +miscellaneous/IsBadWritePtr/test1/paltest_isbadwriteptr_test1 +miscellaneous/IsBadWritePtr/test2/paltest_isbadwriteptr_test2 +miscellaneous/IsBadWritePtr/test3/paltest_isbadwriteptr_test3 +miscellaneous/MessageBoxW/test1/paltest_messageboxw_test1 +miscellaneous/MessageBoxW/test2/paltest_messageboxw_test2 +pal_specific/PAL_get_stderr/test1/paltest_pal_get_stderr_test1 +pal_specific/PAL_get_stdin/test1/paltest_pal_get_stdin_test1 +pal_specific/PAL_get_stdout/test1/paltest_pal_get_stdout_test1 diff --git a/src/coreclr/src/pal/tests/palsuite/composite/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/CMakeLists.txt deleted file mode 100644 index 17d0105eea53..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(object_management) -add_subdirectory(synchronization) -add_subdirectory(threading) -add_subdirectory(wfmo) - diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/CMakeLists.txt deleted file mode 100644 index 1786ba32c69c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(event) -add_subdirectory(mutex) -add_subdirectory(semaphore) - diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/CMakeLists.txt deleted file mode 100644 index 4eeff15aa731..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(nonshared) -add_subdirectory(shared) - diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/CMakeLists.txt deleted file mode 100644 index 666e5e8a17c0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES - event.cpp - main.cpp -) - -add_executable(paltest_event_nonshared - ${SOURCES} -) - -add_dependencies(paltest_event_nonshared coreclrpal) - -target_link_libraries(paltest_event_nonshared - ${COMMON_TEST_LIBRARIES} - rt -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp index 337e0cf74f10..bc521da91b3a 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp @@ -10,7 +10,7 @@ ** This test is for Object Management Test case for event where Object type is shareable. ** Algorithm ** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object +** o Create PROCESS_COUNT processes aware of the Shared Object ** ** Author: ShamitP ** @@ -38,7 +38,7 @@ struct statistics{ unsigned int processId; unsigned int operationsFailed; unsigned int operationsPassed; - unsigned int operationsTotal; + unsigned int operationsTotal; DWORD operationTime; unsigned int relationId; }; @@ -59,27 +59,25 @@ int testStatus; const char sTmpEventName[MAX_PATH_FNAME] = "StartTestEvent"; -void PALAPI Run_Thread(LPVOID lpParam); +void PALAPI Run_Thread_event_nonshared(LPVOID lpParam); int GetParameters( int argc, char **argv) { - if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) + if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) { printf("PAL -Composite Object Management Event Test\n"); printf("Usage:\n"); - printf("Event\n\t[USE_PROCESS_COUNT [greater than 1] \n"); - printf("\t[THREAD_COUNT [greater than 1] \n"); + printf("Event\n\t[USE_PROCESS_COUNT [greater than 1] \n"); + printf("\t[THREAD_COUNT [greater than 1] \n"); printf("\t[REPEAT_COUNT [greater than 1]\n"); printf("\t[RELATION_ID [greater than or Equal to 1]\n"); - + return -1; } - // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]); - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) + if( USE_PROCESS_COUNT < 0) { printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); return -1; @@ -93,14 +91,14 @@ int GetParameters( int argc, char **argv) } REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) + if( REPEAT_COUNT < 1) { printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); return -1; } RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) + if( RELATION_ID < 1) { printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); return -1; @@ -110,7 +108,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_event_nonshared_paltest_event_nonshared, "composite/object_management/event/nonshared/paltest_event_nonshared") { unsigned int i = 0; HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; @@ -127,7 +125,7 @@ int GetParameters( int argc, char **argv) /* Variables to capture the file name and the file pointer at process level*/ char processFileName[MAX_LONGPATH]; - FILE *pProcessFile = NULL; + FILE *pProcessFile = NULL; struct ProcessStats processStats; DWORD dwStartTime; @@ -142,9 +140,8 @@ int GetParameters( int argc, char **argv) { Fail("Error in obtaining the parameters\n"); } -// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT); - /* Register the start time */ + /* Register the start time */ dwStartTime = GetTickCount(); processStats.relationId = RELATION_ID; processStats.processId = USE_PROCESS_COUNT; @@ -152,7 +149,7 @@ int GetParameters( int argc, char **argv) _snprintf(processFileName, MAX_LONGPATH, "%d_process_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pProcessFile = fopen(processFileName, "w+"); if(pProcessFile == NULL) - { + { Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT); } @@ -160,27 +157,27 @@ int GetParameters( int argc, char **argv) _snprintf(fileName, MAX_LONGPATH, "%d_thread_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pFile = fopen(fileName, "w+"); - + if(pFile == NULL) - { + { Fail("Error in opening thread File for write for process [%d]\n", USE_PROCESS_COUNT); } // For each thread we will log operations failed (int), passed (int), total (int) // and number of ticks (DWORD) for the operations resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize); - StartTestsEvHandle = CreateEvent( + StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/ TRUE, /* bManualReset */ FALSE, /* bInitialState */ NULL /* name of Event */ - ); + ); if( StartTestsEvHandle == NULL ) { Fail("Error:%d: Unexpected failure " "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - + } /* Create StartTest Event */ @@ -189,9 +186,9 @@ int GetParameters( int argc, char **argv) NULL, /* lpEventAttributes, inheritable to child processes*/ TRUE, /* bAutomaticReset */ TRUE, /* bInitialState */ - NULL + NULL ); - + if( hEventHandle == NULL) { Fail("Unable to create Event handle for process id [%d], returned error [%d]\n", i, GetLastError()); @@ -205,26 +202,26 @@ int GetParameters( int argc, char **argv) hThread[i] = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread,/* thread function */ + (LPTHREAD_START_ROUTINE)Run_Thread_event_nonshared,/* thread function */ (LPVOID)dwParam, /* argument to thread function */ 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ + &threadId[i] /* returns the thread identifier*/ ); - - + + if(hThread[i] == NULL) { Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } - + } if (!SetEvent(StartTestsEvHandle)) { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); + Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); + returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); if( WAIT_OBJECT_0 != returnCode ) { @@ -232,17 +229,15 @@ int GetParameters( int argc, char **argv) testStatus = FAIL; } - processStats.operationTime = GetTimeDiff(dwStartTime); + processStats.operationTime = GetTimeDiff(dwStartTime); /* Write to a file*/ if(pFile!= NULL) - { + { for( i = 0; i < THREAD_COUNT; i++ ) - { + { buffer = (struct statistics *)resultBuffer->getResultBuffer(i); returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); - //Trace("Iteration %d over\n", i); - } } if(fclose(pFile)) @@ -260,7 +255,6 @@ int GetParameters( int argc, char **argv) /* Logging for the test case over, clean up the handles */ -// Trace("Test Thread %d done\n", USE_PROCESS_COUNT); /* Clean Up */ for( i = 0; i < THREAD_COUNT; i++ ) { @@ -281,17 +275,17 @@ int GetParameters( int argc, char **argv) { Trace("Error:%d: CloseHandle failed for Process [%d] hEventHandle\n", GetLastError(), USE_PROCESS_COUNT); testStatus = FAIL; - } + } - PAL_Terminate(); + PAL_TerminateEx(testStatus); return testStatus; } -void PALAPI Run_Thread (LPVOID lpParam) +void PALAPI Run_Thread_event_nonshared (LPVOID lpParam) { unsigned int i = 0; - DWORD dwWaitResult; + DWORD dwWaitResult; struct statistics stats; DWORD dwStartTime; @@ -304,10 +298,10 @@ void PALAPI Run_Thread (LPVOID lpParam) stats.operationTime = 0; int Id=(int)lpParam; - - dwWaitResult = WaitForSingleObject( + + dwWaitResult = WaitForSingleObject( StartTestsEvHandle, // handle to start test handle - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { @@ -318,40 +312,35 @@ void PALAPI Run_Thread (LPVOID lpParam) for( i = 0; i < REPEAT_COUNT; i++ ) { - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( hEventHandle, // handle to Event - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { -// Trace("Error while waiting for onject @ thread %d, # iter %d, RC is %d, Error is %d\n", Id, i, dwWaitResult, GetLastError()); - stats.operationsFailed += 1; + stats.operationsFailed += 1; stats.operationsTotal += 1; testStatus = FAIL; continue; } - if (! SetEvent(hEventHandle)) - { + if (! SetEvent(hEventHandle)) + { // Deal with error. -// Trace("Error while setting Event @ thread %d # iter %d\n", Id, i); stats.operationsFailed += 1; stats.operationsTotal += 1; // Do we need to have while true loop to attempt to set event? testStatus = FAIL; continue; - } - + } + stats.operationsTotal += 1; stats.operationsPassed += 1; -// Trace("Successs while setting Event @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT); - } - - stats.operationTime = GetTimeDiff(dwStartTime); + + stats.operationTime = GetTimeDiff(dwStartTime); if(resultBuffer->LogResult(Id, (char *)&stats)) { Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); } - //Trace("Thread %d over for process %d\n", Id, USE_PROCESS_COUNT); } diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp index 2d326c4b7246..115632a833f4 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp @@ -83,7 +83,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_event_nonshared_paltest_event_nonshared, "composite/object_management/event/nonshared/paltest_event_nonshared") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/CMakeLists.txt deleted file mode 100644 index 008739c3b86f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES - event.cpp - main.cpp -) - -add_executable(paltest_event_shared - ${SOURCES} -) - -add_dependencies(paltest_event_shared coreclrpal) - -target_link_libraries(paltest_event_shared - ${COMMON_TEST_LIBRARIES} - rt -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/event.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/event.cpp index 8f136f3b5370..155d5e9bd9b4 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/event.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/event.cpp @@ -10,7 +10,7 @@ ** This test is for Object Management Test case for event where Object type is shareable. ** Algorithm ** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object +** o Create PROCESS_COUNT processes aware of the Shared Object ** ** Author: ShamitP ** Author: ShamitP @@ -35,7 +35,7 @@ struct statistics{ unsigned int processId; unsigned int operationsFailed; unsigned int operationsPassed; - unsigned int operationsTotal; + unsigned int operationsTotal; DWORD operationTime; unsigned int relationId; }; @@ -57,28 +57,26 @@ int testStatus; const char sTmpEventName[MAX_PATH] = "StartTestEvent"; char objectSuffix[MAX_PATH]; -void PALAPI Run_Thread(LPVOID lpParam); +void PALAPI Run_Thread_event_shared(LPVOID lpParam); int GetParameters( int argc, char **argv) { - if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) + if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) { printf("PAL -Composite Object Management event Test\n"); printf("Usage:\n"); - printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n"); - printf("\t[THREAD_COUNT (greater than 1)] \n"); + printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n"); + printf("\t[THREAD_COUNT (greater than 1)] \n"); printf("\t[REPEAT_COUNT (greater than 1)]\n"); - printf("\t[RELATION_ID [greater than or equal to 1]\n"); + printf("\t[RELATION_ID [greater than or equal to 1]\n"); printf("\t[Object Name Suffix]\n"); return -1; } - // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]); - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) + if( USE_PROCESS_COUNT < 0) { printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); return -1; @@ -92,14 +90,14 @@ int GetParameters( int argc, char **argv) } REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) + if( REPEAT_COUNT < 1) { printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); return -1; } RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) + if( RELATION_ID < 1) { printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); return -1; @@ -113,7 +111,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_event_shared_paltest_event_shared, "composite/object_management/event/shared/paltest_event_shared") { unsigned int i = 0; HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; @@ -125,7 +123,7 @@ int GetParameters( int argc, char **argv) DWORD dwParam = 0; int returnCode = 0; - + /* Variables to capture the file name and the file pointer at thread level*/ char fileName[MAX_PATH]; FILE *pFile = NULL; @@ -134,7 +132,7 @@ int GetParameters( int argc, char **argv) /* Variables to capture the file name and the file pointer at process level*/ char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; + FILE *pProcessFile = NULL; struct ProcessStats processStats; DWORD dwStartTime; @@ -151,14 +149,13 @@ int GetParameters( int argc, char **argv) { Fail("Error in obtaining the parameters\n"); } -// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT); if(argc == 5) { strncat(ObjName, objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) ); } - /* Register the start time */ + /* Register the start time */ dwStartTime = GetTickCount(); processStats.relationId = RELATION_ID; processStats.processId = USE_PROCESS_COUNT; @@ -166,7 +163,7 @@ int GetParameters( int argc, char **argv) _snprintf(processFileName, MAX_PATH, "%d_process_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pProcessFile = fopen(processFileName, "w+"); if(pProcessFile == NULL) - { + { Fail("Error:%d: in opening Process File for write for process [%d]\n", GetLastError(), USE_PROCESS_COUNT); } @@ -174,9 +171,9 @@ int GetParameters( int argc, char **argv) _snprintf(fileName, MAX_PATH, "%d_thread_event_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pFile = fopen(fileName, "w+"); - + if(pFile == NULL) - { + { Fail("Error:%d: in opening thread file for write for process [%d]\n", GetLastError(), USE_PROCESS_COUNT); } // For each thread we will log operations failed (int), passed (int), total (int) @@ -194,7 +191,7 @@ int GetParameters( int argc, char **argv) { Fail("Error:%d: Unexpected failure " "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - + } /* Create StartTest Event */ @@ -202,9 +199,9 @@ int GetParameters( int argc, char **argv) hEventHandle = OpenEventW( EVENT_ALL_ACCESS, /* lpEventAttributes, inheritable to child processes*/ FALSE, /* bAutomaticReset */ - wcObjName + wcObjName ); - + if( hEventHandle == NULL) { Fail("Unable to create Event handle for process id [%d], returned error [%d]\n", i, GetLastError()); @@ -218,44 +215,42 @@ int GetParameters( int argc, char **argv) hThread[i] = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread,/* thread function */ + (LPTHREAD_START_ROUTINE)Run_Thread_event_shared,/* thread function */ (LPVOID)dwParam, /* argument to thread function */ 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ + &threadId[i] /* returns the thread identifier*/ ); - + if(hThread[i] == NULL) { Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } - + } if (!SetEvent(StartTestsEvHandle)) { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); + Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); + returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError()); testStatus = FAIL; } - - processStats.operationTime = GetTimeDiff(dwStartTime); + + processStats.operationTime = GetTimeDiff(dwStartTime); /* Write to a file*/ if(pFile!= NULL) - { + { for( i = 0; i < THREAD_COUNT; i++ ) - { + { buffer = (struct statistics *)resultBuffer->getResultBuffer(i); returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); -// Trace("Iteration %d over\n", i); - } } @@ -273,8 +268,6 @@ int GetParameters( int argc, char **argv) } /* Logging for the test case over, clean up the handles */ -// Trace("Test Thread %d done\n", USE_PROCESS_COUNT); - for( i = 0; i < THREAD_COUNT; i++ ) { if(!CloseHandle(hThread[i]) ) @@ -294,17 +287,17 @@ int GetParameters( int argc, char **argv) { Trace("Error:%d: CloseHandle failed for Process [%d] hEventHandle\n", GetLastError(), USE_PROCESS_COUNT); testStatus = FAIL; - } + } free(wcObjName); PAL_Terminate(); return testStatus; } -void PALAPI Run_Thread (LPVOID lpParam) +void PALAPI Run_Thread_event_shared (LPVOID lpParam) { unsigned int i = 0; - DWORD dwWaitResult; + DWORD dwWaitResult; struct statistics stats; DWORD dwStartTime; @@ -317,10 +310,10 @@ void PALAPI Run_Thread (LPVOID lpParam) stats.operationTime = 0; int Id=(int)lpParam; - - dwWaitResult = WaitForSingleObject( + + dwWaitResult = WaitForSingleObject( StartTestsEvHandle, // handle to start test handle - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { @@ -332,41 +325,35 @@ void PALAPI Run_Thread (LPVOID lpParam) for( i = 0; i < REPEAT_COUNT; i++ ) { - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( hEventHandle, // handle to Event - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { - //Trace("Error:%d: while waiting for onject @ thread %d, # iter %d\n", GetLastError(), Id, i); - stats.operationsFailed += 1; + stats.operationsFailed += 1; stats.operationsTotal += 1; testStatus = FAIL; continue; } - if (! SetEvent(hEventHandle)) - { + if (! SetEvent(hEventHandle)) + { // Deal with error. -// Trace("Error while setting Event @ thread %d # iter %d\n", Id, i); stats.operationsFailed += 1; stats.operationsTotal += 1; // do we need to have while true loop to attempt to set event...? testStatus = FAIL; continue; - } + } stats.operationsTotal += 1; - stats.operationsPassed += 1; - // Trace("Successs while setting Event @ iteration %d -> thread %d -> Process %d for handle %d\n", i, Id, USE_PROCESS_COUNT, hEventHandle); - + stats.operationsPassed += 1; } - - stats.operationTime = GetTimeDiff(dwStartTime); - //Trace("OPeration time is %d", stats.operationTime ); + + stats.operationTime = GetTimeDiff(dwStartTime); if(resultBuffer->LogResult(Id, (char *)&stats)) { Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); } - //Trace("Thread %d over for process %d\n", Id, USE_PROCESS_COUNT); } diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/main.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/main.cpp index 6824d3c2507e..cce500d10cbf 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/main.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/event/shared/main.cpp @@ -91,7 +91,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_event_shared_paltest_event_shared, "composite/object_management/event/shared/paltest_event_shared") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/CMakeLists.txt deleted file mode 100644 index 4eeff15aa731..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(nonshared) -add_subdirectory(shared) - diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/CMakeLists.txt deleted file mode 100644 index 87932ffb6404..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES - main.cpp - mutex.cpp -) - -add_executable(paltest_mutex_nonshared - ${SOURCES} -) - -add_dependencies(paltest_mutex_nonshared coreclrpal) - -target_link_libraries(paltest_mutex_nonshared - ${COMMON_TEST_LIBRARIES} - rt -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.cpp index 0937a2a8967d..4277e66e0821 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.cpp @@ -83,7 +83,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_mutex_nonshared_paltest_mutex_nonshared, "composite/object_management/mutex/nonshared/paltest_mutex_nonshared") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.cpp index 8dc808c99ab2..a3503dc4702d 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.cpp @@ -2,16 +2,16 @@ // The .NET Foundation licenses this file to you under the MIT license. /*============================================================ -** +** ** Source Code: main.c and mutex.c ** main.c creates process and waits for all processes to get over ** mutex.c creates a mutex and then calls threads which will contend for the mutex -** +** ** This test is for Object Management Test case for Mutex where Object type is not shareable. ** Algorithm ** o Create PROCESS_COUNT processes. -** o Main Thread of each process creates OBJECT_TYPE Object -** +** o Main Thread of each process creates OBJECT_TYPE Object +** ** Author: ShamitP **============================================================ */ @@ -32,7 +32,7 @@ struct statistics{ unsigned int processId; unsigned int operationsFailed; unsigned int operationsPassed; - unsigned int operationsTotal; + unsigned int operationsTotal; DWORD operationTime; unsigned int relationId; }; @@ -51,26 +51,24 @@ ResultBuffer *resultBuffer = NULL; int testStatus; -void PALAPI Run_Thread(LPVOID lpParam); +void PALAPI Run_Thread_mutex_nonshared(LPVOID lpParam); int GetParameters( int argc, char **argv) { - if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) + if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) { printf("PAL -Composite Object Management Mutex Test\n"); printf("Usage:\n"); - printf("mutex\n\t[USE_PROCESS_COUNT ( greater than 1] \n"); - printf("\t[THREAD_COUNT ( greater than 1] \n"); + printf("mutex\n\t[USE_PROCESS_COUNT ( greater than 1] \n"); + printf("\t[THREAD_COUNT ( greater than 1] \n"); printf("\t[REPEAT_COUNT ( greater than 1]\n"); - printf("\t[RELATION_ID [greater than 1]\n"); + printf("\t[RELATION_ID [greater than 1]\n"); return -1; } - // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]); - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) + if( USE_PROCESS_COUNT < 0) { printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); return -1; @@ -84,14 +82,14 @@ int GetParameters( int argc, char **argv) } REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) + if( REPEAT_COUNT < 1) { printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); return -1; } RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) + if( RELATION_ID < 1) { printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); return -1; @@ -100,7 +98,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_mutex_nonshared_paltest_mutex_nonshared, "composite/object_management/mutex/nonshared/paltest_mutex_nonshared") { unsigned int i = 0; HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; @@ -111,7 +109,7 @@ int GetParameters( int argc, char **argv) DWORD dwParam = 0; int returnCode = 0; - + /* Variables to capture the file name and the file pointer at thread level*/ char fileName[MAX_PATH]; FILE *pFile = NULL; @@ -120,7 +118,7 @@ int GetParameters( int argc, char **argv) /* Variables to capture the file name and the file pointer at process level*/ char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; + FILE *pProcessFile = NULL; struct ProcessStats processStats; DWORD dwStartTime; @@ -135,9 +133,8 @@ int GetParameters( int argc, char **argv) { Fail("Error in obtaining the parameters\n"); } -// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT); - /* Register the start time */ + /* Register the start time */ dwStartTime = GetTickCount(); processStats.relationId = RELATION_ID; processStats.processId = USE_PROCESS_COUNT; @@ -145,16 +142,16 @@ int GetParameters( int argc, char **argv) _snprintf(processFileName, MAX_PATH, "%d_process_mutex_%d_.txt", USE_PROCESS_COUNT,RELATION_ID); pProcessFile = fopen(processFileName, "w+"); if(pProcessFile == NULL) - { + { Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT); } statisticsSize = sizeof(struct statistics); _snprintf(fileName, MAX_PATH, "%d_thread_mutex_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pFile = fopen(fileName, "w+"); + pFile = fopen(fileName, "w+"); if(pFile == NULL) - { + { Fail("Error in opening file for write for process [%d]\n", USE_PROCESS_COUNT); } // For each thread we will log operations failed (int), passed (int), total (int) @@ -164,14 +161,14 @@ int GetParameters( int argc, char **argv) StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/ TRUE, /* bManualReset */ FALSE, /* bInitialState */ - NULL + NULL ); /* name of Event */ if( StartTestsEvHandle == NULL ) { Fail("Error:%d: Unexpected failure " "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - + } /* Create StartTest Event */ @@ -179,9 +176,9 @@ int GetParameters( int argc, char **argv) hMutexHandle = CreateMutex( NULL, FALSE, /* bInitialOwner, owns initially */ - NULL + NULL ); - + if( hMutexHandle == NULL) { Fail("Unable to create Mutex handle for process id [%d], returned error [%d]\n", i, GetLastError()); @@ -195,44 +192,42 @@ int GetParameters( int argc, char **argv) hThread[i] = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread,/* thread function */ + (LPTHREAD_START_ROUTINE)Run_Thread_mutex_nonshared,/* thread function */ (LPVOID)dwParam, /* argument to thread function */ 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ + &threadId[i] /* returns the thread identifier*/ ); - + if(hThread[i] == NULL) { Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - + } + } - + if (!SetEvent(StartTestsEvHandle)) { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); + Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); + returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError()); testStatus = FAIL; } - - processStats.operationTime = GetTimeDiff(dwStartTime); + + processStats.operationTime = GetTimeDiff(dwStartTime); /* Write to a file*/ if(pFile!= NULL) - { + { for( i = 0; i < THREAD_COUNT; i++ ) - { + { buffer = (struct statistics *)resultBuffer->getResultBuffer(i); returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); -// Trace("Iteration %d over\n", i); - } } fclose(pFile); @@ -242,9 +237,6 @@ int GetParameters( int argc, char **argv) /* Logging for the test case over, clean up the handles */ -// Trace("Test Thread %d done\n", USE_PROCESS_COUNT); - - for( i = 0; i < THREAD_COUNT; i++ ) { if(!CloseHandle(hThread[i]) ) @@ -264,16 +256,16 @@ int GetParameters( int argc, char **argv) { Trace("Error:%d: CloseHandle failed for Process [%d] hMutexHandle\n", GetLastError(), USE_PROCESS_COUNT); testStatus = FAIL; - } + } PAL_Terminate(); return testStatus; } -void PALAPI Run_Thread (LPVOID lpParam) +void PALAPI Run_Thread_mutex_nonshared (LPVOID lpParam) { unsigned int i = 0; - DWORD dwWaitResult; + DWORD dwWaitResult; struct statistics stats; DWORD dwStartTime; @@ -286,10 +278,10 @@ void PALAPI Run_Thread (LPVOID lpParam) stats.operationTime = 0; int Id=(int)lpParam; - - dwWaitResult = WaitForSingleObject( + + dwWaitResult = WaitForSingleObject( StartTestsEvHandle, // handle to mutex - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { @@ -301,37 +293,32 @@ void PALAPI Run_Thread (LPVOID lpParam) for( i = 0; i < REPEAT_COUNT; i++ ) { - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( hMutexHandle, // handle to mutex - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { -// Trace("Error while waiting for onject @ thread %d, # iter %d\n", Id, i); stats.operationsFailed += 1; stats.operationsTotal += 1; testStatus = FAIL; continue; } - if (! ReleaseMutex(hMutexHandle)) - { + if (! ReleaseMutex(hMutexHandle)) + { // Deal with error. -// Trace("Error while releasing mutex @ thread %d # iter %d\n", Id, i); stats.operationsFailed += 1; stats.operationsTotal += 1; // Probably need to have while true loop to attempt to release mutex... testStatus = FAIL; continue; - } + } stats.operationsTotal += 1; - stats.operationsPassed += 1; - // Trace("Successs while releasing mutex @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT); - + stats.operationsPassed += 1; } - stats.operationTime = GetTimeDiff(dwStartTime); - //Trace("OPeration time is %d", stats.operationTime ); + stats.operationTime = GetTimeDiff(dwStartTime); if(resultBuffer->LogResult(Id, (char *)&stats)) { Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/CMakeLists.txt deleted file mode 100644 index d058c4483322..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES - main.cpp - mutex.cpp -) - -add_executable(paltest_mutex_shared - ${SOURCES} -) - -add_dependencies(paltest_mutex_shared coreclrpal) - -target_link_libraries(paltest_mutex_shared - ${COMMON_TEST_LIBRARIES} - rt -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/main.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/main.cpp index a8481f60d1b1..3790785d0651 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/main.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/main.cpp @@ -93,7 +93,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_mutex_shared_paltest_mutex_shared, "composite/object_management/mutex/shared/paltest_mutex_shared") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.cpp index 19fe3ad6f90a..51400a99564e 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.cpp @@ -2,18 +2,18 @@ // The .NET Foundation licenses this file to you under the MIT license. /*============================================================ -** +** ** This test is for Object Management Test case for Mutex where Object type is shareable. -** +** ** Source Code: main.c and mutex.c ** main.c creates a mutex, creates processes and waits for all processes to get over ** mutex.c create threads which will contend for the mutex -** +** ** This test is for Object Management Test case for Mutex where Object type is not shareable. ** Algorithm ** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object -** +** o Create PROCESS_COUNT processes aware of the Shared Object +** ** Author: ShamitP ** ** @@ -28,7 +28,7 @@ /* Test Input Variables */ unsigned int USE_PROCESS_COUNT = 0; unsigned int THREAD_COUNT = 0; -unsigned int REPEAT_COUNT = 0; +unsigned int REPEAT_COUNT = 0; unsigned int RELATION_ID = 0; @@ -37,7 +37,7 @@ struct statistics{ unsigned int processId; unsigned int operationsFailed; unsigned int operationsPassed; - unsigned int operationsTotal; + unsigned int operationsTotal; DWORD operationTime; unsigned int relationId; }; @@ -59,28 +59,26 @@ int testStatus; const char sTmpEventName[MAX_PATH] = "StartTestEvent"; char objectSuffix[MAX_PATH]; -void PALAPI Run_Thread(LPVOID lpParam); +void PALAPI Run_Thread_mutex_shared(LPVOID lpParam); int GetParameters( int argc, char **argv) { - if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) + if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) { printf("PAL -Composite Object Management event Test\n"); printf("Usage:\n"); - printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n"); - printf("\t[THREAD_COUNT (greater than 1)] \n"); + printf("main\n\t[USE_PROCESS_COUNT (greater than 1)] \n"); + printf("\t[THREAD_COUNT (greater than 1)] \n"); printf("\t[REPEAT_COUNT (greater than 1)]\n"); - printf("\t[RELATION_ID [greater than 1]\n"); + printf("\t[RELATION_ID [greater than 1]\n"); printf("\t[Object Name Suffix]\n"); return -1; } - // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]); - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) + if( USE_PROCESS_COUNT < 0) { printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); return -1; @@ -94,14 +92,14 @@ int GetParameters( int argc, char **argv) } REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) + if( REPEAT_COUNT < 1) { printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); return -1; } RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) + if( RELATION_ID < 1) { printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); return -1; @@ -115,17 +113,17 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_mutex_shared_paltest_mutex_shared, "composite/object_management/mutex/shared/paltest_mutex_shared") { unsigned int i = 0; HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; DWORD threadId[MAXIMUM_WAIT_OBJECTS]; - + char ObjName[MAX_PATH] = "SHARED_MUTEX"; DWORD dwParam = 0; int returnCode = 0; - + /* Variables to capture the file name and the file pointer*/ char fileName[MAX_PATH]; FILE *pFile = NULL; @@ -134,7 +132,7 @@ int GetParameters( int argc, char **argv) /* Variables to capture the file name and the file pointer at process level*/ char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; + FILE *pProcessFile = NULL; struct ProcessStats processStats; DWORD dwStartTime; @@ -151,14 +149,13 @@ int GetParameters( int argc, char **argv) { Fail("Error in obtaining the parameters\n"); } -// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT); if(argc == 5) { strncat(ObjName, objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) ); } - /* Register the start time */ + /* Register the start time */ dwStartTime = GetTickCount(); processStats.relationId = RELATION_ID; processStats.processId = USE_PROCESS_COUNT; @@ -166,20 +163,20 @@ int GetParameters( int argc, char **argv) _snprintf(processFileName, MAX_PATH, "%d_process_mutex_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pProcessFile = fopen(processFileName, "w+"); if(pProcessFile == NULL) - { + { Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT); } statisticsSize = sizeof(struct statistics); _snprintf(fileName, MAX_PATH, "%d_thread_mutex_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pFile = fopen(fileName, "w+"); if(pFile == NULL) - { + { Fail("Error in opening file for write for process [%d]\n", USE_PROCESS_COUNT); } // For each thread we will log operations failed (int), passed (int), total (int) // and number of ticks (DWORD) for the operations resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize); - + /* Create StartTest Event */ StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/ TRUE, /* bManualReset */ @@ -190,15 +187,15 @@ int GetParameters( int argc, char **argv) { Fail("Error:%d: Unexpected failure " "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - + } hMutexHandle = CreateMutex( NULL, FALSE, /* bInitialOwner, owns initially */ - ObjName + ObjName ); - + if( (hMutexHandle == NULL)|| (GetLastError() != ERROR_ALREADY_EXISTS)) { Fail("Unable to create Mutex handle for process id [%d], returned error [%d], expected ERROR_ALREADY_EXISTS\n", i, GetLastError()); @@ -212,55 +209,51 @@ int GetParameters( int argc, char **argv) hThread[i] = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread,/* thread function */ + (LPTHREAD_START_ROUTINE)Run_Thread_mutex_shared,/* thread function */ (LPVOID)dwParam, /* argument to thread function */ 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ + &threadId[i] /* returns the thread identifier*/ ); - + if(hThread[i] == NULL) { Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); - } - + } + } - + if (!SetEvent(StartTestsEvHandle)) { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); + Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); + returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) for %d process returned %d, and GetLastError value is %d\n", USE_PROCESS_COUNT, returnCode, GetLastError()); testStatus = FAIL; } - - processStats.operationTime = GetTimeDiff(dwStartTime); - + + processStats.operationTime = GetTimeDiff(dwStartTime); + /* Write to a file*/ if(pFile!= NULL) - { + { for( i = 0; i < THREAD_COUNT; i++ ) - { + { buffer = (struct statistics *)resultBuffer->getResultBuffer(i); returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); -// Trace("Iteration %d over\n", i); - } } fclose(pFile); - + fprintf(pProcessFile, "%d,%d,%d\n", USE_PROCESS_COUNT, processStats.operationTime, processStats.relationId ); fclose(pProcessFile); /* Logging for the test case over, clean up the handles */ - -// Trace("Process Count %d over\n",USE_PROCESS_COUNT); - + for( i = 0; i < THREAD_COUNT; i++ ) { if(!CloseHandle(hThread[i]) ) @@ -280,16 +273,16 @@ int GetParameters( int argc, char **argv) { Trace("Error:%d: CloseHandle failed for Process [%d] hMutexHandle\n", GetLastError(), USE_PROCESS_COUNT); testStatus = FAIL; - } + } PAL_Terminate(); return testStatus; } -void PALAPI Run_Thread (LPVOID lpParam) +void PALAPI Run_Thread_mutex_shared (LPVOID lpParam) { unsigned int i = 0; - DWORD dwWaitResult; + DWORD dwWaitResult; struct statistics stats; DWORD dwStartTime; @@ -302,10 +295,10 @@ void PALAPI Run_Thread (LPVOID lpParam) stats.operationTime = 0; int Id=(int)lpParam; - - dwWaitResult = WaitForSingleObject( + + dwWaitResult = WaitForSingleObject( StartTestsEvHandle, // handle to mutex - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { @@ -317,35 +310,31 @@ void PALAPI Run_Thread (LPVOID lpParam) for( i = 0; i < REPEAT_COUNT; i++ ) { - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( hMutexHandle, // handle to mutex - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { -// Trace("Error while waiting for onject @ thread %d, # iter %d, Error Returned [%d]\n", Id, i, GetLastError()); stats.operationsFailed += 1; stats.operationsTotal += 1; testStatus = FAIL; continue; } - if (! ReleaseMutex(hMutexHandle)) - { + if (! ReleaseMutex(hMutexHandle)) + { // Deal with error. -// Trace("Error while releasing mutex @ thread %d # iter %d\n", Id, i); stats.operationsFailed += 1; stats.operationsTotal += 1; // Probably need to have while true loop to attempt to release mutex... testStatus = FAIL; continue; - } - + } + stats.operationsTotal += 1; - stats.operationsPassed += 1; -// Trace("Successs while releasing mutex @ iteration %d -> thread %d -> Process count %d\n", i, Id, USE_PROCESS_COUNT); - + stats.operationsPassed += 1; } - stats.operationTime = GetTimeDiff(dwStartTime); + stats.operationTime = GetTimeDiff(dwStartTime); if(resultBuffer->LogResult(Id, (char *)&stats)) { Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/CMakeLists.txt deleted file mode 100644 index 4eeff15aa731..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(nonshared) -add_subdirectory(shared) - diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/CMakeLists.txt deleted file mode 100644 index 4b35e86f613c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES - main.cpp - semaphore.cpp -) - -add_executable(paltest_semaphore_nonshared - ${SOURCES} -) - -add_dependencies(paltest_semaphore_nonshared coreclrpal) - -target_link_libraries(paltest_semaphore_nonshared - ${COMMON_TEST_LIBRARIES} - rt -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp index effe5c3527f8..99b0b2b2a553 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp @@ -83,7 +83,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_semaphore_nonshared_paltest_semaphore_nonshared, "composite/object_management/semaphore/nonshared/paltest_semaphore_nonshared") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp index 6c84a77c6c15..b37c1218d643 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp @@ -2,16 +2,16 @@ // The .NET Foundation licenses this file to you under the MIT license. /*============================================================ -** +** ** Source Code: main.c and semaphore.c ** main.c creates process and waits for all processes to get over ** semaphore.c creates a semaphore and then calls threads which will contend for the semaphore -** +** ** This test is for Object Management Test case for semaphore where Object type is not shareable. ** Algorithm ** o Create PROCESS_COUNT processes. -** o Main Thread of each process creates OBJECT_TYPE Object -** +** o Main Thread of each process creates OBJECT_TYPE Object +** ** Author: ShamitP ** ** @@ -34,7 +34,7 @@ struct statistics{ unsigned int processId; unsigned int operationsFailed; unsigned int operationsPassed; - unsigned int operationsTotal; + unsigned int operationsTotal; DWORD operationTime; unsigned int relationId; }; @@ -59,26 +59,24 @@ int testStatus; const char sTmpEventName[MAX_PATH] = "StartTestEvent"; -void PALAPI Run_Thread(LPVOID lpParam); +void PALAPI Run_Thread_semaphore_nonshared(LPVOID lpParam); int GetParameters( int argc, char **argv) { - if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) + if( (argc != 5) || ((argc == 1) && !strcmp(argv[1],"/?")) || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) { printf("PAL -Composite Object Management Semaphore Test\n"); printf("Usage:\n"); - printf("semaphore\n\t[USE_PROCESS_COUNT ( greater than 1] \n"); - printf("\t[THREAD_COUNT ( greater than 1] \n"); + printf("semaphore\n\t[USE_PROCESS_COUNT ( greater than 1] \n"); + printf("\t[THREAD_COUNT ( greater than 1] \n"); printf("\t[REPEAT_COUNT ( greater than 1]\n"); - printf("\t[RELATION_ID [greater than 1]\n"); + printf("\t[RELATION_ID [greater than 1]\n"); return -1; } - // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]); - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) + if( USE_PROCESS_COUNT < 0) { printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); return -1; @@ -92,14 +90,14 @@ int GetParameters( int argc, char **argv) } REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) + if( REPEAT_COUNT < 1) { printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); return -1; } RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) + if( RELATION_ID < 1) { printf("\nMain Process:Invalid RELATION_ID number, Pass greater than or Equal to 1\n"); return -1; @@ -108,12 +106,12 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_semaphore_nonshared_paltest_semaphore_nonshared, "composite/object_management/semaphore/nonshared/paltest_semaphore_nonshared") { unsigned int i = 0; HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; DWORD threadId[MAXIMUM_WAIT_OBJECTS]; - + const char *ObjName = "Semaphore"; DWORD dwParam = 0; @@ -128,7 +126,7 @@ int GetParameters( int argc, char **argv) /* Variables to capture the file name and the file pointer at process level*/ char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; + FILE *pProcessFile = NULL; struct ProcessStats processStats; DWORD dwStartTime; @@ -143,9 +141,8 @@ int GetParameters( int argc, char **argv) { Fail("Error in obtaining the parameters\n"); } - // Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT); - /* Register the start time */ + /* Register the start time */ dwStartTime = GetTickCount(); processStats.relationId = RELATION_ID; processStats.processId = USE_PROCESS_COUNT; @@ -153,7 +150,7 @@ int GetParameters( int argc, char **argv) _snprintf(processFileName, MAX_PATH, "%d_process_semaphore_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pProcessFile = fopen(processFileName, "w+"); if(pProcessFile == NULL) - { + { Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT); } @@ -162,7 +159,7 @@ int GetParameters( int argc, char **argv) _snprintf(fileName, MAX_PATH, "%d_thread_semaphore_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pFile = fopen(fileName, "w+"); if(pFile == NULL) - { + { Fail("Error in opening file for write for process [%d]\n", USE_PROCESS_COUNT); } // For each thread we will log operations failed (int), passed (int), total (int) @@ -178,7 +175,7 @@ int GetParameters( int argc, char **argv) { Fail("Error:%d: Unexpected failure " "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - + } /* Create StartTest Event */ @@ -186,9 +183,11 @@ int GetParameters( int argc, char **argv) NULL, /* lpSemaphoreAttributes */ lInitialCount, /*lInitialCount*/ lMaximumCount, /*lMaximumCount */ - NULL + NULL, + 0, + 0 ); - + if( hSemaphoreHandle == NULL) { Fail("Unable to create Semaphore handle for process id [%d], returned error [%d]\n", i, GetLastError()); @@ -202,10 +201,10 @@ int GetParameters( int argc, char **argv) hThread[i] = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread,/* thread function */ + (LPTHREAD_START_ROUTINE)Run_Thread_semaphore_nonshared,/* thread function */ (LPVOID)dwParam, /* argument to thread function */ 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ + &threadId[i] /* returns the thread identifier*/ ); @@ -213,16 +212,16 @@ int GetParameters( int argc, char **argv) { Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } - + } - + if (!SetEvent(StartTestsEvHandle)) { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); + Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); + returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); if( WAIT_OBJECT_0 != returnCode ) { @@ -230,24 +229,20 @@ int GetParameters( int argc, char **argv) testStatus = FAIL; } - processStats.operationTime = GetTimeDiff(dwStartTime); - + processStats.operationTime = GetTimeDiff(dwStartTime); + /* Write to a file*/ if(pFile!= NULL) - { + { for( i = 0; i < THREAD_COUNT; i++ ) - { + { buffer = (struct statistics *)resultBuffer->getResultBuffer(i); returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); - //Trace("Iteration %d over\n", i); - } } fclose(pFile); /* Logging for the test case over, clean up the handles */ -// Trace("Test Thread %d done\n", USE_PROCESS_COUNT); - for( i = 0; i < THREAD_COUNT; i++ ) { if(!CloseHandle(hThread[i]) ) @@ -267,16 +262,16 @@ int GetParameters( int argc, char **argv) { Trace("Error:%d: CloseHandle failed for Process [%d] hSemaphoreHandle\n", GetLastError(), USE_PROCESS_COUNT); testStatus = FAIL; - } + } PAL_Terminate(); return PASS; } -void PALAPI Run_Thread (LPVOID lpParam) +void PALAPI Run_Thread_semaphore_nonshared (LPVOID lpParam) { unsigned int i = 0; - DWORD dwWaitResult; + DWORD dwWaitResult; int Id=(int)lpParam; @@ -290,9 +285,9 @@ void PALAPI Run_Thread (LPVOID lpParam) stats.operationsTotal = 0; stats.operationTime = 0; - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( StartTestsEvHandle, // handle to start test handle - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { @@ -303,39 +298,34 @@ void PALAPI Run_Thread (LPVOID lpParam) for( i = 0; i < REPEAT_COUNT; i++ ) { - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( hSemaphoreHandle, // handle to Semaphore - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { -// Trace("Error while waiting for onject @ thread %d, # iter %d, RC is %d, Error is %d\n", Id, i, dwWaitResult, GetLastError()); stats.operationsFailed += 1; stats.operationsTotal += 1; testStatus = FAIL; continue; } - if (! ReleaseSemaphore(hSemaphoreHandle, 1, NULL)) - { + if (! ReleaseSemaphore(hSemaphoreHandle, 1, NULL)) + { // Deal with error. - // Trace("Error while releasing Semaphore @ thread %d # iter %d\n", Id, i); stats.operationsFailed += 1; stats.operationsTotal += 1; // Probably need to have while true loop to attempt to release semaphore... testStatus = FAIL; - continue; - } + continue; + } stats.operationsTotal += 1; - stats.operationsPassed += 1; -// Trace("Successs while releasing Semaphore @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT); - + stats.operationsPassed += 1; } - - stats.operationTime = GetTimeDiff(dwStartTime); + + stats.operationTime = GetTimeDiff(dwStartTime); if(resultBuffer->LogResult(Id, (char *)&stats)) { Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); } - // Trace("Thread %d over for process %d\n", Id, USE_PROCESS_COUNT); } diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/CMakeLists.txt deleted file mode 100644 index 92fb32ab3d8d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES - main.cpp - semaphore.cpp -) - -add_executable(paltest_semaphore_shared - ${SOURCES} -) - -add_dependencies(paltest_semaphore_shared coreclrpal) - -target_link_libraries(paltest_semaphore_shared - ${COMMON_TEST_LIBRARIES} - rt -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp index fd9167d487ad..df1ea1f7bea3 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp @@ -2,16 +2,16 @@ // The .NET Foundation licenses this file to you under the MIT license. /*============================================================ -** +** ** Source Code: main.c and semaphore.c ** main.c creates process and waits for all processes to get over ** semaphore.c creates a semaphore and then calls threads which will contend for the semaphore -** +** ** This test is for Object Management Test case for semaphore where Object type is shareable. ** Algorithm ** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object -** +** o Create PROCESS_COUNT processes aware of the Shared Object +** ** ** **============================================================ @@ -44,21 +44,21 @@ struct TestStats{ int GetParameters( int argc, char **argv) { - if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) + if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) { printf("PAL -Composite Object Management event Test\n"); printf("Usage:\n"); - printf("main\n\t[PROCESS_COUNT (greater than 1)] \n"); - printf("\t[THREAD_COUNT (greater than 1)] \n"); + printf("main\n\t[PROCESS_COUNT (greater than 1)] \n"); + printf("\t[THREAD_COUNT (greater than 1)] \n"); printf("\t[REPEAT_COUNT (greater than 1)]\n"); - printf("\t[RELATION_ID [greater than or equal to 1]\n"); + printf("\t[RELATION_ID [greater than or equal to 1]\n"); printf("\t[Object Name Suffix]\n"); return -1; } PROCESS_COUNT = atoi(argv[1]); - if( (PROCESS_COUNT < 1) || (PROCESS_COUNT > MAXIMUM_WAIT_OBJECTS) ) + if( (PROCESS_COUNT < 1) || (PROCESS_COUNT > MAXIMUM_WAIT_OBJECTS) ) { printf("\nMain Process:Invalid PROCESS_COUNT number, Pass greater than 1 and less than PROCESS_COUNT %d\n", MAXIMUM_WAIT_OBJECTS); return -1; @@ -72,20 +72,20 @@ int GetParameters( int argc, char **argv) } REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) + if( REPEAT_COUNT < 1) { printf("\nMain Process:Invalid REPEAT_COUNT number, Pass greater than 1\n"); return -1; } RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) + if( RELATION_ID < 1) { printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); return -1; } - + if(argc == 6) { strncpy(objectSuffix, argv[5], MAX_PATH-1); @@ -94,7 +94,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_semaphore_shared_paltest_semaphore_shared, "composite/object_management/semaphore/shared/paltest_semaphore_shared") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; @@ -121,11 +121,11 @@ int GetParameters( int argc, char **argv) } /* -"While the new PAL does support named semaphore it's unclear -if we should change the Windows PAL, since we share that w/ Rotor -and they are still using the old PAL. For the time being it may -make the most sense to just skip the named semaphore test on Windows -- from an object management perspective it doesn't really gain +"While the new PAL does support named semaphore it's unclear +if we should change the Windows PAL, since we share that w/ Rotor +and they are still using the old PAL. For the time being it may +make the most sense to just skip the named semaphore test on Windows +- from an object management perspective it doesn't really gain us anything over what we already have." */ ZeroMemory( objectSuffix, MAX_PATH ); @@ -134,13 +134,13 @@ us anything over what we already have." { Fail("Error in obtaining the parameters\n"); } - + if(argc == 6) { strncat(ObjName, objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) ); } - /* Register the start time */ + /* Register the start time */ dwStartTime = GetTickCount(); testStats.relationId = RELATION_ID; testStats.processCount = PROCESS_COUNT; @@ -151,7 +151,7 @@ us anything over what we already have." _snprintf(fileName, MAX_PATH, "main_semaphore_%d_.txt", RELATION_ID); pFile = fopen(fileName, "w+"); if(pFile == NULL) - { + { Fail("Error in opening main file for write\n"); } @@ -159,14 +159,16 @@ us anything over what we already have." NULL, /* lpSemaphoreAttributes */ lInitialCount, /*lInitialCount*/ lMaximumCount, /*lMaximumCount */ - ObjName + ObjName, + 0, + 0 ); - + if( hSemaphoreHandle == NULL) { Fail("Unable to create shared Semaphore handle @ Main returned error [%d]\n", GetLastError()); } - + for( i = 0; i < PROCESS_COUNT; i++ ) { @@ -177,7 +179,7 @@ us anything over what we already have." Fail("Error: Insufficient semaphore name string length for %s for iteration [%d]\n", ObjName, i); } - + /* Zero the data structure space */ ZeroMemory ( &pi[i], sizeof(pi[i]) ); ZeroMemory ( &si[i], sizeof(si[i]) ); @@ -208,7 +210,7 @@ us anything over what we already have." } - returnCode = WaitForMultipleObjects( PROCESS_COUNT, hProcess, TRUE, INFINITE); + returnCode = WaitForMultipleObjects( PROCESS_COUNT, hProcess, TRUE, INFINITE); if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) @ Main thread for %d processes returned %d, and GetLastError value is %d\n", PROCESS_COUNT, returnCode, GetLastError()); @@ -220,15 +222,15 @@ us anything over what we already have." /* check the exit code from the process */ if( ! GetExitCodeProcess( pi[i].hProcess, &processReturnCode ) ) { - Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n", - i, GetLastError() ); - + Trace( "GetExitCodeProcess call failed for iteration %d with error code %u\n", + i, GetLastError() ); + testReturnCode = FAIL; } if(processReturnCode == FAIL) { - Trace( "Process [%d] failed and returned FAIL\n", i); + Trace( "Process [%d] failed and returned FAIL\n", i); testReturnCode = FAIL; } @@ -245,7 +247,7 @@ us anything over what we already have." } } - testStats.operationTime = GetTimeDiff(dwStartTime); + testStats.operationTime = GetTimeDiff(dwStartTime); fprintf(pFile, "%d,%d,%d,%d,%d,%s\n", testStats.operationTime, testStats.relationId, testStats.processCount, testStats.threadCount, testStats.repeatCount, testStats.buildNumber); if(fclose(pFile)) { @@ -257,8 +259,8 @@ us anything over what we already have." { Trace("Error:%d: CloseHandle failed for hSemaphoreHandle\n", GetLastError()); testReturnCode = FAIL; - - } + + } if( testReturnCode == PASS) { diff --git a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp index 251e4d2fdcc5..bcad3c3ada42 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp @@ -2,16 +2,16 @@ // The .NET Foundation licenses this file to you under the MIT license. /*============================================================ -** +** ** Source Code: main.c and semaphore.c ** main.c creates process and waits for all processes to get over ** semaphore.c creates a semaphore and then calls threads which will contend for the semaphore -** +** ** This test is for Object Management Test case for semaphore where Object type is shareable. ** Algorithm ** o Main Process Creates OBJECT_TYPE Object -** o Create PROCESS_COUNT processes aware of the Shared Object -** +** o Create PROCESS_COUNT processes aware of the Shared Object +** ** ** **============================================================ @@ -33,7 +33,7 @@ struct statistics{ unsigned int processId; unsigned int operationsFailed; unsigned int operationsPassed; - unsigned int operationsTotal; + unsigned int operationsTotal; DWORD operationTime; unsigned int relationId; }; @@ -59,25 +59,25 @@ int testStatus; const char sTmpEventName[MAX_PATH] = "StartTestEvent"; char objectSuffix[MAX_PATH]; -void PALAPI Run_Thread(LPVOID lpParam); +void PALAPI Run_Thread_semaphore_shared(LPVOID lpParam); int GetParameters( int argc, char **argv) { - if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) + if( (!((argc == 5) || (argc == 6) ) )|| ((argc == 1) && !strcmp(argv[1],"/?")) || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) { printf("PAL -Composite Object Management event Test\n"); printf("Usage:\n"); - printf("main\n\t[PROCESS_COUNT (greater than 1)] \n"); - printf("\t[THREAD_COUNT (greater than 1)] \n"); + printf("main\n\t[PROCESS_COUNT (greater than 1)] \n"); + printf("\t[THREAD_COUNT (greater than 1)] \n"); printf("\t[REPEAT_COUNT (greater than 1)]\n"); - printf("\t[RELATION_ID [greater than or equal to 1]\n"); + printf("\t[RELATION_ID [greater than or equal to 1]\n"); printf("\t[Object Name Suffix]\n"); return -1; } USE_PROCESS_COUNT = atoi(argv[1]); - if(USE_PROCESS_COUNT < 0) + if(USE_PROCESS_COUNT < 0) { printf("\nMain Process:Invalid PROCESS_COUNT number, Pass greater than 0 \n"); return -1; @@ -91,19 +91,19 @@ int GetParameters( int argc, char **argv) } REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) + if( REPEAT_COUNT < 1) { printf("\nMain Process:Invalid REPEAT_COUNT number, Pass greater than 1\n"); return -1; } RELATION_ID = atoi(argv[4]); - if( RELATION_ID < 1) + if( RELATION_ID < 1) { printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); return -1; } - + if(argc == 6) { strncpy(objectSuffix, argv[5], MAX_PATH-1); @@ -112,12 +112,12 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_object_management_semaphore_shared_paltest_semaphore_shared, "composite/object_management/semaphore/shared/paltest_semaphore_shared") { unsigned int i = 0; HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; DWORD threadId[MAXIMUM_WAIT_OBJECTS]; - + char ObjName[MAX_PATH] = "SHARED_SEMAPHORE"; DWORD dwParam = 0; @@ -131,7 +131,7 @@ int GetParameters( int argc, char **argv) /* Variables to capture the file name and the file pointer at process level*/ char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; + FILE *pProcessFile = NULL; struct ProcessStats processStats; DWORD dwStartTime; @@ -148,14 +148,13 @@ int GetParameters( int argc, char **argv) { Fail("Error in obtaining the parameters\n"); } -// Trace("Process created, value of process count is [%d]\n", USE_PROCESS_COUNT); if(argc == 6) { strncat(ObjName , objectSuffix, MAX_PATH - (sizeof(ObjName) + 1) ); } - /* Register the start time */ + /* Register the start time */ dwStartTime = GetTickCount(); processStats.relationId = RELATION_ID; processStats.processId = USE_PROCESS_COUNT; @@ -163,22 +162,22 @@ int GetParameters( int argc, char **argv) _snprintf(processFileName, MAX_PATH, "%d_process_semaphore_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pProcessFile = fopen(processFileName, "w+"); if(pProcessFile == NULL) - { + { Fail("Error in opening process File file for write for process [%d]\n", USE_PROCESS_COUNT); } statisticsSize = sizeof(struct statistics); _snprintf(fileName, MAX_PATH, "%d_thread_semaphore_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); - pFile = fopen(fileName, "w+"); + pFile = fopen(fileName, "w+"); if(pFile == NULL) - { + { Fail("Error in opening file for write for process [%d]\n", USE_PROCESS_COUNT); } // For each thread we will log operations failed (int), passed (int), total (int) // and number of ticks (DWORD) for the operations resultBuffer = new ResultBuffer( THREAD_COUNT, statisticsSize); - + /* Create Start Tests event */ StartTestsEvHandle = CreateEvent( NULL, /* lpEventAttributes*/ TRUE, /* bManualReset */ @@ -189,16 +188,18 @@ int GetParameters( int argc, char **argv) { Fail("Error:%d: Unexpected failure " "to create %s Event for process count %d\n", GetLastError(), sTmpEventName, USE_PROCESS_COUNT ); - + } hSemaphoreHandle = CreateSemaphore( NULL, /* lpSemaphoreAttributes */ lInitialCount, /*lInitialCount*/ lMaximumCount, /*lMaximumCount */ - ObjName + ObjName, + 0, + 0 ); - + if( (hSemaphoreHandle == NULL) || (GetLastError() != ERROR_ALREADY_EXISTS) ) { @@ -214,10 +215,10 @@ int GetParameters( int argc, char **argv) hThread[i] = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread,/* thread function */ + (LPTHREAD_START_ROUTINE)Run_Thread_semaphore_shared,/* thread function */ (LPVOID)dwParam, /* argument to thread function */ 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ + &threadId[i] /* returns the thread identifier*/ ); if(hThread[i] == NULL) @@ -225,14 +226,14 @@ int GetParameters( int argc, char **argv) Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } } - + if (!SetEvent(StartTestsEvHandle)) { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); + Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } /* Test running */ - returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); + returnCode = WaitForMultipleObjects( THREAD_COUNT, hThread, TRUE, INFINITE); if( WAIT_OBJECT_0 != returnCode ) { @@ -240,23 +241,20 @@ int GetParameters( int argc, char **argv) testStatus = FAIL; } - processStats.operationTime = GetTimeDiff(dwStartTime); + processStats.operationTime = GetTimeDiff(dwStartTime); /* Write to a file*/ if(pFile!= NULL) - { + { for( i = 0; i < THREAD_COUNT; i++ ) - { + { buffer = (struct statistics *)resultBuffer->getResultBuffer(i); returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); -// Trace("Iteration %d over\n", i); - } } fclose(pFile); /* Logging for the test case over, clean up the handles */ -// Trace("Test Thread %d done\n", USE_PROCESS_COUNT); for( i = 0; i < THREAD_COUNT; i++ ) { if(!CloseHandle(hThread[i]) ) @@ -276,16 +274,16 @@ int GetParameters( int argc, char **argv) { Trace("Error:%d: CloseHandle failed for Process [%d] hSemaphoreHandle\n", GetLastError(), USE_PROCESS_COUNT); testStatus = FAIL; - } + } PAL_Terminate(); return PASS; } -void PALAPI Run_Thread (LPVOID lpParam) +void PALAPI Run_Thread_semaphore_shared (LPVOID lpParam) { unsigned int i = 0; - DWORD dwWaitResult; + DWORD dwWaitResult; int Id=(int)lpParam; @@ -299,9 +297,9 @@ void PALAPI Run_Thread (LPVOID lpParam) stats.operationsTotal = 0; stats.operationTime = 0; - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( StartTestsEvHandle, // handle to start test handle - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { @@ -312,39 +310,34 @@ void PALAPI Run_Thread (LPVOID lpParam) for( i = 0; i < REPEAT_COUNT; i++ ) { - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( hSemaphoreHandle, // handle to Semaphore - TIMEOUT); + TIMEOUT); if(dwWaitResult != WAIT_OBJECT_0) { -// Trace("Error while waiting for onject @ thread %d, # iter %d, RC is %d, Error is %d\n", Id, i, dwWaitResult, GetLastError()); stats.operationsFailed += 1; stats.operationsTotal += 1; testStatus = FAIL; continue; } - if (! ReleaseSemaphore(hSemaphoreHandle, 1, NULL)) - { + if (! ReleaseSemaphore(hSemaphoreHandle, 1, NULL)) + { // Deal with error. - // Trace("Error while releasing Semaphore @ thread %d # iter %d\n", Id, i); stats.operationsFailed += 1; stats.operationsTotal += 1; // Probably need to have while true loop to attempt to release semaphore.. testStatus = FAIL; - continue; - } - + continue; + } + stats.operationsTotal += 1; - stats.operationsPassed += 1; -// Trace("Successs while releasing Semaphore @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT); - + stats.operationsPassed += 1; } - - stats.operationTime = GetTimeDiff(dwStartTime); + + stats.operationTime = GetTimeDiff(dwStartTime); if(resultBuffer->LogResult(Id, (char *)&stats)) { Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); } - // Trace("Thread %d over for process %d\n", Id, USE_PROCESS_COUNT); } diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/CMakeLists.txt deleted file mode 100644 index e21f4d367d3d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(criticalsection) -add_subdirectory(nativecriticalsection) -add_subdirectory(nativecs_interlocked) - diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/CMakeLists.txt deleted file mode 100644 index 8b7b607baafc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(SOURCES - criticalsection.cpp - mainWrapper.cpp -) - -add_executable(paltest_synchronization_criticalsection - ${SOURCES} -) - -add_dependencies(paltest_synchronization_criticalsection coreclrpal) - -target_link_libraries(paltest_synchronization_criticalsection - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.cpp b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.cpp index 60a41283ee22..641c0fdcf355 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.cpp @@ -210,7 +210,7 @@ enterandleavecs( LPVOID lpParam ) } -int __cdecl main (int argc, char **argv) +PALTEST(composite_synchronization_criticalsection_paltest_synchronization_criticalsection, "composite/synchronization/criticalsection/paltest_synchronization_criticalsection") { /* diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.cpp b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.cpp index 7f9659dd9973..da99d5ef3588 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.cpp @@ -87,7 +87,7 @@ int GetParameters( int argc, char **argv) } //Main entry point for the application - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_synchronization_criticalsection_paltest_synchronization_criticalsection, "composite/synchronization/criticalsection/paltest_synchronization_criticalsection") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; //Array to hold Process handles diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/CMakeLists.txt deleted file mode 100644 index 6ba585256869..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES - mtx_critsect.cpp - pal_composite_native_cs.cpp - resultbuffer.cpp -) - -add_executable(paltest_synchronization_nativecriticalsection - ${SOURCES} -) - -add_dependencies(paltest_synchronization_nativecriticalsection coreclrpal) - -target_link_libraries(paltest_synchronization_nativecriticalsection - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp index a36931205a5d..ba077cba615e 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp @@ -66,7 +66,7 @@ ULONGLONG getPerfCallibrationValue(void); -extern int main(int argc, char **argv) +PALTEST(composite_synchronization_nativecriticalsection_paltest_synchronization_nativecriticalsection, "composite/synchronization/nativecriticalsection/paltest_synchronization_nativecriticalsection") { //Variable Declaration pthread_t pthreads[640]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/resultbuffer.cpp b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/resultbuffer.cpp index e99e31ff31d3..32e8f92b3e08 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/resultbuffer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/resultbuffer.cpp @@ -3,11 +3,6 @@ //#include "stdafx.h" #include "resultbuffer.h" -// -//#using -// -//using namespace System; - ResultBuffer:: ResultBuffer(int ThreadCount, int ThreadLogSize) { diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/CMakeLists.txt deleted file mode 100644 index 90f52dd46d3d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -set(SOURCES - interlocked.cpp - mtx_critsect.cpp - pal_composite_native_cs.cpp - resultbuffer.cpp -) - -add_executable(paltest_synchronization_nativecs_interlocked - ${SOURCES} -) - -add_dependencies(paltest_synchronization_nativecs_interlocked coreclrpal) - -target_link_libraries(paltest_synchronization_nativecs_interlocked - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp index 18d967423771..3f1d31e5d1b0 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp @@ -66,7 +66,7 @@ ULONGLONG getPerfCallibrationValue(void); -extern int main(int argc, char **argv) +PALTEST(composite_synchronization_nativecs_interlocked_paltest_synchronization_nativecs_interlocked, "composite/synchronization/nativecs_interlocked/paltest_synchronization_nativecs_interlocked") { //Variable Declaration pthread_t pthreads[640]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/resultbuffer.cpp b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/resultbuffer.cpp index e99e31ff31d3..32e8f92b3e08 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/resultbuffer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/resultbuffer.cpp @@ -3,11 +3,6 @@ //#include "stdafx.h" #include "resultbuffer.h" -// -//#using -// -//using namespace System; - ResultBuffer:: ResultBuffer(int ThreadCount, int ThreadLogSize) { diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/threading/CMakeLists.txt deleted file mode 100644 index 2b4f0ea8a631..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(threadsuspension) -add_subdirectory(threadsuspension_switchthread) - diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/CMakeLists.txt deleted file mode 100644 index a931f974273d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(SOURCES - mainWrapper.cpp - threadsuspension.cpp -) - -add_executable(paltest_threading_threadsuspension - ${SOURCES} -) - -add_dependencies(paltest_threading_threadsuspension coreclrpal) - -target_link_libraries(paltest_threading_threadsuspension - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.cpp b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.cpp index 4366f26137ee..72a1b3d9ce45 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.cpp @@ -87,7 +87,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_threading_threadsuspension_paltest_threading_threadsuspension, "composite/threading/threadsuspension/paltest_threading_threadsuspension") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/samplefile.dat b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/samplefile.dat deleted file mode 100644 index d6505f2549b9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/samplefile.dat +++ /dev/null @@ -1,5124 +0,0 @@ -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense blackasdf dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.cpp b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.cpp index 2e2539445e37..ede0e4b7580e 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.cpp @@ -138,7 +138,7 @@ int GetParameters(int, char * *); //Main Entry for the Thread Suspension Test Case -int __cdecl main (int argc, char **argv) +PALTEST(composite_threading_threadsuspension_paltest_threading_threadsuspension, "composite/threading/threadsuspension/paltest_threading_threadsuspension") { /* diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/CMakeLists.txt deleted file mode 100644 index 0d6a8fbdbfb2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(SOURCES - mainWrapper.cpp - threadsuspension.cpp -) - -add_executable(paltest_threading_threadsuspension_switchthread - ${SOURCES} -) - -add_dependencies(paltest_threading_threadsuspension_switchthread coreclrpal) - -target_link_libraries(paltest_threading_threadsuspension_switchthread - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.cpp b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.cpp index 4366f26137ee..1f95d7dced47 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.cpp @@ -87,7 +87,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_threading_threadsuspension_switchthread_paltest_threading_threadsuspension_switchthread, "composite/threading/threadsuspension_switchthread/paltest_threading_threadsuspension_switchthread") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/samplefile.dat b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/samplefile.dat deleted file mode 100644 index d6505f2549b9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/samplefile.dat +++ /dev/null @@ -1,5124 +0,0 @@ -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense blackasdf dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. -By Patricia Reaney -LONDON (Reuters) - Europe, Africa and the Middle East are the best vantage points to see the first transit of Venus across the sun in more than a century on Tuesday, scientists said. - -Mostly clear skies are forecast in many parts of the three regions, but people were urged to be careful if they watch the rare event when it begins at 1:19 a.m. EDT because it could cause blindness. Views will be restricted from Asia and the Americas. - -Unlike a solar eclipse by the moon that is over in two or three minutes, Venus's transit -- which last occurred in 1882 -- will go on for six hours. - -The planet will appear as an intense black dot on the solar disc. - -Most of the sun will be visible as Venus crosses to the right from the bottom left side of the solar disc. Venus will be 26.7 million miles from earth. - -"Venus will be about 1/30 the size of the diameter of the sun, but it will be much darker and more intense than sunspots," said Dr Robert Walsh, of the University of Central Lancashire's Center for Astrophysics in northern England. - -Scientists recommend some form of indirect projection as the safest way to observe the phenomenon. - -"Never ever look directly at the sun with the naked eye or any sort of optical equipment -- telescope, binoculars or even digital camera," said Walsh. - -"Even if you glance at the sun for a short period of time you can damage your eye and lose some of your sight," he said. - -Internet sites will be covering the transit and observatories around the world have organized viewings. - -"Mainly Western Europe could see some high cloud that might prevent people from seeing it," said a spokesman for Britain's Meteorological Office. "The rest of Europe shouldn't be too bad. It should be fine." - -German astronomer Johannes Kepler first predicted a transit of Venus in 1627 but he died before he could witness one. English astronomer Jeremiah Horrocks first observed it in 1639. - -The transit occurs four times in every 243 years. There are two December transits, eight years apart, and then 121.5 years later there are two June transits, also eight years apart. After another 105.5 years the cycle begins again. - -The next transit will occur in 2012 when it will be visible from parts of Asia and the Pacific but not Europe. diff --git a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.cpp b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.cpp index da445a06570d..8ccf29d01f85 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.cpp @@ -138,7 +138,7 @@ int GetParameters(int, char * *); //Main Entry for the Thread Suspension Test Case -int __cdecl main (int argc, char **argv) +PALTEST(composite_threading_threadsuspension_switchthread_paltest_threading_threadsuspension_switchthread, "composite/threading/threadsuspension_switchthread/paltest_threading_threadsuspension_switchthread") { /* diff --git a/src/coreclr/src/pal/tests/palsuite/composite/wfmo/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/composite/wfmo/CMakeLists.txt deleted file mode 100644 index 11cc57108a9d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/composite/wfmo/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES - main.cpp - mutex.cpp -) - -add_executable(paltest_composite_wfmo - ${SOURCES} -) - -add_dependencies(paltest_composite_wfmo coreclrpal) - -target_link_libraries(paltest_composite_wfmo - ${COMMON_TEST_LIBRARIES} - rt -) diff --git a/src/coreclr/src/pal/tests/palsuite/composite/wfmo/main.cpp b/src/coreclr/src/pal/tests/palsuite/composite/wfmo/main.cpp index 43c5b98c7b3b..599109fb142e 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/wfmo/main.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/wfmo/main.cpp @@ -97,7 +97,7 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_wfmo_paltest_composite_wfmo, "composite/wfmo/paltest_composite_wfmo") { unsigned int i = 0; HANDLE hProcess[MAXIMUM_WAIT_OBJECTS]; diff --git a/src/coreclr/src/pal/tests/palsuite/composite/wfmo/mutex.cpp b/src/coreclr/src/pal/tests/palsuite/composite/wfmo/mutex.cpp index 5d2310fcfb19..82f59880c404 100644 --- a/src/coreclr/src/pal/tests/palsuite/composite/wfmo/mutex.cpp +++ b/src/coreclr/src/pal/tests/palsuite/composite/wfmo/mutex.cpp @@ -4,13 +4,13 @@ /*============================================================ **Source Code: main.c and mutex.c ** main.c creates process and waits for all processes to get over -** mutex.c creates a mutex and then calls threads which will +** mutex.c creates a mutex and then calls threads which will ** contend for the mutex ** ** This test is for WFMO Test case for Mutex ** Algorithm ** o Create PROCESS_COUNT processes. -** o Main Thread of each process creates OBJECT_TYPE Object +** o Main Thread of each process creates OBJECT_TYPE Object ** ** Author: ShamitP ** @@ -35,7 +35,7 @@ struct statistics{ unsigned int processId; unsigned int operationsFailed; unsigned int operationsPassed; - unsigned int operationsTotal; + unsigned int operationsTotal; DWORD operationTime; unsigned int relationId; @@ -56,29 +56,26 @@ ResultBuffer *resultBuffer = NULL; int testStatus; -void PALAPI Run_Thread(LPVOID lpParam); +void PALAPI Run_Thread_composite_wfmo(LPVOID lpParam); int GetParameters( int argc, char **argv) { - if( (argc != 6) || ((argc == 1) && !strcmp(argv[1],"/?")) + if( (argc != 6) || ((argc == 1) && !strcmp(argv[1],"/?")) || !strcmp(argv[1],"/h") || !strcmp(argv[1],"/H")) { printf("PAL -Composite WFMO Test\n"); printf("Usage:\n"); - printf("mutex\n\t[USE_PROCESS_COUNT [greater than 0] \n"); - printf("\t[THREAD_COUNT [greater than 0] \n"); + printf("mutex\n\t[USE_PROCESS_COUNT [greater than 0] \n"); + printf("\t[THREAD_COUNT [greater than 0] \n"); printf("\t[REPEAT_COUNT [greater than 0]\n"); printf("\t[SLEEP_LENGTH [greater than 0]\n"); - printf("\t[RELATION_ID [greater than 0]\n"); - - + printf("\t[RELATION_ID [greater than 0]\n"); + return -1; } - // Trace("Args 1 is [%s], Arg 2 is [%s], Arg 3 is [%s]\n", argv[1], argv[2], argv[3]); - USE_PROCESS_COUNT = atoi(argv[1]); - if( USE_PROCESS_COUNT < 0) + if( USE_PROCESS_COUNT < 0) { printf("\nInvalid USE_PROCESS_COUNT number, Pass greater than 1\n"); return -1; @@ -92,21 +89,21 @@ int GetParameters( int argc, char **argv) } REPEAT_COUNT = atoi(argv[3]); - if( REPEAT_COUNT < 1) + if( REPEAT_COUNT < 1) { printf("\nInvalid REPEAT_COUNT number, Pass greater than 1\n"); return -1; } SLEEP_LENGTH = atoi(argv[4]); - if( SLEEP_LENGTH < 1) + if( SLEEP_LENGTH < 1) { printf("\nMain Process:Invalid SLEEP_LENGTH number, Pass greater than 1\n"); return -1; } RELATION_ID = atoi(argv[5]); - if( RELATION_ID < 1) + if( RELATION_ID < 1) { printf("\nMain Process:Invalid RELATION_ID number, Pass greater than 1\n"); return -1; @@ -115,13 +112,13 @@ int GetParameters( int argc, char **argv) return 0; } - int __cdecl main(INT argc, CHAR **argv) +PALTEST(composite_wfmo_paltest_composite_wfmo, "composite/wfmo/paltest_composite_wfmo") { - unsigned int i = 0; + unsigned int i = 0; HANDLE hThread[MAXIMUM_WAIT_OBJECTS]; DWORD threadId[MAXIMUM_WAIT_OBJECTS]; int returnCode = 0; - + DWORD dwParam = 0; /* Variables to capture the file name and the file pointer at thread level*/ @@ -132,7 +129,7 @@ int GetParameters( int argc, char **argv) /* Variables to capture the file name and the file pointer at process level*/ char processFileName[MAX_PATH]; - FILE *pProcessFile = NULL; + FILE *pProcessFile = NULL; struct ProcessStats processStats; DWORD dwStartTime; @@ -147,9 +144,8 @@ int GetParameters( int argc, char **argv) { Fail("Error in obtaining the parameters\n"); } -// Trace("Process created, value of process count is [%d] and no. of threads is [%d]\n", USE_PROCESS_COUNT, THREAD_COUNT); - /* Register the start time */ + /* Register the start time */ dwStartTime = GetTickCount(); processStats.relationId = RELATION_ID; processStats.processId = USE_PROCESS_COUNT; @@ -157,7 +153,7 @@ int GetParameters( int argc, char **argv) _snprintf(processFileName, MAX_PATH, "%d_process_wfmo_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pProcessFile = fopen(processFileName, "w+"); if(pProcessFile == NULL) - { + { Fail("Error:%d: in opening Process File for write for process [%d]\n", GetLastError(), USE_PROCESS_COUNT); } @@ -166,7 +162,7 @@ int GetParameters( int argc, char **argv) _snprintf(fileName, MAX_PATH, "%d_thread_wfmo_%d_.txt", USE_PROCESS_COUNT, RELATION_ID); pFile = fopen(fileName, "w+"); if(pFile == NULL) - { + { Fail("Error in opening file for write for process [%d], error [%d]\n", USE_PROCESS_COUNT, GetLastError()); } // For each thread we will log operations failed (int), passed (int), total (int) @@ -182,16 +178,16 @@ int GetParameters( int argc, char **argv) { Fail("Error:%d: Unexpected failure " "to create start tests Event for process count %d\n", GetLastError(), USE_PROCESS_COUNT ); - + } /* Create StartTest Event */ hMutexHandle = CreateMutex( NULL, FALSE, /* bInitialOwner, owns initially */ - NULL + NULL ); - + if( hMutexHandle == NULL) { Fail("Unable to create Mutex handle for process id [%d], returned error [%d]\n", i, GetLastError()); @@ -205,22 +201,21 @@ int GetParameters( int argc, char **argv) hThread[i] = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE)Run_Thread,/* thread function */ + (LPTHREAD_START_ROUTINE)Run_Thread_composite_wfmo,/* thread function */ (LPVOID)dwParam, /* argument to thread function */ 0, /* use default creation flags */ - &threadId[i] /* returns the thread identifier*/ + &threadId[i] /* returns the thread identifier*/ ); if(hThread[i] == NULL) { Fail("Create Thread failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } - - } - + } + if (!SetEvent(StartTestsEvHandle)) { - Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); + Fail("Set Event for Start Tests failed for %d process, and GetLastError value is %d\n", USE_PROCESS_COUNT, GetLastError()); } /* Test running */ @@ -230,7 +225,7 @@ int GetParameters( int argc, char **argv) } else { - returnCode = WaitForSingleObject(hThread[0], INFINITE); + returnCode = WaitForSingleObject(hThread[0], INFINITE); } if( WAIT_OBJECT_0 != returnCode ) @@ -239,17 +234,15 @@ int GetParameters( int argc, char **argv) testStatus = FAIL; } - processStats.operationTime = GetTimeDiff(dwStartTime); + processStats.operationTime = GetTimeDiff(dwStartTime); /* Write to a file*/ if(pFile!= NULL) - { + { for( i = 0; i < THREAD_COUNT; i++ ) - { + { buffer = (struct statistics *)resultBuffer->getResultBuffer(i); returnCode = fprintf(pFile, "%d,%d,%d,%d,%lu,%d\n", buffer->processId, buffer->operationsFailed, buffer->operationsPassed, buffer->operationsTotal, buffer->operationTime, buffer->relationId ); - //Trace("Iteration %d over\n", i); - } } if(fclose(pFile)) @@ -266,8 +259,6 @@ int GetParameters( int argc, char **argv) } /* Logging for the test case over, clean up the handles */ - // Trace("Test Process %d done\n", USE_PROCESS_COUNT); - //Trace("Contents of the buffer are [%s]\n", resultBuffer->getResultBuffer()); for( i = 0; i < THREAD_COUNT; i++ ) { if(!CloseHandle(hThread[i]) ) @@ -287,12 +278,12 @@ int GetParameters( int argc, char **argv) return testStatus; } -void PALAPI Run_Thread (LPVOID lpParam) +void PALAPI Run_Thread_composite_wfmo (LPVOID lpParam) { unsigned int i = 0; struct statistics stats; - DWORD dwWaitResult; + DWORD dwWaitResult; DWORD dwStartTime; stats.relationId = RELATION_ID; @@ -303,10 +294,10 @@ void PALAPI Run_Thread (LPVOID lpParam) stats.operationTime = 0; int Id=(int)lpParam; - - dwWaitResult = WaitForSingleObject( + + dwWaitResult = WaitForSingleObject( StartTestsEvHandle, // handle to mutex - INFINITE); + INFINITE); if(dwWaitResult != WAIT_OBJECT_0) { @@ -320,10 +311,10 @@ void PALAPI Run_Thread (LPVOID lpParam) /* Run the tests repeat count times */ for( i = 0; i < REPEAT_COUNT; i++ ) { - dwWaitResult = WaitForSingleObject( + dwWaitResult = WaitForSingleObject( hMutexHandle, // handle to mutex - INFINITE); - + INFINITE); + if(dwWaitResult != WAIT_OBJECT_0) { Trace("Error:%d: while waiting for onject @ thread %d, # iter %d\n", GetLastError(), Id, i); @@ -335,8 +326,8 @@ void PALAPI Run_Thread (LPVOID lpParam) Sleep(SLEEP_LENGTH); - if (!ReleaseMutex(hMutexHandle)) - { + if (!ReleaseMutex(hMutexHandle)) + { // Deal with error. Trace("Error:%d: while releasing mutex @ thread %d # iter %d\n", GetLastError(), Id, i); stats.operationsFailed += 1; @@ -344,21 +335,16 @@ void PALAPI Run_Thread (LPVOID lpParam) // do we need to have while true loop to attempt to release mutex...? testStatus = FAIL; continue; - } + } stats.operationsTotal += 1; stats.operationsPassed += 1; - -// Trace("Successs while releasing mutex @ iteration %d -> thread %d -> Process %d\n", i, Id, USE_PROCESS_COUNT); - } - - stats.operationTime = GetTimeDiff(dwStartTime); - // Trace("Operation Time %lu, Process Count [%d], ThreadCount[%d]\n", stats.operationTime, USE_PROCESS_COUNT, Id); + + stats.operationTime = GetTimeDiff(dwStartTime); if(resultBuffer->LogResult(Id, (char *)&stats)) { Fail("Error:%d: while writing to shared memory, Thread Id is[%d] and Process id is [%d]\n", GetLastError(), Id, USE_PROCESS_COUNT); } - // Trace("Contents of the buffer are after thread [%d]\n", Id); } diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/CMakeLists.txt deleted file mode 100644 index 62493c1ee4f4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# TODO: make these tests compile -# add_subdirectory(DebugBreak) -# add_subdirectory(WriteProcessMemory) - -add_subdirectory(OutputDebugStringA) -add_subdirectory(OutputDebugStringW) - diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/CMakeLists.txt deleted file mode 100644 index 0614c48de9ef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_debugbreak_test1 - ${SOURCES} -) - -add_dependencies(paltest_debugbreak_test1 coreclrpal) - -target_link_libraries(paltest_debugbreak_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.cpp index b0872c3f37d1..6c0bf1d5a140 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_DebugBreak_test1_paltest_debugbreak_test1, "debug_api/DebugBreak/test1/paltest_debugbreak_test1") { BOOL bTry = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/testinfo.dat deleted file mode 100644 index 65215093cd0a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/DebugBreak/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Debug -Function = DebugBreak -Name = DebugBreak test #1 -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests that DebugBreak "works". This will require case by case -= manual interpretation. diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/CMakeLists.txt deleted file mode 100644 index 20b49a02a743..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/CMakeLists.txt +++ /dev/null @@ -1,30 +0,0 @@ -set(TESTSOURCES - test1.cpp -) - -add_executable(paltest_outputdebugstringa_test1 - ${TESTSOURCES} -) - -add_dependencies(paltest_outputdebugstringa_test1 coreclrpal) - -target_link_libraries(paltest_outputdebugstringa_test1 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - helper.cpp -) - -add_executable(paltest_outputdebugstringa_test1_helper - ${HELPERSOURCES} -) - -add_dependencies(paltest_outputdebugstringa_test1_helper coreclrpal) - -target_link_libraries(paltest_outputdebugstringa_test1_helper - ${COMMON_TEST_LIBRARIES} -) - - diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.cpp index 85f9c64b8ba7..e47029fa7865 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_OutputDebugStringA_test1_paltest_outputdebugstringa_test1_helper, "debug_api/OutputDebugStringA/test1/paltest_outputdebugstringa_test1_helper") { if(0 != (PAL_Initialize(argc, argv))) { diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.cpp index 07b0c6798177..98f0a1b95b0a 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.cpp @@ -5,7 +5,7 @@ ** ** Source: test1.c ** -** Purpose: Debugs the helper application. Checks that certain events, in +** Purpose: Debugs the helper application. Checks that certain events, in ** particular the OUTPUT_DEBUG_STRING_EVENT, is generated correctly ** and gives the correct values. ** @@ -16,47 +16,52 @@ const int DELAY_MS = 2000; -struct OutputCheck +struct OutputCheck { DWORD ExpectedEventCode; DWORD ExpectedUnicode; char *ExpectedStr; }; -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_OutputDebugStringA_test1_paltest_outputdebugstringa_test1, "debug_api/OutputDebugStringA/test1/paltest_outputdebugstringa_test1") { - + PROCESS_INFORMATION pi; STARTUPINFO si; - + if(0 != (PAL_Initialize(argc, argv))) { return FAIL; } - + ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); - + + WCHAR name[] = {'h','e','l', 'p', 'e', 'r', '\0'}; /* Create a new process. This is the process to be Debugged */ - if(!CreateProcess( NULL, "helper", NULL, NULL, - FALSE, 0, NULL, NULL, &si, &pi)) + if(!CreateProcessW( NULL, name, NULL, NULL, + FALSE, 0, NULL, NULL, &si, &pi)) { + DWORD dwError = GetLastError(); + free(name); Fail("ERROR: CreateProcess failed to load executable 'helper'. " - "GetLastError() returned %d.\n",GetLastError()); + "GetLastError() returned %d.\n", dwError); } + free(name); + /* This is the main loop. It exits when the process which is being debugged is finished executing. */ - + while(1) - { + { DWORD dwRet = 0; dwRet = WaitForSingleObject(pi.hProcess, DELAY_MS /* Wait for 2 seconds max*/ ); - + if (dwRet != WAIT_OBJECT_0) { Trace("WaitForSingleObjectTest:WaitForSingleObject " @@ -75,8 +80,8 @@ int __cdecl main(int argc, char *argv[]) dwError = GetLastError(); CloseHandle ( pi.hProcess ); CloseHandle ( pi.hThread ); - Fail( "GetExitCodeProcess call failed with error code %d\n", - dwError ); + Fail( "GetExitCodeProcess call failed with error code %d\n", + dwError ); } if(dwExitCode != STILL_ACTIVE) { @@ -85,9 +90,9 @@ int __cdecl main(int argc, char *argv[]) break; } Trace("still executing %d..\n", dwExitCode); - } + } } - + PAL_Terminate(); return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/testinfo.dat deleted file mode 100644 index e4d37931ec9c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Debug -Function = OutputDebugStringA -Name = OutputDebugStringA test #1 -TYPE = DEFAULT -EXE1 = test1 -EXE2 = helper -Description -=Tests that OutputDebugString generates the correct debugging event behaviour. diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/CMakeLists.txt deleted file mode 100644 index c23befae1cf7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_outputdebugstringw_test1 - ${SOURCES} -) - -add_dependencies(paltest_outputdebugstringw_test1 coreclrpal) - -target_link_libraries(paltest_outputdebugstringw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.cpp index c0fb3743ede2..3e12cd53a001 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.cpp @@ -15,7 +15,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_OutputDebugStringW_test1_paltest_outputdebugstringw_test1, "debug_api/OutputDebugStringW/test1/paltest_outputdebugstringw_test1") { WCHAR *str1; WCHAR *str2; diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/testinfo.dat deleted file mode 100644 index eee22efa9247..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Debug -Function = OutputDebugStringW -Name = OutputDebugStringW test #1 -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that OutputDebugString generates the correct debugging event behaviour. diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/CMakeLists.txt deleted file mode 100644 index dd5da4441123..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/CMakeLists.txt deleted file mode 100644 index e2d976676f49..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test1.cpp -) - -add_executable(paltest_writeprocessmemory_test1 - ${TESTSOURCES} -) - -add_dependencies(paltest_writeprocessmemory_test1 coreclrpal) - -target_link_libraries(paltest_writeprocessmemory_test1 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - helper.cpp -) - -add_executable(paltest_writeprocessmemory_test1_helper - ${HELPERSOURCES} -) - -add_dependencies(paltest_writeprocessmemory_test1_helper coreclrpal) - -target_link_libraries(paltest_writeprocessmemory_test1_helper - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp index ba53f6e17be0..edf8857b864b 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp @@ -124,7 +124,7 @@ int wpmDoIt(struct allhandles_t Comms, return TRUE; } -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1_helper, "debug_api/WriteProcessMemory/test1/paltest_writeprocessmemory_test1_helper") { BOOL success = TRUE; /* assume success */ @@ -236,7 +236,7 @@ int __cdecl main(int argc, char *argv[]) Fail(""); } - PAL_Terminate(); + PAL_TerminateEx(success ? PASS : FAIL); return success ? PASS : FAIL; } diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp index a3608bde245c..41f4f825ca25 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp @@ -19,7 +19,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_WriteProcessMemory_test1_paltest_writeprocessmemory_test1, "debug_api/WriteProcessMemory/test1/paltest_writeprocessmemory_test1") { PROCESS_INFORMATION pi; diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/testinfo.dat deleted file mode 100644 index 130bba97be97..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Debug -Function = WriteProcessMemory -Name = Check that writing text to process memory succeeds. -TYPE = DEFAULT -EXE1 = test1 -EXE2 = helper -Description -= Create a child process and attempt to write to its memory -= at the places and lengths it specifies via a data file. -= the child verifies that all the specified memory was altered -= with no overruns. diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/CMakeLists.txt deleted file mode 100644 index 4c8364dd093d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test3.cpp -) - -add_executable(paltest_writeprocessmemory_test3 - ${TESTSOURCES} -) - -add_dependencies(paltest_writeprocessmemory_test3 coreclrpal) - -target_link_libraries(paltest_writeprocessmemory_test3 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - helper.cpp -) - -add_executable(paltest_writeprocessmemory_test3_helper - ${HELPERSOURCES} -) - -add_dependencies(paltest_writeprocessmemory_test3_helper coreclrpal) - -target_link_libraries(paltest_writeprocessmemory_test3_helper - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp index a64477424263..3479bc39f532 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp @@ -121,7 +121,7 @@ int wpmVerifyCant(struct allhandles_t Comms, return TRUE; } -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3_helper, "debug_api/WriteProcessMemory/test3/paltest_writeprocessmemory_test3_helper") { BOOL success = TRUE; /* assume success */ struct allhandles_t Comms = {0,0,0} ; @@ -249,7 +249,7 @@ int __cdecl main(int argc, char *argv[]) Fail(""); } - PAL_Terminate(); + PAL_TerminateEx(success ? PASS : FAIL); return success ? PASS : FAIL; } diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp index bef06d0843e7..196efb1b2abf 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp @@ -20,7 +20,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_WriteProcessMemory_test3_paltest_writeprocessmemory_test3, "debug_api/WriteProcessMemory/test3/paltest_writeprocessmemory_test3") { PROCESS_INFORMATION pi; @@ -199,6 +199,6 @@ int __cdecl main(int argc, char *argv[]) PEDANTIC(CloseHandle, (pi.hThread)); PEDANTIC(CloseHandle, (pi.hProcess)); - PAL_Terminate(dwExitCode); + PAL_TerminateEx(dwExitCode); return dwExitCode; } diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/testinfo.dat deleted file mode 100644 index 92dd2c62320d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Debug -Function = WriteProcessMemory -Name = Check that you can't write from writable to protected memory. -TYPE = DEFAULT -EXE1 = test3 -EXE2 = helper -Description -= 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 -= data should be unchanged. diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/CMakeLists.txt deleted file mode 100644 index 21b2fda3b953..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test4.cpp -) - -add_executable(paltest_writeprocessmemory_test4 - ${TESTSOURCES} -) - -add_dependencies(paltest_writeprocessmemory_test4 coreclrpal) - -target_link_libraries(paltest_writeprocessmemory_test4 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - helper.cpp -) - -add_executable(paltest_writeprocessmemory_test4_helper - ${HELPERSOURCES} -) - -add_dependencies(paltest_writeprocessmemory_test4_helper coreclrpal) - -target_link_libraries(paltest_writeprocessmemory_test4_helper - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp index aa9746f56328..42ee9125bc79 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp @@ -16,7 +16,7 @@ #include const int MY_EXCEPTION=999; -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_WriteProcessMemory_test4_paltest_writeprocessmemory_test4_helper, "debug_api/WriteProcessMemory/test4/paltest_writeprocessmemory_test4_helper") { char* Memory; diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp index 34f72ce1c02a..577869b78717 100644 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp @@ -16,7 +16,7 @@ #include const int MY_EXCEPTION=999; -int __cdecl main(int argc, char *argv[]) +PALTEST(debug_api_WriteProcessMemory_test4_paltest_writeprocessmemory_test4, "debug_api/WriteProcessMemory/test4/paltest_writeprocessmemory_test4") { PROCESS_INFORMATION pi; diff --git a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/testinfo.dat deleted file mode 100644 index 4f69644dce2c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Debug -Function = WriteProcessMemory -Name = Check that you can't write to protected memory. -TYPE = DEFAULT -EXE1 = test4 -EXE2 = helper -Description -= Create a child process and debug it. When the child -= raises an exception, it sends back a memory location. Call -= WriteProcessMemory on a restricted memory location and ensure that -= it fails. - diff --git a/src/coreclr/src/pal/tests/palsuite/eventprovider/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/eventprovider/CMakeLists.txt index 000ee2d2fb0d..87a2b12f08c1 100644 --- a/src/coreclr/src/pal/tests/palsuite/eventprovider/CMakeLists.txt +++ b/src/coreclr/src/pal/tests/palsuite/eventprovider/CMakeLists.txt @@ -1,14 +1,15 @@ set(SOURCES + EnableEventLogging.cpp ${CMAKE_CURRENT_BINARY_DIR}/clralltestevents.cpp ) set(EVENT_MANIFEST ${VM_DIR}/ClrEtwAll.man) set(TEST_GENERATOR ${CLR_DIR}/src/scripts/genEventingTests.py) -include(FindPython) +include(FindPythonInterp) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clralltestevents.cpp - COMMAND ${Python_EXECUTABLE} ${TEST_GENERATOR} --testdir "${CMAKE_CURRENT_BINARY_DIR}" --man "${EVENT_MANIFEST}" + COMMAND ${PYTHON_EXECUTABLE} ${TEST_GENERATOR} --testdir "${CMAKE_CURRENT_BINARY_DIR}" --man "${EVENT_MANIFEST}" DEPENDS ${EVENT_MANIFEST} ${TEST_GENERATOR} COMMENT "Updating clralltestevents.cpp" ) @@ -19,7 +20,7 @@ if(TARGET_UNIX) include_directories(${COREPAL_SOURCE_DIR}/inc/rt) endif(TARGET_UNIX) -add_executable(eventprovidertest +_add_executable(eventprovidertest ${SOURCES} ) set(EVENT_PROVIDER_DEPENDENCIES "") @@ -37,3 +38,5 @@ endif(FEATURE_EVENT_TRACE) target_link_libraries(eventprovidertest ${EVENT_PROVIDER_DEPENDENCIES} coreclrpal) add_dependencies(eventprovidertest eventing_headers) + +_install (TARGETS eventprovidertest DESTINATION paltests/eventprovider) \ No newline at end of file diff --git a/src/coreclr/src/pal/tests/palsuite/eventprovider/EnableEventLogging.cpp b/src/coreclr/src/pal/tests/palsuite/eventprovider/EnableEventLogging.cpp new file mode 100644 index 000000000000..fb6cf9d89775 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/eventprovider/EnableEventLogging.cpp @@ -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. + +/*===================================================================== +** +** Source: EnableEnventLogging.cpp +** +** Purpose: Fix linker issue on platforms where the PAL is built against +** verion 2.4 of liblttng-ust-dev +** +** +**===================================================================*/ + +#if defined(HOST_UNIX) +// This is a wrapper method for LTTng. See https://github.com/dotnet/coreclr/pull/27273 for details. +extern "C" bool XplatEventLoggerIsEnabled() +{ + // As we are testing the lttng events here, enable them unconditionally. + return true; +} +#endif // HOST_UNIX diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/CMakeLists.txt deleted file mode 100644 index c650506afd3a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_subdirectory(pal_sxs) -#add_subdirectory(pal_except) -#add_subdirectory(PAL_EXCEPT_FILTER) -#add_subdirectory(PAL_EXCEPT_FILTER_EX) -#add_subdirectory(pal_finally) -#add_subdirectory(PAL_TRY_EXCEPT) -#add_subdirectory(PAL_TRY_EXCEPT_EX) -#add_subdirectory(PAL_TRY_LEAVE_FINALLY) -add_subdirectory(RaiseException) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/CMakeLists.txt deleted file mode 100644 index e186c6e987e8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_EXCEPT_FILTER.cpp -) - -add_executable(paltest_pal_except_filter_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_filter_test1 coreclrpal) - -target_link_libraries(paltest_pal_except_filter_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.cpp index fa537b43d0b4..3c44088bfb7f 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.cpp @@ -46,7 +46,7 @@ LONG ExitFilter(EXCEPTION_POINTERS* ep, LPVOID pnTestInt) } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_EXCEPT_FILTER_test1_paltest_pal_except_filter_test1, "exception_handling/PAL_EXCEPT_FILTER/test1/paltest_pal_except_filter_test1") { int* p = 0x00000000; /* pointer to NULL */ BOOL bExcept = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/testinfo.dat deleted file mode 100644 index 1d68e987f53f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_EXCEPT_FILTER -Name = Test for PAL_EXCEPT_FILTER -Type = DEFAULT -EXE1 = pal_except_filter -LANG = cpp -Description -= Tests the PAL implementation of the PAL_EXCEPT_FILTER. An -= exception is forced and a known value is passed to the filter -= fuction. The known value as well as booleans are tested to -= ensure proper functioning. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/CMakeLists.txt deleted file mode 100644 index baaac69333a4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - pal_except_filter.cpp -) - -add_executable(paltest_pal_except_filter_test2 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_filter_test2 coreclrpal) - -target_link_libraries(paltest_pal_except_filter_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.cpp index 0e960c247875..c5abcc6b39c7 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.cpp @@ -70,7 +70,7 @@ LONG ExitFilter(EXCEPTION_POINTERS* ep, LPVOID pnTestInt) } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_EXCEPT_FILTER_test2_paltest_pal_except_filter_test2, "exception_handling/PAL_EXCEPT_FILTER/test2/paltest_pal_except_filter_test2") { BOOL bExcept = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/testinfo.dat deleted file mode 100644 index 66789ab817d8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_EXCEPT_FILTER -Name = Test for PAL_EXCEPT_FILTER -Type = DEFAULT -EXE1 = pal_except_filter -LANG = cpp -Description -= Tests the PAL implementation of the PAL_EXCEPT_FILTER. An -= exception is forced and the filter returns -= EXCEPTION_CONTINUE_EXECUTION to allow execution to continue. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/CMakeLists.txt deleted file mode 100644 index 54dd18aca98f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - pal_except_filter.cpp -) - -add_executable(paltest_pal_except_filter_test3 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_filter_test3 coreclrpal) - -target_link_libraries(paltest_pal_except_filter_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.cpp index 11f420ea809d..afa2fb3320fb 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.cpp @@ -104,7 +104,7 @@ void NestedFunc2 (void) NestedFunc1(); } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_EXCEPT_FILTER_test3_paltest_pal_except_filter_test3, "exception_handling/PAL_EXCEPT_FILTER/test3/paltest_pal_except_filter_test3") { if (0 != PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/testinfo.dat deleted file mode 100644 index 795ba064b8c4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_EXCEPT_FILTER_EX -Name = Test for nested PAL_EXCEPT_FILTER functions & EXCEPTION_CONTINUE_SEARCH -Type = DEFAULT -EXE1 = pal_except_filter -LANG = cpp -Description -= Tests the PAL implementation of the PAL_EXCEPT_FILTER with nested -= functions to build a call stack. An -= exception is forced and passed to two nested exception filters for -= consideration. The first filter returns EXCEPTION_CONTINUE_SEARCH -= so the second can run and return EXCEPTION_EXECUTE_HANDLER. The -= initial exception handler should be skipped, and the second -= executed diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/CMakeLists.txt deleted file mode 100644 index c6bc2efd7559..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_EXCEPT_FILTER_EX.cpp -) - -add_executable(paltest_pal_except_filter_ex_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_filter_ex_test1 coreclrpal) - -target_link_libraries(paltest_pal_except_filter_ex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.cpp index b987b14f59d8..1a2668716e62 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.cpp @@ -70,7 +70,7 @@ LONG Filter_02(EXCEPTION_POINTERS* ep, VOID *pnTestInt) } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_EXCEPT_FILTER_EX_test1_paltest_pal_except_filter_ex_test1, "exception_handling/PAL_EXCEPT_FILTER_EX/test1/paltest_pal_except_filter_ex_test1") { int* p = 0x00000000; BOOL bExcept = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/testinfo.dat deleted file mode 100644 index 3dae7bcad5db..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = exception_handling -Function = PAL_EXCEPT_FILTER_EX -Name = Test for PAL_EXCEPT_FILTER_EX -Type = DEFAULT -EXE1 = pal_except_filter_ex -LANG = cpp -Description -= Tests the PAL implementation of the PAL_EXCEPT_FILTER_EX. -= There are two try blocks in this test. The first forces an -= exception error to force hitting the first filter. The second -= doesn't to make sure we don't hit the filter. A value is also -= passed into the filter program and it is validated to make sure -= it was passed correctly. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/CMakeLists.txt deleted file mode 100644 index ceb214a7dd2d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - pal_except_filter_ex.cpp -) - -add_executable(paltest_pal_except_filter_ex_test2 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_filter_ex_test2 coreclrpal) - -target_link_libraries(paltest_pal_except_filter_ex_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.cpp index 314221178b44..1b3a05654a83 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.cpp @@ -54,7 +54,7 @@ LONG Filter_01(EXCEPTION_POINTERS* ep, VOID *pnTestInt) return EXCEPTION_EXECUTE_HANDLER; } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_EXCEPT_FILTER_EX_test2_paltest_pal_except_filter_ex_test2, "exception_handling/PAL_EXCEPT_FILTER_EX/test2/paltest_pal_except_filter_ex_test2") { int* p = 0x00000000; BOOL bExcept = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/testinfo.dat deleted file mode 100644 index 4c5c5b2d606e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_EXCEPT_FILTER_EX -Name = Test for PAL_EXCEPT_FILTER_EX -Type = DEFAULT -EXE1 = pal_except_filter_ex -LANG = cpp -Description -= Tests the PAL implementation of the PAL_EXCEPT_FILTER_EX. -= There is a nested try blocks in this test. The nested -= PAL_TRY creates an exception and the FILTER creates another. -= This test makes sure that this case does not end in a -= infinite loop. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/CMakeLists.txt deleted file mode 100644 index 31107993f93c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - pal_except_filter.cpp -) - -add_executable(paltest_pal_except_filter_ex_test3 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_filter_ex_test3 coreclrpal) - -target_link_libraries(paltest_pal_except_filter_ex_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.cpp index bb0be8b3038e..815b4d84d108 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.cpp @@ -68,7 +68,7 @@ LONG ExecExeptionFilter(EXCEPTION_POINTERS* ep, LPVOID pnTestInt) return EXCEPTION_EXECUTE_HANDLER; } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_EXCEPT_FILTER_EX_test3_paltest_pal_except_filter_ex_test3, "exception_handling/PAL_EXCEPT_FILTER_EX/test3/paltest_pal_except_filter_ex_test3") { int* p = 0x00000000; /* pointer to NULL */ BOOL bExcept1 = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/testinfo.dat deleted file mode 100644 index ae6093b1dbea..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/testinfo.dat +++ /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. - -Version = 1.0 -Section = exception_handling -Function = PAL_EXCEPT_FILTER_EX -Name = Test for nested PAL_EXCEPT_FILTER_EX & EXCEPTION_CONTINUE_SEARCH -Type = DEFAULT -EXE1 = pal_except_filter -LANG = cpp -Description -= Tests the PAL implementation of the PAL_EXCEPT_FILTER_EX. An -= exception is forced and passed to two nested exception filters for -= consideration. The first filter returns EXCEPTION_CONTINUE_SEARCH -= so the second can run and return EXCEPTION_EXECUTE_HANDLER. The -= initial exception handler should be skipped, and the second -= executed diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/CMakeLists.txt deleted file mode 100644 index 867b02876f4c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_TRY_EXCEPT.cpp -) - -add_executable(paltest_pal_try_except_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_try_except_test1 coreclrpal) - -target_link_libraries(paltest_pal_try_except_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.cpp index eb2bbce1ee6e..a05fd5c8c984 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_TRY_EXCEPT_test1_paltest_pal_try_except_test1, "exception_handling/PAL_TRY_EXCEPT/test1/paltest_pal_try_except_test1") { int* p = 0x00000000; /* NULL pointer */ BOOL bTry = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/testinfo.dat deleted file mode 100644 index 7108fe259f1b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_TRY and PAL_EXCEPT -Name = Test for PAL_TRY and PAL_EXCEPT -Type = DEFAULT -EXE1 = pal_try_except -LANG = cpp -Description -= Since these two are so closely connected, they are tested together. -= In the PAL_TRY block, an access violation is forced to gain -= access to the PAL_EXCEPT block. Booleans are used to ensure -= each of the code blocks are hit. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/CMakeLists.txt deleted file mode 100644 index 81089fd479f4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_TRY_EXCEPT.cpp -) - -add_executable(paltest_pal_try_except_test2 - ${SOURCES} -) - -add_dependencies(paltest_pal_try_except_test2 coreclrpal) - -target_link_libraries(paltest_pal_try_except_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.cpp index baf4533bd8a0..b4bdd51bf533 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_TRY_EXCEPT_test2_paltest_pal_try_except_test2, "exception_handling/PAL_TRY_EXCEPT/test2/paltest_pal_try_except_test2") { BOOL bTry = FALSE; BOOL bExcept = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/testinfo.dat deleted file mode 100644 index 8ccdd101a194..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_TRY and PAL_EXCEPT (test 2) -Name = Test for PAL_TRY and PAL_EXCEPT -Type = DEFAULT -EXE1 = pal_try_except -LANG = cpp -Description -= Since these two are so closely connected, they are tested together. -= In this test, no exceptions are forced to ensure the EXCEPTION block -= isn't hit. Booleans are used to ensure the proper code blocks are hit. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/CMakeLists.txt deleted file mode 100644 index 1969986fb714..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_TRY_EXCEPT_EX.cpp -) - -add_executable(paltest_pal_try_except_ex_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_try_except_ex_test1 coreclrpal) - -target_link_libraries(paltest_pal_try_except_ex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.cpp index 2225f46aab6f..ed33957aea70 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_TRY_EXCEPT_EX_test1_paltest_pal_try_except_ex_test1, "exception_handling/PAL_TRY_EXCEPT_EX/test1/paltest_pal_try_except_ex_test1") { int* p = 0x00000000; /* NULL pointer */ BOOL bTry = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/testinfo.dat deleted file mode 100644 index afb31350006f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_TRY and PAL_EXCEPT_EX -Name = Test for PAL_TRY and PAL_EXCEPT_EX -Type = DEFAULT -EXE1 = pal_try_except_ex -LANG = cpp -Description -= Since these two are so closely connected, they are tested together. -= In the PAL_TRY block, an access violation is forced to gain -= access to the PAL_EXCEPT block. Booleans are used to ensure -= each of the code blocks are hit. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/CMakeLists.txt deleted file mode 100644 index 00a0985373aa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_TRY_EXCEPT_EX.cpp -) - -add_executable(paltest_pal_try_except_ex_test2 - ${SOURCES} -) - -add_dependencies(paltest_pal_try_except_ex_test2 coreclrpal) - -target_link_libraries(paltest_pal_try_except_ex_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.cpp index c56552d4b59c..4d06875f3371 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_TRY_EXCEPT_EX_test2_paltest_pal_try_except_ex_test2, "exception_handling/PAL_TRY_EXCEPT_EX/test2/paltest_pal_try_except_ex_test2") { BOOL bTry = FALSE; BOOL bExcept = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/testinfo.dat deleted file mode 100644 index 79d5b8b22304..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_TRY and PAL_EXCEPT_EX (test 2) -Name = Test for PAL_TRY and PAL_EXCEPT_EX -Type = DEFAULT -EXE1 = pal_try_except_ex -LANG = cpp -Description -= Since these two are so closely connected, they are tested together. -= In this test, no exceptions are forced to ensure the EXCEPTION block -= isn't hit. Booleans are used to ensure the proper code blocks are hit. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/CMakeLists.txt deleted file mode 100644 index d56169e8682f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_TRY_EXCEPT_EX.cpp -) - -add_executable(paltest_pal_try_except_ex_test3 - ${SOURCES} -) - -add_dependencies(paltest_pal_try_except_ex_test3 coreclrpal) - -target_link_libraries(paltest_pal_try_except_ex_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.cpp index 7e4d97f11ec2..ccf5efabeb2e 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_TRY_EXCEPT_EX_test3_paltest_pal_try_except_ex_test3, "exception_handling/PAL_TRY_EXCEPT_EX/test3/paltest_pal_try_except_ex_test3") { int* p = 0x00000000; /* NULL pointer */ BOOL bTry = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/testinfo.dat deleted file mode 100644 index 99d74e1f4353..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_TRY and PAL_EXCEPT_EX (test3) -Name = Test for PAL_TRY and PAL_EXCEPT_EX -Type = DEFAULT -EXE1 = pal_try_except_ex -LANG = cpp -Description -= Since these two are so closely connected, they are tested together. -= Only one of the PAL_TRY blocks will force and exception to ensure the -= correct PAL_EXCEPT_EX block is hit. Booleans are used to ensure -= the correct code blocks are hit. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/CMakeLists.txt deleted file mode 100644 index 9a8175353d0c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_TRY_LEAVE_FINALLY.cpp -) - -add_executable(paltest_pal_try_leave_finally_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_try_leave_finally_test1 coreclrpal) - -target_link_libraries(paltest_pal_try_leave_finally_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.cpp index b5de993e5b38..ed866aaa2872 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_PAL_TRY_LEAVE_FINALLY_test1_paltest_pal_try_leave_finally_test1, "exception_handling/PAL_TRY_LEAVE_FINALLY/test1/paltest_pal_try_leave_finally_test1") { BOOL bTry = FALSE; BOOL bFinally = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/testinfo.dat deleted file mode 100644 index 22e7f4fd5058..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = PAL_TRY, PAL_LEAVE and PAL_FINALLY -Name = Test for PAL_TRY, PAL_LEAVE and PAL_EXCEPT -Type = DEFAULT -EXE1 = pal_try_leave_finally -LANG = cpp -Description -= Since these three are so closely connected, they are tested together. -= The PAL_TRY block contains a PAL_LEAVE which kicks execution to -= the PAL_FINALLY block. Booleans are used to ensure each of the -= code blocks are properly hit. - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/CMakeLists.txt deleted file mode 100644 index f0c98f7e2b03..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_raiseexception_test1 - ${SOURCES} -) - -add_dependencies(paltest_raiseexception_test1 coreclrpal) - -target_link_libraries(paltest_raiseexception_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/test1.cpp index 22ffbc0c030a..81cfa59fb773 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/test1.cpp @@ -15,11 +15,11 @@ #include -BOOL bExcept = FALSE; -BOOL bTry = FALSE; -BOOL bFinally = FALSE; +BOOL bExcept_RaiseException_test1 = FALSE; +BOOL bTry_RaiseException_test1 = FALSE; +BOOL bFinally_RaiseException_test1 = FALSE; -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_RaiseException_test1_paltest_raiseexception_test1, "exception_handling/RaiseException/test1/paltest_raiseexception_test1") { if(0 != (PAL_Initialize(argc, argv))) @@ -32,7 +32,7 @@ int __cdecl main(int argc, char *argv[]) */ PAL_TRY(VOID*, unused, NULL) { - bTry = TRUE; + bTry_RaiseException_test1 = TRUE; RaiseException(0,0,0,0); Fail("RaiseException: ERROR -> code was executed after the " @@ -40,42 +40,42 @@ int __cdecl main(int argc, char *argv[]) } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - bExcept = TRUE; + bExcept_RaiseException_test1 = TRUE; } PAL_ENDTRY; - if (!bTry) + if (!bTry_RaiseException_test1) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_RaiseException_test1) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_EXCEPT_FILTER_EX block was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept) + if(!bTry_RaiseException_test1 || !bExcept_RaiseException_test1) { Fail(""); } /* Reinit flags */ - bTry = bExcept = FALSE; + bTry_RaiseException_test1 = bExcept_RaiseException_test1 = FALSE; /********************************************************* * Tests the behaviour of RaiseException with * PAL_FINALLY - * (bFinally should be set before bExcept) + * (bFinally_RaiseException_test1 should be set before bExcept_RaiseException_test1) */ PAL_TRY(VOID*, unused, NULL) { PAL_TRY(VOID*, unused, NULL) { - bTry = TRUE; + bTry_RaiseException_test1 = TRUE; RaiseException(0,0,0,0); Fail("RaiseException: ERROR -> code was executed after the " @@ -83,43 +83,43 @@ int __cdecl main(int argc, char *argv[]) } PAL_FINALLY { - bFinally = TRUE; + bFinally_RaiseException_test1 = TRUE; } PAL_ENDTRY; } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if( bFinally == FALSE ) + if( bFinally_RaiseException_test1 == FALSE ) { Fail("RaiseException: ERROR -> It appears the code in the " "PAL_EXCEPT executed before the code in PAL_FINALLY.\n"); } - bExcept = TRUE; + bExcept_RaiseException_test1 = TRUE; } PAL_ENDTRY; - if (!bTry) + if (!bTry_RaiseException_test1) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_RaiseException_test1) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_EXCEPT block was not executed.\n"); } - if (!bFinally) + if (!bFinally_RaiseException_test1) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_FINALLY block was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept || !bFinally) + if(!bTry_RaiseException_test1 || !bExcept_RaiseException_test1 || !bFinally_RaiseException_test1) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/testinfo.dat deleted file mode 100644 index 8dc343012a59..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = RaiseException -Name = RaiseException test #1 -TYPE = DEFAULT -EXE1 = test1 -LANG = cpp -Description -=Tests that RaiseException throws a catchable exception diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/CMakeLists.txt deleted file mode 100644 index 71968b965744..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_raiseexception_test2 - ${SOURCES} -) - -add_dependencies(paltest_raiseexception_test2 coreclrpal) - -target_link_libraries(paltest_raiseexception_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/test2.cpp index e5a85fe6adc2..e55a41bd5965 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/test2.cpp @@ -17,15 +17,15 @@ #include -BOOL bFilter; -BOOL bTry; -BOOL bExcept; +BOOL bFilter_RaiseException_test2; +BOOL bTry_RaiseException_test2; +BOOL bExcept_RaiseException_test2; -ULONG_PTR lpArguments_test1[EXCEPTION_MAXIMUM_PARAMETERS]; -DWORD nArguments_test1 = EXCEPTION_MAXIMUM_PARAMETERS; +ULONG_PTR lpArguments_test1_RaiseException_test2[EXCEPTION_MAXIMUM_PARAMETERS]; +DWORD nArguments_test1_RaiseException_test2 = EXCEPTION_MAXIMUM_PARAMETERS; -ULONG_PTR lpArguments_test2[EXCEPTION_MAXIMUM_PARAMETERS+1]; -DWORD nArguments_test2 = EXCEPTION_MAXIMUM_PARAMETERS+1; +ULONG_PTR lpArguments_test2_RaiseException_test2[EXCEPTION_MAXIMUM_PARAMETERS+1]; +DWORD nArguments_test2_RaiseException_test2 = EXCEPTION_MAXIMUM_PARAMETERS+1; /** @@ -33,14 +33,14 @@ DWORD nArguments_test2 = EXCEPTION_MAXIMUM_PARAMETERS+1; ** Filter function that checks for the parameters ** **/ -LONG Filter_test1(EXCEPTION_POINTERS* ep, VOID *unused) +LONG Filter_test1_RaiseException_test2(EXCEPTION_POINTERS* ep, VOID *unused) { int i; /* let the main know we've hit the filter function */ - bFilter = TRUE; + bFilter_RaiseException_test2 = TRUE; - if (!bTry) + if (!bTry_RaiseException_test2) { Fail("PAL_EXCEPT_FILTER_EX: ERROR -> Something weird is going on." " The filter was hit without PAL_TRY being hit.\n"); @@ -48,26 +48,26 @@ LONG Filter_test1(EXCEPTION_POINTERS* ep, VOID *unused) /* was the correct number of arguments passed */ - if (ep->ExceptionRecord->NumberParameters != (DWORD) nArguments_test1) + if (ep->ExceptionRecord->NumberParameters != (DWORD) nArguments_test1_RaiseException_test2) { Fail("RaiseException: ERROR -> Number of arguments passed to filter" " was %d when it should have been %d", ep->ExceptionRecord->NumberParameters, - nArguments_test1); + nArguments_test1_RaiseException_test2); } /* were the correct arguments passed */ - for( i=0; ((DWORD)i)ExceptionRecord->ExceptionInformation[i] - != lpArguments_test1[i]) + != lpArguments_test1_RaiseException_test2[i]) { Fail("RaiseException: ERROR -> Argument %d passed to filter" " was %d when it should have been %d", i, ep->ExceptionRecord->ExceptionInformation[i], - lpArguments_test1[i]); + lpArguments_test1_RaiseException_test2[i]); } } @@ -79,10 +79,10 @@ LONG Filter_test1(EXCEPTION_POINTERS* ep, VOID *unused) ** Filter function that checks for the maximum parameters ** **/ -LONG Filter_test2(EXCEPTION_POINTERS* ep, VOID* unused) +LONG Filter_test2_RaiseException_test2(EXCEPTION_POINTERS* ep, VOID* unused) { /* let the main know we've hit the filter function */ - bFilter = TRUE; + bFilter_RaiseException_test2 = TRUE; if (ep->ExceptionRecord->NumberParameters > EXCEPTION_MAXIMUM_PARAMETERS) { @@ -95,9 +95,9 @@ LONG Filter_test2(EXCEPTION_POINTERS* ep, VOID* unused) return EXCEPTION_EXECUTE_HANDLER; } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_RaiseException_test2_paltest_raiseexception_test2, "exception_handling/RaiseException/test2/paltest_raiseexception_test2") { - bExcept = FALSE; + bExcept_RaiseException_test2 = FALSE; if (0 != PAL_Initialize(argc, argv)) { @@ -110,57 +110,57 @@ int __cdecl main(int argc, char *argv[]) */ PAL_TRY(VOID*, unused, NULL) { - bTry = TRUE; /* indicate we hit the PAL_TRY block */ + bTry_RaiseException_test2 = TRUE; /* indicate we hit the PAL_TRY block */ /* Initialize arguments to pass to filter */ - for(int i = 0; ((DWORD)i) < nArguments_test1; i++ ) + for(int i = 0; ((DWORD)i) < nArguments_test1_RaiseException_test2; i++ ) { - lpArguments_test1[i] = i; + lpArguments_test1_RaiseException_test2[i] = i; } - RaiseException(0,0,nArguments_test1,lpArguments_test1); + RaiseException(0,0,nArguments_test1_RaiseException_test2,lpArguments_test1_RaiseException_test2); Fail("RaiseException: ERROR -> code was executed after the " "exception was raised.\n"); } - PAL_EXCEPT_FILTER(Filter_test1) + PAL_EXCEPT_FILTER(Filter_test1_RaiseException_test2) { - if (!bTry) + if (!bTry_RaiseException_test2) { Fail("RaiseException: ERROR -> Something weird is going on." " PAL_EXCEPT_FILTER was hit without PAL_TRY being hit.\n"); } - bExcept = TRUE; /* indicate we hit the PAL_EXCEPT_FILTER_EX block */ + bExcept_RaiseException_test2 = TRUE; /* indicate we hit the PAL_EXCEPT_FILTER_EX block */ } PAL_ENDTRY; - if (!bTry) + if (!bTry_RaiseException_test2) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_RaiseException_test2) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_EXCEPT_FILTER_EX block was not executed.\n"); } - if (!bFilter) + if (!bFilter_RaiseException_test2) { Trace("RaiseException: ERROR -> It appears the code in the" " filter function was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept || !bFilter) + if(!bTry_RaiseException_test2 || !bExcept_RaiseException_test2 || !bFilter_RaiseException_test2) { Fail(""); } /* Reinit flags */ - bTry = bExcept = bFilter = FALSE; + bTry_RaiseException_test2 = bExcept_RaiseException_test2 = bFilter_RaiseException_test2 = FALSE; /******************************************************** * Test that the number of arguments never @@ -169,50 +169,50 @@ int __cdecl main(int argc, char *argv[]) */ PAL_TRY(VOID*, unused, NULL) { - bTry = TRUE; /* indicate we hit the PAL_TRY block */ + bTry_RaiseException_test2 = TRUE; /* indicate we hit the PAL_TRY block */ /* Initialize arguments to pass to filter */ - for(int i = 0; ((DWORD)i) < nArguments_test2; i++ ) + for(int i = 0; ((DWORD)i) < nArguments_test2_RaiseException_test2; i++ ) { - lpArguments_test2[i] = i; + lpArguments_test2_RaiseException_test2[i] = i; } - RaiseException(0,0,nArguments_test2,lpArguments_test2); + RaiseException(0,0,nArguments_test2_RaiseException_test2,lpArguments_test2_RaiseException_test2); Fail("RaiseException: ERROR -> code was executed after the " "exception was raised.\n"); } - PAL_EXCEPT_FILTER(Filter_test2) + PAL_EXCEPT_FILTER(Filter_test2_RaiseException_test2) { - if (!bTry) + if (!bTry_RaiseException_test2) { Fail("RaiseException: ERROR -> Something weird is going on." " PAL_EXCEPT_FILTER was hit without PAL_TRY being hit.\n"); } - bExcept = TRUE; /* indicate we hit the PAL_EXCEPT_FILTER_EX block */ + bExcept_RaiseException_test2 = TRUE; /* indicate we hit the PAL_EXCEPT_FILTER_EX block */ } PAL_ENDTRY; - if (!bTry) + if (!bTry_RaiseException_test2) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_RaiseException_test2) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_EXCEPT_FILTER_EX block was not executed.\n"); } - if (!bFilter) + if (!bFilter_RaiseException_test2) { Trace("RaiseException: ERROR -> It appears the code in the" " filter function was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept || !bFilter) + if(!bTry_RaiseException_test2 || !bExcept_RaiseException_test2 || !bFilter_RaiseException_test2) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/testinfo.dat deleted file mode 100644 index 8d59d41a2bae..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test2/testinfo.dat +++ /dev/null @@ -1,27 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 - -Section = exception_handling - -Function = RaiseException - -Name = RaiseException test #2 - -TYPE = DEFAULT - -EXE1 = test2 -LANG = cpp - -Description - -=Tests that the correct arguments are passed - -=to the filter by RaiseException and tests that - -=the number of arguments never exceeds - -=EXCEPTION_MAXIMUM_PARAMETERS, even though we - -=pass a greater number of arguments diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/CMakeLists.txt deleted file mode 100644 index 72b79365b031..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_raiseexception_test3 - ${SOURCES} -) - -add_dependencies(paltest_raiseexception_test3 coreclrpal) - -target_link_libraries(paltest_raiseexception_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/test.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/test.cpp index 47199b55fa2f..d0f98e3f5c3a 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/test.cpp @@ -14,21 +14,21 @@ #include -BOOL bFilter = FALSE; -BOOL bTry = FALSE; -BOOL bExcept = FALSE; +BOOL bFilter_RaiseException_test3 = FALSE; +BOOL bTry_RaiseException_test3 = FALSE; +BOOL bExcept_RaiseException_test3 = FALSE; /** ** ** Filter function that checks for the parameters ** **/ -LONG Filter_test1(EXCEPTION_POINTERS* ep, VOID* unused) +LONG Filter_test1_RaiseException_test3(EXCEPTION_POINTERS* ep, VOID* unused) { /* let the main know we've hit the filter function */ - bFilter = TRUE; + bFilter_RaiseException_test3 = TRUE; - if (!bTry) + if (!bTry_RaiseException_test3) { Fail("PAL_EXCEPT_FILTER_EX: ERROR -> Something weird is going on." " The filter was hit without PAL_TRY being hit.\n"); @@ -48,9 +48,9 @@ LONG Filter_test1(EXCEPTION_POINTERS* ep, VOID* unused) return EXCEPTION_EXECUTE_HANDLER; } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_RaiseException_test3_paltest_raiseexception_test3, "exception_handling/RaiseException/test3/paltest_raiseexception_test3") { - bExcept = FALSE; + bExcept_RaiseException_test3 = FALSE; if (0 != PAL_Initialize(argc, argv)) { @@ -63,7 +63,7 @@ int __cdecl main(int argc, char *argv[]) */ PAL_TRY(VOID*, unused, NULL) { - bTry = TRUE; /* indicate we hit the PAL_TRY block */ + bTry_RaiseException_test3 = TRUE; /* indicate we hit the PAL_TRY block */ RaiseException(EXCEPTION_ARRAY_BOUNDS_EXCEEDED, 0, @@ -72,37 +72,37 @@ int __cdecl main(int argc, char *argv[]) Fail("RaiseException: ERROR -> code was executed after the " "exception was raised.\n"); } - PAL_EXCEPT_FILTER(Filter_test1) + PAL_EXCEPT_FILTER(Filter_test1_RaiseException_test3) { - if (!bTry) + if (!bTry_RaiseException_test3) { Fail("RaiseException: ERROR -> Something weird is going on." " PAL_EXCEPT_FILTER was hit without PAL_TRY being hit.\n"); } - bExcept = TRUE; /* indicate we hit the PAL_EXCEPT_FILTER_EX block */ + bExcept_RaiseException_test3 = TRUE; /* indicate we hit the PAL_EXCEPT_FILTER_EX block */ } PAL_ENDTRY; - if (!bTry) + if (!bTry_RaiseException_test3) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_RaiseException_test3) { Trace("RaiseException: ERROR -> It appears the code in the " "PAL_EXCEPT_FILTER_EX block was not executed.\n"); } - if (!bFilter) + if (!bFilter_RaiseException_test3) { Trace("RaiseException: ERROR -> It appears the code in the" " filter function was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept || !bFilter) + if(!bTry_RaiseException_test3 || !bExcept_RaiseException_test3 || !bFilter_RaiseException_test3) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/testinfo.dat deleted file mode 100644 index fe650592402b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/RaiseException/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = RaiseException -Name = RaiseException test #3 -TYPE = DEFAULT -EXE1 = test -LANG = cpp -Description -= Tests that the exception code passed to -= RaiseException makes it to the filter. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/CMakeLists.txt deleted file mode 100644 index 7cd88f8e86da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/CMakeLists.txt deleted file mode 100644 index d0d8476bc79d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_pal_except_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_test1 coreclrpal) - -target_link_libraries(paltest_pal_except_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.cpp index 809c9bba5bda..35632612d504 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.cpp @@ -13,10 +13,10 @@ #include /* Execution flags */ -BOOL bTry = FALSE; -BOOL bExcept = FALSE; +BOOL bTry_pal_except_test1 = FALSE; +BOOL bExcept_pal_except_test1 = FALSE; -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_pal_except_test1_paltest_pal_except_test1, "exception_handling/pal_except/test1/paltest_pal_except_test1") { if (0 != PAL_Initialize(argc, argv)) { @@ -27,34 +27,34 @@ int __cdecl main(int argc, char *argv[]) { int* p = 0x00000000; /* NULL pointer */ - bTry = TRUE; /* indicate we hit the PAL_TRY block */ + bTry_pal_except_test1 = TRUE; /* indicate we hit the PAL_TRY block */ *p = 13; /* causes an access violation exception */ Fail("ERROR: code was executed after the access violation.\n"); } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if (!bTry) + if (!bTry_pal_except_test1) { Fail("ERROR: PAL_EXCEPT was hit without PAL_TRY being hit.\n"); } - bExcept = TRUE; /* indicate we hit the PAL_EXCEPT block */ + bExcept_pal_except_test1 = TRUE; /* indicate we hit the PAL_EXCEPT block */ } PAL_ENDTRY; - if (!bTry) + if (!bTry_pal_except_test1) { Trace("ERROR: the code in the PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_pal_except_test1) { Trace("ERROR: the code in the PAL_EXCEPT block was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept) + if(!bTry_pal_except_test1 || !bExcept_pal_except_test1) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/testinfo.dat deleted file mode 100644 index 5c2a4849ebdb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test1/testinfo.dat +++ /dev/null @@ -1,22 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 - -Section = exception_handling - -Function = PAL_TRY and PAL_EXCEPT - -Name = Test for PAL_TRY and PAL_EXCEPT - -Type = DEFAULT - -EXE1 = test1 - -LANG = cpp - -Description - -= Test to make sure the PAL_EXCEPT block is executed - -= after an exception occurs in the PAL_TRY block diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/CMakeLists.txt deleted file mode 100644 index 908b485b2ec7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_pal_except_test2 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_test2 coreclrpal) - -target_link_libraries(paltest_pal_except_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.cpp index 68238c4e1e9e..3724f8fecf9c 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.cpp @@ -14,12 +14,12 @@ #include /* Execution flags */ -BOOL bTry = FALSE; -BOOL bExcept = FALSE; -BOOL bTry_nested = FALSE; -BOOL bExcept_nested = FALSE; +BOOL bTry_pal_except_test2 = FALSE; +BOOL bExcept_pal_except_test2 = FALSE; +BOOL bTry_nested_pal_except_test2 = FALSE; +BOOL bExcept_nested_pal_except_test2 = FALSE; -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_pal_except_test2_paltest_pal_except_test2, "exception_handling/pal_except/test2/paltest_pal_except_test2") { if (0 != PAL_Initialize(argc, argv)) { @@ -30,13 +30,13 @@ int __cdecl main(int argc, char *argv[]) { int* p = 0x00000000; /* NULL pointer */ - bTry = TRUE; /* indicate we hit the PAL_TRY block */ + bTry_pal_except_test2 = TRUE; /* indicate we hit the PAL_TRY block */ /* Nested PAL_TRY */ PAL_TRY { - bTry_nested = TRUE; + bTry_nested_pal_except_test2 = TRUE; *p = 13; /* causes an access violation exception */ @@ -45,12 +45,12 @@ int __cdecl main(int argc, char *argv[]) } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if (!bTry) + if (!bTry_pal_except_test2) { Fail("ERROR: Nested PAL_EXCEPT was hit without " "nested PAL_TRY being hit.\n"); } - bExcept_nested = TRUE; + bExcept_nested_pal_except_test2 = TRUE; } PAL_ENDTRY; @@ -60,45 +60,45 @@ int __cdecl main(int argc, char *argv[]) } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if (!bTry) + if (!bTry_pal_except_test2) { Fail("ERROR: PAL_EXCEPT was hit without PAL_TRY being hit.\n"); } - if (!bExcept_nested) + if (!bExcept_nested_pal_except_test2) { Fail("ERROR: PAL_EXCEPT was hit without " "nested PAL_EXCEPT being hit.\n"); } - bExcept = TRUE; /* indicate we hit the PAL_EXCEPT block */ + bExcept_pal_except_test2 = TRUE; /* indicate we hit the PAL_EXCEPT block */ } PAL_ENDTRY; - if (!bTry) + if (!bTry_pal_except_test2) { Trace("ERROR: the code in the PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_pal_except_test2) { Trace("ERROR: the code in the PAL_EXCEPT block was not executed.\n"); } - if (!bTry_nested) + if (!bTry_nested_pal_except_test2) { Trace("ERROR: the code in the " "nested PAL_TRY block was not executed.\n"); } - if (!bExcept_nested) + if (!bExcept_nested_pal_except_test2) { Trace("ERROR: the code in the " "nested PAL_EXCEPT block was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept || - !bTry_nested || !bExcept_nested) + if(!bTry_pal_except_test2 || !bExcept_pal_except_test2 || + !bTry_nested_pal_except_test2 || !bExcept_nested_pal_except_test2) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/testinfo.dat deleted file mode 100644 index 6aa28db3527d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test2/testinfo.dat +++ /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. - -Version = 1.0 - -Section = exception_handling - -Function = PAL_TRY and PAL_EXCEPT_EX - -Name = Test for PAL_TRY and PAL_EXCEPT_EX - -Type = DEFAULT - -EXE1 = test2 - -LANG = cpp - -Description - -= Test to make sure the PAL_EXCEPT_EX block is executed - -= after an exception occurs in the PAL_TRY block - -= that contains another PAL_TRY-PAL_EXCEPT_EX block diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/CMakeLists.txt deleted file mode 100644 index c3ab83976491..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_pal_except_test3 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_test3 coreclrpal) - -target_link_libraries(paltest_pal_except_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.cpp index 0e6b2641d14b..926af9b92a7a 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.cpp @@ -15,10 +15,10 @@ #include /* Execution flags */ -BOOL bTry = FALSE; -BOOL bExcept = FALSE; -BOOL bTry_function = FALSE; -BOOL bExcept_function = FALSE; +BOOL bTry_pal_except_test3 = FALSE; +BOOL bExcept_pal_except_test3 = FALSE; +BOOL bTry_function_pal_except_test3 = FALSE; +BOOL bExcept_function_pal_except_test3 = FALSE; /* * Helper function that contains a PAL_TRY-PAL_EXCEPT block @@ -30,7 +30,7 @@ void Helper() { int *lp = 0x00000000; - bTry_function = TRUE; + bTry_function_pal_except_test3 = TRUE; *lp = 13; /* causes an access violation exception */ @@ -39,17 +39,17 @@ void Helper() } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if (!bTry) + if (!bTry_pal_except_test3) { Fail("ERROR: Nested PAL_EXCEPT was hit without " "the function's PAL_TRY being hit.\n"); } - bExcept_function = TRUE; + bExcept_function_pal_except_test3 = TRUE; } PAL_ENDTRY; } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_pal_except_test3_paltest_pal_except_test3, "exception_handling/pal_except/test3/paltest_pal_except_test3") { if (0 != PAL_Initialize(argc, argv)) { @@ -60,7 +60,7 @@ int __cdecl main(int argc, char *argv[]) { int* p = 0x00000000; /* NULL pointer */ - bTry = TRUE; /* indicate we hit the PAL_TRY block */ + bTry_pal_except_test3 = TRUE; /* indicate we hit the PAL_TRY block */ Helper(); @@ -70,45 +70,45 @@ int __cdecl main(int argc, char *argv[]) } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if (!bTry) + if (!bTry_pal_except_test3) { Fail("ERROR: PAL_EXCEPT was hit without PAL_TRY being hit.\n"); } - if (!bExcept_function) + if (!bExcept_function_pal_except_test3) { Fail("ERROR: PAL_EXCEPT was hit without " "function's PAL_EXCEPT being hit.\n"); } - bExcept = TRUE; /* indicate we hit the PAL_EXCEPT block */ + bExcept_pal_except_test3 = TRUE; /* indicate we hit the PAL_EXCEPT block */ } PAL_ENDTRY; - if (!bTry) + if (!bTry_pal_except_test3) { Trace("ERROR: the code in the PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_pal_except_test3) { Trace("ERROR: the code in the PAL_EXCEPT block was not executed.\n"); } - if (!bTry_function) + if (!bTry_function_pal_except_test3) { Trace("ERROR: the code in the " "function's PAL_TRY block was not executed.\n"); } - if (!bExcept_function) + if (!bExcept_function_pal_except_test3) { Trace("ERROR: the code in the " "function's PAL_EXCEPT block was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept || - !bTry_function || !bExcept_function) + if(!bTry_pal_except_test3 || !bExcept_pal_except_test3 || + !bTry_function_pal_except_test3 || !bExcept_function_pal_except_test3) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/testinfo.dat deleted file mode 100644 index 348940e6a27f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test3/testinfo.dat +++ /dev/null @@ -1,26 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 - -Section = exception_handling - -Function = PAL_TRY and PAL_EXCEPT - -Name = Test for PAL_TRY and PAL_EXCEPT - -Type = DEFAULT - -EXE1 = test3 - -LANG = cpp - -Description - -= Test to make sure the PAL_EXCEPT block is executed - -= after an exception occurs in the PAL_TRY block - -= that calls a function that contains - -= another PAL_TRY-PAL_EXCEPT block diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/CMakeLists.txt deleted file mode 100644 index 493845cdbc8e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_pal_except_test4 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_test4 coreclrpal) - -target_link_libraries(paltest_pal_except_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.cpp index 386f50243898..ba2151a61cbb 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.cpp @@ -15,12 +15,12 @@ #include /* Execution flags */ -BOOL bTry = FALSE; -BOOL bExcept = FALSE; -BOOL bTry_nested = FALSE; -BOOL bExcept_nested = FALSE; +BOOL bTry_palexcept_test4 = FALSE; +BOOL bExcept_palexcept_test4 = FALSE; +BOOL bTry_nested_palexcept_test4 = FALSE; +BOOL bExcept_nested_palexcept_test4 = FALSE; -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_pal_except_test4_paltest_pal_except_test4, "exception_handling/pal_except/test4/paltest_pal_except_test4") { if (0 != PAL_Initialize(argc, argv)) { @@ -31,14 +31,14 @@ int __cdecl main(int argc, char *argv[]) { int* p = 0x00000000; /* NULL pointer */ - bTry = TRUE; /* indicate we hit the PAL_TRY block */ + bTry_palexcept_test4 = TRUE; /* indicate we hit the PAL_TRY block */ *p = 13; /* causes an access violation exception */ Fail("ERROR: code was executed after the access violation.\n"); } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if (!bTry) + if (!bTry_palexcept_test4) { Fail("ERROR: PAL_EXCEPT was hit without PAL_TRY being hit.\n"); } @@ -47,7 +47,7 @@ int __cdecl main(int argc, char *argv[]) { int *lp = 0x00000000; - bTry_nested = TRUE; + bTry_nested_palexcept_test4 = TRUE; *lp = 13; /* causes an access violation exception */ Fail("ERROR: code was executed after the " @@ -55,44 +55,44 @@ int __cdecl main(int argc, char *argv[]) } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - if (!bTry_nested) + if (!bTry_nested_palexcept_test4) { Fail("ERROR: PAL_EXCEPT was hit without PAL_TRY being hit " "in the nested block.\n"); } - bExcept_nested = TRUE; + bExcept_nested_palexcept_test4 = TRUE; } PAL_ENDTRY; - bExcept = TRUE; /* indicate we hit the PAL_EXCEPT block */ + bExcept_palexcept_test4 = TRUE; /* indicate we hit the PAL_EXCEPT block */ } PAL_ENDTRY; - if (!bTry) + if (!bTry_palexcept_test4) { Trace("ERROR: the code in the PAL_TRY block was not executed.\n"); } - if (!bExcept) + if (!bExcept_palexcept_test4) { Trace("ERROR: the code in the PAL_EXCEPT block was not executed.\n"); } - if (!bTry_nested) + if (!bTry_nested_palexcept_test4) { Trace("ERROR: the code in the nested " "PAL_TRY block was not executed.\n"); } - if (!bExcept_nested) + if (!bExcept_nested_palexcept_test4) { Trace("ERROR: the code in the nested " "PAL_EXCEPT block was not executed.\n"); } /* did we hit all the code blocks? */ - if(!bTry || !bExcept || - !bTry_nested || !bExcept_nested) + if(!bTry_palexcept_test4 || !bExcept_palexcept_test4 || + !bTry_nested_palexcept_test4 || !bExcept_nested_palexcept_test4) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/testinfo.dat deleted file mode 100644 index 3f761bc2487f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test4/testinfo.dat +++ /dev/null @@ -1,26 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 - -Section = exception_handling - -Function = PAL_TRY and PAL_EXCEPT - -Name = Test for PAL_TRY and PAL_EXCEPT - -Type = DEFAULT - -EXE1 = test4 - -LANG = cpp - -Description - -= Test to make sure the PAL_EXCEPT block is executed - -= after an exception occurs in the PAL_TRY block - -= if the PAL_EXCEPT block contains a nested - -= PAL_TRY-PAL_EXCEPT block diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/CMakeLists.txt deleted file mode 100644 index 5b6b8dc3f4b3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_pal_except_test5 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_test5 coreclrpal) - -target_link_libraries(paltest_pal_except_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.cpp index 97ee1d8d2810..4872226f3ea7 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.cpp @@ -20,7 +20,7 @@ BOOL bExcept = FALSE; BOOL bTry_nested = FALSE; BOOL bExcept_nested = FALSE; -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_pal_except_test5_paltest_pal_except_test5, "exception_handling/pal_except/test5/paltest_pal_except_test5") { if (0 != PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/testinfo.dat deleted file mode 100644 index 9ff2fbfb8b02..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test5/testinfo.dat +++ /dev/null @@ -1,26 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 - -Section = exception_handling - -Function = PAL_TRY and PAL_EXCEPT - -Name = Test for PAL_TRY and PAL_EXCEPT - -Type = DEFAULT - -EXE1 = test5 - -LANG = cpp - -Description - -= Test to make sure the PAL_EXCEPT block is executed - -= after an exception occurs in the PAL_TRY block - -= if the PAL_EXCEPT block calls a function that contains - -= another PAL_TRY-PAL_EXCEPT block diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/CMakeLists.txt deleted file mode 100644 index e74367388c77..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_pal_except_test6 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_test6 coreclrpal) - -target_link_libraries(paltest_pal_except_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.cpp index c3fc8547690f..89c360d7e858 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.cpp @@ -22,7 +22,7 @@ BOOL bTry_nested2 = FALSE; BOOL bExcept_nested2 = FALSE; -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_pal_except_test6_paltest_pal_except_test6, "exception_handling/pal_except/test6/paltest_pal_except_test6") { if (0 != PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/testinfo.dat deleted file mode 100644 index 5d6006cef6d8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test6/testinfo.dat +++ /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. - -Version = 1.0 - -Section = exception_handling - -Function = PAL_TRY and PAL_EXCEPT_EX - -Name = Test for PAL_TRY and PAL_EXCEPT_EX - -Type = DEFAULT - -EXE1 = test6 - -LANG = cpp - -Description - -= Test to make sure the PAL_EXCEPT_EX block is executed - -= after an exception occurs in the PAL_TRY block - -= that contains multiple PAL_TRY-PAL_EXCEPT_EX blocks diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/CMakeLists.txt deleted file mode 100644 index 40ffaeafd6a7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_pal_except_test7 - ${SOURCES} -) - -add_dependencies(paltest_pal_except_test7 coreclrpal) - -target_link_libraries(paltest_pal_except_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.cpp index cc43f4ee2a0a..b1c90af044e4 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_pal_except_test7_paltest_pal_except_test7, "exception_handling/pal_except/test7/paltest_pal_except_test7") { BOOL bTry = FALSE; BOOL bExcept = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/testinfo.dat deleted file mode 100644 index 97cdfa4ba75f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_except/test7/testinfo.dat +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 - -Section = exception_handling - -Function = PAL_TRY and PAL_EXCEPT - -Name = Test for PAL_TRY and PAL_EXCEPT - -Type = DEFAULT - -EXE1 = test7 - -LANG = cpp - -Description - -= In this test, no exceptions are forced to ensure the EXCEPTION block - -= isn't hit. - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/CMakeLists.txt deleted file mode 100644 index db29fcab1854..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - pal_finally.cpp -) - -add_executable(paltest_pal_finally_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_finally_test1 coreclrpal) - -target_link_libraries(paltest_pal_finally_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.cpp b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.cpp index 423355b2d68d..2a23e4ed3c30 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.cpp +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.cpp @@ -152,7 +152,7 @@ void NestedFunc2 (void) PAL_ENDTRY ; } -int __cdecl main(int argc, char *argv[]) +PALTEST(exception_handling_pal_finally_test1_paltest_pal_finally_test1, "exception_handling/pal_finally/test1/paltest_pal_finally_test1") { if (0 != PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/testinfo.dat deleted file mode 100644 index 66626c2039ed..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_finally/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = exception_handling -Function = PAL_FINALLY -Name = Test for nested PAL_FINALLY -Type = DEFAULT -EXE1 = pal_finally -LANG = cpp -Description -= Tests the PAL implementation of the PAL_FINALLY in the presence -= of a call stack. An exception is forced and passed to two nested -= exception filters for consideration. The first filter returns -= EXCEPTION_CONTINUE_SEARCH so the second can run and return -= EXCEPTION_EXECUTE_HANDLER. The initial exception handler should -= be skipped, and the second executed, and all the PAL_FINALLY -= blocks handled. diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt index 0db9b289dc80..aec809d3fbc7 100644 --- a/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt +++ b/src/coreclr/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt @@ -19,11 +19,11 @@ set(EXPORTS_FILE1 ${CMAKE_CURRENT_BINARY_DIR}/dlltest1.exports) generate_exports_file(${DEF_SOURCES1} ${EXPORTS_FILE1}) if(CLR_CMAKE_HOST_UNIX) - set_exports_linker_option(${EXPORTS_FILE}) + set_exports_linker_option(${EXPORTS_FILE1}) endif(CLR_CMAKE_HOST_UNIX) set(DLL1SOURCES dlltest1.cpp) -add_library(paltest_pal_sxs_test1_dll1 SHARED ${DLL1SOURCES}) +_add_library(paltest_pal_sxs_test1_dll1 SHARED ${DLL1SOURCES}) add_custom_target(dlltest1_exports DEPENDS ${EXPORTS_FILE1}) set_property(TARGET paltest_pal_sxs_test1_dll1 APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION1}) set_property(TARGET paltest_pal_sxs_test1_dll1 APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE1}) @@ -55,7 +55,7 @@ if(CLR_CMAKE_TARGET_OSX) endif(CLR_CMAKE_TARGET_OSX) set(DLL2SOURCES dlltest2.cpp) -add_library(paltest_pal_sxs_test1_dll2 SHARED ${DLL2SOURCES}) +_add_library(paltest_pal_sxs_test1_dll2 SHARED ${DLL2SOURCES}) add_custom_target(dlltest2_exports DEPENDS ${EXPORTS_FILE2}) set_property(TARGET paltest_pal_sxs_test1_dll2 APPEND_STRING PROPERTY LINK_FLAGS ${EXPORTS_LINKER_OPTION2}) set_property(TARGET paltest_pal_sxs_test1_dll2 APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE2}) @@ -72,7 +72,7 @@ target_link_libraries(paltest_pal_sxs_test1_dll2 set(TESTSOURCES exceptionsxs.cpp) -add_executable(paltest_pal_sxs_test1 ${TESTSOURCES}) +_add_executable(paltest_pal_sxs_test1 ${TESTSOURCES}) add_dependencies(paltest_pal_sxs_test1 paltest_pal_sxs_test1_dll1 @@ -83,3 +83,7 @@ target_link_libraries(paltest_pal_sxs_test1 paltest_pal_sxs_test1_dll1 paltest_pal_sxs_test1_dll2 ) + +_install (TARGETS paltest_pal_sxs_test1 DESTINATION paltests/exception_handling/pal_sxs/test1) +_install (TARGETS paltest_pal_sxs_test1_dll1 DESTINATION paltests/exception_handling/pal_sxs/test1) +_install (TARGETS paltest_pal_sxs_test1_dll2 DESTINATION paltests/exception_handling/pal_sxs/test1) \ No newline at end of file diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CMakeLists.txt deleted file mode 100644 index b9b0052cdc0f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -add_subdirectory(CopyFileA) -add_subdirectory(CopyFileW) -add_subdirectory(CreateFileA) -add_subdirectory(CreateFileW) -add_subdirectory(DeleteFileA) -add_subdirectory(DeleteFileW) -add_subdirectory(errorpathnotfound) -add_subdirectory(FILECanonicalizePath) -add_subdirectory(FindClose) -add_subdirectory(FindFirstFileA) -add_subdirectory(FindFirstFileW) -add_subdirectory(FindNextFileA) -add_subdirectory(FindNextFileW) -add_subdirectory(FlushFileBuffers) -add_subdirectory(GetConsoleOutputCP) -add_subdirectory(GetCurrentDirectoryA) -add_subdirectory(GetCurrentDirectoryW) -add_subdirectory(GetFileAttributesA) -add_subdirectory(GetFileAttributesExW) -add_subdirectory(GetFileAttributesW) -add_subdirectory(GetFileSize) -add_subdirectory(GetFileSizeEx) -add_subdirectory(GetFullPathNameA) -add_subdirectory(GetFullPathNameW) -add_subdirectory(GetStdHandle) -add_subdirectory(GetSystemTime) -add_subdirectory(GetSystemTimeAsFileTime) -add_subdirectory(GetTempFileNameA) -add_subdirectory(GetTempFileNameW) -add_subdirectory(gettemppatha) -add_subdirectory(GetTempPathW) -add_subdirectory(MoveFileExA) -add_subdirectory(MoveFileExW) -add_subdirectory(ReadFile) -add_subdirectory(SearchPathW) -add_subdirectory(SetEndOfFile) -add_subdirectory(SetFilePointer) -add_subdirectory(WriteFile) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/CMakeLists.txt deleted file mode 100644 index 7c06a0fc1d1d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CopyFileA.cpp -) - -add_executable(paltest_copyfilea_test1 - ${SOURCES} -) - -add_dependencies(paltest_copyfilea_test1 coreclrpal) - -target_link_libraries(paltest_copyfilea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.cpp index fcfb463a9349..5f11729312f8 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.cpp @@ -31,7 +31,7 @@ struct TESTS{ }; -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CopyFileA_test1_paltest_copyfilea_test1, "file_io/CopyFileA/test1/paltest_copyfilea_test1") { char szSrcExisting[] = {"src_existing.tmp"}; char szSrcNonExistant[] = {"src_non-existant.tmp"}; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/testinfo.dat deleted file mode 100644 index 305e3486f2bd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CopyFileA -Name = Test for CopyFileA (test 1) -Type = DEFAULT -EXE1 = copyfilea -Description -= Test the CopyFileA function diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/CMakeLists.txt deleted file mode 100644 index 12993509ac68..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_copyfilea_test2 - ${SOURCES} -) - -add_dependencies(paltest_copyfilea_test2 coreclrpal) - -target_link_libraries(paltest_copyfilea_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.cpp index 60e1ffa280b9..73604c03441d 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CopyFileA_test2_paltest_copyfilea_test2, "file_io/CopyFileA/test2/paltest_copyfilea_test2") { BOOL bRc = TRUE; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/testinfo.dat deleted file mode 100644 index 17f971771216..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CopyFileA -Name = CopyFileA - checking copying to itself (test2) -Type = DEFAULT -EXE1 = test2 -Description -= Test the CopyFileA function's behaviour -= for copying a file to itself. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/CMakeLists.txt deleted file mode 100644 index 92316b40d299..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_copyfilea_test3 - ${SOURCES} -) - -add_dependencies(paltest_copyfilea_test3 coreclrpal) - -target_link_libraries(paltest_copyfilea_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.cpp index 48ebda2d5fc3..37f7601986e9 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CopyFileA_test3_paltest_copyfilea_test3, "file_io/CopyFileA/test3/paltest_copyfilea_test3") { BOOL bRc = TRUE; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/testinfo.dat deleted file mode 100644 index fde68250de9d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test3/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CopyFileA -Name = CopyFileA - checking file attributes maintained (test2) -Type = DEFAULT -EXE1 = test3 -Description -= Test the CopyFileA function's behaviour -= for copying a file and verifying that -= the copied file has the same file attributes -= as the original. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/CMakeLists.txt deleted file mode 100644 index 71318e8698aa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_copyfilea_test4 - ${SOURCES} -) - -add_dependencies(paltest_copyfilea_test4 coreclrpal) - -target_link_libraries(paltest_copyfilea_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.cpp index 05d07eed5d17..bf3e3ec732b8 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.cpp @@ -24,7 +24,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CopyFileA_test4_paltest_copyfilea_test4, "file_io/CopyFileA/test4/paltest_copyfilea_test4") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/testinfo.dat deleted file mode 100644 index 662c16999128..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileA/test4/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CopyFileA -Name = CopyFileA - checking file attributes maintained (test4) -Type = DEFAULT -EXE1 = test4 -Description -= Copy a file from a different user, belonging to a different group to -= the the current user, who is a member of the current group. Then check -= to see that the current user has the basic access rights to the copied -= file. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/CMakeLists.txt deleted file mode 100644 index 182997da420a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CopyFileW.cpp -) - -add_executable(paltest_copyfilew_test1 - ${SOURCES} -) - -add_dependencies(paltest_copyfilew_test1 coreclrpal) - -target_link_libraries(paltest_copyfilew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.cpp index 49e25f1ed947..5a36b3d11260 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.cpp @@ -23,7 +23,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CopyFileW_test1_paltest_copyfilew_test1, "file_io/CopyFileW/test1/paltest_copyfilew_test1") { LPSTR lpSource[2] = {"src_existing.tmp", "src_non-existant.tmp"}; LPSTR lpDestination[2] = {"dst_existing.tmp", "dst_non-existant.tmp"}; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/testinfo.dat deleted file mode 100644 index 80eaf917be67..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CopyFileW -Name = Tests CopyFileW functionality. -Type = DEFAULT -EXE1 = copyfilew -Description -= Test the CopyFileW function - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/CMakeLists.txt deleted file mode 100644 index dc88b3f42b1d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_copyfilew_test2 - ${SOURCES} -) - -add_dependencies(paltest_copyfilew_test2 coreclrpal) - -target_link_libraries(paltest_copyfilew_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.cpp index 98fb244627e1..ce0eea540d2b 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CopyFileW_test2_paltest_copyfilew_test2, "file_io/CopyFileW/test2/paltest_copyfilew_test2") { LPSTR szSrcExisting = "src_existing.tmp"; WCHAR* wcSource; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/testinfo.dat deleted file mode 100644 index b81c63f7b237..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CopyFileW -Name = Tests CopyFileW to check if file can be copied to itself. (test2) -Type = DEFAULT -EXE1 = test2 -Description -= Test the CopyFileW function -= to see the effect of copying a -= file to itself. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/CMakeLists.txt deleted file mode 100644 index f147367b7e9e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_copyfilew_test3 - ${SOURCES} -) - -add_dependencies(paltest_copyfilew_test3 coreclrpal) - -target_link_libraries(paltest_copyfilew_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.cpp index 739abc9504f4..e142e72b3cec 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.cpp @@ -24,7 +24,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CopyFileW_test3_paltest_copyfilew_test3, "file_io/CopyFileW/test3/paltest_copyfilew_test3") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/testinfo.dat deleted file mode 100644 index ef91c318e520..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CopyFileW/test3/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CopyFileW -Name = CopyFileW - checking file attributes maintained (test3) -Type = DEFAULT -EXE1 = test3 -Description -= Copy a file from a different user, belonging to a different group to -= the the current user, who is a member of the current group. Then check -= to see that the current user has the basic access rights to the copied -= file. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryA/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryA/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/CMakeLists.txt deleted file mode 100644 index ee06026decfe..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createdirectorya.cpp -) - -add_executable(paltest_createdirectorya_test2 - ${SOURCES} -) - -add_dependencies(paltest_createdirectorya_test2 coreclrpal) - -target_link_libraries(paltest_createdirectorya_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryW/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/CMakeLists.txt deleted file mode 100644 index bdc1dfe97441..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createdirectoryw.cpp -) - -add_executable(paltest_createdirectoryw_test2 - ${SOURCES} -) - -add_dependencies(paltest_createdirectoryw_test2 coreclrpal) - -target_link_libraries(paltest_createdirectoryw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/CMakeLists.txt deleted file mode 100644 index 737dfcfbc9b7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileA.cpp -) - -add_executable(paltest_createfilea_test1 - ${SOURCES} -) - -add_dependencies(paltest_createfilea_test1 coreclrpal) - -target_link_libraries(paltest_createfilea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp index 21150a0614ca..06af62f9f3a2 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp @@ -12,7 +12,7 @@ #include -BOOL Cleanup(void) +BOOL Cleanup_CreateFileA_test1(void) { char FileName[20]; int i; @@ -31,7 +31,7 @@ BOOL Cleanup(void) } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CreateFileA_test1_paltest_createfilea_test1, "file_io/CreateFileA/test1/paltest_createfilea_test1") { BOOL bSuccess = TRUE; int nCounter = 0; @@ -70,7 +70,7 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - if (!Cleanup()) { + if (!Cleanup_CreateFileA_test1()) { Trace("Pre-test Cleanup() failed. LastError=%d\n", GetLastError()); return FAIL; } @@ -132,7 +132,7 @@ int __cdecl main(int argc, char *argv[]) } } - if (!Cleanup()) + if (!Cleanup_CreateFileA_test1()) { Trace("Post-test Cleanup() failed. LastError=%d\n", GetLastError()); return FAIL; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/testinfo.dat deleted file mode 100644 index 3f3083a78c1a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CreateFileA -Name = test for CreateFileA -Type = DEFAULT -EXE1 = createfilea -Description -= Attempts to create files based on all combinations of -= options of CreateFileA diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/CMakeLists.txt deleted file mode 100644 index 44fa6507b574..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileW.cpp -) - -add_executable(paltest_createfilew_test1 - ${SOURCES} -) - -add_dependencies(paltest_createfilew_test1 coreclrpal) - -target_link_libraries(paltest_createfilew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp index a861f3d88fa2..38d7f5fc9c56 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp @@ -12,7 +12,7 @@ #include -BOOL Cleanup(void) +BOOL Cleanup_CreateFileW_test1(void) { char FileName[20]; int i; @@ -31,7 +31,7 @@ BOOL Cleanup(void) } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_CreateFileW_test1_paltest_createfilew_test1, "file_io/CreateFileW/test1/paltest_createfilew_test1") { BOOL bSuccess = TRUE; int nCounter = 0; @@ -72,7 +72,7 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - if (!Cleanup()) { + if (!Cleanup_CreateFileW_test1()) { Trace("Pre-test Cleanup() failed. LastError=%d\n", GetLastError()); return FAIL; } @@ -139,7 +139,7 @@ int __cdecl main(int argc, char *argv[]) } } - if (!Cleanup()) + if (!Cleanup_CreateFileW_test1()) { Trace("Post-test Cleanup() failed. LastError=%d\n", GetLastError()); return FAIL; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/testinfo.dat deleted file mode 100644 index b4028e8a44ae..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/CreateFileW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = CreateFileW -Name = test for CreateFileW -Type = DEFAULT -EXE1 = createfilew -Description -= Attempts to create files based on all combinations of -= options of CreateFileW diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/CMakeLists.txt deleted file mode 100644 index 3d60e61477f7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - DeleteFileA.cpp -) - -add_executable(paltest_deletefilea_test1 - ${SOURCES} -) - -add_dependencies(paltest_deletefilea_test1 coreclrpal) - -target_link_libraries(paltest_deletefilea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/DeleteFileA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/DeleteFileA.cpp index badb3ba8525a..606a0f57a59e 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/DeleteFileA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/DeleteFileA.cpp @@ -26,7 +26,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_DeleteFileA_test1_paltest_deletefilea_test1, "file_io/DeleteFileA/test1/paltest_deletefilea_test1") { FILE *tempFile = NULL; BOOL bRc = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/testinfo.dat deleted file mode 100644 index 5522d2855608..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = DeleteFileA -Name = Test for DeleteFileA (test 1) -Type = DEFAULT -EXE1 = deletefilea -Description -= Attempt to delete various files. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/CMakeLists.txt deleted file mode 100644 index c61b1ab0e9a4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - DeleteFileW.cpp -) - -add_executable(paltest_deletefilew_test1 - ${SOURCES} -) - -add_dependencies(paltest_deletefilew_test1 coreclrpal) - -target_link_libraries(paltest_deletefilew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.cpp index ef9069670206..fa4652f8748b 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.cpp @@ -22,7 +22,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_DeleteFileW_test1_paltest_deletefilew_test1, "file_io/DeleteFileW/test1/paltest_deletefilew_test1") { FILE *tempFile = NULL; BOOL bRc = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/testinfo.dat deleted file mode 100644 index 78f0fbc2bd9d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/DeleteFileW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = DeleteFileW -Name = Test for DeleteFileW (test 1) -Type = DEFAULT -EXE1 = deletefilew -Description -= Tests DeleteFileW on various file names - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/CMakeLists.txt deleted file mode 100644 index 9c4d62206c34..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - FILECanonicalizePath.cpp -) - -add_executable(paltest_filecanonicalizepath_test1 - ${SOURCES} -) - -add_dependencies(paltest_filecanonicalizepath_test1 coreclrpal) - -target_link_libraries(paltest_filecanonicalizepath_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.cpp index 4661843d7803..74daffe3a5ad 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.cpp @@ -16,7 +16,7 @@ extern "C" void FILECanonicalizePath(LPSTR lpUnixPath); void TestCase(LPSTR input, LPSTR expectedOutput); -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_FILECanonicalizePath_paltest_filecanonicalizepath_test1, "file_io/FILECanonicalizePath/paltest_filecanonicalizepath_test1") { if (PAL_Initialize(argc,argv) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/testinfo.dat deleted file mode 100644 index c06c21c75883..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FILECanonicalizePath/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FILECanonicalizePath -Name = Test for FILECanonicalizePath (test 1) -Type = DEFAULT -EXE1 = filecanonicalizepath -Description -= Canonicalizes paths and verifies the results diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/CMakeLists.txt deleted file mode 100644 index e8b1b8336a8e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - FindClose.cpp -) - -add_executable(paltest_findclose_test1 - ${SOURCES} -) - -add_dependencies(paltest_findclose_test1 coreclrpal) - -target_link_libraries(paltest_findclose_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.cpp index f9df4b9c077a..7226b1d7a064 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.cpp @@ -15,18 +15,18 @@ -const WCHAR szFindName[] = {'t','e', 's', 't', '0', '1', '.', 't', 'x', 't', '\0'}; -const WCHAR szFindName_02[] = {'t','e', 's', 't', '0', '2', '.', 't', 'x', 't', '\0'}; -const WCHAR szFindName_03[] = {'t','e', 's', 't', '0', '3', '.', 't', 'x', 't', '\0'}; -const WCHAR szFindNameWldCard_01[] = {'t','e', 's', 't', '0', '?', '.', 't', 'x', 't', '\0'}; -const WCHAR szFindNameWldCard_02[] = {'*', '.', 't', 'x', 't', '\0'}; -const WCHAR szDirName[] = {'t','e', 's', 't', '_', 'd', 'i', 'r', '\0'}; -const WCHAR szDirName_02[] = {'t','e', 's', 't', '_', 'd', 'i', 'r', '0', '2', '\0'}; -const WCHAR szDirNameWldCard[] = {'t','e', 's', 't', '_', '*', '\0'}; +const WCHAR szFindName_FindClose_test1[] = {'t','e', 's', 't', '0', '1', '.', 't', 'x', 't', '\0'}; +const WCHAR szFindName_02_FindClose_test1[] = {'t','e', 's', 't', '0', '2', '.', 't', 'x', 't', '\0'}; +const WCHAR szFindName_03_FindClose_test1[] = {'t','e', 's', 't', '0', '3', '.', 't', 'x', 't', '\0'}; +const WCHAR szFindNameWldCard_01_FindClose_test1[] = {'t','e', 's', 't', '0', '?', '.', 't', 'x', 't', '\0'}; +const WCHAR szFindNameWldCard_02_FindClose_test1[] = {'*', '.', 't', 'x', 't', '\0'}; +const WCHAR szDirName_FindClose_test1[] = {'t','e', 's', 't', '_', 'd', 'i', 'r', '\0'}; +const WCHAR szDirName_02_FindClose_test1[] = {'t','e', 's', 't', '_', 'd', 'i', 'r', '0', '2', '\0'}; +const WCHAR szDirNameWldCard_FindClose_test1[] = {'t','e', 's', 't', '_', '*', '\0'}; -BOOL createTestFile(const WCHAR* szName) +BOOL createTestFile_FindClose_test1(const WCHAR* szName) { FILE *pFile = NULL; char* pTemp = NULL; @@ -51,16 +51,16 @@ BOOL createTestFile(const WCHAR* szName) void removeAll() { - RemoveDirectoryW(szDirName); - RemoveDirectoryW(szDirName_02); + RemoveDirectoryW(szDirName_FindClose_test1); + RemoveDirectoryW(szDirName_02_FindClose_test1); - DeleteFileW(szFindName); - DeleteFileW(szFindName_02); - DeleteFileW(szFindName_03); + DeleteFileW(szFindName_FindClose_test1); + DeleteFileW(szFindName_02_FindClose_test1); + DeleteFileW(szFindName_03_FindClose_test1); } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_FindClose_test1_paltest_findclose_test1, "file_io/FindClose/test1/paltest_findclose_test1") { WIN32_FIND_DATAW findFileData; WIN32_FIND_DATAW findFileData_02; @@ -84,19 +84,19 @@ int __cdecl main(int argc, char *argv[]) } /* find a file that exists */ - if(createTestFile(szFindName) == FALSE) + if(createTestFile_FindClose_test1(szFindName_FindClose_test1) == FALSE) { removeAll(); PAL_TerminateEx(FAIL); return FAIL; } - if(createTestFile(szFindName_02) == FALSE) + if(createTestFile_FindClose_test1(szFindName_02_FindClose_test1) == FALSE) { removeAll(); PAL_TerminateEx(FAIL); return FAIL; } - if(createTestFile(szFindName_03) == FALSE) + if(createTestFile_FindClose_test1(szFindName_03_FindClose_test1) == FALSE) { removeAll(); PAL_TerminateEx(FAIL); @@ -104,10 +104,10 @@ int __cdecl main(int argc, char *argv[]) } // close a FindFirstFileW handle - hFind = FindFirstFileW(szFindName, &findFileData); + hFind = FindFirstFileW(szFindName_FindClose_test1, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - pTemp = convertC((WCHAR*)szFindName); + pTemp = convertC((WCHAR*)szFindName_FindClose_test1); Trace("FindClose: ERROR -> Unable to find \"%s\"\n", pTemp); free(pTemp); removeAll(); @@ -124,10 +124,10 @@ int __cdecl main(int argc, char *argv[]) " FindFirstFileW handle.\n"); } } - hFind = FindFirstFileW(szFindName, &findFileData); + hFind = FindFirstFileW(szFindName_FindClose_test1, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - pTemp = convertC((WCHAR*)szFindName); + pTemp = convertC((WCHAR*)szFindName_FindClose_test1); Trace("FindClose: ERROR -> Unable to find \"%s\"\n", pTemp); free(pTemp); removeAll(); @@ -155,10 +155,10 @@ int __cdecl main(int argc, char *argv[]) } /* find a directory that exists */ - bRc = CreateDirectoryW(szDirName, NULL); + bRc = CreateDirectoryW(szDirName_FindClose_test1, NULL); if (bRc == FALSE) { - pTemp = convertC((WCHAR*)szDirName); + pTemp = convertC((WCHAR*)szDirName_FindClose_test1); Trace("FindClose: ERROR -> Failed to create the directory \"%s\"\n", pTemp); free(pTemp); @@ -167,10 +167,10 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - bRc = CreateDirectoryW(szDirName_02, NULL); + bRc = CreateDirectoryW(szDirName_02_FindClose_test1, NULL); if (bRc == FALSE) { - pTemp = convertC((WCHAR*)szDirName_02); + pTemp = convertC((WCHAR*)szDirName_02_FindClose_test1); Trace("FindClose: ERROR -> Failed to create the directory \"%s\"\n", pTemp); free(pTemp); @@ -179,10 +179,10 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - hFind = FindFirstFileW(szDirName, &findFileData); + hFind = FindFirstFileW(szDirName_FindClose_test1, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - pTemp = convertC((WCHAR*)szDirName); + pTemp = convertC((WCHAR*)szDirName_FindClose_test1); Trace("FindClose: ERROR. FindFirstFileW was unable to find \"%s\"\n", pTemp); free(pTemp); @@ -202,10 +202,10 @@ int __cdecl main(int argc, char *argv[]) } /* find a file using wild cards */ - hFind = FindFirstFileW(szFindNameWldCard_01, &findFileData); + hFind = FindFirstFileW(szFindNameWldCard_01_FindClose_test1, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - pTemp = convertC((WCHAR*)szFindNameWldCard_01); + pTemp = convertC((WCHAR*)szFindNameWldCard_01_FindClose_test1); Trace("FindClose: ERROR -> FindFirstFileW was unable to find \"%s\"\n", pTemp); free(pTemp); @@ -234,10 +234,10 @@ int __cdecl main(int argc, char *argv[]) } /* find a directory using wild cards */ - hFind = FindFirstFileW(szDirNameWldCard, &findFileData); + hFind = FindFirstFileW(szDirNameWldCard_FindClose_test1, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - pTemp = convertC((WCHAR*)szDirNameWldCard); + pTemp = convertC((WCHAR*)szDirNameWldCard_FindClose_test1); Trace("FindClose: ERROR -> Unable to find \"%s\"\n", pTemp); free(pTemp); diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/testinfo.dat deleted file mode 100644 index a330c61b8585..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindClose/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FindClose -Name = Test for FindClose (test 1) -Type = DEFAULT -EXE1 = findclose -Description -= Test the FindClose on handles opened using the Find functions - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/CMakeLists.txt deleted file mode 100644 index c73e27ff0b79..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - FindFirstFileA.cpp -) - -add_executable(paltest_findfirstfilea_test1 - ${SOURCES} -) - -add_dependencies(paltest_findfirstfilea_test1 coreclrpal) - -target_link_libraries(paltest_findfirstfilea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.cpp index 901a1f35e6bb..9a4d906162d3 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.cpp @@ -14,18 +14,18 @@ #include -const char* szNoFileName = "333asdf.x77t"; -const char* szFindName = "test01.txt"; -const char* szFindNameWldCard_01 = "test0?.txt"; -const char* szFindNameWldCard_02 = "*.txt"; -const char* szDirName = "test_dir"; -const char* szDirNameSlash = "test_dir\\"; -const char* szDirNameWldCard_01 = "?est_dir"; -const char* szDirNameWldCard_02 = "test_*"; +#define szNoFileName "333asdf.x77t" +#define szFindName "test01.txt" +#define szFindNameWldCard_01 "test0?.txt" +#define szFindNameWldCard_02 "*.txt" +#define szDirName "test_dir" +#define szDirNameSlash "test_dir\\" +#define szDirNameWldCard_01 "?est_dir" +#define szDirNameWldCard_02 "test_*" /* Longer than MAX_LONGPATH characters */ char szLongFindName[MAX_LONGPATH+1]; -BOOL CleanUp() +BOOL CleanUp_FindFirstFileA_test1() { DWORD dwAtt; BOOL result = TRUE; @@ -36,29 +36,31 @@ BOOL CleanUp() if(!SetFileAttributesA (szFindName, FILE_ATTRIBUTE_NORMAL)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", szFindName, FILE_ATTRIBUTE_NORMAL); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", szFindName, FILE_ATTRIBUTE_NORMAL); + } if(!DeleteFileA (szFindName)) { result = FALSE; - Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), szFindName, dwAtt); + Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), szFindName, dwAtt); } } dwAtt = GetFileAttributesA(szDirName); if( dwAtt != INVALID_FILE_ATTRIBUTES ) { - if(!RemoveDirectoryA (szDirName)) + LPWSTR szDirNameW = convert(szDirName); + if(!RemoveDirectoryW (szDirNameW)) { result = FALSE; - Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), szDirName, dwAtt); + Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), szDirName, dwAtt); } + free(szDirNameW); } return result; } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_FindFirstFileA_test1_paltest_findfirstfilea_test1, "file_io/FindFirstFileA/test1/paltest_findfirstfilea_test1") { WIN32_FIND_DATA findFileData; HANDLE hFind = NULL; @@ -73,7 +75,7 @@ int __cdecl main(int argc, char *argv[]) } - if(!CleanUp()) + if(!CleanUp_FindFirstFileA_test1()) { Fail("FindFirstFileW: ERROR : Initial Clean Up failed\n"); } @@ -134,12 +136,12 @@ int __cdecl main(int argc, char *argv[]) if (bRc == FALSE) { Fail("FindFirstFileA: ERROR -> Failed to create the directory " - "\"%s\"\n", + "\"%s\"\n", szDirName); } hFind = FindFirstFileA(szDirName, &findFileData); - if (hFind == INVALID_HANDLE_VALUE) + if (hFind == INVALID_HANDLE_VALUE) { Fail ("FindFirstFileA: ERROR. Unable to find \"%s\"\n", szDirName); } @@ -157,23 +159,23 @@ int __cdecl main(int argc, char *argv[]) // find a directory using a trailing '\' on the directory name: should fail // hFind = FindFirstFileA(szDirNameSlash, &findFileData); - if (hFind != INVALID_HANDLE_VALUE) + if (hFind != INVALID_HANDLE_VALUE) { Fail ("FindFirstFileA: ERROR -> Able to find \"%s\": trailing " - "slash should have failed.\n", + "slash should have failed.\n", szDirNameSlash); } // find a file using wild cards hFind = FindFirstFileA(szFindNameWldCard_01, &findFileData); - if (hFind == INVALID_HANDLE_VALUE) + if (hFind == INVALID_HANDLE_VALUE) { - Fail ("FindFirstFileA: ERROR -> Unable to find \"%s\"\n", + Fail ("FindFirstFileA: ERROR -> Unable to find \"%s\"\n", szFindNameWldCard_01); } hFind = FindFirstFileA(szFindNameWldCard_02, &findFileData); - if (hFind == INVALID_HANDLE_VALUE) + if (hFind == INVALID_HANDLE_VALUE) { Fail ("FindFirstFileA: ERROR -> Unable to find \"%s\"\n", szFindNameWldCard_02); } @@ -183,23 +185,23 @@ int __cdecl main(int argc, char *argv[]) // find a directory using wild cards // hFind = FindFirstFileA(szDirNameWldCard_01, &findFileData); - if (hFind == INVALID_HANDLE_VALUE) + if (hFind == INVALID_HANDLE_VALUE) { Fail ("FindFirstFileA: ERROR -> Unable to find \"%s\"\n", szDirNameWldCard_01); } hFind = FindFirstFileA(szDirNameWldCard_02, &findFileData); - if (hFind == INVALID_HANDLE_VALUE) + if (hFind == INVALID_HANDLE_VALUE) { Fail ("FindFirstFileA: ERROR -> Unable to find \"%s\"\n", szDirNameWldCard_02); } - if(!CleanUp()) + if(!CleanUp_FindFirstFileA_test1()) { Fail("FindFirstFileW: ERROR : Final Clean Up failed\n"); } - PAL_Terminate(); + PAL_Terminate(); return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/testinfo.dat deleted file mode 100644 index 7a2e05906dc8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FindFirstFileA -Name = Test for FindFirstFileA (test 1) -Type = DEFAULT -EXE1 = findfirstfilea -Description -= Create a number of files and try to find them - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/CMakeLists.txt deleted file mode 100644 index e2380b194be2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - FindFirstFileW.cpp -) - -add_executable(paltest_findfirstfilew_test1 - ${SOURCES} -) - -add_dependencies(paltest_findfirstfilew_test1 coreclrpal) - -target_link_libraries(paltest_findfirstfilew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.cpp index ac3ba18d95ee..362cea7f631a 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.cpp @@ -14,17 +14,17 @@ #include -const char* szNoFileName = "333asdf.x77t"; -const char* szFindName = "test01.txt"; -const char* szFindNameWldCard_01 = "test0?.txt"; -const char* szFindNameWldCard_02 = "*.txt"; -const char* szDirName = "test_dir"; -const char* szDirNameSlash = "test_dir\\"; -const char* szDirNameWldCard_01 = "?est_dir"; -const char* szDirNameWldCard_02 = "test_*"; +#define szNoFileName "333asdf.x77t" +#define szFindName "test01.txt" +#define szFindNameWldCard_01 "test0?.txt" +#define szFindNameWldCard_02 "*.txt" +#define szDirName "test_dir" +#define szDirNameSlash "test_dir\\" +#define szDirNameWldCard_01 "?est_dir" +#define szDirNameWldCard_02 "test_*" -BOOL CleanUp() +BOOL CleanUp_FindFirstFileW_test1() { DWORD dwAtt; BOOL result = TRUE; @@ -35,29 +35,31 @@ BOOL CleanUp() if(!SetFileAttributesA (szFindName, FILE_ATTRIBUTE_NORMAL)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", szFindName, FILE_ATTRIBUTE_NORMAL); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", szFindName, FILE_ATTRIBUTE_NORMAL); + } if(!DeleteFileA (szFindName)) { result = FALSE; - Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), szFindName, dwAtt); + Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), szFindName, dwAtt); } } dwAtt = GetFileAttributesA(szDirName); if( dwAtt != INVALID_FILE_ATTRIBUTES ) { - if(!RemoveDirectoryA (szDirName)) + LPWSTR szDirNameW = convert(szDirName); + if(!RemoveDirectoryW (szDirNameW)) { result = FALSE; - Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), szDirName, dwAtt); + Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), szDirName, dwAtt); } + free(szDirNameW); } return result; } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_FindFirstFileW_test1_paltest_findfirstfilew_test1, "file_io/FindFirstFileW/test1/paltest_findfirstfilew_test1") { WIN32_FIND_DATAW findFileData; HANDLE hFind = NULL; @@ -71,7 +73,7 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - if(!CleanUp()) + if(!CleanUp_FindFirstFileW_test1()) { Fail("FindFirstFileW: ERROR : Initial Clean Up failed\n"); } @@ -155,7 +157,7 @@ int __cdecl main(int argc, char *argv[]) if (hFind != INVALID_HANDLE_VALUE) { Fail("FindFirstFileW: ERROR -> Able to find \"%s\": trailing " - "slash should have failed.\n", + "slash should have failed.\n", szDirNameSlash); } @@ -165,7 +167,7 @@ int __cdecl main(int argc, char *argv[]) free(pTemp); if (hFind == INVALID_HANDLE_VALUE) { - Fail("FindFirstFileW: ERROR -> Unable to find \"%s\"\n", + Fail("FindFirstFileW: ERROR -> Unable to find \"%s\"\n", szFindNameWldCard_01); } @@ -174,7 +176,7 @@ int __cdecl main(int argc, char *argv[]) free(pTemp); if (hFind == INVALID_HANDLE_VALUE) { - Fail("FindFirstFileW: ERROR -> Unable to find \"%s\"\n", + Fail("FindFirstFileW: ERROR -> Unable to find \"%s\"\n", szFindNameWldCard_02); } @@ -188,7 +190,7 @@ int __cdecl main(int argc, char *argv[]) free(pTemp); if (hFind == INVALID_HANDLE_VALUE) { - Fail("FindFirstFileW: ERROR -> Unable to find \"%s\"\n", + Fail("FindFirstFileW: ERROR -> Unable to find \"%s\"\n", szDirNameWldCard_01); } @@ -197,15 +199,15 @@ int __cdecl main(int argc, char *argv[]) free(pTemp); if (hFind == INVALID_HANDLE_VALUE) { - Fail("FindFirstFileW: ERROR -> Unable to find \"%s\"\n", + Fail("FindFirstFileW: ERROR -> Unable to find \"%s\"\n", szDirNameWldCard_02); } - if(!CleanUp()) + if(!CleanUp_FindFirstFileW_test1()) { Fail("FindFirstFileW: ERROR : Final Clean Up failed\n"); } - PAL_Terminate(); + PAL_Terminate(); return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/testinfo.dat deleted file mode 100644 index 0a89d3659dfc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FindFirstFileW -Name = Test for FindFirstFileW (test 1) -Type = DEFAULT -EXE1 = findfirstfilew -Description -= Create a number of files and try to find them - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/CMakeLists.txt deleted file mode 100644 index 98329356ecea..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - FindNextFileA.cpp -) - -add_executable(paltest_findnextfilea_test1 - ${SOURCES} -) - -add_dependencies(paltest_findnextfilea_test1 coreclrpal) - -target_link_libraries(paltest_findnextfilea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.cpp index a9192b464c9d..dd7981efaabc 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.cpp @@ -13,17 +13,17 @@ #include -const char* szFindName = "test01.txt"; -const char* szFindName_02 = "test02.txt"; -const char* szFindNameWldCard_01 = "test0?.txt"; -const char* szFindNameWldCard_02 = "*.txt"; -const char* szDirName = "test_dir"; -const char* szDirName_02 = "test_dir_02"; -const char* szDirNameWldCard = "test_*"; +#define szFindName "test01.txt" +#define szFindName_02 "test02.txt" +#define szFindNameWldCard_01 "test0?.txt" +#define szFindNameWldCard_02 "*.txt" +#define szDirName "test_dir" +#define szDirName_02 "test_dir_02" +#define szDirNameWldCard "test_*" -void removeAll() +void removeAll_FindNextFileA_test1() { WCHAR* wTempPtr = NULL; @@ -39,7 +39,7 @@ void removeAll() -BOOL createTestFile(const char* szName) +BOOL createTestFile_FindNextFileA_test1(const char* szName) { FILE *pFile = NULL; @@ -48,7 +48,7 @@ BOOL createTestFile(const char* szName) { Trace("FindNextFile: ERROR -> Unable to create file \"%s\".\n", szName); - removeAll(); + removeAll_FindNextFileA_test1(); return FALSE; } else @@ -61,7 +61,7 @@ BOOL createTestFile(const char* szName) -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_FindNextFileA_test1_paltest_findnextfilea_test1, "file_io/FindNextFileA/test1/paltest_findnextfilea_test1") { WIN32_FIND_DATA findFileData; WIN32_FIND_DATA findFileData_02; @@ -75,7 +75,7 @@ int __cdecl main(int argc, char *argv[]) { return FAIL; } - removeAll(); + removeAll_FindNextFileA_test1(); // @@ -97,12 +97,12 @@ int __cdecl main(int argc, char *argv[]) // // find a file that exists // - if(createTestFile(szFindName) == FALSE) + if(createTestFile_FindNextFileA_test1(szFindName) == FALSE) { PAL_TerminateEx(FAIL); return FAIL; } - if(createTestFile(szFindName_02) == FALSE) + if(createTestFile_FindNextFileA_test1(szFindName_02) == FALSE) { PAL_TerminateEx(FAIL); return FAIL; @@ -111,7 +111,7 @@ int __cdecl main(int argc, char *argv[]) hFind = FindFirstFileA(szFindName, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Unable to find \"%s\"\n", szFindName); } else @@ -119,7 +119,7 @@ int __cdecl main(int argc, char *argv[]) bRc = FindNextFile(hFind, &findFileData); if (bRc != FALSE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Found a file that doesn't exist.\n"); } } @@ -133,7 +133,7 @@ int __cdecl main(int argc, char *argv[]) free (wTempPtr); if (bRc == FALSE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Failed to create the directory \"%s\"\n", szDirName); } @@ -142,7 +142,7 @@ int __cdecl main(int argc, char *argv[]) free (wTempPtr); if (bRc == FALSE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Failed to create the directory \"%s\"\n", szDirName_02); } @@ -150,7 +150,7 @@ int __cdecl main(int argc, char *argv[]) hFind = FindFirstFileA(szDirName, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR. FindFirstFileA was unable to find \"%s\"\n", szDirName); } @@ -159,7 +159,7 @@ int __cdecl main(int argc, char *argv[]) bRc = FindNextFile(hFind, &findFileData); if (bRc != FALSE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Found a directory that doesn't exist.\n"); } } @@ -171,7 +171,7 @@ int __cdecl main(int argc, char *argv[]) hFind = FindFirstFileA(szFindNameWldCard_01, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> FindFirstFileA was unable to find \"%s\"\n", szFindNameWldCard_01); } @@ -180,7 +180,7 @@ int __cdecl main(int argc, char *argv[]) bRc = FindNextFile(hFind, &findFileData_02); if (bRc == FALSE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Unable to find another file.\n"); } else @@ -188,7 +188,7 @@ int __cdecl main(int argc, char *argv[]) // validate we found the correct file if (strcmp(findFileData_02.cFileName, findFileData.cFileName) == 0) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Found the same file \"%s\".\n", findFileData.cFileName); } @@ -202,7 +202,7 @@ int __cdecl main(int argc, char *argv[]) hFind = FindFirstFileA(szDirNameWldCard, &findFileData); if (hFind == INVALID_HANDLE_VALUE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Unable to find \"%s\"\n", szDirNameWldCard); } @@ -211,7 +211,7 @@ int __cdecl main(int argc, char *argv[]) bRc = FindNextFile(hFind, &findFileData_02); if (bRc == FALSE) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Unable to find another directory.\n"); } else @@ -219,7 +219,7 @@ int __cdecl main(int argc, char *argv[]) // validate we found the correct directory if (strcmp(findFileData_02.cFileName, findFileData.cFileName) == 0) { - removeAll(); + removeAll_FindNextFileA_test1(); Fail("FindNextFile: ERROR -> Found the same directory \"%s\".\n", findFileData.cFileName); } @@ -230,7 +230,7 @@ int __cdecl main(int argc, char *argv[]) // attempt to write to the hFind handle (which should fail) // bRc = WriteFile(hFind, "this is a test", 10, &dwBytesWritten, NULL); - removeAll(); + removeAll_FindNextFileA_test1(); if (bRc == TRUE) { Fail("FindNextFile: ERROR -> Able to write to a FindNextFile handle.\n"); diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/testinfo.dat deleted file mode 100644 index dc0ad63f1a64..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FindNextFileA -Name = Test for FindNextFileA (test 1) -Type = DEFAULT -EXE1 = findnextfilea -Description -= Create test files and directories to verify FindNextFileA - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/CMakeLists.txt deleted file mode 100644 index 5e013cacd68d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - findnextfilea.cpp -) - -add_executable(paltest_findnextfilea_test2 - ${SOURCES} -) - -add_dependencies(paltest_findnextfilea_test2 coreclrpal) - -target_link_libraries(paltest_findnextfilea_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.cpp index 091d0c37bd54..3ef068ac1af9 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.cpp @@ -88,7 +88,7 @@ static void DoTest(const char* szDir, } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_FindNextFileA_test2_paltest_findnextfilea_test2, "file_io/FindNextFileA/test2/paltest_findnextfilea_test2") { if (0 != PAL_Initialize(argc,argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/testinfo.dat deleted file mode 100644 index 23d17cb80c12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileA/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FindNextFileA -Name = Test for FindNextFileA (test 2) -Type = DEFAULT -EXE1 = findnextfilea -Description -= Tests the PAL implementation of the FindNextFileA function. -= Tests '*' and '*.*' to ensure that '.' and '..' are -= returned in the expected order diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/CMakeLists.txt deleted file mode 100644 index 1ba07bd294e9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - FindNextFileW.cpp -) - -add_executable(paltest_findnextfilew_test1 - ${SOURCES} -) - -add_dependencies(paltest_findnextfilew_test1 coreclrpal) - -target_link_libraries(paltest_findnextfilew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.cpp index df271f8b849d..bdcc73f605f9 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.cpp @@ -13,17 +13,15 @@ #include -const char* szFindName = "test01.txt"; -const char* szFindName_02 = "test02.txt"; -const char* szFindNameWldCard_01 = "test0?.txt"; -const char* szFindNameWldCard_02 = "*.txt"; -const char* szDirName = "test_dir"; -const char* szDirName_02 = "test_dir_02"; -const char* szDirNameWldCard = "test_*"; - - - -void removeAll() +#define szFindName "test01.txt" +#define szFindName_02 "test02.txt" +#define szFindNameWldCard_01 "test0?.txt" +#define szFindNameWldCard_02 "*.txt" +#define szDirName "test_dir" +#define szDirName_02 "test_dir_02" +#define szDirNameWldCard "test_*" + +void removeAll_FindNextFileW_test1() { WCHAR* wTempPtr = NULL; @@ -46,7 +44,7 @@ void removeAll() -BOOL createTestFile(const char* szName) +BOOL createTestFile_FindNextFileW_test1(const char* szName) { FILE *pFile = NULL; @@ -54,7 +52,7 @@ BOOL createTestFile(const char* szName) if (pFile == NULL) { Trace("FindNextFileW: ERROR -> Unable to create file \"%s\".\n", szName); - removeAll(); + removeAll_FindNextFileW_test1(); return FALSE; } else @@ -68,7 +66,7 @@ BOOL createTestFile(const char* szName) -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_FindNextFileW_test1_paltest_findnextfilew_test1, "file_io/FindNextFileW/test1/paltest_findnextfilew_test1") { WIN32_FIND_DATAW findFileData; WIN32_FIND_DATAW findFileData_02; @@ -82,18 +80,18 @@ int __cdecl main(int argc, char *argv[]) { return FAIL; } - removeAll(); + removeAll_FindNextFileW_test1(); // // find a file that exists // - if(createTestFile(szFindName) == FALSE) + if(createTestFile_FindNextFileW_test1(szFindName) == FALSE) { PAL_TerminateEx(FAIL); return FAIL; } - if(createTestFile(szFindName_02) == FALSE) + if(createTestFile_FindNextFileW_test1(szFindName_02) == FALSE) { PAL_TerminateEx(FAIL); return FAIL; @@ -104,7 +102,7 @@ int __cdecl main(int argc, char *argv[]) free(wTempPtr); if (hFind == INVALID_HANDLE_VALUE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Unable to find \"%s\"\n", szFindName); } else @@ -112,7 +110,7 @@ int __cdecl main(int argc, char *argv[]) bRc = FindNextFileW(hFind, &findFileData); if (bRc != FALSE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Found a file that doesn't exist.\n"); } } @@ -126,7 +124,7 @@ int __cdecl main(int argc, char *argv[]) free (wTempPtr); if (bRc == FALSE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Failed to create the directory \"%s\"\n", szDirName); } @@ -135,7 +133,7 @@ int __cdecl main(int argc, char *argv[]) free (wTempPtr); if (bRc == FALSE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Failed to create the directory " "\"%s\"\n", szDirName_02); @@ -146,7 +144,7 @@ int __cdecl main(int argc, char *argv[]) free (wTempPtr); if (hFind == INVALID_HANDLE_VALUE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR. FindFirstFileW was unable " "to find \"%s\"\n", szDirName); @@ -156,7 +154,7 @@ int __cdecl main(int argc, char *argv[]) bRc = FindNextFileW(hFind, &findFileData); if (bRc != FALSE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Found a directory that " "doesn't exist.\n"); } @@ -171,7 +169,7 @@ int __cdecl main(int argc, char *argv[]) free(wTempPtr); if (hFind == INVALID_HANDLE_VALUE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> FindFirstFileW was unable to " "find \"%s\"\n", szFindNameWldCard_01); @@ -181,7 +179,7 @@ int __cdecl main(int argc, char *argv[]) bRc = FindNextFileW(hFind, &findFileData_02); if (bRc == FALSE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Unable to find another file.\n"); } else @@ -189,7 +187,7 @@ int __cdecl main(int argc, char *argv[]) // validate we found the correct file if (wcscmp(findFileData_02.cFileName, findFileData.cFileName) == 0) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Found the same file \"%S\".\n", findFileData.cFileName); } @@ -205,7 +203,7 @@ int __cdecl main(int argc, char *argv[]) free(wTempPtr); if (hFind == INVALID_HANDLE_VALUE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Unable to find \"%s\"\n", szDirNameWldCard); } @@ -214,7 +212,7 @@ int __cdecl main(int argc, char *argv[]) bRc = FindNextFileW(hFind, &findFileData_02); if (bRc == FALSE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Unable to find another directory.\n"); } else @@ -222,7 +220,7 @@ int __cdecl main(int argc, char *argv[]) // validate we found the correct directory if (wcscmp(findFileData_02.cFileName, findFileData.cFileName) == 0) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Found the same directory " "\"%S\".\n", findFileData.cFileName); @@ -236,12 +234,12 @@ int __cdecl main(int argc, char *argv[]) bRc = WriteFile(hFind, "this is a test", 10, &dwBytesWritten, NULL); if (bRc == TRUE) { - removeAll(); + removeAll_FindNextFileW_test1(); Fail("FindNextFileW: ERROR -> Able to write to a FindNextFileW " "handle.\n"); } - removeAll(); + removeAll_FindNextFileW_test1(); PAL_Terminate(); return PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/testinfo.dat deleted file mode 100644 index 97ac53884a24..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FindNextFileW -Name = Test for FindNextFileW (test 1) -Type = DEFAULT -EXE1 = findnextfilew -Description -= Create test files and directories to verify FindNextFileW - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/CMakeLists.txt deleted file mode 100644 index 5944a0943f0f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - findnextfilew.cpp -) - -add_executable(paltest_findnextfilew_test2 - ${SOURCES} -) - -add_dependencies(paltest_findnextfilew_test2 coreclrpal) - -target_link_libraries(paltest_findnextfilew_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.cpp index b0e5f4857b8a..58d01da7e8f0 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.cpp @@ -88,7 +88,7 @@ static void DoTest(const WCHAR* szwDir, } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_FindNextFileW_test2_paltest_findnextfilew_test2, "file_io/FindNextFileW/test2/paltest_findnextfilew_test2") { if (0 != PAL_Initialize(argc,argv)) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/testinfo.dat deleted file mode 100644 index 664538d76a86..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FindNextFileW/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FindNextFileW -Name = Test for FindNextFileW (test 2) -Type = DEFAULT -EXE1 = findnextfilew -Description -= Tests the PAL implementation of the FindNextFileW function. -= Tests '*' and '*.*' to ensure that '.' and '..' are -= returned in the expected order diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/CMakeLists.txt deleted file mode 100644 index bb8a0bbe584b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - FlushFileBuffers.cpp -) - -add_executable(paltest_flushfilebuffers_test1 - ${SOURCES} -) - -add_dependencies(paltest_flushfilebuffers_test1 coreclrpal) - -target_link_libraries(paltest_flushfilebuffers_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.cpp index 8c7b7545fadb..f1de32d7fc83 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.cpp @@ -21,7 +21,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(file_io_FlushFileBuffers_test1_paltest_flushfilebuffers_test1, "file_io/FlushFileBuffers/test1/paltest_flushfilebuffers_test1") { int TheReturn; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/testinfo.dat deleted file mode 100644 index 54b3c24e3055..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = FlushFileBuffers -Name = Positive Test for FlushFileBuffers -TYPE = DEFAULT -EXE1 = flushfilebuffers -Description -= Test the FlushFileBuffers -= Test the return values -- ensure that the correct values are -= returned for success and failure. -= This test does not prove that flush worked, -= there is no way of stopping the OS from flushing -= the file by itself. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/CMakeLists.txt deleted file mode 100644 index 541e5fac5650..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetConsoleOutputCP.cpp -) - -add_executable(paltest_getconsoleoutputcp_test1 - ${SOURCES} -) - -add_dependencies(paltest_getconsoleoutputcp_test1 coreclrpal) - -target_link_libraries(paltest_getconsoleoutputcp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.cpp index 137839387cd5..7c391e3f1765 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetConsoleOutputCP_test1_paltest_getconsoleoutputcp_test1, "file_io/GetConsoleOutputCP/test1/paltest_getconsoleoutputcp_test1") { UINT uiCP = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/testinfo.dat deleted file mode 100644 index 85fb02067be4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetConsoleOutputCP -Name = Positive Test for GetConsoleOutputCP (test 1) -Type = DEFAULT -EXE1 = getconsoleoutputcp -Description -= Test GetConsoleOutputCP. Apparently there are only two possible -= return values: CP_ACP or 1252 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/CMakeLists.txt deleted file mode 100644 index b64c050432cf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetCurrentDirectoryA.cpp -) - -add_executable(paltest_getcurrentdirectorya_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcurrentdirectorya_test1 coreclrpal) - -target_link_libraries(paltest_getcurrentdirectorya_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.cpp index 2e28e530bfd4..e5411c0aad8f 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.cpp @@ -12,11 +12,12 @@ #include -const char* szFileName = "blah"; -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetCurrentDirectoryA_test1_paltest_getcurrentdirectorya_test1, "file_io/GetCurrentDirectoryA/test1/paltest_getcurrentdirectorya_test1") { + const char* szFileName = "blah"; + DWORD dwRc = 0; DWORD dwRc2 = 0; char szReturnedPath[_MAX_PATH+1]; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/testinfo.dat deleted file mode 100644 index d5c59d997073..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetCurrentDirectoryA -Name = Test for GetCurrentDirectoryA (test 1) -Type = DEFAULT -EXE1 = getcurrentdirectorya -Description -= Calculate the current directory name and compare to that -= returned by GetCurrentDirectoryA - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/CMakeLists.txt deleted file mode 100644 index 92f6e4edc574..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetCurrentDirectoryW.cpp -) - -add_executable(paltest_getcurrentdirectoryw_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcurrentdirectoryw_test1 coreclrpal) - -target_link_libraries(paltest_getcurrentdirectoryw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.cpp index a183663387cf..f25ff41d6cc9 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetCurrentDirectoryW_test1_paltest_getcurrentdirectoryw_test1, "file_io/GetCurrentDirectoryW/test1/paltest_getcurrentdirectoryw_test1") { DWORD dwRc = 0; DWORD dwRc2 = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/testinfo.dat deleted file mode 100644 index d3ddb7ea4f1d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetCurrentDirectoryW -Name = Test for GetCurrentDirectoryW (test 1) -Type = DEFAULT -EXE1 = getcurrentdirectoryw -Description -= Compute the current directory and compare with the results -= from GetCurrentDirectoryW - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/.hidden_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/.hidden_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/.hidden_ro_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/.hidden_ro_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/CMakeLists.txt deleted file mode 100644 index 347816e4eb97..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(SOURCES - GetFileAttributesA.cpp -) - -add_executable(paltest_getfileattributesa_test1 - ${SOURCES} -) - -add_dependencies(paltest_getfileattributesa_test1 coreclrpal) - -target_link_libraries(paltest_getfileattributesa_test1 - ${COMMON_TEST_LIBRARIES} -) -add_subdirectory(.hidden_directory) -add_subdirectory(.hidden_ro_directory) -add_subdirectory(normal_test_directory) -add_subdirectory(no_directory) -add_subdirectory(ro_test_directory) -add_subdirectory(rw_directory) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.cpp index 9d71293acfef..309be929e113 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.cpp @@ -10,7 +10,7 @@ ** - a normal directory and file ** - a read only directory and file ** - a read write directory and file -** - a hidden directory and file +** - a hidden directory and file ** - a read only hidden directory and file ** - a directory and a file with no attributes ** - an invalid file name @@ -22,7 +22,7 @@ const int TYPE_DIR = 0; const int TYPE_FILE = 1; /* Structure defining a test case */ -typedef struct +typedef struct { char *name; /* name of the file/directory */ DWORD expectedAttribs; /* expected attributes */ @@ -30,7 +30,7 @@ typedef struct int isFile; /* is file (1) or dir (0) */ }TestCaseFile; -typedef struct +typedef struct { char *name; /* name of the file/directory */ DWORD expectedAttribs; /* expected attributes */ @@ -38,115 +38,117 @@ typedef struct int isFile; /* is file (1) or dir (0) */ }TestCaseDir; -DWORD desiredAccessFile = GENERIC_READ | GENERIC_WRITE; -DWORD shareModeFile = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE; -LPSECURITY_ATTRIBUTES lpAttrFile = NULL; -DWORD dwCreationDispFile = CREATE_NEW; -DWORD dwFlagsAttribFile = FILE_ATTRIBUTE_NORMAL; -HANDLE hTemplateFile = NULL; +DWORD desiredAccessFile_GetFileAttributesA_test1 = GENERIC_READ | GENERIC_WRITE; +DWORD shareModeFile_GetFileAttributesA_test1 = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE; +LPSECURITY_ATTRIBUTES lpAttrFile_GetFileAttributesA_test1 = NULL; +DWORD dwCreationDispFile_GetFileAttributesA_test1 = CREATE_NEW; +DWORD dwFlagsAttribFile_GetFileAttributesA_test1 = FILE_ATTRIBUTE_NORMAL; +HANDLE hTemplateFile_GetFileAttributesA_test1 = NULL; -int numFileTests = 6; -TestCaseFile gfaTestsFile[6]; /* GetFileAttributes tests list */ +int numFileTests_A = 6; +TestCaseFile gfaTestsFile_A[6]; /* GetFileAttributes tests list */ -int numDirTests = 6; -TestCaseDir gfaTestsDir[6]; /* GetFileAttributes tests list */ +int numDirTests_A = 6; +TestCaseDir gfaTestsDir_A[6]; /* GetFileAttributes tests list */ -BOOL CleanUpFiles() +BOOL CleanUpFiles_GetFileAttributesA_test1() { DWORD dwAtt; int i; BOOL result = TRUE; - for (i = 0; i < numFileTests -1 ; i++ ) + for (i = 0; i < numFileTests_A -1 ; i++ ) { - dwAtt = GetFileAttributesA(gfaTestsFile[i].name); - + dwAtt = GetFileAttributesA(gfaTestsFile_A[i].name); + if( dwAtt != INVALID_FILE_ATTRIBUTES ) { //Trace("Files iteration %d\n", i); - if(!SetFileAttributesA (gfaTestsFile[i].name, FILE_ATTRIBUTE_NORMAL)) + if(!SetFileAttributesA (gfaTestsFile_A[i].name, FILE_ATTRIBUTE_NORMAL)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsFile[i].name, FILE_ATTRIBUTE_NORMAL); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsFile_A[i].name, FILE_ATTRIBUTE_NORMAL); + } - if(!DeleteFileA (gfaTestsFile[i].name)) + if(!DeleteFileA (gfaTestsFile_A[i].name)) { result = FALSE; - Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), gfaTestsFile[i].name, dwAtt); + Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), gfaTestsFile_A[i].name, dwAtt); } - + } } // Trace("Value of result is %d\n", result); return result; } -BOOL SetUpFiles() +BOOL SetUpFiles_GetFileAttributesA_test1() { int i = 0; BOOL result = TRUE; - for (i = 0; i < numFileTests -1; i++ ) + for (i = 0; i < numFileTests_A -1; i++ ) { - gfaTestsFile[i].hFile = CreateFile(gfaTestsFile[i].name, - desiredAccessFile, - shareModeFile, - lpAttrFile, - dwCreationDispFile, - dwFlagsAttribFile, - hTemplateFile); - - if( gfaTestsFile[i].hFile == NULL ) + gfaTestsFile_A[i].hFile = CreateFile(gfaTestsFile_A[i].name, + desiredAccessFile_GetFileAttributesA_test1, + shareModeFile_GetFileAttributesA_test1, + lpAttrFile_GetFileAttributesA_test1, + dwCreationDispFile_GetFileAttributesA_test1, + dwFlagsAttribFile_GetFileAttributesA_test1, + hTemplateFile_GetFileAttributesA_test1); + + if( gfaTestsFile_A[i].hFile == NULL ) { Fail("Error while creating files for iteration %d\n", i); } - if(!SetFileAttributesA (gfaTestsFile[i].name, gfaTestsFile[i].expectedAttribs)) + if(!SetFileAttributesA (gfaTestsFile_A[i].name, gfaTestsFile_A[i].expectedAttribs)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsFile[i].name, gfaTestsFile[i].expectedAttribs); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsFile_A[i].name, gfaTestsFile_A[i].expectedAttribs); + } } return result; } -BOOL CleanUpDirs() +BOOL CleanUpDirs_GetFileAttributesA_test1() { DWORD dwAtt; int i; BOOL result = TRUE; - for (i = 0; i < numDirTests -1 ; i++ ) + for (i = 0; i < numDirTests_A -1 ; i++ ) { - dwAtt = GetFileAttributesA(gfaTestsDir[i].name); - + dwAtt = GetFileAttributesA(gfaTestsDir_A[i].name); + if( dwAtt != INVALID_FILE_ATTRIBUTES ) { - - if(!SetFileAttributesA (gfaTestsDir[i].name, FILE_ATTRIBUTE_DIRECTORY)) + + if(!SetFileAttributesA (gfaTestsDir_A[i].name, FILE_ATTRIBUTE_DIRECTORY)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsDir[i].name, (FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY)); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsDir_A[i].name, (FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY)); + } - if(!RemoveDirectoryA (gfaTestsDir[i].name)) + LPWSTR nameW = convert(gfaTestsDir_A[i].name); + if(!RemoveDirectoryW (nameW)) { result = FALSE; - Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), gfaTestsDir[i].name, dwAtt); + Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), gfaTestsDir_A[i].name, dwAtt); } - + + free(nameW); } } return result; } -BOOL SetUpDirs() +BOOL SetUpDirs_GetFileAttributesA_test1() { int i = 0; BOOL result = TRUE; DWORD ret = 0; - for (i = 0; i < numDirTests - 1 ; i++ ) + for (i = 0; i < numDirTests_A - 1 ; i++ ) { - result = CreateDirectoryA(gfaTestsDir[i].name, + result = CreateDirectoryA(gfaTestsDir_A[i].name, NULL); if(!result ) @@ -155,25 +157,25 @@ BOOL SetUpDirs() Fail("Error while creating directory for iteration %d\n", i); } - if(!SetFileAttributesA (gfaTestsDir[i].name, gfaTestsDir[i].expectedAttribs)) + if(!SetFileAttributesA (gfaTestsDir_A[i].name, gfaTestsDir_A[i].expectedAttribs)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsDir[i].name, gfaTestsDir[i].expectedAttribs); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsDir_A[i].name, gfaTestsDir_A[i].expectedAttribs); + } - ret = GetFileAttributesA (gfaTestsDir[i].name); - if(ret != gfaTestsDir[i].expectedAttribs) + ret = GetFileAttributesA (gfaTestsDir_A[i].name); + if(ret != gfaTestsDir_A[i].expectedAttribs) { result = FALSE; - Trace("ERROR: Error setting attributes [%s][%d]\n", gfaTestsDir[i].name, gfaTestsDir[i].expectedAttribs); - } - //Trace("Setup Dir setting attr [%d], returned [%d]\n", gfaTestsDir[i].expectedAttribs, ret); + Trace("ERROR: Error setting attributes [%s][%d]\n", gfaTestsDir_A[i].name, gfaTestsDir_A[i].expectedAttribs); + } + //Trace("Setup Dir setting attr [%d], returned [%d]\n", gfaTestsDir_A[i].expectedAttribs, ret); } //Trace("Setup dirs returning %d\n", result); return result; } -int __cdecl main(int argc, char **argv) +PALTEST(file_io_GetFileAttributesA_test1_paltest_getfileattributesa_test1, "file_io/GetFileAttributesA/test1/paltest_getfileattributesa_test1") { int i; BOOL bFailed = FALSE; @@ -187,68 +189,68 @@ int __cdecl main(int argc, char **argv) char * NoDirectoryName = "no_directory"; char * NormalFileName = "normal_test_file"; - char * ReadOnlyFileName = "ro_test_file"; + char * ReadOnlyFileName = "ro_test_file"; char * ReadWriteFileName = "rw_file"; char * HiddenFileName = ".hidden_file"; char * HiddenReadOnlyFileName = ".hidden_ro_file"; char * NotReallyAFileName = "not_really_a_file"; /* Tests on directory */ - gfaTestsDir[0].name = NormalDirectoryName; - gfaTestsDir[0].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; - gfaTestsDir[0].isFile = TYPE_DIR; - - gfaTestsDir[1].name = ReadOnlyDirectoryName; - gfaTestsDir[1].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY | + gfaTestsDir_A[0].name = NormalDirectoryName; + gfaTestsDir_A[0].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; + gfaTestsDir_A[0].isFile = TYPE_DIR; + + gfaTestsDir_A[1].name = ReadOnlyDirectoryName; + gfaTestsDir_A[1].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_READONLY; - gfaTestsDir[1].isFile = TYPE_DIR; + gfaTestsDir_A[1].isFile = TYPE_DIR; - gfaTestsDir[2].name = ReadWriteDirectoryName; - gfaTestsDir[2].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; - gfaTestsDir[2].isFile = TYPE_DIR; + gfaTestsDir_A[2].name = ReadWriteDirectoryName; + gfaTestsDir_A[2].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; + gfaTestsDir_A[2].isFile = TYPE_DIR; - gfaTestsDir[3].name = HiddenDirectoryName; - gfaTestsDir[3].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; //| + gfaTestsDir_A[3].name = HiddenDirectoryName; + gfaTestsDir_A[3].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; //| //FILE_ATTRIBUTE_HIDDEN; - gfaTestsDir[3].isFile = TYPE_DIR; - - gfaTestsDir[4].name = HiddenReadOnlyDirectoryName; - gfaTestsDir[4].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY | + gfaTestsDir_A[3].isFile = TYPE_DIR; + + gfaTestsDir_A[4].name = HiddenReadOnlyDirectoryName; + gfaTestsDir_A[4].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_READONLY; //| //FILE_ATTRIBUTE_HIDDEN; - gfaTestsDir[4].isFile = TYPE_DIR; + gfaTestsDir_A[4].isFile = TYPE_DIR; - gfaTestsDir[5].name = NoDirectoryName; - gfaTestsDir[5].expectedAttribs = INVALID_FILE_ATTRIBUTES; - gfaTestsDir[5].isFile = TYPE_DIR; + gfaTestsDir_A[5].name = NoDirectoryName; + gfaTestsDir_A[5].expectedAttribs = INVALID_FILE_ATTRIBUTES; + gfaTestsDir_A[5].isFile = TYPE_DIR; /* Tests on file */ - gfaTestsFile[0].name = NormalFileName; - gfaTestsFile[0].expectedAttribs = FILE_ATTRIBUTE_NORMAL; - gfaTestsFile[0].isFile = TYPE_FILE; + gfaTestsFile_A[0].name = NormalFileName; + gfaTestsFile_A[0].expectedAttribs = FILE_ATTRIBUTE_NORMAL; + gfaTestsFile_A[0].isFile = TYPE_FILE; - gfaTestsFile[1].name = ReadOnlyFileName; - gfaTestsFile[1].expectedAttribs = FILE_ATTRIBUTE_READONLY; - gfaTestsFile[1].isFile = TYPE_FILE; + gfaTestsFile_A[1].name = ReadOnlyFileName; + gfaTestsFile_A[1].expectedAttribs = FILE_ATTRIBUTE_READONLY; + gfaTestsFile_A[1].isFile = TYPE_FILE; - gfaTestsFile[2].name = ReadWriteFileName; - gfaTestsFile[2].expectedAttribs = FILE_ATTRIBUTE_NORMAL; - gfaTestsFile[2].isFile = TYPE_FILE; + gfaTestsFile_A[2].name = ReadWriteFileName; + gfaTestsFile_A[2].expectedAttribs = FILE_ATTRIBUTE_NORMAL; + gfaTestsFile_A[2].isFile = TYPE_FILE; - gfaTestsFile[3].name = HiddenFileName; - gfaTestsFile[3].expectedAttribs = FILE_ATTRIBUTE_NORMAL; //FILE_ATTRIBUTE_HIDDEN; - gfaTestsFile[3].isFile = TYPE_FILE; + gfaTestsFile_A[3].name = HiddenFileName; + gfaTestsFile_A[3].expectedAttribs = FILE_ATTRIBUTE_NORMAL; //FILE_ATTRIBUTE_HIDDEN; + gfaTestsFile_A[3].isFile = TYPE_FILE; - gfaTestsFile[4].name = HiddenReadOnlyFileName; - gfaTestsFile[4].expectedAttribs = FILE_ATTRIBUTE_READONLY; //| + gfaTestsFile_A[4].name = HiddenReadOnlyFileName; + gfaTestsFile_A[4].expectedAttribs = FILE_ATTRIBUTE_READONLY; //| //FILE_ATTRIBUTE_HIDDEN; - gfaTestsFile[4].isFile = TYPE_FILE; + gfaTestsFile_A[4].isFile = TYPE_FILE; - gfaTestsFile[5].name = NotReallyAFileName; - gfaTestsFile[5].expectedAttribs = INVALID_FILE_ATTRIBUTES; - gfaTestsFile[5].isFile = TYPE_FILE; + gfaTestsFile_A[5].name = NotReallyAFileName; + gfaTestsFile_A[5].expectedAttribs = INVALID_FILE_ATTRIBUTES; + gfaTestsFile_A[5].isFile = TYPE_FILE; /* Initialize PAL environment */ if (0 != PAL_Initialize(argc,argv)) @@ -256,74 +258,74 @@ int __cdecl main(int argc, char **argv) return FAIL; } - if(!CleanUpFiles()) + if(!CleanUpFiles_GetFileAttributesA_test1()) { Fail("GetFileAttributesA: Pre-Clean Up Files Failed\n"); } - if(0 == SetUpFiles()) + if(0 == SetUpFiles_GetFileAttributesA_test1()) { Fail("GetFileAttributesA: SetUp Files Failed\n"); } - if(!CleanUpDirs()) + if(!CleanUpDirs_GetFileAttributesA_test1()) { Fail("GetFileAttributesA: Pre-Clean Up Directories Failed\n"); } - if(!SetUpDirs()) + if(!SetUpDirs_GetFileAttributesA_test1()) { Fail("GetFileAttributesA: SetUp Directories Failed\n"); } - /* + /* * Go through all the test cases above, * call GetFileAttributesA on the name and * make sure the return value is the one expected */ - for( i = 0; i < numFileTests; i++ ) + for( i = 0; i < numFileTests_A; i++ ) { - result = GetFileAttributesA(gfaTestsFile[i].name); + result = GetFileAttributesA(gfaTestsFile_A[i].name); - if( result != gfaTestsFile[i].expectedAttribs ) + if( result != gfaTestsFile_A[i].expectedAttribs ) { bFailed = TRUE; Trace("ERROR: GetFileAttributesA Test#%u on %s " "returned %u instead of %u. \n", i, - gfaTestsFile[i].name, + gfaTestsFile_A[i].name, result, - gfaTestsFile[i].expectedAttribs); + gfaTestsFile_A[i].expectedAttribs); } } - for( i = 0; i < numDirTests; i++ ) + for( i = 0; i < numDirTests_A; i++ ) { - result = GetFileAttributesA(gfaTestsDir[i].name); + result = GetFileAttributesA(gfaTestsDir_A[i].name); - if( result != gfaTestsDir[i].expectedAttribs ) + if( result != gfaTestsDir_A[i].expectedAttribs ) { bFailed = TRUE; Trace("ERROR: GetFileAttributesA on Directories Test#%u on %s " "returned %u instead of %u. \n", i, - gfaTestsDir[i].name, + gfaTestsDir_A[i].name, result, - gfaTestsDir[i].expectedAttribs); + gfaTestsDir_A[i].expectedAttribs); } } - if(!CleanUpFiles()) + if(!CleanUpFiles_GetFileAttributesA_test1()) { Fail("GetFileAttributesA: Post-Clean Up Files Failed\n"); } - if(!CleanUpDirs()) + if(!CleanUpDirs_GetFileAttributesA_test1()) { Fail("GetFileAttributesA: Post-Clean Up Directories Failed\n"); } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/no_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/no_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/normal_test_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/normal_test_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/ro_test_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/ro_test_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/rw_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/rw_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/testinfo.dat deleted file mode 100644 index eb49f3c49520..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/testinfo.dat +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 - -Section = file_io - -Function = GetFileAttributesA - -Name = Positive Test for GetFileAttributesA - -TYPE = DEFAULT - -EXE1 = getfileattributesa - -Description - -= Test the GetFileAttributesA function - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/.hidden_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/.hidden_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/CMakeLists.txt deleted file mode 100644 index 8929fa8876f1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_getfileattributesexw_test1 - ${SOURCES} -) - -add_dependencies(paltest_getfileattributesexw_test1 coreclrpal) - -target_link_libraries(paltest_getfileattributesexw_test1 - ${COMMON_TEST_LIBRARIES} -) -add_subdirectory(.hidden_directory) -add_subdirectory(normal_test_directory) -add_subdirectory(ro_test_directory) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/normal_test_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/normal_test_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/ro_test_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/ro_test_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.cpp index 037d276af803..8cc392fc8912 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.cpp @@ -93,7 +93,7 @@ void VerifyInfo(WIN32_FILE_ATTRIBUTE_DATA InfoStruct, results are correct. */ -void RunTest(char* Name, DWORD Attribs, ItemType TheType ) +void RunTest_GetFileAttributesExW_test1(char* Name, DWORD Attribs, ItemType TheType ) { WCHAR* TheName; WIN32_FILE_ATTRIBUTE_DATA InfoStruct; @@ -115,7 +115,7 @@ void RunTest(char* Name, DWORD Attribs, ItemType TheType ) } -int __cdecl main(int argc, char **argv) +PALTEST(file_io_GetFileAttributesExW_test1_paltest_getfileattributesexw_test1, "file_io/GetFileAttributesExW/test1/paltest_getfileattributesexw_test1") { DWORD TheResult; WCHAR* FileName; @@ -127,29 +127,29 @@ int __cdecl main(int argc, char **argv) } /* Test a Directroy */ - RunTest("normal_test_directory", FILE_ATTRIBUTE_DIRECTORY, IS_DIR); + RunTest_GetFileAttributesExW_test1("normal_test_directory", FILE_ATTRIBUTE_DIRECTORY, IS_DIR); /* Test a Normal File */ - RunTest("normal_test_file", FILE_ATTRIBUTE_NORMAL, IS_FILE); + RunTest_GetFileAttributesExW_test1("normal_test_file", FILE_ATTRIBUTE_NORMAL, IS_FILE); /* Test a Read-Only Directroy */ - RunTest("ro_test_directory", + RunTest_GetFileAttributesExW_test1("ro_test_directory", FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_DIRECTORY, IS_DIR); /* Test a Read-Only File */ - RunTest("ro_test_file", FILE_ATTRIBUTE_READONLY, IS_FILE); + RunTest_GetFileAttributesExW_test1("ro_test_file", FILE_ATTRIBUTE_READONLY, IS_FILE); /* Test a Hidden File */ - RunTest(".hidden_file", FILE_ATTRIBUTE_HIDDEN, IS_FILE); + RunTest_GetFileAttributesExW_test1(".hidden_file", FILE_ATTRIBUTE_HIDDEN, IS_FILE); /* Test a Hidden Directroy */ - RunTest(".hidden_directory", + RunTest_GetFileAttributesExW_test1(".hidden_directory", FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_DIRECTORY, IS_DIR); /* Test a Non-Existant File */ diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/testinfo.dat deleted file mode 100644 index 6135ede5bc7a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFileAttributesExW -Name = Test with normal file/dir and readonly file/dir and hidden file/dir -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the GetFileAttributesExW function. -= Call the function on a normal directory and file and a read-only directory -= and file and a hidden file and directory. -= Ensure that the attributes returned are correct, and the -= file times and file sizes. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/CMakeLists.txt deleted file mode 100644 index fb59139042fe..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_getfileattributesexw_test2 - ${SOURCES} -) - -add_dependencies(paltest_getfileattributesexw_test2 coreclrpal) - -target_link_libraries(paltest_getfileattributesexw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.cpp index f5fea17222d6..31fe689214e0 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.cpp @@ -32,7 +32,7 @@ static int IsFileTimeOk(FILETIME FirstTime, FILETIME SecondTime) return(TimeOne <= TimeTwo); } -int __cdecl main(int argc, char **argv) +PALTEST(file_io_GetFileAttributesExW_test2_paltest_getfileattributesexw_test2, "file_io/GetFileAttributesExW/test2/paltest_getfileattributesexw_test2") { DWORD res; char fileName[MAX_PATH] = "test_file"; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/testinfo.dat deleted file mode 100644 index af5d031cd28c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFileAttributesExW -Name = Test for GetFileAttributesExW -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the GetFileAttributesExW function. -= First get a file's attributes, modify the file, re-get its attributes -= and compare the two sets of attributes diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/.hidden_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/.hidden_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/.hidden_ro_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/.hidden_ro_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/CMakeLists.txt deleted file mode 100644 index 039375e839f4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(SOURCES - GetFileAttributesW.cpp -) - -add_executable(paltest_getfileattributesw_test1 - ${SOURCES} -) - -add_dependencies(paltest_getfileattributesw_test1 coreclrpal) - -target_link_libraries(paltest_getfileattributesw_test1 - ${COMMON_TEST_LIBRARIES} -) -add_subdirectory(.hidden_directory) -add_subdirectory(.hidden_ro_directory) -add_subdirectory(normal_test_directory) -add_subdirectory(no_directory) -add_subdirectory(ro_test_directory) -add_subdirectory(rw_test_directory) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.cpp index cb5745337169..7efc9f880534 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.cpp @@ -10,7 +10,7 @@ ** - a normal directory and file ** - a read only directory and file ** - a read write directory and file -** - a hidden directory and file +** - a hidden directory and file ** - a read only hidden directory and file ** - a directory and a file with no attributes ** - an invalid file name @@ -22,7 +22,7 @@ const int TYPE_DIR = 0; const int TYPE_FILE = 1; /* Structure defining a test case */ -typedef struct +typedef struct { char *name; /* name of the file/directory */ DWORD expectedAttribs; /* expected attributes */ @@ -30,7 +30,7 @@ typedef struct int isFile; /* is file (1) or dir (0) */ }TestCaseFile; -typedef struct +typedef struct { char *name; /* name of the file/directory */ DWORD expectedAttribs; /* expected attributes */ @@ -38,115 +38,117 @@ typedef struct int isFile; /* is file (1) or dir (0) */ }TestCaseDir; -DWORD desiredAccessFile = GENERIC_READ | GENERIC_WRITE; -DWORD shareModeFile = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE; -LPSECURITY_ATTRIBUTES lpAttrFile = NULL; -DWORD dwCreationDispFile = CREATE_NEW; -DWORD dwFlagsAttribFile = FILE_ATTRIBUTE_NORMAL; -HANDLE hTemplateFile = NULL; +DWORD desiredAccessFile_GetFileAttributesW_test1 = GENERIC_READ | GENERIC_WRITE; +DWORD shareModeFile_GetFileAttributesW_test1 = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE; +LPSECURITY_ATTRIBUTES lpAttrFile_GetFileAttributesW_test1 = NULL; +DWORD dwCreationDispFile_GetFileAttributesW_test1 = CREATE_NEW; +DWORD dwFlagsAttribFile_GetFileAttributesW_test1 = FILE_ATTRIBUTE_NORMAL; +HANDLE hTemplateFile_GetFileAttributesW_test1 = NULL; -int numFileTests = 6; -TestCaseFile gfaTestsFile[6]; /* GetFileAttributes tests list */ +int numFileTests_GetFileAttributesW_test1 = 6; +TestCaseFile gfaTestsFile_GetFileAttributesW_test1[6]; /* GetFileAttributes tests list */ -int numDirTests = 6; -TestCaseDir gfaTestsDir[6]; /* GetFileAttributes tests list */ +int numDirTests_GetFileAttributesW_test1 = 6; +TestCaseDir gfaTestsDir_GetFileAttributesW_test1[6]; /* GetFileAttributes tests list */ -BOOL CleanUpFiles() +BOOL CleanUpFiles_GetFileAttributesW_test1() { DWORD dwAtt; int i; BOOL result = TRUE; - for (i = 0; i < numFileTests - 1 ; i++ ) + for (i = 0; i < numFileTests_GetFileAttributesW_test1 - 1 ; i++ ) { - dwAtt = GetFileAttributesA(gfaTestsFile[i].name); - + dwAtt = GetFileAttributesA(gfaTestsFile_GetFileAttributesW_test1[i].name); + if( dwAtt != INVALID_FILE_ATTRIBUTES ) { //Trace("Files iteration %d\n", i); - if(!SetFileAttributesA (gfaTestsFile[i].name, FILE_ATTRIBUTE_NORMAL)) + if(!SetFileAttributesA (gfaTestsFile_GetFileAttributesW_test1[i].name, FILE_ATTRIBUTE_NORMAL)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsFile[i].name, FILE_ATTRIBUTE_NORMAL); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsFile_GetFileAttributesW_test1[i].name, FILE_ATTRIBUTE_NORMAL); + } - if(!DeleteFileA (gfaTestsFile[i].name)) + if(!DeleteFileA (gfaTestsFile_GetFileAttributesW_test1[i].name)) { result = FALSE; - Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), gfaTestsFile[i].name, dwAtt); + Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), gfaTestsFile_GetFileAttributesW_test1[i].name, dwAtt); } - + } } // Trace("Value of result is %d\n", result); return result; } -BOOL SetUpFiles() +BOOL SetUpFiles_GetFileAttributesW_test1() { int i = 0; BOOL result = TRUE; - for (i = 0; i < numFileTests - 1 ; i++ ) + for (i = 0; i < numFileTests_GetFileAttributesW_test1 - 1 ; i++ ) { - gfaTestsFile[i].hFile = CreateFile(gfaTestsFile[i].name, - desiredAccessFile, - shareModeFile, - lpAttrFile, - dwCreationDispFile, - dwFlagsAttribFile, - hTemplateFile); - - if( gfaTestsFile[i].hFile == NULL ) + gfaTestsFile_GetFileAttributesW_test1[i].hFile = CreateFile(gfaTestsFile_GetFileAttributesW_test1[i].name, + desiredAccessFile_GetFileAttributesW_test1, + shareModeFile_GetFileAttributesW_test1, + lpAttrFile_GetFileAttributesW_test1, + dwCreationDispFile_GetFileAttributesW_test1, + dwFlagsAttribFile_GetFileAttributesW_test1, + hTemplateFile_GetFileAttributesW_test1); + + if( gfaTestsFile_GetFileAttributesW_test1[i].hFile == NULL ) { Fail("Error while creating files for iteration %d\n", i); } - if(!SetFileAttributesA (gfaTestsFile[i].name, gfaTestsFile[i].expectedAttribs)) + if(!SetFileAttributesA (gfaTestsFile_GetFileAttributesW_test1[i].name, gfaTestsFile_GetFileAttributesW_test1[i].expectedAttribs)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsFile[i].name, gfaTestsFile[i].expectedAttribs); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsFile_GetFileAttributesW_test1[i].name, gfaTestsFile_GetFileAttributesW_test1[i].expectedAttribs); + } } return result; } -BOOL CleanUpDirs() +BOOL CleanUpDirs_GetFileAttributesW_test1() { DWORD dwAtt; int i; BOOL result = TRUE; - for (i = 0; i < numDirTests - 1; i++ ) + for (i = 0; i < numDirTests_GetFileAttributesW_test1 - 1; i++ ) { - dwAtt = GetFileAttributesA(gfaTestsDir[i].name); - + dwAtt = GetFileAttributesA(gfaTestsDir_GetFileAttributesW_test1[i].name); + if( dwAtt != INVALID_FILE_ATTRIBUTES ) { - - if(!SetFileAttributesA (gfaTestsDir[i].name, FILE_ATTRIBUTE_DIRECTORY)) + + if(!SetFileAttributesA (gfaTestsDir_GetFileAttributesW_test1[i].name, FILE_ATTRIBUTE_DIRECTORY)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsDir[i].name, (FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY)); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsDir_GetFileAttributesW_test1[i].name, (FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY)); + } - if(!RemoveDirectoryA (gfaTestsDir[i].name)) + LPWSTR nameW = convert(gfaTestsDir_GetFileAttributesW_test1[i].name); + if(!RemoveDirectoryW (nameW)) { result = FALSE; - Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), gfaTestsDir[i].name, dwAtt); + Trace("ERROR:%d: Error deleting file [%s][%d]\n", GetLastError(), gfaTestsDir_GetFileAttributesW_test1[i].name, dwAtt); } - + + free(nameW); } } return result; } -BOOL SetUpDirs() +BOOL SetUpDirs_GetFileAttributesW_test1() { int i = 0; BOOL result = TRUE; DWORD ret = 0; - for (i = 0; i < numDirTests - 1; i++ ) + for (i = 0; i < numDirTests_GetFileAttributesW_test1 - 1; i++ ) { - result = CreateDirectoryA(gfaTestsDir[i].name, + result = CreateDirectoryA(gfaTestsDir_GetFileAttributesW_test1[i].name, NULL); if(!result ) @@ -155,25 +157,25 @@ BOOL SetUpDirs() Fail("Error while creating directory for iteration %d\n", i); } - if(!SetFileAttributesA (gfaTestsDir[i].name, gfaTestsDir[i].expectedAttribs)) + if(!SetFileAttributesA (gfaTestsDir_GetFileAttributesW_test1[i].name, gfaTestsDir_GetFileAttributesW_test1[i].expectedAttribs)) { result = FALSE; - Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsDir[i].name, gfaTestsDir[i].expectedAttribs); - } + Trace("ERROR:%d: Error setting attributes [%s][%d]\n", GetLastError(), gfaTestsDir_GetFileAttributesW_test1[i].name, gfaTestsDir_GetFileAttributesW_test1[i].expectedAttribs); + } - ret = GetFileAttributesA (gfaTestsDir[i].name); - if(ret != gfaTestsDir[i].expectedAttribs) + ret = GetFileAttributesA (gfaTestsDir_GetFileAttributesW_test1[i].name); + if(ret != gfaTestsDir_GetFileAttributesW_test1[i].expectedAttribs) { result = FALSE; - Trace("ERROR: Error setting attributes [%s][%d]\n", gfaTestsDir[i].name, gfaTestsDir[i].expectedAttribs); - } - // Trace("Setup Dir setting attr [%d], returned [%d]\n", gfaTestsDir[i].expectedAttribs, ret); + Trace("ERROR: Error setting attributes [%s][%d]\n", gfaTestsDir_GetFileAttributesW_test1[i].name, gfaTestsDir_GetFileAttributesW_test1[i].expectedAttribs); + } + // Trace("Setup Dir setting attr [%d], returned [%d]\n", gfaTestsDir_GetFileAttributesW_test1[i].expectedAttribs, ret); } // Trace("Setup dirs returning %d\n", result); return result; } -int __cdecl main(int argc, char **argv) +PALTEST(file_io_GetFileAttributesW_test1_paltest_getfileattributesw_test1, "file_io/GetFileAttributesW/test1/paltest_getfileattributesw_test1") { int i; BOOL bFailed = FALSE; @@ -187,7 +189,7 @@ int __cdecl main(int argc, char **argv) char * NoDirectoryName = "no_directory"; char * NormalFileName = "normal_test_file"; - char * ReadOnlyFileName = "ro_test_file"; + char * ReadOnlyFileName = "ro_test_file"; char * ReadWriteFileName = "rw_file"; char * HiddenFileName = ".hidden_file"; char * HiddenReadOnlyFileName = ".hidden_ro_file"; @@ -195,61 +197,61 @@ int __cdecl main(int argc, char **argv) WCHAR *WStr; /* Tests on directory */ - gfaTestsDir[0].name = NormalDirectoryName; - gfaTestsDir[0].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; - gfaTestsDir[0].isFile = TYPE_DIR; - - gfaTestsDir[1].name = ReadOnlyDirectoryName; - gfaTestsDir[1].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY | + gfaTestsDir_GetFileAttributesW_test1[0].name = NormalDirectoryName; + gfaTestsDir_GetFileAttributesW_test1[0].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; + gfaTestsDir_GetFileAttributesW_test1[0].isFile = TYPE_DIR; + + gfaTestsDir_GetFileAttributesW_test1[1].name = ReadOnlyDirectoryName; + gfaTestsDir_GetFileAttributesW_test1[1].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_READONLY; - gfaTestsDir[1].isFile = TYPE_DIR; + gfaTestsDir_GetFileAttributesW_test1[1].isFile = TYPE_DIR; - gfaTestsDir[2].name = ReadWriteDirectoryName; - gfaTestsDir[2].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; - gfaTestsDir[2].isFile = TYPE_DIR; + gfaTestsDir_GetFileAttributesW_test1[2].name = ReadWriteDirectoryName; + gfaTestsDir_GetFileAttributesW_test1[2].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; + gfaTestsDir_GetFileAttributesW_test1[2].isFile = TYPE_DIR; - gfaTestsDir[3].name = HiddenDirectoryName; - gfaTestsDir[3].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; //| + gfaTestsDir_GetFileAttributesW_test1[3].name = HiddenDirectoryName; + gfaTestsDir_GetFileAttributesW_test1[3].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY; //| //FILE_ATTRIBUTE_HIDDEN; - gfaTestsDir[3].isFile = TYPE_DIR; - - gfaTestsDir[4].name = HiddenReadOnlyDirectoryName; - gfaTestsDir[4].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY | + gfaTestsDir_GetFileAttributesW_test1[3].isFile = TYPE_DIR; + + gfaTestsDir_GetFileAttributesW_test1[4].name = HiddenReadOnlyDirectoryName; + gfaTestsDir_GetFileAttributesW_test1[4].expectedAttribs = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_READONLY; //| //FILE_ATTRIBUTE_HIDDEN; - gfaTestsDir[4].isFile = TYPE_DIR; + gfaTestsDir_GetFileAttributesW_test1[4].isFile = TYPE_DIR; - gfaTestsDir[5].name = NoDirectoryName; - gfaTestsDir[5].expectedAttribs = INVALID_FILE_ATTRIBUTES; - gfaTestsDir[5].isFile = TYPE_DIR; + gfaTestsDir_GetFileAttributesW_test1[5].name = NoDirectoryName; + gfaTestsDir_GetFileAttributesW_test1[5].expectedAttribs = INVALID_FILE_ATTRIBUTES; + gfaTestsDir_GetFileAttributesW_test1[5].isFile = TYPE_DIR; /* Tests on file */ - gfaTestsFile[0].name = NormalFileName; - gfaTestsFile[0].expectedAttribs = FILE_ATTRIBUTE_NORMAL; - gfaTestsFile[0].isFile = TYPE_FILE; + gfaTestsFile_GetFileAttributesW_test1[0].name = NormalFileName; + gfaTestsFile_GetFileAttributesW_test1[0].expectedAttribs = FILE_ATTRIBUTE_NORMAL; + gfaTestsFile_GetFileAttributesW_test1[0].isFile = TYPE_FILE; - gfaTestsFile[1].name = ReadOnlyFileName; - gfaTestsFile[1].expectedAttribs = FILE_ATTRIBUTE_READONLY; - gfaTestsFile[1].isFile = TYPE_FILE; + gfaTestsFile_GetFileAttributesW_test1[1].name = ReadOnlyFileName; + gfaTestsFile_GetFileAttributesW_test1[1].expectedAttribs = FILE_ATTRIBUTE_READONLY; + gfaTestsFile_GetFileAttributesW_test1[1].isFile = TYPE_FILE; - gfaTestsFile[2].name = ReadWriteFileName; - gfaTestsFile[2].expectedAttribs = FILE_ATTRIBUTE_NORMAL; - gfaTestsFile[2].isFile = TYPE_FILE; + gfaTestsFile_GetFileAttributesW_test1[2].name = ReadWriteFileName; + gfaTestsFile_GetFileAttributesW_test1[2].expectedAttribs = FILE_ATTRIBUTE_NORMAL; + gfaTestsFile_GetFileAttributesW_test1[2].isFile = TYPE_FILE; - gfaTestsFile[3].name = HiddenFileName; - gfaTestsFile[3].expectedAttribs = FILE_ATTRIBUTE_NORMAL; //FILE_ATTRIBUTE_HIDDEN; - gfaTestsFile[3].isFile = TYPE_FILE; + gfaTestsFile_GetFileAttributesW_test1[3].name = HiddenFileName; + gfaTestsFile_GetFileAttributesW_test1[3].expectedAttribs = FILE_ATTRIBUTE_NORMAL; //FILE_ATTRIBUTE_HIDDEN; + gfaTestsFile_GetFileAttributesW_test1[3].isFile = TYPE_FILE; - gfaTestsFile[4].name = HiddenReadOnlyFileName; - gfaTestsFile[4].expectedAttribs = FILE_ATTRIBUTE_READONLY; //| + gfaTestsFile_GetFileAttributesW_test1[4].name = HiddenReadOnlyFileName; + gfaTestsFile_GetFileAttributesW_test1[4].expectedAttribs = FILE_ATTRIBUTE_READONLY; //| //FILE_ATTRIBUTE_HIDDEN; - gfaTestsFile[4].isFile = TYPE_FILE; + gfaTestsFile_GetFileAttributesW_test1[4].isFile = TYPE_FILE; - gfaTestsFile[5].name = NotReallyAFileName; - gfaTestsFile[5].expectedAttribs = INVALID_FILE_ATTRIBUTES; - gfaTestsFile[5].isFile = TYPE_FILE; + gfaTestsFile_GetFileAttributesW_test1[5].name = NotReallyAFileName; + gfaTestsFile_GetFileAttributesW_test1[5].expectedAttribs = INVALID_FILE_ATTRIBUTES; + gfaTestsFile_GetFileAttributesW_test1[5].isFile = TYPE_FILE; /* Initialize PAL environment */ if (0 != PAL_Initialize(argc,argv)) @@ -257,78 +259,78 @@ int __cdecl main(int argc, char **argv) return FAIL; } - if(!CleanUpFiles()) + if(!CleanUpFiles_GetFileAttributesW_test1()) { Fail("GetFileAttributesW: Pre-Clean Up Files Failed\n"); } - if(0 == SetUpFiles()) + if(0 == SetUpFiles_GetFileAttributesW_test1()) { Fail("GetFileAttributesW: SetUp Files Failed\n"); } - if(!CleanUpDirs()) + if(!CleanUpDirs_GetFileAttributesW_test1()) { Fail("GetFileAttributesW: Pre-Clean Up Directories Failed\n"); } - if(!SetUpDirs()) + if(!SetUpDirs_GetFileAttributesW_test1()) { Fail("GetFileAttributesW: SetUp Directories Failed\n"); } - /* + /* * Go through all the test cases above, * call GetFileAttributesW on the name and * make sure the return value is the one expected */ - for( i = 0; i < numFileTests; i++ ) + for( i = 0; i < numFileTests_GetFileAttributesW_test1; i++ ) { - WStr = convert(gfaTestsFile[i].name); + WStr = convert(gfaTestsFile_GetFileAttributesW_test1[i].name); result = GetFileAttributesW(WStr); - if( result != gfaTestsFile[i].expectedAttribs ) + if( result != gfaTestsFile_GetFileAttributesW_test1[i].expectedAttribs ) { bFailed = TRUE; Trace("ERROR: GetFileAttributesW Test#%u on %s " "returned %u instead of %u. \n", i, - gfaTestsFile[i].name, + gfaTestsFile_GetFileAttributesW_test1[i].name, result, - gfaTestsFile[i].expectedAttribs); + gfaTestsFile_GetFileAttributesW_test1[i].expectedAttribs); } free(WStr); } - for( i = 0; i < numDirTests; i++ ) + for( i = 0; i < numDirTests_GetFileAttributesW_test1; i++ ) { - WStr = convert(gfaTestsDir[i].name); + WStr = convert(gfaTestsDir_GetFileAttributesW_test1[i].name); result = GetFileAttributesW(WStr); - if( result != gfaTestsDir[i].expectedAttribs ) + if( result != gfaTestsDir_GetFileAttributesW_test1[i].expectedAttribs ) { bFailed = TRUE; Trace("ERROR: GetFileAttributesW on Directories Test#%u on %s " "returned %u instead of %u. \n", i, - gfaTestsDir[i].name, + gfaTestsDir_GetFileAttributesW_test1[i].name, result, - gfaTestsDir[i].expectedAttribs); + gfaTestsDir_GetFileAttributesW_test1[i].expectedAttribs); } free(WStr); } - if(!CleanUpFiles()) + if(!CleanUpFiles_GetFileAttributesW_test1()) { Fail("GetFileAttributesW: Post-Clean Up Files Failed\n"); } - if(!CleanUpDirs()) + if(!CleanUpDirs_GetFileAttributesW_test1()) { Fail("GetFileAttributesW: Post-Clean Up Directories Failed\n"); } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/no_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/no_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/normal_test_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/normal_test_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/ro_test_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/ro_test_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/rw_test_directory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/rw_test_directory/CMakeLists.txt deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/testinfo.dat deleted file mode 100644 index e837aeae70aa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/testinfo.dat +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 - -Section = file_io - -Function = GetFileAttributesW - -Name = Positive Test for GetFileAttributesW - -TYPE = DEFAULT - -EXE1 = getfileattributesw - -Description - -= Test the GetFileAttributesW function - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/CMakeLists.txt deleted file mode 100644 index fa5a8b3470cc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetFileSize.cpp -) - -add_executable(paltest_getfilesize_test1 - ${SOURCES} -) - -add_dependencies(paltest_getfilesize_test1 coreclrpal) - -target_link_libraries(paltest_getfilesize_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.cpp index f66d5b94054b..4a58e113a931 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.cpp @@ -12,9 +12,9 @@ #include -const char* szTextFile = "text.txt"; -void CleanUp(HANDLE hFile) + +void CleanUp_GetFileSize_test1(HANDLE hFile) { if (CloseHandle(hFile) != TRUE) { @@ -28,7 +28,7 @@ void CleanUp(HANDLE hFile) } } -void CheckFileSize(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) +void CheckFileSize_GetFileSize_test1(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) { DWORD dwRc = 0; DWORD dwReturnedHighOrder = 0; @@ -39,7 +39,7 @@ void CheckFileSize(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) { Trace("GetFileSize: ERROR -> Call to SetFilePointer failed with %ld.\n", GetLastError()); - CleanUp(hFile); + CleanUp_GetFileSize_test1(hFile); Fail(""); } else @@ -48,21 +48,21 @@ void CheckFileSize(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) { Trace("GetFileSize: ERROR -> Call to SetEndOfFile failed with %ld.\n", GetLastError()); - CleanUp(hFile); + CleanUp_GetFileSize_test1(hFile); Fail(""); } dwReturnedOffset = GetFileSize(hFile, &dwReturnedHighOrder); if ((dwReturnedOffset != dwOffset) || (dwReturnedHighOrder != dwHighOrder)) { - CleanUp(hFile); + CleanUp_GetFileSize_test1(hFile); Fail("GetFileSize: ERROR -> File sizes do not match up.\n"); } } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetFileSize_test1_paltest_getfilesize_test1, "file_io/GetFileSize/test1/paltest_getfilesize_test1") { HANDLE hFile = NULL; DWORD dwRc = 0; @@ -126,14 +126,14 @@ int __cdecl main(int argc, char *argv[]) } /* give the file a size */ - CheckFileSize(hFile, 256, 0); + CheckFileSize_GetFileSize_test1(hFile, 256, 0); /* make the file large using the high order option */ - CheckFileSize(hFile, 256, 1); + CheckFileSize_GetFileSize_test1(hFile, 256, 1); /* set the file size to zero */ - CheckFileSize(hFile, 0, 0); + CheckFileSize_GetFileSize_test1(hFile, 0, 0); /* test if file size changes by writing to it. */ /* get file size */ @@ -144,7 +144,7 @@ int __cdecl main(int argc, char *argv[]) { Trace("GetFileSize: ERROR -> Call to WriteFile failed with %ld.\n", GetLastError()); - CleanUp(hFile); + CleanUp_GetFileSize_test1(hFile); Fail(""); } @@ -153,7 +153,7 @@ int __cdecl main(int argc, char *argv[]) { Trace("GetFileSize: ERROR -> Call to FlushFileBuffers failed with %ld.\n", GetLastError()); - CleanUp(hFile); + CleanUp_GetFileSize_test1(hFile); Fail(""); } @@ -161,12 +161,12 @@ int __cdecl main(int argc, char *argv[]) dwRc2 = GetFileSize(hFile, NULL); if((dwRc2-dwRc) !=strlen(data)) { - CleanUp(hFile); + CleanUp_GetFileSize_test1(hFile); Fail("GetFileSize: ERROR -> File size did not increase properly after.\n" "writing %d chars\n", strlen(data)); } - CleanUp(hFile); + CleanUp_GetFileSize_test1(hFile); PAL_Terminate(); return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/testinfo.dat deleted file mode 100644 index ea1c1021d5e9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSize/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFileSize -Name = Positive Test for GetFileSize (test 1) -Type = DEFAULT -EXE1 = getfilesize -Description -= Test GetFileSize on a NULL handle and valid file handles - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/CMakeLists.txt deleted file mode 100644 index 6de183f9563f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetFileSizeEx.cpp -) - -add_executable(paltest_getfilesizeex_test1 - ${SOURCES} -) - -add_dependencies(paltest_getfilesizeex_test1 coreclrpal) - -target_link_libraries(paltest_getfilesizeex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.cpp index 3361047c2713..1268fad42001 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.cpp @@ -12,9 +12,9 @@ #include -const char* szTextFile = "text.txt"; -void CleanUp(HANDLE hFile) + +void CleanUp_GetFileSizeEx_test1(HANDLE hFile) { if (CloseHandle(hFile) != TRUE) { @@ -30,7 +30,7 @@ void CleanUp(HANDLE hFile) } } -void CheckFileSize(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) +void CheckFileSize_GetFileSizeEx_test1(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) { DWORD dwRc = 0; DWORD dwError = 0; @@ -41,7 +41,7 @@ void CheckFileSize(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) { Trace("GetFileSizeEx: ERROR -> Call to SetFilePointer failed with %ld.\n", GetLastError()); - CleanUp(hFile); + CleanUp_GetFileSizeEx_test1(hFile); Fail(""); } else @@ -49,7 +49,7 @@ void CheckFileSize(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) if (!SetEndOfFile(hFile)) { dwError = GetLastError(); - CleanUp(hFile); + CleanUp_GetFileSizeEx_test1(hFile); if (dwError == 112) { Fail("GetFileSizeEx: ERROR -> SetEndOfFile failed due to lack of " @@ -67,14 +67,14 @@ void CheckFileSize(HANDLE hFile, DWORD dwOffset, DWORD dwHighOrder) if ((qwFileSize.u.LowPart != dwOffset) || (qwFileSize.u.HighPart != dwHighOrder)) { - CleanUp(hFile); + CleanUp_GetFileSizeEx_test1(hFile); Fail("GetFileSizeEx: ERROR -> File sizes do not match up.\n"); } } } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetFileSizeEx_test1_paltest_getfilesizeex_test1, "file_io/GetFileSizeEx/test1/paltest_getfilesizeex_test1") { HANDLE hFile = NULL; BOOL bRc = FALSE; @@ -126,14 +126,14 @@ int __cdecl main(int argc, char *argv[]) } /* give the file a size */ - CheckFileSize(hFile, 256, 0); + CheckFileSize_GetFileSizeEx_test1(hFile, 256, 0); /* make the file large using the high order option */ - CheckFileSize(hFile, 256, 1); + CheckFileSize_GetFileSizeEx_test1(hFile, 256, 1); /* set the file size to zero */ - CheckFileSize(hFile, 0, 0); + CheckFileSize_GetFileSizeEx_test1(hFile, 0, 0); /* test if file size changes by writing to it. */ /* get file size */ @@ -144,7 +144,7 @@ int __cdecl main(int argc, char *argv[]) { Trace("GetFileSizeEx: ERROR -> Call to WriteFile failed with %ld.\n", GetLastError()); - CleanUp(hFile); + CleanUp_GetFileSizeEx_test1(hFile); Fail(""); } @@ -153,7 +153,7 @@ int __cdecl main(int argc, char *argv[]) { Trace("GetFileSizeEx: ERROR -> Call to FlushFileBuffers failed with %ld.\n", GetLastError()); - CleanUp(hFile); + CleanUp_GetFileSizeEx_test1(hFile); Fail(""); } @@ -161,12 +161,12 @@ int __cdecl main(int argc, char *argv[]) GetFileSizeEx(hFile, &qwFileSize2); if((qwFileSize2.QuadPart-qwFileSize.QuadPart) !=strlen(data)) { - CleanUp(hFile); + CleanUp_GetFileSizeEx_test1(hFile); Fail("GetFileSizeEx: ERROR -> File size did not increase properly after.\n" "writing %d chars\n", strlen(data)); } - CleanUp(hFile); + CleanUp_GetFileSizeEx_test1(hFile); PAL_Terminate(); return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/testinfo.dat deleted file mode 100644 index 587113c35566..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFileSizeEx -Name = Positive Test for GetFileSizeEx (test 1) -Type = DEFAULT -EXE1 = getfilesizeex -Description -= Test GetFileSizeEx on a NULL handle and valid file handles - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/CMakeLists.txt deleted file mode 100644 index a531511937a8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetFullPathNameA.cpp -) - -add_executable(paltest_getfullpathnamea_test1 - ${SOURCES} -) - -add_dependencies(paltest_getfullpathnamea_test1 coreclrpal) - -target_link_libraries(paltest_getfullpathnamea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.cpp index eda6f130c4f3..18aee4bba038 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.cpp @@ -12,10 +12,10 @@ #include -const char* szFileName = "testing.tmp"; - -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetFullPathNameA_test1_paltest_getfullpathnamea_test1, "file_io/GetFullPathNameA/test1/paltest_getfullpathnamea_test1") { + const char* szFileName = "testing.tmp"; + DWORD dwRc = 0; char szReturnedPath[_MAX_DIR+1]; char szShortBuff[2]; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/testinfo.dat deleted file mode 100644 index f5191c648a6a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFullPathNameA -Name = Test for GetFullPathNameA (test 1) -Type = DEFAULT -EXE1 = getfullpathnamea -Description -= Get the full path for a file name and verify the results. -= Also, attempt to call GetFullPathNameA with a buffer that is -= too small for the returned path and verify the results. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/CMakeLists.txt deleted file mode 100644 index fc400bd67a38..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_getfullpathnamea_test2 - ${SOURCES} -) - -add_dependencies(paltest_getfullpathnamea_test2 coreclrpal) - -target_link_libraries(paltest_getfullpathnamea_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.cpp index caec7d8be8d3..b63e61f33e60 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.cpp @@ -17,11 +17,11 @@ #include -const char* szDotDot = "..\\"; -const char* szFileName = "testing.tmp"; - -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetFullPathNameA_test2_paltest_getfullpathnamea_test2, "file_io/GetFullPathNameA/test2/paltest_getfullpathnamea_test2") { + const char* szDotDot = "..\\"; + const char* szFileName = "testing.tmp"; + DWORD dwRc = 0; char szReturnedPath[_MAX_DIR+1]; char szFullFileName[_MAX_DIR+1]; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/testinfo.dat deleted file mode 100644 index fd72c84010f6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/testinfo.dat +++ /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. - -Version = 1.0 -Section = file_io -Function = GetFullPathNameA -Name = Test for GetFullPathNameA -Type = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the GetFullPathNameA API. -= GetFullPathA will be passed a directory that contains '..'. -= To add to this test, we will also call SetCurrentDirectory to -= ensure this is handled properly. -= The test will create a file with in the parent directory -= to verify that the returned directory is valid. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/CMakeLists.txt deleted file mode 100644 index 0877aae13d79..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_getfullpathnamea_test3 - ${SOURCES} -) - -add_dependencies(paltest_getfullpathnamea_test3 coreclrpal) - -target_link_libraries(paltest_getfullpathnamea_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.cpp index 54c53955465d..b098719bb1fd 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.cpp @@ -29,17 +29,18 @@ #include + +PALTEST(file_io_GetFullPathNameA_test3_paltest_getfullpathnamea_test3, "file_io/GetFullPathNameA/test3/paltest_getfullpathnamea_test3") +{ #ifdef WIN32 const char* szSeperator = "\\"; #else const char* szSeperator = "//"; #endif -const char* szDotDot = "..\\"; -const char* szFileName = "testing.tmp"; + const char* szDotDot = "..\\"; + const char* szFileName = "testing.tmp"; -int __cdecl main(int argc, char *argv[]) -{ DWORD dwRc = 0; char szReturnedPath[_MAX_DIR+1]; char szFullFileName[_MAX_DIR+1]; @@ -235,6 +236,6 @@ int __cdecl main(int argc, char *argv[]) free (szCreatedDirW); /* Terminate the PAL.*/ - PAL_Terminate(); + PAL_TerminateEx(bRetVal); return bRetVal; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/testinfo.dat deleted file mode 100644 index 1a1de6d9555c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFullPathNameA -Name = Test for GetFullPathNameA -Type = DEFAULT -EXE1 = test3 -Description -= Tests the PAL implementation of the GetFullPathNameA API. -= GetFullPathA will be passed a directory that contains '..'. -= Example: test_directory\level1\..\testing.tmp. -= To add to this test, we will also call SetCurrentDirectory to -= ensure this is handled properly. -= The test will create a file with in the parent directory -= to verify that the returned directory is valid. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/CMakeLists.txt deleted file mode 100644 index ec502f5d0e2d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_getfullpathnamea_test4 - ${SOURCES} -) - -add_dependencies(paltest_getfullpathnamea_test4 coreclrpal) - -target_link_libraries(paltest_getfullpathnamea_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.cpp index fd9879b03c8d..f463aec087f9 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.cpp @@ -29,17 +29,18 @@ #include + +PALTEST(file_io_GetFullPathNameA_test4_paltest_getfullpathnamea_test4, "file_io/GetFullPathNameA/test4/paltest_getfullpathnamea_test4") +{ #ifdef WIN32 const char* szSeperator = "\\"; #else const char* szSeperator = "//"; #endif -const char* szDotDot = ".."; -const char* szFileName = "testing.tmp"; + const char* szDotDot = ".."; + const char* szFileName = "testing.tmp"; -int __cdecl main(int argc, char *argv[]) -{ DWORD dwRc = 0; char szReturnedPath[_MAX_DIR+1]; char szFullFileName[_MAX_DIR+1]; @@ -197,6 +198,6 @@ int __cdecl main(int argc, char *argv[]) free (szCreatedDirW); /* Terminate the PAL.*/ - PAL_Terminate(); + PAL_TerminateEx(bRetVal); return bRetVal; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/testinfo.dat deleted file mode 100644 index 9480549d73e5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFullPathNameA -Name = Test for GetFullPathNameA -Type = DEFAULT -EXE1 = test4 -Description -= Tests the PAL implementation of the GetFullPathNameA API. -= GetFullPathA will be passed a directory that begins with '..'. -= Example: ..\test_directory\level1\testing.tmp. -= To add to this test, we will also call SetCurrentDirectory to -= ensure this is handled properly. -= The test will create a file with in the parent directory -= to verify that the returned directory is valid. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/CMakeLists.txt deleted file mode 100644 index edae18d61513..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetFullPathNameW.cpp -) - -add_executable(paltest_getfullpathnamew_test1 - ${SOURCES} -) - -add_dependencies(paltest_getfullpathnamew_test1 coreclrpal) - -target_link_libraries(paltest_getfullpathnamew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.cpp index e4562132016b..281c2023016b 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.cpp @@ -12,10 +12,10 @@ #include -const char* szFileName = "testing.tmp"; - -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetFullPathNameW_test1_paltest_getfullpathnamew_test1, "file_io/GetFullPathNameW/test1/paltest_getfullpathnamew_test1") { + const char* szFileName = "testing.tmp"; + DWORD dwRc = 0; WCHAR szwReturnedPath[_MAX_DIR+1]; WCHAR szwShortBuff[2]; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/testinfo.dat deleted file mode 100644 index 4b7448ddb447..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFullPathNameW -Name = Test for GetFullPathNameW (test 1) -Type = DEFAULT -EXE1 = getfullpathnamew -Description -= Get the full path for a file name and verify the results. -= Also, attempt to call GetFullPathNameW with a buffer that is -= too small for the returned path and verify the results. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/CMakeLists.txt deleted file mode 100644 index 9d19bf001726..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_getfullpathnamew_test2 - ${SOURCES} -) - -add_dependencies(paltest_getfullpathnamew_test2 coreclrpal) - -target_link_libraries(paltest_getfullpathnamew_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.cpp index 3faaffa3f5c2..57fa29130c64 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.cpp @@ -16,11 +16,11 @@ #include -WCHAR szwDotDot[] = {'.','.','\\','\0'}; -WCHAR szwFileName[] = {'t','e','s','t','i','n','g','.','t','m','p','\0'}; - -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetFullPathNameW_test2_paltest_getfullpathnamew_test2, "file_io/GetFullPathNameW/test2/paltest_getfullpathnamew_test2") { + WCHAR szwDotDot[] = {'.','.','\\','\0'}; + WCHAR szwFileName[] = {'t','e','s','t','i','n','g','.','t','m','p','\0'}; + DWORD dwRc = 0; WCHAR szwReturnedPath[_MAX_DIR+1]; WCHAR szwFullFileName[_MAX_DIR+1]; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/testinfo.dat deleted file mode 100644 index facd0940b060..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFullPathNameW -Name = Test for GetFullPathNameW (test 2) -Type = DEFAULT -EXE1 = test2 -Description -= Get the full path for a file name and verify the results. -= This test will use a relative path, containing '..\'. To -= add to this test, we will also call SetCurrentDirectory to -= ensure this is handled properly. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/CMakeLists.txt deleted file mode 100644 index c91e8bc1ec10..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_getfullpathnamew_test3 - ${SOURCES} -) - -add_dependencies(paltest_getfullpathnamew_test3 coreclrpal) - -target_link_libraries(paltest_getfullpathnamew_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.cpp index ca2b13bc5154..24fa5eff8faa 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.cpp @@ -29,17 +29,17 @@ #define UNICODE #include +PALTEST(file_io_GetFullPathNameW_test3_paltest_getfullpathnamew_test3, "file_io/GetFullPathNameW/test3/paltest_getfullpathnamew_test3") +{ #ifdef WIN32 -const WCHAR szSeperator[] = {'\\','\\','\0'}; + const WCHAR szSeperator[] = {'\\','\\','\0'}; #else -const WCHAR szSeperator[] = {'/','/','\0'}; + const WCHAR szSeperator[] = {'/','/','\0'}; #endif -const WCHAR szDotDot[] = {'.','.','\0'}; -const WCHAR szFileName[] = {'t','e','s','t','i','n','g','.','t','m','p','\0'}; + const WCHAR szDotDot[] = {'.','.','\0'}; + const WCHAR szFileName[] = {'t','e','s','t','i','n','g','.','t','m','p','\0'}; -int __cdecl main(int argc, char *argv[]) -{ DWORD dwRc = 0; WCHAR szReturnedPath[_MAX_DIR+1]; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/testinfo.dat deleted file mode 100644 index fe20866ad7f6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFullPathNameW -Name = Test for GetFullPathNameW -Type = DEFAULT -EXE1 = test3 -Description -= Tests the PAL implementation of the GetFullPathNameW API. -= GetFullPathW will be passed a directory that contains '..'. -= Example: test_directory\level1\..\testing.tmp. -= To add to this test, we will also call SetCurrentDirectory to -= ensure this is handled properly. -= The test will create a file with in the parent directory -= to verify that the returned directory is valid. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/CMakeLists.txt deleted file mode 100644 index a838b4639b80..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_getfullpathnamew_test4 - ${SOURCES} -) - -add_dependencies(paltest_getfullpathnamew_test4 coreclrpal) - -target_link_libraries(paltest_getfullpathnamew_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.cpp index 6976dcd4079e..752abfc0605b 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.cpp @@ -29,17 +29,17 @@ #define UNICODE #include +PALTEST(file_io_GetFullPathNameW_test4_paltest_getfullpathnamew_test4, "file_io/GetFullPathNameW/test4/paltest_getfullpathnamew_test4") +{ #ifdef WIN32 const WCHAR szSeperator[] = {'\\','\\','\0'}; #else const WCHAR szSeperator[] = {'/','/','\0'}; #endif -const WCHAR szDotDot[] = {'.','.','\0'}; -const WCHAR szFileName[] = {'t','e','s','t','i','n','g','.','t','m','p','\0'}; + const WCHAR szDotDot[] = {'.','.','\0'}; + const WCHAR szFileName[] = {'t','e','s','t','i','n','g','.','t','m','p','\0'}; -int __cdecl main(int argc, char *argv[]) -{ DWORD dwRc = 0; WCHAR szReturnedPath[_MAX_DIR+1]; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/testinfo.dat deleted file mode 100644 index 9480549d73e5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetFullPathNameA -Name = Test for GetFullPathNameA -Type = DEFAULT -EXE1 = test4 -Description -= Tests the PAL implementation of the GetFullPathNameA API. -= GetFullPathA will be passed a directory that begins with '..'. -= Example: ..\test_directory\level1\testing.tmp. -= To add to this test, we will also call SetCurrentDirectory to -= ensure this is handled properly. -= The test will create a file with in the parent directory -= to verify that the returned directory is valid. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/CMakeLists.txt deleted file mode 100644 index 4fe9d389649a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetStdHandle.cpp -) - -add_executable(paltest_getstdhandle_test1 - ${SOURCES} -) - -add_dependencies(paltest_getstdhandle_test1 coreclrpal) - -target_link_libraries(paltest_getstdhandle_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.cpp index 3120d180f107..ac68e4938c0b 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetStdHandle_test1_paltest_getstdhandle_test1, "file_io/GetStdHandle/test1/paltest_getstdhandle_test1") { HANDLE hFile = NULL; DWORD dwBytesWritten = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/testinfo.dat deleted file mode 100644 index be8b8fc3dbf3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetStdHandle -Name = Positive Test for GetStdHandle (test 1) -Type = DEFAULT -EXE1 = getstdhandle -Description -= Test GetStdHandle on a valid/invalid std handles - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/CMakeLists.txt deleted file mode 100644 index 1855b4ae1a06..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetStdHandle.cpp -) - -add_executable(paltest_getstdhandle_test2 - ${SOURCES} -) - -add_dependencies(paltest_getstdhandle_test2 coreclrpal) - -target_link_libraries(paltest_getstdhandle_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.cpp index 91d175b58e37..65879cd9153c 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetStdHandle_test2_paltest_getstdhandle_test2, "file_io/GetStdHandle/test2/paltest_getstdhandle_test2") { HANDLE hFile = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/testinfo.dat deleted file mode 100644 index b4bcbaa71ee7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetStdHandle/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetStdHandle -Name = Positive Test for GetStdHandle (test 2) -Type = DEFAULT -EXE1 = getstdhandle -Description -= Smoke Test GetStdHandle on a valid/invalid std handles - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/CMakeLists.txt deleted file mode 100644 index d738faed8ab0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getsystemtime_test1 - ${SOURCES} -) - -add_dependencies(paltest_getsystemtime_test1 coreclrpal) - -target_link_libraries(paltest_getsystemtime_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp index fe5e01869a95..a589cb97640d 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp @@ -20,7 +20,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetSystemTime_test1_paltest_getsystemtime_test1, "file_io/GetSystemTime/test1/paltest_getsystemtime_test1") { SYSTEMTIME TheTime; SYSTEMTIME firstTime; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/testinfo.dat deleted file mode 100644 index f96f4770ac13..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTime/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetSystemTime -Name = Positive test of GetSystemTime -Type = DEFAULT -EXE1 = test -Description -= Tests the PAL implementation of the GetSystemTime API diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/CMakeLists.txt deleted file mode 100644 index 5515d8a19ca8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetSystemTimeAsFileTime.cpp -) - -add_executable(paltest_getsystemtimeasfiletime_test1 - ${SOURCES} -) - -add_dependencies(paltest_getsystemtimeasfiletime_test1 coreclrpal) - -target_link_libraries(paltest_getsystemtimeasfiletime_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp index c17cbccd69fb..71b65aa3cc4c 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(file_io_GetSystemTimeAsFileTime_test1_paltest_getsystemtimeasfiletime_test1, "file_io/GetSystemTimeAsFileTime/test1/paltest_getsystemtimeasfiletime_test1") { FILETIME TheFirstTime, TheSecondTime; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/testinfo.dat deleted file mode 100644 index 3b0c0d99cb62..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetSystemTimeAsFileTime -Name = Positive Test for GetSystemTimeAsFileTime -TYPE = DEFAULT -EXE1 = getsystemtimeasfiletime -Description -= Test the GetSystemTimeAsFileTime function. -= Take two times, three seconds apart, and ensure that the time is -= increasing, and that it has increased at least 3 seconds. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/CMakeLists.txt deleted file mode 100644 index 204af67ba3e8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetTempFileNameA.cpp -) - -add_executable(paltest_gettempfilenamea_test1 - ${SOURCES} -) - -add_dependencies(paltest_gettempfilenamea_test1 coreclrpal) - -target_link_libraries(paltest_gettempfilenamea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp index c5e26784fc03..e93d2d9840cb 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetTempFileNameA_test1_paltest_gettempfilenamea_test1, "file_io/GetTempFileNameA/test1/paltest_gettempfilenamea_test1") { UINT uiError = 0; const UINT uUnique = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/testinfo.dat deleted file mode 100644 index 452858aa6915..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetTempFileNameA -Name = Test for GetTempFileNameA (test 1) -Type = DEFAULT -EXE1 = gettempfilenamea -Description -= Tests the PAL implimentation of GetTempFileNameA by testing -= various combinations of path and prefix names. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/CMakeLists.txt deleted file mode 100644 index 440f991a8f44..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetTempFileNameA.cpp -) - -add_executable(paltest_gettempfilenamea_test2 - ${SOURCES} -) - -add_dependencies(paltest_gettempfilenamea_test2 coreclrpal) - -target_link_libraries(paltest_gettempfilenamea_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.cpp index c64128844974..9edaf483985a 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.cpp @@ -18,7 +18,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetTempFileNameA_test2_paltest_gettempfilenamea_test2, "file_io/GetTempFileNameA/test2/paltest_gettempfilenamea_test2") { UINT uiError = 0; DWORD dwError = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/testinfo.dat deleted file mode 100644 index 61042b1695aa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetTempFileNameA -Name = Test for GetTempFileNameA (test 2) -Type = DEFAULT -EXE1 = gettempfilenamea -Description -= Test the number of files that can be created. Since -= GetTempFileNameA only handles 8.3 file names, the test -= attempts to create more than the maximum temp files possible -= with a 3 character prefix. Since this test takes so long, it -= is not to be included in the standard test harness. -= This test will also need more than 4.07 GB free disk space. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/CMakeLists.txt deleted file mode 100644 index 942d92675b85..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - gettempfilenamea.cpp -) - -add_executable(paltest_gettempfilenamea_test3 - ${SOURCES} -) - -add_dependencies(paltest_gettempfilenamea_test3 coreclrpal) - -target_link_libraries(paltest_gettempfilenamea_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.cpp index 4cb3581d2b88..fa9112c49f1c 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.cpp @@ -24,7 +24,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetTempFileNameA_test3_paltest_gettempfilenamea_test3, "file_io/GetTempFileNameA/test3/paltest_gettempfilenamea_test3") { const UINT uUnique = 0; UINT uiError; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/testinfo.dat deleted file mode 100644 index 00ef5135af68..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetTempFileNameA -Name = Test for GetTempFileNameA (test 3) -Type = DEFAULT -EXE1 = gettempfilenamea -Description -= Tests the PAL implementation of the GetTempFileNameA function. -= Checks the file attributes and ensures that getting a file name, -= deleting the file and getting another doesn't produce the same -= as the just deleted file. Also checks the file size is 0. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/CMakeLists.txt deleted file mode 100644 index 8db091232102..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetTempFileNameW.cpp -) - -add_executable(paltest_gettempfilenamew_test1 - ${SOURCES} -) - -add_dependencies(paltest_gettempfilenamew_test1 coreclrpal) - -target_link_libraries(paltest_gettempfilenamew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp index 126b3f63685e..0d6371cd8597 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp @@ -14,7 +14,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetTempFileNameW_test1_paltest_gettempfilenamew_test1, "file_io/GetTempFileNameW/test1/paltest_gettempfilenamew_test1") { UINT uiError = 0; const UINT uUnique = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/testinfo.dat deleted file mode 100644 index b315f7aef6b9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetTempFileNameW -Name = Test for GetTempFileNameW (test 1) -Type = DEFAULT -EXE1 = gettempfilenamew -Description -= Test all the different options of GetTempFileNameW - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/CMakeLists.txt deleted file mode 100644 index 2181841f380b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetTempFileNameW.cpp -) - -add_executable(paltest_gettempfilenamew_test2 - ${SOURCES} -) - -add_dependencies(paltest_gettempfilenamew_test2 coreclrpal) - -target_link_libraries(paltest_gettempfilenamew_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.cpp index d649bf811fc5..d79e4cad67fb 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.cpp @@ -14,7 +14,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetTempFileNameW_test2_paltest_gettempfilenamew_test2, "file_io/GetTempFileNameW/test2/paltest_gettempfilenamew_test2") { UINT uiError = 0; DWORD dwError = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/testinfo.dat deleted file mode 100644 index 74d871676d42..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetTempFileNameW -Name = Test for GetTempFileNameW (test 2) -Type = DEFAULT -EXE1 = gettempfilenamew -Description -= This test attempts to create over 65000 files and will -= have to be run manually because it will take longer than -= the maximum 60 seconds allowed per test - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/CMakeLists.txt deleted file mode 100644 index 469af9da4c2e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - gettempfilenamew.cpp -) - -add_executable(paltest_gettempfilenamew_test3 - ${SOURCES} -) - -add_dependencies(paltest_gettempfilenamew_test3 coreclrpal) - -target_link_libraries(paltest_gettempfilenamew_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.cpp index 0e55cd0ce22b..312138b08e49 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.cpp @@ -24,7 +24,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetTempFileNameW_test3_paltest_gettempfilenamew_test3, "file_io/GetTempFileNameW/test3/paltest_gettempfilenamew_test3") { const UINT uUnique = 0; UINT uiError; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/testinfo.dat deleted file mode 100644 index 176994bab294..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetTempFileNameW -Name = Test for GetTempFileNameW (test 3) -Type = DEFAULT -EXE1 = gettempfilenamew -Description -= Tests the PAL implementation of the GetTempFileNameW function. -= Checks the file attributes and ensures that getting a file name, -= deleting the file and getting another doesn't produce the same -= as the just deleted file. Also checks the file size is 0. diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/CMakeLists.txt deleted file mode 100644 index 690eead144fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetTempPathW.cpp -) - -add_executable(paltest_gettemppathw_test1 - ${SOURCES} -) - -add_dependencies(paltest_gettemppathw_test1 coreclrpal) - -target_link_libraries(paltest_gettemppathw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.cpp index a33eee5008ab..6c54612344f0 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.cpp @@ -62,7 +62,7 @@ static void SetAndCheckLength(const WCHAR tmpDirPath [], int bufferLength, int e } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_GetTempPathW_test1_paltest_gettemppathw_test1, "file_io/GetTempPathW/test1/paltest_gettemppathw_test1") { if (0 != PAL_Initialize(argc, argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/testinfo.dat deleted file mode 100644 index bcca83dc2c50..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/GetTempPathW/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetTempPathW -Name = Test for GetTempPathW (test 1) -Type = DEFAULT -EXE1 = gettemppathw -Description -= Calls GetTempPathW and verifies by passing the returned -= value to CreateDirectoryW. If the returned path exists, -= CreateDirectoryW will fail. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/CMakeLists.txt deleted file mode 100644 index 3582b9520f57..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - MoveFileExA.cpp -) - -add_executable(paltest_movefileexa_test1 - ${SOURCES} -) - -add_dependencies(paltest_movefileexa_test1 coreclrpal) - -target_link_libraries(paltest_movefileexa_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.cpp index 08ce684facb1..26df141d997c 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.cpp @@ -13,20 +13,20 @@ #include -LPSTR lpSource[4] = { +LPSTR lpSource_MoveFileExA_test1[4] = { "src_existing.tmp", "src_non-existant.tmp", "src_dir_existing", "src_dir_non-existant" }; -LPSTR lpDestination[4]={ +LPSTR lpDestination_MoveFileExA_test1[4]={ "dst_existing.tmp", "dst_non-existant.tmp", "dst_dir_existing", "dst_dir_non-existant" }; -LPSTR lpFiles[14] ={ +LPSTR lpFiles_MoveFileExA_test1[14] ={ "src_dir_existing\\test01.tmp", "src_dir_existing\\test02.tmp", "dst_dir_existing\\test01.tmp", @@ -42,38 +42,38 @@ LPSTR lpFiles[14] ={ "dst_dir_non-existant\\test01.tmp", "dst_dir_non-existant\\test02.tmp" }; - -DWORD dwFlag[2] = {MOVEFILE_COPY_ALLOWED, MOVEFILE_REPLACE_EXISTING}; +DWORD dwFlag_MoveFileExA_test1[2] = {MOVEFILE_COPY_ALLOWED, MOVEFILE_REPLACE_EXISTING}; -int createExisting(void) + +int createExisting_MoveFileExA_test1(void) { HANDLE tempFile = NULL; HANDLE tempFile2 = NULL; /* create the src_existing file and dst_existing file */ - tempFile = CreateFileA(lpSource[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile = CreateFileA(lpSource_MoveFileExA_test1[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - tempFile2 = CreateFileA(lpDestination[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile2 = CreateFileA(lpDestination_MoveFileExA_test1[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); CloseHandle(tempFile2); CloseHandle(tempFile); if ((tempFile == NULL) || (tempFile2 == NULL)) { - Trace("ERROR[%ul]: couldn't create %S or %S\n", GetLastError(), lpSource[0], - lpDestination[0]); - return FAIL; + Trace("ERROR[%ul]: couldn't create %S or %S\n", GetLastError(), lpSource_MoveFileExA_test1[0], + lpDestination_MoveFileExA_test1[0]); + return FAIL; } /* create the src_dir_existing and dst_dir_existing directory and files */ - CreateDirectoryA(lpSource[2], NULL); + CreateDirectoryA(lpSource_MoveFileExA_test1[2], NULL); - tempFile = CreateFileA(lpFiles[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile = CreateFileA(lpFiles_MoveFileExA_test1[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - tempFile2 = CreateFileA(lpFiles[1], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile2 = CreateFileA(lpFiles_MoveFileExA_test1[1], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); CloseHandle(tempFile2); CloseHandle(tempFile); @@ -84,10 +84,10 @@ int createExisting(void) return FAIL; } - CreateDirectoryA(lpDestination[2], NULL); - tempFile = CreateFileA(lpFiles[2], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + CreateDirectoryA(lpDestination_MoveFileExA_test1[2], NULL); + tempFile = CreateFileA(lpFiles_MoveFileExA_test1[2], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - tempFile2 = CreateFileA(lpFiles[3], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile2 = CreateFileA(lpFiles_MoveFileExA_test1[3], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); CloseHandle(tempFile2); CloseHandle(tempFile); @@ -101,21 +101,26 @@ int createExisting(void) } -void removeDirectoryHelper(LPSTR dir, int location) -{ +void removeDirectoryHelper_MoveFileExA_test1(LPSTR dir, int location) +{ DWORD dwAtt = GetFileAttributesA(dir); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - if(!RemoveDirectoryA(dir)) + LPWSTR dirW = convert(dir); + if(!RemoveDirectoryW(dirW)) { - Fail("ERROR: Failed to remove Directory [%s], Error Code [%d], location [%d]\n", dir, GetLastError(), location); + DWORD dwError = GetLastError(); + free(dirW); + Fail("ERROR: Failed to remove Directory [%s], Error Code [%d], location [%d]\n", dir, dwError, location); } + + free(dirW); } } -void removeFileHelper(LPSTR pfile, int location) -{ +void removeFileHelper_MoveFileExA_test1(LPSTR pfile, int location) +{ FILE *fp; fp = fopen( pfile, "r"); @@ -123,83 +128,83 @@ void removeFileHelper(LPSTR pfile, int location) { if(fclose(fp)) { - Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location); + Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location); } if(!DeleteFileA(pfile)) { - Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location); + Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location); } } } -void removeAll(void) +void removeAll_MoveFileExA_test1(void) { DWORD dwAtt; /* get rid of destination dirs and files */ - removeFileHelper(lpSource[0], 11); - removeFileHelper(lpSource[1], 12); - removeFileHelper(lpFiles[0], 13); - removeFileHelper(lpFiles[1], 14); + removeFileHelper_MoveFileExA_test1(lpSource_MoveFileExA_test1[0], 11); + removeFileHelper_MoveFileExA_test1(lpSource_MoveFileExA_test1[1], 12); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[0], 13); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[1], 14); - removeDirectoryHelper(lpSource[2], 101); - removeFileHelper(lpFiles[4], 15); - removeFileHelper(lpFiles[5], 16); - removeDirectoryHelper(lpSource[3], 102); + removeDirectoryHelper_MoveFileExA_test1(lpSource_MoveFileExA_test1[2], 101); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[4], 15); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[5], 16); + removeDirectoryHelper_MoveFileExA_test1(lpSource_MoveFileExA_test1[3], 102); /* get rid of destination dirs and files */ - dwAtt = GetFileAttributesA(lpDestination[0]); + dwAtt = GetFileAttributesA(lpDestination_MoveFileExA_test1[0]); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - removeFileHelper(lpFiles[6], 18); - removeFileHelper(lpFiles[7], 19); - removeDirectoryHelper(lpDestination[0], 103); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[6], 18); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[7], 19); + removeDirectoryHelper_MoveFileExA_test1(lpDestination_MoveFileExA_test1[0], 103); } else { - removeFileHelper(lpDestination[0], 17); + removeFileHelper_MoveFileExA_test1(lpDestination_MoveFileExA_test1[0], 17); } - dwAtt = GetFileAttributesA(lpDestination[1]); + dwAtt = GetFileAttributesA(lpDestination_MoveFileExA_test1[1]); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - removeFileHelper(lpFiles[8], 21); - removeFileHelper(lpFiles[9], 22); - removeDirectoryHelper(lpDestination[1], 104); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[8], 21); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[9], 22); + removeDirectoryHelper_MoveFileExA_test1(lpDestination_MoveFileExA_test1[1], 104); } else { - removeFileHelper(lpDestination[1], 19); + removeFileHelper_MoveFileExA_test1(lpDestination_MoveFileExA_test1[1], 19); } - - dwAtt = GetFileAttributesA(lpDestination[2]); + + dwAtt = GetFileAttributesA(lpDestination_MoveFileExA_test1[2]); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - removeFileHelper(lpFiles[10], 24); - removeFileHelper(lpFiles[11], 25); - removeDirectoryHelper(lpDestination[2], 105); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[10], 24); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[11], 25); + removeDirectoryHelper_MoveFileExA_test1(lpDestination_MoveFileExA_test1[2], 105); } else { - removeFileHelper(lpDestination[2], 23); + removeFileHelper_MoveFileExA_test1(lpDestination_MoveFileExA_test1[2], 23); } - dwAtt = GetFileAttributesA(lpDestination[3]); + dwAtt = GetFileAttributesA(lpDestination_MoveFileExA_test1[3]); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - removeFileHelper(lpFiles[12], 26); - removeFileHelper(lpFiles[13], 27); - removeDirectoryHelper(lpDestination[3], 106); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[12], 26); + removeFileHelper_MoveFileExA_test1(lpFiles_MoveFileExA_test1[13], 27); + removeDirectoryHelper_MoveFileExA_test1(lpDestination_MoveFileExA_test1[3], 106); } else { - removeFileHelper(lpDestination[3], 107); + removeFileHelper_MoveFileExA_test1(lpDestination_MoveFileExA_test1[3], 107); } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_MoveFileExA_test1_paltest_movefileexa_test1, "file_io/MoveFileExA/test1/paltest_movefileexa_test1") { BOOL bRc = TRUE; char results[40]; @@ -232,41 +237,41 @@ int __cdecl main(int argc, char *argv[]) /* clean the slate */ - removeAll(); - if (createExisting() != PASS) + removeAll_MoveFileExA_test1(); + if (createExisting_MoveFileExA_test1() != PASS) { goto EXIT; - } + } - /* lpSource loop */ + /* lpSource_MoveFileExA_test1 loop */ for (i = 0; i < 4; i++) { - /* lpDestination loop */ + /* lpDestination_MoveFileExA_test1 loop */ for (j = 0; j < 4; j++) { - /* dwFlag loop */ + /* dwFlag_MoveFileExA_test1 loop */ for (k = 0; k < 2; k++) { /* move the file to the new location */ - bRc = MoveFileExA(lpSource[i], lpDestination[j], dwFlag[k]); + bRc = MoveFileExA(lpSource_MoveFileExA_test1[i], lpDestination_MoveFileExA_test1[j], dwFlag_MoveFileExA_test1[k]); if (!( - ((bRc == TRUE) && (results[nCounter] == '1')) - || + ((bRc == TRUE) && (results[nCounter] == '1')) + || ((bRc == FALSE ) && (results[nCounter] == '0')) ) ) { - Trace("MoveFileExA(%s, %s, %s): Values of i[%d], j[%d], k [%d] and results[%d]=%c LastError[%d]Flag[%d]FAILED\n", - lpSource[i], lpDestination[j], - k == 1 ? + Trace("MoveFileExA(%s, %s, %s): Values of i[%d], j[%d], k [%d] and results[%d]=%c LastError[%d]Flag[%d]FAILED\n", + lpSource_MoveFileExA_test1[i], lpDestination_MoveFileExA_test1[j], + k == 1 ? "MOVEFILE_REPLACE_EXISTING":"MOVEFILE_COPY_ALLOWED", i, j, k, nCounter, results[nCounter], GetLastError(), bRc); goto EXIT; } /* undo the last move */ - removeAll(); - if (createExisting() != PASS) + removeAll_MoveFileExA_test1(); + if (createExisting_MoveFileExA_test1() != PASS) { goto EXIT; } @@ -276,7 +281,7 @@ int __cdecl main(int argc, char *argv[]) } /* create the temp source file */ - hFile = CreateFileA(tempSource, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + hFile = CreateFileA(tempSource, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if( hFile == INVALID_HANDLE_VALUE ) @@ -285,7 +290,7 @@ int __cdecl main(int argc, char *argv[]) "create the file correctly.\n"); goto EXIT; } - + bRc = CloseHandle(hFile); if(!bRc) { @@ -321,7 +326,7 @@ int __cdecl main(int argc, char *argv[]) Trace("MoveFileExA: GetFileAttributes failed to get " "the file's attributes.\n"); goto EXIT; - } + } if((result & FILE_ATTRIBUTE_READONLY) != FILE_ATTRIBUTE_READONLY) { @@ -351,7 +356,7 @@ int __cdecl main(int argc, char *argv[]) res = PASS; EXIT: - removeAll(); + removeAll_MoveFileExA_test1(); PAL_TerminateEx(res); return res; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/testinfo.dat deleted file mode 100644 index baf6a864055f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = MoveFileExA -Name = Test for MoveFileExA (test 1) -Type = DEFAULT -EXE1 = movefileexa -Description -= Creates a number of files/directories and attempts to move them. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/CMakeLists.txt deleted file mode 100644 index 4e984e8b1a8a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - MoveFileExW.cpp -) - -add_executable(paltest_movefileexw_test1 - ${SOURCES} -) - -add_dependencies(paltest_movefileexw_test1 coreclrpal) - -target_link_libraries(paltest_movefileexw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.cpp index bb9cb5a2d766..70a6e29f1265 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.cpp @@ -13,40 +13,40 @@ #include -LPWSTR lpSource[4]; -LPWSTR lpDestination[4]; -LPWSTR lpFiles[14]; +LPWSTR lpSource_MoveFileExW_test1[4]; +LPWSTR lpDestination_MoveFileExW_test1[4]; +LPWSTR lpFiles_MoveFileExW_test1[14]; -DWORD dwFlag[2] = {MOVEFILE_COPY_ALLOWED, MOVEFILE_REPLACE_EXISTING}; +DWORD dwFlag_MoveFileExW_test1[2] = {MOVEFILE_COPY_ALLOWED, MOVEFILE_REPLACE_EXISTING}; -int createExisting(void) +int createExisting_MoveFileExW_test1(void) { HANDLE tempFile = NULL; HANDLE tempFile2 = NULL; /* create the src_existing file and dst_existing file */ - tempFile = CreateFileW(lpSource[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile = CreateFileW(lpSource_MoveFileExW_test1[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - tempFile2 = CreateFileW(lpDestination[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile2 = CreateFileW(lpDestination_MoveFileExW_test1[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); CloseHandle(tempFile2); CloseHandle(tempFile); if ((tempFile == NULL) || (tempFile2 == NULL)) { - Trace("ERROR: couldn't create %S or %S\n", lpSource[0], - lpDestination[0]); + Trace("ERROR: couldn't create %S or %S\n", lpSource_MoveFileExW_test1[0], + lpDestination_MoveFileExW_test1[0]); return FAIL; } /* create the src_dir_existing and dst_dir_existing directory and files */ - CreateDirectoryW(lpSource[2], NULL); + CreateDirectoryW(lpSource_MoveFileExW_test1[2], NULL); - tempFile = CreateFileW(lpFiles[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile = CreateFileW(lpFiles_MoveFileExW_test1[0], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - tempFile2 = CreateFileW(lpFiles[1], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile2 = CreateFileW(lpFiles_MoveFileExW_test1[1], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); CloseHandle(tempFile2); CloseHandle(tempFile); @@ -57,10 +57,10 @@ int createExisting(void) return FAIL; } - CreateDirectoryW(lpDestination[2], NULL); - tempFile = CreateFileW(lpFiles[2], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + CreateDirectoryW(lpDestination_MoveFileExW_test1[2], NULL); + tempFile = CreateFileW(lpFiles_MoveFileExW_test1[2], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - tempFile2 = CreateFileW(lpFiles[3], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + tempFile2 = CreateFileW(lpFiles_MoveFileExW_test1[3], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); CloseHandle(tempFile2); CloseHandle(tempFile); @@ -73,7 +73,7 @@ int createExisting(void) return PASS; } -void removeDirectoryHelper(LPWSTR dir, int location) +void removeDirectoryHelper_MoveFileExW_test1(LPWSTR dir, int location) { DWORD dwAtt = GetFileAttributesW(dir); // Trace(" Value of location[%d], and directorye [%S]\n", location, dir); @@ -87,7 +87,7 @@ void removeDirectoryHelper(LPWSTR dir, int location) } } -void removeFileHelper(LPWSTR wfile, int location) +void removeFileHelper_MoveFileExW_test1(LPWSTR wfile, int location) { FILE *fp; char * pfile = convertC(wfile); @@ -115,108 +115,108 @@ void removeFileHelper(LPWSTR wfile, int location) free(pfile); } -void removeAll(void) +void removeAll_MoveFileExW_test1(void) { DWORD dwAtt; /* get rid of destination dirs and files */ - removeFileHelper(lpSource[0], 11); -// lpSource[0] = convert("src_existing.tmp"); + removeFileHelper_MoveFileExW_test1(lpSource_MoveFileExW_test1[0], 11); +// lpSource_MoveFileExW_test1[0] = convert("src_existing.tmp"); - removeFileHelper(lpSource[1], 12); - //lpSource[1] = convert("src_non-existant.tmp"); + removeFileHelper_MoveFileExW_test1(lpSource_MoveFileExW_test1[1], 12); + //lpSource_MoveFileExW_test1[1] = convert("src_non-existant.tmp"); - removeFileHelper(lpFiles[0], 13); -// lpFiles[0] = convert("src_dir_existing\\test01.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[0], 13); +// lpFiles_MoveFileExW_test1[0] = convert("src_dir_existing\\test01.tmp"); - removeFileHelper(lpFiles[1], 14); -// lpFiles[1] = convert("src_dir_existing\\test02.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[1], 14); +// lpFiles_MoveFileExW_test1[1] = convert("src_dir_existing\\test02.tmp"); - removeDirectoryHelper(lpSource[2], 101); -// lpSource[2] = convert("src_dir_existing"); + removeDirectoryHelper_MoveFileExW_test1(lpSource_MoveFileExW_test1[2], 101); +// lpSource_MoveFileExW_test1[2] = convert("src_dir_existing"); - removeFileHelper(lpFiles[4], 15); -// lpFiles[4] = convert("src_dir_non-existant\\test01.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[4], 15); +// lpFiles_MoveFileExW_test1[4] = convert("src_dir_non-existant\\test01.tmp"); - removeFileHelper(lpFiles[5], 16); -// lpFiles[5] = convert("src_dir_non-existant\\test02.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[5], 16); +// lpFiles_MoveFileExW_test1[5] = convert("src_dir_non-existant\\test02.tmp"); - removeDirectoryHelper(lpSource[3], 102); -// lpSource[3] = convert("src_dir_non-existant"); + removeDirectoryHelper_MoveFileExW_test1(lpSource_MoveFileExW_test1[3], 102); +// lpSource_MoveFileExW_test1[3] = convert("src_dir_non-existant"); /* get rid of destination dirs and files */ - dwAtt = GetFileAttributesW(lpDestination[0]); + dwAtt = GetFileAttributesW(lpDestination_MoveFileExW_test1[0]); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - removeFileHelper(lpFiles[6], 18); - // lpFiles[6] = convert("dst_existing.tmp\\test01.tmp"); - removeFileHelper(lpFiles[7], 19); - // lpFiles[7] = convert("dst_existing.tmp\\test02.tmp"); - removeDirectoryHelper(lpDestination[0], 103); - // lpDestination[0] = convert("dst_existing.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[6], 18); + // lpFiles_MoveFileExW_test1[6] = convert("dst_existing.tmp\\test01.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[7], 19); + // lpFiles_MoveFileExW_test1[7] = convert("dst_existing.tmp\\test02.tmp"); + removeDirectoryHelper_MoveFileExW_test1(lpDestination_MoveFileExW_test1[0], 103); + // lpDestination_MoveFileExW_test1[0] = convert("dst_existing.tmp"); } else { - removeFileHelper(lpDestination[0], 17); - // lpDestination[0] = convert("dst_existing.tmp"); + removeFileHelper_MoveFileExW_test1(lpDestination_MoveFileExW_test1[0], 17); + // lpDestination_MoveFileExW_test1[0] = convert("dst_existing.tmp"); } - dwAtt = GetFileAttributesW(lpDestination[1]); + dwAtt = GetFileAttributesW(lpDestination_MoveFileExW_test1[1]); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - removeFileHelper(lpFiles[8], 21); - // lpFiles[8] = convert("dst_non-existant.tmp\\test01.tmp"); - removeFileHelper(lpFiles[9], 22); - // lpFiles[9] = convert("dst_non-existant.tmp\\test02.tmp"); - removeDirectoryHelper(lpDestination[1], 104); - // lpDestination[1] = convert("dst_non-existant.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[8], 21); + // lpFiles_MoveFileExW_test1[8] = convert("dst_non-existant.tmp\\test01.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[9], 22); + // lpFiles_MoveFileExW_test1[9] = convert("dst_non-existant.tmp\\test02.tmp"); + removeDirectoryHelper_MoveFileExW_test1(lpDestination_MoveFileExW_test1[1], 104); + // lpDestination_MoveFileExW_test1[1] = convert("dst_non-existant.tmp"); } else { - removeFileHelper(lpDestination[1], 19); - //lpDestination[1] = convert("dst_non-existant.tmp"); + removeFileHelper_MoveFileExW_test1(lpDestination_MoveFileExW_test1[1], 19); + //lpDestination_MoveFileExW_test1[1] = convert("dst_non-existant.tmp"); } - dwAtt = GetFileAttributesW(lpDestination[2]); + dwAtt = GetFileAttributesW(lpDestination_MoveFileExW_test1[2]); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - removeFileHelper(lpFiles[10], 24); - // lpFiles[10] = convert("dst_dir_existing\\test01.tmp"); - removeFileHelper(lpFiles[11], 25); - // lpFiles[11] = convert("dst_dir_existing\\test02.tmp"); - removeDirectoryHelper(lpDestination[2], 105); - // lpDestination[2] = convert("dst_dir_existing"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[10], 24); + // lpFiles_MoveFileExW_test1[10] = convert("dst_dir_existing\\test01.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[11], 25); + // lpFiles_MoveFileExW_test1[11] = convert("dst_dir_existing\\test02.tmp"); + removeDirectoryHelper_MoveFileExW_test1(lpDestination_MoveFileExW_test1[2], 105); + // lpDestination_MoveFileExW_test1[2] = convert("dst_dir_existing"); } else { - removeFileHelper(lpDestination[2], 23); - // lpDestination[2] = convert("dst_dir_existing"); + removeFileHelper_MoveFileExW_test1(lpDestination_MoveFileExW_test1[2], 23); + // lpDestination_MoveFileExW_test1[2] = convert("dst_dir_existing"); } - dwAtt = GetFileAttributesW(lpDestination[3]); + dwAtt = GetFileAttributesW(lpDestination_MoveFileExW_test1[3]); if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) ) { - removeFileHelper(lpFiles[12], 26); - // lpFiles[12] = convert("dst_dir_non-existant\\test01.tmp"); - removeFileHelper(lpFiles[13], 27); - // lpFiles[13] = convert("dst_dir_non-existant\\test02.tmp"); - removeDirectoryHelper(lpDestination[3], 106); - // lpDestination[3] = convert("dst_dir_non-existant"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[12], 26); + // lpFiles_MoveFileExW_test1[12] = convert("dst_dir_non-existant\\test01.tmp"); + removeFileHelper_MoveFileExW_test1(lpFiles_MoveFileExW_test1[13], 27); + // lpFiles_MoveFileExW_test1[13] = convert("dst_dir_non-existant\\test02.tmp"); + removeDirectoryHelper_MoveFileExW_test1(lpDestination_MoveFileExW_test1[3], 106); + // lpDestination_MoveFileExW_test1[3] = convert("dst_dir_non-existant"); } else { - removeFileHelper(lpDestination[3], 107); - // lpDestination[3] = convert("dst_dir_non-existant"); + removeFileHelper_MoveFileExW_test1(lpDestination_MoveFileExW_test1[3], 107); + // lpDestination_MoveFileExW_test1[3] = convert("dst_dir_non-existant"); } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_MoveFileExW_test1_paltest_movefileexw_test1, "file_io/MoveFileExW/test1/paltest_movefileexw_test1") { BOOL bRc = TRUE; char results[40]; @@ -233,34 +233,34 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - lpSource[0] = convert("src_existing.tmp"); - lpSource[1] = convert("src_non-existant.tmp"); - lpSource[2] = convert("src_dir_existing"); - lpSource[3] = convert("src_dir_non-existant"); + lpSource_MoveFileExW_test1[0] = convert("src_existing.tmp"); + lpSource_MoveFileExW_test1[1] = convert("src_non-existant.tmp"); + lpSource_MoveFileExW_test1[2] = convert("src_dir_existing"); + lpSource_MoveFileExW_test1[3] = convert("src_dir_non-existant"); - lpDestination[0] = convert("dst_existing.tmp"); - lpDestination[1] = convert("dst_non-existant.tmp"); - lpDestination[2] = convert("dst_dir_existing"); - lpDestination[3] = convert("dst_dir_non-existant"); + lpDestination_MoveFileExW_test1[0] = convert("dst_existing.tmp"); + lpDestination_MoveFileExW_test1[1] = convert("dst_non-existant.tmp"); + lpDestination_MoveFileExW_test1[2] = convert("dst_dir_existing"); + lpDestination_MoveFileExW_test1[3] = convert("dst_dir_non-existant"); - lpFiles[0] = convert("src_dir_existing\\test01.tmp"); - lpFiles[1] = convert("src_dir_existing\\test02.tmp"); - lpFiles[2] = convert("dst_dir_existing\\test01.tmp"); - lpFiles[3] = convert("dst_dir_existing\\test02.tmp"); - lpFiles[4] = convert("src_dir_non-existant\\test01.tmp"); - lpFiles[5] = convert("src_dir_non-existant\\test02.tmp"); + lpFiles_MoveFileExW_test1[0] = convert("src_dir_existing\\test01.tmp"); + lpFiles_MoveFileExW_test1[1] = convert("src_dir_existing\\test02.tmp"); + lpFiles_MoveFileExW_test1[2] = convert("dst_dir_existing\\test01.tmp"); + lpFiles_MoveFileExW_test1[3] = convert("dst_dir_existing\\test02.tmp"); + lpFiles_MoveFileExW_test1[4] = convert("src_dir_non-existant\\test01.tmp"); + lpFiles_MoveFileExW_test1[5] = convert("src_dir_non-existant\\test02.tmp"); - lpFiles[6] = convert("dst_existing.tmp\\test01.tmp"); - lpFiles[7] = convert("dst_existing.tmp\\test02.tmp"); + lpFiles_MoveFileExW_test1[6] = convert("dst_existing.tmp\\test01.tmp"); + lpFiles_MoveFileExW_test1[7] = convert("dst_existing.tmp\\test02.tmp"); - lpFiles[8] = convert("dst_non-existant.tmp\\test01.tmp"); - lpFiles[9] = convert("dst_non-existant.tmp\\test02.tmp"); + lpFiles_MoveFileExW_test1[8] = convert("dst_non-existant.tmp\\test01.tmp"); + lpFiles_MoveFileExW_test1[9] = convert("dst_non-existant.tmp\\test02.tmp"); - lpFiles[10] = convert("dst_dir_existing\\test01.tmp"); - lpFiles[11] = convert("dst_dir_existing\\test02.tmp"); + lpFiles_MoveFileExW_test1[10] = convert("dst_dir_existing\\test01.tmp"); + lpFiles_MoveFileExW_test1[11] = convert("dst_dir_existing\\test02.tmp"); - lpFiles[12] = convert("dst_dir_non-existant\\test01.tmp"); - lpFiles[13] = convert("dst_dir_non-existant\\test02.tmp"); + lpFiles_MoveFileExW_test1[12] = convert("dst_dir_non-existant\\test01.tmp"); + lpFiles_MoveFileExW_test1[13] = convert("dst_dir_non-existant\\test02.tmp"); /* read in the expected results to compare with actual results */ memset (results, 0, 34); @@ -283,19 +283,19 @@ int __cdecl main(int argc, char *argv[]) /* clean the slate */ - removeAll(); - if (createExisting() != PASS) + removeAll_MoveFileExW_test1(); + if (createExisting_MoveFileExW_test1() != PASS) { goto EXIT; } - /* lpSource loop */ + /* lpSource_MoveFileExW_test1 loop */ for (i = 0; i < 4; i++) { - /* lpDestination loop */ + /* lpDestination_MoveFileExW_test1 loop */ for (j = 0; j < 4; j++) { - /* dwFlag loop */ + /* dwFlag_MoveFileExW_test1 loop */ for (k = 0; k < 2; k++) { @@ -304,7 +304,7 @@ int __cdecl main(int argc, char *argv[]) //exit(1); //} /* move the file to the new location */ - bRc = MoveFileExW(lpSource[i], lpDestination[j], dwFlag[k]); + bRc = MoveFileExW(lpSource_MoveFileExW_test1[i], lpDestination_MoveFileExW_test1[j], dwFlag_MoveFileExW_test1[k]); if (!( ((bRc == TRUE) && (results[nCounter] == '1')) @@ -313,21 +313,21 @@ int __cdecl main(int argc, char *argv[]) ) { Trace("MoveFileExW(%S, %S, %s): Values of i[%d], j[%d], k [%d] and results[%d]=%c LastError[%d]Flag[%d]FAILED\n", - lpSource[i], lpDestination[j], + lpSource_MoveFileExW_test1[i], lpDestination_MoveFileExW_test1[j], k == 1 ? "MOVEFILE_REPLACE_EXISTING":"MOVEFILE_COPY_ALLOWED", i, j, k, nCounter, results[nCounter], GetLastError(), bRc); goto EXIT; } //Trace("MoveFileExW(%S, %S, %s): Values of i[%d], j[%d], k [%d] and results[%d]=%c \n", - // lpSource[i], lpDestination[j], + // lpSource_MoveFileExW_test1[i], lpDestination_MoveFileExW_test1[j], // k == 1 ? // "MOVEFILE_REPLACE_EXISTING":"MOVEFILE_COPY_ALLOWED", i, j, k, nCounter, results[nCounter]); /* undo the last move */ - removeAll(); - if (createExisting() != PASS) + removeAll_MoveFileExW_test1(); + if (createExisting_MoveFileExW_test1() != PASS) { goto EXIT; } @@ -413,15 +413,15 @@ int __cdecl main(int argc, char *argv[]) res = PASS; EXIT: - removeAll(); + removeAll_MoveFileExW_test1(); for (i=0; i<4; i++) { - free(lpSource[i]); - free(lpDestination[i]); + free(lpSource_MoveFileExW_test1[i]); + free(lpDestination_MoveFileExW_test1[i]); } for (i=0; i<14; i++) { - free(lpFiles[i]); + free(lpFiles_MoveFileExW_test1[i]); } PAL_TerminateEx(res); diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/testinfo.dat deleted file mode 100644 index 6b4a8b2cfbb4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/MoveFileExW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = MoveFileExW -Name = Test for MoveFileExW (test 1) -Type = DEFAULT -EXE1 = movefileexw -Description -= Creates a number of files/directories and attempts to move them. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/CMakeLists.txt deleted file mode 100644 index 51a66debad4a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ReadFile.cpp -) - -add_executable(paltest_readfile_test1 - ${SOURCES} -) - -add_dependencies(paltest_readfile_test1 coreclrpal) - -target_link_libraries(paltest_readfile_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.cpp index 2c9698d7c6ac..822531db4b87 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.cpp @@ -15,7 +15,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_ReadFile_test1_paltest_readfile_test1, "file_io/ReadFile/test1/paltest_readfile_test1") { HANDLE hFile = NULL; DWORD dwByteCount = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/testinfo.dat deleted file mode 100644 index 7aa03cd48f50..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = ReadFile -Name = Positive Test for ReadFile -Type = DEFAULT -EXE1 = readfile -Description -=Attempt to read from a NULL handle and a file without read permissions - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/CMakeLists.txt deleted file mode 100644 index adf226e3149b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ReadFile.cpp -) - -add_executable(paltest_readfile_test2 - ${SOURCES} -) - -add_dependencies(paltest_readfile_test2 coreclrpal) - -target_link_libraries(paltest_readfile_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp index 3f969eb4b6d4..96962eda3983 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp @@ -21,19 +21,18 @@ #include -const char* szStringTest = "The quick fox jumped over the lazy dog's back.\0"; -const char* szEmptyString = ""; -const char* szReadableFile = "Readable.txt"; -const char* szResultsFile = "Results.txt"; +#define szStringTest "The quick fox jumped over the lazy dog's back.\0" +#define szEmptyString "" +#define szReadableFile "Readable.txt" +#define szResultsFile "Results.txt" //Previously number of tests was 6, now 4 refer VSW 312690 #define NOOFTESTS 4 const int PAGESIZE = 4096; +char *readBuffer_ReadFile_test2; -char *readBuffer; - -BOOL validateResults(const char* szString, // string read +BOOL validateResults_ReadFile_test2(const char* szString, // string read DWORD dwByteCount, // amount requested DWORD dwBytesRead) // amount read { @@ -62,7 +61,7 @@ BOOL validateResults(const char* szString, // string read return TRUE; } -BOOL readTest(DWORD dwByteCount, char cResult) +BOOL readTest_ReadFile_test2(DWORD dwByteCount, char cResult) { HANDLE hFile = NULL; DWORD dwBytesRead; @@ -83,9 +82,9 @@ BOOL readTest(DWORD dwByteCount, char cResult) return FALSE; } - memset(readBuffer, 0, PAGESIZE); + memset(readBuffer_ReadFile_test2, 0, PAGESIZE); - bRc = ReadFile(hFile, readBuffer, dwByteCount, &dwBytesRead, NULL); + bRc = ReadFile(hFile, readBuffer_ReadFile_test2, dwByteCount, &dwBytesRead, NULL); if (bRc == FALSE) { @@ -93,7 +92,7 @@ BOOL readTest(DWORD dwByteCount, char cResult) if (cResult == '1') { Trace("\nbRc = %d\n", bRc); - Trace("readBuffer = [%s] dwByteCount = %d dwBytesRead = %d\n", readBuffer, dwByteCount, dwBytesRead); + Trace("readBuffer = [%s] dwByteCount = %d dwBytesRead = %d\n", readBuffer_ReadFile_test2, dwByteCount, dwBytesRead); Trace("cresult = 1\n"); Trace("getlasterror = %d\n", GetLastError()); CloseHandle(hFile); @@ -111,7 +110,7 @@ BOOL readTest(DWORD dwByteCount, char cResult) } else { - return (validateResults(readBuffer, dwByteCount, dwBytesRead)); + return (validateResults_ReadFile_test2(readBuffer_ReadFile_test2, dwByteCount, dwBytesRead)); } } @@ -119,7 +118,7 @@ BOOL readTest(DWORD dwByteCount, char cResult) return TRUE; } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_ReadFile_test2_paltest_readfile_test2, "file_io/ReadFile/test2/paltest_readfile_test2") { HANDLE hFile = NULL; const int BUFFER_SIZE = 2 * PAGESIZE; @@ -145,14 +144,14 @@ int __cdecl main(int argc, char *argv[]) } /* allocate read-write memery for readBuffer */ - if (!(readBuffer = (char*) VirtualAlloc(NULL, BUFFER_SIZE, MEM_COMMIT, PAGE_READWRITE))) + if (!(readBuffer_ReadFile_test2 = (char*) VirtualAlloc(NULL, BUFFER_SIZE, MEM_COMMIT, PAGE_READWRITE))) { Fail("VirtualAlloc failed: GetLastError returns %d\n", GetLastError()); return FAIL; } /* write protect the second page of readBuffer */ - if (!VirtualProtect(&readBuffer[PAGESIZE], PAGESIZE, PAGE_NOACCESS, &oldProt)) + if (!VirtualProtect(&readBuffer_ReadFile_test2[PAGESIZE], PAGESIZE, PAGE_NOACCESS, &oldProt)) { Fail("VirtualProtect failed: GetLastError returns %d\n", GetLastError()); return FAIL; @@ -179,14 +178,14 @@ int __cdecl main(int argc, char *argv[]) for (i = 0; i< NOOFTESTS; i++) { - bRc = readTest(dwByteCount[i], szResults[i]); + bRc = readTest_ReadFile_test2(dwByteCount[i], szResults[i]); if (bRc != TRUE) { Fail("ReadFile: ERROR -> Failed on test[%d]\n", i); } } - VirtualFree(readBuffer, BUFFER_SIZE, MEM_RELEASE); + VirtualFree(readBuffer_ReadFile_test2, BUFFER_SIZE, MEM_RELEASE); PAL_Terminate(); return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/testinfo.dat deleted file mode 100644 index 510f79fca6c7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = ReadFile -Name = Positive Test for ReadFile -Type = DEFAULT -EXE1 = readfile -Description -=Multiple tests of reads of varying sizes with verification - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/CMakeLists.txt deleted file mode 100644 index 2ce27e0dac25..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ReadFile.cpp -) - -add_executable(paltest_readfile_test3 - ${SOURCES} -) - -add_dependencies(paltest_readfile_test3 coreclrpal) - -target_link_libraries(paltest_readfile_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.cpp index 937e581c11a1..e9762552d90e 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.cpp @@ -23,13 +23,13 @@ #include -const char* szStringTest = "The quick fox jumped over the lazy dog's back.\0"; -const char* szEmptyString = ""; -const char* szReadableFile = "Readable.txt"; -const char* szResultsFile = "Results.txt"; +#define szStringTest "The quick fox jumped over the lazy dog's back.\0" +#define szEmptyString "" +#define szReadableFile "Readable.txt" +#define szResultsFile "Results.txt" -BOOL validateResults(const char* szString, // string read +BOOL validateResults_ReadFile_test3(const char* szString, // string read DWORD dwByteCount, // amount requested DWORD dwBytesRead) // amount read { @@ -62,7 +62,7 @@ BOOL validateResults(const char* szString, // string read -BOOL readTest(DWORD dwByteCount, char cResult) +BOOL readTest_ReadFile_test3(DWORD dwByteCount, char cResult) { HANDLE hFile = NULL; DWORD dwBytesRead = 0; @@ -125,7 +125,7 @@ BOOL readTest(DWORD dwByteCount, char cResult) } else { - return (validateResults(szString, dwRequested, dwTotal)); + return (validateResults_ReadFile_test3(szString, dwRequested, dwTotal)); } } @@ -135,7 +135,7 @@ BOOL readTest(DWORD dwByteCount, char cResult) -int __cdecl main(int argc, char **argv) +PALTEST(file_io_ReadFile_test3_paltest_readfile_test3, "file_io/ReadFile/test3/paltest_readfile_test3") { HANDLE hFile = NULL; DWORD dwByteCount[4] = {0, 1, 2, 3}; @@ -171,7 +171,7 @@ int __cdecl main(int argc, char **argv) for (i = 0; i < 4; i++) { - bRc = readTest(dwByteCount[i], szResults[i]); + bRc = readTest_ReadFile_test3(dwByteCount[i], szResults[i]); if (bRc != TRUE) { Fail("ReadFile: ERROR -> Failed on test[%d]\n", i); diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/testinfo.dat deleted file mode 100644 index 510f79fca6c7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = ReadFile -Name = Positive Test for ReadFile -Type = DEFAULT -EXE1 = readfile -Description -=Multiple tests of reads of varying sizes with verification - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/CMakeLists.txt deleted file mode 100644 index b284c5b77d79..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - readfile.cpp -) - -add_executable(paltest_readfile_test4 - ${SOURCES} -) - -add_dependencies(paltest_readfile_test4 coreclrpal) - -target_link_libraries(paltest_readfile_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.cpp index 864695092a6a..1704c4c2e9dd 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.cpp @@ -15,7 +15,7 @@ **===================================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_ReadFile_test4_paltest_readfile_test4, "file_io/ReadFile/test4/paltest_readfile_test4") { HANDLE hFile = NULL; DWORD dwBytesWritten; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/testinfo.dat deleted file mode 100644 index 664ce3362f6d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/ReadFile/test4/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = ReadFile -Name = Positive Test for ReadFile -Type = DEFAULT -EXE1 = readfile -Description -= Tests the PAL implementation of the ReadFile function. -= Creates a file and writes a small string to it, attempt -= to read many more characters that exist. The returned -= number of chars should be the amount written originally -= not the number requested. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/RemoveDirectoryA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/RemoveDirectoryA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/RemoveDirectoryA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/RemoveDirectoryW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/RemoveDirectoryW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/RemoveDirectoryW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt deleted file mode 100644 index 86201dd8d660..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SearchPathW.cpp -) - -add_executable(paltest_searchpathw_test1 - ${SOURCES} -) - -add_dependencies(paltest_searchpathw_test1 coreclrpal) - -target_link_libraries(paltest_searchpathw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp index 6ae52059e2ec..aa9e3bee6baa 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp @@ -25,30 +25,30 @@ //); // //Parameters -//lpPath -//[in] Pointer to a null-terminated string that specifies the path to be searched for the file. If this parameter is NULL, the function searches for a matching file in the following directories in the following sequence: -//The directory from which the application loaded. -//The current directory. -//The system directory. Use the GetSystemDirectory function to get the path of this directory. -//The 16-bit system directory. There is no function that retrieves the path of this directory, but it is searched. -//The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. -//The directories that are listed in the PATH environment variable. - -//lpFileName -//[in] Pointer to a null-terminated string that specifies the name of the file to search for. - -//lpExtension -//[in] Pointer to a null-terminated string that specifies an extension to be added to the file name when searching for the file. The first character of the file name extension must be a period (.). The extension is added only if the specified file name does not end with an extension. +//lpPath +//[in] Pointer to a null-terminated string that specifies the path to be searched for the file. If this parameter is NULL, the function searches for a matching file in the following directories in the following sequence: +//The directory from which the application loaded. +//The current directory. +//The system directory. Use the GetSystemDirectory function to get the path of this directory. +//The 16-bit system directory. There is no function that retrieves the path of this directory, but it is searched. +//The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. +//The directories that are listed in the PATH environment variable. + +//lpFileName +//[in] Pointer to a null-terminated string that specifies the name of the file to search for. + +//lpExtension +//[in] Pointer to a null-terminated string that specifies an extension to be added to the file name when searching for the file. The first character of the file name extension must be a period (.). The extension is added only if the specified file name does not end with an extension. //If a file name extension is not required or if the file name contains an extension, this parameter can be NULL. // -//nBufferLength -//[in] Size of the buffer that receives the valid path and file name, in TCHARs. +//nBufferLength +//[in] Size of the buffer that receives the valid path and file name, in TCHARs. -//lpBuffer -//[out] Pointer to the buffer that receives the path and file name of the file found. +//lpBuffer +//[out] Pointer to the buffer that receives the path and file name of the file found. -//lpFilePart -//[out] Pointer to the variable that receives the address (within lpBuffer) of the last component of the valid path and file name, which is the address of the character immediately following the final backslash (\) in the path. +//lpFilePart +//[out] Pointer to the variable that receives the address (within lpBuffer) of the last component of the valid path and file name, which is the address of the character immediately following the final backslash (\) in the path. //Return Values //If the function succeeds, the value returned is the length, in TCHARs, of the string copied to the buffer, not including the terminating null character. If the return value is greater than nBufferLength, the value returned is the size of the buffer required to hold the path. @@ -57,20 +57,20 @@ #include -const char* szDir = "."; +#define szDir "." -const char* szNoFileName = "333asdf"; -const char* szNoFileNameExt = ".x77t"; +#define szNoFileName "333asdf" +#define szNoFileNameExt ".x77t" -const char* szFileNameExists = "searchpathw"; -const char* szFileNameExtExists = ".c"; +#define szFileNameExists "searchpathw" +#define szFileNameExtExists ".c" -const char* szFileNameExistsWithExt = "searchpathw.c"; +#define szFileNameExistsWithExt "searchpathw.c" -char fileloc[_MAX_PATH]; +char fileloc_SearchPathW_test1[_MAX_PATH]; -void removeFileHelper(LPSTR pfile, int location) -{ +void removeFileHelper_SearchPathW_test1(LPSTR pfile, int location) +{ FILE *fp; fp = fopen( pfile, "r"); @@ -78,27 +78,28 @@ void removeFileHelper(LPSTR pfile, int location) { if(fclose(fp)) { - Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location); + Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location); } if(!DeleteFileA(pfile)) { - Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location); + Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location); } else { - // Trace("Success: deleted file [%S], Error Code [%d], location [%d]\n", wfile, GetLastError(), location); + // Trace("Success: deleted file [%S], Error Code [%d], location [%d]\n", wfile, GetLastError(), location); } } } -void RemoveAll() +void RemoveAll_SearchPathW_test1() { - removeFileHelper(fileloc, 1); + removeFileHelper_SearchPathW_test1(fileloc_SearchPathW_test1, 1); } -int __cdecl main(int argc, char *argv[]) { +PALTEST(file_io_SearchPathW_test1_paltest_searchpathw_test1, "file_io/SearchPathW/test1/paltest_searchpathw_test1") +{ WCHAR* lpPath = NULL; WCHAR* lpFileName = NULL; @@ -131,18 +132,18 @@ int __cdecl main(int argc, char *argv[]) { Fail("ERROR: GetTempPathA failed to get a path\n"); } - memset(fileloc, 0, _MAX_PATH); - sprintf_s(fileloc, _countof(fileloc), "%s%s", fullPath, szFileNameExistsWithExt); + memset(fileloc_SearchPathW_test1, 0, _MAX_PATH); + sprintf_s(fileloc_SearchPathW_test1, _countof(fileloc_SearchPathW_test1), "%s%s", fullPath, szFileNameExistsWithExt); - RemoveAll(); + RemoveAll_SearchPathW_test1(); - hsearchfile = CreateFileA(fileloc, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + hsearchfile = CreateFileA(fileloc_SearchPathW_test1, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hsearchfile == NULL) { - Trace("ERROR[%ul]: couldn't create %s\n", GetLastError(), fileloc); - return FAIL; + Trace("ERROR[%ul]: couldn't create %s\n", GetLastError(), fileloc_SearchPathW_test1); + return FAIL; } CloseHandle(hsearchfile); @@ -179,14 +180,14 @@ int __cdecl main(int argc, char *argv[]) { error = GetLastError(); free(lpPath); free(lpFileName); - Fail ("SearchPathA: ERROR2 -> Did not Find valid file[%s][%s][%d]\n", lpPath, szFileNameExistsWithExt, error); + Fail ("SearchPathW: ERROR2 -> Did not Find valid file[%s][%s][%d]\n", lpPath, szFileNameExistsWithExt, error); } free(lpPath); free(lpFileName); - RemoveAll(); + RemoveAll_SearchPathW_test1(); PAL_Terminate(); - return PASS; + return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/testinfo.dat deleted file mode 100644 index 1664a75d527c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SearchPathW/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SearchPathW -Name = Test #1 for SearchPathW -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests the PAL implementation of the SearchFileW function diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/CMakeLists.txt deleted file mode 100644 index dcf480bf226b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/CMakeLists.txt deleted file mode 100644 index 675371750b41..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetEndOfFile.cpp -) - -add_executable(paltest_setendoffile_test1 - ${SOURCES} -) - -add_dependencies(paltest_setendoffile_test1 coreclrpal) - -target_link_libraries(paltest_setendoffile_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.cpp index b4ca15527e08..56bcbcfce69a 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.cpp @@ -20,10 +20,10 @@ #include -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetEndOfFile_test1_paltest_setendoffile_test1, "file_io/SetEndOfFile/test1/paltest_setendoffile_test1") { HANDLE hFile = NULL; BOOL bRc = FALSE; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/testinfo.dat deleted file mode 100644 index d3e27707eeb3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetEndOfFile -Name = Positive Test for SetEndOfFile -Type = DEFAULT -EXE1 = setendoffile -Description -=Truncate a file - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/CMakeLists.txt deleted file mode 100644 index 324e24eeba42..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetEndOfFile.cpp -) - -add_executable(paltest_setendoffile_test2 - ${SOURCES} -) - -add_dependencies(paltest_setendoffile_test2 coreclrpal) - -target_link_libraries(paltest_setendoffile_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.cpp index 031c7573b3ac..b3b5372ec640 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.cpp @@ -14,11 +14,9 @@ #include -const char* szStringTest = "The quick fox jumped over the lazy dog's back."; -const char* szTextFile = "text.txt"; +#define szStringTest "The quick fox jumped over the lazy dog's back." - -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_SetEndOfFile_test2_paltest_setendoffile_test2, "file_io/SetEndOfFile/test2/paltest_setendoffile_test2") { HANDLE hFile = NULL; DWORD dwByteCount = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/testinfo.dat deleted file mode 100644 index 1debf06544ce..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetEndOfFile -Name = Positive Test for SetEndOfFile -Type = DEFAULT -EXE1 = setendoffile -Description -=Truncate the test file using SetEndOfFile diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/CMakeLists.txt deleted file mode 100644 index e9cb6036a831..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetEndOfFile.cpp -) - -add_executable(paltest_setendoffile_test3 - ${SOURCES} -) - -add_dependencies(paltest_setendoffile_test3 coreclrpal) - -target_link_libraries(paltest_setendoffile_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.cpp index c7598d32b7f2..3d30a6a39ac6 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.cpp @@ -15,10 +15,10 @@ #include -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetEndOfFile_test3_paltest_setendoffile_test3, "file_io/SetEndOfFile/test3/paltest_setendoffile_test3") { HANDLE hFile = NULL; DWORD dwByteCount = 0; @@ -59,7 +59,7 @@ int __cdecl main(int argc, char *argv[]) Trace("SetEndOfFile: ERROR -> Unable to close file \"%s\".\n", szTextFile); } - PAL_Terminate(); + PAL_TerminateEx(FAIL); return FAIL; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/testinfo.dat deleted file mode 100644 index c6156af4ff9a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetEndOfFile -Name = Positive Test for SetEndOfFile -Type = DEFAULT -EXE1 = setendoffile -Description -=Set the end of file past the actual end -=of file thereby, extending it. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/CMakeLists.txt deleted file mode 100644 index 439d184f97dc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - setendoffile.cpp -) - -add_executable(paltest_setendoffile_test4 - ${SOURCES} -) - -add_dependencies(paltest_setendoffile_test4 coreclrpal) - -target_link_libraries(paltest_setendoffile_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.cpp index 66530513f9d4..f4da80135d24 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.cpp @@ -16,8 +16,8 @@ #include -const char* szStringTest = "The quick fox jumped over the lazy dog's back."; -const char* szTextFile = "test.tmp"; +#define szStringTest "The quick fox jumped over the lazy dog's back." +#define szTextFile "test.tmp" static void Cleanup(HANDLE hFile) { @@ -89,7 +89,7 @@ static void DoTest(HANDLE hFile, DWORD dwOffset, DWORD dwMethod) } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_SetEndOfFile_test4_paltest_setendoffile_test4, "file_io/SetEndOfFile/test4/paltest_setendoffile_test4") { HANDLE hFile = NULL; DWORD dwBytesWritten; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/testinfo.dat deleted file mode 100644 index 74236b5df6a1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetEndOfFile -Name = Positive Test for SetEndOfFile (test 4) -Type = DEFAULT -EXE1 = setendoffile -Description -= Tests the PAL implementation of the SetEndOfFile function. -= Verify that the file pointer is the same before -= and after a SetEndOfFile using SetFilePointer with -= FILE_BEGIN, FILE_CURRENT and FILE_END diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/CMakeLists.txt deleted file mode 100644 index d329a7f60fb0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_setendoffile_test5 - ${SOURCES} -) - -add_dependencies(paltest_setendoffile_test5 coreclrpal) - -target_link_libraries(paltest_setendoffile_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.cpp index f7c6e3c10410..8af9bccc7988 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_SetEndOfFile_test5_paltest_setendoffile_test5, "file_io/SetEndOfFile/test5/paltest_setendoffile_test5") { HANDLE hFile = NULL; DWORD dwBytesWritten; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/testinfo.dat deleted file mode 100644 index 169561ae31e0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetEndOfFile -Name = Positive Test for SetEndOfFile -Type = DEFAULT -EXE1 = test5 -Description -= Tests the PAL implementation of the SetEndOfFile function. -= Test attempts to set the end of file pointer to a position -= which has data before and after it. Then it attempts to -= read text beyond the end of file pointer. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/CMakeLists.txt deleted file mode 100644 index 7cd88f8e86da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/CMakeLists.txt deleted file mode 100644 index 698768d6ec29..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetFilePointer.cpp -) - -add_executable(paltest_setfilepointer_test1 - ${SOURCES} -) - -add_dependencies(paltest_setfilepointer_test1 coreclrpal) - -target_link_libraries(paltest_setfilepointer_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.cpp index 6c421bf7e932..b19f174d57d9 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.cpp @@ -15,10 +15,10 @@ #include -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetFilePointer_test1_paltest_setfilepointer_test1, "file_io/SetFilePointer/test1/paltest_setfilepointer_test1") { HANDLE hFile = NULL; DWORD dwByteCount = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/testinfo.dat deleted file mode 100644 index 769fe0173d09..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetFilePointer -Name = Test for SetFilePointer (test 1) -Type = DEFAULT -EXE1 = setfilepointer -Description -=Set the file pointer on a NULL file handle and other invalid options - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/CMakeLists.txt deleted file mode 100644 index fa25357ec18d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetFilePointer.cpp -) - -add_executable(paltest_setfilepointer_test2 - ${SOURCES} -) - -add_dependencies(paltest_setfilepointer_test2 coreclrpal) - -target_link_libraries(paltest_setfilepointer_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.cpp index 073703e644eb..1167f229c4c6 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.cpp @@ -24,10 +24,10 @@ const char * const szText = "The quick brown fox jumped over the lazy dog's back."; -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetFilePointer_test2_paltest_setfilepointer_test2, "file_io/SetFilePointer/test2/paltest_setfilepointer_test2") { HANDLE hFile = NULL; DWORD dwByteCount = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/testinfo.dat deleted file mode 100644 index 5e328c6565c1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetFilePointer -Name = Positive Test for SetFilePointer (test 2) -Type = DEFAULT -EXE1 = setfilepointer -Description -=Tests the FILE_BEGIN option - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/CMakeLists.txt deleted file mode 100644 index cf0b9ddec643..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetFilePointer.cpp -) - -add_executable(paltest_setfilepointer_test3 - ${SOURCES} -) - -add_dependencies(paltest_setfilepointer_test3 coreclrpal) - -target_link_libraries(paltest_setfilepointer_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.cpp index 1ba13e525314..8c230996322a 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.cpp @@ -24,10 +24,10 @@ const char* const szText = "The quick brown fox jumped over the lazy dog's back."; -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetFilePointer_test3_paltest_setfilepointer_test3, "file_io/SetFilePointer/test3/paltest_setfilepointer_test3") { HANDLE hFile = NULL; DWORD dwByteCount = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/testinfo.dat deleted file mode 100644 index 934aad656f1d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetFilePointer -Name = Positive Test for SetFilePointer (test 3) -Type = DEFAULT -EXE1 = setfilepointer -Description -=Tests the FILE_CURRENT option - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/CMakeLists.txt deleted file mode 100644 index 35c0ee9f0e21..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetFilePointer.cpp -) - -add_executable(paltest_setfilepointer_test4 - ${SOURCES} -) - -add_dependencies(paltest_setfilepointer_test4 coreclrpal) - -target_link_libraries(paltest_setfilepointer_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.cpp index 12e13ca62085..9294886be11d 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.cpp @@ -23,10 +23,10 @@ #include const char* szText = "The quick brown fox jumped over the lazy dog's back."; -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetFilePointer_test4_paltest_setfilepointer_test4, "file_io/SetFilePointer/test4/paltest_setfilepointer_test4") { HANDLE hFile = NULL; DWORD dwByteCount = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/testinfo.dat deleted file mode 100644 index 0195673da772..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test4/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetFilePointer -Name = Positive Test for SetFilePointer (test 4) -Type = DEFAULT -EXE1 = setfilepointer -Description -=Tests the FILE_END option - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/CMakeLists.txt deleted file mode 100644 index a384a1488c8a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetFilePointer.cpp -) - -add_executable(paltest_setfilepointer_test5 - ${SOURCES} -) - -add_dependencies(paltest_setfilepointer_test5 coreclrpal) - -target_link_libraries(paltest_setfilepointer_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.cpp index c1c531d19716..d2f8911b4b58 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.cpp @@ -22,9 +22,9 @@ #include -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetFilePointer_test5_paltest_setfilepointer_test5, "file_io/SetFilePointer/test5/paltest_setfilepointer_test5") { HANDLE hFile = NULL; DWORD dwOffset = 1; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/testinfo.dat deleted file mode 100644 index baed91d6b763..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test5/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetFilePointer -Name = Positive Test for SetFilePointer (test 5) -Type = DEFAULT -EXE1 = setfilepointer -Description -=Tests the FILE_BEGIN option with the high word parameter. -=This test requires about 4 gig free disk space - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/CMakeLists.txt deleted file mode 100644 index b7b8dbae2aad..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetFilePointer.cpp -) - -add_executable(paltest_setfilepointer_test6 - ${SOURCES} -) - -add_dependencies(paltest_setfilepointer_test6 coreclrpal) - -target_link_libraries(paltest_setfilepointer_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.cpp index 5b48da950b92..69fe23373fda 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.cpp @@ -22,10 +22,10 @@ #include -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetFilePointer_test6_paltest_setfilepointer_test6, "file_io/SetFilePointer/test6/paltest_setfilepointer_test6") { HANDLE hFile = NULL; DWORD dwOffset = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/testinfo.dat deleted file mode 100644 index 1f292b886f11..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test6/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetFilePointer -Name = Positive Test for SetFilePointer (test 6) -Type = DEFAULT -EXE1 = setfilepointer -Description -=Tests the FILE_CURRENT option with the high word parameter. -=This test requires about 4 GB free disk space. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/CMakeLists.txt deleted file mode 100644 index 6596afadbf2d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SetFilePointer.cpp -) - -add_executable(paltest_setfilepointer_test7 - ${SOURCES} -) - -add_dependencies(paltest_setfilepointer_test7 coreclrpal) - -target_link_libraries(paltest_setfilepointer_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.cpp index d7d4d37b6214..3230a215f73d 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.cpp @@ -22,10 +22,10 @@ #include -const char* szTextFile = "text.txt"; -int __cdecl main(int argc, char *argv[]) + +PALTEST(file_io_SetFilePointer_test7_paltest_setfilepointer_test7, "file_io/SetFilePointer/test7/paltest_setfilepointer_test7") { HANDLE hFile = NULL; DWORD dwOffset = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/testinfo.dat deleted file mode 100644 index 1a9b5fb2b672..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/SetFilePointer/test7/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = SetFilePointer -Name = Positive Test for SetFilePointer (test 7) -Type = DEFAULT -EXE1 = setfilepointer -Description -=Tests the FILE_END option with the high word parameter -=This test requires about 4 GB of free disk space. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/CMakeLists.txt deleted file mode 100644 index dcf480bf226b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/CMakeLists.txt deleted file mode 100644 index 4a02596986ab..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - WriteFile.cpp -) - -add_executable(paltest_writefile_test1 - ${SOURCES} -) - -add_dependencies(paltest_writefile_test1 coreclrpal) - -target_link_libraries(paltest_writefile_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.cpp index cc805ccf9ff6..8664c9e0c987 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.cpp @@ -15,9 +15,10 @@ #include -const char* szStringTest = "The quick fox jumped over the lazy dog's back."; -const char* szReadOnlyFile = "ReadOnly.txt"; -void do_cleanup() +#define szStringTest "The quick fox jumped over the lazy dog's back." +#define szReadOnlyFile "ReadOnly.txt" + +void do_cleanup_WriteFile_test1() { BOOL bRc = FALSE; bRc = DeleteFileA(szReadOnlyFile); @@ -29,7 +30,7 @@ void do_cleanup() } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_WriteFile_test1_paltest_writefile_test1, "file_io/WriteFile/test1/paltest_writefile_test1") { HANDLE hFile = NULL; DWORD dwBytesWritten; @@ -78,7 +79,7 @@ int __cdecl main(int argc, char *argv[]) { last_error = GetLastError(); Trace("WriteFile: ERROR[%ld] -> Unable to make the file read-only.\n", last_error); - do_cleanup(); + do_cleanup_WriteFile_test1(); Fail("WriteFile: ERROR[%ld] -> Unable to make the file read-only.\n", last_error); } @@ -86,7 +87,7 @@ int __cdecl main(int argc, char *argv[]) if (bRc == TRUE) { last_error = GetLastError(); Trace("WriteFile: ERROR[%ld] -> Able to write to a read-only file.\n", last_error); - do_cleanup(); + do_cleanup_WriteFile_test1(); Fail("WriteFile: ERROR[%ld] -> Able to write to a read-only file.\n", last_error); } @@ -95,7 +96,7 @@ int __cdecl main(int argc, char *argv[]) if (bRc != TRUE) { last_error = GetLastError(); Trace("WriteFile: ERROR[%ld] -> Unable to close file \"%s\".\n", last_error, szReadOnlyFile); - do_cleanup(); + do_cleanup_WriteFile_test1(); Fail("WriteFile: ERROR -> Unable to close file \"%s\".\n", szReadOnlyFile); } @@ -107,7 +108,7 @@ int __cdecl main(int argc, char *argv[]) Fail("WriteFile: ERROR[%ld] -> Unable to make the file attribute NORMAL.\n", last_error); } - do_cleanup(); + do_cleanup_WriteFile_test1(); PAL_Terminate(); return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/testinfo.dat deleted file mode 100644 index 72ec21f55ade..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = WriteFile -Name = test for WriteFile -Type = DEFAULT -EXE1 = writefile -Description -=Attempt to write to a NULL handle and to a read-only file - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/CMakeLists.txt deleted file mode 100644 index 844c0b19620c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - WriteFile.cpp -) - -add_executable(paltest_writefile_test2 - ${SOURCES} -) - -add_dependencies(paltest_writefile_test2 coreclrpal) - -target_link_libraries(paltest_writefile_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp index 593b1667fd5e..463e6744b443 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp @@ -16,12 +16,12 @@ #include -char* writeBuffer; -const char* szWritableFile = "Writeable.txt"; -const char* szResultsFile = "Results.txt"; +char* writeBuffer_WriteFile_test2; +#define szWritableFile "Writeable.txt" +#define szResultsFile "Results.txt" const int PAGESIZE = 4096; -BOOL writeTest(DWORD dwByteCount, DWORD dwBytesWrittenResult, BOOL bResult) +BOOL writeTest_WriteFile_test2(DWORD dwByteCount, DWORD dwBytesWrittenResult, BOOL bResult) { HANDLE hFile = NULL; DWORD dwBytesWritten; @@ -39,7 +39,7 @@ BOOL writeTest(DWORD dwByteCount, DWORD dwBytesWrittenResult, BOOL bResult) return FALSE; } - bRc = WriteFile(hFile, writeBuffer, dwByteCount, &dwBytesWritten, NULL); + bRc = WriteFile(hFile, writeBuffer_WriteFile_test2, dwByteCount, &dwBytesWritten, NULL); CloseHandle(hFile); if ((bRc != bResult) || (dwBytesWrittenResult != dwBytesWritten)) @@ -53,7 +53,7 @@ BOOL writeTest(DWORD dwByteCount, DWORD dwBytesWrittenResult, BOOL bResult) return TRUE; } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_WriteFile_test2_paltest_writefile_test2, "file_io/WriteFile/test2/paltest_writefile_test2") { const char * testString = "The quick fox jumped over the lazy dog's back."; const int testStringLen = strlen(testString); @@ -72,19 +72,19 @@ int __cdecl main(int argc, char *argv[]) return FAIL; } - /* allocate read-write memery for writeBuffer */ - if (!(writeBuffer = (char*) VirtualAlloc(NULL, BUFFER_SIZE, MEM_COMMIT, + /* allocate read-write memery for writeBuffer_WriteFile_test2 */ + if (!(writeBuffer_WriteFile_test2 = (char*) VirtualAlloc(NULL, BUFFER_SIZE, MEM_COMMIT, PAGE_READWRITE))) { Fail("VirtualAlloc failed: GetLastError returns %d\n", GetLastError()); return FAIL; } - memset((void*) writeBuffer, '.', BUFFER_SIZE); - strcpy(writeBuffer, testString); + memset((void*) writeBuffer_WriteFile_test2, '.', BUFFER_SIZE); + strcpy(writeBuffer_WriteFile_test2, testString); - /* write protect the second page of writeBuffer */ - if (!VirtualProtect(&writeBuffer[PAGESIZE], PAGESIZE, PAGE_NOACCESS, &oldProt)) + /* write protect the second page of writeBuffer_WriteFile_test2 */ + if (!VirtualProtect(&writeBuffer_WriteFile_test2[PAGESIZE], PAGESIZE, PAGE_NOACCESS, &oldProt)) { Fail("VirtualProtect failed: GetLastError returns %d\n", GetLastError()); return FAIL; @@ -92,7 +92,7 @@ int __cdecl main(int argc, char *argv[]) for (j = 0; j< 4; j++) { - bRc = writeTest(dwByteCount[j], dwByteWritten[j], bResults[j]); + bRc = writeTest_WriteFile_test2(dwByteCount[j], dwByteWritten[j], bResults[j]); if (bRc != TRUE) { Fail("WriteFile: ERROR -> Failed on test[%d]\n", j); diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/testinfo.dat deleted file mode 100644 index 94d2db8b488b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = WriteFile -Name = Positive Test for WriteFile -Type = DEFAULT -EXE1 = writefile -Description -=Multiple tests of writes of varying sizes with verification - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/CMakeLists.txt deleted file mode 100644 index 128d52a67c9e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - WriteFile.cpp -) - -add_executable(paltest_writefile_test3 - ${SOURCES} -) - -add_dependencies(paltest_writefile_test3 coreclrpal) - -target_link_libraries(paltest_writefile_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.cpp index 672a10e16eca..ec51d5d5c88a 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.cpp @@ -15,11 +15,11 @@ #include -const char* szStringTest = "The quick fox jumped over the lazy dog's back.\0"; -const char* szWritableFile = "writeable.txt"; +#define szStringTest "The quick fox jumped over the lazy dog's back.\0" +#define szWritableFile "writeable.txt" -BOOL validateResults(const char* szString) +BOOL validateResults_WriteFile_test3(const char* szString) { FILE *pFile = NULL; char szReadString[100]; @@ -58,7 +58,7 @@ BOOL validateResults(const char* szString) -BOOL writeTest(const char* szString) +BOOL writeTest_WriteFile_test3(const char* szString) { HANDLE hFile = NULL; DWORD dwBytesWritten; @@ -104,7 +104,7 @@ BOOL writeTest(const char* szString) } else { - return (validateResults(szString)); + return (validateResults_WriteFile_test3(szString)); } return TRUE; @@ -113,7 +113,7 @@ BOOL writeTest(const char* szString) -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_WriteFile_test3_paltest_writefile_test3, "file_io/WriteFile/test3/paltest_writefile_test3") { const char *pString = szStringTest; BOOL bRc = FALSE; @@ -124,7 +124,7 @@ int __cdecl main(int argc, char *argv[]) } - bRc = writeTest(pString); + bRc = writeTest_WriteFile_test3(pString); if (bRc != TRUE) { Fail("WriteFile: ERROR -> Failed\n"); diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/testinfo.dat deleted file mode 100644 index cba76f89a390..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = WriteFile -Name = Positive Test for WriteFile -Type = DEFAULT -EXE1 = writefile -Description -=Multiple consecutive writes to a file with verification - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/CMakeLists.txt deleted file mode 100644 index 68327e29c8ce..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - writefile.cpp -) - -add_executable(paltest_writefile_test4 - ${SOURCES} -) - -add_dependencies(paltest_writefile_test4 coreclrpal) - -target_link_libraries(paltest_writefile_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/testinfo.dat deleted file mode 100644 index f3627273f758..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = WriteFile -Name = Positive Test for WriteFile -Type = DEFAULT -EXE1 = writefile -Description -= writes to a file at different locations with verification - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.cpp index 4eb2b20ee013..34ab48103533 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.cpp @@ -24,7 +24,7 @@ #include -BOOL CleanUp(HANDLE hFile, const char * fileName) +BOOL CleanUp_WriteFile_test4(HANDLE hFile, const char * fileName) { BOOL bRc = TRUE; if (CloseHandle(hFile) != TRUE) @@ -42,7 +42,7 @@ BOOL CleanUp(HANDLE hFile, const char * fileName) return bRc; } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_WriteFile_test4_paltest_writefile_test4, "file_io/WriteFile/test4/paltest_writefile_test4") { const char* szStringTest = "1234567890"; const char* szWritableFile = "writeable.txt"; @@ -80,14 +80,14 @@ int __cdecl main(int argc, char *argv[]) { Trace("WriteFile: ERROR -> Unable to write to file error: %ld \n", GetLastError()); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test4(hFile,szWritableFile); Fail(""); } if(!FlushFileBuffers(hFile)) { Trace("WriteFile: ERROR -> Call to FlushFile Buffers failed " "error %ld \n",GetLastError()); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test4(hFile,szWritableFile); Fail(""); } @@ -97,7 +97,7 @@ int __cdecl main(int argc, char *argv[]) Trace("WriteFile: ERROR -> writing %u chars to empty file " "caused its size to become %u\n",strlen(szStringTest), GetFileSize(hFile, NULL)); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test4(hFile,szWritableFile); Fail(""); } @@ -120,7 +120,7 @@ int __cdecl main(int argc, char *argv[]) Trace("WriteFile: ERROR -> Unable to write to file after " " moiving the file poiner to 5 error: %ld \n", GetLastError()); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test4(hFile,szWritableFile); Fail(""); } @@ -129,7 +129,7 @@ int __cdecl main(int argc, char *argv[]) { Trace("WriteFile: ERROR -> Call to FlushFile Buffers failed " "error %ld \n",GetLastError()); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test4(hFile,szWritableFile); Fail(""); } @@ -140,11 +140,11 @@ int __cdecl main(int argc, char *argv[]) "sitting the file pointer to 5 resulted in wrong file size; " "Expected %u resulted %u.",strlen(szStringTest), (strlen(szStringTest)+5),GetFileSize(hFile, NULL)); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test4(hFile,szWritableFile); Fail(""); } - if (!CleanUp(hFile,szWritableFile)) + if (!CleanUp_WriteFile_test4(hFile,szWritableFile)) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/CMakeLists.txt deleted file mode 100644 index dbb06ddf4874..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - writefile.cpp -) - -add_executable(paltest_writefile_test5 - ${SOURCES} -) - -add_dependencies(paltest_writefile_test5 coreclrpal) - -target_link_libraries(paltest_writefile_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/testinfo.dat deleted file mode 100644 index 5f7239927681..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = WriteFile -Name = Positive Test for WriteFile -Type = DEFAULT -EXE1 = writefile -Description -= write lots of data to a file. then check with -= GetFileSize -= This test is disabled due to its time overhead. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.cpp index e1ddf22ad4db..a9f1af7baa8d 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.cpp @@ -21,7 +21,7 @@ #include -BOOL CleanUp(HANDLE hFile, const char * fileName) +BOOL CleanUp_WriteFile_test5(HANDLE hFile, const char * fileName) { BOOL bRc = TRUE; if (CloseHandle(hFile) != TRUE) @@ -40,7 +40,7 @@ BOOL CleanUp(HANDLE hFile, const char * fileName) } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_WriteFile_test5_paltest_writefile_test5, "file_io/WriteFile/test5/paltest_writefile_test5") { HANDLE hFile = NULL; @@ -81,7 +81,7 @@ int __cdecl main(int argc, char *argv[]) { Trace("WriteFile: ERROR -> Unable to write to file error: %ld \n", GetLastError()); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test5(hFile,szWritableFile); Fail(""); } @@ -91,7 +91,7 @@ int __cdecl main(int argc, char *argv[]) { Trace("WriteFile: ERROR -> Call to FlushFileBuffers failed" "error %ld \n",GetLastError()); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test5(hFile,szWritableFile); Fail(""); } @@ -101,12 +101,12 @@ int __cdecl main(int argc, char *argv[]) Trace("WriteFile: ERROR -> file size did not change properly" " after writing 4000 000 chars to it ( size= %u )\n", GetFileSize(hFile,NULL)); - CleanUp(hFile,szWritableFile); + CleanUp_WriteFile_test5(hFile,szWritableFile); Fail(""); } - if (!CleanUp(hFile,szWritableFile)) + if (!CleanUp_WriteFile_test5(hFile,szWritableFile)) { Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/CMakeLists.txt deleted file mode 100644 index f50f97a58511..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_errorpathnotfound_test1 - ${SOURCES} -) - -add_dependencies(paltest_errorpathnotfound_test1 coreclrpal) - -target_link_libraries(paltest_errorpathnotfound_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.cpp index 8a2654b1193c..fa624a352e7d 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.cpp @@ -36,7 +36,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_errorpathnotfound_test1_paltest_errorpathnotfound_test1, "file_io/errorpathnotfound/test1/paltest_errorpathnotfound_test1") { diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/testinfo.dat deleted file mode 100644 index 761ca9aed2bc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/testinfo.dat +++ /dev/null @@ -1,30 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. - -# The .NET Foundation licenses this file to you under the MIT license. - - - - - -Version = 1.0 - -Section = file_io - -Function = some File_io functions - -Name = errorpathnotfound - checking GetLastError. - -Type = DEFAULT - -EXE1 = test1 - -Description - -= Test the return value of GetLastError() after calling - -= some file_io functions with an invalid path. - -= Functions covered by this test are: - -= CopyFile, CreateFile and DeleteFile. - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/CMakeLists.txt deleted file mode 100644 index 277855a74b70..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_errorpathnotfound_test2 - ${SOURCES} -) - -add_dependencies(paltest_errorpathnotfound_test2 coreclrpal) - -target_link_libraries(paltest_errorpathnotfound_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.cpp index b6a439a5786c..927f800c1e43 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.cpp @@ -38,7 +38,7 @@ -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_errorpathnotfound_test2_paltest_errorpathnotfound_test2, "file_io/errorpathnotfound/test2/paltest_errorpathnotfound_test2") { diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/testinfo.dat deleted file mode 100644 index 1b04b9766f25..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/testinfo.dat +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. - -# The .NET Foundation licenses this file to you under the MIT license. - - - - -Version = 1.0 - -Section = file_io - -Function = some File_io functions - -Name = errorpathnotfound - checking GetLastError. - -Type = DEFAULT - -EXE1 = test2 - -Description - -= Test the return value of GetLastError() after calling - -= some file_io functions with an invalid path. - -= Functions covered by this test are: - -= FindFirstFileA, FindFirstFileW, - -= GetFileAttributesA, GetFileAttributesW, - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/CMakeLists.txt deleted file mode 100644 index 6b8473aa5294..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - gettemppatha.cpp -) - -add_executable(paltest_gettemppatha_test1 - ${SOURCES} -) - -add_dependencies(paltest_gettemppatha_test1 coreclrpal) - -target_link_libraries(paltest_gettemppatha_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.cpp b/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.cpp index 55ca7db7ca4e..30845d788a46 100644 --- a/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.cpp +++ b/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.cpp @@ -62,7 +62,7 @@ static void SetAndCheckLength(CHAR tmpDirPath[], int bufferLength, int expectedR } } -int __cdecl main(int argc, char *argv[]) +PALTEST(file_io_gettemppatha_test1_paltest_gettemppatha_test1, "file_io/gettemppatha/test1/paltest_gettemppatha_test1") { if (0 != PAL_Initialize(argc,argv)) { diff --git a/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/testinfo.dat deleted file mode 100644 index 700a0c72c1e2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/file_io/gettemppatha/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = file_io -Function = GetTempPathA -Name = Test for GetTempPathA (test 1) -Type = DEFAULT -EXE1 = gettemppatha -Description -= Calls GetTempPathA and verifies by passing the returned -= value to CreateDirectoryA. If the returned path exists, -= CreateDirectoryA will fail. - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt deleted file mode 100644 index 90da8e58f7fd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -add_subdirectory(CreateFileMappingA) -add_subdirectory(CreateFileMappingW) -add_subdirectory(FreeLibrary) -add_subdirectory(FreeLibraryAndExitThread) -add_subdirectory(GetModuleFileNameA) -add_subdirectory(GetModuleFileNameW) -add_subdirectory(GetProcAddress) -add_subdirectory(LocalAlloc) -add_subdirectory(LocalFree) -add_subdirectory(MapViewOfFile) -add_subdirectory(OpenFileMappingA) -add_subdirectory(OpenFileMappingW) -add_subdirectory(ProbeMemory) -add_subdirectory(UnmapViewOfFile) -add_subdirectory(VirtualAlloc) -add_subdirectory(VirtualFree) -add_subdirectory(VirtualProtect) -add_subdirectory(VirtualQuery) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/CMakeLists.txt deleted file mode 100644 index 6d92806060a9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CMakeLists.txt deleted file mode 100644 index d7d18920c350..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMapping.cpp -) - -add_executable(paltest_createfilemappinga_test1 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappinga_test1 coreclrpal) - -target_link_libraries(paltest_createfilemappinga_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.cpp deleted file mode 100644 index 6462b8022a75..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.cpp +++ /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. - -/*============================================================= -** -** Source: createfilemapping.c (test 1) -** -** Purpose: Positive test the CreateFileMapping API. -** Call CreateFileMapping with access PAGE_READONLY. -** -** -**============================================================*/ -#include - -const int MAPPINGSIZE = 2048; - -int __cdecl main(int argc, char *argv[]) -{ - - HANDLE hFile; - char buf[] = "this is a test string"; - char ch[2048]; - char lpFileName[] = "test.tmp"; - DWORD dwBytesWritten; - BOOL err; - int RetVal = PASS; - - HANDLE hFileMapping; - LPVOID lpMapViewAddress; - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Create a file handle with CreateFile. - */ - hFile = CreateFile( lpFileName, - GENERIC_WRITE|GENERIC_READ, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - Fail("ERROR: %u :unable to create file \"%s\".\n", - GetLastError(), - lpFileName); - } - - /* Initialize the buffers. - */ - memset(ch, 0, MAPPINGSIZE); - - /* Write to the File handle. - */ - err = WriteFile(hFile, - buf, - strlen(buf), - &dwBytesWritten, - NULL); - - if (err == FALSE) - { - Trace("ERROR: %u :unable to write to file handle " - "hFile=0x%lx\n", - GetLastError(), - hFile); - RetVal = FAIL; - goto CleanUpOne; - } - - /* Flush to the hard-drive. - */ - FlushFileBuffers(hFile); - - /* Create a unnamed file-mapping object with file handle FileHandle - * and with PAGE_READWRITE protection. - */ - hFileMapping = CreateFileMapping( - hFile, - NULL, /*not inherited*/ - PAGE_READONLY, /*read and wite*/ - 0, /*high-order size*/ - 0, /*low-order size*/ - NULL); /*unnamed object*/ - - if(NULL == hFileMapping) - { - Trace("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpOne; - } - - /* maps a view of a file into the address space of the calling process. - */ - lpMapViewAddress = MapViewOfFile( - hFileMapping, - FILE_MAP_READ, /* access code */ - 0, /*high order offset*/ - 0, /*low order offset*/ - 0); /* number of bytes for map */ - - if(NULL == lpMapViewAddress) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* Copy the MapViewOfFile to buffer, so we can - * compare with value read from file directly. - */ - memcpy(ch, (LPCSTR)lpMapViewAddress, MAPPINGSIZE); - if (memcmp(ch, buf, strlen(buf))!= 0) - { - Trace("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - ch, buf); - RetVal = FAIL; - goto CleanUpThree; - } - -CleanUpThree: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewAddress) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewAddress); - RetVal = FAIL; - } - -CleanUpTwo: - - /* Close Handle to opend file mapping. - */ - if ( CloseHandle(hFileMapping) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFileMapping); - RetVal = FAIL; - } - -CleanUpOne: - - /* Close Handle to create file mapping. - */ - if ( CloseHandle(hFile) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFile); - RetVal = FAIL; - } - - /* Terminate the PAL. - */ - PAL_TerminateEx(RetVal); - return RetVal; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/testinfo.dat deleted file mode 100644 index 0fd5e3429be7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA with PAGE_READONLY -TYPE = DEFAULT -EXE1 = createfilemapping -Description -=Test the CreateFileMapping to create a named file-mapping object -=and with PAGE_READONLY protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CMakeLists.txt deleted file mode 100644 index 25877fbbccd7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMapping.cpp -) - -add_executable(paltest_createfilemappinga_test3 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappinga_test3 coreclrpal) - -target_link_libraries(paltest_createfilemappinga_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.cpp deleted file mode 100644 index bbf75296e057..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: createfilemapping.c (test 3) -** -** Purpose: Positive test the CreateFileMapping API. -** Call CreateFileMapping with access PAGE_READWRITE. -** -** -**============================================================*/ -#include - -const int MAPPINGSIZE = 2048; - -int __cdecl main(int argc, char *argv[]) -{ - - HANDLE hFile; - char buf[] = "this is a test string"; - char ch[2048]; - char lpFileName[] = "test.tmp"; - HANDLE hFileMapping; - LPVOID lpMapViewAddress; - int RetVal = PASS; - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Create a file handle with CreateFile. - */ - hFile = CreateFile( lpFileName, - GENERIC_WRITE|GENERIC_READ, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - Fail("ERROR: %u :unable to create file \"%s\".\n", - GetLastError(), - lpFileName); - } - - /* Initialize the buffers. - */ - memset(ch, 0, MAPPINGSIZE); - - /* Create a unnamed file-mapping object with file handle FileHandle - * and with PAGE_READWRITE protection. - */ - hFileMapping = CreateFileMapping( - hFile, - NULL, /*not inherited*/ - PAGE_READWRITE, /*read and wite*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - NULL); /*unnamed object*/ - - if(NULL == hFileMapping) - { - Trace("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpOne; - } - - /* maps a view of a file into the address space of the calling process. - */ - lpMapViewAddress = MapViewOfFile( - hFileMapping, - FILE_MAP_ALL_ACCESS, /* access code */ - 0, /*high order offset*/ - 0, /*low order offset*/ - MAPPINGSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewAddress) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* Write to the Map view. - */ - memcpy(lpMapViewAddress, buf, strlen(buf)); - - /* Read from the Map view. - */ - memcpy(ch, (LPCSTR)lpMapViewAddress, MAPPINGSIZE); - - /* Copy the MapViewOfFile to buffer, so we can - * compare with value read from file directly. - */ - if (memcmp(ch, buf, strlen(buf))!= 0) - { - Trace("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - ch, buf); - RetVal = FAIL; - goto CleanUpThree; - } - -CleanUpThree: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewAddress) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewAddress); - RetVal = FAIL; - } - -CleanUpTwo: - - /* Close Handle to opend file mapping. - */ - if ( CloseHandle(hFileMapping) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFileMapping); - RetVal = FAIL; - } - -CleanUpOne: - - /* Close Handle to create file mapping. - */ - if ( CloseHandle(hFile) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFile); - RetVal = FAIL; - } - - /* Terminate the PAL. - */ - PAL_TerminateEx(RetVal); - return RetVal; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/testinfo.dat deleted file mode 100644 index c393f0777d94..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA with PAGE_READWRITE -TYPE = DEFAULT -EXE1 = createfilemapping -Description -=Test the CreateFileMapping to create a unnamed file-mapping object -=and with PAGE_READWRITE protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CMakeLists.txt deleted file mode 100644 index 566abe34ba22..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMapping.cpp -) - -add_executable(paltest_createfilemappinga_test4 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappinga_test4 coreclrpal) - -target_link_libraries(paltest_createfilemappinga_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.cpp deleted file mode 100644 index a5fd1c8a0a30..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.cpp +++ /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. - -/*============================================================= -** -** Source: createfilemapping.c (test 4) -** -** Purpose: Positive test the CreateFileMapping API. -** Call CreateFileMapping with access PAGE_WRITECOPY. -** -** -**============================================================*/ -#include - -const int MAPPINGSIZE = 2048; - -int __cdecl main(int argc, char *argv[]) -{ - - HANDLE hFile; - char buf[] = "this is a test string"; - char ch[2048]; - char lpFileName[] = "test.tmp"; - HANDLE hFileMapping; - LPVOID lpMapViewAddress; - int RetVal = PASS; - int err; - DWORD dwBytesWritten; - - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Create a file handle with CreateFile. - */ - hFile = CreateFile( lpFileName, - GENERIC_WRITE|GENERIC_READ, - FILE_SHARE_READ|FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - Fail("ERROR: %u :unable to create file \"%s\".\n", - GetLastError(), - lpFileName); - } - - /* Write to the File handle. - */ - err = WriteFile(hFile, - buf, - strlen(buf), - &dwBytesWritten, - NULL); - - if (err == FALSE) - { - Trace("ERROR: %u :unable to write to file handle " - "hFile=0x%lx\n", - GetLastError(), - hFile); - RetVal = FAIL; - goto CleanUpOne; - } - - /* Flush to the hard-drive. - */ - FlushFileBuffers(hFile); - - /* Initialize the buffers. - */ - memset(ch, 0, MAPPINGSIZE); - - /* Create a unnamed file-mapping object with file handle FileHandle - * and with PAGE_WRITECOPY protection. - */ - hFileMapping = CreateFileMapping( - hFile, - NULL, /*not inherited*/ - PAGE_WRITECOPY, /*write copy*/ - 0, /*high-order size*/ - 0, /*low-order size*/ - NULL); /*unnamed object*/ - - if(NULL == hFileMapping) - { - Trace("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpOne; - } - - /* maps a view of a file into the address space of the calling process. - */ - lpMapViewAddress = MapViewOfFile( - hFileMapping, - FILE_MAP_COPY, /* access code */ - 0, /* high order offset*/ - 0, /* low order offset*/ - 0); /* number of bytes for map */ - - if(NULL == lpMapViewAddress) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* Write to the Map view.3 - */ - memcpy(lpMapViewAddress, buf, strlen(buf)); - - /* Read from the Map view. - */ - memcpy(ch, (LPCSTR)lpMapViewAddress, MAPPINGSIZE); - - /* Copy the MapViewOfFile to buffer, so we can - * compare with value read from file directly. - */ - if (memcmp(ch, buf, strlen(buf))!= 0) - { - Trace("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - ch, buf); - RetVal = FAIL; - goto CleanUpThree; - } - -CleanUpThree: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewAddress) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewAddress); - RetVal = FAIL; - } - -CleanUpTwo: - - /* Close Handle to opend file mapping. - */ - if ( CloseHandle(hFileMapping) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFileMapping); - RetVal = FAIL; - } - -CleanUpOne: - - /* Close Handle to create file mapping. - */ - if ( CloseHandle(hFile) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFile); - RetVal = FAIL; - } - - /* Terminate the PAL. - */ - PAL_TerminateEx(RetVal); - return RetVal; -} - - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/testinfo.dat deleted file mode 100644 index eab2b3cd7bf1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA with PAGE_WRITECOPY. -TYPE = DEFAULT -EXE1 = createfilemapping -Description -= Positive test the CreateFileMapping API. -= Call CreateFileMapping with access PAGE_WRITECOPY. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CMakeLists.txt deleted file mode 100644 index 4cd40531187c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMapping.cpp -) - -add_executable(paltest_createfilemappinga_test5 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappinga_test5 coreclrpal) - -target_link_libraries(paltest_createfilemappinga_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.cpp deleted file mode 100644 index 3d17532eeca4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.cpp +++ /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. - -/*============================================================= -** -** Source: createfilemapping.c (test 5) -** -** Purpose: Positive test the CreateFileMapping API. -** Test CreateFileMapping to a "swap" handle with -** access PAGE_READONLY. -** -** -**============================================================*/ -#include - -const int MAPPINGSIZE = 2048; -HANDLE SWAP_HANDLE = ((VOID *)(-1)); - -int __cdecl main(int argc, char *argv[]) -{ - char testString[] = "this is a test string"; - char lpObjectName[] = "myMappingObject"; - int RetVal = FAIL; - char results[2048]; - - HANDLE hFileMapRO; - HANDLE hFileMapRW; - LPVOID lpMapViewRO; - LPVOID lpMapViewRW; - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Initialize the buffers. - */ - memset(results, 0, MAPPINGSIZE); - - /* Create a named file-mapping object with file handle FileHandle - * and with PAGE_READWRITE protection. - */ - hFileMapRW = CreateFileMapping( - SWAP_HANDLE, - NULL, /*not inherited*/ - PAGE_READWRITE, /*read only*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - lpObjectName); /*named object*/ - - if(NULL == hFileMapRW) - { - Fail("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - } - - /* maps a view of a file into the address space of the calling process. - */ - lpMapViewRW = MapViewOfFile( - hFileMapRW, - FILE_MAP_ALL_ACCESS, /* access code */ - 0, /* high order offset*/ - 0, /* low order offset*/ - MAPPINGSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewRW) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpOne; - } - - - hFileMapRO = CreateFileMapping( - SWAP_HANDLE, - NULL, /*not inherited*/ - PAGE_READONLY, /*read and write*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - lpObjectName); /*named object*/ - - if(NULL == hFileMapRO) - { - Trace("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* maps a view of a file into the address space of the calling process. - */ - lpMapViewRO = MapViewOfFile( - hFileMapRO, - FILE_MAP_READ, /* access code */ - 0, /* high order offset*/ - 0, /* low order offset*/ - MAPPINGSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewRO) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpThree; - } - - /* Write the test string to the Map view. - */ - memcpy(lpMapViewRW, testString, strlen(testString)); - - /* Read from the second Map view. - */ - memcpy(results, (LPCSTR)lpMapViewRO, MAPPINGSIZE); - - /* Verify the contents of the file mapping, - * by comparing what was written to what was read. - */ - if (memcmp(results, testString, strlen(testString))!= 0) - { - Trace("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - results, - testString); - RetVal = FAIL; - goto CleanUpFour; - } - - /* Test was successful. - */ - RetVal = PASS; - -CleanUpFour: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewRO) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewRO); - RetVal = FAIL; - } - -CleanUpThree: - - /* Close Handle to opend file mapping. - */ - if ( CloseHandle(hFileMapRO) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFileMapRO); - RetVal = FAIL; - } - - -CleanUpTwo: - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewRW) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewRW); - RetVal = FAIL; - } - - -CleanUpOne: - - /* Close Handle to opend file mapping. - */ - if ( CloseHandle(hFileMapRW) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFileMapRW); - RetVal = FAIL; - } - - - /* Terminate the PAL. - */ - PAL_TerminateEx(RetVal); - return RetVal; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/testinfo.dat deleted file mode 100644 index 2b5d8902a403..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA - with PAGE_READWRITE and INVALID_HANDLE_VALUE file handle -TYPE = DEFAULT -EXE1 = createfilemapping -Description -=Test the CreateFileMapping to create a unnamed file-mapping object -=and with PAGE_READWRITE protection by passing INVALID_HANDLE_VALUE -=file handle diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CMakeLists.txt deleted file mode 100644 index 89d25f5a5d5e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMapping.cpp -) - -add_executable(paltest_createfilemappinga_test6 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappinga_test6 coreclrpal) - -target_link_libraries(paltest_createfilemappinga_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.cpp deleted file mode 100644 index 7c3ba87a8f67..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: createfilemapping.c (test 6) -** -** Purpose: Positive test the CreateFileMapping API. -** Test CreateFileMapping to a "swap" handle with -** access PAGE_READWRITE. -** -** -**============================================================*/ -#include - -const int MAPPINGSIZE = 2048; -HANDLE SWAP_HANDLE = ((VOID *)(-1)); - -int __cdecl main(int argc, char *argv[]) -{ - char testString[] = "this is a test string"; - char lpObjectName[] = "myMappingObject"; - char results[2048]; - int RetVal = PASS; - - HANDLE hFileMapRW; - LPVOID lpMapViewRW; - LPVOID lpMapViewRW2; - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Initialize the buffers. - */ - memset(results, 0, MAPPINGSIZE); - - /* Create a named file-mapping object with file handle FileHandle - * and with PAGE_READWRITE protection. - */ - hFileMapRW = CreateFileMapping( - SWAP_HANDLE, - NULL, /*not inherited*/ - PAGE_READWRITE, /*read write*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - lpObjectName); /*unnamed object*/ - - if(NULL == hFileMapRW) - { - Fail("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - } - - /* Create a map view of the READWRITE file mapping. - */ - lpMapViewRW = MapViewOfFile( - hFileMapRW, - FILE_MAP_ALL_ACCESS,/* access code */ - 0, /* high order offset*/ - 0, /* low order offset*/ - MAPPINGSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewRW) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpOne; - } - - - /* maps a view of a file into the address space of the calling process. - */ - lpMapViewRW2 = MapViewOfFile( - hFileMapRW, - FILE_MAP_ALL_ACCESS, /* access code */ - 0, /* high order offset*/ - 0, /* low order offset*/ - MAPPINGSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewRW2) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* Write the test string to the Map view. - */ - memcpy(lpMapViewRW, testString, strlen(testString)); - - /* Read from the second Map view. - */ - memcpy(results, (LPCSTR)lpMapViewRW2, MAPPINGSIZE); - - /* Verify the contents of the file mapping, - * by comparing what was written to what was read. - */ - if (memcmp(results, testString, strlen(testString))!= 0) - { - Trace("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - results, - testString); - RetVal = FAIL; - goto CleanUpThree; - } - - /* Test successful. - */ - RetVal = PASS; - -CleanUpThree: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewRW2) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewRW2); - RetVal = FAIL; - } - -CleanUpTwo: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewRW) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewRW); - RetVal = FAIL; - } - - -CleanUpOne: - - /* Close Handle to create file mapping. - */ - if ( CloseHandle(hFileMapRW) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFileMapRW); - RetVal = FAIL; - } - - - /* Terminate the PAL. - */ - PAL_TerminateEx(RetVal); - return RetVal; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/testinfo.dat deleted file mode 100644 index b69e8e3161d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA - with PAGE_READONLY -TYPE = DEFAULT -EXE1 = createfilemapping -Description -=Test the CreateFileMapping to create a named file-mapping object -=and with PAGE_READONLY protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/CMakeLists.txt deleted file mode 100644 index ea2e756d22d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createfilemapping.cpp -) - -add_executable(paltest_createfilemappinga_test7 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappinga_test7 coreclrpal) - -target_link_libraries(paltest_createfilemappinga_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.cpp deleted file mode 100644 index 47bfdf20f71c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: createfilemapping.c (test 7) -** -** Purpose: Positive test the CreateFileMapping API. -** Test CreateFileMapping to a "swap" handle with -** access PAGE_READWRITE. -** -** -**============================================================*/ -#include - -const int MAPPINGSIZE = 2048; -HANDLE SWAP_HANDLE = ((VOID *)(-1)); - -int __cdecl main(int argc, char *argv[]) -{ - char testString[] = "this is a test string"; - char lpObjectName[] = "myMappingObject"; - char results[2048]; - int RetVal = PASS; - - HANDLE hFileMapRW; - LPVOID lpMapViewRW; - LPVOID lpMapViewRO; - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Initialize the buffers. - */ - memset(results, 0, MAPPINGSIZE); - - /* Create a named file-mapping object with file handle FileHandle - * and with PAGE_READWRITE protection. - */ - hFileMapRW = CreateFileMapping( - SWAP_HANDLE, - NULL, /*not inherited*/ - PAGE_READWRITE, /*read write*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - lpObjectName); /*unnamed object*/ - - if(NULL == hFileMapRW) - { - Fail("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - } - - /* Create a map view to the READWRITE file mapping. - */ - lpMapViewRW = MapViewOfFile( - hFileMapRW, - FILE_MAP_ALL_ACCESS,/* access code */ - 0, /* high order offset*/ - 0, /* low order offset*/ - MAPPINGSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewRW) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpOne; - } - - - /* Create a map view to the READWRITE file mapping. - */ - lpMapViewRO = MapViewOfFile( - hFileMapRW, - FILE_MAP_READ, /* access code */ - 0, /* high order offset*/ - 0, /* low order offset*/ - MAPPINGSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewRO) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* Write the test string to the Map view. - */ - memcpy(lpMapViewRW, testString, strlen(testString)); - - /* Read from the second Map view. - */ - memcpy(results, (LPCSTR)lpMapViewRO, MAPPINGSIZE); - - /* Verify the contents of the file mapping, - * by comparing what was written to what was read. - */ - if (memcmp(results, testString, strlen(testString))!= 0) - { - Trace("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - results, - testString); - RetVal = FAIL; - goto CleanUpThree; - } - - /* Test successful. - */ - RetVal = PASS; - -CleanUpThree: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewRO) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewRO); - RetVal = FAIL; - } - -CleanUpTwo: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewRW) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewRW); - RetVal = FAIL; - } - - -CleanUpOne: - - /* Close Handle to create file mapping. - */ - if ( CloseHandle(hFileMapRW) == FALSE ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - hFileMapRW); - RetVal = FAIL; - } - - - /* Terminate the PAL. - */ - PAL_TerminateEx(RetVal); - return RetVal; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/testinfo.dat deleted file mode 100644 index a61f67ffd079..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA - with PAGE_COPYWRITE -TYPE = DEFAULT -EXE1 = createfilemapping -Description -=Test the CreateFileMapping to create a named file-mapping object -=and with PAGE_READONLY protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/CMakeLists.txt deleted file mode 100644 index 93d8a02a1ecd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createfilemapping.cpp -) - -add_executable(paltest_createfilemappinga_test8 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappinga_test8 coreclrpal) - -target_link_libraries(paltest_createfilemappinga_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.cpp deleted file mode 100644 index fa09291511c4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: createfilemapping.c (test 8) -** -** Purpose: Positive test the CreateFileMapping API. -** Test the un-verifiable parameter combinations. -** -** -**============================================================*/ -#include - -const int MAPPINGSIZE = 2048; -HANDLE SWAP_HANDLE = ((VOID *)(-1)); - -int __cdecl main(int argc, char *argv[]) -{ - HANDLE hFileMap; - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Create a READONLY, "swap", un-named file mapping. - * This test is unverifiable since there is no hook back to the file map - * because it is un-named. As well, since it resides in "swap", and is - * initialized to zero, there is nothing to read. - */ - hFileMap = CreateFileMapping( - SWAP_HANDLE, - NULL, /*not inherited*/ - PAGE_READONLY, /*read only*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - NULL); /*un-named object*/ - - if(NULL == hFileMap) - { - Fail("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - } - - - /* Create a COPYWRITE, "swap", un-named file mapping. - * This test is unverifiable, here is a quote from MSDN: - * - * Copy on write access. If you create the map with PAGE_WRITECOPY and - * the view with FILE_MAP_COPY, you will receive a view to file. If you - * write to it, the pages are automatically swappable and the modifications - * you make will not go to the original data file. - * - */ - hFileMap = CreateFileMapping( - SWAP_HANDLE, - NULL, /*not inherited*/ - PAGE_WRITECOPY, /*read only*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - NULL); /*unnamed object*/ - - if(NULL == hFileMap) - { - Fail("ERROR:%u: Failed to create File Mapping.\n", - GetLastError()); - } - - - /* Terminate the PAL. - */ - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/testinfo.dat deleted file mode 100644 index 961303fde725..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA - unnamed swap, READWRITE. -TYPE = DEFAULT -EXE1 = createfilemapping -Description -= Positive test the CreateFileMapping API. -= Test an unnamed File Mapping to a "swap" -= handle with access PAGE_READWRITE. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/CMakeLists.txt deleted file mode 100644 index 8932cad2f45c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createfilemapping.cpp -) - -add_executable(paltest_createfilemappinga_test9 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappinga_test9 coreclrpal) - -target_link_libraries(paltest_createfilemappinga_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.cpp deleted file mode 100644 index c0a1028fa443..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.cpp +++ /dev/null @@ -1,149 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: createfilemapping.c (test 9) -** -** Purpose: Negative test the CreateFileMapping API. -** -** -**============================================================*/ -#include - -const int MAPPINGSIZE = 2048; - -int __cdecl main(int argc, char *argv[]) -{ - - HANDLE hFile; - char lpFileName[] = "test.tmp"; - - HANDLE hFileMapping; - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Create a file handle with CreateFile, as READONLY - */ - hFile = CreateFile( lpFileName, - GENERIC_READ, - FILE_SHARE_READ, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile == INVALID_HANDLE_VALUE) - { - Fail("ERROR: %u :unable to create file \"%s\".\n", - GetLastError(), - lpFileName); - } - - /* Attempt to create a unnamed file-mapping object to a READONLY file - * as READWRITE access. - */ - hFileMapping = CreateFileMapping( - hFile, - NULL, /*not inherited*/ - PAGE_READWRITE, /*read and write*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - NULL); /*unnamed object*/ - - if(NULL != hFileMapping) - { - Trace("ERROR: Able to create READWRITE mapping to a " - "READONLY file.\n" ); - if( 0 == CloseHandle(hFile) ) - { - Trace("Unexpected Error: Unable to close file handle\n"); - } - Fail(""); - } - - /* Attempt to create a unnamed file-mapping object to a zero lenght - * file. - */ - hFileMapping = CreateFileMapping( - hFile, - NULL, /*not inherited*/ - PAGE_READWRITE, /*read and write*/ - 0, /*high-order size*/ - 0, /*low-order size*/ - NULL); /*unnamed object*/ - - if( NULL != hFileMapping ) - { - Trace("ERROR: Able to create READWRITE mapping to a " - "READONLY file.\n" ); - if( 0 == CloseHandle(hFile) ) - { - Trace("Unexpected Error: Unable to close file handle\n"); - } - Fail(""); - } - if(GetLastError() != ERROR_ACCESS_DENIED) - { - Trace("ERROR: Expected GetLastError() to return " - "ERROR_FILE_INVALID (%d), it returned %u.\n", - ERROR_FILE_INVALID, - GetLastError()); - if( 0 == CloseHandle(hFile) ) - { - Trace("Unexpected Error: Unable to close file handle\n"); - } - Fail(""); - } - - /* Attempt to create a file mapping that is larger than - * the file. - */ - hFileMapping = CreateFileMapping( - hFile, - NULL, /*not inherited*/ - PAGE_READONLY, /*read only*/ - 0, /*high-order size*/ - MAPPINGSIZE, /*low-order size*/ - NULL); /*unnamed object*/ - if(NULL != hFileMapping) - { - Trace("ERROR: Able to create file mapping of size %d to " - "file of size 0.\n", - MAPPINGSIZE); - if( 0 == CloseHandle(hFile) ) - { - Trace("Unexpected Error: Unable to close file handle\n"); - } - Fail(""); - } - - if(GetLastError() != ERROR_NOT_ENOUGH_MEMORY ) - { - Trace("ERROR: Expected GetLastError() to return " - "ERROR_NOT_ENOUGH_MEMORY (%d), it returned %u.\n", - ERROR_NOT_ENOUGH_MEMORY, - GetLastError()); - if( 0 == CloseHandle(hFile) ) - { - Trace("Unexpected Error: Unable to close file handle\n"); - } - Fail(""); - } - - if( 0 == CloseHandle(hFile) ) - { - Fail("Unexpected Error: Unable to close file handle\n"); - } - - /* Terminate the PAL. - */ - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/testinfo.dat deleted file mode 100644 index c5812e6f0d66..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA negative testing -TYPE = DEFAULT -EXE1 = createfilemapping -Description -= Negative test the CreateFileMapping API. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CMakeLists.txt deleted file mode 100644 index c9599098417c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -add_subdirectory(CreateFileMapping_neg1) -add_subdirectory(test1) - -# TODO: make this test compile -# add_subdirectory(test2) - -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CMakeLists.txt deleted file mode 100644 index 8e106a7deccb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMapping_neg.cpp -) - -add_executable(paltest_createfilemappingw_createfilemapping_neg1 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_createfilemapping_neg1 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_createfilemapping_neg1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.cpp index 3fd3d2086706..91400a3a5c7e 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.cpp @@ -16,7 +16,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_CreateFileMapping_neg1_paltest_createfilemappingw_createfilemapping_neg1, "filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/paltest_createfilemappingw_createfilemapping_neg1") { HANDLE FileHandle; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/testinfo.dat deleted file mode 100644 index 7b8b1bbd463a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = Negative test for CreateFileMappingW - with a zero length file -TYPE = DEFAULT -EXE1 = createfilemapping_neg -Description -=Test the CreateFileMapping to try to map a zero length file diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CMakeLists.txt deleted file mode 100644 index decb9995f320..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMappingW.cpp -) - -add_executable(paltest_createfilemappingw_test1 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test1 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.cpp index b17ecfac0adc..316320949a4c 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.cpp @@ -15,7 +15,7 @@ const int MAPPINGSIZE = 2048; -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test1_paltest_createfilemappingw_test1, "filemapping_memmgt/CreateFileMappingW/test1/paltest_createfilemappingw_test1") { HANDLE hFile; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/testinfo.dat deleted file mode 100644 index e132c6324c94..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMappingW -Name = CreateFileMappingW with PAGE_READONLY -TYPE = DEFAULT -EXE1 = createfilemappingw -Description -=Test the CreateFileMappingW to create a unnamed file-mapping object -=and with PAGE_READONLY protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CMakeLists.txt deleted file mode 100644 index 618abe04d79e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMappingW.cpp -) - -add_executable(paltest_createfilemappingw_test2 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test2 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp index 9f13cd7ce7a2..bacdc92365cd 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp @@ -15,7 +15,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test2_paltest_createfilemappingw_test2, "filemapping_memmgt/CreateFileMappingW/test2/paltest_createfilemappingw_test2") { HANDLE FileHandle; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CMakeLists.txt deleted file mode 100644 index 46723a0d270e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMappingW.cpp -) - -add_executable(paltest_createfilemappingw_test3 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test3 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.cpp index 867b51b1668a..409e829718e9 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.cpp @@ -15,7 +15,7 @@ const int MAPPINGSIZE = 2048; -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test3_paltest_createfilemappingw_test3, "filemapping_memmgt/CreateFileMappingW/test3/paltest_createfilemappingw_test3") { HANDLE hFile; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/testinfo.dat deleted file mode 100644 index 6cd0d3eef8b7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMappingW -Name = CreateFileMappingW with PAGE_READWRITE -TYPE = DEFAULT -EXE1 = createfilemappingw -Description -=Test the CreateFileMappingW to create a unnamed file-mapping object -=and with PAGE_READWRITE protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CMakeLists.txt deleted file mode 100644 index b9ab86107734..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMappingW.cpp -) - -add_executable(paltest_createfilemappingw_test4 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test4 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.cpp index e439ed0c939a..1ac6815542a3 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.cpp @@ -15,7 +15,7 @@ const int MAPPINGSIZE = 2048; -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test4_paltest_createfilemappingw_test4, "filemapping_memmgt/CreateFileMappingW/test4/paltest_createfilemappingw_test4") { HANDLE hFile; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/testinfo.dat deleted file mode 100644 index 2a1e78b640f5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMappingW -Name = CreateFileMappingW with PAGE_WRITECOPY. -TYPE = DEFAULT -EXE1 = createfilemappingw -Description -=Test the CreateFileMapping to create a unnamed file-mapping object -=and with PAGE_WRITE protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CMakeLists.txt deleted file mode 100644 index 933596a7c2f0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMappingW.cpp -) - -add_executable(paltest_createfilemappingw_test5 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test5 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.cpp index a45267d4d30c..098f7a09a0a7 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.cpp @@ -15,10 +15,10 @@ #include const int MAPPINGSIZE = 2048; -HANDLE SWAP_HANDLE = ((VOID *)(-1)); -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test5_paltest_createfilemappingw_test5, "filemapping_memmgt/CreateFileMappingW/test5/paltest_createfilemappingw_test5") { + HANDLE SWAP_HANDLE = ((VOID *)(-1)); char testString[] = "this is a test string"; WCHAR lpObjectName[] = {'m','y','O','b','j','e','c','t','\0'}; int RetVal = FAIL; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/testinfo.dat deleted file mode 100644 index dfc444e6f605..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMappingW -Name = CreateFileMappingW - PAGE_READWRITE -TYPE = DEFAULT -EXE1 = createfilemappingw -Description -= Positive test the CreateFileMappingW API. -= Test CreateFileMappingW to create a named -= "swap" handle with access PAGE_READONLY. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CMakeLists.txt deleted file mode 100644 index abd57dded2f2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateFileMappingW.cpp -) - -add_executable(paltest_createfilemappingw_test6 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test6 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.cpp index 635999a6ab4c..615d26121496 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.cpp @@ -15,10 +15,10 @@ #include const int MAPPINGSIZE = 2048; -HANDLE SWAP_HANDLE = ((VOID *)(-1)); -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test6_paltest_createfilemappingw_test6, "filemapping_memmgt/CreateFileMappingW/test6/paltest_createfilemappingw_test6") { + HANDLE SWAP_HANDLE = ((VOID *)(-1)); char testString[] = "this is a test string"; WCHAR lpObjectName[] = {'m','y','O','b','j','e','c','t','\0'}; char results[2048]; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/testinfo.dat deleted file mode 100644 index 583585009054..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMapping -Name = CreateFileMappingA - with PAGE_READONLY -TYPE = DEFAULT -EXE1 = createfilemappingw -Description -= Positive test the CreateFileMappingW API. -= Test CreateFileMappingW to create a named -= "swap" handle with access PAGE_READWRITE. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/CMakeLists.txt deleted file mode 100644 index 011f6e1b4c6a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createfilemapping.cpp -) - -add_executable(paltest_createfilemappingw_test7 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test7 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.cpp index 3141f7ea2e2a..48c2361faddb 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.cpp @@ -15,10 +15,10 @@ #include const int MAPPINGSIZE = 2048; -HANDLE SWAP_HANDLE = ((VOID *)(-1)); -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test7_paltest_createfilemappingw_test7, "filemapping_memmgt/CreateFileMappingW/test7/paltest_createfilemappingw_test7") { + HANDLE SWAP_HANDLE = ((VOID *)(-1)); char testString[] = "this is a test string"; WCHAR lpObjectName[] = {'m','y','O','b','j','e','c','t','\0'}; char results[2048]; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/testinfo.dat deleted file mode 100644 index 3c499001a474..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMappingW -Name = CreateFileMappingW - PAGE_COPYWRITE -TYPE = DEFAULT -EXE1 = createfilemapping -Description -= Positive test the CreateFileMappingW API. -= Test CreateFileMappingW to create a named -= "swap" handle with access PAGE_READWRITE diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/CMakeLists.txt deleted file mode 100644 index 6e01ec7c7890..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createfilemapping.cpp -) - -add_executable(paltest_createfilemappingw_test8 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test8 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.cpp index 54543d5f218e..8a264ea83e17 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.cpp @@ -14,10 +14,10 @@ #include const int MAPPINGSIZE = 2048; -HANDLE SWAP_HANDLE = ((VOID *)(-1)); -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test8_paltest_createfilemappingw_test8, "filemapping_memmgt/CreateFileMappingW/test8/paltest_createfilemappingw_test8") { + HANDLE SWAP_HANDLE = ((VOID *)(-1)); WCHAR lpObjectName[] = {'m','y','O','b','j','e','c','t','\0'}; HANDLE hFileMap; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/testinfo.dat deleted file mode 100644 index 3d8364d5abf5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMappingW - Special cases -Name = CreateFileMappingW -TYPE = DEFAULT -EXE1 = createfilemapping -Description -= Positive test the CreateFileMappingW API. -= Test the un-verifiable parameter combinations. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/CMakeLists.txt deleted file mode 100644 index b069bc6ed767..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createfilemapping.cpp -) - -add_executable(paltest_createfilemappingw_test9 - ${SOURCES} -) - -add_dependencies(paltest_createfilemappingw_test9 coreclrpal) - -target_link_libraries(paltest_createfilemappingw_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.cpp index e062e4543d33..70c52936011d 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.cpp @@ -14,7 +14,7 @@ const int MAPPINGSIZE = 2048; -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_CreateFileMappingW_test9_paltest_createfilemappingw_test9, "filemapping_memmgt/CreateFileMappingW/test9/paltest_createfilemappingw_test9") { HANDLE hFile; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/testinfo.dat deleted file mode 100644 index b3baf015a102..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = CreateFileMappingW -Name = CreateFileMappingW negative testing -TYPE = DEFAULT -EXE1 = createfilemapping -Description -= Negative test the CreateFileMapping API. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/CMakeLists.txt deleted file mode 100644 index 66341ef4ecaa..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(SOURCES - dlltest.cpp - FreeLibrary.cpp -) - -add_executable(paltest_freelibrary_test1 - ${SOURCES} -) - -add_dependencies(paltest_freelibrary_test1 coreclrpal) - -target_link_libraries(paltest_freelibrary_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.cpp index 093242db6350..528a1cca29fc 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.cpp @@ -25,7 +25,7 @@ BOOL PALAPI TestDll(HMODULE, int); -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_FreeLibrary_test1_paltest_freelibrary_test1, "filemapping_memmgt/FreeLibrary/test1/paltest_freelibrary_test1") { HANDLE hLib; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/testinfo.dat deleted file mode 100644 index 6e6e9f3f4010..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = FreeLibrary -Name = Positive test for FreeLibrary API -TYPE = DEFAULT -EXE1 = freelibrary -LIB1 = dlltest -Description -=Test the FreeLibrary to decrement the reference -=count of the loaded DLL diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/CMakeLists.txt deleted file mode 100644 index 126d16b2484e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_freelibrary_test2 - ${SOURCES} -) - -add_dependencies(paltest_freelibrary_test2 coreclrpal) - -target_link_libraries(paltest_freelibrary_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.cpp index 2cf10ee8ee14..c360743c4452 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char* argv[]) +PALTEST(filemapping_memmgt_FreeLibrary_test2_paltest_freelibrary_test2, "filemapping_memmgt/FreeLibrary/test2/paltest_freelibrary_test2") { HANDLE hLib; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/testinfo.dat deleted file mode 100644 index 44c99fb3ce3a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = FreeLibrary -Name = Negative test for FreeLibrary -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the FreeLibrary function. -= This is a negative test that will pass an invalid and a -= null handle to FreeLibrary. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/CMakeLists.txt deleted file mode 100644 index 5e268fbff5f2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(SOURCES - dlltest.cpp - test1.cpp -) - -add_executable(paltest_freelibraryandexitthread_test1 - ${SOURCES} -) - -add_dependencies(paltest_freelibraryandexitthread_test1 coreclrpal) - -target_link_libraries(paltest_freelibraryandexitthread_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp index 2306a190d0f3..97448fadaf96 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp @@ -27,11 +27,11 @@ #define TIMEOUT 60000 -BOOL PALAPI StartThreadTest(); -DWORD PALAPI CreateTestThread(LPVOID); -BOOL PALAPI TestDll(HMODULE, int); +BOOL PALAPI StartThreadTest_FreeLibraryAndExitThread_test1(); +DWORD PALAPI CreateTestThread_FreeLibraryAndExitThread_test1(LPVOID); +BOOL PALAPI TestDll_FreeLibraryAndExitThread_test1(HMODULE, int); -int __cdecl main(int argc, char* argv[]) +PALTEST(filemapping_memmgt_FreeLibraryAndExitThread_test1_paltest_freelibraryandexitthread_test1, "filemapping_memmgt/FreeLibraryAndExitThread/test1/paltest_freelibraryandexitthread_test1") { /*Initialize the PAL*/ if ((PAL_Initialize(argc, argv)) != 0) @@ -39,7 +39,7 @@ int __cdecl main(int argc, char* argv[]) return (FAIL); } - if (!StartThreadTest()) + if (!StartThreadTest_FreeLibraryAndExitThread_test1()) { Fail("ERROR: FreeLibraryAndExitThread test failed.\n"); } @@ -51,12 +51,12 @@ int __cdecl main(int argc, char* argv[]) } -BOOL PALAPI StartThreadTest() +BOOL PALAPI StartThreadTest_FreeLibraryAndExitThread_test1() { HMODULE hLib; HANDLE hThread; DWORD dwThreadId; - LPTHREAD_START_ROUTINE lpStartAddress = &CreateTestThread; + LPTHREAD_START_ROUTINE lpStartAddress = &CreateTestThread_FreeLibraryAndExitThread_test1; LPVOID lpParameter = (LPVOID)lpStartAddress; DWORD rc = -1; /*Load library (DLL).*/ @@ -101,7 +101,7 @@ BOOL PALAPI StartThreadTest() } /*Test access to DLL.*/ - if(!TestDll(hLib, 0)) + if(!TestDll_FreeLibraryAndExitThread_test1(hLib, 0)) { Trace("ERROR: TestDll function returned FALSE " "expected TRUE\n."); @@ -117,7 +117,7 @@ BOOL PALAPI StartThreadTest() return (TRUE); } -BOOL PALAPI TestDll(HMODULE hLib, int testResult) +BOOL PALAPI TestDll_FreeLibraryAndExitThread_test1(HMODULE hLib, int testResult) { int RetVal; char FunctName[] = "DllTest"; @@ -164,10 +164,10 @@ BOOL PALAPI TestDll(HMODULE hLib, int testResult) return (TRUE); } -DWORD PALAPI CreateTestThread(LPVOID lpParam) +DWORD PALAPI CreateTestThread_FreeLibraryAndExitThread_test1(LPVOID lpParam) { /* Test access to DLL.*/ - TestDll(lpParam, 1); + TestDll_FreeLibraryAndExitThread_test1(lpParam, 1); /*Free library and exit thread.*/ FreeLibraryAndExitThread(lpParam, (DWORD)0); diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/testinfo.dat deleted file mode 100644 index cdadee335abb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = FreeLibraryAndExitThread -Name = Positive test for FreeLibraryAndExitThread -TYPE = DEFAULT -EXE1 = test1 -LIB1 = dlltest -Description -= Tests the PAL implementation of the FreeLibraryAndExitThread -= function. When run, FreeLibraryAndExitThread will exit the -= process that it is called within, therefore we create a -= thread to run the API. Then we test for the existance of the -= thread and access to the library. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/CMakeLists.txt deleted file mode 100644 index fd7fa6bdfcac..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetModuleFileNameA.cpp -) - -add_executable(paltest_getmodulefilenamea_test1 - ${SOURCES} -) - -add_dependencies(paltest_getmodulefilenamea_test1 coreclrpal) - -target_link_libraries(paltest_getmodulefilenamea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.cpp index 78550913b59a..c5fc79f7ad96 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.cpp @@ -26,7 +26,7 @@ #define Delimiter "\\" #endif -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_GetModuleFileNameA_test1_paltest_getmodulefilenamea_test1, "filemapping_memmgt/GetModuleFileNameA/test1/paltest_getmodulefilenamea_test1") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/testinfo.dat deleted file mode 100644 index 72196a4cc642..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = GetModuleFileNameA -Name = Positive test for GetModuleFileNameA API -TYPE = DEFAULT -EXE1 = getmodulefilenamea -Description -=Test the GetModuleFileNameA to retrieve the specified module -=full path and file name diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/CMakeLists.txt deleted file mode 100644 index 5dd6e857a317..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetModuleFileNameA.cpp -) - -add_executable(paltest_getmodulefilenamea_test2 - ${SOURCES} -) - -add_dependencies(paltest_getmodulefilenamea_test2 coreclrpal) - -target_link_libraries(paltest_getmodulefilenamea_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.cpp index 99cfeb7c1cf1..b888ce3e93aa 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.cpp @@ -16,7 +16,7 @@ #define MODULENAMEBUFFERSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_GetModuleFileNameA_test2_paltest_getmodulefilenamea_test2, "filemapping_memmgt/GetModuleFileNameA/test2/paltest_getmodulefilenamea_test2") { DWORD ModuleNameLength; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/testinfo.dat deleted file mode 100644 index 9f6c7d8b4f41..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = GetModuleFileNameA -Name = Positive test for GetModuleFileNameA API -TYPE = DEFAULT -EXE1 = getmodulefilenamea -Description -=Test the GetModuleFileNameA to retrieve current process full -=full path and file name by passing a NULL module handle diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/CMakeLists.txt deleted file mode 100644 index 0488cc9a3ef8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetModuleFileNameW.cpp -) - -add_executable(paltest_getmodulefilenamew_test1 - ${SOURCES} -) - -add_dependencies(paltest_getmodulefilenamew_test1 coreclrpal) - -target_link_libraries(paltest_getmodulefilenamew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp index d38ea3218570..db9daafd9b16 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp @@ -25,7 +25,7 @@ #define Delimiter "\\" #endif -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_GetModuleFileNameW_test1_paltest_getmodulefilenamew_test1, "filemapping_memmgt/GetModuleFileNameW/test1/paltest_getmodulefilenamew_test1") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/testinfo.dat deleted file mode 100644 index e6e090035fc4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = GetModuleFileNameW -Name = Positive test for GetModuleFileNameW API -TYPE = DEFAULT -EXE1 = getmodulefilenamew -Description -=Test the GetModuleFileNameW to retrieve the specified module -=full path and file name in UNICODE diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/CMakeLists.txt deleted file mode 100644 index f3a51c31d612..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - GetModuleFileNameW.cpp -) - -add_executable(paltest_getmodulefilenamew_test2 - ${SOURCES} -) - -add_dependencies(paltest_getmodulefilenamew_test2 coreclrpal) - -target_link_libraries(paltest_getmodulefilenamew_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp index b9f52970eb32..cf93a94db982 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp @@ -18,7 +18,7 @@ #define MODULENAMEBUFFERSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_GetModuleFileNameW_test2_paltest_getmodulefilenamew_test2, "filemapping_memmgt/GetModuleFileNameW/test2/paltest_getmodulefilenamew_test2") { DWORD ModuleNameLength; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/testinfo.dat deleted file mode 100644 index 47a5defb23b7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = GetModuleFileNameW -Name = Positive test for GetModuleFileNameW API -TYPE = DEFAULT -EXE1 = getmodulefilenamew -Description -=Test the GetModuleFileNameW to retrieve current process full -=full path and file name by passing a NULL module handle in UNICODE diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/CMakeLists.txt deleted file mode 100644 index 6398b4eb2386..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(SOURCES - test1.cpp - testlib.cpp -) - -add_executable(paltest_getprocaddress_test1 - ${SOURCES} -) - -add_dependencies(paltest_getprocaddress_test1 coreclrpal) - -target_link_libraries(paltest_getprocaddress_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.cpp index 78d6a565f642..183177fb3841 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.cpp @@ -23,7 +23,7 @@ typedef int (PALAPI_NOEXPORT *SIMPLEFUNCTION)(int); #define lpModuleName "testlib.dll" #endif -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_GetProcAddress_test1_paltest_getprocaddress_test1, "filemapping_memmgt/GetProcAddress/test1/paltest_getprocaddress_test1") { int err; HMODULE hModule; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testinfo.dat deleted file mode 100644 index 8bc3b446977e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = filemapping_memmgt -Function = getprocaddress -Name = Positive test for GetProcAddress API -TYPE = DEFAULT -EXE1 = test1 -LIB1 = testlib -Description -=Positive test the GetProcAddress API. -=The first test calls GetProcAddress to retrieve the -=address of strcpy by its name, then calls the function and -=checks that it worked. The second part of the test -=calls GetProcAddress to retrieve the address of -=strcpy by its ordinal, then calls the function and -=checks that it worked. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/CMakeLists.txt deleted file mode 100644 index d328f4c81598..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(SOURCES - test2.cpp - testlib.cpp -) - -add_executable(paltest_getprocaddress_test2 - ${SOURCES} -) - -add_dependencies(paltest_getprocaddress_test2 coreclrpal) - -target_link_libraries(paltest_getprocaddress_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.cpp index fdd5d8567666..8556a67086e5 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.cpp @@ -26,7 +26,7 @@ /** * main */ -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_GetProcAddress_test2_paltest_getprocaddress_test2, "filemapping_memmgt/GetProcAddress/test2/paltest_getprocaddress_test2") { int err; HMODULE hModule; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testinfo.dat deleted file mode 100644 index 4e64e8ccf92a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testinfo.dat +++ /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. - -Version = 1.0 -Section = filemapping_memmgt -Function = getprocaddress -Name = Negative test for GetProcAddress API -TYPE = DEFAULT -EXE1 = test2 -LIB1 = testlib -Description -=This test tries to call GetProcAddress with -=a NULL handle, with a NULL function name, with an empty -=function name, with an invalid name and with an -=nvalid ordinal value. - - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/CMakeLists.txt deleted file mode 100644 index 910d3b191525..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - LocalAlloc.cpp -) - -add_executable(paltest_localalloc_test1 - ${SOURCES} -) - -add_dependencies(paltest_localalloc_test1 coreclrpal) - -target_link_libraries(paltest_localalloc_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.cpp index 1b349069f04a..5879ed598071 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.cpp @@ -12,7 +12,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_LocalAlloc_test1_paltest_localalloc_test1, "filemapping_memmgt/LocalAlloc/test1/paltest_localalloc_test1") { HLOCAL LocalHeap; HLOCAL FreeHeap; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/testinfo.dat deleted file mode 100644 index b1626eff32c7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = LocalAlloc -Name = Positive test LocalAlloc API to Allocate the specified number of bytes from the heap -TYPE = DEFAULT -EXE1 = localalloc -Description -=Test the LocalAlloc with zero ad allocation attribute diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/CMakeLists.txt deleted file mode 100644 index cc406ce212b2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - LocalFree.cpp -) - -add_executable(paltest_localfree_test1 - ${SOURCES} -) - -add_dependencies(paltest_localfree_test1 coreclrpal) - -target_link_libraries(paltest_localfree_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.cpp index 86d27b45586c..0fcb32d6fc96 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.cpp @@ -12,7 +12,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_LocalFree_test1_paltest_localfree_test1, "filemapping_memmgt/LocalFree/test1/paltest_localfree_test1") { HLOCAL LocalHeap; HLOCAL FreeHeap; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/testinfo.dat deleted file mode 100644 index 2fb5007769f0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = LocalFree -Name = Positive test LocalFree API to free a specified local memory object -TYPE = DEFAULT -EXE1 = localfree -Description -=Test the LocalFree to free a specified local memory object diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/CMakeLists.txt deleted file mode 100644 index b069f7e87e66..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - LocalFree.cpp -) - -add_executable(paltest_localfree_test2 - ${SOURCES} -) - -add_dependencies(paltest_localfree_test2 coreclrpal) - -target_link_libraries(paltest_localfree_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.cpp index 587036041c17..5d66077a2cfd 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_LocalFree_test2_paltest_localfree_test2, "filemapping_memmgt/LocalFree/test2/paltest_localfree_test2") { HLOCAL FreeHeap; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/testinfo.dat deleted file mode 100644 index aab6b36a74e1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = LocalFree -Name = Positive test LocalFree API by passing NULL as local memory object handle -TYPE = DEFAULT -EXE1 = localfree -Description -=Test the LocalFree by passing NULL -=as a local memory object handle diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/CMakeLists.txt deleted file mode 100644 index 828a2878bf12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/CMakeLists.txt deleted file mode 100644 index 384729f48b0c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - MapViewOfFile.cpp -) - -add_executable(paltest_mapviewoffile_test1 - ${SOURCES} -) - -add_dependencies(paltest_mapviewoffile_test1 coreclrpal) - -target_link_libraries(paltest_mapviewoffile_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp index 9f0f6b8fa90c..0c25bdbc46d9 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp @@ -26,7 +26,7 @@ #define TEMP_DIRECTORY_PATH "/data/local/tmp/" #endif -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_MapViewOfFile_test1_paltest_mapviewoffile_test1, "filemapping_memmgt/MapViewOfFile/test1/paltest_mapviewoffile_test1") { HANDLE hFile = INVALID_HANDLE_VALUE; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/testinfo.dat deleted file mode 100644 index 84e3addeeb3c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = MapViewOfFile -Name = Positive test MapViewOfFile API with access FILE_MAP_READ -TYPE = DEFAULT -EXE1 = mapviewoffile -Description -=Test the MapViewOfFile with access FILE_MAP_READ diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/CMakeLists.txt deleted file mode 100644 index 0d4f42525b0b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - MapViewOfFile.cpp -) - -add_executable(paltest_mapviewoffile_test2 - ${SOURCES} -) - -add_dependencies(paltest_mapviewoffile_test2 coreclrpal) - -target_link_libraries(paltest_mapviewoffile_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.cpp index e34960158a4f..8de37a15619f 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.cpp @@ -22,7 +22,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_MapViewOfFile_test2_paltest_mapviewoffile_test2, "filemapping_memmgt/MapViewOfFile/test2/paltest_mapviewoffile_test2") { HANDLE hFile; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/testinfo.dat deleted file mode 100644 index b8ed53e8f385..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = MapViewOfFile -Name = Positive test for MapViewOfFile API with access FILE_MAP_WRITE -TYPE = DEFAULT -EXE1 = mapviewoffile -Description -=Test the MapViewOfFile with access FILE_MAP_WRITE diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/CMakeLists.txt deleted file mode 100644 index 8da6c06890e1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - MapViewOfFile.cpp -) - -add_executable(paltest_mapviewoffile_test3 - ${SOURCES} -) - -add_dependencies(paltest_mapviewoffile_test3 coreclrpal) - -target_link_libraries(paltest_mapviewoffile_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.cpp index 3a8990e3aceb..b5d4ef346232 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.cpp @@ -22,7 +22,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_MapViewOfFile_test3_paltest_mapviewoffile_test3, "filemapping_memmgt/MapViewOfFile/test3/paltest_mapviewoffile_test3") { HANDLE hFile; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/testinfo.dat deleted file mode 100644 index 34f83cad17a2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = MapViewOfFile -Name = Positive test MapViewOfFile API with access FILE_MAP_ALL_ACCESS -TYPE = DEFAULT -EXE1 = mapviewoffile -Description -=Test the MapViewOfFile with access FILE_MAP_ALL_ACCESS diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/CMakeLists.txt deleted file mode 100644 index 3b43a5e2e7ff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - mapviewoffile.cpp -) - -add_executable(paltest_mapviewoffile_test4 - ${SOURCES} -) - -add_dependencies(paltest_mapviewoffile_test4 coreclrpal) - -target_link_libraries(paltest_mapviewoffile_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.cpp index 66a72896eeba..00139eda9da6 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.cpp @@ -19,7 +19,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_MapViewOfFile_test4_paltest_mapviewoffile_test4, "filemapping_memmgt/MapViewOfFile/test4/paltest_mapviewoffile_test4") { HANDLE hFile; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/testinfo.dat deleted file mode 100644 index 84e96b38bcd7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = MapViewOfFile -Name = Negative test MapViewOfFile API -TYPE = DEFAULT -EXE1 = mapviewoffile -Description -= Negative test the MapViewOfFile API. -= Call MapViewOfFile with all access modes, -= except read-only, on a read only map. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/CMakeLists.txt deleted file mode 100644 index ace9e601f38b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - mapviewoffile.cpp -) - -add_executable(paltest_mapviewoffile_test5 - ${SOURCES} -) - -add_dependencies(paltest_mapviewoffile_test5 coreclrpal) - -target_link_libraries(paltest_mapviewoffile_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.cpp index ee920301fc36..a2c221f159e1 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.cpp @@ -18,7 +18,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_MapViewOfFile_test5_paltest_mapviewoffile_test5, "filemapping_memmgt/MapViewOfFile/test5/paltest_mapviewoffile_test5") { const int MAPPINGSIZE = 2048; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/testinfo.dat deleted file mode 100644 index 2427779c0a19..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = MapViewOfFile -Name = Negative test for MapViewOfFile API. -TYPE = DEFAULT -EXE1 = mapviewoffile -Description -= Negative test the MapViewOfFile API. -= Passing invalid values for the hFileMappingObject. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/CMakeLists.txt deleted file mode 100644 index 1855c6ea347e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - mapviewoffile.cpp -) - -add_executable(paltest_mapviewoffile_test6 - ${SOURCES} -) - -add_dependencies(paltest_mapviewoffile_test6 coreclrpal) - -target_link_libraries(paltest_mapviewoffile_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.cpp index 0e719ad73384..c118fa1f6692 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.cpp @@ -17,7 +17,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_MapViewOfFile_test6_paltest_mapviewoffile_test6, "filemapping_memmgt/MapViewOfFile/test6/paltest_mapviewoffile_test6") { const int MAPPINGSIZE = 2048; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/testinfo.dat deleted file mode 100644 index 6112c648cfe4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = MapViewOfFile -Name = Positive test for MapViewOfFile API. -TYPE = DEFAULT -EXE1 = mapviewoffile -Description -= Positive test the MapViewOfFile API. -= Mapping in a section of anonymous pagefile diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/CMakeLists.txt deleted file mode 100644 index 5c2d17af5eff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - OpenFileMappingA.cpp -) - -add_executable(paltest_openfilemappinga_test1 - ${SOURCES} -) - -add_dependencies(paltest_openfilemappinga_test1 coreclrpal) - -target_link_libraries(paltest_openfilemappinga_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.cpp deleted file mode 100644 index 231389491d07..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.cpp +++ /dev/null @@ -1,156 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: openfilemappinga.c (test 1) -** -** Purpose: Positive test the OpenFileMapping API. -** Call OpenFileMapping to open a named file-mapping -** object with FILE_MAP_ALL_ACCESS access -** -** -**============================================================*/ -#include - -int __cdecl main(int argc, char *argv[]) -{ - HANDLE FileMappingHandle; - HANDLE OpenFileMappingHandle; - HANDLE lpMapViewAddress; - const int LOWORDERSIZE = 1024; - char buf[] = "this is a test"; - char MapObject[] = "myMappingObject"; - char ch[1024]; - int err; - int RetVal = PASS; - - /* Initialize the PAL environment. - */ - err = PAL_Initialize(argc, argv); - if(0 != err) - { - return FAIL; - } - - - /* Create a named file-mapping object with - * file handle FileHandle. - */ - FileMappingHandle = CreateFileMapping( - INVALID_HANDLE_VALUE, - NULL, /* not inherited */ - PAGE_READWRITE, /* read and write */ - 0, /* high-order size */ - LOWORDERSIZE, /* low-order size */ - MapObject); /* named object */ - - if(NULL == FileMappingHandle) - { - Fail("ERROR:%u:Failed to call CreateFileMapping to " - "create a mapping object.\n", - GetLastError()); - } - if(GetLastError() == ERROR_ALREADY_EXISTS) - { - Trace("ERROR:File mapping object already exists\n"); - RetVal = FAIL; - goto CleanUpOne; - } - - /* Open a named file-mapping object with - * FILE_MAP_ALL_ACCESS access. - */ - OpenFileMappingHandle = OpenFileMapping( - FILE_MAP_ALL_ACCESS, - TRUE, - MapObject ); - - if(NULL == OpenFileMappingHandle) - { - Trace("ERROR:%u:Failed to Call OpenFileMapping API!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpOne; - } - - /* Test the opened map view. - */ - lpMapViewAddress = MapViewOfFile( - OpenFileMappingHandle, - FILE_MAP_ALL_ACCESS, /* access code */ - 0, /* high order offset */ - 0, /* low order offset */ - LOWORDERSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewAddress) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* Write to the Map View. - */ - memcpy(lpMapViewAddress, buf, strlen(buf)); - - /* Read from the Map View. - */ - memcpy(ch, (LPCSTR)lpMapViewAddress, LOWORDERSIZE); - - /* Compare what was written to the Map View, - * to what was read. - */ - if (memcmp(ch, buf, strlen(buf))!= 0) - { - Trace("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - ch, buf); - RetVal = FAIL; - goto CleanUpThree; - - } - -CleanUpThree: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewAddress) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewAddress); - RetVal = FAIL; - } - -CleanUpTwo: - - /* Close Handle to opend file mapping. - */ - if ( CloseHandle(OpenFileMappingHandle) == 0 ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - OpenFileMappingHandle); - RetVal = FAIL; - } - -CleanUpOne: - - /* Close Handle to create file mapping. - */ - if ( CloseHandle(FileMappingHandle) == 0 ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - FileMappingHandle); - RetVal = FAIL; - } - - - /* Terminat the PAL.*/ - PAL_TerminateEx(RetVal); - return RetVal; -} diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/testinfo.dat deleted file mode 100644 index a6021bb633c5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = OpenFileMappingA -Name = Positive test for OpenFileMappingA API with FILE_MAP_ALL_ACCESS access -TYPE = DEFAULT -EXE1 = openfilemappinga -Description -=Test the OpenFileMappingA with FILE_MAP_ALL_ACCESS access diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/CMakeLists.txt deleted file mode 100644 index 6dda4b7fdae8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - OpenFileMappingA.cpp -) - -add_executable(paltest_openfilemappinga_test2 - ${SOURCES} -) - -add_dependencies(paltest_openfilemappinga_test2 coreclrpal) - -target_link_libraries(paltest_openfilemappinga_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.cpp deleted file mode 100644 index a8a2ce21cf22..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.cpp +++ /dev/null @@ -1,213 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: openfilemappinga.c (test 2) -** -** Purpose: Positive test the OpenFileMapping API. -** Call OpenFileMapping to open a named file-mapping -** object with FILE_MAP_WRITE access -** -** -**============================================================*/ -#include - -int __cdecl main(int argc, char *argv[]) -{ - HANDLE FileMappingHandle; - HANDLE OpenFileMappingHandle; - HANDLE lpMapViewAddress; - HANDLE OpenFileMappingHandle2; - HANDLE lpMapViewAddress2; - const int LOWORDERSIZE = 1024; - char MapObject[] = "myMappingObject"; - char buf[] = "this is a test"; - char ch[1024]; - int RetVal = PASS; - - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Create a named file-mapping object with file handle FileHandle. - */ - FileMappingHandle = CreateFileMapping( - INVALID_HANDLE_VALUE, - NULL, /* not inherited */ - PAGE_READWRITE, /* read and write */ - 0, /* high-order size */ - LOWORDERSIZE, /* low-order size */ - MapObject); /* named object */ - - - if(NULL == FileMappingHandle) - { - Fail("\nFailed to call CreateFileMapping to create " - "a mapping object!\n"); - } - if(GetLastError() == ERROR_ALREADY_EXISTS) - { - Trace("\nFile mapping object already exists!\n"); - RetVal = FAIL; - goto CleanUpOne; - } - - /* Open a named file-mapping object with FILE_MAP_WRITE access. - */ - OpenFileMappingHandle = OpenFileMapping( - FILE_MAP_WRITE, - FALSE, - MapObject); - - if(NULL == OpenFileMappingHandle) - { - Trace("\nFailed to Call OpenFileMapping API!\n"); - RetVal = FAIL; - goto CleanUpOne; - } - - /* Open a named file-mapping object with - * FILE_MAP_ALL_ACCESS access, to verify - * the FILE_MAP_WRITE access map. - */ - OpenFileMappingHandle2 = OpenFileMapping( - FILE_MAP_ALL_ACCESS, - FALSE, - MapObject); - - if(NULL == OpenFileMappingHandle2) - { - Trace("\nFailed to Call OpenFileMapping API!\n"); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* Create map view of the open mapping that has - * FILE_MAP_WRITE access. - */ - lpMapViewAddress = MapViewOfFile( - OpenFileMappingHandle, - FILE_MAP_WRITE, /* access code */ - 0, /* high order offset */ - 0, /* low order offset */ - LOWORDERSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewAddress) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpThree; - } - - /* Create map view of the open mapping that has - * FILE_MAP_ALL_ACCESS access. - */ - lpMapViewAddress2 = MapViewOfFile( - OpenFileMappingHandle2, - FILE_MAP_ALL_ACCESS, /* access code */ - 0, /* high order offset */ - 0, /* low order offset */ - LOWORDERSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewAddress2) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpFour; - } - - /* Write to the Map View. - */ - memcpy(lpMapViewAddress, buf, strlen(buf)); - - /* Read from the Map View. - */ - memcpy(ch, (LPCSTR)lpMapViewAddress, LOWORDERSIZE); - - /* Compare what was written to the Map View, - * to what was read. - */ - if (memcmp(ch, buf, strlen(buf))!= 0) - { - Fail("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - ch, buf); - RetVal = FAIL; - goto CleanUpFive; - } - -CleanUpFive: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewAddress2) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewAddress2); - RetVal = FAIL; - } - -CleanUpFour: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewAddress) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewAddress); - RetVal = FAIL; - } - -CleanUpThree: - - /* Close Handle to opened file mapping. - */ - if ( CloseHandle(OpenFileMappingHandle2) == 0 ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - OpenFileMappingHandle2); - RetVal = FAIL; - } - -CleanUpTwo: - - /* Close Handle to opened file mapping. - */ - if ( CloseHandle(OpenFileMappingHandle) == 0 ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - OpenFileMappingHandle); - RetVal = FAIL; - } - -CleanUpOne: - - /* Close Handle to create file mapping. - */ - if ( CloseHandle(FileMappingHandle) == 0 ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - FileMappingHandle); - RetVal = FAIL; - } - - - /* Terminate the PAL. - */ - PAL_TerminateEx(RetVal); - return RetVal; -} diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/testinfo.dat deleted file mode 100644 index 4d7fca5f7877..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = OpenFileMappingA -Name = Positive test for OpenFileMappingA API with FILE_MAP_WRITE access -TYPE = DEFAULT -EXE1 = openfilemappinga -Description -=Test the OpenFileMappingA with FILE_MAP_WRITE access diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/CMakeLists.txt deleted file mode 100644 index 8bcd7c4e09da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - OpenFileMappingA.cpp -) - -add_executable(paltest_openfilemappinga_test3 - ${SOURCES} -) - -add_dependencies(paltest_openfilemappinga_test3 coreclrpal) - -target_link_libraries(paltest_openfilemappinga_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.cpp deleted file mode 100644 index f26c7347c22e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.cpp +++ /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. - -/*============================================================= -** -** Source: openfilemappinga.c -** -** Purpose: Positive test the OpenFileMapping API. -** Call OpenFileMapping to open a named file-mapping -** object with FILE_MAP_READ access -** -** -**============================================================*/ -#include - - -int __cdecl main(int argc, char *argv[]) -{ - - HANDLE FileMappingHandle; - HANDLE OpenFileMappingHandle; - HANDLE OpenFileMappingHandle2; - HANDLE lpMapViewAddress; - HANDLE lpMapViewAddress2; - const int LOWORDERSIZE = 1024; - char buf[] = "this is a test"; - char MapObject[] = "myMappingObject"; - char ch[1024]; - int RetVal = PASS; - - /* Initialize the PAL environment. - */ - if(0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Create a named file-mapping object with file handle FileHandle. - */ - FileMappingHandle = CreateFileMapping( - INVALID_HANDLE_VALUE, - NULL, /* Not inherited */ - PAGE_READWRITE, /* Read only */ - 0, /* High-order size */ - LOWORDERSIZE, /* Must be none 0 */ - MapObject); /* Named object */ - - - if(NULL == FileMappingHandle) - { - Fail("ERROR:%u:Failed to call CreateFileMapping to create " - "mapping object = \"%s\".\n", - GetLastError(), - MapObject); - } - if(GetLastError() == ERROR_ALREADY_EXISTS) - { - Trace("ERROR:File mapping object \"%s\" already exists!\n", - MapObject); - RetVal = FAIL; - goto CleanUpOne; - } - - /* Open a named file-mapping object with - * FILE_MAP_READ access. - */ - OpenFileMappingHandle = OpenFileMapping( - FILE_MAP_READ, - 0, - MapObject); - - if(NULL == OpenFileMappingHandle) - { - Trace("ERROR:%u: Failed to Call OpenFileMapping API.\n"); - RetVal = FAIL; - goto CleanUpOne; - } - - /* Open a named file-mapping object with - * FILE_MAP_ALL_ACCESS access, to verify the - * READ-ONLY Map view. - */ - OpenFileMappingHandle2 = OpenFileMapping( - FILE_MAP_ALL_ACCESS, - 0, - MapObject); - - if(NULL == OpenFileMappingHandle2) - { - Trace("Failed to Call OpenFileMapping API!\n"); - RetVal = FAIL; - goto CleanUpTwo; - } - - /* Test the opened map view. - */ - lpMapViewAddress = MapViewOfFile( - OpenFileMappingHandle, - FILE_MAP_READ, /* access code */ - 0, /* high order offset */ - 0, /* low order offset */ - LOWORDERSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewAddress) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpThree; - } - - /* Open the second Map view to verify the writing - * of the READ-ONLY Map view. - */ - lpMapViewAddress2 = MapViewOfFile( - OpenFileMappingHandle2, - FILE_MAP_ALL_ACCESS, /* access code */ - 0, /* high order offset */ - 0, /* low order offset */ - LOWORDERSIZE); /* number of bytes for map */ - - if(NULL == lpMapViewAddress2) - { - Trace("ERROR:%u: Failed to call MapViewOfFile " - "API to map a view of file!\n", - GetLastError()); - RetVal = FAIL; - goto CleanUpFour; - } - - /* Write to the ALL_ACCESS Map View. - */ - memcpy(lpMapViewAddress2, buf, strlen(buf)); - - /* Read from the READ-ONLY Map View. - */ - memcpy(ch, (LPCSTR)lpMapViewAddress, LOWORDERSIZE); - - /* Compare what was written to the Map View, - * to what was read. - */ - if (memcmp(ch, buf, strlen(buf))!= 0) - { - Trace("ERROR: MapViewOfFile not equal to file contents " - "retrieved \"%s\", expected \"%s\".\n", - ch, buf); - RetVal = FAIL; - goto CleanUpFive; - } - -CleanUpFive: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewAddress2) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewAddress2); - RetVal = FAIL; - } - -CleanUpFour: - - /* Unmap the view of file. - */ - if ( UnmapViewOfFile(lpMapViewAddress) == FALSE ) - { - Trace("ERROR:%u: Failed to UnmapViewOfFile of \"%0x%lx\".\n", - GetLastError(), - lpMapViewAddress); - RetVal = FAIL; - } - -CleanUpThree: - - /* Close Handle to opened file mapping. - */ - if ( CloseHandle(OpenFileMappingHandle2) == 0 ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - OpenFileMappingHandle2); - RetVal = FAIL; - } - -CleanUpTwo: - - /* Close Handle to opened file mapping. - */ - if ( CloseHandle(OpenFileMappingHandle) == 0 ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - OpenFileMappingHandle); - RetVal = FAIL; - } - -CleanUpOne: - - /* Close Handle to create file mapping. - */ - if ( CloseHandle(FileMappingHandle) == 0 ) - { - Trace("ERROR:%u: Failed to CloseHandle \"0x%lx\".\n", - GetLastError(), - FileMappingHandle); - RetVal = FAIL; - } - - /* Terminate the PAL. - */ - PAL_TerminateEx(RetVal); - return RetVal; -} diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/testinfo.dat deleted file mode 100644 index a6b02d890d56..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = OpenFileMappingA -Name = Positive test for OpenFileMappingA API with FILE_MAP_READ access -TYPE = DEFAULT -EXE1 = openfilemappinga -Description -=Test the OpenFileMappingA with FILE_MAP_READ access diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/CMakeLists.txt deleted file mode 100644 index 20b340f819ff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - OpenFileMappingW.cpp -) - -add_executable(paltest_openfilemappingw_test1 - ${SOURCES} -) - -add_dependencies(paltest_openfilemappingw_test1 coreclrpal) - -target_link_libraries(paltest_openfilemappingw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.cpp index f5680f070b3b..a7ba76aa7b1c 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.cpp @@ -15,7 +15,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_OpenFileMappingW_test1_paltest_openfilemappingw_test1, "filemapping_memmgt/OpenFileMappingW/test1/paltest_openfilemappingw_test1") { HANDLE lpMapViewAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/testinfo.dat deleted file mode 100644 index 78401088492c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = OpenFileMappingW -Name = Positive test for OpenFileMappingW API -TYPE = DEFAULT -EXE1 = openfilemappingw -Description -=Test the OpenFileMappingW with FILE_MAP_ALL_ACCESS access diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/CMakeLists.txt deleted file mode 100644 index 4f50f1e63005..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - OpenFileMappingW.cpp -) - -add_executable(paltest_openfilemappingw_test2 - ${SOURCES} -) - -add_dependencies(paltest_openfilemappingw_test2 coreclrpal) - -target_link_libraries(paltest_openfilemappingw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.cpp index 8b9f08955f48..c1d43ab16f99 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.cpp @@ -14,7 +14,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_OpenFileMappingW_test2_paltest_openfilemappingw_test2, "filemapping_memmgt/OpenFileMappingW/test2/paltest_openfilemappingw_test2") { HANDLE FileMappingHandle; HANDLE OpenFileMappingHandle; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/testinfo.dat deleted file mode 100644 index fc258fed1f9d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = OpenFileMappingW -Name = Positive test for OpenFileMappingW API -TYPE = DEFAULT -EXE1 = openfilemappingw -Description -=Test the OpenFileMappingW with FILE_MAP_WRITE access diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/CMakeLists.txt deleted file mode 100644 index 3fc9328cab38..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - OpenFileMappingW.cpp -) - -add_executable(paltest_openfilemappingw_test3 - ${SOURCES} -) - -add_dependencies(paltest_openfilemappingw_test3 coreclrpal) - -target_link_libraries(paltest_openfilemappingw_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.cpp index 7b55dfc428b8..ebffd6f2baf3 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.cpp @@ -14,7 +14,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_OpenFileMappingW_test3_paltest_openfilemappingw_test3, "filemapping_memmgt/OpenFileMappingW/test3/paltest_openfilemappingw_test3") { char buf[] = "this is a test"; char ch[1024]; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/testinfo.dat deleted file mode 100644 index 5ec676370952..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = OpenFileMappingW -Name = Positive test for OpenFileMappingW API with FILE_MAP_READ access -TYPE = DEFAULT -EXE1 = openfilemappingw -Description -=Test the OpenFileMappingW with FILE_MAP_READ access diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/CMakeLists.txt deleted file mode 100644 index 680635f23fe5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(ProbeMemory_neg1) -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/CMakeLists.txt deleted file mode 100644 index 50eaf4abf5ef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ProbeMemory_neg.cpp -) - -add_executable(paltest_probememory_probememory_neg1 - ${SOURCES} -) - -add_dependencies(paltest_probememory_probememory_neg1 coreclrpal) - -target_link_libraries(paltest_probememory_probememory_neg1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp index 1bca5c662ab9..8c052afae852 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp @@ -14,7 +14,7 @@ #define REGIONSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_ProbeMemory_ProbeMemory_neg1_paltest_probememory_probememory_neg1, "filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/paltest_probememory_probememory_neg1") { int err; BOOL bResult; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/testinfo.dat deleted file mode 100644 index 3f4fad673356..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = PAL_ProbeMemory -Name = Negative test PAL_ProbeMemory API to read unreadable memory area -TYPE = DEFAULT -EXE1 = probememory_neg -Description -=Test the PAL_ProbeMemory to read unreadable memory area diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/CMakeLists.txt deleted file mode 100644 index 08308e0e053b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ProbeMemory.cpp -) - -add_executable(paltest_probememory_test1 - ${SOURCES} -) - -add_dependencies(paltest_probememory_test1 coreclrpal) - -target_link_libraries(paltest_probememory_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp index 58dbcd67eb40..ffd00f1d4393 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp @@ -15,7 +15,7 @@ #define REGIONSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_ProbeMemory_test1_paltest_probememory_test1, "filemapping_memmgt/ProbeMemory/test1/paltest_probememory_test1") { int err; BOOL bResult; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/testinfo.dat deleted file mode 100644 index 9fd6b566c59e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = PAL_ProbeMemory -Name = Positive test for PAL_ProbeMemory API to probe for read/write -TYPE = DEFAULT -EXE1 = probememory -Description -=Test the PAL_ProbeMemory to probe for read and write diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/CMakeLists.txt deleted file mode 100644 index 8ada94f50a67..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - UnmapViewOfFile.cpp -) - -add_executable(paltest_unmapviewoffile_test1 - ${SOURCES} -) - -add_dependencies(paltest_unmapviewoffile_test1 coreclrpal) - -target_link_libraries(paltest_unmapviewoffile_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.cpp index 3b78ce617ec0..8c1fa48d48e2 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.cpp @@ -22,7 +22,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_UnmapViewOfFile_test1_paltest_unmapviewoffile_test1, "filemapping_memmgt/UnmapViewOfFile/test1/paltest_unmapviewoffile_test1") { const int MappingSize = 2048; HANDLE hFile; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/testinfo.dat deleted file mode 100644 index e5c136b60d5d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = UnmapViewOfFile -Name = Positive test UnmapViewOfFile API to unmap a view of file -TYPE = DEFAULT -EXE1 = unmapviewoffile -LANG = cpp -Description -= Test the UnmapViewOfFile to unmap a view of file. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/CMakeLists.txt deleted file mode 100644 index 958e36b74e85..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - unmapviewoffile.cpp -) - -add_executable(paltest_unmapviewoffile_test2 - ${SOURCES} -) - -add_dependencies(paltest_unmapviewoffile_test2 coreclrpal) - -target_link_libraries(paltest_unmapviewoffile_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/testinfo.dat deleted file mode 100644 index 5229c85d3628..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = UnmapViewOfFile -Name = Negative test UnmapViewOfFile API to unmap a view of file -TYPE = DEFAULT -EXE1 = unmapviewoffile -Description -= Test the UnmapViewOfFile to unmap a view of file -= negative test by passing a NULL mapping address. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.cpp index 43ab2b50cd11..b887891c46c9 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_UnmapViewOfFile_test2_paltest_unmapviewoffile_test2, "filemapping_memmgt/UnmapViewOfFile/test2/paltest_unmapviewoffile_test2") { int err; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/CMakeLists.txt deleted file mode 100644 index 0960bf91ff59..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test13) -add_subdirectory(test14) -add_subdirectory(test15) -add_subdirectory(test16) -add_subdirectory(test17) -add_subdirectory(test18) -add_subdirectory(test19) -add_subdirectory(test2) -add_subdirectory(test20) -add_subdirectory(test21) -add_subdirectory(test22) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) -add_subdirectory(test9) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/CMakeLists.txt deleted file mode 100644 index 9f5f71e72ab1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test1 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test1 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.cpp index f71175cbe4aa..c71373e5b615 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test1_paltest_virtualalloc_test1, "filemapping_memmgt/VirtualAlloc/test1/paltest_virtualalloc_test1") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/testinfo.dat deleted file mode 100644 index f5f575557498..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT allocation type -=and PAGE_READONLY access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/CMakeLists.txt deleted file mode 100644 index 0d04c27dc671..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test10 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test10 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.cpp index f24d64b26213..d17b699d5b6e 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test10_paltest_virtualalloc_test10, "filemapping_memmgt/VirtualAlloc/test10/paltest_virtualalloc_test10") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/testinfo.dat deleted file mode 100644 index 2c2db5db106e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_RESERVE allocation type -=and PAGE_EXECUTE_READ access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/CMakeLists.txt deleted file mode 100644 index f9b2425986af..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test11 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test11 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test11 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.cpp index 5f5440cf0bcb..af7549511e69 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.cpp @@ -14,7 +14,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test11_paltest_virtualalloc_test11, "filemapping_memmgt/VirtualAlloc/test11/paltest_virtualalloc_test11") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/testinfo.dat deleted file mode 100644 index 09830266b74a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_RESERVE allocation type -=and PAGE_EXECUTE_READWRITE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/CMakeLists.txt deleted file mode 100644 index 34b271ffa602..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test12 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test12 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.cpp index a2d8bb5adfb0..b6ef0fefcb58 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test12_paltest_virtualalloc_test12, "filemapping_memmgt/VirtualAlloc/test12/paltest_virtualalloc_test12") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/testinfo.dat deleted file mode 100644 index 3b014114d161..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT allocation type -=and PAGE_NOACCESS access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/CMakeLists.txt deleted file mode 100644 index bb1c11f7b1b2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test13 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test13 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test13 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.cpp index 0859c49d9144..8b6eee22f943 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test13_paltest_virtualalloc_test13, "filemapping_memmgt/VirtualAlloc/test13/paltest_virtualalloc_test13") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/testinfo.dat deleted file mode 100644 index ee11d926b931..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT|MEM_TOP_DOWN allocation type -=and PAGE_READONLY access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/CMakeLists.txt deleted file mode 100644 index 8f994b1683fc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test14 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test14 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test14 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.cpp index e76d12311f77..dd3b1d0d2ac8 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test14_paltest_virtualalloc_test14, "filemapping_memmgt/VirtualAlloc/test14/paltest_virtualalloc_test14") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/testinfo.dat deleted file mode 100644 index 5e38441a9fc6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT|MEM_TOP_DOWN allocation type -=and PAGE_READWRITE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/CMakeLists.txt deleted file mode 100644 index cd00816b66af..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test15 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test15 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test15 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.cpp index 10922602b1ff..58dfa9fcf8b1 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test15_paltest_virtualalloc_test15, "filemapping_memmgt/VirtualAlloc/test15/paltest_virtualalloc_test15") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/testinfo.dat deleted file mode 100644 index 76b6ed401cdf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT|MEM_TOP_DOWN allocation type -=and PAGE_EXECUTE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/CMakeLists.txt deleted file mode 100644 index 774353117639..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test16 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test16 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test16 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.cpp index 9cbe6ce85259..dae54ec2826b 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test16_paltest_virtualalloc_test16, "filemapping_memmgt/VirtualAlloc/test16/paltest_virtualalloc_test16") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/testinfo.dat deleted file mode 100644 index 6bbb9069a4d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT|MEM_TOP_DOWN allocation type -=and PAGE_EXECUTE_READ access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/CMakeLists.txt deleted file mode 100644 index 166eb99be977..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test17 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test17 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test17 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.cpp index d4efeb154086..64e15b5ecd9d 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.cpp @@ -14,7 +14,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test17_paltest_virtualalloc_test17, "filemapping_memmgt/VirtualAlloc/test17/paltest_virtualalloc_test17") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/testinfo.dat deleted file mode 100644 index 59155900f02c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT|MEM_TOP_DOWN allocation type -=and PAGE_EXECUTE_READWRITE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/CMakeLists.txt deleted file mode 100644 index eef8a48f933c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test18 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test18 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test18 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.cpp index 189298625ca7..420e72eb65ee 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test18_paltest_virtualalloc_test18, "filemapping_memmgt/VirtualAlloc/test18/paltest_virtualalloc_test18") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/testinfo.dat deleted file mode 100644 index a3f0f31a0af6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT|MEM_TOP_DOWN allocation type -=and PAGE_NOACCESS access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/CMakeLists.txt deleted file mode 100644 index b2c5b8a00498..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test19 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test19 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test19 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.cpp index d575daa39c76..28ca74f96eb2 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.cpp @@ -15,7 +15,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test19_paltest_virtualalloc_test19, "filemapping_memmgt/VirtualAlloc/test19/paltest_virtualalloc_test19") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/testinfo.dat deleted file mode 100644 index 0249bfc187ca..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc to reserve and commit -=simultaneously by using MEM_COMMIT|MEM_RESERVE|MEM_TOP_DOWN -=allocation type and PAGE_READONLY access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/CMakeLists.txt deleted file mode 100644 index 520cadcc7ef3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test2 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test2 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.cpp index dab649d718f3..28b117b6084f 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test2_paltest_virtualalloc_test2, "filemapping_memmgt/VirtualAlloc/test2/paltest_virtualalloc_test2") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/testinfo.dat deleted file mode 100644 index 9ca9f0f5fd35..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT allocation type -=and PAGE_READWRITE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/CMakeLists.txt deleted file mode 100644 index 354b3e641af6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - virtualalloc.cpp -) - -add_executable(paltest_virtualalloc_test20 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test20 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test20 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/testinfo.dat deleted file mode 100644 index a58268126fe8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test VirtualAlloc to ensure that re-committed memory is not changed. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.cpp index 3ed2b40364a1..b0fabd548004 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test20_paltest_virtualalloc_test20, "filemapping_memmgt/VirtualAlloc/test20/paltest_virtualalloc_test20") { int err; int *ptr; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/CMakeLists.txt deleted file mode 100644 index bb4cd0ab27ae..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - virtualalloc.cpp -) - -add_executable(paltest_virtualalloc_test21 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test21 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test21 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/testinfo.dat deleted file mode 100644 index 8fcc04474a9b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test VirtualAlloc to ensure that freed memory that is committed again is zeroed. diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.cpp index 1663bf6c1954..c45a898b5db6 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test21_paltest_virtualalloc_test21, "filemapping_memmgt/VirtualAlloc/test21/paltest_virtualalloc_test21") { int err; int *ptr; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/CMakeLists.txt deleted file mode 100644 index 8d132cc68da1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test22 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test22 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test22 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp index 74fea7da1773..d256c1220ff2 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test22_paltest_virtualalloc_test22, "filemapping_memmgt/VirtualAlloc/test22/paltest_virtualalloc_test22") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/testinfo.dat deleted file mode 100644 index 17da3b1e48ee..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Negative test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT allocation type -=and PAGE_READWRITEaccess protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/CMakeLists.txt deleted file mode 100644 index 1baefef90e0d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test3 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test3 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.cpp index e004a00a47a3..cfa22a11ae1e 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test3_paltest_virtualalloc_test3, "filemapping_memmgt/VirtualAlloc/test3/paltest_virtualalloc_test3") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/testinfo.dat deleted file mode 100644 index 08181b199c26..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT allocation type -=and PAGE_EXECUTE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/CMakeLists.txt deleted file mode 100644 index d9ef27468ae9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test4 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test4 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.cpp index e4250f685dc0..f745ec688173 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test4_paltest_virtualalloc_test4, "filemapping_memmgt/VirtualAlloc/test4/paltest_virtualalloc_test4") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/testinfo.dat deleted file mode 100644 index e30903b480fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT allocation type -=and PAGE_EXECUTE_READ access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/CMakeLists.txt deleted file mode 100644 index eb87fe1e6626..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test5 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test5 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.cpp index 4ff672bce349..c6014a98ca8b 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.cpp @@ -14,7 +14,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test5_paltest_virtualalloc_test5, "filemapping_memmgt/VirtualAlloc/test5/paltest_virtualalloc_test5") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/testinfo.dat deleted file mode 100644 index 929605dec721..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT allocation type -=and PAGE_EXECUTE_READWRITE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/CMakeLists.txt deleted file mode 100644 index de6f2d25463e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test6 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test6 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.cpp index a9a08734f1fc..c8d775a96fc8 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test6_paltest_virtualalloc_test6, "filemapping_memmgt/VirtualAlloc/test6/paltest_virtualalloc_test6") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/testinfo.dat deleted file mode 100644 index 3b014114d161..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_COMMIT allocation type -=and PAGE_NOACCESS access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/CMakeLists.txt deleted file mode 100644 index d7fcd5a40ad3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test7 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test7 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.cpp index 27285252f28d..3b9440078410 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test7_paltest_virtualalloc_test7, "filemapping_memmgt/VirtualAlloc/test7/paltest_virtualalloc_test7") { int err; LPVOID lpVirtualAddress; @@ -33,7 +33,7 @@ int __cdecl main(int argc, char *argv[]) if(NULL == lpVirtualAddress) { Fail("\nFailed to call VirtualAlloc API!\n"); - PAL_Terminate(); + PAL_TerminateEx(1); return 1; } @@ -42,7 +42,7 @@ int __cdecl main(int argc, char *argv[]) if(0 == err) { Fail("\nFailed to call VirtualFree API!\n"); - PAL_Terminate(); + PAL_TerminateEx(1); return 1; } diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/testinfo.dat deleted file mode 100644 index 7096b5462ba2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_RESERVE allocation type -=and PAGE_READONLY access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/CMakeLists.txt deleted file mode 100644 index 75295b1f64b0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test8 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test8 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.cpp index 9802e7b3a8d2..df778dc145a3 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test8_paltest_virtualalloc_test8, "filemapping_memmgt/VirtualAlloc/test8/paltest_virtualalloc_test8") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/testinfo.dat deleted file mode 100644 index fe712f77c17a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_RESERVE allocation type -=and PAGE_READWRITE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/CMakeLists.txt deleted file mode 100644 index e819321f3980..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualAlloc.cpp -) - -add_executable(paltest_virtualalloc_test9 - ${SOURCES} -) - -add_dependencies(paltest_virtualalloc_test9 coreclrpal) - -target_link_libraries(paltest_virtualalloc_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.cpp index 36d3cf786ab8..e6e434c68474 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualAlloc_test9_paltest_virtualalloc_test9, "filemapping_memmgt/VirtualAlloc/test9/paltest_virtualalloc_test9") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/testinfo.dat deleted file mode 100644 index 6ee923e448ff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualAlloc -Name = Positive test for VirtualAlloc API -TYPE = DEFAULT -EXE1 = virtualalloc -Description -=Test the VirtualAlloc with MEM_RESERVE allocation type -=and PAGE_EXECUTE access protection diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/CMakeLists.txt deleted file mode 100644 index 72832ce5186f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualFree.cpp -) - -add_executable(paltest_virtualfree_test1 - ${SOURCES} -) - -add_dependencies(paltest_virtualfree_test1 coreclrpal) - -target_link_libraries(paltest_virtualfree_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.cpp index 921457e6d3a9..35868de36380 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualFree_test1_paltest_virtualfree_test1, "filemapping_memmgt/VirtualFree/test1/paltest_virtualfree_test1") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/testinfo.dat deleted file mode 100644 index 462b8ffab1c4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualFree -Name = Positive test for VirtualFree API -TYPE = DEFAULT -EXE1 = virtualfree -Description -=Test the VirtualFree with MEM_DECOMMIT free -=operation type diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/CMakeLists.txt deleted file mode 100644 index a647cf5d3033..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualFree.cpp -) - -add_executable(paltest_virtualfree_test2 - ${SOURCES} -) - -add_dependencies(paltest_virtualfree_test2 coreclrpal) - -target_link_libraries(paltest_virtualfree_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.cpp index fe70d7d08732..d22f7058714b 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualFree_test2_paltest_virtualfree_test2, "filemapping_memmgt/VirtualFree/test2/paltest_virtualfree_test2") { int err; LPVOID lpVirtualAddress; @@ -33,7 +33,7 @@ int __cdecl main(int argc, char *argv[]) if(NULL == lpVirtualAddress) { Fail("\nFailed to call VirtualAlloc API!\n"); - PAL_Terminate(); + PAL_TerminateEx(1); return 1; } @@ -44,7 +44,7 @@ int __cdecl main(int argc, char *argv[]) if(0 == err) { Fail("\nFailed to call VirtualFree API!\n"); - PAL_Terminate(); + PAL_TerminateEx(1); return 1; } diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/testinfo.dat deleted file mode 100644 index 8942d13572a6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualFree -Name = Positive test for VirtualFree API -TYPE = DEFAULT -EXE1 = virtualfree -Description -=Test the VirtualFree with MEM_RELEASE free -=operation type diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/CMakeLists.txt deleted file mode 100644 index f77894ea022d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualFree.cpp -) - -add_executable(paltest_virtualfree_test3 - ${SOURCES} -) - -add_dependencies(paltest_virtualfree_test3 coreclrpal) - -target_link_libraries(paltest_virtualfree_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.cpp index 214f96c1d5ee..133f82c9f866 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.cpp @@ -16,7 +16,7 @@ #define VIRTUALSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualFree_test3_paltest_virtualfree_test3, "filemapping_memmgt/VirtualFree/test3/paltest_virtualfree_test3") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/testinfo.dat deleted file mode 100644 index 371b964b5a5d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualFree -Name = Positive test for VirtualFree API -TYPE = DEFAULT -EXE1 = virtualfree -Description -=Test the VirtualFree with MEM_DECOMMIT|MEM_RELEASE free -=operation type diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/CMakeLists.txt deleted file mode 100644 index ca5ce73dc030..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test6) -add_subdirectory(test7) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/CMakeLists.txt deleted file mode 100644 index 522a4cdd498f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualProtect.cpp -) - -add_executable(paltest_virtualprotect_test1 - ${SOURCES} -) - -add_dependencies(paltest_virtualprotect_test1 coreclrpal) - -target_link_libraries(paltest_virtualprotect_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.cpp index 36e107593c8a..be99cc4dd60a 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.cpp @@ -15,7 +15,7 @@ #define REGIONSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualProtect_test1_paltest_virtualprotect_test1, "filemapping_memmgt/VirtualProtect/test1/paltest_virtualprotect_test1") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/testinfo.dat deleted file mode 100644 index 51cbd6577f25..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualProtect -Name = Positive test for VirtualProtect - with PAGE_READWRITE -TYPE = DEFAULT -EXE1 = virtualprotect -Description -=Test the VirtualProtect to set new access protection -=as PAGE_READWRITE diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/CMakeLists.txt deleted file mode 100644 index e5e049c3e67a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualProtect.cpp -) - -add_executable(paltest_virtualprotect_test2 - ${SOURCES} -) - -add_dependencies(paltest_virtualprotect_test2 coreclrpal) - -target_link_libraries(paltest_virtualprotect_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.cpp index 0c95533f554f..84978365ab0a 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.cpp @@ -15,7 +15,7 @@ #define REGIONSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualProtect_test2_paltest_virtualprotect_test2, "filemapping_memmgt/VirtualProtect/test2/paltest_virtualprotect_test2") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/testinfo.dat deleted file mode 100644 index 12db123a8b6b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualProtect -Name = Positive test for VirtualProtect - with PAGE_EXECUTE -TYPE = DEFAULT -EXE1 = virtualprotect -Description -=Test the VirtualProtect to set new access protection -=as PAGE_EXECUTE diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/CMakeLists.txt deleted file mode 100644 index 537e4627d730..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualProtect.cpp -) - -add_executable(paltest_virtualprotect_test3 - ${SOURCES} -) - -add_dependencies(paltest_virtualprotect_test3 coreclrpal) - -target_link_libraries(paltest_virtualprotect_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.cpp index 86e35ebd0748..10f9b13d21e6 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.cpp @@ -15,7 +15,7 @@ #define REGIONSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualProtect_test3_paltest_virtualprotect_test3, "filemapping_memmgt/VirtualProtect/test3/paltest_virtualprotect_test3") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/testinfo.dat deleted file mode 100644 index 7817613f95e6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualProtect -Name = Positive test for VirtualProtect - with PAGE_EXECUTE_READ -TYPE = DEFAULT -EXE1 = virtualprotect -Description -=Test the VirtualProtect to set new access protection -=as PAGE_EXECUTE_READ diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/CMakeLists.txt deleted file mode 100644 index 4b5eb6e17f2b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualProtect.cpp -) - -add_executable(paltest_virtualprotect_test4 - ${SOURCES} -) - -add_dependencies(paltest_virtualprotect_test4 coreclrpal) - -target_link_libraries(paltest_virtualprotect_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.cpp index 61275e822b47..0dbc9accbc34 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.cpp @@ -15,7 +15,7 @@ #define REGIONSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualProtect_test4_paltest_virtualprotect_test4, "filemapping_memmgt/VirtualProtect/test4/paltest_virtualprotect_test4") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/testinfo.dat deleted file mode 100644 index 19d6b9eb3b23..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualProtect -Name = Positive test for VirtualProtect - with PAGE_EXECUTE_READWRITE -TYPE = DEFAULT -EXE1 = virtualprotect -Description -=Test the VirtualProtect to set new access protection -=as PAGE_EXECUTE_READWRITE diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/CMakeLists.txt deleted file mode 100644 index 5f08af8aca29..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualProtect.cpp -) - -add_executable(paltest_virtualprotect_test6 - ${SOURCES} -) - -add_dependencies(paltest_virtualprotect_test6 coreclrpal) - -target_link_libraries(paltest_virtualprotect_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.cpp index 6fa46642901e..96c1b65eea2c 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.cpp @@ -15,7 +15,7 @@ #define REGIONSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualProtect_test6_paltest_virtualprotect_test6, "filemapping_memmgt/VirtualProtect/test6/paltest_virtualprotect_test6") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/testinfo.dat deleted file mode 100644 index 7df0c9dc9e83..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualProtect -Name = Positive test for VirtualProtect - with PAGE_NOACCESS -TYPE = DEFAULT -EXE1 = virtualprotect -Description -=Test the VirtualProtect to set new access protection -=as PAGE_NOACCESS diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/CMakeLists.txt deleted file mode 100644 index 03ba8a379e1c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualProtect.cpp -) - -add_executable(paltest_virtualprotect_test7 - ${SOURCES} -) - -add_dependencies(paltest_virtualprotect_test7 coreclrpal) - -target_link_libraries(paltest_virtualprotect_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.cpp index fb60354c672a..5a65cb8dd138 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.cpp @@ -15,7 +15,7 @@ #define REGIONSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualProtect_test7_paltest_virtualprotect_test7, "filemapping_memmgt/VirtualProtect/test7/paltest_virtualprotect_test7") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/testinfo.dat deleted file mode 100644 index 1ba6e796f209..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualProtect -Name = Positive test for VirtualProtect - with PAGE_READONLY -TYPE = DEFAULT -EXE1 = virtualprotect -Description -=Test the VirtualProtect to set new access protection -=as PAGE_READONLY diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/CMakeLists.txt deleted file mode 100644 index 2fef93910940..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - VirtualQuery.cpp -) - -add_executable(paltest_virtualquery_test1 - ${SOURCES} -) - -add_dependencies(paltest_virtualquery_test1 coreclrpal) - -target_link_libraries(paltest_virtualquery_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.cpp b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.cpp index 3a414b36cbfa..b11e046d9252 100644 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.cpp +++ b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.cpp @@ -15,7 +15,7 @@ #define VIRTUALMEMORYSIZE 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(filemapping_memmgt_VirtualQuery_test1_paltest_virtualquery_test1, "filemapping_memmgt/VirtualQuery/test1/paltest_virtualquery_test1") { int err; LPVOID lpVirtualAddress; diff --git a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/testinfo.dat deleted file mode 100644 index 3d9d01e2e9a1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Filemapping_memmgt -Function = VirtualQuery -Name = Positive test for VirtualQuery API -TYPE = DEFAULT -EXE1 = virtualquery -Description -=Test the VirtualQuery to get the virtual page info diff --git a/src/coreclr/src/pal/tests/palsuite/issues.targets b/src/coreclr/src/pal/tests/palsuite/issues.targets new file mode 100644 index 000000000000..fd8a2c082519 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/issues.targets @@ -0,0 +1,35 @@ + + + + + + https://github.com/dotnet/runtime/issues/42289 + + + + + + + https://github.com/dotnet/runtime/issues/42291 + + + + + https://github.com/dotnet/runtime/issues/42291 + + + + + https://github.com/dotnet/runtime/issues/42291 + + + + + + https://github.com/dotnet/runtime/issues/7639 + + + https://github.com/dotnet/runtime/issues/42292 + + + diff --git a/src/coreclr/src/pal/tests/palsuite/loader/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/CMakeLists.txt deleted file mode 100644 index ffee9ae53b6c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(LoadLibraryA) -add_subdirectory(LoadLibraryW) - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/CMakeLists.txt deleted file mode 100644 index b8673b44b0d9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test5) -add_subdirectory(test7) - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/CMakeLists.txt deleted file mode 100644 index d8d84b2e5956..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - LoadLibraryA.cpp -) - -add_executable(paltest_loadlibrarya_test1 - ${SOURCES} -) - -add_dependencies(paltest_loadlibrarya_test1 coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.cpp index 942b540d4169..2ab9fe398606 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.cpp @@ -21,7 +21,7 @@ #define ModuleName "rotor_pal.dll" #endif -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryA_test1_paltest_loadlibrarya_test1, "loader/LoadLibraryA/test1/paltest_loadlibrarya_test1") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/testinfo.dat deleted file mode 100644 index 946efd2a1641..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryA -Name = Positive test for LoadLibraryA API to load Dynamic library module -TYPE = DEFAULT -EXE1 = loadlibrarya -Description -=Test the LoadLibraryA to map module into calling process address space - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/CMakeLists.txt deleted file mode 100644 index f8b83c47f0a1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - LoadLibraryA.cpp -) - -add_executable(paltest_loadlibrarya_test2 - ${SOURCES} -) - -add_dependencies(paltest_loadlibrarya_test2 coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.cpp index e8dc76d94591..7b26fec41db9 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.cpp @@ -12,7 +12,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryA_test2_paltest_loadlibrarya_test2, "loader/LoadLibraryA/test2/paltest_loadlibrarya_test2") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.cpp deleted file mode 100644 index 5664c6737756..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================= -** -** Source: mymoduale.c -** -** Purpose: Positive test the LoadLibrary API. -** - -** -**============================================================*/ - -int __cdecl main(int argc, char *argv[]) -{ - //only for testing LoadLibrary - return 0; -} diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/testinfo.dat deleted file mode 100644 index b0f3b00d49cd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryA -Name = Negative test LoadLibraryA API to load a not exist module -TYPE = DEFAULT -EXE1 = loadlibrarya -Description -=Test the LoadLibraryA to load a not exist module - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/CMakeLists.txt deleted file mode 100644 index b22469ab4362..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - loadlibrarya.cpp -) - -add_executable(paltest_loadlibrarya_test3 - ${SOURCES} -) - -add_dependencies(paltest_loadlibrarya_test3 coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.cpp index a0732f66f2e3..af8782a28016 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.cpp @@ -12,7 +12,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryA_test3_paltest_loadlibrarya_test3, "loader/LoadLibraryA/test3/paltest_loadlibrarya_test3") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/testinfo.dat deleted file mode 100644 index 47a426e0322c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryA -Name = Negative test LoadLibraryA API with a NULL module name -TYPE = DEFAULT -EXE1 = loadlibrarya -Description -=Test the LoadLibraryA to map NULL module into calling -=process address space - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/CMakeLists.txt deleted file mode 100644 index 1957f44fb88f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - loadlibrarya.cpp -) - -add_executable(paltest_loadlibrarya_test5 - ${SOURCES} -) - -add_dependencies(paltest_loadlibrarya_test5 coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp index b8216f724f15..690f1ba071c9 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryA_test5_paltest_loadlibrarya_test5, "loader/LoadLibraryA/test5/paltest_loadlibrarya_test5") { HMODULE ModuleHandle; char ModuleName[_MAX_FNAME]; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/testinfo.dat deleted file mode 100644 index 975519b5805a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test5/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryA -Name = Negative test for LoadLibraryA API by passing a module name without extension but with a trailing dot. -TYPE = DEFAULT -EXE1 = loadlibrarya -Description -=Test the LoadLibraryA by passing a module name without extension -=but with a trailing dot. - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/CMakeLists.txt deleted file mode 100644 index 29f8152b55c7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - loadlibrarya.cpp -) - -add_executable(paltest_loadlibrarya_test6 - ${TESTSOURCES} -) - -add_dependencies(paltest_loadlibrarya_test6 coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test6 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - dlltest.cpp -) - -add_executable(paltest_loadlibrarya_test6_dlltest - ${HELPERSOURCES} -) - -add_dependencies(paltest_loadlibrarya_test6_dlltest coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test6_dlltest - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.cpp index eb2a5e9d40e2..d71e0ea85c33 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.cpp @@ -59,7 +59,7 @@ BOOL PALAPI TestDll(HMODULE hLib) return (TRUE); } -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryA_test6_paltest_loadlibrarya_test6, "loader/LoadLibraryA/test6/paltest_loadlibrarya_test6") { HANDLE hFullLib; HANDLE hShortLib; @@ -165,7 +165,7 @@ int __cdecl main(int argc, char *argv[]) /* Terminate the PAL. */ - PAL_Terminate(); + PAL_TerminateEx(iRetVal); return iRetVal; } diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/testinfo.dat deleted file mode 100644 index a5252b6e389f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test6/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryA -Name = Positive test for LoadLibrary API -TYPE = DEFAULT -EXE1 = loadlibrarya -LIB1 = dlltest -Description -= Positive test the LoadLibrary API. Test will verify -= that it is unable to load the library twice. Once by -= using the full path name and secondly by using the -= short name. - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/CMakeLists.txt deleted file mode 100644 index ae287cc4cc5e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - LoadLibraryA.cpp -) - -add_executable(paltest_loadlibrarya_test7 - ${SOURCES} -) - -add_dependencies(paltest_loadlibrarya_test7 coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.cpp index 99aef0a5173e..78948e61698d 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.cpp @@ -21,7 +21,7 @@ #define ModuleName "rotor_pal.dll" #endif -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryA_test7_paltest_loadlibrarya_test7, "loader/LoadLibraryA/test7/paltest_loadlibrarya_test7") { HMODULE ModuleHandle; HMODULE ReturnHandle; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/testinfo.dat deleted file mode 100644 index c16a7d95a2df..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test7/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryA -Name = Positive and Negative test for LoadLibraryA API to load Dynamic library module -TYPE = DEFAULT -EXE1 = loadlibrarya -Description -=Test the LoadLibraryA to load multiple times and call unload more times than load - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/CMakeLists.txt deleted file mode 100644 index dd36aa94a8f5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - loadlibrarya.cpp -) - -add_executable(paltest_loadlibrarya_test8 - ${TESTSOURCES} -) - -add_dependencies(paltest_loadlibrarya_test8 coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test8 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - dlltest.cpp -) - -add_executable(paltest_loadlibrarya_test8_dlltest - ${HELPERSOURCES} -) - -add_dependencies(paltest_loadlibrarya_test8_dlltest coreclrpal) - -target_link_libraries(paltest_loadlibrarya_test8_dlltest - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.cpp index 62197cfedcaa..b489ef27f965 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.cpp @@ -59,7 +59,7 @@ BOOL PALAPI TestDll(HMODULE hLib) return (TRUE); } -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryA_test8_paltest_loadlibrarya_test8, "loader/LoadLibraryA/test8/paltest_loadlibrarya_test8") { HANDLE hFullLib; HANDLE hShortLib; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/testinfo.dat deleted file mode 100644 index 2d4bf04ec75b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryA/test8/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryA -Name = Positive test for LoadLibrary API -TYPE = DEFAULT -EXE1 = loadlibrarya -LIB1 = dlltest -Description -= Positive test the LoadLibrary API. Test will verify -= that it is able to load the library thrice. Once by -= using the full path name, second by using the -= short name and third by using relative paths - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/CMakeLists.txt deleted file mode 100644 index 2ad6ca8b274d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test5) - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/CMakeLists.txt deleted file mode 100644 index 8adb8a16e09a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - LoadLibraryW.cpp -) - -add_executable(paltest_loadlibraryw_test1 - ${SOURCES} -) - -add_dependencies(paltest_loadlibraryw_test1 coreclrpal) - -target_link_libraries(paltest_loadlibraryw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.cpp index bd680cc5d25c..26d6f2adefeb 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.cpp @@ -21,7 +21,7 @@ #define ModuleName "rotor_pal.dll" #endif -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryW_test1_paltest_loadlibraryw_test1, "loader/LoadLibraryW/test1/paltest_loadlibraryw_test1") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/testinfo.dat deleted file mode 100644 index f014e6c6833f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryW -Name = Positive test for LoadLibraryW API to load a dynamic library module -TYPE = DEFAULT -EXE1 = loadlibraryw -Description -=Test the LoadLibraryW to map module into calling process address space diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/CMakeLists.txt deleted file mode 100644 index e9a933e6e8f0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - loadlibraryw.cpp -) - -add_executable(paltest_loadlibraryw_test2 - ${SOURCES} -) - -add_dependencies(paltest_loadlibraryw_test2 coreclrpal) - -target_link_libraries(paltest_loadlibraryw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.cpp index 097b275906ca..f563bb0243f5 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.cpp @@ -13,7 +13,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryW_test2_paltest_loadlibraryw_test2, "loader/LoadLibraryW/test2/paltest_loadlibraryw_test2") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/testinfo.dat deleted file mode 100644 index 5f0e262a8990..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryW -Name = Negative test LoadLibraryW API to load a not exist module -TYPE = DEFAULT -EXE1 = loadlibraryw -Description -=Test the LoadLibraryW to load a not exist module - diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/CMakeLists.txt deleted file mode 100644 index ac6cf05d7b6a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - loadlibraryw.cpp -) - -add_executable(paltest_loadlibraryw_test3 - ${SOURCES} -) - -add_dependencies(paltest_loadlibraryw_test3 coreclrpal) - -target_link_libraries(paltest_loadlibraryw_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp index 9f405138c910..4c943597e428 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp @@ -13,7 +13,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryW_test3_paltest_loadlibraryw_test3, "loader/LoadLibraryW/test3/paltest_loadlibraryw_test3") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/testinfo.dat deleted file mode 100644 index cfd9c01c3adc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryW -Name = Negative test loadlibraryw API with a NULL module name -TYPE = DEFAULT -EXE1 = loadlibraryw -Description -=Test the LoadLibraryW with a NULL module name diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/CMakeLists.txt deleted file mode 100644 index 384da59a79a1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - loadlibraryw.cpp -) - -add_executable(paltest_loadlibraryw_test5 - ${SOURCES} -) - -add_dependencies(paltest_loadlibraryw_test5 coreclrpal) - -target_link_libraries(paltest_loadlibraryw_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp index 505b62053163..33b46fb0a406 100644 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp +++ b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp @@ -14,7 +14,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(loader_LoadLibraryW_test5_paltest_loadlibraryw_test5, "loader/LoadLibraryW/test5/paltest_loadlibraryw_test5") { HMODULE ModuleHandle; int err; diff --git a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/testinfo.dat deleted file mode 100644 index 055c9753f540..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/loader/LoadLibraryW/test5/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Loader -Function = LoadLibraryw -Name = Negative test for LoadLibraryW API by passing a module name without extension but with a trailing dot. -TYPE = DEFAULT -EXE1 = loadlibraryw -Description -=Test the LoadLibraryW by passing a module name without extension -=but with a trailing dot. - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/CMakeLists.txt deleted file mode 100644 index 41cc457c94a5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# TODO: make the following tests compile if they are needed -# add_subdirectory(CompareStringA) -# add_subdirectory(CompareStringW) -# add_subdirectory(GetLocaleInfoW) - -add_subdirectory(GetACP) -add_subdirectory(GetCPInfo) -add_subdirectory(IsDBCSLeadByte) -add_subdirectory(IsDBCSLeadByteEx) -add_subdirectory(MultiByteToWideChar) -add_subdirectory(WideCharToMultiByte) - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/CMakeLists.txt deleted file mode 100644 index 0d13e9830318..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_comparestringa_test1 - ${SOURCES} -) - -add_dependencies(paltest_comparestringa_test1 coreclrpal) - -target_link_libraries(paltest_comparestringa_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.cpp index 37beece4dfae..91d4ae9da3ca 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_CompareStringA_test1_paltest_comparestringa_test1, "locale_info/CompareStringA/test1/paltest_comparestringa_test1") { char str1[] = {'f','o','o',0}; char str2[] = {'f','o','o','x',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/testinfo.dat deleted file mode 100644 index 6bea1c67f24b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringA/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = CompareStringA -Name = Test #1 for CompareStringA -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that CompareStringA returns the correct value and can handle -=invalid parameters. diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/CMakeLists.txt deleted file mode 100644 index 24e0a187b024..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_comparestringw_test1 - ${SOURCES} -) - -add_dependencies(paltest_comparestringw_test1 coreclrpal) - -target_link_libraries(paltest_comparestringw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.cpp index 5c3f8b0e42bd..d15094609a99 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_CompareStringW_test1_paltest_comparestringw_test1, "locale_info/CompareStringW/test1/paltest_comparestringw_test1") { WCHAR str1[] = {'f','o','o',0}; WCHAR str2[] = {'f','o','o','x',0}; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/testinfo.dat deleted file mode 100644 index 95894f2dfcc7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/CompareStringW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = CompareStringW -Name = Test #1 for CompareStringW -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that CompareStringW returns the correct value and can handle -=invalid parameters. diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/CMakeLists.txt deleted file mode 100644 index e994d15c0d51..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_getacp_test1 - ${SOURCES} -) - -add_dependencies(paltest_getacp_test1 coreclrpal) - -target_link_libraries(paltest_getacp_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/test1.cpp index f0f1284d3c7a..0f315f2ffe61 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/test1.cpp @@ -19,7 +19,7 @@ #define EXPECTED_CP 65001 -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_GetACP_test1_paltest_getacp_test1, "locale_info/GetACP/test1/paltest_getacp_test1") { int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/testinfo.dat deleted file mode 100644 index 48c2a36859cc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetACP/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = GetACP -Name = Test #1 for GetACP -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that GetACP returns code-page 1252. diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/CMakeLists.txt deleted file mode 100644 index 619871319609..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_getcpinfo_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcpinfo_test1 coreclrpal) - -target_link_libraries(paltest_getcpinfo_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.cpp deleted file mode 100644 index 2ef184d6478b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: Tests that GetCPInfo works for CP_ACP and 0x4E4 (default codepage) -** Also makes sure it correctly handles an invalid code page. -** -** -**==========================================================================*/ - - -#include - - -int __cdecl main(int argc, char *argv[]) -{ - CPINFO cpinfo; - - if (0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - if (!GetCPInfo(CP_ACP, &cpinfo)) - { - Fail("GetCPInfo() unable to get info for CP_ACP\n"); - } - - if (!GetCPInfo(65001, &cpinfo)) - { - Fail("GetCPInfo() unable to get info for code page 65001 (utf8)\n"); - } - - if (GetCPInfo(-1, &cpinfo)) - { - Fail("GetCPInfo() did not error on invalid code page!\n"); - } - - if (GetLastError() != ERROR_INVALID_PARAMETER) - { - Fail("GetCPInfo() failed to set the last error to" - " ERROR_INVALID_PARAMETER!\n"); - } - - - PAL_Terminate(); - - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/testinfo.dat deleted file mode 100644 index a1b30072e1e2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = GetCPInfo -Name = Test #1 for GetCPInfo -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that GetCPInfo works for CP_ACP and 0x4E4 (default codepage) -=Also makes sure it correctly handles an invalid code page. diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/CMakeLists.txt deleted file mode 100644 index e10388ac9286..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_getcpinfo_test2 - ${SOURCES} -) - -add_dependencies(paltest_getcpinfo_test2 coreclrpal) - -target_link_libraries(paltest_getcpinfo_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.cpp deleted file mode 100644 index 0e47d54c230e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test2.c -** -** Purpose: Tests that GetCPInfo gives the correct information for codepage 0x4E4 -** (the default). -** -** -**==========================================================================*/ - - -#include - - -int __cdecl main(int argc, char *argv[]) -{ - CPINFO cpinfo; - int codepage; - unsigned int i; - - if (PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* - * codepage 1252 (0x4E4): Windows 3.1 Latin 1 (U.S., Western Europe) - */ - codepage = 1252; - - if (!GetCPInfo(codepage, &cpinfo)) - { - Fail("GetCPInfo() failed on default ansi code page!\n"); - } - if (cpinfo.MaxCharSize != 1) - { - Fail("GetCPInfo() returned incorrect MaxCharSize information!\n"); - } - if (cpinfo.DefaultChar[0] != '?' || cpinfo.DefaultChar[1] != 0) - { - Fail("GetCPInfo() returned incorrect DefaultChar information"); - } - - for (i = 0; i - -/* Currently only one CodePage "CP_ACP" is supported by the PAL */ - -int __cdecl main(int argc, char *argv[]) -{ - CPINFO cpinfo; - - /* Initialize the PAL. - */ - if (PAL_Initialize(argc, argv)) - { - return FAIL; - } - - /* Test GetCPInfo with CP_ACP. - */ - if (!GetCPInfo(CP_ACP, &cpinfo)) - { - Fail("GetCPInfo() unable to get info for code page %d!\n", CP_ACP); - } - - /* Terminate the PAL. - */ - PAL_Terminate(); - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/testinfo.dat deleted file mode 100644 index 13f7a292627c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/testinfo.dat +++ /dev/null @@ -1,8 +0,0 @@ -Version = 1.0 -Section = Locale Information -Function = GetCPInfo -Name = Test #3 for GetCPInfo -TYPE = DEFAULT -EXE1 = test3 -Description -=Tests that GetCPInfo passes for all valid code pages diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/CMakeLists.txt deleted file mode 100644 index cca2aa5585c6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_getlocaleinfow_test1 - ${SOURCES} -) - -add_dependencies(paltest_getlocaleinfow_test1 coreclrpal) - -target_link_libraries(paltest_getlocaleinfow_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp index 932ddc0313e9..13f8176f3e64 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp @@ -39,7 +39,7 @@ LocalInfoType Locales[] = int NumLocales = sizeof(Locales) / sizeof(Locales[0]); -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_GetLocaleInfoW_test1_paltest_getlocaleinfow_test1, "locale_info/GetLocaleInfoW/test1/paltest_getlocaleinfow_test1") { WCHAR buffer[256] = { 0 }; int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/testinfo.dat deleted file mode 100644 index be1629203570..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = GetLocaleInfoW -Name = Test #1 for GetLocaleInfoW -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that GetLocaleInfoW gives the correction information for LOCALE_NEUTRAL diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/CMakeLists.txt deleted file mode 100644 index 20ccbc363187..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_getlocaleinfow_test2 - ${SOURCES} -) - -add_dependencies(paltest_getlocaleinfow_test2 coreclrpal) - -target_link_libraries(paltest_getlocaleinfow_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.cpp index 215ee3e2c7f7..5a5a3aa21b3d 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_GetLocaleInfoW_test2_paltest_getlocaleinfow_test2, "locale_info/GetLocaleInfoW/test2/paltest_getlocaleinfow_test2") { WCHAR buffer[256] = { 0 }; int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/testinfo.dat deleted file mode 100644 index 4f8b045fc026..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = GetLocaleInfoW -Name = Test #2 for GetLocaleInfoW -TYPE = DEFAULT -EXE1 = test2 -Description -=Tests that GetLocaleInfoW will correctly return the amount of -=buffer space required. Also tests that it correctly handles a -=buffer of insufficient space. diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/CMakeLists.txt deleted file mode 100644 index afc3a306bb08..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isdbcsleadbyte_test1 - ${SOURCES} -) - -add_dependencies(paltest_isdbcsleadbyte_test1 coreclrpal) - -target_link_libraries(paltest_isdbcsleadbyte_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.cpp deleted file mode 100644 index 0d3b997010e0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: Tests that IsDBCSLeadByte does not find any lead-bytes in the -** current ansi code page -** -** -** TODO: Test for positive, i.e., if it is potentially isdbcsleadbyte -**==========================================================================*/ - - -#include - -void DoTest() -{ - int value; - int ret; - int i; - - - for (i=0; i<256; i++) - { - value = IsDBCSLeadByte(i); - - ret = GetLastError(); - if (ret == ERROR_INVALID_PARAMETER) - { - Fail("IsDBCSLeadByte unexpectedly errored with ERROR_INVALID_PARAMETER for %d!\n", i); - } - else if (ret != 0) - { - Fail("IsDBCSLeadByte had an unexpected error [%d] for %d!\n", ret, i); - } - else if (value) - { - Fail("IsDBCSLeadByte incorrectly found a lead byte in value [%d] for" - " %d\n", value, i); - } - - } -} - -int __cdecl main(int argc, char *argv[]) -{ - - if (0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - DoTest(); - - PAL_Terminate(); - -// setlocale( "japan", ); - - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/testinfo.dat deleted file mode 100644 index 5cdc938541b4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = IsDBCSLeadByte -Name = Test #1 for IsDBCSLeadByte -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that IsDBCSLeadByte does not find any lead-bytes in the -=current ansi code page diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/CMakeLists.txt deleted file mode 100644 index b3901ca0ce14..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_isdbcsleadbyteex_test1 - ${SOURCES} -) - -add_dependencies(paltest_isdbcsleadbyteex_test1 coreclrpal) - -target_link_libraries(paltest_isdbcsleadbyteex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.cpp deleted file mode 100644 index 036e2a392b19..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: test1.c -** -** Purpose: Tests that IsDBCSLeadByteEx does not find any lead-bytes in the -** current ansi code page or the default code page. Also tests that -** it correctly handles an invalid codepage. -** -** -**==========================================================================*/ - - -#include - -void DoTest(int codepage) -{ - int value; - int ret; - int i; - - - for (i=0; i<256; i++) - { - value = IsDBCSLeadByteEx(codepage, i); - - ret = GetLastError(); - if (ret == ERROR_INVALID_PARAMETER) - { - Fail("IsDBCSLeadByteEx unexpectedly errored with ERROR_INVALID_PARAMETER!\n"); - } - else if (ret != 0) - { - Fail("IsDBCSLeadByteEx had an unexpected error!\n"); - } - else if (value) - { - Fail("IsDBCSLeadByteEx incorrectly found a lead byte in code " - "page %d\n", codepage); - } - - } -} - -int __cdecl main(int argc, char *argv[]) -{ - - if (0 != PAL_Initialize(argc, argv)) - { - return FAIL; - } - - if (IsDBCSLeadByteEx(-1, 0)) - { - Fail("IsDBCSLeadByteEx did not error on an invalid code page!\n"); - } - - /* Clear the last error. */ - SetLastError(0); - - - DoTest(0); - DoTest(CP_ACP); - - PAL_Terminate(); - - return PASS; -} - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/testinfo.dat deleted file mode 100644 index ead792e7a6e9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = IsDBCSLeadByteEx -Name = Test #1 for IsDBCSLeadByteEx -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that IsDBCSLeadByteEx does not find any lead-bytes in the -=current ansi code page or the default code page. Also tests that -=it correctly handles an invalid codepage. diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/CMakeLists.txt deleted file mode 100644 index 03456f5e2930..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/CMakeLists.txt deleted file mode 100644 index 24c812e67275..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_multibytetowidechar_test1 - ${SOURCES} -) - -add_dependencies(paltest_multibytetowidechar_test1 coreclrpal) - -target_link_libraries(paltest_multibytetowidechar_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.cpp index a10c00d3ef2f..bbd8ab11c00f 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.cpp @@ -19,7 +19,7 @@ * with CP_ACP, and that dwFlags will be 0. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_MultiByteToWideChar_test1_paltest_multibytetowidechar_test1, "locale_info/MultiByteToWideChar/test1/paltest_multibytetowidechar_test1") { char mbStr[128]; WCHAR wideStr[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/testinfo.dat deleted file mode 100644 index 0548926e8469..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = MultiByteToWideChar -Name = Test #1 for MultiByteToWideChar -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests MultiByteToWideChar with all the ASCII characters (0-127). -=Also tests that WideCharToMultiByte handles different buffer -=lengths correctly (0, -1, and a valid length) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/CMakeLists.txt deleted file mode 100644 index e60ae207c944..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_multibytetowidechar_test2 - ${SOURCES} -) - -add_dependencies(paltest_multibytetowidechar_test2 coreclrpal) - -target_link_libraries(paltest_multibytetowidechar_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.cpp index e4649b116daf..e98b03db070f 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.cpp @@ -18,7 +18,7 @@ * with CP_ACP, and that dwFlags will be 0. */ -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_MultiByteToWideChar_test2_paltest_multibytetowidechar_test2, "locale_info/MultiByteToWideChar/test2/paltest_multibytetowidechar_test2") { char mbStr[128]; WCHAR wideStr[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/testinfo.dat deleted file mode 100644 index 84d190a8fab9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = MultiByteToWideChar -Name = Test #2 for MultiByteToWideChar -TYPE = DEFAULT -EXE1 = test2 -Description -=Tests that MultiByteToWideChar respects the length of the wide -=character string. diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/CMakeLists.txt deleted file mode 100644 index e6397e5a4a51..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_multibytetowidechar_test3 - ${SOURCES} -) - -add_dependencies(paltest_multibytetowidechar_test3 coreclrpal) - -target_link_libraries(paltest_multibytetowidechar_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.cpp index 5553e73cdaf9..2e36b3e3a145 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.cpp @@ -15,7 +15,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_MultiByteToWideChar_test3_paltest_multibytetowidechar_test3, "locale_info/MultiByteToWideChar/test3/paltest_multibytetowidechar_test3") { char mbStr[128]; WCHAR wideStr[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/testinfo.dat deleted file mode 100644 index 603565d64a18..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = MultiByteToWideChar -Name = Test #3 for MultiByteToWideChar -TYPE = DEFAULT -EXE1 = test3 -Description -=Tests that MultiByteToWideChar correctly handles the following -=error conditions: insufficient buffer space, invalid code pages, -=and invalid flags. - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/CMakeLists.txt deleted file mode 100644 index feb8d69756db..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_multibytetowidechar_test4 - ${SOURCES} -) - -add_dependencies(paltest_multibytetowidechar_test4 coreclrpal) - -target_link_libraries(paltest_multibytetowidechar_test4 - ${COMMON_TEST_LIBRARIES} -) \ No newline at end of file diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.cpp index 758d3c875cbc..cab71f15e709 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_MultiByteToWideChar_test4_paltest_multibytetowidechar_test4, "locale_info/MultiByteToWideChar/test4/paltest_multibytetowidechar_test4") { int ret; int ret2; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/testinfo.dat deleted file mode 100644 index e95f4139046d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# - -Version = 1.0 -Section = Locale Information -Function = MultiByteToWideChar -Name = Test #4 for MultiByteToWideChar -TYPE = DEFAULT -EXE1 = test4 -Description -=Tests MultiByteToWideChar with UTF-8 encoded strings -=containing various corner cases \ No newline at end of file diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/CMakeLists.txt deleted file mode 100644 index 7db3404bbe53..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/CMakeLists.txt deleted file mode 100644 index a55f4e82fdd3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_widechartomultibyte_test1 - ${SOURCES} -) - -add_dependencies(paltest_widechartomultibyte_test1 coreclrpal) - -target_link_libraries(paltest_widechartomultibyte_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.cpp index 3bdc124e9f9d..e8197b8c11b4 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_WideCharToMultiByte_test1_paltest_widechartomultibyte_test1, "locale_info/WideCharToMultiByte/test1/paltest_widechartomultibyte_test1") { char mbStr[128]; WCHAR wideStr[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/testinfo.dat deleted file mode 100644 index 518a52988bee..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = WideCharToMultiByte -Name = Test #1 for WideCharToMultiByte -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests WideCharToMultiByte with all the ASCII characters (0-127). -=Also tests that WideCharToMultiByte handles different buffer -=lengths correctly (0, -1, and a valid length) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/CMakeLists.txt deleted file mode 100644 index 941f0f50e22b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_widechartomultibyte_test2 - ${SOURCES} -) - -add_dependencies(paltest_widechartomultibyte_test2 coreclrpal) - -target_link_libraries(paltest_widechartomultibyte_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.cpp index f4cee255adc4..611b1b92b1b1 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_WideCharToMultiByte_test2_paltest_widechartomultibyte_test2, "locale_info/WideCharToMultiByte/test2/paltest_widechartomultibyte_test2") { char mbStr[128]; WCHAR wideStr[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/testinfo.dat deleted file mode 100644 index 3b29e9514ac1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = WideCharToMultiByte -Name = Test #2 for WideCharToMultiByte -TYPE = DEFAULT -EXE1 = test2 -Description -=Tests that WideCharToMultiByte respects the length of the wide -=character string. diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/CMakeLists.txt deleted file mode 100644 index d2719ad75d32..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_widechartomultibyte_test3 - ${SOURCES} -) - -add_dependencies(paltest_widechartomultibyte_test3 coreclrpal) - -target_link_libraries(paltest_widechartomultibyte_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.cpp index 46c7f47fa9a7..3bb816dcb883 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_WideCharToMultiByte_test3_paltest_widechartomultibyte_test3, "locale_info/WideCharToMultiByte/test3/paltest_widechartomultibyte_test3") { char mbStr[128]; WCHAR wideStr[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/testinfo.dat deleted file mode 100644 index 9ecf1f29309a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = WideCharToMultiByte -Name = Test #3 for WideCharToMultiByte -TYPE = DEFAULT -EXE1 = test3 -Description -=Tests that WideCharToMultiByte correctly handles the following -=error conditions: insufficient buffer space and invalid code pages. - diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/CMakeLists.txt deleted file mode 100644 index 43bfbd062e21..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_widechartomultibyte_test4 - ${SOURCES} -) - -add_dependencies(paltest_widechartomultibyte_test4 coreclrpal) - -target_link_libraries(paltest_widechartomultibyte_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.cpp index 7c81884d73dc..19b5796bf1f5 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.cpp @@ -59,7 +59,7 @@ TestWideCharToMultiByte( return testStatus; } -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_WideCharToMultiByte_test4_paltest_widechartomultibyte_test4, "locale_info/WideCharToMultiByte/test4/paltest_widechartomultibyte_test4") { int testStatus = PASS; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/testinfo.dat deleted file mode 100644 index fd7575e8f624..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Locale Information -Function = WideCharToMultiByte -Name = Test #4 for WideCharToMultiByte -TYPE = DEFAULT -EXE1 = test4 -Description -=Tests that WideCharToMultiByte correctly handles WC_NO_BEST_FIT_CHARS diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/CMakeLists.txt deleted file mode 100644 index 5906634768ce..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_widechartomultibyte_test5 - ${SOURCES} -) - -add_dependencies(paltest_widechartomultibyte_test5 coreclrpal) - -target_link_libraries(paltest_widechartomultibyte_test5 - ${COMMON_TEST_LIBRARIES} -) \ No newline at end of file diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.cpp index c01bbe0756cf..bf2dabedefa8 100644 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(locale_info_WideCharToMultiByte_test5_paltest_widechartomultibyte_test5, "locale_info/WideCharToMultiByte/test5/paltest_widechartomultibyte_test5") { int ret; int ret2; diff --git a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/testinfo.dat deleted file mode 100644 index 485d9401e5eb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright (c) Microsoft Corporation. All rights reserved. -# - -Version = 1.0 -Section = Locale Information -Function = WideCharToMultiByte -Name = Test #5 for WideCharToMultiByte -TYPE = DEFAULT -EXE1 = test5 -Description -=Tests WideCharToMultiByte conversion to UTF-8 -=containing various corner cases \ No newline at end of file diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/CMakeLists.txt deleted file mode 100644 index 2ff735b23223..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_cgroup_test1 - ${SOURCES} -) - -add_dependencies(paltest_cgroup_test1 coreclrpal) - -target_link_libraries(paltest_cgroup_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/test.cpp index d44c7a753a20..8b1ee94ba315 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/test.cpp @@ -22,7 +22,7 @@ #include -int __cdecl main(int argc,char *argv[]) +PALTEST(miscellaneous_CGroup_test1_paltest_cgroup_test1, "miscellaneous/CGroup/test1/paltest_cgroup_test1") { /* diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/testinfo.dat deleted file mode 100644 index 672a583a78ed..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CGroup/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = CGroup -Name = Positive Test for CGroup -TYPE = DEFAULT -EXE1 = test -Description -= Test to see if Cgroup memory limit works properly diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt deleted file mode 100644 index a0518e239b14..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -add_subdirectory(CGroup) -add_subdirectory(CloseHandle) -add_subdirectory(CreatePipe) -add_subdirectory(FlushInstructionCache) -add_subdirectory(FormatMessageW) -add_subdirectory(FreeEnvironmentStringsW) -add_subdirectory(GetCommandLineW) -add_subdirectory(GetEnvironmentStringsW) -add_subdirectory(GetEnvironmentVariableA) -add_subdirectory(GetEnvironmentVariableW) -add_subdirectory(GetLastError) -add_subdirectory(GetSystemInfo) -add_subdirectory(GlobalMemoryStatusEx) -add_subdirectory(GetTickCount) -add_subdirectory(InterlockedBit) -add_subdirectory(InterlockedCompareExchange) -add_subdirectory(InterlockedCompareExchange64) -add_subdirectory(InterlockedCompareExchangePointer) -add_subdirectory(InterlockedDecrement) -add_subdirectory(InterlockedDecrement64) -add_subdirectory(InterlockedExchange) -add_subdirectory(InterlockedExchange64) -add_subdirectory(InterLockedExchangeAdd) -add_subdirectory(InterlockedExchangePointer) -add_subdirectory(InterlockedIncrement) -add_subdirectory(InterlockedIncrement64) -add_subdirectory(queryperformancecounter) -add_subdirectory(queryperformancefrequency) -add_subdirectory(SetEnvironmentVariableA) -add_subdirectory(SetEnvironmentVariableW) -add_subdirectory(SetLastError) -add_subdirectory(_i64tow) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/CMakeLists.txt deleted file mode 100644 index 34fbb1200e24..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_charnexta_test1 - ${SOURCES} -) - -add_dependencies(paltest_charnexta_test1 coreclrpal) - -target_link_libraries(paltest_charnexta_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/CMakeLists.txt deleted file mode 100644 index 1203e12752c3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_charnexta_test2 - ${SOURCES} -) - -add_dependencies(paltest_charnexta_test2 coreclrpal) - -target_link_libraries(paltest_charnexta_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/CMakeLists.txt deleted file mode 100644 index 886d89da1e31..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_charnextexa_test1 - ${SOURCES} -) - -add_dependencies(paltest_charnextexa_test1 coreclrpal) - -target_link_libraries(paltest_charnextexa_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/CMakeLists.txt deleted file mode 100644 index 15278efdc350..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_charnextexa_test2 - ${SOURCES} -) - -add_dependencies(paltest_charnextexa_test2 coreclrpal) - -target_link_libraries(paltest_charnextexa_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/CMakeLists.txt deleted file mode 100644 index 0715ea025b8e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_closehandle_test1 - ${SOURCES} -) - -add_dependencies(paltest_closehandle_test1 coreclrpal) - -target_link_libraries(paltest_closehandle_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.cpp index ad1bed2ab6f7..a45322ad2ef4 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_CloseHandle_test1_paltest_closehandle_test1, "miscellaneous/CloseHandle/test1/paltest_closehandle_test1") { HANDLE FileHandle = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/testinfo.dat deleted file mode 100644 index 3ac8f45d7962..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = CloseHandle -Name = Positive Test for CloseHandle -TYPE = DEFAULT -EXE1 = test -Description -= Open a file to get a handle, and then close the file using CloseHandle - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/CMakeLists.txt deleted file mode 100644 index ae5b509ed536..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_closehandle_test2 - ${SOURCES} -) - -add_dependencies(paltest_closehandle_test2 coreclrpal) - -target_link_libraries(paltest_closehandle_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.cpp index 70aa9c4bcef9..48188be27a09 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_CloseHandle_test2_paltest_closehandle_test2, "miscellaneous/CloseHandle/test2/paltest_closehandle_test2") { HANDLE SomeHandle = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/testinfo.dat deleted file mode 100644 index a69f5d5b0518..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = CloseHandle -Name = Positive Test for CloseHandle -TYPE = DEFAULT -EXE1 = test -Description -= Attempt to close an unintialized HANDLE, should be unable to do this. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/CMakeLists.txt deleted file mode 100644 index 8242bbd12474..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_createpipe_test1 - ${SOURCES} -) - -add_dependencies(paltest_createpipe_test1 coreclrpal) - -target_link_libraries(paltest_createpipe_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.cpp index df2b8f667173..f0f686924cba 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.cpp @@ -20,9 +20,9 @@ #include -const char* cTestString = "one fish, two fish, red fish, blue fish."; +#define cTestString "one fish, two fish, read fish, blue fish." -int __cdecl main(int argc, char **argv) +PALTEST(miscellaneous_CreatePipe_test1_paltest_createpipe_test1, "miscellaneous/CreatePipe/test1/paltest_createpipe_test1") { HANDLE hReadPipe = NULL; HANDLE hWritePipe = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/testinfo.dat deleted file mode 100644 index d36f44faf47a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = CreatePipe -Name = Test for CreatePipe -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the CreatePipe function. -= This test will create two pipes, a read and a write. Once -= the pipes have been created, they will be tested by writing -= and then reading, then comparing the results. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/CMakeLists.txt deleted file mode 100644 index c3e8011077f7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_flushinstructioncache_test1 - ${SOURCES} -) - -add_dependencies(paltest_flushinstructioncache_test1 coreclrpal) - -target_link_libraries(paltest_flushinstructioncache_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.cpp index 1ff3d9e898ae..c14915d76d54 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.cpp @@ -47,7 +47,7 @@ void DoTest(void *Buffer, int Size, int Expected) } -int __cdecl main(int argc,char *argv[]) +PALTEST(miscellaneous_FlushInstructionCache_test1_paltest_flushinstructioncache_test1, "miscellaneous/FlushInstructionCache/test1/paltest_flushinstructioncache_test1") { char ValidPtr[256]; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/testinfo.dat deleted file mode 100644 index bb2d259cdf02..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FlushInstructionCache -Name = Positive Test #1 for FlushInstructionCache -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that FlushInstructionCache returns the correct value for a -=number of different inputs. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/CMakeLists.txt deleted file mode 100644 index 828a2878bf12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/CMakeLists.txt deleted file mode 100644 index 191da48fff97..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_formatmessagew_test1 - ${SOURCES} -) - -add_dependencies(paltest_formatmessagew_test1 coreclrpal) - -target_link_libraries(paltest_formatmessagew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.cpp index 05b4bca36d32..9c1955355008 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.cpp @@ -14,7 +14,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_FormatMessageW_test1_paltest_formatmessagew_test1, "miscellaneous/FormatMessageW/test1/paltest_formatmessagew_test1") +{ WCHAR TheString[] = {'P','a','l',' ','T','e','s','t','\0'}; WCHAR OutBuffer[128]; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/testinfo.dat deleted file mode 100644 index c057584ef983..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FormatMessageW -Name = Positive test of FormatMessageW -TYPE = DEFAULT -EXE1 = test -Description -= Test a very simple case -- basically just copy a string into a buffer, -= no formatting. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/CMakeLists.txt deleted file mode 100644 index 5f0f6cefe532..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_formatmessagew_test2 - ${SOURCES} -) - -add_dependencies(paltest_formatmessagew_test2 coreclrpal) - -target_link_libraries(paltest_formatmessagew_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.cpp index a4a9a4d00b0f..679818579638 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.cpp @@ -13,7 +13,7 @@ #define UNICODE #include -WCHAR OutBuffer[1024]; +WCHAR OutBuffer_FormatMessageW_test2[1024]; /* Pass this test the string "INSERT" and it will succeed */ @@ -24,14 +24,14 @@ int test1(int num, ...) int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -46,12 +46,12 @@ int test1(int num, ...) } - if(memcmp(OutBuffer, convert("Pal INSERT Testing"), - wcslen(OutBuffer)*2+2) != 0) + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal INSERT Testing"), + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal INSERT " "Testing' but '%s' was returned.", - convertC(OutBuffer)); + convertC(OutBuffer_FormatMessageW_test2)); } @@ -68,14 +68,14 @@ int test2(int num, ...) va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -89,10 +89,10 @@ int test2(int num, ...) " with the 'i' formatter."); } - if(memcmp(OutBuffer, convert("Pal 40 Testing"),wcslen(OutBuffer)*2+2) != 0) + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal 40 Testing"),wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal 40 Testing' " - "but '%s' was returned.", convertC(OutBuffer)); + "but '%s' was returned.", convertC(OutBuffer_FormatMessageW_test2)); } return PASS; } @@ -105,13 +105,13 @@ int test3(int num, ...) { int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -125,10 +125,10 @@ int test3(int num, ...) { " with the 'c' formatter."); } - if(memcmp(OutBuffer, convert("Pal a Testing"),wcslen(OutBuffer)*2+2) != 0) + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal a Testing"),wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal a Testing' " - "but '%s' was returned.", convertC(OutBuffer)); + "but '%s' was returned.", convertC(OutBuffer_FormatMessageW_test2)); } @@ -143,13 +143,13 @@ int test4(int num, ...) { int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -163,10 +163,10 @@ int test4(int num, ...) { " with the 'C' formatter."); } - if(memcmp(OutBuffer, convert("Pal a Testing"),wcslen(OutBuffer)*2+2) != 0) + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal a Testing"),wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal a Testing' " - "but '%s' was returned.",convertC(OutBuffer)); + "but '%s' was returned.",convertC(OutBuffer_FormatMessageW_test2)); } return PASS; @@ -181,14 +181,14 @@ int test5(int num, ...) int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -203,10 +203,10 @@ int test5(int num, ...) } - if(memcmp(OutBuffer, convert("Pal 57 Testing"),wcslen(OutBuffer)*2+2) != 0) + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal 57 Testing"),wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal 57 Testing' " - "but '%s' was returned.",convertC(OutBuffer)); + "but '%s' was returned.",convertC(OutBuffer_FormatMessageW_test2)); } @@ -221,14 +221,14 @@ int test6(int num, ...) { int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -243,11 +243,11 @@ int test6(int num, ...) { } - if(memcmp(OutBuffer, convert("Pal a and b Testing"), - wcslen(OutBuffer)*2+2) != 0) + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal a and b Testing"), + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal a and b " - "Testing' but '%s' was returned.", convertC(OutBuffer)); + "Testing' but '%s' was returned.", convertC(OutBuffer_FormatMessageW_test2)); } @@ -263,14 +263,14 @@ int test7(int num, ...) int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -285,12 +285,12 @@ int test7(int num, ...) } - if(memcmp(OutBuffer, + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal 90 and foo and bar Testing"), - wcslen(OutBuffer)*2+2) != 0) + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal 90 and foo " - "and bar Testing' but '%s' was returned.",convertC(OutBuffer)); + "and bar Testing' but '%s' was returned.",convertC(OutBuffer_FormatMessageW_test2)); } return PASS; @@ -306,14 +306,14 @@ int test8(int num, ...) int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -328,12 +328,12 @@ int test8(int num, ...) } - if(memcmp(OutBuffer, + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal a and b and 50 and 100 Testing"), - wcslen(OutBuffer)*2+2) != 0) + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal a and b and 50" - " and 100 Testing' but '%s' was returned.",convertC(OutBuffer)); + " and 100 Testing' but '%s' was returned.",convertC(OutBuffer_FormatMessageW_test2)); } @@ -350,13 +350,13 @@ int test9(int num, ...) { int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -371,12 +371,12 @@ int test9(int num, ...) { } - if(memcmp(OutBuffer, + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal foo and bar and 56 Testing"), - wcslen(OutBuffer)*2+2) != 0) + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal foo and bar " - "and 56 Testing' but '%s' was returned.",convertC(OutBuffer)); + "and 56 Testing' but '%s' was returned.",convertC(OutBuffer_FormatMessageW_test2)); } @@ -392,13 +392,13 @@ int test10(int num, ...) int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -413,12 +413,12 @@ int test10(int num, ...) } - if(memcmp(OutBuffer, + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal 123ab and 123CD Testing"), - wcslen(OutBuffer)*2+2) != 0) + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal 123ab and " - "123CD Testing' but '%s' was returned.", convertC(OutBuffer)); + "123CD Testing' but '%s' was returned.", convertC(OutBuffer_FormatMessageW_test2)); } @@ -434,14 +434,14 @@ int test11(int num, ...) int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -461,31 +461,31 @@ int test11(int num, ...) */ #if defined(HOST_64BIT) Trace("Testing for 64 Bit Platforms \n"); - if(memcmp(OutBuffer, + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal 00000000000123AB and foo Testing"), - wcslen(OutBuffer)*2+2) != 0 && + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0 && /* BSD style */ - memcmp( OutBuffer, + memcmp( OutBuffer_FormatMessageW_test2, convert( "Pal 0x123ab and foo Testing" ), - wcslen(OutBuffer)*2+2 ) != 0 ) + wcslen(OutBuffer_FormatMessageW_test2)*2+2 ) != 0 ) { Fail("ERROR: The formated string should have been 'Pal 000123AB and " - "foo Testing' but '%s' was returned.",convertC(OutBuffer)); + "foo Testing' but '%s' was returned.",convertC(OutBuffer_FormatMessageW_test2)); } #else Trace("Testing for Non 64 Bit Platforms \n"); - if(memcmp(OutBuffer, + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal 000123AB and foo Testing"), - wcslen(OutBuffer)*2+2) != 0 && + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0 && /* BSD style */ - memcmp( OutBuffer, + memcmp( OutBuffer_FormatMessageW_test2, convert( "Pal 0x123ab and foo Testing" ), - wcslen(OutBuffer)*2+2 ) != 0 ) + wcslen(OutBuffer_FormatMessageW_test2)*2+2 ) != 0 ) { Fail("ERROR: The formated string should have been 'Pal 000123AB and " - "foo Testing' but '%s' was returned.",convertC(OutBuffer)); + "foo Testing' but '%s' was returned.",convertC(OutBuffer_FormatMessageW_test2)); } @@ -504,14 +504,14 @@ int test12(int num, ...) int ReturnResult; va_list TheList; va_start(TheList,num); - memset( OutBuffer, 0, 1024 * sizeof(OutBuffer[0]) ); + memset( OutBuffer_FormatMessageW_test2, 0, 1024 * sizeof(OutBuffer_FormatMessageW_test2[0]) ); ReturnResult = FormatMessage( FORMAT_MESSAGE_FROM_STRING, /* source and processing options */ TheString, /* message source */ 0, /* message identifier */ 0, /* language identifier */ - OutBuffer, /* message buffer */ + OutBuffer_FormatMessageW_test2, /* message buffer */ 1024, /* maximum size of message buffer */ &TheList /* array of message inserts */ ); @@ -526,20 +526,20 @@ int test12(int num, ...) } - if(memcmp(OutBuffer, + if(memcmp(OutBuffer_FormatMessageW_test2, convert("Pal 100 and 123ab and 123CD Testing"), - wcslen(OutBuffer)*2+2) != 0) + wcslen(OutBuffer_FormatMessageW_test2)*2+2) != 0) { Fail("ERROR: The formated string should have been 'Pal 100 and " "123ab and 123CD Testing' but '%s' was returned.", - convertC(OutBuffer)); + convertC(OutBuffer_FormatMessageW_test2)); } return PASS; } -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_FormatMessageW_test2_paltest_formatmessagew_test2, "miscellaneous/FormatMessageW/test2/paltest_formatmessagew_test2") { WCHAR szwInsert[] = {'I','N','S','E','R','T','\0'}; WCHAR szwFoo[] = {'f','o','o','\0'}; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/testinfo.dat deleted file mode 100644 index dc5713728288..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FormatMessageW -Name = Positive test of FormatMessageW -TYPE = DEFAULT -EXE1 = test -Description -= A collection of tests to check and make sure all the standard formatters work. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/CMakeLists.txt deleted file mode 100644 index 98532f3ddb13..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_formatmessagew_test3 - ${SOURCES} -) - -add_dependencies(paltest_formatmessagew_test3 coreclrpal) - -target_link_libraries(paltest_formatmessagew_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.cpp index e46214f84151..47474477c87e 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.cpp @@ -13,10 +13,10 @@ #define UNICODE #include -WCHAR OutBuffer[1024]; -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_FormatMessageW_test3_paltest_formatmessagew_test3, "miscellaneous/FormatMessageW/test3/paltest_formatmessagew_test3") { + WCHAR OutBuffer[1024]; WCHAR * TheString; WCHAR * CorrectString; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/testinfo.dat deleted file mode 100644 index 704b4c29c499..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FormatMessageW -Name = Positive test of FormatMessageW -TYPE = DEFAULT -EXE1 = test -Description -= Test to ensure the IGNORE_INSERTS flag works properly. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/CMakeLists.txt deleted file mode 100644 index 1a0dcad8ee2f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_formatmessagew_test4 - ${SOURCES} -) - -add_dependencies(paltest_formatmessagew_test4 coreclrpal) - -target_link_libraries(paltest_formatmessagew_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.cpp index 7ebe91de5ef1..0760a8495507 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.cpp @@ -13,10 +13,10 @@ #define UNICODE #include -WCHAR OutBuffer[1024]; -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_FormatMessageW_test4_paltest_formatmessagew_test4, "miscellaneous/FormatMessageW/test4/paltest_formatmessagew_test4") { + WCHAR OutBuffer[1024]; WCHAR * TheString; WCHAR* TheArray[3]; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/testinfo.dat deleted file mode 100644 index dbe71255aafd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FormatMessageW -Name = Positive test of FormatMessageW -TYPE = DEFAULT -EXE1 = test -Description -= Test to ensure the FORMAT_MESSAGE_ARGUMENT_ARRAY flag works properly. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/CMakeLists.txt deleted file mode 100644 index c0c69e819215..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_formatmessagew_test5 - ${SOURCES} -) - -add_dependencies(paltest_formatmessagew_test5 coreclrpal) - -target_link_libraries(paltest_formatmessagew_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.cpp index a27f42ebcf7d..b7a21c496e8f 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.cpp @@ -14,7 +14,8 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_FormatMessageW_test5_paltest_formatmessagew_test5, "miscellaneous/FormatMessageW/test5/paltest_formatmessagew_test5") +{ WCHAR * TheString; LPWSTR OutBuffer; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/testinfo.dat deleted file mode 100644 index 39e525c759a5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FormatMessageW -Name = Positive test of FormatMessageW -TYPE = DEFAULT -EXE1 = test -Description -= Test to ensure the FORMAT_MESSAGE_ALLOCATE_BUFFER flag works properly. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/CMakeLists.txt deleted file mode 100644 index cdbd9be0dafb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_formatmessagew_test6 - ${SOURCES} -) - -add_dependencies(paltest_formatmessagew_test6 coreclrpal) - -target_link_libraries(paltest_formatmessagew_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.cpp index 510946421df1..b16b0ea27754 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.cpp @@ -15,7 +15,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_FormatMessageW_test6_paltest_formatmessagew_test6, "miscellaneous/FormatMessageW/test6/paltest_formatmessagew_test6") +{ LPWSTR OutBuffer; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/testinfo.dat deleted file mode 100644 index 6ca71938f152..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FormatMessageW -Name = Positive test of FormatMessageW -TYPE = DEFAULT -EXE1 = test -Description -= Test to ensure the FORMAT_SYSTEM_MESSAGE flag works properly. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/CMakeLists.txt deleted file mode 100644 index 059e1bfc1ca3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_freeenvironmentstringsw_test1 - ${SOURCES} -) - -add_dependencies(paltest_freeenvironmentstringsw_test1 coreclrpal) - -target_link_libraries(paltest_freeenvironmentstringsw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.cpp index a8d371800701..1d90fdd15721 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.cpp @@ -13,7 +13,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_FreeEnvironmentStringsW_test1_paltest_freeenvironmentstringsw_test1, "miscellaneous/FreeEnvironmentStringsW/test1/paltest_freeenvironmentstringsw_test1") { LPWSTR CapturedEnvironment = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/testinfo.dat deleted file mode 100644 index 33267b23b031..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FreeEnvironmentStringsW -Name = Return value test for FreeEnvironmentStringsW -TYPE = DEFAULT -EXE1 = test -Description -= Get a set of strings and then free it to see if function returns success - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/CMakeLists.txt deleted file mode 100644 index b47c4f012bbd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_freeenvironmentstringsw_test2 - ${SOURCES} -) - -add_dependencies(paltest_freeenvironmentstringsw_test2 coreclrpal) - -target_link_libraries(paltest_freeenvironmentstringsw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.cpp index c961ee625026..1bf34eda6ecb 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.cpp @@ -13,7 +13,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_FreeEnvironmentStringsW_test2_paltest_freeenvironmentstringsw_test2, "miscellaneous/FreeEnvironmentStringsW/test2/paltest_freeenvironmentstringsw_test2") { WCHAR CapturedEnvironment[] = {'T','E','S','T','\0'}; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/testinfo.dat deleted file mode 100644 index e9ee3e4a5788..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = FreeEnvironmentStringsW -Name = Positive Return value test for FreeEnvironmentStringsW -TYPE = DEFAULT -EXE1 = test -Description -= Ensure that FreeEnvironmentStringsW returns success when passed pointers -= that don't point to an environment block. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/CMakeLists.txt deleted file mode 100644 index c60f7101c56a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getcommandlinew_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcommandlinew_test1 coreclrpal) - -target_link_libraries(paltest_getcommandlinew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.cpp index 9604138a5ece..eca5a53a3194 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.cpp @@ -13,7 +13,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetCommandLineW_test1_paltest_getcommandlinew_test1, "miscellaneous/GetCommandLineW/test1/paltest_getcommandlinew_test1") { LPWSTR TheResult = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/testinfo.dat deleted file mode 100644 index 19fba6d0667e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetCommandLineW -Name = Positive test for GetCommandLineW -TYPE = DEFAULT -EXE1 = test -Description -= Ensure that this function returns the correct CommandLine - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/CMakeLists.txt deleted file mode 100644 index dbeaffc635a8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentstringsw_test1 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentstringsw_test1 coreclrpal) - -target_link_libraries(paltest_getenvironmentstringsw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.cpp index 9cdabf2d525f..3d76f17bb466 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.cpp @@ -15,7 +15,8 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GetEnvironmentStringsW_test1_paltest_getenvironmentstringsw_test1, "miscellaneous/GetEnvironmentStringsW/test1/paltest_getenvironmentstringsw_test1") +{ LPWSTR CapturedEnvironmentStrings = NULL; LPWSTR EnviroStringReturned = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/testinfo.dat deleted file mode 100644 index 3e7c3e6ffbd6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentStringsW -Name = Test for correct return of GetEnvironmentStringsW -TYPE = DEFAULT -EXE1 = test -Description -= Get a set of strings, and check to make sure it contains a predetermined -= string that was placed there. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/CMakeLists.txt deleted file mode 100644 index 828a2878bf12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/CMakeLists.txt deleted file mode 100644 index e434fd1b7197..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentvariablea_test1 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablea_test1 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.cpp index 35edd29a6db2..165ebdaeca47 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.cpp @@ -14,7 +14,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GetEnvironmentVariableA_test1_paltest_getenvironmentvariablea_test1, "miscellaneous/GetEnvironmentVariableA/test1/paltest_getenvironmentvariablea_test1") +{ /* Define some buffers needed for the function */ char * pResultBuffer = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/testinfo.dat deleted file mode 100644 index 104eab1bab3a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableA -Name = Return value test for GetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test -Description -= Assign a properly sized buffer and get an environment variable, check to -= ensure it returns the correct values. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/CMakeLists.txt deleted file mode 100644 index cdfa4c920875..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentvariablea_test2 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablea_test2 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablea_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.cpp index ac0b9ebb02a3..71561403fff5 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.cpp @@ -16,7 +16,8 @@ #define SMALL_BUFFER_SIZE 1 -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GetEnvironmentVariableA_test2_paltest_getenvironmentvariablea_test2, "miscellaneous/GetEnvironmentVariableA/test2/paltest_getenvironmentvariablea_test2") +{ /* A place to stash the returned values */ int ReturnValueForSmallBuffer = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/testinfo.dat deleted file mode 100644 index 55150d5dc671..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableA -Name = Return value test on GetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test -Description -= Pass a small buffer to GetEnvironmentVariableA -= to ensure it returns the size it requires. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/CMakeLists.txt deleted file mode 100644 index 20dd149cce9d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentvariablea_test3 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablea_test3 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablea_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.cpp index 96a2a93fd24b..87920f66a376 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.cpp @@ -17,7 +17,7 @@ #define BUFFER_SIZE 5000 #define SMALL_BUFFER_SIZE 5 -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetEnvironmentVariableA_test3_paltest_getenvironmentvariablea_test3, "miscellaneous/GetEnvironmentVariableA/test3/paltest_getenvironmentvariablea_test3") { int ReturnValueForNonExisting = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/testinfo.dat deleted file mode 100644 index 7f049668700d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableA -Name = Return value test for GetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test -Description -= Pass a nonexisting environment variable and a null to the function -= to check return values. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/CMakeLists.txt deleted file mode 100644 index 14dc464b278b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentvariablea_test4 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablea_test4 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablea_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.cpp index 35431e074d3d..b8e5607af90d 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.cpp @@ -18,7 +18,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GetEnvironmentVariableA_test4_paltest_getenvironmentvariablea_test4, "miscellaneous/GetEnvironmentVariableA/test4/paltest_getenvironmentvariablea_test4") +{ /* Define some buffers needed for the function */ char * pResultBuffer = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/testinfo.dat deleted file mode 100644 index d0e01fd76cc1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableA -Name = Positive Test for GetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test -Description -= Set an Environment Variable, then use GetEnvironmentVariable -= to retrieve it ensure that it retrieves properly. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/CMakeLists.txt deleted file mode 100644 index d5ceb8cf5775..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_getenvironmentvariablea_test5 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablea_test5 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablea_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.cpp index e65573542277..347826b7e4e7 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetEnvironmentVariableA_test5_paltest_getenvironmentvariablea_test5, "miscellaneous/GetEnvironmentVariableA/test5/paltest_getenvironmentvariablea_test5") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/testinfo.dat deleted file mode 100644 index 91baadc4c538..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableA -Name = Positive Test for GetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test5 -Description -= Set environment variables that differ only in case -= and verify that on BSD they return two different -= values. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/CMakeLists.txt deleted file mode 100644 index e9ca7390c8df..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_getenvironmentvariablea_test6 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablea_test6 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablea_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.cpp index 2f1107fdb4fe..81b2453c4f6d 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.cpp @@ -15,7 +15,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetEnvironmentVariableA_test6_paltest_getenvironmentvariablea_test6, "miscellaneous/GetEnvironmentVariableA/test6/paltest_getenvironmentvariablea_test6") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/testinfo.dat deleted file mode 100644 index 6f1952b47987..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableA -Name = Positive Test for GetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test6 -Description -= Set an Environment Variable, then use GetEnvironmentVariable -= to retrieve the Variable, using a name that differs only in -= Case. In Windows this should not affect the return value -= of the function. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/CMakeLists.txt deleted file mode 100644 index 828a2878bf12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/CMakeLists.txt deleted file mode 100644 index 2ce264d3396b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentvariablew_test1 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablew_test1 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.cpp index 50c40afc7a74..115486229f10 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.cpp @@ -13,7 +13,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetEnvironmentVariableW_test1_paltest_getenvironmentvariablew_test1, "miscellaneous/GetEnvironmentVariableW/test1/paltest_getenvironmentvariablew_test1") { /* Define some buffers needed for the function */ diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/testinfo.dat deleted file mode 100644 index 40adb9cd4da6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableW -Name = Return value test for GetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test -Description -= Assign a properly sized buffer and get an environment variable, -= check to ensure it returns the correct values. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/CMakeLists.txt deleted file mode 100644 index edcf8db43ca6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentvariablew_test2 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablew_test2 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablew_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.cpp index b4308a8bd5c5..444db4ec3162 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.cpp @@ -16,7 +16,7 @@ #define SMALL_BUFFER_SIZE 1 -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetEnvironmentVariableW_test2_paltest_getenvironmentvariablew_test2, "miscellaneous/GetEnvironmentVariableW/test2/paltest_getenvironmentvariablew_test2") { WCHAR pSmallBuffer[SMALL_BUFFER_SIZE]; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/testinfo.dat deleted file mode 100644 index 0fc404753f76..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableW -Name = Return value test on GetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test -Description -= Pass a small buffer to GetEnvironmentVariableW -= to ensure it returns the size it requires. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/CMakeLists.txt deleted file mode 100644 index da0aa869022e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentvariablew_test3 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablew_test3 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablew_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.cpp index d489996f64a3..8d1c8f8577ab 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.cpp @@ -16,7 +16,7 @@ #define BUFFER_SIZE 5000 #define SMALL_BUFFER_SIZE 5 -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetEnvironmentVariableW_test3_paltest_getenvironmentvariablew_test3, "miscellaneous/GetEnvironmentVariableW/test3/paltest_getenvironmentvariablew_test3") { /* Define some buffers needed for the function */ diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/testinfo.dat deleted file mode 100644 index 86464a2f3a0f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableW -Name = Return value test for GetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test -Description -= Pass a nonexisting environment variable and a null to the function -= to check return values. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/CMakeLists.txt deleted file mode 100644 index f2b472c8cec5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getenvironmentvariablew_test4 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablew_test4 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablew_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.cpp index 47f1c217b581..481252be3833 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.cpp @@ -16,7 +16,8 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GetEnvironmentVariableW_test4_paltest_getenvironmentvariablew_test4, "miscellaneous/GetEnvironmentVariableW/test4/paltest_getenvironmentvariablew_test4") +{ /* Define some buffers needed for the function */ WCHAR * pResultBuffer = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/testinfo.dat deleted file mode 100644 index ae1965ca49ff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableW -Name = Positive Test for GetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test -Description -= Set an Environment Variable, then use GetEnvironmentVariable -= to retrieve it -- ensure that it retrieves properly. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/CMakeLists.txt deleted file mode 100644 index 37884eecaccc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_getenvironmentvariablew_test5 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablew_test5 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablew_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.cpp index d0932ae184f9..3601d22a5f46 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetEnvironmentVariableW_test5_paltest_getenvironmentvariablew_test5, "miscellaneous/GetEnvironmentVariableW/test5/paltest_getenvironmentvariablew_test5") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/testinfo.dat deleted file mode 100644 index b53bf6a81e35..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableW -Name = Positive Test for GetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test5 -Description -= Set an Environment Variable, then use GetEnvironmentVariable -= to retrieve it. Then set another environment variable that differs -= from the original variable only by case and verify that -= GetEnvironmnetVariable returns the correct value. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/CMakeLists.txt deleted file mode 100644 index 8a780b8bacb6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_getenvironmentvariablew_test6 - ${SOURCES} -) - -add_dependencies(paltest_getenvironmentvariablew_test6 coreclrpal) - -target_link_libraries(paltest_getenvironmentvariablew_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.cpp index abd9fc267027..533f8e9f0d08 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_GetEnvironmentVariableW_test6_paltest_getenvironmentvariablew_test6, "miscellaneous/GetEnvironmentVariableW/test6/paltest_getenvironmentvariablew_test6") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/testinfo.dat deleted file mode 100644 index 102cf8edcaca..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetEnvironmentVariableW -Name = Positive Test for GetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test6 -Description -= Set an Environment Variable, then use GetEnvironmentVariable -= to retrieve the Variable, using a name that differs only in -= Case. In Windows this should not affect the return value -= of the function. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/CMakeLists.txt deleted file mode 100644 index 28ca478f2b43..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getlasterror_test1 - ${SOURCES} -) - -add_dependencies(paltest_getlasterror_test1 coreclrpal) - -target_link_libraries(paltest_getlasterror_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.cpp index c106f9c9030d..159c9f197f41 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.cpp @@ -34,7 +34,8 @@ static void test(DWORD error ) } -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GetLastError_test1_paltest_getlasterror_test1, "miscellaneous/GetLastError/test1/paltest_getlasterror_test1") +{ /* diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/testinfo.dat deleted file mode 100644 index 44c0197aae00..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetLastError -Name = Positive Test for GetLastError -TYPE = DEFAULT -EXE1 = test -Description -= Ensure GetLastError returns the error message which was set. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/CMakeLists.txt deleted file mode 100644 index 1fd61e2fc7f5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_getsysteminfo_test1 - ${SOURCES} -) - -add_dependencies(paltest_getsysteminfo_test1 coreclrpal) - -target_link_libraries(paltest_getsysteminfo_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.cpp index f9cb513b7a60..6b2d638b174f 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.cpp @@ -12,7 +12,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GetSystemInfo_test1_paltest_getsysteminfo_test1, "miscellaneous/GetSystemInfo/test1/paltest_getsysteminfo_test1") +{ SYSTEM_INFO TheSystemInfo; SYSTEM_INFO* pSystemInfo = &TheSystemInfo; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/testinfo.dat deleted file mode 100644 index ac3a2251084b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetSystemInfo -Name = Positive Test for GetSystemInfo -TYPE = DEFAULT -EXE1 = test -Description -= Ensures the two required System Info fields can be aquired, -= and the others are all 0. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/CMakeLists.txt deleted file mode 100644 index 7ad0ef0084b6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_gettickcount_test1 - ${SOURCES} -) - -add_dependencies(paltest_gettickcount_test1 coreclrpal) - -target_link_libraries(paltest_gettickcount_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.cpp index 2638f93808b7..f783ff878ceb 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.cpp @@ -14,7 +14,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GetTickCount_test1_paltest_gettickcount_test1, "miscellaneous/GetTickCount/test1/paltest_gettickcount_test1") +{ DWORD FirstCount = 0; DWORD SecondCount = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/testinfo.dat deleted file mode 100644 index dde3d04fbc1c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GetTickCount -Name = Positive Test for GetTickCount -TYPE = DEFAULT -EXE1 = test -Description -= Grab two Tick Counts with this function, and ensure that -= the second is larger to show that the tick count is increasing. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/CMakeLists.txt deleted file mode 100644 index 718513d95954..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_globalmemorystatusex_test1 - ${SOURCES} -) - -add_dependencies(paltest_globalmemorystatusex_test1 coreclrpal) - -target_link_libraries(paltest_globalmemorystatusex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/test.cpp index 84de313e71d1..358341e8aa3e 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/test.cpp @@ -12,7 +12,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_GlobalMemoryStatusEx_test1_paltest_globalmemorystatusex_test1, "miscellaneous/GlobalMemoryStatusEx/test1/paltest_globalmemorystatusex_test1") +{ MEMORYSTATUSEX memoryStatus; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/testinfo.dat deleted file mode 100644 index af14d1b24329..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/GlobalMemoryStatusEx/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = GlobalMemoryStatusEx -Name = Positive Test for GlobalMemoryStatusEx -TYPE = DEFAULT -EXE1 = test -Description -= Ensures that invocation of GlobalMemoryStatusEx succeeds and -= that it returns nonzero virtual and physical memory sizes - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/CMakeLists.txt deleted file mode 100644 index 9602e0b698c6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedexchangeadd_test1 - ${SOURCES} -) - -add_dependencies(paltest_interlockedexchangeadd_test1 coreclrpal) - -target_link_libraries(paltest_interlockedexchangeadd_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/test.cpp index ba91df17c1c4..1d4b258adbae 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterLockedExchangeAdd/test1/test.cpp @@ -18,7 +18,7 @@ */ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterLockedExchangeAdd_test1_paltest_interlockedexchangeadd_test1, "miscellaneous/InterLockedExchangeAdd/test1/paltest_interlockedexchangeadd_test1") { LONG TheReturn; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/CMakeLists.txt deleted file mode 100644 index be162fb28a3a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedbit_test1 - ${SOURCES} -) - -add_dependencies(paltest_interlockedbit_test1 coreclrpal) - -target_link_libraries(paltest_interlockedbit_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/test.cpp index 027a292c327e..20236a3ab1dc 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/test.cpp @@ -20,17 +20,17 @@ typedef struct tag_TEST_DATA UCHAR expectedReturnValue; } TEST_DATA; -TEST_DATA test_data[] = +PALTEST(miscellaneous_InterlockedBit_test1_paltest_interlockedbit_test1, "miscellaneous/InterlockedBit/test1/paltest_interlockedbit_test1") { - { (LONG)0x00000000, 3, (LONG)0x00000000, 0 }, - { (LONG)0x12341234, 2, (LONG)0x12341230, 1 }, - { (LONG)0x12341234, 3, (LONG)0x12341234, 0 }, - { (LONG)0x12341234, 31, (LONG)0x12341234, 0 }, - { (LONG)0x12341234, 28, (LONG)0x02341234, 1 }, - { (LONG)0xffffffff, 28, (LONG)0xefffffff, 1 } -}; - -int __cdecl main(int argc, char *argv[]) { + TEST_DATA test_data[] = + { + { (LONG)0x00000000, 3, (LONG)0x00000000, 0 }, + { (LONG)0x12341234, 2, (LONG)0x12341230, 1 }, + { (LONG)0x12341234, 3, (LONG)0x12341234, 0 }, + { (LONG)0x12341234, 31, (LONG)0x12341234, 0 }, + { (LONG)0x12341234, 28, (LONG)0x02341234, 1 }, + { (LONG)0xffffffff, 28, (LONG)0xefffffff, 1 } + }; /* * Initialize the PAL and return FAILURE if this fails diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/testinfo.dat deleted file mode 100644 index ab6067ab1511..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedBitTestAndReset -Name = Test for InterlockedBitTestAndReset -TYPE = DEFAULT -EXE1 = test -Description -Test validates that function InterlockedBitTestAndReset work as intended. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/CMakeLists.txt deleted file mode 100644 index 1771ad9d2fb2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedbit_test2 - ${SOURCES} -) - -add_dependencies(paltest_interlockedbit_test2 coreclrpal) - -target_link_libraries(paltest_interlockedbit_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/test.cpp index 0bb01ff124fc..956084fd5c71 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/test.cpp @@ -20,17 +20,17 @@ typedef struct tag_TEST_DATA UCHAR expectedReturnValue; } TEST_DATA; -TEST_DATA test_data[] = +PALTEST(miscellaneous_InterlockedBit_test2_paltest_interlockedbit_test2, "miscellaneous/InterlockedBit/test2/paltest_interlockedbit_test2") { - { (LONG)0x00000000, 2, (LONG)0x00000004, 0 }, - { (LONG)0x12341234, 2, (LONG)0x12341234, 1 }, - { (LONG)0x12341234, 3, (LONG)0x1234123c, 0 }, - { (LONG)0x12341234, 31, (LONG)0x92341234, 0 }, - { (LONG)0x12341234, 28, (LONG)0x12341234, 1 }, - { (LONG)0xffffffff, 28, (LONG)0xffffffff, 1 } -}; - -int __cdecl main(int argc, char *argv[]) { + TEST_DATA test_data[] = + { + { (LONG)0x00000000, 2, (LONG)0x00000004, 0 }, + { (LONG)0x12341234, 2, (LONG)0x12341234, 1 }, + { (LONG)0x12341234, 3, (LONG)0x1234123c, 0 }, + { (LONG)0x12341234, 31, (LONG)0x92341234, 0 }, + { (LONG)0x12341234, 28, (LONG)0x12341234, 1 }, + { (LONG)0xffffffff, 28, (LONG)0xffffffff, 1 } + }; /* * Initialize the PAL and return FAILURE if this fails diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/testinfo.dat deleted file mode 100644 index 9c206d31b346..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedBit/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedBitTestAndSet -Name = Test for InterlockedBitTestAndSet -TYPE = DEFAULT -EXE1 = test -Description -Test validates that function InterlockedBitTestAndSet work as intended. - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/CMakeLists.txt deleted file mode 100644 index f5546b912913..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedcompareexchange_test1 - ${SOURCES} -) - -add_dependencies(paltest_interlockedcompareexchange_test1 coreclrpal) - -target_link_libraries(paltest_interlockedcompareexchange_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/test.cpp index 2d98aac47b0f..473c98067d07 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/test.cpp @@ -22,7 +22,8 @@ #define SECOND_VALUE 5 #define THIRD_VALUE 10 -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_InterlockedCompareExchange_test1_paltest_interlockedcompareexchange_test1, "miscellaneous/InterlockedCompareExchange/test1/paltest_interlockedcompareexchange_test1") +{ int BaseVariableToManipulate = START_VALUE; int ValueToExchange = SECOND_VALUE; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/testinfo.dat deleted file mode 100644 index 857c40b684e8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedCompareExchange -Name = Positive test of InterlockedCompareExchange -TYPE = DEFAULT -EXE1 = test -Description -= Test to see if both successful and unsuccessful compare exchanges workp -= roperly -- ie. Exchange and don't exchange. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/CMakeLists.txt deleted file mode 100644 index e19fb1184a75..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedcompareexchange_test2 - ${SOURCES} -) - -add_dependencies(paltest_interlockedcompareexchange_test2 coreclrpal) - -target_link_libraries(paltest_interlockedcompareexchange_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/test.cpp index 42c94087fc43..1e05e83a44f4 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange/test2/test.cpp @@ -29,7 +29,8 @@ void ReleaseLock(PLONG pLock); //Main entry point of the program -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_InterlockedCompareExchange_test2_paltest_interlockedcompareexchange_test2, "miscellaneous/InterlockedCompareExchange/test2/paltest_interlockedcompareexchange_test2") +{ int i = 0; DWORD dwThreadID=0; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/CMakeLists.txt deleted file mode 100644 index 7a5f9271b2d7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedcompareexchange64_test1 - ${SOURCES} -) - -add_dependencies(paltest_interlockedcompareexchange64_test1 coreclrpal) - -target_link_libraries(paltest_interlockedcompareexchange64_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/test.cpp index e91a1461e5a3..2fd50dfdbbf6 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/test.cpp @@ -22,7 +22,8 @@ #define SECOND_VALUE 5 #define THIRD_VALUE 10 -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_InterlockedCompareExchange64_test1_paltest_interlockedcompareexchange64_test1, "miscellaneous/InterlockedCompareExchange64/test1/paltest_interlockedcompareexchange64_test1") +{ LONGLONG BaseVariableToManipulate = START_VALUE; LONGLONG ValueToExchange = SECOND_VALUE; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/testinfo.dat deleted file mode 100644 index 8021f43156e3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedCompareExchange64 -Name = Positive test of InterlockedCompareExchange64 -TYPE = DEFAULT -EXE1 = test -Description -= Test to see if both successful and unsuccessful compare exchanges workp -= roperly -- ie. Exchange and don't exchange. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/CMakeLists.txt deleted file mode 100644 index 41543eff2819..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedcompareexchange64_test2 - ${SOURCES} -) - -add_dependencies(paltest_interlockedcompareexchange64_test2 coreclrpal) - -target_link_libraries(paltest_interlockedcompareexchange64_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/test.cpp index 933cb3ff2364..bdf5150aa3b7 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchange64/test2/test.cpp @@ -18,10 +18,10 @@ #define MAX_THREADS 64 #define REPEAT_COUNT 10000 -LONG GlobalCounter = 0; -void IncrementCounter(void); +LONG GlobalCounter_InterlockedCompareExchange64_test2 = 0; +void IncrementCounter_InterlockedCompareExchange64_test2(void); -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedCompareExchange64_test2_paltest_interlockedcompareexchange64_test2, "miscellaneous/InterlockedCompareExchange64/test2/paltest_interlockedcompareexchange64_test2") { LONG TotalOperations=0; @@ -32,7 +32,7 @@ int __cdecl main(int argc, char *argv[]) TotalOperations = MAX_THREADS * REPEAT_COUNT; - GlobalCounter = 0; + GlobalCounter_InterlockedCompareExchange64_test2 = 0; /* * Initialize the PAL and return FAILURE if this fails @@ -54,7 +54,7 @@ int __cdecl main(int argc, char *argv[]) hThread[i] = CreateThread( NULL, // default security attributes 0, // use default stack size - (LPTHREAD_START_ROUTINE) IncrementCounter, // thread function + (LPTHREAD_START_ROUTINE) IncrementCounter_InterlockedCompareExchange64_test2, // thread function NULL, // argument to thread function 0, // use default creation flags &dwThreadID); // returns the thread identifier @@ -78,7 +78,7 @@ int __cdecl main(int argc, char *argv[]) /* Compare the value of global counter with zero. */ - if (TotalOperations!=GlobalCounter) + if (TotalOperations!=GlobalCounter_InterlockedCompareExchange64_test2) { Fail("Test Case Failed: InterlockedDecrement \n"); } @@ -89,13 +89,13 @@ int __cdecl main(int argc, char *argv[]) return PASS; } -void IncrementCounter(void) +void IncrementCounter_InterlockedCompareExchange64_test2(void) { int i=0; for (i=0; i -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedCompareExchangePointer_test1_paltest_interlockedcompareexchangepointer_test1, "miscellaneous/InterlockedCompareExchangePointer/test1/paltest_interlockedcompareexchangepointer_test1") { long StartValue = 5; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchangePointer/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchangePointer/test1/testinfo.dat deleted file mode 100644 index 7a802c1e8cbb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedCompareExchangePointer/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedCompareExchangePointer -Name = Positive test of InterlockedCompareExchangePointer -TYPE = DEFAULT -EXE1 = test -Description -= Test to see if both successful and unsuccessful compare exchanges work -= properly -- ie. Exchange and don't exchange. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/CMakeLists.txt deleted file mode 100644 index adf7267d11b2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockeddecrement_test1 - ${SOURCES} -) - -add_dependencies(paltest_interlockeddecrement_test1 coreclrpal) - -target_link_libraries(paltest_interlockeddecrement_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/test.cpp index ddd188cb7086..03f7834772e4 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/test.cpp @@ -18,7 +18,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedDecrement_test1_paltest_interlockeddecrement_test1, "miscellaneous/InterlockedDecrement/test1/paltest_interlockeddecrement_test1") { int TheValue = 0; int TheReturn; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/testinfo.dat deleted file mode 100644 index e94bf38e740f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedDecrement -Name = Positive test of InterlockedDecrement -TYPE = DEFAULT -EXE1 = test -Description -= Test to see if this decrements the variable correctly and -= has the correct return value. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/CMakeLists.txt deleted file mode 100644 index cb66d92cf591..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockeddecrement_test2 - ${SOURCES} -) - -add_dependencies(paltest_interlockeddecrement_test2 coreclrpal) - -target_link_libraries(paltest_interlockeddecrement_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/test.cpp index a9dd8ef29350..2dc372cdab07 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement/test2/test.cpp @@ -18,10 +18,10 @@ #define MAX_THREADS 64 #define REPEAT_COUNT 10000 -LONG GlobalCounter = 0; -void DecrementCounter(void); +LONG GlobalCounter_InterlockedDecrement_test2 = 0; +void DecrementCounter_InterlockedDecrement_test2(void); -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedDecrement_test2_paltest_interlockeddecrement_test2, "miscellaneous/InterlockedDecrement/test2/paltest_interlockeddecrement_test2") { LONG TotalOperations=0; @@ -29,7 +29,7 @@ int __cdecl main(int argc, char *argv[]) DWORD dwThreadID = 0; HANDLE hThread[MAX_THREADS]; TotalOperations = MAX_THREADS * REPEAT_COUNT; - GlobalCounter = TotalOperations; + GlobalCounter_InterlockedDecrement_test2 = TotalOperations; /* * Initialize the PAL and return FAILURE if this fails @@ -45,7 +45,7 @@ int __cdecl main(int argc, char *argv[]) hThread[i] = CreateThread( NULL, // default security attributes 0, // use default stack size - (LPTHREAD_START_ROUTINE) DecrementCounter, // thread function + (LPTHREAD_START_ROUTINE) DecrementCounter_InterlockedDecrement_test2, // thread function NULL, // argument to thread function 0, // use default creation flags &dwThreadID); // returns the thread identifier @@ -71,7 +71,7 @@ int __cdecl main(int argc, char *argv[]) /* Compare the value of global counter with zero. */ - if (0!=GlobalCounter) + if (0!=GlobalCounter_InterlockedDecrement_test2) { Fail("Test Case Failed: InterlockedDecrement \n"); } @@ -80,12 +80,12 @@ int __cdecl main(int argc, char *argv[]) return PASS; } -void DecrementCounter(void) +void DecrementCounter_InterlockedDecrement_test2(void) { int i=0; for (i=0; i -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedDecrement64_test1_paltest_interlockeddecrement64_test1, "miscellaneous/InterlockedDecrement64/test1/paltest_interlockeddecrement64_test1") { LONGLONG TheValue = 0; LONGLONG TheReturn; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test1/testinfo.dat deleted file mode 100644 index 878c1023cb6a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedDecrement64 -Name = Positive test of InterlockedDecrement64 -TYPE = DEFAULT -EXE1 = test -Description -= Test to see if this decrements the variable correctly and -= has the correct return value. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/CMakeLists.txt deleted file mode 100644 index f3f90d9f4dd4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockeddecrement64_test2 - ${SOURCES} -) - -add_dependencies(paltest_interlockeddecrement64_test2 coreclrpal) - -target_link_libraries(paltest_interlockeddecrement64_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/test.cpp index 6bfa89a38548..f006111f9456 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedDecrement64/test2/test.cpp @@ -18,17 +18,17 @@ #define MAX_THREADS 64 #define REPEAT_COUNT 10000 -LONG GlobalCounter = 0; -void DecrementCounter(void); +LONG GlobalCounter_InterlockedDecrement64_test2 = 0; +void DecrementCounter_InterlockedDecrement64_test2(void); -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedDecrement64_test2_paltest_interlockeddecrement64_test2, "miscellaneous/InterlockedDecrement64/test2/paltest_interlockeddecrement64_test2") { LONG TotalOperations=0; int i=0; DWORD dwThreadID = 0; HANDLE hThread[MAX_THREADS]; TotalOperations = MAX_THREADS * REPEAT_COUNT; - GlobalCounter = TotalOperations; + GlobalCounter_InterlockedDecrement64_test2 = TotalOperations; /* * Initialize the PAL and return FAILURE if this fails @@ -47,7 +47,7 @@ int __cdecl main(int argc, char *argv[]) hThread[i] = CreateThread( NULL, // default security attributes 0, // use default stack size - (LPTHREAD_START_ROUTINE) DecrementCounter, // thread function + (LPTHREAD_START_ROUTINE) DecrementCounter_InterlockedDecrement64_test2, // thread function NULL, // argument to thread function 0, // use default creation flags &dwThreadID); // returns the thread identifier @@ -73,7 +73,7 @@ int __cdecl main(int argc, char *argv[]) /* Compare the value of global counter with zero. */ - if (0!=GlobalCounter) + if (0!=GlobalCounter_InterlockedDecrement64_test2) { Fail("Test Case Failed: InterlockedDecrement \n"); } @@ -84,13 +84,13 @@ int __cdecl main(int argc, char *argv[]) return PASS; } -void DecrementCounter(void) +void DecrementCounter_InterlockedDecrement64_test2(void) { int i=0; for (i=0; i -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedExchangePointer_test1_paltest_interlockedexchangepointer_test1, "miscellaneous/InterlockedExchangePointer/test1/paltest_interlockedexchangepointer_test1") { int err; int i1 = 10; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedExchangePointer/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedExchangePointer/test1/testinfo.dat deleted file mode 100644 index b7128df27912..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedExchangePointer/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = miscellaneous -Function = InterlockedExchangePointer -Name = Pos test for InterlockedExchangePointer API to excnage a pair of value -TYPE = DEFAULT -EXE1 = interlockedexchangepointer -Description -=Test the InterlockedExchangePointer to exchange a pair of value diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/CMakeLists.txt deleted file mode 100644 index d0e65acde3c2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedincrement_test1 - ${SOURCES} -) - -add_dependencies(paltest_interlockedincrement_test1 coreclrpal) - -target_link_libraries(paltest_interlockedincrement_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/test.cpp index d100c1da072a..da0116fc1793 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/test.cpp @@ -19,7 +19,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedIncrement_test1_paltest_interlockedincrement_test1, "miscellaneous/InterlockedIncrement/test1/paltest_interlockedincrement_test1") { int TheValue = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/testinfo.dat deleted file mode 100644 index e404d7ff3452..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedIncreement -Name = Positive test of InterlockedIncrement -TYPE = DEFAULT -EXE1 = test -Description -= Test to see if this increments the variable correctly and -= has the correct return value. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/CMakeLists.txt deleted file mode 100644 index 8d03188f3bca..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedincrement_test2 - ${SOURCES} -) - -add_dependencies(paltest_interlockedincrement_test2 coreclrpal) - -target_link_libraries(paltest_interlockedincrement_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/test.cpp index 49e31c65fa31..87623b900b7a 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement/test2/test.cpp @@ -18,13 +18,13 @@ #define MAX_THREADS 64 #define REPEAT_COUNT 10000 -LONG GlobalCounter = 0; +LONG GlobalCounter_InterlockedIncrement_test2 = 0; -void IncrementCounter(void); +void IncrementCounter_InterlockedIncrement_test2(void); -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedIncrement_test2_paltest_interlockedincrement_test2, "miscellaneous/InterlockedIncrement/test2/paltest_interlockedincrement_test2") { LONG TotalOperations=0; @@ -32,7 +32,7 @@ int __cdecl main(int argc, char *argv[]) DWORD dwThreadID = 0; HANDLE hThread[MAX_THREADS]; TotalOperations = MAX_THREADS * REPEAT_COUNT; - GlobalCounter = 0; + GlobalCounter_InterlockedIncrement_test2 = 0; /* * Initialize the PAL and return FAILURE if this fails @@ -48,7 +48,7 @@ int __cdecl main(int argc, char *argv[]) hThread[i] = CreateThread( NULL, // default security attributes 0, // use default stack size - (LPTHREAD_START_ROUTINE) IncrementCounter, // thread function + (LPTHREAD_START_ROUTINE) IncrementCounter_InterlockedIncrement_test2, // thread function NULL, // argument to thread function 0, // use default creation flags &dwThreadID); // returns the thread identifier @@ -75,7 +75,7 @@ int __cdecl main(int argc, char *argv[]) /* Compare the value of global counter with zero. */ - if (TotalOperations!=GlobalCounter) + if (TotalOperations!=GlobalCounter_InterlockedIncrement_test2) { Fail("Test Case Failed: InterlockedDecrement \n"); } @@ -84,11 +84,11 @@ int __cdecl main(int argc, char *argv[]) return PASS; } -void IncrementCounter(void) +void IncrementCounter_InterlockedIncrement_test2(void) { int i=0; for (i=0; i -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedIncrement64_test1_paltest_interlockedincrement64_test1, "miscellaneous/InterlockedIncrement64/test1/paltest_interlockedincrement64_test1") { LONGLONG TheValue = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test1/testinfo.dat deleted file mode 100644 index 7b9c2712937b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = InterlockedIncrement64 -Name = Positive test of InterlockedIncrement64 -TYPE = DEFAULT -EXE1 = test -Description -= Test to see if this increments the variable correctly and -= has the correct return value. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/CMakeLists.txt deleted file mode 100644 index 7a7bbf819f74..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_interlockedincrement64_test2 - ${SOURCES} -) - -add_dependencies(paltest_interlockedincrement64_test2 coreclrpal) - -target_link_libraries(paltest_interlockedincrement64_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/test.cpp index cabd2176c94c..195a5a536aa5 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/InterlockedIncrement64/test2/test.cpp @@ -18,10 +18,10 @@ #define MAX_THREADS 64 #define REPEAT_COUNT 10000 -LONG GlobalCounter = 0; -void IncrementCounter(void); +LONG GlobalCounter_InterlockedIncrement64_test2 = 0; +void IncrementCounter_InterlockedIncrement64_test2(void); -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_InterlockedIncrement64_test2_paltest_interlockedincrement64_test2, "miscellaneous/InterlockedIncrement64/test2/paltest_interlockedincrement64_test2") { LONG TotalOperations=0; @@ -29,7 +29,7 @@ int __cdecl main(int argc, char *argv[]) DWORD dwThreadID = 0; HANDLE hThread[MAX_THREADS]; TotalOperations = MAX_THREADS * REPEAT_COUNT; - GlobalCounter = 0; + GlobalCounter_InterlockedIncrement64_test2 = 0; /* * Initialize the PAL and return FAILURE if this fails @@ -50,7 +50,7 @@ int __cdecl main(int argc, char *argv[]) hThread[i] = CreateThread( NULL, // default security attributes 0, // use default stack size - (LPTHREAD_START_ROUTINE) IncrementCounter, // thread function + (LPTHREAD_START_ROUTINE) IncrementCounter_InterlockedIncrement64_test2, // thread function NULL, // argument to thread function 0, // use default creation flags &dwThreadID); // returns the thread identifier @@ -76,7 +76,7 @@ int __cdecl main(int argc, char *argv[]) /* Compare the value of global counter with zero. */ - if (TotalOperations!=GlobalCounter) + if (TotalOperations!=GlobalCounter_InterlockedIncrement64_test2) { Fail("Test Case Failed: InterlockedDecrement \n"); } @@ -86,13 +86,13 @@ int __cdecl main(int argc, char *argv[]) return PASS; } -void IncrementCounter(void) +void IncrementCounter_InterlockedIncrement64_test2(void) { int i=0; for (i=0; i -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_IsBadWritePtr_test2_paltest_isbadwriteptr_test2, "miscellaneous/IsBadWritePtr/test2/paltest_isbadwriteptr_test2") +{ LPVOID PageOne, PageTwo, PageThree; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/testinfo.dat deleted file mode 100644 index dcffd114a6a2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = IsBadWritePtr -Name = Return Value test IsBadWritePtr -TYPE = DEFAULT -EXE1 = test2 -Description -= Create three consecuative pages, NOACCES, READWRITE and -= NOACCESS. Check to ensure that the READWRITE page returns 0, to -= ensure that IsBadWritePtr isn't overflowing. Also check the other two -= pages to see that they return non-zero. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/CMakeLists.txt deleted file mode 100644 index a12ebfbe4ae3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_isbadwriteptr_test3 - ${SOURCES} -) - -add_dependencies(paltest_isbadwriteptr_test3 coreclrpal) - -target_link_libraries(paltest_isbadwriteptr_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp index 5b2ac41d4ff1..b49c0c63418d 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp @@ -13,7 +13,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_IsBadWritePtr_test3_paltest_isbadwriteptr_test3, "miscellaneous/IsBadWritePtr/test3/paltest_isbadwriteptr_test3") +{ LPVOID PageOne; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/testinfo.dat deleted file mode 100644 index 89739c0d09af..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = IsBadWritePtr -Name = Return Value test IsBadWritePtr -TYPE = DEFAULT -EXE1 = test3 -Description -= Check that IsBadWritePtr returns non-zero on Read-only memory. - - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/CMakeLists.txt deleted file mode 100644 index 900e74671835..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_messageboxw_test1 - ${SOURCES} -) - -add_dependencies(paltest_messageboxw_test1 coreclrpal) - -target_link_libraries(paltest_messageboxw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.cpp index 4a3f208efa44..3dcd8171bb29 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_MessageBoxW_test1_paltest_messageboxw_test1, "miscellaneous/MessageBoxW/test1/paltest_messageboxw_test1") { /* Declare Variables to use with convert()*/ WCHAR * PalTitle = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/testinfo.dat deleted file mode 100644 index 667db59488ca..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = MessageBoxW -Name = Positive test of MessageBoxW -TYPE = DEFAULT -EXE1 = test -Description -= Ensure that the return values are correct for each type of Message Style. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/CMakeLists.txt deleted file mode 100644 index 7f3295526b07..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_messageboxw_test2 - ${SOURCES} -) - -add_dependencies(paltest_messageboxw_test2 coreclrpal) - -target_link_libraries(paltest_messageboxw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.cpp index 9893decc98e2..c75a53bed704 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.cpp @@ -14,7 +14,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_MessageBoxW_test2_paltest_messageboxw_test2, "miscellaneous/MessageBoxW/test2/paltest_messageboxw_test2") +{ /* * Initialize the PAL and return FAILURE if this fails diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/testinfo.dat deleted file mode 100644 index 667db59488ca..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = MessageBoxW -Name = Positive test of MessageBoxW -TYPE = DEFAULT -EXE1 = test -Description -= Ensure that the return values are correct for each type of Message Style. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/CMakeLists.txt deleted file mode 100644 index 97c0701fd3c6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_setenvironmentvariablea_test1 - ${SOURCES} -) - -add_dependencies(paltest_setenvironmentvariablea_test1 coreclrpal) - -target_link_libraries(paltest_setenvironmentvariablea_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.cpp index 6ff916aca038..502637026b9a 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.cpp @@ -23,7 +23,7 @@ #include #define BUF_SIZE 128 -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_SetEnvironmentVariableA_test1_paltest_setenvironmentvariablea_test1, "miscellaneous/SetEnvironmentVariableA/test1/paltest_setenvironmentvariablea_test1") { /* Define some buffers needed for the function */ diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/testinfo.dat deleted file mode 100644 index 3283c2ec73de..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = SetEnvironmentVariableA -Name = Positive test of SetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test1 -Description -= Set an environment variable and check to ensure success was returned. Then -= get the environment variable and compare to the correct value. Also, check -= that calling the function again, resets the variable properly. And that -= calling with NULL deletes the variable. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/CMakeLists.txt deleted file mode 100644 index 34cc7876def5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_setenvironmentvariablea_test2 - ${SOURCES} -) - -add_dependencies(paltest_setenvironmentvariablea_test2 coreclrpal) - -target_link_libraries(paltest_setenvironmentvariablea_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.cpp index d71e4e2063a5..efe05bb785b5 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.cpp @@ -16,7 +16,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_SetEnvironmentVariableA_test2_paltest_setenvironmentvariablea_test2, "miscellaneous/SetEnvironmentVariableA/test2/paltest_setenvironmentvariablea_test2") { /* Define some buffers needed for the function */ diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/testinfo.dat deleted file mode 100644 index 46a5aa0a7031..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = SetEnvironmentVariableA -Name = Return value test of SetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to see that passing NULL to the first param fails. -= Test that passing NULL to both params fails. -= Set an environment variable, then pass NULL to the second param -= to delete it. Then make the same call again, to check that it fails. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/CMakeLists.txt deleted file mode 100644 index 4aa1a4a94b20..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_setenvironmentvariablea_test3 - ${SOURCES} -) - -add_dependencies(paltest_setenvironmentvariablea_test3 coreclrpal) - -target_link_libraries(paltest_setenvironmentvariablea_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.cpp index d35d6925ddb3..704218321c4e 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_SetEnvironmentVariableA_test3_paltest_setenvironmentvariablea_test3, "miscellaneous/SetEnvironmentVariableA/test3/paltest_setenvironmentvariablea_test3") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/testinfo.dat deleted file mode 100644 index 2f59bc47c9b5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/testinfo.dat +++ /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. - -Version = 1.0 -Section = Miscellaneous -Function = SetEnvironmentVariableA -Name = Return value test of SetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test3 -Description -= Test creating environment variables that differ only -= by case and check that they are treated as separate -= variables in the BSD operating system. - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/CMakeLists.txt deleted file mode 100644 index 032acfb9a181..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_setenvironmentvariablea_test4 - ${SOURCES} -) - -add_dependencies(paltest_setenvironmentvariablea_test4 coreclrpal) - -target_link_libraries(paltest_setenvironmentvariablea_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.cpp index 18473198bf75..4c6998df1da0 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.cpp @@ -15,7 +15,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_SetEnvironmentVariableA_test4_paltest_setenvironmentvariablea_test4, "miscellaneous/SetEnvironmentVariableA/test4/paltest_setenvironmentvariablea_test4") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/testinfo.dat deleted file mode 100644 index 4a07a95ce49c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/testinfo.dat +++ /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. - -Version = 1.0 -Section = Miscellaneous -Function = SetEnvironmentVariableA -Name = Return value test of SetEnvironmentVariableA -TYPE = DEFAULT -EXE1 = test4 -Description -= Test that creating an environment variable and trying -= to attain the value of the environment variable using -= a name with different case works in the Windows -= Environment. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/CMakeLists.txt deleted file mode 100644 index a0bd6300707d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_setenvironmentvariablew_test1 - ${SOURCES} -) - -add_dependencies(paltest_setenvironmentvariablew_test1 coreclrpal) - -target_link_libraries(paltest_setenvironmentvariablew_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp index 6541ee07327d..01107c8b2cb3 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp @@ -21,7 +21,7 @@ /* Depends on GetEnvironmentVariable */ -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_SetEnvironmentVariableW_test1_paltest_setenvironmentvariablew_test1, "miscellaneous/SetEnvironmentVariableW/test1/paltest_setenvironmentvariablew_test1") { /* Define some buffers needed for the function */ diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/testinfo.dat deleted file mode 100644 index a35799f9b503..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = Miscellaneous -Function = SetEnvironmentVariableW -Name = Positive test of SetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test -Description -= Set an environment variable and check to ensure success was returned. Then -= get the environment variable and compare to the correct value. Also, check -= that calling the function again, resets the variable properly. And that -= calling with NULL deletes the variable. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/CMakeLists.txt deleted file mode 100644 index fa7579058572..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_setenvironmentvariablew_test2 - ${SOURCES} -) - -add_dependencies(paltest_setenvironmentvariablew_test2 coreclrpal) - -target_link_libraries(paltest_setenvironmentvariablew_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.cpp index c20d97cad31e..948cf87d2bde 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.cpp @@ -18,7 +18,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_SetEnvironmentVariableW_test2_paltest_setenvironmentvariablew_test2, "miscellaneous/SetEnvironmentVariableW/test2/paltest_setenvironmentvariablew_test2") { /* Define some buffers needed for the function */ diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/testinfo.dat deleted file mode 100644 index a3b30d087d93..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/testinfo.dat +++ /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. - -Version = 1.0 -Section = Miscellaneous -Function = SetEnvironmentVariableW -Name = Return value test of SetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test -Description -= Test to see that passing NULL to the first param fails. -= Test that passing NULL to both params fails. -= Set an environment variable, then pass NULL to the second param -= to delete it. Then make the same call again, to check that it fails. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/CMakeLists.txt deleted file mode 100644 index 2a7a77e32e8d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_setenvironmentvariablew_test3 - ${SOURCES} -) - -add_dependencies(paltest_setenvironmentvariablew_test3 coreclrpal) - -target_link_libraries(paltest_setenvironmentvariablew_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.cpp index 53b7fc5630a9..4c5afe3ab274 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_SetEnvironmentVariableW_test3_paltest_setenvironmentvariablew_test3, "miscellaneous/SetEnvironmentVariableW/test3/paltest_setenvironmentvariablew_test3") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/testinfo.dat deleted file mode 100644 index 33fbfe541860..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = SetEnvironmentVariableW -Name = Return value test of SetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test3 -Description -= Create environment variables that differ only by case -= and verify that they are treated distinctly in the -= BSD Operating System. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/CMakeLists.txt deleted file mode 100644 index 7ec1ba81ae50..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_setenvironmentvariablew_test4 - ${SOURCES} -) - -add_dependencies(paltest_setenvironmentvariablew_test4 coreclrpal) - -target_link_libraries(paltest_setenvironmentvariablew_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.cpp index 225e104039b5..92b5ccf1d30d 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_SetEnvironmentVariableW_test4_paltest_setenvironmentvariablew_test4, "miscellaneous/SetEnvironmentVariableW/test4/paltest_setenvironmentvariablew_test4") { #if WIN32 diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/testinfo.dat deleted file mode 100644 index f0da41068472..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = SetEnvironmentVariableW -Name = Return value test of SetEnvironmentVariableW -TYPE = DEFAULT -EXE1 = test4 -Description -= Create environment variable and try to retrieve -= the value of the variable by using a variable name -= that differs in case. This should not affect the -= return value in the Windows Operating System. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/CMakeLists.txt deleted file mode 100644 index 75775f2cce3d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_setlasterror_test1 - ${SOURCES} -) - -add_dependencies(paltest_setlasterror_test1 coreclrpal) - -target_link_libraries(paltest_setlasterror_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.cpp index 8a6b0d3c6fea..f51fdbdf933f 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.cpp @@ -14,7 +14,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(miscellaneous_SetLastError_test1_paltest_setlasterror_test1, "miscellaneous/SetLastError/test1/paltest_setlasterror_test1") +{ /* Error value that we can set to test */ const unsigned int FAKE_ERROR = 5; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/testinfo.dat deleted file mode 100644 index e81fa1cc3b29..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Miscellaneous -Function = SetLastError -Name = Positive test of SetLastError -TYPE = DEFAULT -EXE1 = test -Description -= Set the Last Error and then use GetLastError to make sure -= it was set properly. Assumes GetLastError is working. - - - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/CMakeLists.txt deleted file mode 100644 index 1995383f8420..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_i64tow_test1 - ${SOURCES} -) - -add_dependencies(paltest_i64tow_test1 coreclrpal) - -target_link_libraries(paltest_i64tow_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp index 0c48434a0e10..2a44813cde4f 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp @@ -21,7 +21,7 @@ typedef struct } testCase; -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous__i64tow_test1_paltest_i64tow_test1, "miscellaneous/_i64tow/test1/paltest_i64tow_test1") { WCHAR buffer[256]; WCHAR *testStr; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/testinfo.dat deleted file mode 100644 index 8ee04a500507..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = miscellaneous -Function = _i64tow_s -Name = Test #1 for _i64tow_s -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests _i64tow_s with normal values and different radices, negative -=values, as well as the highest and lowest values. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/CMakeLists.txt deleted file mode 100644 index 28f975fc2360..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_queryperformancecounter_test1 - ${SOURCES} -) - -add_dependencies(paltest_queryperformancecounter_test1 coreclrpal) - -target_link_libraries(paltest_queryperformancecounter_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.cpp index 65c8503b41fe..d14fa2fa2bb2 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.cpp @@ -14,13 +14,13 @@ #include -/* Milliseconds of error which are acceptable Function execution time, etc. - FreeBSD has a "standard" resolution of 50ms for waiting operations, so we - must take that into account as well */ -DWORD AcceptableTimeError = 15; -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_queryperformancecounter_test1_paltest_queryperformancecounter_test1, "miscellaneous/queryperformancecounter/test1/paltest_queryperformancecounter_test1") { + /* Milliseconds of error which are acceptable Function execution time, etc. + FreeBSD has a "standard" resolution of 50ms for waiting operations, so we + must take that into account as well */ + DWORD AcceptableTimeError = 15; int i; int NumIterations = 100; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/testinfo.dat deleted file mode 100644 index 56f11fc91b1c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -Version = 1.0 -Section = Miscellaneous -Function = QueryPerformanceCounter -Name = Positive Test for QueryPerformanceCounter -TYPE = DEFAULT -EXE1 = test1 -Description -= This test will verify with QueryPerformanceCounter -= and QueryPerformanceFrequency that an API call of Sleep -= of 100 milliseconds takes 100 milliseconds, taking into -= account the error tolerance. diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/CMakeLists.txt deleted file mode 100644 index 3381412046e0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_queryperformancefrequency_test1 - ${SOURCES} -) - -add_dependencies(paltest_queryperformancefrequency_test1 coreclrpal) - -target_link_libraries(paltest_queryperformancefrequency_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.cpp index bc3fc0761474..3e370ddafb10 100644 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(miscellaneous_queryperformancefrequency_test1_paltest_queryperformancefrequency_test1, "miscellaneous/queryperformancefrequency/test1/paltest_queryperformancefrequency_test1") { LARGE_INTEGER Freq; diff --git a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/testinfo.dat deleted file mode 100644 index ea561422c135..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -Version = 1.0 -Section = Miscellaneous -Function = QueryPerformanceFrequency -Name = Positive Test for QueryPerformanceFrequency -TYPE = DEFAULT -EXE1 = test1 -Description -= This test will verify that QueryPerformanceFrequency -= returns a valid return value. -= The value of the count is processor dependent. On -= some processors, for example, the count might be the -= cycle rate of the processor clock. diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/CMakeLists.txt deleted file mode 100644 index 694090ae90db..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# TODO: make these tests compile -# add_subdirectory(PAL_get_stderr) -# add_subdirectory(PAL_get_stdin) -# add_subdirectory(PAL_get_stdout) - -add_subdirectory(PAL_errno) -add_subdirectory(PAL_GetPALDirectoryW) -add_subdirectory(PAL_Initialize_Terminate) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/CMakeLists.txt deleted file mode 100644 index 4c0a408b89a5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_GetPALDirectoryW.cpp -) - -add_executable(paltest_pal_getpaldirectoryw_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_getpaldirectoryw_test1 coreclrpal) - -target_link_libraries(paltest_pal_getpaldirectoryw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp index 73099467940d..21a1bb3f0aa5 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp @@ -14,7 +14,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_GetPALDirectoryW_test1_paltest_pal_getpaldirectoryw_test1, "pal_specific/PAL_GetPALDirectoryW/test1/paltest_pal_getpaldirectoryw_test1") { int err; BOOL bValue; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/testinfo.dat deleted file mode 100644 index 306d2e53d3d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = PAL_Specific -Function = PAL_GetPALDirectoryW -Name = Positive test for PAL_GetPALDirectoryW to retrieve fully-qualified directory name. -TYPE = DEFAULT -EXE1 = pal_getpaldirectoryw -Description -=Retrieve the fully-qualified directory name where the PAL DLL is loaded from diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/CMakeLists.txt deleted file mode 100644 index 177003322e3b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_GetUserTempDirectoryW.cpp -) - -add_executable(paltest_pal_getusertempdirectoryw_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_getusertempdirectoryw_test1 coreclrpal) - -target_link_libraries(paltest_pal_getusertempdirectoryw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp index 2343a6799d4f..b09d3f626319 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp @@ -16,7 +16,7 @@ #define DIRECTORYLENGTH 1024 -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_GetUserTempDirectoryW_test1_paltest_pal_getusertempdirectoryw_test1, "pal_specific/PAL_GetUserTempDirectoryW/test1/paltest_pal_getusertempdirectoryw_test1") { int err; DWORD dwFileAttribute; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/testinfo.dat deleted file mode 100644 index 7384f82fb873..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = pal_specific -Function = PAL_GetUserTempDirectoryW -Name = Positive test for PAL_GetUserTempDirectoryW API -TYPE = DEFAULT -EXE1 = pal_getusertempdirectoryw -Description -=Test the PAL_GetUserTempDirectoryW to retrieve the user temp -=directory name diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/CMakeLists.txt deleted file mode 100644 index e5a390313c70..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_Initialize_Terminate.cpp -) - -add_executable(paltest_pal_initialize_terminate_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_initialize_terminate_test1 coreclrpal) - -target_link_libraries(paltest_pal_initialize_terminate_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.cpp index 8baba7c8b053..a640cc48a40c 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.cpp @@ -15,7 +15,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_Initialize_Terminate_test1_paltest_pal_initialize_terminate_test1, "pal_specific/PAL_Initialize_Terminate/test1/paltest_pal_initialize_terminate_test1") { int err; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/testinfo.dat deleted file mode 100644 index 15fb6bfa9aa0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = PAL_Specific -Function = PAL_Initialize and PAL_Terminate -Name = Positive test for PAL_Initialize and PAL_Terminate -TYPE = DEFAULT -EXE1 = pal_initialize_terminate -Description -=Test the PAL_Initialize to initialize the PAL environment -=Test the PAL_Terminate to clean up the PAL environment diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/CMakeLists.txt deleted file mode 100644 index bca09933cedd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - pal_initialize_twice.cpp -) - -add_executable(paltest_pal_initialize_terminate_test2 - ${SOURCES} -) - -add_dependencies(paltest_pal_initialize_terminate_test2 coreclrpal) - -target_link_libraries(paltest_pal_initialize_terminate_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.cpp index 2697e370598c..5d35cd888f22 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.cpp @@ -15,7 +15,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_Initialize_Terminate_test2_paltest_pal_initialize_terminate_test2, "pal_specific/PAL_Initialize_Terminate/test2/paltest_pal_initialize_terminate_test2") { /* Initialize the PAL environment */ if (0 != (PAL_Initialize(argc, argv))) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/testinfo.dat deleted file mode 100644 index baa11675a23b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = PAL_Specific -Function = PAL_Initialize and PAL_Terminate -Name = Positive test for calling PAL_Initialize twice -TYPE = DEFAULT -EXE1 = pal_initialize_twice -Description -=Test calling PAL_Initialize twice to initialize the PAL environment -=and increment the init_count. -=Test calling PAL_Terminate twice to decrement the init_count -=and then clean up the PAL environment. diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/CMakeLists.txt deleted file mode 100644 index 21befe2f82e3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2_neg) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/CMakeLists.txt deleted file mode 100644 index 93af8fa7dd1a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_RegisterLibraryW_UnregisterLibraryW.cpp -) - -add_executable(paltest_pal_registerlibraryw_unregisterlibraryw_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_registerlibraryw_unregisterlibraryw_test1 coreclrpal) - -target_link_libraries(paltest_pal_registerlibraryw_unregisterlibraryw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp index d4e5578e0cae..5d7b5c9335fe 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp @@ -16,7 +16,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_RegisterLibraryW_UnregisterLibraryW_test1_paltest_pal_registerlibraryw_unregisterlibraryw_test1, "pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/paltest_pal_registerlibraryw_unregisterlibraryw_test1") { HMODULE ModuleHandle; char ModuleName[64]; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/testinfo.dat deleted file mode 100644 index 68d1fa0c490f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = pal_specific -Function = PAL_RegisterLibraryW and PAL_UnregisterLibraryW API -Name = Positive test PAL_RegisterLibraryW and PAL_UnregisterLibaryW API -TYPE = DEFAULT -EXE1 = pal_registerlibraryw_unregisterlibraryw -Description -=Test the PAL_RegisterLibraryW and PAL_UnregisterLibraryW to map an executable -=module into calling process address space and unmap this module diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/CMakeLists.txt deleted file mode 100644 index 0ac3cfc56f9f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - reg_unreg_libraryw_neg.cpp -) - -add_executable(paltest_reg_unreg_libraryw_neg - ${SOURCES} -) - -add_dependencies(paltest_reg_unreg_libraryw_neg coreclrpal) - -target_link_libraries(paltest_reg_unreg_libraryw_neg - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp index 55838837ae0a..6e380901a9ea 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp @@ -14,7 +14,7 @@ #define UNICODE #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_RegisterLibraryW_UnregisterLibraryW_test2_neg_paltest_reg_unreg_libraryw_neg, "pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/paltest_reg_unreg_libraryw_neg") { HMODULE ModuleHandle; char ModuleName[64]; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/testinfo.dat deleted file mode 100644 index b0ebcb3d1d7e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = pal_specific -Function = PAL_RegisterLibraryW and PAL_UnregisterLibraryW API -Name = Negative test for PAL_RegisterLibraryW and PAL_UnregisterLibaryW API to map and unmap a non-existant module -TYPE = DEFAULT -EXE1 = pal_registerlibraryw_unregisterlibraryw_neg -Description -=Test the PAL_RegisterLibraryW and PAL_UnregisterLibraryW to map a non-existant -=module into calling process address space - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/CMakeLists.txt deleted file mode 100644 index 32bef1dedb76..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_errno.cpp -) - -add_executable(paltest_pal_errno_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_errno_test1 coreclrpal) - -target_link_libraries(paltest_pal_errno_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.cpp index 3f9451ad8c52..29f2da53b055 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.cpp @@ -13,7 +13,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_errno_test1_paltest_pal_errno_test1, "pal_specific/PAL_errno/test1/paltest_pal_errno_test1") { int err; FILE *pFile = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/testinfo.dat deleted file mode 100644 index 8fb427ad3382..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = PAL_Specific -Function = PAL_errno -Name = Positive test PAL_errno API to retrieve the pre-thread errno value -TYPE = DEFAULT -EXE1 = pal_errno -Description -=Test the PAL_errno to retrieve a pointer to per-thread errno value diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/CMakeLists.txt deleted file mode 100644 index df89be2b8cd1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_get_stderr.cpp -) - -add_executable(paltest_pal_get_stderr_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_get_stderr_test1 coreclrpal) - -target_link_libraries(paltest_pal_get_stderr_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp index 6a2981ce44ca..2377505158c6 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp @@ -15,7 +15,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_get_stderr_test1_paltest_pal_get_stderr_test1, "pal_specific/PAL_get_stderr/test1/paltest_pal_get_stderr_test1") { int err; FILE *pPAL_stderr = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/testinfo.dat deleted file mode 100644 index 87f0e4818df5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = PAL_Specific -Function = PAL_get_stderr -Name = Positive test PAL_get_stderr to retrieve the PAL standard error stream pointer -TYPE = DEFAULT -EXE1 = pal_get_stderr -Description -=Test the PAL_get_stderr to retrieve the PAL standard error output stream pointer and -=output a test message to this error stream -=this test case will be run both manually and automatically diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/CMakeLists.txt deleted file mode 100644 index 859911058d4b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_get_stdin.cpp -) - -add_executable(paltest_pal_get_stdin_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_get_stdin_test1 coreclrpal) - -target_link_libraries(paltest_pal_get_stdin_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp index e320f79a9bf5..91d8a3a9a650 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp @@ -15,7 +15,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_get_stdin_test1_paltest_pal_get_stdin_test1, "pal_specific/PAL_get_stdin/test1/paltest_pal_get_stdin_test1") { int err; FILE *pPAL_stdin = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/testinfo.dat deleted file mode 100644 index b186dc973d4c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = PAL_Specific -Function = PAL_get_stdin -Name = Positive test PAL_get_stdin to retrieve the PAL standard stdin stream pointer -TYPE = DEFAULT -EXE1 = pal_get_stdin -Description -=Test the PAL_get_stdin to retrieve the PAL standard input stream pointer -=if success, display the input string to screen -=this test case should be run manually diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/CMakeLists.txt deleted file mode 100644 index 5142c43889f3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - PAL_get_stdout.cpp -) - -add_executable(paltest_pal_get_stdout_test1 - ${SOURCES} -) - -add_dependencies(paltest_pal_get_stdout_test1 coreclrpal) - -target_link_libraries(paltest_pal_get_stdout_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.cpp index f741278d097c..d891e9ac40ab 100644 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.cpp +++ b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.cpp @@ -15,7 +15,7 @@ **============================================================*/ #include -int __cdecl main(int argc, char *argv[]) +PALTEST(pal_specific_PAL_get_stdout_test1_paltest_pal_get_stdout_test1, "pal_specific/PAL_get_stdout/test1/paltest_pal_get_stdout_test1") { int err; FILE *pPAL_stdout = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/testinfo.dat deleted file mode 100644 index 5c7c3e05adc6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = PAL_Specific -Function = PAL_get_stdout -Name = Positive test PAL_get_stdout to retrieve PAL standard output stream pointer -TYPE = DEFAULT -EXE1 = pal_get_stdout -Description -=Test the PAL_get_stdout to retrieve the PAL standard output stream pointer -=This test case will be run both manually and automatically diff --git a/src/coreclr/src/pal/tests/palsuite/paltestlist.txt b/src/coreclr/src/pal/tests/palsuite/paltestlist.txt index ce633d672d43..cac225d5a5c8 100644 --- a/src/coreclr/src/pal/tests/palsuite/paltestlist.txt +++ b/src/coreclr/src/pal/tests/palsuite/paltestlist.txt @@ -348,9 +348,6 @@ c_runtime/_finitef/test1/paltest_finitef_test1 c_runtime/_isnan/test1/paltest_isnan_test1 c_runtime/_isnanf/test1/paltest_isnanf_test1 c_runtime/_itow/test1/paltest_itow_test1 -c_runtime/_mbsdec/test1/paltest_mbsdec_test1 -c_runtime/_mbsinc/test1/paltest_mbsinc_test1 -c_runtime/_mbsninc/test1/paltest_mbsninc_test1 c_runtime/_putenv/test1/paltest_putenv_test1 c_runtime/_putenv/test2/paltest_putenv_test2 c_runtime/_putenv/test3/paltest_putenv_test3 @@ -428,7 +425,7 @@ c_runtime/_vsnwprintf_s/test6/paltest_vsnwprintf_test6 c_runtime/_vsnwprintf_s/test8/paltest_vsnwprintf_test8 c_runtime/_vsnwprintf_s/test9/paltest_vsnwprintf_test9 c_runtime/_wcsicmp/test1/paltest_wcsicmp_test1 -c_runtime/_wcslwr/test1/paltest_wcslwr_test1 +c_runtime/_wcslwr_s/test1/paltest_wcslwr_s_test1 c_runtime/_wcsnicmp/test1/paltest_wcsnicmp_test1 c_runtime/_wfopen/test1/paltest_wfopen_test1 c_runtime/_wfopen/test2/paltest_wfopen_test2 @@ -444,11 +441,6 @@ exception_handling/RaiseException/test1/paltest_raiseexception_test1 exception_handling/RaiseException/test2/paltest_raiseexception_test2 exception_handling/RaiseException/test3/paltest_raiseexception_test3 exception_handling/pal_sxs/test1/paltest_pal_sxs_test1 -filemapping_memmgt/CreateFileMappingA/test1/paltest_createfilemappinga_test1 -filemapping_memmgt/CreateFileMappingA/test3/paltest_createfilemappinga_test3 -filemapping_memmgt/CreateFileMappingA/test4/paltest_createfilemappinga_test4 -filemapping_memmgt/CreateFileMappingA/test8/paltest_createfilemappinga_test8 -filemapping_memmgt/CreateFileMappingA/test9/paltest_createfilemappinga_test9 filemapping_memmgt/CreateFileMappingW/test1/paltest_createfilemappingw_test1 filemapping_memmgt/CreateFileMappingW/test3/paltest_createfilemappingw_test3 filemapping_memmgt/CreateFileMappingW/test4/paltest_createfilemappingw_test4 @@ -569,10 +561,6 @@ loader/LoadLibraryW/test2/paltest_loadlibraryw_test2 loader/LoadLibraryW/test3/paltest_loadlibraryw_test3 loader/LoadLibraryW/test5/paltest_loadlibraryw_test5 locale_info/GetACP/test1/paltest_getacp_test1 -locale_info/GetCPInfo/test1/paltest_getcpinfo_test1 -locale_info/GetCPInfo/test3/paltest_getcpinfo_test3 -locale_info/IsDBCSLeadByte/test1/paltest_isdbcsleadbyte_test1 -locale_info/IsDBCSLeadByteEx/test1/paltest_isdbcsleadbyteex_test1 locale_info/MultiByteToWideChar/test1/paltest_multibytetowidechar_test1 locale_info/MultiByteToWideChar/test2/paltest_multibytetowidechar_test2 locale_info/MultiByteToWideChar/test3/paltest_multibytetowidechar_test3 @@ -640,18 +628,11 @@ pal_specific/PAL_errno/test1/paltest_pal_errno_test1 pal_specific/PAL_Initialize_Terminate/test1/paltest_pal_initialize_terminate_test1 pal_specific/PAL_Initialize_Terminate/test2/paltest_pal_initialize_terminate_test2 samples/test1/paltest_samples_test1 -threading/CreateEventA/test1/paltest_createeventa_test1 -threading/CreateEventA/test2/paltest_createeventa_test2 threading/CreateEventW/test1/paltest_createeventw_test1 threading/CreateEventW/test2/paltest_createeventw_test2 -threading/CreateMutexA_ReleaseMutex/test1/paltest_createmutexa_releasemutex_test1 threading/CreateMutexW_ReleaseMutex/test1/paltest_createmutexw_releasemutex_test1 -threading/CreateProcessA/test1/paltest_createprocessa_test1 -threading/CreateProcessA/test2/paltest_createprocessa_test2 threading/CreateProcessW/test1/paltest_createprocessw_test1 threading/CreateProcessW/test2/paltest_createprocessw_test2 -threading/CreateSemaphoreA_ReleaseSemaphore/test1/paltest_createsemaphorea_releasesemaphore_test1 -threading/CreateSemaphoreA_ReleaseSemaphore/test2/paltest_createsemaphorea_releasesemaphore_test2 threading/CreateSemaphoreW_ReleaseSemaphore/test1/paltest_createsemaphorew_releasesemaphore_test1 threading/CreateSemaphoreW_ReleaseSemaphore/test2/paltest_createsemaphorew_releasesemaphore_test2 threading/CreateThread/test1/paltest_createthread_test1 diff --git a/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt b/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt index aafef3b73c8a..37c7d6ed8e01 100644 --- a/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt +++ b/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt @@ -53,9 +53,6 @@ exception_handling/PAL_TRY_EXCEPT_EX/test1/paltest_pal_try_except_ex_test1 exception_handling/PAL_TRY_EXCEPT_EX/test2/paltest_pal_try_except_ex_test2 exception_handling/PAL_TRY_EXCEPT_EX/test3/paltest_pal_try_except_ex_test3 exception_handling/PAL_TRY_LEAVE_FINALLY/test1/paltest_pal_try_leave_finally_test1 -filemapping_memmgt/CreateFileMappingA/test5/paltest_createfilemappinga_test5 -filemapping_memmgt/CreateFileMappingA/test6/paltest_createfilemappinga_test6 -filemapping_memmgt/CreateFileMappingA/test7/paltest_createfilemappinga_test7 filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/paltest_createfilemappingw_createfilemapping_neg1 filemapping_memmgt/CreateFileMappingW/test2/paltest_createfilemappingw_test2 filemapping_memmgt/CreateFileMappingW/test5/paltest_createfilemappingw_test5 @@ -67,9 +64,6 @@ filemapping_memmgt/GetModuleFileNameA/test1/paltest_getmodulefilenamea_test1 filemapping_memmgt/GetModuleFileNameW/test1/paltest_getmodulefilenamew_test1 filemapping_memmgt/GetProcAddress/test1/paltest_getprocaddress_test1 filemapping_memmgt/GetProcAddress/test2/paltest_getprocaddress_test2 -filemapping_memmgt/OpenFileMappingA/test1/paltest_openfilemappinga_test1 -filemapping_memmgt/OpenFileMappingA/test2/paltest_openfilemappinga_test2 -filemapping_memmgt/OpenFileMappingA/test3/paltest_openfilemappinga_test3 filemapping_memmgt/OpenFileMappingW/test1/paltest_openfilemappingw_test1 filemapping_memmgt/OpenFileMappingW/test2/paltest_openfilemappingw_test2 filemapping_memmgt/OpenFileMappingW/test3/paltest_openfilemappingw_test3 @@ -99,7 +93,6 @@ loader/LoadLibraryA/test8/paltest_loadlibrarya_test8 loader/LoadLibraryW/test1/paltest_loadlibraryw_test1 locale_info/CompareStringA/test1/paltest_comparestringa_test1 locale_info/CompareStringW/test1/paltest_comparestringw_test1 -locale_info/GetCPInfo/test2/paltest_getcpinfo_test2 locale_info/GetLocaleInfoW/test1/paltest_getlocaleinfow_test1 locale_info/GetLocaleInfoW/test2/paltest_getlocaleinfow_test2 locale_info/GetStringTypeExW/test1/paltest_getstringtypeexw_test1 @@ -125,11 +118,8 @@ pal_specific/PAL_get_stdin/test1/paltest_pal_get_stdin_test1 pal_specific/PAL_get_stdout/test1/paltest_pal_get_stdout_test1 pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/paltest_pal_registerlibraryw_unregisterlibraryw_test1 samples/test2/paltest_samples_test2 -threading/CreateEventA/test3/paltest_createeventa_test3 threading/CreateEventW/test3/paltest_createeventw_test3 -threading/CreateMutexA_ReleaseMutex/test2/paltest_createmutexa_releasemutex_test2 threading/CreateMutexW_ReleaseMutex/test2/paltest_createmutexw_releasemutex_test2 -threading/CreateSemaphoreA_ReleaseSemaphore/test3/paltest_createsemaphorea_releasesemaphore_test3 threading/CreateSemaphoreW_ReleaseSemaphore/test3/paltest_createsemaphorew_releasesemaphore_test3 threading/CreateThread/test2/paltest_createthread_test2 threading/CriticalSectionFunctions/test5/paltest_criticalsectionfunctions_test5 diff --git a/src/coreclr/src/pal/tests/palsuite/paltests.cpp b/src/coreclr/src/pal/tests/palsuite/paltests.cpp new file mode 100644 index 000000000000..4ec0a3982e3c --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/paltests.cpp @@ -0,0 +1,75 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*============================================================= +** +** Source: paltests.cpp +** +** Purpose: Entrypoint for all the pal tests. Written to avoid any +** standard library usage +** +**============================================================*/ +#include + +PALTest* PALTest::s_tests = 0; + +int PrintUsage(int argc, char *argv[]) +{ + if (PAL_Initialize(argc, argv)) + { + return FAIL; + } + + printf("paltests \n"); + printf("Either print list of all paltests by passing PrintPalTests, or run a single PAL test.\n"); + + PAL_TerminateEx(FAIL); + return FAIL; +} + +int PrintTests(int argc, char *argv[]) +{ + if (PAL_Initialize(argc, argv)) + { + return FAIL; + } + + PALTest *testCur = PALTest::s_tests; + for (;testCur != 0; testCur = testCur->_next) + { + printf("%s\n", testCur->_name); + } + PAL_Terminate(); + return PASS; +} + +int __cdecl main(int argc, char *argv[]) +{ + if (argc < 2) + { + return PrintUsage(argc, argv); + } + + if (strcmp(argv[1], "PrintPalTests") == 0) + { + return PrintTests(argc, argv); + } + + PALTest *testCur = PALTest::s_tests; + for (;testCur != 0; testCur = testCur->_next) + { + int i = 0; + bool stringMatches = strcmp(testCur->_name, argv[1]) == 0; + if (!stringMatches) + continue; + + for (int i = 1; i < (argc - 1); i++) + { + argv[i] = argv[i + 1]; + } + + return testCur->_entrypoint(argc - 1, argv); + } + + return PrintUsage(argc, argv); +} diff --git a/src/coreclr/src/pal/tests/palsuite/producepaltestlist.proj b/src/coreclr/src/pal/tests/palsuite/producepaltestlist.proj new file mode 100644 index 000000000000..0427efa5a207 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/producepaltestlist.proj @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/coreclr/src/pal/tests/palsuite/runpaltests.sh b/src/coreclr/src/pal/tests/palsuite/runpaltests.sh index cc8ffd6b918b..bda11101095f 100755 --- a/src/coreclr/src/pal/tests/palsuite/runpaltests.sh +++ b/src/coreclr/src/pal/tests/palsuite/runpaltests.sh @@ -6,7 +6,7 @@ if [ $# -lt 1 -o $# -gt 3 ] then echo "Usage..." - echo "runpaltests.sh []" + echo "runpaltests.sh [] []" echo echo "For example:" echo "runpaltests.sh /projectk/build/debug" @@ -19,11 +19,19 @@ echo "***** Testing PAL *****" echo # Store the location of the root of build directory -BUILD_ROOD_DIR=$1 +BUILD_ROOT_DIR=$1 +if [ -d "$(pwd)/$BUILD_ROOT_DIR" ]; then + BUILD_ROOT_DIR="$(pwd)/$BUILD_ROOT_DIR" +fi + # Create path to the compiled PAL tets in the build directory -PAL_TEST_BUILD=$BUILD_ROOD_DIR/src/pal/tests/palsuite +PAL_TEST_BUILD=$BUILD_ROOT_DIR echo Running PAL tests from $PAL_TEST_BUILD +pushd $BUILD_ROOT_DIR + +export LD_LIBRARY_PATH=$BUILD_ROOT_DIR:$LD_LIBRARY_PATH + # Create absolute path to the file that contains a list of PAL tests to execute. # This file is located next to this script in the source tree RELATIVE_PATH_TO_PAL_TESTS=$0 @@ -33,22 +41,27 @@ RELATIVE_PATH_TO_PAL_TESTS=${RELATIVE_PATH_TO_PAL_TESTS%/*.*} cd $RELATIVE_PATH_TO_PAL_TESTS # Environment variable PWD contains absolute path to the current folder # so use it to create absolute path to the file with a list of tests. -PAL_TEST_LIST=$PWD/paltestlist.txt +PAL_TEST_LIST=$BUILD_ROOT_DIR/paltestlist.txt # Change current directory back to the original location -cd $OLDPWD echo The list of PAL tests to run will be read from $PAL_TEST_LIST # Create the test output root directory -mkdir -p /tmp/PalTestOutput -if [ ! -d /tmp/PalTestOutput ]; then - rm -f -r /tmp/PalTestOutput +if [ $# -gt 2 ] +then + PAL_TEST_OUTPUT_DIR=$3 + mkdir -p $PAL_TEST_OUTPUT_DIR +else mkdir -p /tmp/PalTestOutput + if [ ! -d /tmp/PalTestOutput ]; then + rm -f -r /tmp/PalTestOutput + mkdir -p /tmp/PalTestOutput + fi + PAL_TEST_OUTPUT_DIR=/tmp/PalTestOutput/default fi # Determine the folder to use for PAL test output during the run, and the folder where output files were requested to be copied. # First check if the output folder was passed as a parameter to the script. It is supposed be the second parameter so check if # we have more than 1 argument. -PAL_TEST_OUTPUT_DIR=/tmp/PalTestOutput/default if [ $# -gt 1 ] then COPY_TO_TEST_OUTPUT_DIR=$2 @@ -57,12 +70,17 @@ else fi # Determine the folder to use for PAL test output during the run -if [ "$COPY_TO_TEST_OUTPUT_DIR" != "$PAL_TEST_OUTPUT_DIR" ]; then - # Output files were requested to be copied to a specific folder. In this mode, we need to support parallel runs of PAL tests - # on the same machine. Make a unique temp folder for working output inside /tmp/PalTestOutput. - PAL_TEST_OUTPUT_DIR=$(mktemp -d /tmp/PalTestOutput/tmp.XXXXXXXX) +if [ ! $# -gt 2 ] +then + if [ "$COPY_TO_TEST_OUTPUT_DIR" != "$PAL_TEST_OUTPUT_DIR" ]; then + # Output files were requested to be copied to a specific folder. In this mode, we need to support parallel runs of PAL tests + # on the same machine. Make a unique temp folder for working output inside $PAL_TEST_RESULTS_DIR. + PAL_TEST_OUTPUT_DIR=$(mktemp -d /tmp/PalTestOutput/tmp.XXXXXXXX) + fi fi +cd $PAL_TEST_OUTPUT_DIR + echo PAL tests will store their temporary files and output in $PAL_TEST_OUTPUT_DIR. if [ "$COPY_TO_TEST_OUTPUT_DIR" != "$PAL_TEST_OUTPUT_DIR" ]; then echo Output files will be copied to $COPY_TO_TEST_OUTPUT_DIR at the end. @@ -124,13 +142,19 @@ do # Create path to a test executable to run TEST_COMMAND="$PAL_TEST_BUILD/$TEST_NAME" + if [ ! -f $TEST_COMMAND ]; then + TEST_COMMAND="$PAL_TEST_BUILD/paltests $TEST_NAME" + fi + echo -n . + STARTTIME=$(date +%s) # Redirect to temp file $TEST_COMMAND 2>&1 | tee ${PAL_OUT_FILE} ; ( exit ${PIPESTATUS[0]} ) - # Get exit code of the test process. TEST_EXIT_CODE=$? + ENDTIME=$(date +%s) + # Change back to the output directory, and remove the test's working directory if it's empty cd $PAL_TEST_OUTPUT_DIR rmdir $TEST_WORKING_DIR 2>/dev/null @@ -143,7 +167,7 @@ do TEST_XUNIT_NAME=$(echo $TEST_XUNIT_NAME | tr / .) TEST_XUNIT_CLASSNAME=$(echo $TEST_XUNIT_CLASSNAME | tr / .) - echo -n "> $PAL_XUNIT_TEST_LIST_TMP + echo -n "> $PAL_XUNIT_TEST_LIST_TMP # If the exit code is 0 then the test passed, otherwise record a failure. if [ "$TEST_EXIT_CODE" -eq "0" ]; then @@ -153,6 +177,7 @@ do 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 FAILED_TEST="$TEST_NAME. Exit code: $TEST_EXIT_CODE" @@ -208,6 +233,8 @@ if [ "$COPY_TO_TEST_OUTPUT_DIR" != "$PAL_TEST_OUTPUT_DIR" ]; then echo Copied PAL test output files to $COPY_TO_TEST_OUTPUT_DIR. fi +popd + # Set exit code to be equal to the number PAL tests that have failed. # Exit code 0 indicates success. exit $NUMBER_OF_FAILED_TESTS diff --git a/src/coreclr/src/pal/tests/palsuite/runpaltestshelix.sh b/src/coreclr/src/pal/tests/palsuite/runpaltestshelix.sh new file mode 100644 index 000000000000..4919dc4bc443 --- /dev/null +++ b/src/coreclr/src/pal/tests/palsuite/runpaltestshelix.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# +# This script executes the PAL tests from the specified build location. +# +cd $HELIX_WORKITEM_ROOT + +TEST_OUTPUT_DIR_HELIX=$HELIX_WORKITEM_ROOT/testoutput +$HELIX_WORKITEM_ROOT/runpaltests.sh $HELIX_WORKITEM_ROOT $HELIX_WORKITEM_ROOT/testoutput $HELIX_WORKITEM_ROOT/testoutputtmp +exit_code_paltests=$? +cp $TEST_OUTPUT_DIR_HELIX/pal_tests.xml $HELIX_WORKITEM_ROOT/testResults.xml +exit $exit_code_paltests \ No newline at end of file diff --git a/src/coreclr/src/pal/tests/palsuite/samples/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/samples/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/samples/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/samples/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/samples/test1/CMakeLists.txt deleted file mode 100644 index 9841a230a595..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/samples/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_samples_test1 - ${SOURCES} -) - -add_dependencies(paltest_samples_test1 coreclrpal) - -target_link_libraries(paltest_samples_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/samples/test1/test.cpp b/src/coreclr/src/pal/tests/palsuite/samples/test1/test.cpp index 5a8fb032a375..71f2f24eafbb 100644 --- a/src/coreclr/src/pal/tests/palsuite/samples/test1/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/samples/test1/test.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(samples_test1_paltest_samples_test1, "samples/test1/paltest_samples_test1") { /* Initialize the PAL. */ diff --git a/src/coreclr/src/pal/tests/palsuite/samples/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/samples/test1/testinfo.dat deleted file mode 100644 index 35406bf33758..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/samples/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Samples -Function = sample -Name = Sample Test #1 -TYPE = DEFAULT -EXE1 = test -Description -=This is a sample test case. It will always pass. - - diff --git a/src/coreclr/src/pal/tests/palsuite/samples/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/samples/test2/CMakeLists.txt deleted file mode 100644 index 38d447a65279..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/samples/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test.cpp -) - -add_executable(paltest_samples_test2 - ${SOURCES} -) - -add_dependencies(paltest_samples_test2 coreclrpal) - -target_link_libraries(paltest_samples_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/samples/test2/test.cpp b/src/coreclr/src/pal/tests/palsuite/samples/test2/test.cpp index 82877c66c2e7..03fd5dc0c7cc 100644 --- a/src/coreclr/src/pal/tests/palsuite/samples/test2/test.cpp +++ b/src/coreclr/src/pal/tests/palsuite/samples/test2/test.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(samples_test2_paltest_samples_test2, "samples/test2/paltest_samples_test2") { int exampleInt = 9; diff --git a/src/coreclr/src/pal/tests/palsuite/samples/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/samples/test2/testinfo.dat deleted file mode 100644 index e6e4832aa128..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/samples/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Samples -Function = sample -Name = Sample Test #2 -TYPE = DEFAULT -EXE1 = test -Description -=This is a sample test case. It will always fail. - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CMakeLists.txt deleted file mode 100644 index fdb71b40c278..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -add_subdirectory(CreateEventA) -add_subdirectory(CreateEventW) -add_subdirectory(CreateMutexA_ReleaseMutex) -add_subdirectory(CreateMutexW_ReleaseMutex) -add_subdirectory(CreateProcessA) -add_subdirectory(CreateProcessW) -add_subdirectory(CreateSemaphoreA_ReleaseSemaphore) -add_subdirectory(CreateSemaphoreW_ReleaseSemaphore) -add_subdirectory(CreateThread) -add_subdirectory(CriticalSectionFunctions) -add_subdirectory(DuplicateHandle) -add_subdirectory(ExitProcess) -add_subdirectory(ExitThread) -add_subdirectory(GetCurrentProcess) -add_subdirectory(GetCurrentProcessId) -add_subdirectory(GetCurrentThread) -add_subdirectory(GetCurrentThreadId) -add_subdirectory(GetExitCodeProcess) -add_subdirectory(GetProcessTimes) -add_subdirectory(GetThreadTimes) -add_subdirectory(NamedMutex) -add_subdirectory(OpenEventW) -add_subdirectory(OpenProcess) -add_subdirectory(QueryThreadCycleTime) -add_subdirectory(QueueUserAPC) -add_subdirectory(ReleaseMutex) -add_subdirectory(releasesemaphore) -add_subdirectory(ResetEvent) -add_subdirectory(ResumeThread) -add_subdirectory(SetErrorMode) -add_subdirectory(SetEvent) -add_subdirectory(SignalObjectAndWait) -add_subdirectory(Sleep) -add_subdirectory(SleepEx) -add_subdirectory(SwitchToThread) -add_subdirectory(TerminateProcess) -add_subdirectory(ThreadPriority) -add_subdirectory(WaitForMultipleObjects) -add_subdirectory(WaitForMultipleObjectsEx) -add_subdirectory(WaitForSingleObject) -add_subdirectory(YieldProcessor) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/CMakeLists.txt deleted file mode 100644 index 0dc038e1708b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_createeventa_test1 - ${SOURCES} -) - -add_dependencies(paltest_createeventa_test1 coreclrpal) - -target_link_libraries(paltest_createeventa_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.cpp deleted file mode 100644 index 52f1a467e4fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: test1.c -** -** Purpose: Test for CreateEvent. Create an event, ensure the -** HANDLE is valid. Then check to ensure that the object is in the -** signaled state. Close the HANDLE and done. -** -** -**=========================================================*/ - -/* - Note: From the rotor_pal documentation: - - lpEventAttributes will always be NULL, bManualReset can be either - TRUE or FALSE, bInitialState can be either TRUE or FALSE, the lpName - may be non-NULL - -*/ - - -#include - -BOOL CreateEventTest() -{ - BOOL bRet = FALSE; - DWORD dwRet = 0; - - LPSECURITY_ATTRIBUTES lpEventAttributes = NULL; - BOOL bManualReset = TRUE; - BOOL bInitialState = TRUE; - - /* Call CreateEvent, and check to ensure the returned HANDLE is a - valid event HANDLE - */ - - HANDLE hEvent = CreateEvent( lpEventAttributes, - bManualReset, - bInitialState, - NULL); - - if (hEvent != NULL) - { - /* Wait for the Object (for 0 time) and ensure that it returns - the value indicating that the event is signaled. - */ - dwRet = WaitForSingleObject(hEvent,0); - - if (dwRet != WAIT_OBJECT_0) - { - Trace("CreateEventTest:WaitForSingleObject failed (%x)\n", GetLastError()); - } - else - { - /* If we make it here, and CloseHandle succeeds, then the - entire test has passed. Otherwise bRet will still show - failure - */ - bRet = CloseHandle(hEvent); - - if (!bRet) - { - Trace("CreateEventTest:CloseHandle failed (%x)\n", GetLastError()); - } - } - } - else - { - Trace("CreateEventTest:CreateEvent failed (%x)\n", GetLastError()); - } - - return bRet; -} - -int __cdecl main(int argc, char **argv) -{ - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - if(!CreateEventTest()) - { - Fail ("Test failed\n"); - } - - PAL_Terminate(); - return ( PASS ); - -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/testinfo.dat deleted file mode 100644 index 019b2a4c4163..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateEvent -Name = Positive Test for CreateEvent -TYPE = DEFAULT -EXE1 = test1 -Description -= Test for CreateEvent. Create an event, ensure the -= HANDLE is valid. Then check to ensure that the object is in the -= signaled state. Close the HANDLE and done. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/CMakeLists.txt deleted file mode 100644 index 06b634345d8e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_createeventa_test2 - ${SOURCES} -) - -add_dependencies(paltest_createeventa_test2 coreclrpal) - -target_link_libraries(paltest_createeventa_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.cpp deleted file mode 100644 index a3749e27d1d3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: test2.c -** -** Purpose: Test for CreateEvent. Create the event with the -** initial state being not signaled. Check to ensure that it -** times out when the event is triggered. -** -** -**=========================================================*/ - -#include - -BOOL CreateEventTest() -{ - BOOL bRet = FALSE; - DWORD dwRet = 0; - - LPSECURITY_ATTRIBUTES lpEventAttributes = 0; - BOOL bManualReset = TRUE; - BOOL bInitialState = FALSE; - - /* Create an event with the Initial State set to FALSE */ - - HANDLE hEvent = CreateEvent( lpEventAttributes, - bManualReset, - bInitialState, - NULL); - - if (hEvent != NULL) - { - /* This should ensure that the object is reset, or - non-signaled. - */ - - dwRet = WaitForSingleObject(hEvent,0); - - if (dwRet != WAIT_TIMEOUT) - { - Trace("CloseEventTest:WaitForSingleObject failed (%x)\n", GetLastError()); - } - else - { - /* At this point, we've tested the function with success. - So long as the HANDLE can be closed, this test should - pass. - */ - - bRet = CloseHandle(hEvent); - - if (!bRet) - { - Trace("CloseEventTest:CloseHandle failed (%x)\n", GetLastError()); - } - } - } - else - { - Trace("CloseEventTest:CreateEvent failed (%x)\n", GetLastError()); - } - - return bRet; -} - -int __cdecl main(int argc, char **argv) -{ - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - if(!CreateEventTest()) - { - Fail ("Test failed\n"); - } - - PAL_Terminate(); - return ( PASS ); - -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/testinfo.dat deleted file mode 100644 index a3ada19a0ee2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateEvent -Name = Positive Test for CreateEvent -TYPE = DEFAULT -EXE1 = test2 -Description -= Test for CreateEvent. Create the event with the -= initial state being not signaled. Check to ensure that it -= times out when the event is triggered. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/CMakeLists.txt deleted file mode 100644 index a627e2eb8537..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_createeventa_test3 - ${SOURCES} -) - -add_dependencies(paltest_createeventa_test3 coreclrpal) - -target_link_libraries(paltest_createeventa_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/test3.cpp deleted file mode 100644 index ddd299357359..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/test3.cpp +++ /dev/null @@ -1,218 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: test3.c -** -** Purpose: Tests for CreateEventA. Create an event with an empty name, -** create an event with the same name as an already created event -** object. -** -** -**=========================================================*/ - -#include - -#define SWAPPTR ((VOID *)(-1)) - -struct testCase -{ - LPSECURITY_ATTRIBUTES lpEventAttributes; - BOOL bManualReset; - BOOL bInitialState; - char lpName[MAX_PATH + 2]; - DWORD dwNameLen; - DWORD lastError; - BOOL bResult; -}; - -struct testCase testCases[]= -{ - {0, TRUE, FALSE, "", 0, ERROR_SUCCESS, PASS}, - {0, TRUE, FALSE, "", 5, ERROR_SUCCESS, PASS}, - {0, TRUE, FALSE, "", 5, ERROR_ALREADY_EXISTS, PASS}, - {0, TRUE, FALSE, "", 6, ERROR_INVALID_HANDLE, PASS}, - {0, TRUE, FALSE, "", MAX_PATH - 1 - 60, ERROR_SUCCESS, PASS}, - {0, TRUE, FALSE, "", MAX_PATH + 1, ERROR_FILENAME_EXCED_RANGE, PASS} -}; - -static HANDLE hEvent[sizeof(testCases)/sizeof(struct testCase)]; - -DWORD result[sizeof(testCases)/sizeof(struct testCase)]; - -int __cdecl main(int argc, char **argv) -{ - - BOOL bRet = TRUE; - const char *nonEventName = "aaaaaa"; - HANDLE hUnnamedEvent; - HANDLE hFMap; - DWORD dwRet; - int i; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - hUnnamedEvent = CreateEventA(0, TRUE, FALSE, NULL); - - if ( NULL == hUnnamedEvent ) - { - bRet = FALSE; - Trace ( "PALSUITE ERROR: CreateEventA (%d, %d, %d, NULL) call " - "returned NULL.\nGetLastError returned %u.\n", 0, TRUE, FALSE, - GetLastError()); - } - - if (!CloseHandle(hUnnamedEvent)) - { - bRet = FALSE; - Trace("PALSUITE ERROR: CreateEventA: CloseHandle(%lp); call " - "failed\nGetLastError returned '%u'.\n", hUnnamedEvent, - GetLastError()); - } - - /* Create non-event with the same name as one of the testCases */ - hFMap = CreateFileMappingA( SWAPPTR, NULL, PAGE_READONLY, 0, 1, - nonEventName ); - - if ( NULL == hFMap ) - { - bRet = FALSE; - Trace ( "PALSUITE ERROR: CreateFileMapping (%p, %p, %d, %d, %d, %s)" - " call returned NULL.\nGetLastError returned %u.\n", - SWAPPTR, NULL, PAGE_READONLY, 0, 0, nonEventName, - GetLastError()); - goto done; - } - - /* Create Events */ - for (i = 0; i < sizeof(testCases)/sizeof(struct testCase); i++) - { - /* create name */ - memset (testCases[i].lpName, '\0', (MAX_PATH + 2)); - memset (testCases[i].lpName, 'a', testCases[i].dwNameLen ); - - SetLastError(ERROR_SUCCESS); - - hEvent[i] = CreateEventA( testCases[i].lpEventAttributes, - testCases[i].bManualReset, - testCases[i].bInitialState, - testCases[i].lpName); - - if (hEvent[i] != INVALID_HANDLE_VALUE) - { - DWORD dwError = GetLastError(); - - if (dwError != testCases[i].lastError) - { - bRet = FALSE; - Trace ("PALSUITE ERROR:\nCreateEventA(%lp, %d, %d, %s)" - "\nGetLastError returned '%u', it should have returned" - "'%d' at index '%d'.\n", testCases[i].lpEventAttributes, - testCases[i].bManualReset, testCases[i].bInitialState, - testCases[i].lpName, dwError, - testCases[i].lastError, i); - } - if ( ERROR_FILENAME_EXCED_RANGE == testCases[i].lastError ) - { - result [i] = 1; - } - if ( ERROR_INVALID_HANDLE == testCases[i].lastError ) - { - result [i] = 1; - } - /* - * If we expected the testcase to FAIL and it passed, - * report an error. - */ - if (testCases[i].bResult == FAIL) - { - bRet = FALSE; - Trace ("PALSUITE ERROR:\nCreateEventA(%lp, %d, %d, %s)" - "\nShould have returned INVALID_HANDLE_VALUE but " - "didn't at index '%d'.\n", - testCases[i].lpEventAttributes, - testCases[i].bManualReset, - testCases[i].bInitialState, - testCases[i].lpName, i); - } - /* - * If result hasn't been set already set it to 0 so all the - * resources will be freed. - */ - if (!result[i] ) - { - result[i] = 0; - } - } - else - { - /* - * If we get an INVALID_HANDLE_VALUE and we expected the - * test case to pass, report an error. - */ - result[i] = 1; - - if (testCases[i].bResult == PASS) - { - bRet = FALSE; - Trace ("PALSUITE ERROR:\nCreateEventA(%lp, %d, %d, %s);" - "\nReturned INVALID_HANDLE_VALUE at index '%d'.\n", - testCases[i].lpEventAttributes, - testCases[i].bManualReset, testCases[i].bInitialState, - testCases[i].lpName, i); - } - } - } - - /* cleanup */ - for (i = 0; i < sizeof(testCases)/sizeof(struct testCase); i++) - { - if (result[i]) - { - continue; - } - dwRet = WaitForSingleObject ( hEvent[i], 0 ); - - if (dwRet != WAIT_TIMEOUT) - { - bRet = FALSE; - Trace("PALSUITE ERROR: CreateEventA:\nWaitForSingleObject (%lp, " - "%d) call failed at index %d .\nGetLastError returned " - "'%u'.\n", hEvent[i], 0, i, GetLastError()); - } - - if (!CloseHandle(hEvent[i])) - { - bRet = FALSE; - Trace("PALSUITE ERROR: CreateEventA: CloseHandle(%lp) call " - "failed at index %d\nGetLastError returned '%u'.\n", - hEvent[i], i, GetLastError()); - } - } - -done: - if (!CloseHandle(hFMap)) - { - bRet = FALSE; - Trace("PALSUITE ERROR: CreateEventW: CloseHandle(%p) call " - "failed\nGetLastError returned '%u'.\n", hFMap, - GetLastError()); - } - - if (FALSE == bRet) - { - bRet = FAIL; - } - else - { - bRet = PASS; - } - - PAL_TerminateEx(bRet); - - return(bRet); -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/testinfo.dat deleted file mode 100644 index acf4bf5f94d2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventA/test3/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateEventA -Name = Positive Test for CreateEventA -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests for CreateEventA. Create an unnamed event, create -= an event with an empty name, create an event with a name longer than -= MAX_PATH, MAX_PATH + 1, create an event with a name already taken -= by a non-event object, create an event with a name already taken -= by an event object. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/CMakeLists.txt deleted file mode 100644 index b73b132cd29d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_createeventw_test1 - ${SOURCES} -) - -add_dependencies(paltest_createeventw_test1 coreclrpal) - -target_link_libraries(paltest_createeventw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.cpp index 8153d63a313b..361c58d1ad1d 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.cpp @@ -19,7 +19,7 @@ #define UNICODE #include -BOOL CreateEventTest() +BOOL CreateEventTest_CreateEvent_test1() { BOOL bRet = FALSE; DWORD dwRet = 0; @@ -73,7 +73,7 @@ BOOL CreateEventTest() return bRet; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CreateEventW_test1_paltest_createeventw_test1, "threading/CreateEventW/test1/paltest_createeventw_test1") { if(0 != (PAL_Initialize(argc, argv))) @@ -81,7 +81,7 @@ int __cdecl main(int argc, char **argv) return ( FAIL ); } - if(!CreateEventTest()) + if(!CreateEventTest_CreateEvent_test1()) { Fail ("Test failed\n"); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/testinfo.dat deleted file mode 100644 index d0ed8a534b64..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateEventW -Name = Positive Test for CreateEventW -TYPE = DEFAULT -EXE1 = test1 -Description -= Test for CreateEventW. Create an event, ensure the -= HANDLE is valid. Then check to ensure that the object is in the -= signaled state. Close the HANDLE and done. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/CMakeLists.txt deleted file mode 100644 index 60c505b1f49f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_createeventw_test2 - ${SOURCES} -) - -add_dependencies(paltest_createeventw_test2 coreclrpal) - -target_link_libraries(paltest_createeventw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.cpp index 7c7905c7e5ff..c40581718fd5 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.cpp @@ -14,7 +14,7 @@ #define UNICODE #include -BOOL CreateEventTest() +BOOL CreateEventTest_CreateEvent_test2() { BOOL bRet = FALSE; DWORD dwRet = 0; @@ -66,14 +66,14 @@ BOOL CreateEventTest() return bRet; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CreateEventW_test2_paltest_createeventw_test2, "threading/CreateEventW/test2/paltest_createeventw_test2") { if(0 != (PAL_Initialize(argc, argv))) { return ( FAIL ); } - if(!CreateEventTest()) + if(!CreateEventTest_CreateEvent_test2()) { Fail ("Test failed\n"); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/testinfo.dat deleted file mode 100644 index 9588f2d100a4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateEventW -Name = Positive Test for CreateEventW -TYPE = DEFAULT -EXE1 = test2 -Description -= Test for CreateEvent. Create the event with the -= initial state being not signaled. Check to ensure that it -= times out when the event is triggered. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/CMakeLists.txt deleted file mode 100644 index 51068211f035..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_createeventw_test3 - ${SOURCES} -) - -add_dependencies(paltest_createeventw_test3 coreclrpal) - -target_link_libraries(paltest_createeventw_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/test3.cpp index 8b07d55d35e0..023ccd1018ac 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/test3.cpp @@ -28,22 +28,21 @@ struct testCase BOOL bResult; }; -struct testCase testCases[]= +PALTEST(threading_CreateEventW_test3_paltest_createeventw_test3, "threading/CreateEventW/test3/paltest_createeventw_test3") { - {0, TRUE, FALSE, {'\0'}, 0, ERROR_SUCCESS, PASS}, - {0, TRUE, FALSE, {'\0'}, 5, ERROR_SUCCESS, PASS}, - {0, TRUE, FALSE, {'\0'}, 5, ERROR_ALREADY_EXISTS, PASS}, - {0, TRUE, FALSE, {'\0'}, 6, ERROR_INVALID_HANDLE, PASS}, - {0, TRUE, FALSE, {'\0'}, MAX_PATH - 1 - 60, ERROR_SUCCESS, PASS}, - {0, TRUE, FALSE, {'\0'}, MAX_PATH - 60, ERROR_SUCCESS, PASS}, -}; - -static HANDLE hEvent[sizeof(testCases)/sizeof(struct testCase)]; + struct testCase testCases[]= + { + {0, TRUE, FALSE, {'\0'}, 0, ERROR_SUCCESS, PASS}, + {0, TRUE, FALSE, {'\0'}, 5, ERROR_SUCCESS, PASS}, + {0, TRUE, FALSE, {'\0'}, 5, ERROR_ALREADY_EXISTS, PASS}, + {0, TRUE, FALSE, {'\0'}, 6, ERROR_INVALID_HANDLE, PASS}, + {0, TRUE, FALSE, {'\0'}, MAX_PATH - 1 - 60, ERROR_SUCCESS, PASS}, + {0, TRUE, FALSE, {'\0'}, MAX_PATH - 60, ERROR_SUCCESS, PASS}, + }; -DWORD result[sizeof(testCases)/sizeof(struct testCase)]; + HANDLE hEvent[sizeof(testCases)/sizeof(struct testCase)]; -int __cdecl main(int argc, char **argv) -{ + DWORD result[sizeof(testCases)/sizeof(struct testCase)]; BOOL bRet = TRUE; WCHAR nonEventName[] = {'a','a','a','a','a','a','\0'}; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/testinfo.dat deleted file mode 100644 index 58d3e98d7245..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateEventW/test3/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateEventW -Name = Positive Test for CreateEventW -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests for CreateEventW. Create an unnamed event, create -= an event with an empty name, create an event with a name longer than -= MAX_PATH, MAX_PATH + 1, create an event with a name already taken -= by a non-event object, create an event with a name already taken -= by an event object. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CMakeLists.txt deleted file mode 100644 index ddd1ed9cce16..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateMutexA.cpp -) - -add_executable(paltest_createmutexa_releasemutex_test1 - ${SOURCES} -) - -add_dependencies(paltest_createmutexa_releasemutex_test1 coreclrpal) - -target_link_libraries(paltest_createmutexa_releasemutex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.cpp deleted file mode 100644 index 3fe70fabefd0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.cpp +++ /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. - -/*============================================================ -** -** Source: CreateMutexA_ReleaseMutex/test1/CreateMutexA.c -** -** Purpose: This test case tests whether a Mutex object created -** with CreateMutex really works by mutually excluding -** threads from accessing a data structure at the same -** time. Here we have a buffer that can be filled or -** emptied, we use a Mutex object to ensure that one -** operation cannot be started until the other is -** finished. If one operation detects that the other -** has not finished, it fails. There is a Producer -** thread which will try to fill the buffer 25 times, -** and a consumer thread which try to empty the buffer -** 25 times. If either the fill or empty operations -** fails because the Mutex failed to mutually exclude -** them, the corresponding thread will set an error -** flag and return. This will cause the test case to -** fail. -** -** To increase the probability of identifying problems, -** the Fill opeartion has been slowed down with a call -** to Sleep. This ensures that one operation will try -** to access the shared buffer while the other is in -** progress. -** -** NOTE: this test case also serves as a test case for -** WaitForSingleObject. -** -** -** Dependencies: CreateThread -** ReleaseMutex -** WaitForSingleObject -** WaitForMultipleObjects -** Sleep -** memset -** - -** -**=========================================================*/ - -#define UNICODE -#include - -/* Define some values that we will using many times */ -#define MAIN_BUF_SIZE 40 -#define NUM_OF_CYCLES 40 - -/* Buffer Operation return codes */ -#define OP_OK 0 -#define OP_ERR 1 -#define OP_NONE 2 - - -HANDLE hMutex; /* handle to mutex */ - -BOOL bProdErr; /* Producer error Flag */ -BOOL bConErr; /* Consumer error Flag */ - -/* Test Buffer */ -char Buffer[MAIN_BUF_SIZE]; - -/* - * EmptyBuffer implements the empty operation for test buffer. - */ -int -EmptyBuffer() -{ - int i; - - if ( WaitForSingleObject(hMutex, INFINITE) == WAIT_FAILED) - { - Fail("ERROR: WaitForSingleObject failed.\n"); - } - - /* Check to see if the buffer is already completely empty */ - for (i=0; i - -const char *szMutex = "MyMutex"; -const char *szEmpty = ""; - -/* Function Prototypes */ -BOOL TestNamedMutex(const char *szMutexName); -DWORD NamedMutexThread(LPVOID lpParam); -BOOL NegativeReleaseMutexTests(); - -struct ThreadData -{ - HANDLE hMutex; - BOOL bReturnCode; -}; -typedef struct ThreadData THREADDATA; - - -int __cdecl main (int argc, char **argv) -{ - BOOL bFailures = FALSE; - char *szMaxPath; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - - /* - * Test named Mutexes with ordinary string - */ - - if (!TestNamedMutex(szMutex)) - { - bFailures = TRUE; - } - - - /* - * Test named Mutexes with empty ("") string - */ - - if (!TestNamedMutex(szEmpty)) - { - bFailures = TRUE; - } - - - /* - * Test named Mutexes with string of length MAX_LONGPATHPATH - */ - - szMaxPath = (char *)malloc(MAX_LONGPATH+2); - memset(szMaxPath, 'A', MAX_LONGPATH-60); - szMaxPath[MAX_LONGPATH-60] = 0; - - if (!TestNamedMutex(szMaxPath)) - { - bFailures = TRUE; - } - - free((void*)szMaxPath); - - - /* - * Run some negative tests on ReleaseMutex - */ - - if (!NegativeReleaseMutexTests()) - { - bFailures = TRUE; - } - - - /* - * If there were any failures, then abort with a call to Fail - */ - - if (bFailures == TRUE) - { - Fail("ERROR: There some failures in the Mutex tests.\n"); - } - - PAL_Terminate(); - return ( PASS ); -} - - -/* - * Testing Function - * - * Try to get multiple handles to a named Mutex and test - * to make sure they actually refer to same Mutex object. - */ -BOOL TestNamedMutex(const char *szMutexName) -{ - DWORD dwData; - HANDLE hMutex1; - HANDLE hMutex2; - HANDLE hThread; - THREADDATA threadData; - - /* Create a mutex and take ownership immediately */ - hMutex1 = CreateMutexA (NULL, TRUE, szMutexName); - - if (NULL == hMutex1) - { - Trace("ERROR: CreateMutexA #1 failed. GetLastError returned %u\n", - GetLastError()); - return FALSE; - } - - /* Try to wait on the Mutex we just created. We should not block. */ - if (WaitForSingleObject(hMutex1, 1000) == WAIT_TIMEOUT) - { - Trace("WaitForSingleObject blocked on a Mutex that we owned.\n"); - return FALSE; - } - /* We have to call ReleaseMutex here because of the Wait */ - if (ReleaseMutex(hMutex1) == FALSE) - { - Trace("ReleaseMutex Failed.\n"); - return FALSE; - } - - /* Get a second handle to the same mutex */ - hMutex2 = CreateMutexA (NULL, FALSE, szMutexName); - - if (NULL == hMutex2) - { - Trace("ERROR: CreateMutex #2 failed. GetLastError returned %u\n", - GetLastError()); - free((void*)szMutexName); - return FALSE; - } - - /* - * Create a thread that will Wait on the second handle. - */ - threadData.hMutex = hMutex2; - hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)NamedMutexThread, - (LPVOID)&threadData, 0, &dwData); - - if (NULL == hThread) - { - Trace("ERROR: CreateThread failed. GetLastError returned %u\n", - GetLastError()); - return FALSE; - } - - /* Give the thread a little time to execute & wait*/ - Sleep(500); - - /* Signal the the first handle */ - if (ReleaseMutex(hMutex1) == FALSE) - { - Trace("ReleaseMutex Failed.\n"); - return FALSE; - } - - /* Give the thread some time to finish */ - Sleep(2000); - - /* Clean Up */ - if (CloseHandle(hMutex1) == FALSE || - CloseHandle(hMutex2) == FALSE || - CloseHandle(hThread) == FALSE) - { - Trace("ERROR: CloseHandle failed.\n"); - return FALSE; - } - - /* Check the return code to see if signalling the first */ - /* Mutex handle woke up the thread which was Waiting on */ - /* the second handle. */ - if (threadData.bReturnCode != FALSE) - { - Trace("ERROR: The handles did not refer to the same Mutex object.\n"); - return FALSE; - } - - return TRUE; -} - - -/* - * Thread function used with above testing function. - */ -DWORD NamedMutexThread(LPVOID lpParam) -{ - BOOL bTimedOut = FALSE; - THREADDATA *lpThreadData = (THREADDATA *)lpParam; - - /* Wait on the Mutex that was passed to us */ - if (WaitForSingleObject(lpThreadData->hMutex, 10000) == WAIT_TIMEOUT) - { - /* The Mutex was not signaled in the allotted time */ - bTimedOut = TRUE; - } - if (ReleaseMutex(lpThreadData->hMutex) == FALSE) - { - Trace("ERROR: ReleaseMutex failed.\n"); - lpThreadData->bReturnCode = FALSE; - return 0; - } - - /* Indicate whether we timed out Waiting on the Mutex */ - lpThreadData->bReturnCode = bTimedOut; - - return 0; -} - - -/* - * Testing Function - * - * Try some negative tests on ReleaseMutex - */ -BOOL NegativeReleaseMutexTests() -{ - HANDLE hMutex; - BOOL bRet; - BOOL bResults = TRUE; - - - /* - * Try calling ReleaseMutex on a null handle - */ - hMutex = 0; - bRet = ReleaseMutex(hMutex); - - if (bRet != 0) - { - Trace("Error: ReleaseMutex accepted null handle.\n"); - bResults = FALSE; - } - - - /* - * Try calling ReleaseMutex on an handle that we don't own - */ - hMutex = CreateMutexA (NULL, TRUE, NULL); - if (hMutex == 0) - { - Trace("Error: CreateMutex failed.\n"); - bResults = FALSE; - } - - bRet = ReleaseMutex(hMutex); - bRet = ReleaseMutex(hMutex); - - if (bRet != FALSE) - { - Trace("Error: ReleaseMutex accepted unowned handle.\n"); - bResults = FALSE; - } - - if (CloseHandle(hMutex) == FALSE) - { - Trace("Error: CloseHandle failed.\n"); - bResults = FALSE; - } - - - - /* - * Try calling ReleaseMutex on an handle that has been closed - */ - hMutex = CreateMutexA (NULL, TRUE, NULL); - if (hMutex == 0) - { - Trace("Error: CreateMutex failed.\n"); - bResults = FALSE; - } - - if (ReleaseMutex(hMutex) == FALSE) - { - Trace("Error: ReleaseMutex failed.\n"); - bResults = FALSE; - } - if (CloseHandle(hMutex) == FALSE) - { - Trace("Error: CloseHandle failed.\n"); - bResults = FALSE; - } - - bRet = ReleaseMutex(hMutex); - - if (bRet != FALSE) - { - Trace("Error: ReleaseMutex accepted invalid handle.\n"); - bResults = FALSE; - } - - return bResults; -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/testinfo.dat deleted file mode 100644 index 92a71b43a7cf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/testinfo.dat +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateMutexA / ReleaseMutex -Name = Basic validity Tests for CreateMutexA / ReleaseMutex -TYPE = DEFAULT -EXE1 = createmutexa -Description -= This test case tests the following things -= - Creation of named Mutexes -= - Creating multiple handles to a single named Mutex -= - Ensuring that these handles work interchangeably -= - Setting bInitialOwnerFlag to TRUE will cause the -= initial call to a Wait function on the same Mutex -= to actually wait. -= - Waiting on a Mutex that a thread already owns should -= not block. -= - Create Named mutex with empty string ("") -= - Create Named mutex with string of MAX_PATH length -= - Calling RelaseMutex with invalid Mutex handles and -= valid but unowned Mutexes. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CMakeLists.txt deleted file mode 100644 index b899c044d2c0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateMutexW.cpp -) - -add_executable(paltest_createmutexw_releasemutex_test1 - ${SOURCES} -) - -add_dependencies(paltest_createmutexw_releasemutex_test1 coreclrpal) - -target_link_libraries(paltest_createmutexw_releasemutex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.cpp index 28aa46be7e0f..98d079197d54 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.cpp @@ -55,13 +55,13 @@ #define OP_NONE 2 -HANDLE hMutex; /* handle to mutex */ +static HANDLE hMutex; /* handle to mutex */ -BOOL bProdErr; /* Producer error Flag */ -BOOL bConErr; /* Consumer error Flag */ +static BOOL bProdErr; /* Producer error Flag */ +static BOOL bConErr; /* Consumer error Flag */ /* Test Buffer */ -char Buffer[MAIN_BUF_SIZE]; +static char Buffer[MAIN_BUF_SIZE]; /* * EmptyBuffer implements the empty operation for test buffer. @@ -230,7 +230,7 @@ DWORD PALAPI Consumer( LPVOID lpParam ) } -int __cdecl main (int argc, char **argv) +PALTEST(threading_CreateMutexW_ReleaseMutex_test1_paltest_createmutexw_releasemutex_test1, "threading/CreateMutexW_ReleaseMutex/test1/paltest_createmutexw_releasemutex_test1") { DWORD dwThreadId; DWORD dwWaitRet; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/testinfo.dat deleted file mode 100644 index 7a95eea6166f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/testinfo.dat +++ /dev/null @@ -1,32 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateMutexW / ReleaseMutex -Name = Positive Test for CreateMutexW and ReleaseMutex -TYPE = DEFAULT -EXE1 = createmutexw -Description -= This test cases test whether a Mutex object created -= with CreateMutexW really works by mutually excluding -= threads from accessing a data structure at the same -= time. Here we have a buffer that can be filled or -= emptied, we use a Mutex object to ensure that one -= operation cannot be started until the other is -= finished. If one operation detects that the other -= has not finished, it fails. There is a Producer -= thread which will try to fill the buffer 25 times, -= and a consumer thread which try to empty the buffer -= 25 times. If either the fill or empty operations -= fails because the Mutex failed to mutually exclude -= then, the corresponding thread will set an error -= flag and return. This will cause the test case to -= fail. -= To increase the probability of identifying problems, -= the Fill opeartion has been slowed dowm with a call -= to Sleep. This ensures that one operation will try -= to access the shared buffer while the other is in -= progress. -= NOTE: this test case also serves as a test case for -= WaitForSingleObject. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CMakeLists.txt deleted file mode 100644 index 72c6d423ae5f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateMutexW.cpp -) - -add_executable(paltest_createmutexw_releasemutex_test2 - ${SOURCES} -) - -add_dependencies(paltest_createmutexw_releasemutex_test2 coreclrpal) - -target_link_libraries(paltest_createmutexw_releasemutex_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.cpp index 2a8ba343f942..1e4ca6c93c59 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.cpp @@ -33,13 +33,13 @@ #define UNICODE #include -const char *szMutex = "MyMutex"; -const char *szEmpty = ""; +#define szMutex "MyMutex" +#define szEmpty "" /* Function Prototypes */ -BOOL TestNamedMutex(const char *szMutexName); -DWORD NamedMutexThread(LPVOID lpParam); -BOOL NegativeReleaseMutexTests(); +BOOL TestNamedMutex_CreateMutexW_ReleaseMutex_test2(const char *szMutexName); +DWORD NamedMutexThread_CreateMutexW_ReleaseMutex_test2(LPVOID lpParam); +BOOL NegativeReleaseMutexTests_CreateMutexW_ReleaseMutex_test2(); struct ThreadData { @@ -49,7 +49,7 @@ struct ThreadData typedef struct ThreadData THREADDATA; -int __cdecl main (int argc, char **argv) +PALTEST(threading_CreateMutexW_ReleaseMutex_test2_paltest_createmutexw_releasemutex_test2, "threading/CreateMutexW_ReleaseMutex/test2/paltest_createmutexw_releasemutex_test2") { BOOL bFailures = FALSE; char *szMaxPath; @@ -64,7 +64,7 @@ int __cdecl main (int argc, char **argv) * Test named Mutexes with ordinary string */ - if (!TestNamedMutex(szMutex)) + if (!TestNamedMutex_CreateMutexW_ReleaseMutex_test2(szMutex)) { bFailures = TRUE; } @@ -74,7 +74,7 @@ int __cdecl main (int argc, char **argv) * Test named Mutexes with empty ("") string */ - if (!TestNamedMutex(szEmpty)) + if (!TestNamedMutex_CreateMutexW_ReleaseMutex_test2(szEmpty)) { bFailures = TRUE; } @@ -88,7 +88,7 @@ int __cdecl main (int argc, char **argv) memset(szMaxPath, 'A', MAX_LONGPATH-60); szMaxPath[MAX_LONGPATH-60] = 0; - if (!TestNamedMutex(szMaxPath)) + if (!TestNamedMutex_CreateMutexW_ReleaseMutex_test2(szMaxPath)) { bFailures = TRUE; } @@ -100,7 +100,7 @@ int __cdecl main (int argc, char **argv) * Run some negative tests on ReleaseMutex */ - if (!NegativeReleaseMutexTests()) + if (!NegativeReleaseMutexTests_CreateMutexW_ReleaseMutex_test2()) { bFailures = TRUE; } @@ -126,7 +126,7 @@ int __cdecl main (int argc, char **argv) * Try to get multiple handles to a named Mutex and test * to make sure they actually refer to same Mutex object. */ -BOOL TestNamedMutex(const char *szMutexName) +BOOL TestNamedMutex_CreateMutexW_ReleaseMutex_test2(const char *szMutexName) { DWORD dwData; HANDLE hMutex1; @@ -181,7 +181,7 @@ BOOL TestNamedMutex(const char *szMutexName) * Create a thread that will Wait on the second handle. */ threadData.hMutex = hMutex2; - hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)NamedMutexThread, + hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)NamedMutexThread_CreateMutexW_ReleaseMutex_test2, (LPVOID)&threadData, 0, &dwData); if (NULL == hThread) @@ -229,7 +229,7 @@ BOOL TestNamedMutex(const char *szMutexName) /* * Thread function used with above testing function. */ -DWORD NamedMutexThread(LPVOID lpParam) +DWORD NamedMutexThread_CreateMutexW_ReleaseMutex_test2(LPVOID lpParam) { BOOL bTimedOut = FALSE; THREADDATA *lpThreadData = (THREADDATA *)lpParam; @@ -259,7 +259,7 @@ DWORD NamedMutexThread(LPVOID lpParam) * * Try some negative tests on ReleaseMutex */ -BOOL NegativeReleaseMutexTests() +BOOL NegativeReleaseMutexTests_CreateMutexW_ReleaseMutex_test2() { HANDLE hMutex; BOOL bRet; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/testinfo.dat deleted file mode 100644 index 948598c875c5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/testinfo.dat +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateMutexW / ReleaseMutex -Name = Basic validity Tests for CreateMutexW / ReleaseMutex -TYPE = DEFAULT -EXE1 = createmutexw -Description -= This test case tests the following things -= - Creation of named Mutexes -= - Creating multiple handles to a single named Mutex -= - Ensuring that these handles work interchangeably -= - Setting bInitialOwnerFlag to TRUE will cause the -= initial call to a Wait function on the same Mutex -= to actually wait. -= - Waiting on a Mutex that a thread already owns should -= not block. -= - Create Named mutex with empty string ("") -= - Create Named mutex with string of MAX_PATH length -= - Calling RelaseMutex with invalid Mutex handles and -= valid but unowned Mutexes. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/CMakeLists.txt deleted file mode 100644 index 869f813e4750..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - parentProcess.cpp -) - -add_executable(paltest_createprocessa_test1 - ${TESTSOURCES} -) - -add_dependencies(paltest_createprocessa_test1 coreclrpal) - -target_link_libraries(paltest_createprocessa_test1 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childProcess.cpp -) - -add_executable(paltest_createprocessa_test1_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_createprocessa_test1_child coreclrpal) - -target_link_libraries(paltest_createprocessa_test1_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.cpp deleted file mode 100644 index 27a3265a2ea6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: CreateProcessA/test1/childprocess.c -** -** Purpose: Test to ensure CreateProcessA starts a new process. This test -** launches a child process, and examines a file written by the child. -** This code is the child code. -** -** Dependencies: GetCurrentDirectory -** strlen -** fopen -** fclose -** fprintf -** - -** -**=========================================================*/ - -#include - -const char *szCommonFileA = "childdata.tmp"; - -const char *szPathDelimA = "\\"; - -const char *szCommonStringA = "058d2d057111a313aa82401c2e856002\0"; - -/* - * Take two wide strings representing file and directory names - * (dirName, fileName), join the strings with the appropriate path - * delimiter and populate a wide character buffer (absPathName) with - * the resulting string. - * - * Returns: The number of wide characters in the resulting string. - * 0 is returned on Error. - */ -int -mkAbsoluteFilenameA ( - LPSTR dirName, - DWORD dwDirLength, - LPCSTR fileName, - DWORD dwFileLength, - LPSTR absPathName ) -{ - extern const char *szPathDelimA; - - DWORD sizeDN, sizeFN, sizeAPN; - - sizeDN = strlen( dirName ); - sizeFN = strlen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if ( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - strncpy(absPathName, dirName, dwDirLength +1); - strncpy(absPathName, szPathDelimA, 2); - strncpy(absPathName, fileName, dwFileLength +1); - - return (sizeAPN); - -} - -int __cdecl main( int argc, char **argv ) -{ - - static FILE * fp; - - DWORD dwFileLength; - DWORD dwDirLength; - DWORD dwSize; - - char szDirNameA[_MAX_DIR]; - char szAbsPathNameA[_MAX_PATH]; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - dwDirLength = GetCurrentDirectory( _MAX_PATH, szDirNameA ); - - if (0 == dwDirLength) - { - Fail ("GetCurrentDirectory call failed. Could not get " - "current working directory\n. Exiting.\n"); - } - - dwFileLength = strlen( szCommonFileA ); - - dwSize = mkAbsoluteFilenameA( szDirNameA, dwDirLength, szCommonFileA, - dwFileLength, szAbsPathNameA ); - - if (0 == dwSize) - { - Fail ("Palsuite Code: mkAbsoluteFilename() call failed. Could " - "not build absolute path name to file\n. Exiting.\n"); - } - - if ( NULL == ( fp = fopen ( szAbsPathNameA , "w+" ) ) ) - { - /* - * A return value of NULL indicates an error condition or an - * EOF condition - */ - Fail ("%s unable to open %s for writing. Exiting.\n", argv[0] - , szAbsPathNameA ); - } - - if ( 0 >= ( fprintf ( fp, "%s", szCommonStringA ))) - { - Fail("%s unable to write to %s. Exiting.\n", argv[0] - , szAbsPathNameA ); - } - - if (0 != (fclose ( fp ))) - { - Fail ("%s unable to close file %s. Pid may not be " - "written to file. Exiting.\n", argv[0], szAbsPathNameA ); - } - - PAL_Terminate(); - return ( PASS ); - -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.cpp deleted file mode 100644 index 145bb1808fe8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.cpp +++ /dev/null @@ -1,200 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: CreateProcessA/test1/parentprocess.c -** -** Purpose: Test to ensure CreateProcessA starts a new process. This test -** launches a child process, and examines a file written by the child. -** This process (the parent process) reads the file created by the child and -** compares the value the child wrote to the file. (a const char *) -** -** Dependencies: GetCurrentDirectory -** strlen -** WaitForSingleObject -** fopen -** fclose -** Fail -** - -** -**=========================================================*/ - -#include - -const char *szCommonFileA = "childdata.tmp"; - -const char *szChildFileA = "paltest_createprocessa_test1_child"; - -const char *szPathDelimA = "\\"; - -const char *szCommonStringA = "058d2d057111a313aa82401c2e856002\0"; - -/* - * Take two wide strings representing file and directory names - * (dirName, fileName), join the strings with the appropriate path - * delimiter and populate a wide character buffer (absPathName) with - * the resulting string. - * - * Returns: The number of wide characters in the resulting string. - * 0 is returned on Error. - */ -int -mkAbsoluteFilenameA ( - LPSTR dirName, - DWORD dwDirLength, - LPCSTR fileName, - DWORD dwFileLength, - LPSTR absPathName ) -{ - extern const char *szPathDelimA; - - DWORD sizeDN, sizeFN, sizeAPN; - - sizeDN = strlen( dirName ); - sizeFN = strlen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if ( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - strncpy(absPathName, dirName, dwDirLength +1); - strncpy(absPathName, szPathDelimA, 2); - strncpy(absPathName, fileName, dwFileLength +1); - - return (sizeAPN); - -} - -int __cdecl main( int argc, char **argv ) - -{ - - STARTUPINFO si; - PROCESS_INFORMATION pi; - - static FILE * fp; - - DWORD dwFileLength; - DWORD dwDirLength; - DWORD dwSize; - - size_t cslen; - - char szReadStringA[256]; - - char szDirNameA[_MAX_DIR]; - char absPathBuf[_MAX_PATH]; - char *szAbsPathNameA; - - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - ZeroMemory ( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory ( &pi, sizeof(pi) ); - - szAbsPathNameA=&absPathBuf[0]; - dwFileLength = strlen( szChildFileA ); - - dwDirLength = GetCurrentDirectory(_MAX_PATH, szDirNameA); - - if (0 == dwDirLength) - { - Fail ("GetCurrentDirectory call failed. Could not get " - "current working directory\n. Exiting.\n"); - } - - dwSize = mkAbsoluteFilenameA( szDirNameA, dwDirLength, szChildFileA, - dwFileLength, szAbsPathNameA ); - - if (0 == dwSize) - { - Fail ("Palsuite Code: mkAbsoluteFilename() call failed. Could " - "not build absolute path name to file\n. Exiting.\n"); - } - - if ( !CreateProcessA ( NULL, - szAbsPathNameA, - NULL, - NULL, - FALSE, - CREATE_NEW_CONSOLE, - NULL, - NULL, - &si, - &pi ) - ) - { - Fail ( "CreateProcess call failed. GetLastError returned %d\n", - GetLastError() ); - } - - WaitForSingleObject ( pi.hProcess, INFINITE ); - - szAbsPathNameA=&absPathBuf[0]; - - dwFileLength = strlen( szCommonFileA ); - - dwSize = mkAbsoluteFilenameA( szDirNameA, dwDirLength, szCommonFileA, - dwFileLength, szAbsPathNameA ); - - /* set the string length for the open call*/ - - if (0 == dwSize) - { - Fail ("Palsuite Code: mkAbsoluteFilename() call failed. Could " - "not build absolute path name to file\n. Exiting.\n"); - } - - if ( NULL == ( fp = fopen ( szAbsPathNameA , "r" ) ) ) - { - Fail ("%s\nunable to open %s\nfor reading. Exiting.\n", argv[0], - szAbsPathNameA ); - } - - cslen = strlen ( szCommonStringA ); - - if ( NULL == fgets( szReadStringA, (cslen + 1), fp )) - { - /* - * A return value of NULL indicates an error condition or an - * EOF condition - */ - Fail ("%s\nunable to read file\n%s\nszReadStringA is %s\n" - "Exiting.\n", argv[0], szAbsPathNameA, - szReadStringA ); - - } - if ( 0 != strncmp( szReadStringA, szCommonStringA, cslen )) - { - Fail ("string comparison failed.\n szReadStringA is %s and\n" - "szCommonStringA is %s\n", szReadStringA, - szCommonStringA ); - } - else - { - Trace ("string comparison passed.\n"); - } - - if (0 != (fclose ( fp ))) - { - Trace ("%s unable to close file %s. This may cause a file pointer " - "leak. Continuing.\n", argv[0], szAbsPathNameA ); - } - - /* Close process and thread handle */ - CloseHandle ( pi.hProcess ); - CloseHandle ( pi.hThread ); - - PAL_Terminate(); - return ( PASS ); - -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/testinfo.dat deleted file mode 100644 index cee46a23f418..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateProcessA -Name = Positive Test for CreateProcessA -TYPE = DEFAULT -EXE1 = parentprocess -EXE2 = childprocess -Description -= Test the CreateProcessA function. The test executes the childprocess -= program. The childprocess program launches and writes a const char string -= to a file childdata. The parent waits for the completion of childprocess -= and then reads the string from the childdata file. If the string in the -= file matches it's copy of the const char string, then the test succeeds. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/CMakeLists.txt deleted file mode 100644 index 20c1343c7596..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - parentprocess.cpp -) - -add_executable(paltest_createprocessa_test2 - ${TESTSOURCES} -) - -add_dependencies(paltest_createprocessa_test2 coreclrpal) - -target_link_libraries(paltest_createprocessa_test2 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childprocess.cpp -) - -add_executable(paltest_createprocessa_test2_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_createprocessa_test2_child coreclrpal) - -target_link_libraries(paltest_createprocessa_test2_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.cpp deleted file mode 100644 index f1ac1474ba42..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: createprocessa/test2/childprocess.c -** -** Purpose: This child process reads a string from stdin -** and writes it out to stdout & stderr -** -** Dependencies: memset -** fgets -** gputs -** - -** -**=========================================================*/ - -#include -#include "test2.h" - - - -int __cdecl main( int argc, char **argv ) -{ - int iRetCode = EXIT_OK_CODE; /* preset exit code to OK */ - char szBuf[BUF_LEN]; - - - if(0 != (PAL_Initialize(argc, argv))) - { - return FAIL; - } - - if (argc != 4) - { - return EXIT_ERR_CODE3; - } - - if (strcmp(argv[1], szArg1) != 0 - || strcmp(argv[2], szArg2) != 0 - || strcmp(argv[3], szArg3) != 0) - { - return EXIT_ERR_CODE4; - } - - - memset(szBuf, 0, BUF_LEN); - - /* Read the string that was written by the parent */ - if (fgets(szBuf, BUF_LEN, stdin) == NULL) - { - return EXIT_ERR_CODE1; - } - - /* Write the string out to the stdout & stderr pipes */ - if (fputs(szBuf, stdout) == EOF - || fputs(szBuf, stderr) == EOF) - { - return EXIT_ERR_CODE2; - } - - /* The exit code will indicate success or failure */ - PAL_TerminateEx(iRetCode); - - /* Return special exit code to indicate success or failure */ - return iRetCode; -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.cpp deleted file mode 100644 index 9f80e3412499..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: createprocessa/test2/parentprocess.c -** -** Purpose: Test the following features of CreateProcessA: -** - 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 -** in STARUPINFO flags and bInheritHandles = TRUE -** - Check to see that proper arguments are passed to -** child process -** -** Dependencies: CreatePipe -** strcpy, strlen, strncmp, memset -** WaitForSingleObject -** WriteFile, ReadFile -** GetExitCodeProcess -** - -** -**=========================================================*/ - -#include -#include "test2.h" - - - -int __cdecl main( int argc, char **argv ) -{ - - /******************************************* - * Declarations - *******************************************/ - STARTUPINFO si; - PROCESS_INFORMATION pi; - - HANDLE hTestStdInR = NULL; - HANDLE hTestStdInW = NULL; - HANDLE hTestStdOutR = NULL; - HANDLE hTestStdOutW = NULL; - HANDLE hTestStdErrR = NULL; - HANDLE hTestStdErrW = NULL; - - BOOL bRetVal = FALSE; - DWORD dwBytesWritten = 0; - DWORD dwBytesRead = 0; - DWORD dwExitCode = 0; - - SECURITY_ATTRIBUTES pipeAttributes; - - char szStdOutBuf[BUF_LEN]; - char szStdErrBuf[BUF_LEN]; - char szFullPathNameA[_MAX_PATH]; - - - /******************************************* - * Initialization - *******************************************/ - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - /*Setup SECURITY_ATTRIBUTES structure for CreatePipe*/ - 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 */ - &pipeAttributes, /* security attributes*/ - 1024); /* pipe size*/ - - if (bRetVal == FALSE) - { - Fail("ERROR: %ld :Unable to create stdin pipe\n", GetLastError()); - } - - - /*Create a StdOut pipe for child*/ - bRetVal = CreatePipe(&hTestStdOutR, /* read handle*/ - &hTestStdOutW, /* write handle */ - &pipeAttributes, /* security attributes*/ - 0); /* pipe size*/ - - if (bRetVal == FALSE) - { - Fail("ERROR: %ld :Unable to create stdout pipe\n", GetLastError()); - } - - - /*Create a StdErr pipe for child*/ - bRetVal = CreatePipe(&hTestStdErrR, /* read handle*/ - &hTestStdErrW, /* write handle */ - &pipeAttributes, /* security attributes*/ - 0); /* pipe size*/ - - if (bRetVal == FALSE) - { - Fail("ERROR: %ld :Unable to create stderr pipe\n", GetLastError()); - } - - /* Zero the data structure space */ - ZeroMemory ( &pi, sizeof(pi) ); - ZeroMemory ( &si, sizeof(si) ); - - /* Set the process flags and standard io handles */ - si.cb = sizeof(si); - si.dwFlags = STARTF_USESTDHANDLES; - si.hStdInput = hTestStdInR; - si.hStdOutput = hTestStdOutW; - si.hStdError = hTestStdErrW; - - strcpy(szFullPathNameA, szChildFileA); - strcat(szFullPathNameA, szArgs); - - /******************************************* - * Start Testing - *******************************************/ - - /* Launch the child */ - if ( !CreateProcessA (NULL, szFullPathNameA, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi )) - { - Fail("ERROR: CreateProcess call failed. GetLastError returned %d\n", - GetLastError() ); - } - - /* Check the returned process information for validity */ - if (pi.hProcess == 0 || pi.hThread == 0) - { - Fail("ERROR: CreateProcess Error: Process Handle = %u, Thread Handle = %u\n", - pi.hProcess, pi.hThread); - } - - /* Write the Constructed string to stdin pipe for the child process */ - if (WriteFile(hTestStdInW, szTestString, strlen(szTestString), &dwBytesWritten, NULL) == FALSE - || WriteFile(hTestStdInW, "\n", strlen("\n"), &dwBytesWritten, NULL) == FALSE) - { - 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); - - /* If the child failed then whole thing fails */ - if (dwExitCode != WAIT_OBJECT_0) - { - TerminateProcess(pi.hProcess, 0); - Fail("ERROR: The child failed to run properly.\n"); - } - - /* Check for problems in the child process */ - if (GetExitCodeProcess(pi.hProcess, &dwExitCode) == FALSE) - { - Fail("ERROR: Call to GetExitCodeProcess failed.\n"); - } - else if (dwExitCode == EXIT_ERR_CODE1) - { - Fail("ERROR: The Child process could not reead the string " - "written to the stdin pipe.\n"); - } - else if (dwExitCode == EXIT_ERR_CODE2) - { - Fail("ERROR: The Child process could not write the string " - "the stdout pipe or stderr pipe.\n"); - } - else if (dwExitCode == EXIT_ERR_CODE3) - { - Fail("ERROR: The Child received the wrong number of " - "command line arguments.\n"); - } - else if (dwExitCode == EXIT_ERR_CODE4) - { - Fail("ERROR: The Child received the wrong " - "command line arguments.\n"); - } - else if (dwExitCode != EXIT_OK_CODE) - { - Fail("ERROR: Unexpected exit code returned: %u. Child process " - "did not complete its part of the test.\n", dwExitCode); - } - - - /* The child ran ok, so check to see if we received the proper */ - /* strings through the pipes. */ - - /* clear our buffers */ - memset(szStdOutBuf, 0, BUF_LEN); - memset(szStdErrBuf, 0, BUF_LEN); - - /* Read the data back from the child process stdout */ - bRetVal = ReadFile(hTestStdOutR, /* handle to read pipe*/ - szStdOutBuf, /* buffer to write to*/ - BUF_LEN, /* number of bytes to read*/ - &dwBytesRead, /* number of bytes read*/ - NULL); /* overlapped buffer*/ - - /*Read the data back from the child process stderr */ - bRetVal = ReadFile(hTestStdErrR, /* handle to read pipe*/ - szStdErrBuf, /* buffer to write to*/ - BUF_LEN, /* number of bytes to read*/ - &dwBytesRead, /* number of bytes read*/ - NULL); /* overlapped buffer*/ - - - /* Confirm that we recieved 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) - { - Fail("ERROR: The data read back from child does not match " - "what was written. STDOUT: %s STDERR: %s\n", - szStdOutBuf, szStdErrBuf); - } - - - /******************************************* - * Clean Up - *******************************************/ - - /* Close process and thread handle */ - CloseHandle ( pi.hProcess ); - CloseHandle ( pi.hThread ); - - CloseHandle(hTestStdInR); - CloseHandle(hTestStdInW); - CloseHandle(hTestStdOutR); - CloseHandle(hTestStdOutW); - CloseHandle(hTestStdErrR); - CloseHandle(hTestStdErrW); - - PAL_Terminate(); - return ( PASS ); -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/test2.h b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/test2.h deleted file mode 100644 index 07bd3977fa6a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/test2.h +++ /dev/null @@ -1,71 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: test2.h -** - -** -**===========================================================*/ - - -const char *szChildFileA = "paltest_createprocessa_test2_child"; -const char *szArgs = " A B C"; -const char *szArg1 = "A"; -const char *szArg2 = "B"; -const char *szArg3 = "C"; - -const char *szPathDelimA = "\\"; - -const char *szTestString = "Copyright (c) Microsoft"; - -const DWORD EXIT_OK_CODE = 100; -const DWORD EXIT_ERR_CODE1 = 101; -const DWORD EXIT_ERR_CODE2 = 102; -const DWORD EXIT_ERR_CODE3 = 103; -const DWORD EXIT_ERR_CODE4 = 104; -const DWORD EXIT_ERR_CODE5 = 105; - -#define BUF_LEN 64 - -/* - * Take two wide strings representing file and directory names - * (dirName, fileName), join the strings with the appropriate path - * delimiter and populate a wide character buffer (absPathName) with - * the resulting string. - * - * Returns: The number of wide characters in the resulting string. - * 0 is returned on Error. - */ -int -mkAbsoluteFilenameA ( - LPSTR dirName, - DWORD dwDirLength, - LPCSTR fileName, - DWORD dwFileLength, - LPSTR absPathName ) -{ - extern const char *szPathDelimA; - - DWORD sizeDN; - DWORD sizeFN; - DWORD sizeAPN; - - sizeDN = strlen( dirName ); - sizeFN = strlen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if ( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - strncpy(absPathName, dirName, dwDirLength +1); - strcat(absPathName, szPathDelimA); - strcat(absPathName, fileName); - - return (sizeAPN); - -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/testinfo.dat deleted file mode 100644 index a90eed19c257..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessA/test2/testinfo.dat +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateProcessA -Name = PROCESS_INFORMATION and HANDLE Inheritance -TYPE = DEFAULT -EXE1 = parentprocess -EXE2 = childprocess -Description -= Test the following features of CreateProcessA: -= - 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 -= in STARUPINFO flags and bInheritHandles = TRUE -= - Check to see that proper arguments are passed to -= child process diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/CMakeLists.txt deleted file mode 100644 index 1a84eb2702d7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - parentProcess.cpp -) - -add_executable(paltest_createprocessw_test1 - ${TESTSOURCES} -) - -add_dependencies(paltest_createprocessw_test1 coreclrpal) - -target_link_libraries(paltest_createprocessw_test1 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childProcess.cpp -) - -add_executable(paltest_createprocessw_test1_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_createprocessw_test1_child coreclrpal) - -target_link_libraries(paltest_createprocessw_test1_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.cpp index 73087ab611ec..a10dd0079922 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.cpp @@ -28,50 +28,10 @@ const WCHAR szCommonFileW[] = {'c','h','i','l','d','d','a','t','a','.','t','m','p','\0'}; -const WCHAR szPathDelimW[] = {'\\','\0'}; - -const char *szCommonStringA = "058d2d057111a313aa82401c2e856002\0"; - -/* - * Take two wide strings representing file and directory names - * (dirName, fileName), join the strings with the appropriate path - * delimiter and populate a wide character buffer (absPathName) with - * the resulting string. - * - * Returns: The number of wide characters in the resulting string. - * 0 is returned on Error. - */ -int -mkAbsoluteFilenameW ( - LPWSTR dirName, - DWORD dwDirLength, - LPCWSTR fileName, - DWORD dwFileLength, - LPWSTR absPathName ) -{ - extern const WCHAR szPathDelimW[]; - - DWORD sizeDN, sizeFN, sizeAPN; - - sizeDN = wcslen( dirName ); - sizeFN = wcslen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if ( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - wcsncpy(absPathName, dirName, dwDirLength +1); - wcsncpy(absPathName, szPathDelimW, 2); - wcsncpy(absPathName, fileName, dwFileLength +1); - - return (sizeAPN); -} +#define szCommonStringA "058d2d057111a313aa82401c2e856002\0" -int __cdecl main( int argc, char **argv ) +PALTEST(threading_CreateProcessW_test1_paltest_createprocessw_test1_child, "threading/CreateProcessW/test1/paltest_createprocessw_test1_child") { static FILE * fp; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.cpp index d417f40ec234..88482f394491 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.cpp @@ -30,52 +30,11 @@ const WCHAR szCommonFileW[] = {'c','h','i','l','d','d','a','t','a','.','t','m','p','\0'}; -const WCHAR szChildFileW[] = u"paltest_createprocessw_test1_child"; - -const WCHAR szPathDelimW[] = {'\\','\0'}; - -const char *szCommonStringA = "058d2d057111a313aa82401c2e856002\0"; - -/* - * Take two wide strings representing file and directory names - * (dirName, fileName), join the strings with the appropriate path - * delimiter and populate a wide character buffer (absPathName) with - * the resulting string. - * - * Returns: The number of wide characters in the resulting string. - * 0 is returned on Error. - */ -int -mkAbsoluteFilenameW ( - LPWSTR dirName, - DWORD dwDirLength, - LPCWSTR fileName, - DWORD dwFileLength, - LPWSTR absPathName ) -{ - extern const WCHAR szPathDelimW[]; +const WCHAR szChildFileW[] = u"threading/CreateProcessW/test1/paltest_createprocessw_test1_child"; - DWORD sizeDN, sizeFN, sizeAPN; - - sizeDN = wcslen( dirName ); - sizeFN = wcslen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if ( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - wcsncpy(absPathName, dirName, dwDirLength +1); - wcsncpy(absPathName, szPathDelimW, 2); - wcsncpy(absPathName, fileName, dwFileLength +1); - - return (sizeAPN); - -} +#define szCommonStringA "058d2d057111a313aa82401c2e856002\0" -int __cdecl main( int argc, char **argv ) +PALTEST(threading_CreateProcessW_test1_paltest_createprocessw_test1, "threading/CreateProcessW/test1/paltest_createprocessw_test1") { @@ -108,7 +67,6 @@ int __cdecl main( int argc, char **argv ) ZeroMemory ( &pi, sizeof(pi) ); szAbsPathNameW=&absPathBuf[0]; - dwFileLength = wcslen( szChildFileW ); dwDirLength = GetCurrentDirectory(_MAX_PATH, szDirNameW); @@ -118,14 +76,15 @@ int __cdecl main( int argc, char **argv ) "current working directory\n. Exiting.\n"); } - dwSize = mkAbsoluteFilenameW( szDirNameW, dwDirLength, szChildFileW, - dwFileLength, szAbsPathNameW ); + int mbwcResult = MultiByteToWideChar(CP_ACP, 0, argv[0], -1, szAbsPathNameW, sizeof(absPathBuf)); - if (0 == dwSize) + if (0 == mbwcResult) { - Fail ("Palsuite Code: mkAbsoluteFilename() call failed. Could " - "not build absolute path name to file\n. Exiting.\n"); + Fail ("Palsuite Code: MultiByteToWideChar() call failed. Exiting.\n"); } + + wcscat(szAbsPathNameW, u" "); + wcscat(szAbsPathNameW, szChildFileW); if ( !CreateProcessW ( NULL, szAbsPathNameW, diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/testinfo.dat deleted file mode 100644 index 03cd757c1546..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateProcessW -Name = Positive Test for CreateProcessW -TYPE = DEFAULT -EXE1 = parentprocess -EXE2 = childprocess -Description -= Test the CreateProcessW function. The test executes the childprocess -= program. The childprocess program launches and writes a const char string -= to a file childdata. The parent waits for the completion of childprocess -= and then reads the string from the childdata file. If the string in the -= file matches it's copy of the const char string, then the test succeeds. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/CMakeLists.txt deleted file mode 100644 index 643d5eb4aa31..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - parentprocess.cpp -) - -add_executable(paltest_createprocessw_test2 - ${TESTSOURCES} -) - -add_dependencies(paltest_createprocessw_test2 coreclrpal) - -target_link_libraries(paltest_createprocessw_test2 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childprocess.cpp -) - -add_executable(paltest_createprocessw_test2_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_createprocessw_test2_child coreclrpal) - -target_link_libraries(paltest_createprocessw_test2_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.cpp index f38f2dad23e6..72ce2a4e67e1 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.cpp @@ -21,7 +21,7 @@ #include "test2.h" -int __cdecl main( int argc, char **argv ) +PALTEST(threading_CreateProcessW_test2_paltest_createprocessw_test2_child, "threading/CreateProcessW/test2/paltest_createprocessw_test2_child") { int iRetCode = EXIT_OK_CODE; /* preset exit code to OK */ char szBuf[BUF_LEN]; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp index 59a8274fe0ab..5d69ee224d51 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp @@ -30,7 +30,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_CreateProcessW_test2_paltest_createprocessw_test2, "threading/CreateProcessW/test2/paltest_createprocessw_test2") { /******************************************* @@ -119,7 +119,16 @@ int __cdecl main( int argc, char **argv ) si.hStdOutput = hTestStdOutW; si.hStdError = hTestStdErrW; - wcscpy(szFullPathNameW, szChildFileW); + int mbwcResult = MultiByteToWideChar(CP_ACP, 0, argv[0], -1, szFullPathNameW, sizeof(szFullPathNameW)); + + if (0 == mbwcResult) + { + Fail ("Palsuite Code: MultiByteToWideChar() call failed. Exiting.\n"); + } + + wcscat(szFullPathNameW, u" "); + wcscat(szFullPathNameW, szChildFileW); + wcscat(szFullPathNameW, szArgs); /******************************************* diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/test2.h b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/test2.h index 100320dac685..3036e7dae941 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/test2.h +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/test2.h @@ -11,13 +11,13 @@ **=========================================================*/ -const WCHAR szChildFileW[] = u"paltest_createprocessw_test2_child"; +const WCHAR szChildFileW[] = u"threading/CreateProcessW/test2/paltest_createprocessw_test2_child"; const WCHAR szArgs[] = {' ',0x41,' ','B',' ','C','\0'}; const WCHAR szArg1[] = {0x41,'\0'}; const WCHAR szArg2[] = {'B','\0'}; const WCHAR szArg3[] = {'C','\0'}; -const char *szTestString = "An uninteresting test string (it works though)"; +#define szTestString "An uninteresting test string (it works though)" const DWORD EXIT_OK_CODE = 100; const DWORD EXIT_ERR_CODE1 = 101; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/testinfo.dat deleted file mode 100644 index b256fd67f72b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateProcessW/test2/testinfo.dat +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateProcessW -Name = PROCESS_INFORMATION and HANDLE Inheritance -TYPE = DEFAULT -EXE1 = parentprocess -EXE2 = childprocess -Description -= Test the following features of CreateProcessW: -= - 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 -= in STARUPINFO flags and bInheritHandles = TRUE -= - Check to see that proper arguments are passed to -= child process diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CMakeLists.txt deleted file mode 100644 index 5585da8389ac..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateSemaphore.cpp -) - -add_executable(paltest_createsemaphorea_releasesemaphore_test1 - ${SOURCES} -) - -add_dependencies(paltest_createsemaphorea_releasesemaphore_test1 coreclrpal) - -target_link_libraries(paltest_createsemaphorea_releasesemaphore_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.cpp deleted file mode 100644 index ecc897c8612e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.cpp +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: createsemaphorea_releasesemaphore/test1/createsemaphore.c -** -** Purpose: Test Semaphore operation using classic IPC problem: -** "Producer-Consumer Problem". -** -** Dependencies: CreateThread -** ReleaseSemaphore -** WaitForSingleObject -** Sleep -** fflush -** - -** -**=========================================================*/ - -#include - -#define PRODUCTION_TOTAL 26 - -#define _BUF_SIZE 10 - -DWORD dwThreadId; /* consumer thread identifier */ - -HANDLE hThread; /* handle to consumer thread */ - -HANDLE hSemaphoreM; /* handle to mutual exclusion semaphore */ - -HANDLE hSemaphoreE; /* handle to semaphore that counts empty buffer slots */ - -HANDLE hSemaphoreF; /* handle to semaphore that counts full buffer slots */ - -typedef struct Buffer -{ - short readIndex; - short writeIndex; - CHAR message[_BUF_SIZE]; - -} BufferStructure; - -CHAR producerItems[PRODUCTION_TOTAL + 1]; - -CHAR consumerItems[PRODUCTION_TOTAL + 1]; - -/* - * Read next message from the Buffer into provided pointer. - * Returns: 0 on failure, 1 on success. - */ -int -readBuf(BufferStructure *Buffer, char *c) -{ - if( Buffer -> writeIndex == Buffer -> readIndex ) - { - return 0; - } - *c = Buffer -> message[Buffer -> readIndex++]; - Buffer -> readIndex %= _BUF_SIZE; - return 1; -} - -/* - * Write message generated by the producer to Buffer. - * Returns: 0 on failure, 1 on success. - */ -int -writeBuf(BufferStructure *Buffer, CHAR c) -{ - if( ( ((Buffer -> writeIndex) + 1) % _BUF_SIZE) == - (Buffer -> readIndex) ) - { - return 0; - } - Buffer -> message[Buffer -> writeIndex++] = c; - Buffer -> writeIndex %= _BUF_SIZE; - return 1; -} - -/* - * Atomic decrement of semaphore value. - */ -VOID -down(HANDLE hSemaphore) -{ - switch ( (WaitForSingleObject ( - hSemaphore, - 10000))) /* Wait 10 seconds */ - { - case WAIT_OBJECT_0: /* - * Semaphore was signaled. OK to access - * semaphore. - */ - break; - case WAIT_ABANDONED: /* - * Object was mutex object whose owning - * thread has terminated. Shouldn't occur. - */ - Fail("WaitForSingleObject call returned 'WAIT_ABANDONED'.\n" - "Failing Test.\n"); - break; - case WAIT_FAILED: /* WaitForSingleObject function failed */ - Fail("WaitForSingleObject call returned 'WAIT_FAILED'.\n" - "GetLastError returned %d\nFailing Test.\n",GetLastError()); - break; - default: - Fail("WaitForSingleObject call returned an unexpected value.\n" - "Failing Test.\n"); - break; - } - -} - -/* - * Atomic increment of semaphore value. - */ -VOID -up(HANDLE hSemaphore) -{ - if (!ReleaseSemaphore ( - hSemaphore, - 1, - NULL) - ) - { - Fail("ReleaseSemaphore call failed. GetLastError returned %d\n", - GetLastError()); - } -} - -/* - * Sleep 500 milleseconds. - */ -VOID -consumerSleep(VOID) -{ - Sleep(500); -} - -/* - * Sleep between 10 milleseconds. - */ -VOID -producerSleep(VOID) -{ - Sleep(10); -} - -/* - * Produce a message and write the message to Buffer. - */ -VOID -producer(BufferStructure *Buffer) -{ - - int n = 0; - char c; - - while (n < PRODUCTION_TOTAL) - { - c = 'A' + n ; /* Produce Item */ - - down(hSemaphoreE); - down(hSemaphoreM); - - if (writeBuf(Buffer, c)) - { - Trace("Producer produces %c.\n", c); - fflush(stdout); - producerItems[n++] = c; - } - - up(hSemaphoreM); - up(hSemaphoreF); - - producerSleep(); - } - - return; -} - -/* - * Read and "Consume" the messages in Buffer. - */ -DWORD -PALAPI -consumer( LPVOID lpParam ) -{ - int n = 0; - char c; - - consumerSleep(); - - while (n < PRODUCTION_TOTAL) - { - - down(hSemaphoreF); - down(hSemaphoreM); - - if (readBuf((BufferStructure*)lpParam, &c)) - { - Trace("\tConsumer consumes %c.\n", c); - fflush(stdout); - consumerItems[n++] = c; - } - - up(hSemaphoreM); - up(hSemaphoreE); - - consumerSleep(); - } - - return 0; -} - -int __cdecl main (int argc, char **argv) -{ - - BufferStructure Buffer, *pBuffer; - - pBuffer = &Buffer; - - if(0 != (PAL_Initialize(argc, argv))) - { - return ( FAIL ); - } - - /* - * Create Semaphores - */ - hSemaphoreM = CreateSemaphoreA ( - NULL, - 1, - 1, - NULL); - - if ( NULL == hSemaphoreM ) - { - Fail ( "hSemaphoreM = CreateSemaphoreA () - returned NULL\n" - "Failing Test.\nGetLastError returned %d\n", GetLastError()); - } - - - hSemaphoreE = CreateSemaphoreA ( - NULL, - _BUF_SIZE , - _BUF_SIZE , - NULL); - - if ( NULL == hSemaphoreE ) - { - Fail ( "hSemaphoreE = CreateSemaphoreA () - returned NULL\n" - "Failing Test.\nGetLastError returned %d\n", GetLastError()); - } - - hSemaphoreF = CreateSemaphoreA ( - NULL, - 0, - _BUF_SIZE , - NULL); - - if ( NULL == hSemaphoreF ) - { - Fail ( "hSemaphoreF = CreateSemaphoreA () - returned NULL\n" - "Failing Test.\nGetLastError returned %d\n", GetLastError()); - } - - - /* - * Initialize Buffer - */ - pBuffer->writeIndex = pBuffer->readIndex = 0; - - /* - * Create Consumer - */ - hThread = CreateThread( - NULL, - 0, - consumer, - &Buffer, - 0, - &dwThreadId); - - if ( NULL == hThread ) - { - Fail ( "CreateThread() returned NULL. Failing test.\n" - "GetLastError returned %d\n", GetLastError()); - } - - /* - * Start producing - */ - producer(pBuffer); - - /* - * Wait for consumer to complete - */ - WaitForSingleObject (hThread, INFINITE); - - /* - * Compare items produced vs. items consumed - */ - if ( 0 != strncmp (producerItems, consumerItems, PRODUCTION_TOTAL) ) - { - Fail("The producerItems string %s\n and the consumerItems string " - "%s\ndo not match. This could be a problem with the strncmp()" - " function\n FailingTest\nGetLastError() returned %d\n", - producerItems, consumerItems, GetLastError()); - } - - Trace ("producerItems and consumerItems arrays match. All %d\nitems " - "were produced and consumed in order.\nTest passed.\n", - PRODUCTION_TOTAL); - - PAL_Terminate(); - return ( PASS ); - -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/testinfo.dat deleted file mode 100644 index 87f87915c1fe..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = threading -Function = CreateSemaphoreA / ReleaseSemaphore -Name = Positive Test for CreateSemaphoreA and ReleaseSemaphore -TYPE = DEFAULT -EXE1 = createsemaphore -Description -= Implementation of Producer / Consumer IPC problem using CreateSemaphoreA -= and ReleaseSemaphore functions. This test case exercises CreateSemaphoreA -= , ReleaseSemaphore, CreateThread and WaitForSingleObject functions. -= Since there is no way to currently create "pseudo" random events in the -= pal, this example does not behave as classic bounded buffers would. This -= test case is designed to starve the consumer and have the producer fill -= the buffer. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CMakeLists.txt deleted file mode 100644 index 55ead1e49328..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateSemaphore.cpp -) - -add_executable(paltest_createsemaphorea_releasesemaphore_test2 - ${SOURCES} -) - -add_dependencies(paltest_createsemaphorea_releasesemaphore_test2 coreclrpal) - -target_link_libraries(paltest_createsemaphorea_releasesemaphore_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.cpp deleted file mode 100644 index 62b42e221ba9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.cpp +++ /dev/null @@ -1,312 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================ -** -** Source: CreateSemaphoreA_ReleaseSemaphore/test2/createsemaphore.c -** -** Purpose: Test Semaphore operation using classic IPC problem: -** "Producer-Consumer Problem". -** -** Dependencies: CreateThread -** ReleaseSemaphore -** WaitForSingleObject -** Sleep -** fflush -** - -** -**=========================================================*/ - -#include - -#define PRODUCTION_TOTAL 26 - -#define _BUF_SIZE 10 - -DWORD dwThreadId; /* consumer thread identifier */ - -HANDLE hThread; /* handle to consumer thread */ - -HANDLE hSemaphoreM; /* handle to mutual exclusion semaphore */ - -HANDLE hSemaphoreE; /* handle to semaphore that counts empty buffer slots */ - -HANDLE hSemaphoreF; /* handle to semaphore that counts full buffer slots */ - -typedef struct Buffer -{ - short readIndex; - short writeIndex; - CHAR message[_BUF_SIZE]; - -} BufferStructure; - -CHAR producerItems[PRODUCTION_TOTAL + 1]; - -CHAR consumerItems[PRODUCTION_TOTAL + 1]; - -/* - * Read next message from the Buffer into provided pointer. - * Returns: 0 on failure, 1 on success. - */ -int -readBuf(BufferStructure *Buffer, char *c) -{ - if( Buffer -> writeIndex == Buffer -> readIndex ) - { - return 0; - } - *c = Buffer -> message[Buffer -> readIndex++]; - Buffer -> readIndex %= _BUF_SIZE; - return 1; -} - -/* - * Write message generated by the producer to Buffer. - * Returns: 0 on failure, 1 on success. - */ -int -writeBuf(BufferStructure *Buffer, CHAR c) -{ - if( ( ((Buffer -> writeIndex) + 1) % _BUF_SIZE) == - (Buffer -> readIndex) ) - { - return 0; - } - Buffer -> message[Buffer -> writeIndex++] = c; - Buffer -> writeIndex %= _BUF_SIZE; - return 1; -} - -/* - * Atomic decrement of semaphore value. - */ -VOID -down(HANDLE hSemaphore) -{ - switch ( (WaitForSingleObject ( - hSemaphore, - 10000))) - { - case WAIT_OBJECT_0: /* - * Semaphore was signaled. OK to access semaphore. - */ - break; - case WAIT_ABANDONED: /* - * Object was mutex object whose owning - * thread has terminated. Shouldn't occur. - */ - Fail("WaitForSingleObject call returned 'WAIT_ABANDONED'.\n" - "Failing Test.\n"); - break; - case WAIT_FAILED: /* WaitForSingleObject function failed */ - Fail("WaitForSingleObject call returned 'WAIT_FAILED'.\n" - "GetLastError returned %d\nFailing Test.\n",GetLastError()); - break; - default: - Fail("WaitForSingleObject call returned an unexpected value.\n" - "Failing Test.\n"); - break; - } - -} - -/* - * Atomic increment of semaphore value. - */ -VOID -up(HANDLE hSemaphore) -{ - if (!ReleaseSemaphore ( - hSemaphore, - 1, - NULL) - ) - { - Fail("ReleaseSemaphore call failed. GetLastError returned %d\n", - GetLastError()); - } -} - -/* - * Sleep 10 milleseconds. - */ -VOID -consumerSleep(VOID) -{ - Sleep(10); -} - -/* - * Sleep 500 milleseconds. - */ -VOID -producerSleep(VOID) -{ - Sleep(500); -} - -/* - * Produce a message and write the message to Buffer. - */ -VOID -producer(BufferStructure *Buffer) -{ - - int n = 0; - char c; - - while (n < PRODUCTION_TOTAL) - { - c = 'A' + n ; /* Produce Item */ - - down(hSemaphoreE); - down(hSemaphoreM); - - if (writeBuf(Buffer, c)) - { - Trace("Producer produces %c.\n", c); - fflush(stdout); - producerItems[n++] = c; - } - - up(hSemaphoreM); - up(hSemaphoreF); - - producerSleep(); - } - return; -} - -/* - * Read and "Consume" the messages in Buffer. - */ -DWORD -PALAPI -consumer( LPVOID lpParam ) -{ - int n = 0; - char c; - - consumerSleep(); - - while (n < PRODUCTION_TOTAL) - { - - down(hSemaphoreF); - down(hSemaphoreM); - - if (readBuf((BufferStructure*)lpParam, &c)) - { - Trace("\tConsumer consumes %c.\n", c); - fflush(stdout); - consumerItems[n++] = c; - } - - up(hSemaphoreM); - up(hSemaphoreE); - - consumerSleep(); - } - return 0; -} - -int __cdecl main (int argc, char **argv) -{ - - BufferStructure Buffer, *pBuffer; - - pBuffer = &Buffer; - - if(0 != (PAL_Initialize(argc, argv))) - { - return (FAIL); - } - - /* - * Create Semaphores - */ - hSemaphoreM = CreateSemaphoreA ( - NULL, - 1, - 1, - NULL); - - if ( NULL == hSemaphoreM ) - { - Fail ( "hSemaphoreM = CreateSemaphoreA () - returned NULL\n" - "Failing Test.\n"); - } - - hSemaphoreE = CreateSemaphoreA ( - NULL, - _BUF_SIZE , - _BUF_SIZE , - NULL); - - if ( NULL == hSemaphoreE ) - { - Fail ( "hSemaphoreE = CreateSemaphoreA () - returned NULL\n" - "Failing Test.\n"); - } - - hSemaphoreF = CreateSemaphoreA ( - NULL, - 0, - _BUF_SIZE , - NULL); - - if ( NULL == hSemaphoreF ) - { - Fail ( "hSemaphoreF = CreateSemaphoreA () - returned NULL\n" - "Failing Test.\n"); - } - - /* - * Initialize Buffer - */ - pBuffer->writeIndex = pBuffer->readIndex = 0; - - /* - * Create Consumer - */ - hThread = CreateThread( - NULL, - 0, - consumer, - &Buffer, - 0, - &dwThreadId); - - if ( NULL == hThread ) - { - Fail ( "CreateThread() returned NULL. Failing test.\n"); - } - - /* - * Start producing - */ - producer(pBuffer); - - /* - * Wait for consumer to complete - */ - WaitForSingleObject (hThread, INFINITE); - - if ( 0 != strncmp (producerItems, consumerItems, PRODUCTION_TOTAL) ) - { - Fail("The producerItems string %s\n and the consumerItems string " - "%s\ndo not match. This could be a problem with the strncmp()" - " function\n FailingTest\nGetLastError() returned %d\n", - producerItems, consumerItems, GetLastError()); - } - - Trace ("producerItems and consumerItems arrays match. All %d\nitems " - "were produced and consumed in order.\nTest passed.\n", - PRODUCTION_TOTAL); - - PAL_Terminate(); - return ( PASS ); - -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/testinfo.dat deleted file mode 100644 index 32645dcffbb4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/testinfo.dat +++ /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. - -Version = 1.0 -Section = threading -Function = CreateSemaphoreA / ReleaseSemaphore -Name = Positive Test for CreateSemaphoreA and ReleaseSemaphore -TYPE = DEFAULT -EXE1 = createsemaphore -Description -= Implementation of Producer / Consumer IPC problem using CreateSemaphoreA -= and ReleaseSemaphore functions. This test case exercises CreateSemaphoreA -= , ReleaseSemaphore, CreateThread and WaitForSingleObject functions. -= Since there is no way to currently create "pseudo" random events in the -= pal, this example does not behave as classic bounded buffers would. This -= test case is designed to starve the producer and have the consumer fill -= the buffer. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/CMakeLists.txt deleted file mode 100644 index a1938dfeb98e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createsemaphore.cpp -) - -add_executable(paltest_createsemaphorea_releasesemaphore_test3 - ${SOURCES} -) - -add_dependencies(paltest_createsemaphorea_releasesemaphore_test3 coreclrpal) - -target_link_libraries(paltest_createsemaphorea_releasesemaphore_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.cpp deleted file mode 100644 index 3d2feacb569d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.cpp +++ /dev/null @@ -1,199 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================ -** -** Source: createsemaphorea_releasesemaphore/test3/createsemaphore.c -** -** Purpose: Test attributes of CreateSemaphoreA and ReleaseSemaphore. -** Insure for CreateSemaphore that lInitialCount and lMaximumCount -** constraints are respected. Validate that CreateSemaphore rejects -** conditions where initial count and / or maximum count are negative -** and conditions where the initial count is greater than the maximum -** count. For ReleaseSemaphore validate that lpPreviousCount gets set -** to the previous semaphore count and lpPreviousCount can be NULL. -** Also establish ReleaseSemaphore fails when called in a semaphore -** with count equal to lMaximumCount. -** -** -**==========================================================================*/ - -#include - -struct testcase -{ - LPSECURITY_ATTRIBUTES lpSemaphoreAttributes; - LONG lInitialCount; - LONG lMaximumCount; - LPCTSTR lpName; - BOOL bNegativeTest; -}; - -struct testcase testCases[] = -{ - {NULL, -1, 1, NULL, TRUE}, - {NULL, 1, -1, NULL, TRUE}, - {NULL, -1, -1, NULL, TRUE}, - {NULL, 2, 1, NULL, TRUE}, - {NULL, 1, 2, NULL, FALSE}, - {NULL, 0, 10, NULL, FALSE}, - {NULL, INT_MAX - 1, INT_MAX, NULL, FALSE}, - {NULL, INT_MAX, INT_MAX, NULL, FALSE} -}; - -HANDLE hSemaphore[sizeof(testCases)/sizeof(struct testcase)]; - -BOOL cleanup(int index) -{ - int i; - BOOL bRet = TRUE; - for (i = 0; i < index; i++) - { - if (!CloseHandle(hSemaphore[i])) - { - bRet = FALSE; - Trace("PALSUITE ERROR: CloseHandle(%p) call failed for index %d\n", - hSemaphore[i], i); - } - } - return(bRet); -} - -int __cdecl main (int argc, char **argv) -{ - int i; - int j; - - if(0 != (PAL_Initialize(argc, argv))) - { - return (FAIL); - } - /* create semaphores */ - for (i = 0; i < sizeof(testCases)/sizeof(struct testcase); i++) - { - hSemaphore[i] = CreateSemaphoreA (testCases[i].lpSemaphoreAttributes, - testCases[i].lInitialCount, - testCases[i].lMaximumCount, - testCases[i].lpName); - - if (NULL == hSemaphore[i]) - { - if (!testCases[i].bNegativeTest) - { - Trace("PALSUITE ERROR: CreateSemaphoreA('%p' '%ld' '%ld' " - "'%p') returned NULL at index %d.\nGetLastError " - "returned %d.\n", testCases[i].lpSemaphoreAttributes, - testCases[i].lInitialCount, testCases[i].lMaximumCount, - testCases[i].lpName, i, GetLastError()); - if (i > 0) - { - cleanup(i - 1); - } - Fail(""); - } - else - { - continue; - } - } - - /* increment semaphore count to lMaximumCount */ - for (j = testCases[i].lInitialCount; (ULONG)j <= (ULONG)testCases[i].lMaximumCount; - j++) - { - if (testCases[i].lMaximumCount == j) - { - /* Call ReleaseSemaphore once more to ensure ReleaseSemaphore - fails */ - if(ReleaseSemaphore(hSemaphore[i], 1, NULL)) - { - Trace("PALSUITE ERROR: ReleaseSemaphore('%p' '%ld' '%p') " - "call returned %d\nwhen it should have returned " - "%d.\nThe semaphore's count was %d.\nGetLastError " - "returned %d.\n", hSemaphore[i], 1, NULL, TRUE, - FALSE, j, GetLastError()); - cleanup(i); - Fail(""); - } - } - else - { - int previous; - BOOL bRet = ReleaseSemaphore(hSemaphore[i], 1, &previous); - DWORD dwError = GetLastError(); - - if(!bRet) - { - Trace("PALSUITE ERROR: ReleaseSemaphore('%p' '%ld' '%p') " - "call returned %d\nwhen it should have returned " - "%d.\nThe semaphore count was %d and it's " - "lMaxCount was %d.\nGetLastError returned %d.\n", - hSemaphore[i], 1, &previous, bRet, TRUE, j, - testCases[i].lMaximumCount, dwError); - cleanup(i); - Fail(""); - } - if (previous != j) - { - Trace("PALSUITE ERROR: ReleaseSemaphore('%p' '%ld' '%p') " - "call set %p to %d instead of %d.\n The semaphore " - "count was %d and GetLastError returned %d.\n", - hSemaphore[i], 1, &previous, &previous, previous, - j, j, dwError); - cleanup(i); - Fail(""); - } - } - } - - // Skip exhaustive decrement tests for too large an initial count - if(testCases[i].lInitialCount >= INT_MAX - 1) - { - continue; - } - - /* decrement semaphore count to 0 */ - for (j = testCases[i].lMaximumCount; j >= 0; j--) - { - DWORD dwRet = WaitForSingleObject(hSemaphore[i], 0); - DWORD dwError = GetLastError(); - - if (0 == j) - { - /* WaitForSingleObject should report that the - semaphore is nonsignaled */ - if (WAIT_TIMEOUT != dwRet) - { - Trace("PALSUITE ERROR: WaitForSingleObject('%p' '%u') " - "call returned %d\nwhen it should have returned " - "%d.\nThe semaphore's count was %d.\nGetLastError " - "returned %d.\n", hSemaphore[i], 0, dwRet, - WAIT_TIMEOUT, j, dwError); - cleanup(i); - Fail(""); - } - } - else - { - /* WaitForSingleObject should report that the - semaphore is signaled */ - if (WAIT_OBJECT_0 != dwRet) - { - Trace("PALSUITE ERROR: WaitForSingleObject('%p' '%u') " - "call returned %d\nwhen it should have returned " - "%d.\nThe semaphore's count was %d.\nGetLastError " - "returned %d.\n", hSemaphore[i], 0, dwRet, - WAIT_OBJECT_0, j, dwError); - cleanup(i); - Fail(""); - } - } - } - } - PAL_Terminate(); - return (PASS); -} - - - - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/testinfo.dat deleted file mode 100644 index ee4384e72430..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/testinfo.dat +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateSemaphoreA / ReleaseSemaphore -Name = Positive Test for CreateSemaphoreA and ReleaseSemaphore -TYPE = DEFAULT -EXE1 = createsemaphore -Description -= Test attributes of CreateSemaphoreA and ReleaseSemaphore. -= Insure for CreateSemaphore that lInitialCount and lMaximumCount -= constraints are respected. Validate that CreateSemaphore rejects -= conditions where, initial count and / or maximum count are negative -= and conditions where the initial count is greater than the maximum -= count. For ReleaseSemaphore validate that lpPreviousCount gets set -= to the previous semaphore count and lpPreviousCount can be NULL. -= Also establish ReleaseSemaphore fails when called in a semaphore -= with count equal to lMaximumCount. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CMakeLists.txt deleted file mode 100644 index dbbf165e55a2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateSemaphore.cpp -) - -add_executable(paltest_createsemaphorew_releasesemaphore_test1 - ${SOURCES} -) - -add_dependencies(paltest_createsemaphorew_releasesemaphore_test1 coreclrpal) - -target_link_libraries(paltest_createsemaphorew_releasesemaphore_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.cpp index 598b351b4bf0..8650b2140a2a 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.cpp @@ -11,9 +11,9 @@ ** Dependencies: CreateThread ** ReleaseSemaphore ** WaitForSingleObject -** Sleep +** Sleep ** fflush -** +** ** **=========================================================*/ @@ -47,9 +47,9 @@ CHAR producerItems[PRODUCTION_TOTAL + 1]; CHAR consumerItems[PRODUCTION_TOTAL + 1]; -/* +/* * Read next message from the Buffer into provided pointer. - * Returns: 0 on failure, 1 on success. + * Returns: 0 on failure, 1 on success. */ int readBuf(BufferStructure *Buffer, char *c) @@ -63,11 +63,11 @@ readBuf(BufferStructure *Buffer, char *c) return 1; } -/* - * Write message generated by the producer to Buffer. +/* + * Write message generated by the producer to Buffer. * Returns: 0 on failure, 1 on success. */ -int +int writeBuf(BufferStructure *Buffer, CHAR c) { if( ( ((Buffer -> writeIndex) + 1) % _BUF_SIZE) == @@ -87,12 +87,12 @@ VOID down(HANDLE hSemaphore) { switch ( (WaitForSingleObject ( - hSemaphore, + hSemaphore, 10000))) /* Wait 10 seconds */ { - case WAIT_OBJECT_0: /* + case WAIT_OBJECT_0: /* * Semaphore was signaled. OK to access - * semaphore. + * semaphore. */ break; case WAIT_ABANDONED: /* @@ -114,16 +114,16 @@ down(HANDLE hSemaphore) } -/* +/* * Atomic increment of semaphore value. */ VOID -up(HANDLE hSemaphore) +up(HANDLE hSemaphore) { if (!ReleaseSemaphore ( - hSemaphore, - 1, - NULL) + hSemaphore, + 1, + NULL) ) { Fail("ReleaseSemaphore call failed. GetLastError returned %d\n", @@ -131,25 +131,25 @@ up(HANDLE hSemaphore) } } -/* +/* * Sleep 500 milleseconds. */ -VOID +VOID consumerSleep(VOID) { Sleep(500); } -/* +/* * Sleep between 10 milleseconds. */ -VOID +VOID producerSleep(VOID) { Sleep(10); } -/* +/* * Produce a message and write the message to Buffer. */ VOID @@ -158,71 +158,70 @@ producer(BufferStructure *Buffer) int n = 0; char c; - - while (n < PRODUCTION_TOTAL) + + while (n < PRODUCTION_TOTAL) { - c = 'A' + n ; /* Produce Item */ - + c = 'A' + n ; /* Produce Item */ + down(hSemaphoreE); down(hSemaphoreM); - - if (writeBuf(Buffer, c)) + + if (writeBuf(Buffer, c)) { Trace("Producer produces %c.\n", c); fflush(stdout); producerItems[n++] = c; } - + up(hSemaphoreM); up(hSemaphoreF); - + producerSleep(); } return; } -/* - * Read and "Consume" the messages in Buffer. +/* + * Read and "Consume" the messages in Buffer. */ DWORD -PALAPI +PALAPI consumer( LPVOID lpParam ) { int n = 0; - char c; + char c; consumerSleep(); - while (n < PRODUCTION_TOTAL) + while (n < PRODUCTION_TOTAL) { - + down(hSemaphoreF); down(hSemaphoreM); - if (readBuf((BufferStructure*)lpParam, &c)) + if (readBuf((BufferStructure*)lpParam, &c)) { Trace("\tConsumer consumes %c.\n", c); fflush(stdout); consumerItems[n++] = c; } - + up(hSemaphoreM); up(hSemaphoreE); consumerSleep(); } - + return 0; } -int __cdecl main (int argc, char **argv) +PALTEST(threading_CreateSemaphoreW_ReleaseSemaphore_test1_paltest_createsemaphorew_releasesemaphore_test1, "threading/CreateSemaphoreW_ReleaseSemaphore/test1/paltest_createsemaphorew_releasesemaphore_test1") { - BufferStructure Buffer, *pBuffer; pBuffer = &Buffer; - + if(0 != (PAL_Initialize(argc, argv))) { return ( FAIL ); @@ -231,84 +230,90 @@ int __cdecl main (int argc, char **argv) /* * Create Semaphores */ - hSemaphoreM = CreateSemaphoreW ( - NULL, - 1, - 1, - NULL); - - if ( NULL == hSemaphoreM ) + hSemaphoreM = CreateSemaphoreExW ( + NULL, + 1, + 1, + NULL, + 0, + 0); + + if ( NULL == hSemaphoreM ) { - Fail ( "hSemaphoreM = CreateSemaphoreW () - returned NULL\n" + Fail ( "hSemaphoreM = CreateSemaphoreExW () - returned NULL\n" "Failing Test.\nGetLastError returned %d\n", GetLastError()); } - hSemaphoreE = CreateSemaphoreW ( - NULL, - _BUF_SIZE , - _BUF_SIZE , - NULL); + hSemaphoreE = CreateSemaphoreExW ( + NULL, + _BUF_SIZE , + _BUF_SIZE , + NULL, + 0, + 0); - if ( NULL == hSemaphoreE ) + if ( NULL == hSemaphoreE ) { - Fail ( "hSemaphoreE = CreateSemaphoreW () - returned NULL\n" + Fail ( "hSemaphoreE = CreateSemaphoreExW () - returned NULL\n" "Failing Test.\nGetLastError returned %d\n", GetLastError()); } - - hSemaphoreF = CreateSemaphoreW ( - NULL, - 0, - _BUF_SIZE , - NULL); - - if ( NULL == hSemaphoreF ) + + hSemaphoreF = CreateSemaphoreExW ( + NULL, + 0, + _BUF_SIZE , + NULL, + 0, + 0); + + if ( NULL == hSemaphoreF ) { - Fail ( "hSemaphoreF = CreateSemaphoreW () - returned NULL\n" + Fail ( "hSemaphoreF = CreateSemaphoreExW () - returned NULL\n" "Failing Test.\nGetLastError returned %d\n", GetLastError()); } - /* + /* * Initialize Buffer */ pBuffer->writeIndex = pBuffer->readIndex = 0; - /* + /* * Create Consumer */ hThread = CreateThread( - NULL, - 0, - consumer, - &Buffer, - 0, - &dwThreadId); - - if ( NULL == hThread ) + NULL, + 0, + consumer, + &Buffer, + 0, + &dwThreadId); + + if ( NULL == hThread ) { Fail ( "CreateThread() returned NULL. Failing test.\n" - "GetLastError returned %d\n", GetLastError()); + "GetLastError returned %d\n", GetLastError()); } - - /* - * Start producing + + /* + * Start producing */ producer(pBuffer); - + /* * Wait for consumer to complete */ WaitForSingleObject (hThread, INFINITE); - /* + /* * Compare items produced vs. items consumed */ if ( 0 != strncmp (producerItems, consumerItems, PRODUCTION_TOTAL) ) { Fail("The producerItems string %s\n and the consumerItems string " "%s\ndo not match. This could be a problem with the strncmp()" - " function\n FailingTest\nGetLastError() returned %d\n", + " function\n FailingTest\nGetLastError() returned %d\n", producerItems, consumerItems, GetLastError()); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/testinfo.dat deleted file mode 100644 index c3a2a9e4f5b0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/testinfo.dat +++ /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. - -Version = 1.0 -Section = threading -Function = CreateSemaphoreW / ReleaseSemaphore -Name = Positive Test for CreateSemaphoreW and ReleaseSemaphore -TYPE = DEFAULT -EXE1 = createsemaphore -Description -= Implementation of Producer / Consumer IPC problem using CreateSemaphoreW -= and ReleaseSemaphore functions. This test case exercises CreateSemaphoreW -= , ReleaseSemaphore, CreateThread and WaitForSingleObject functions. -= Since there is no way to currently create "pseudo" random events in the -= pal, this example does not behave as classic bounded buffers would. This -= test case is designed to starve the consumer and have the producer fill -= the buffer. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CMakeLists.txt deleted file mode 100644 index 620b6b2811d6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - CreateSemaphore.cpp -) - -add_executable(paltest_createsemaphorew_releasesemaphore_test2 - ${SOURCES} -) - -add_dependencies(paltest_createsemaphorew_releasesemaphore_test2 coreclrpal) - -target_link_libraries(paltest_createsemaphorew_releasesemaphore_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.cpp index befce930f22a..85c10482ccc6 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.cpp @@ -3,7 +3,7 @@ /*============================================================ ** -** Source: CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.c +** Source: CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.c ** ** Purpose: Test Semaphore operation using classic IPC problem: ** "Producer-Consumer Problem". @@ -11,9 +11,9 @@ ** Dependencies: CreateThread ** ReleaseSemaphore ** WaitForSingleObject -** Sleep +** Sleep ** fflush -** +** ** **=========================================================*/ @@ -25,15 +25,15 @@ #define _BUF_SIZE 10 -DWORD dwThreadId; /* consumer thread identifier */ +DWORD dwThreadId_CreateSemaphoreW_test2; /* consumer thread identifier */ -HANDLE hThread; /* handle to consumer thread */ +HANDLE hThread_CreateSemaphoreW_test2; /* handle to consumer thread */ -HANDLE hSemaphoreM; /* handle to mutual exclusion semaphore */ +HANDLE hSemaphoreM_CreateSemaphoreW_test2; /* handle to mutual exclusion semaphore */ -HANDLE hSemaphoreE; /* handle to semaphore that counts empty buffer slots */ +HANDLE hSemaphoreE_CreateSemaphoreW_test2; /* handle to semaphore that counts empty buffer slots */ -HANDLE hSemaphoreF; /* handle to semaphore that counts full buffer slots */ +HANDLE hSemaphoreF_CreateSemaphoreW_test2; /* handle to semaphore that counts full buffer slots */ typedef struct Buffer { @@ -43,16 +43,16 @@ typedef struct Buffer } BufferStructure; -CHAR producerItems[PRODUCTION_TOTAL + 1]; +CHAR producerItems_CreateSemaphoreW_test2[PRODUCTION_TOTAL + 1]; -CHAR consumerItems[PRODUCTION_TOTAL + 1]; +CHAR consumerItems_CreateSemaphoreW_test2[PRODUCTION_TOTAL + 1]; -/* +/* * Read next message from the Buffer into provided pointer. - * Returns: 0 on failure, 1 on success. + * Returns: 0 on failure, 1 on success. */ int -readBuf(BufferStructure *Buffer, char *c) +readBuf_CreateSemaphoreW_test2(BufferStructure *Buffer, char *c) { if( Buffer -> writeIndex == Buffer -> readIndex ) { @@ -63,12 +63,12 @@ readBuf(BufferStructure *Buffer, char *c) return 1; } -/* - * Write message generated by the producer to Buffer. +/* + * Write message generated by the producer to Buffer. * Returns: 0 on failure, 1 on success. */ -int -writeBuf(BufferStructure *Buffer, CHAR c) +int +writeBuf_CreateSemaphoreW_test2(BufferStructure *Buffer, CHAR c) { if( ( ((Buffer -> writeIndex) + 1) % _BUF_SIZE) == (Buffer -> readIndex) ) @@ -84,14 +84,15 @@ writeBuf(BufferStructure *Buffer, CHAR c) * Atomic decrement of semaphore value. */ VOID -down(HANDLE hSemaphore) +down_CreateSemaphoreW_test2(HANDLE hSemaphore) { switch ( (WaitForSingleObject ( - hSemaphore, - 10000))) + hSemaphore, + 10000))) /* Wait 10 seconds */ { - case WAIT_OBJECT_0: /* - * Semaphore was signaled. OK to access semaphore. + case WAIT_OBJECT_0: /* + * Semaphore was signaled. OK to access + * semaphore. */ break; case WAIT_ABANDONED: /* @@ -105,7 +106,7 @@ down(HANDLE hSemaphore) Fail("WaitForSingleObject call returned 'WAIT_FAILED'.\n" "GetLastError returned %d\nFailing Test.\n",GetLastError()); break; - default: + default: Fail("WaitForSingleObject call returned an unexpected value.\n" "Failing Test.\n"); break; @@ -113,16 +114,16 @@ down(HANDLE hSemaphore) } -/* +/* * Atomic increment of semaphore value. */ VOID -up(HANDLE hSemaphore) +up_CreateSemaphoreW_test2(HANDLE hSemaphore) { if (!ReleaseSemaphore ( - hSemaphore, - 1, - NULL) + hSemaphore, + 1, + NULL) ) { Fail("ReleaseSemaphore call failed. GetLastError returned %d\n", @@ -130,96 +131,97 @@ up(HANDLE hSemaphore) } } -/* - * Sleep 10 milleseconds. +/* + * Sleep 500 milleseconds. */ -VOID -consumerSleep(VOID) +VOID +consumerSleep_CreateSemaphoreW_test2(VOID) { Sleep(10); } -/* - * Sleep 500 milleseconds. +/* + * Sleep between 10 milleseconds. */ -VOID -producerSleep(VOID) +VOID +producerSleep_CreateSemaphoreW_test2(VOID) { Sleep(500); } -/* +/* * Produce a message and write the message to Buffer. */ VOID -producer(BufferStructure *Buffer) +producer_CreateSemaphoreW_test2(BufferStructure *Buffer) { int n = 0; char c; - - while (n < PRODUCTION_TOTAL) + + while (n < PRODUCTION_TOTAL) { - c = 'A' + n ; /* Produce Item */ - - down(hSemaphoreE); - down(hSemaphoreM); - - if (writeBuf(Buffer, c)) + c = 'A' + n ; /* Produce Item */ + + down_CreateSemaphoreW_test2(hSemaphoreE_CreateSemaphoreW_test2); + down_CreateSemaphoreW_test2(hSemaphoreM_CreateSemaphoreW_test2); + + if (writeBuf_CreateSemaphoreW_test2(Buffer, c)) { Trace("Producer produces %c.\n", c); fflush(stdout); - producerItems[n++] = c; + producerItems_CreateSemaphoreW_test2[n++] = c; } - - up(hSemaphoreM); - up(hSemaphoreF); - - producerSleep(); + + up_CreateSemaphoreW_test2(hSemaphoreM_CreateSemaphoreW_test2); + up_CreateSemaphoreW_test2(hSemaphoreF_CreateSemaphoreW_test2); + + producerSleep_CreateSemaphoreW_test2(); } + return; } -/* - * Read and "Consume" the messages in Buffer. +/* + * Read and "Consume" the messages in Buffer. */ DWORD -PALAPI -consumer( LPVOID lpParam ) +PALAPI +consumer_CreateSemaphoreW_test2( LPVOID lpParam ) { int n = 0; - char c; + char c; - consumerSleep(); + consumerSleep_CreateSemaphoreW_test2(); - while (n < PRODUCTION_TOTAL) + while (n < PRODUCTION_TOTAL) { - - down(hSemaphoreF); - down(hSemaphoreM); - if (readBuf((BufferStructure*)lpParam, &c)) + down_CreateSemaphoreW_test2(hSemaphoreF_CreateSemaphoreW_test2); + down_CreateSemaphoreW_test2(hSemaphoreM_CreateSemaphoreW_test2); + + if (readBuf_CreateSemaphoreW_test2((BufferStructure*)lpParam, &c)) { Trace("\tConsumer consumes %c.\n", c); fflush(stdout); - consumerItems[n++] = c; + consumerItems_CreateSemaphoreW_test2[n++] = c; } - - up(hSemaphoreM); - up(hSemaphoreE); - consumerSleep(); + up_CreateSemaphoreW_test2(hSemaphoreM_CreateSemaphoreW_test2); + up_CreateSemaphoreW_test2(hSemaphoreE_CreateSemaphoreW_test2); + + consumerSleep_CreateSemaphoreW_test2(); } + return 0; } -int __cdecl main (int argc, char **argv) +PALTEST(threading_CreateSemaphoreW_ReleaseSemaphore_test2_paltest_createsemaphorew_releasesemaphore_test2, "threading/CreateSemaphoreW_ReleaseSemaphore/test2/paltest_createsemaphorew_releasesemaphore_test2") { - BufferStructure Buffer, *pBuffer; pBuffer = &Buffer; - + if(0 != (PAL_Initialize(argc, argv))) { return (FAIL); @@ -228,85 +230,91 @@ int __cdecl main (int argc, char **argv) /* * Create Semaphores */ - hSemaphoreM = CreateSemaphoreW ( - NULL, - 1, - 1, - NULL); - - if ( NULL == hSemaphoreM ) + hSemaphoreM_CreateSemaphoreW_test2 = CreateSemaphoreExW ( + NULL, + 1, + 1, + NULL, + 0, + 0); + + if ( NULL == hSemaphoreM_CreateSemaphoreW_test2 ) { - Fail ( "hSemaphoreM = CreateSemaphoreW () - returned NULL\n" + Fail ( "hSemaphoreM_CreateSemaphoreW_test2 = CreateSemaphoreExW () - returned NULL\n" "Failing Test.\n"); } - hSemaphoreE = CreateSemaphoreW ( - NULL, - _BUF_SIZE , - _BUF_SIZE , - NULL); + hSemaphoreE_CreateSemaphoreW_test2 = CreateSemaphoreExW ( + NULL, + _BUF_SIZE , + _BUF_SIZE , + NULL, + 0, + 0); - if ( NULL == hSemaphoreE ) + if ( NULL == hSemaphoreE_CreateSemaphoreW_test2 ) { - Fail ( "hSemaphoreE = CreateSemaphoreW () - returned NULL\n" + Fail ( "hSemaphoreE_CreateSemaphoreW_test2 = CreateSemaphoreExW () - returned NULL\n" "Failing Test.\n"); } - - hSemaphoreF = CreateSemaphoreW ( - NULL, - 0, - _BUF_SIZE , - NULL); - - if ( NULL == hSemaphoreF ) + + hSemaphoreF_CreateSemaphoreW_test2 = CreateSemaphoreExW ( + NULL, + 0, + _BUF_SIZE , + NULL, + 0, + 0); + + if ( NULL == hSemaphoreF_CreateSemaphoreW_test2 ) { - Fail ( "hSemaphoreF = CreateSemaphoreW () - returned NULL\n" + Fail ( "hSemaphoreF_CreateSemaphoreW_test2 = CreateSemaphoreExW () - returned NULL\n" "Failing Test.\n"); } - /* + /* * Initialize Buffer */ pBuffer->writeIndex = pBuffer->readIndex = 0; - /* + /* * Create Consumer */ - hThread = CreateThread( - NULL, - 0, - consumer, - &Buffer, - 0, - &dwThreadId); - - if ( NULL == hThread ) + hThread_CreateSemaphoreW_test2 = CreateThread( + NULL, + 0, + consumer_CreateSemaphoreW_test2, + &Buffer, + 0, + &dwThreadId_CreateSemaphoreW_test2); + + if ( NULL == hThread_CreateSemaphoreW_test2 ) { Fail ( "CreateThread() returned NULL. Failing test.\n"); } - - /* - * Start producing + + /* + * Start producing */ - producer(pBuffer); - + producer_CreateSemaphoreW_test2(pBuffer); + /* * Wait for consumer to complete */ - WaitForSingleObject (hThread, INFINITE); + WaitForSingleObject (hThread_CreateSemaphoreW_test2, INFINITE); - if ( 0 != strncmp (producerItems, consumerItems, PRODUCTION_TOTAL) ) + if ( 0 != strncmp (producerItems_CreateSemaphoreW_test2, consumerItems_CreateSemaphoreW_test2, PRODUCTION_TOTAL) ) { - Fail("The producerItems string %s\n and the consumerItems string " + Fail("The producerItems_CreateSemaphoreW_test2 string %s\n and the consumerItems_CreateSemaphoreW_test2 string " "%s\ndo not match. This could be a problem with the strncmp()" - " function\n FailingTest\nGetLastError() returned %d\n", - producerItems, consumerItems, GetLastError()); + " function\n FailingTest\nGetLastError() returned %d\n", + producerItems_CreateSemaphoreW_test2, consumerItems_CreateSemaphoreW_test2, GetLastError()); } - Trace ("producerItems and consumerItems arrays match. All %d\nitems " + Trace ("producerItems_CreateSemaphoreW_test2 and consumerItems_CreateSemaphoreW_test2 arrays match. All %d\nitems " "were produced and consumed in order.\nTest passed.\n", PRODUCTION_TOTAL); - + PAL_Terminate(); return ( PASS ); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/testinfo.dat deleted file mode 100644 index e70792803239..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/testinfo.dat +++ /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. - -Version = 1.0 -Section = threading -Function = CreateSemaphoreW / ReleaseSemaphore -Name = Positive Test for CreateSemaphoreW and ReleaseSemaphore -TYPE = DEFAULT -EXE1 = createsemaphore -Description -= Implementation of Producer / Consumer IPC problem using CreateSemaphoreW -= and ReleaseSemaphore functions. This test case exercises CreateSemaphoreW -= , ReleaseSemaphore, CreateThread and WaitForSingleObject functions. -= Since there is no way to currently create "pseudo" random events in the -= pal, this example does not behave as classic bounded buffers would. This -= test case is designed to starve the producer and have the consumer fill -= the buffer. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/CMakeLists.txt deleted file mode 100644 index c4f38faf131e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - createsemaphore.cpp -) - -add_executable(paltest_createsemaphorew_releasesemaphore_test3 - ${SOURCES} -) - -add_dependencies(paltest_createsemaphorew_releasesemaphore_test3 coreclrpal) - -target_link_libraries(paltest_createsemaphorew_releasesemaphore_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.cpp index 77e81b468254..aa05b89d0646 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.cpp @@ -5,14 +5,14 @@ ** ** Source: createsemaphorew_releasesemaphore/test3/createsemaphore.c ** -** Purpose: Test attributes of CreateSemaphoreW and ReleaseSemaphore. +** Purpose: Test attributes of CreateSemaphoreExW and ReleaseSemaphore. ** Insure for CreateSemaphore that lInitialCount and lMaximumCount -** constraints are respected. Validate that CreateSemaphore rejects -** conditions where initial count and / or maximum count are negative -** and conditions where the initial count is greater than the maximum +** constraints are respected. Validate that CreateSemaphore rejects +** conditions where initial count and / or maximum count are negative +** and conditions where the initial count is greater than the maximum ** count. For ReleaseSemaphore validate that lpPreviousCount gets set ** to the previous semaphore count and lpPreviousCount can be NULL. -** Also establish ReleaseSemaphore fails when called in a semaphore +** Also establish ReleaseSemaphore fails when called in a semaphore ** with count equal to lMaximumCount. ** ** @@ -29,7 +29,7 @@ struct testcase BOOL bNegativeTest; }; -struct testcase testCases[] = +struct testcase testCases_CreateSemaphoreW_ReleaseSemaphore_test3[] = { {NULL, -1, 1, NULL, TRUE}, {NULL, 1, -1, NULL, TRUE}, @@ -41,25 +41,25 @@ struct testcase testCases[] = {NULL, INT_MAX, INT_MAX, NULL, FALSE} }; -HANDLE hSemaphore[sizeof(testCases)/sizeof(struct testcase)]; +HANDLE hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[sizeof(testCases_CreateSemaphoreW_ReleaseSemaphore_test3)/sizeof(struct testcase)]; -BOOL cleanup(int index) +BOOL cleanup_ReleaseSemaphore_test3(int index) { int i; BOOL bRet = TRUE; for (i = 0; i < index; i++) { - if (!CloseHandle(hSemaphore[i])) + if (!CloseHandle(hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i])) { bRet = FALSE; Trace("PALSUITE ERROR: CloseHandle(%p) call failed for index %d\n", - hSemaphore[i], i); + hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], i); } } return(bRet); } -int __cdecl main (int argc, char **argv) +PALTEST(threading_CreateSemaphoreW_ReleaseSemaphore_test3_paltest_createsemaphorew_releasesemaphore_test3, "threading/CreateSemaphoreW_ReleaseSemaphore/test3/paltest_createsemaphorew_releasesemaphore_test3") { int i; int j; @@ -69,78 +69,83 @@ int __cdecl main (int argc, char **argv) return (FAIL); } /* create semaphores */ - for (i = 0; i < sizeof(testCases)/sizeof(struct testcase); i++) + testcase* testCases = testCases_CreateSemaphoreW_ReleaseSemaphore_test3; + + for (i = 0; i < sizeof(testCases_CreateSemaphoreW_ReleaseSemaphore_test3)/sizeof(struct testcase); i++) { - hSemaphore[i] = CreateSemaphoreW (testCases[i].lpSemaphoreAttributes, + hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i] = CreateSemaphoreExW (testCases[i].lpSemaphoreAttributes, testCases[i].lInitialCount, testCases[i].lMaximumCount, - testCases[i].lpName); - - if (NULL == hSemaphore[i]) + testCases[i].lpName, + 0, + 0); + + if (NULL == hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i]) { if (!testCases[i].bNegativeTest) { - Trace("PALSUITE ERROR: CreateSemaphoreW('%p' '%ld' '%ld' " - "'%p') returned NULL at index %d.\nGetLastError " + Trace("PALSUITE ERROR: CreateSemaphoreExW('%p' '%ld' '%ld' " + "'%p' '0' '0') returned NULL at index %d.\nGetLastError " "returned %d.\n", testCases[i].lpSemaphoreAttributes, testCases[i].lInitialCount, testCases[i].lMaximumCount, - testCases[i].lpName, i, GetLastError()); + testCases[i].lpName, i, GetLastError()); if (i > 0) { - cleanup(i - 1); + cleanup_ReleaseSemaphore_test3(i - 1); } Fail(""); } - else + else { continue; } } /* increment semaphore count to lMaximumCount */ - for (j = testCases[i].lInitialCount; (ULONG)j <= (ULONG)testCases[i].lMaximumCount; - j++) + for (j = testCases[i].lInitialCount; (ULONG)j <= (ULONG)testCases[i].lMaximumCount; + j++) { if (testCases[i].lMaximumCount == j) { /* Call ReleaseSemaphore once more to ensure ReleaseSemaphore fails */ - if(ReleaseSemaphore(hSemaphore[i], 1, NULL)) + if(ReleaseSemaphore(hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], 1, NULL)) { Trace("PALSUITE ERROR: ReleaseSemaphore('%p' '%ld' '%p') " "call returned %d\nwhen it should have returned " "%d.\nThe semaphore's count was %d.\nGetLastError " - "returned %d.\n", hSemaphore[i], 1, NULL, TRUE, + "returned %d.\n", hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], 1, NULL, TRUE, + FALSE, j, GetLastError()); - cleanup(i); + cleanup_ReleaseSemaphore_test3(i); Fail(""); - } + } } - else + else { int previous; - BOOL bRet = ReleaseSemaphore(hSemaphore[i], 1, &previous); - DWORD dwError = GetLastError(); + BOOL bRet = ReleaseSemaphore(hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], 1, &previous); + DWORD dwError = GetLastError(); if(!bRet) { Trace("PALSUITE ERROR: ReleaseSemaphore('%p' '%ld' '%p') " "call returned %d\nwhen it should have returned " "%d.\nThe semaphore count was %d and it's " - "lMaxCount was %d.\nGetLastError returned %d.\n", - hSemaphore[i], 1, &previous, bRet, TRUE, j, + "lMaxCount was %d.\nGetLastError returned %d.\n", + hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], 1, &previous, bRet, TRUE, j, testCases[i].lMaximumCount, dwError); - cleanup(i); + cleanup_ReleaseSemaphore_test3(i); Fail(""); } if (previous != j) { Trace("PALSUITE ERROR: ReleaseSemaphore('%p' '%ld' '%p') " "call set %p to %d instead of %d.\n The semaphore " - "count was %d and GetLastError returned %d.\n", - hSemaphore[i], 1, &previous, &previous, previous, + "count was %d and GetLastError returned %d.\n", + hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], 1, &previous, &previous, previous, j, j, dwError); - cleanup(i); + cleanup_ReleaseSemaphore_test3(i); Fail(""); } } @@ -153,9 +158,9 @@ int __cdecl main (int argc, char **argv) } /* decrement semaphore count to 0 */ - for (j = testCases[i].lMaximumCount; j >= 0; j--) + for (j = testCases[i].lMaximumCount; j >= 0; j--) { - DWORD dwRet = WaitForSingleObject(hSemaphore[i], 0); + DWORD dwRet = WaitForSingleObject(hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], 0); DWORD dwError = GetLastError(); if (0 == j) @@ -167,13 +172,13 @@ int __cdecl main (int argc, char **argv) Trace("PALSUITE ERROR: WaitForSingleObject('%p' '%u') " "call returned %d\nwhen it should have returned " "%d.\nThe semaphore's count was %d.\nGetLastError " - "returned %d.\n", hSemaphore[i], 0, dwRet, + "returned %d.\n", hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], 0, dwRet, WAIT_TIMEOUT, j, dwError); - cleanup(i); + cleanup_ReleaseSemaphore_test3(i); Fail(""); - } + } } - else + else { /* WaitForSingleObject should report that the semaphore is signaled */ @@ -182,9 +187,9 @@ int __cdecl main (int argc, char **argv) Trace("PALSUITE ERROR: WaitForSingleObject('%p' '%u') " "call returned %d\nwhen it should have returned " "%d.\nThe semaphore's count was %d.\nGetLastError " - "returned %d.\n", hSemaphore[i], 0, dwRet, + "returned %d.\n", hSemaphore_CreateSemaphoreW_ReleaseSemaphore_test3[i], 0, dwRet, WAIT_OBJECT_0, j, dwError); - cleanup(i); + cleanup_ReleaseSemaphore_test3(i); Fail(""); } } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/testinfo.dat deleted file mode 100644 index 48215569f073..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/testinfo.dat +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateSemaphoreW / ReleaseSemaphore -Name = Positive Test for CreateSemaphoreW and ReleaseSemaphore -TYPE = DEFAULT -EXE1 = createsemaphore -Description -= Test attributes of CreateSemaphoreW and ReleaseSemaphore. -= Insure for CreateSemaphore that lInitialCount and lMaximumCount -= constraints are respected. Validate that CreateSemaphore rejects -= conditions where, initial count and / or maximum count are negative -= and conditions where the initial count is greater than the maximum -= count. For ReleaseSemaphore validate that lpPreviousCount gets set -= to the previous semaphore count and lpPreviousCount can be NULL. -= Also establish ReleaseSemaphore fails when called in a semaphore -= with count equal to lMaximumCount. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/CMakeLists.txt deleted file mode 100644 index 16b8d432eb40..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_createthread_test1 - ${SOURCES} -) - -add_dependencies(paltest_createthread_test1 coreclrpal) - -target_link_libraries(paltest_createthread_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/test1.cpp index a1c7e4d0cfb8..d856be3571ca 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/test1.cpp @@ -95,7 +95,7 @@ BOOL CreateThreadTest() } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CreateThread_test1_paltest_createthread_test1, "threading/CreateThread/test1/paltest_createthread_test1") { if(0 != (PAL_Initialize(argc, argv))) { diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/testinfo.dat deleted file mode 100644 index ab67f1fa2377..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateThread -Name = Positive Test for CreateThread -TYPE = DEFAULT -EXE1 = test1 -Description -= Test for CreateThread. Call CreateThread and ensure -= that it succeeds. Also check to ensure the paramater is passed -= properly. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/CMakeLists.txt deleted file mode 100644 index 5b528271c158..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_createthread_test2 - ${SOURCES} -) - -add_dependencies(paltest_createthread_test2 coreclrpal) - -target_link_libraries(paltest_createthread_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/test2.cpp index 610c2f6da44c..b21352d3663f 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/test2.cpp @@ -15,15 +15,15 @@ #define NUM_TESTS 3 -HANDLE hThread[NUM_TESTS]; -DWORD dwThreadId[NUM_TESTS]; -volatile BOOL bResult[NUM_TESTS]; -volatile DWORD dwThreadId1[NUM_TESTS]; +HANDLE hThread_CreateThread_test2[NUM_TESTS]; +DWORD dwThreadId_CreateThread_test2[NUM_TESTS]; +volatile BOOL bResult_CreateThread_test2[NUM_TESTS]; +volatile DWORD dwThreadId1_CreateThread_test2[NUM_TESTS]; -DWORD PALAPI Thread( LPVOID lpParameter) +DWORD PALAPI Thread_CreateThread_test2( LPVOID lpParameter) { - dwThreadId1[(DWORD)(SIZE_T)lpParameter] = GetCurrentThreadId(); - bResult[(DWORD)(SIZE_T) lpParameter] = TRUE; + dwThreadId1_CreateThread_test2[(DWORD)(SIZE_T)lpParameter] = GetCurrentThreadId(); + bResult_CreateThread_test2[(DWORD)(SIZE_T) lpParameter] = TRUE; return (DWORD)(SIZE_T) lpParameter; } @@ -36,36 +36,36 @@ struct testCase LPDWORD lpThreadId; }; -struct testCase testCases[]= -{ - {NULL, 0, &Thread, 0, NULL}, - {NULL, 0, &Thread, CREATE_SUSPENDED, NULL}, - {NULL, 0, &Thread, 0, (LPDWORD) 1} -}; - /* * close handles */ -BOOL cleanup(int index) +BOOL cleanup_CreateThread_test2(int index) { int i; BOOL bRet = TRUE; for (i = 0; i < index; i++) { - if (!CloseHandle(hThread[i])) + if (!CloseHandle(hThread_CreateThread_test2[i])) { bRet = FALSE; Trace("PALSUITE ERROR: CloseHandle(%p) call failed for index %d\n", - hThread[i], i); + hThread_CreateThread_test2[i], i); } } return(bRet); } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CreateThread_test2_paltest_createthread_test2, "threading/CreateThread/test2/paltest_createthread_test2") { + struct testCase testCases[]= + { + {NULL, 0, &Thread_CreateThread_test2, 0, NULL}, + {NULL, 0, &Thread_CreateThread_test2, CREATE_SUSPENDED, NULL}, + {NULL, 0, &Thread_CreateThread_test2, 0, (LPDWORD) 1} + }; + SIZE_T i; DWORD dwRetWFSO; DWORD dwRetRT; @@ -79,24 +79,24 @@ int __cdecl main(int argc, char **argv) /* set results array to FALSE */ for (i = 0; i < NUM_TESTS; i++) { - bResult[i]=FALSE; - dwThreadId[i]=0; + bResult_CreateThread_test2[i]=FALSE; + dwThreadId_CreateThread_test2[i]=0; } for (i = 0; i < NUM_TESTS; i++) { if (NULL != testCases[i].lpThreadId) { - testCases[i].lpThreadId = &dwThreadId[i]; + testCases[i].lpThreadId = &dwThreadId_CreateThread_test2[i]; } /* pass the index as the thread argument */ - hThread[i] = CreateThread( testCases[i].lpThreadAttributes, + hThread_CreateThread_test2[i] = CreateThread( testCases[i].lpThreadAttributes, testCases[i].dwStackSize, testCases[i].lpStartAddress, (LPVOID)i, testCases[i].dwCreationFlags, testCases[i].lpThreadId); - if (hThread[i] == NULL) + if (hThread_CreateThread_test2[i] == NULL) { Trace("PALSUITE ERROR: CreateThread('%p' '%d' '%p' '%p' '%d' " "'%p') call failed.\nGetLastError returned '%u'.\n", @@ -104,21 +104,21 @@ int __cdecl main(int argc, char **argv) testCases[i].lpStartAddress, (LPVOID)i, testCases[i].dwCreationFlags, testCases[i].lpThreadId, GetLastError()); - cleanup(i - 1); + cleanup_CreateThread_test2(i - 1); Fail(""); } /* Resume suspended threads */ if (testCases[i].dwCreationFlags == CREATE_SUSPENDED) { - dwRetRT = ResumeThread (hThread[i]); + dwRetRT = ResumeThread (hThread_CreateThread_test2[i]); if (dwRetRT != 1) { Trace ("PALSUITE ERROR: ResumeThread(%p) " "call returned %d it should have returned %d.\n" - "GetLastError returned %u.\n", hThread[i], dwRetRT, + "GetLastError returned %u.\n", hThread_CreateThread_test2[i], dwRetRT, 1, GetLastError()); - cleanup(i); + cleanup_CreateThread_test2(i); Fail(""); } } @@ -127,18 +127,18 @@ int __cdecl main(int argc, char **argv) /* cleanup */ for (i = 0; i < NUM_TESTS; i++) { - dwRetWFSO = WaitForSingleObject(hThread[i], 10000); + dwRetWFSO = WaitForSingleObject(hThread_CreateThread_test2[i], 10000); if (dwRetWFSO != WAIT_OBJECT_0) { Trace ("PALSUITE ERROR: WaitForSingleObject('%p' '%d') " "call returned %d instead of WAIT_OBJECT_0 ('%d').\n" - "GetLastError returned %u.\n", hThread[i], 10000, + "GetLastError returned %u.\n", hThread_CreateThread_test2[i], 10000, dwRetWFSO, WAIT_OBJECT_0, GetLastError()); - cleanup(i); + cleanup_CreateThread_test2(i); Fail(""); } } - if(!cleanup(NUM_TESTS)) + if(!cleanup_CreateThread_test2(NUM_TESTS)) { Fail(""); } @@ -149,7 +149,7 @@ int __cdecl main(int argc, char **argv) * check to see that all threads were created and were passed * the array index as an argument. */ - if (FALSE == bResult[i]) + if (FALSE == bResult_CreateThread_test2[i]) { bRet = FALSE; Trace("PALSUITE ERROR: result[%d]=%d. It should be %d\n", i, @@ -158,20 +158,20 @@ int __cdecl main(int argc, char **argv) /* * check to see that lpThreadId received the correct value. */ - if (0 != dwThreadId[i]) + if (0 != dwThreadId_CreateThread_test2[i]) { - if (dwThreadId[i] != dwThreadId1[i]) + if (dwThreadId_CreateThread_test2[i] != dwThreadId1_CreateThread_test2[i]) { bRet = FALSE; - Trace("PALSUITE ERROR: dwThreadId[%d]=%p and dwThreadId1[%d]" + Trace("PALSUITE ERROR: dwThreadId_CreateThread_test2[%d]=%p and dwThreadId1_CreateThread_test2[%d]" "=%p\nThese values should be identical.\n", i, - dwThreadId[i], i, dwThreadId1[i]); + dwThreadId_CreateThread_test2[i], i, dwThreadId1_CreateThread_test2[i]); } } } if (!bRet) { - cleanup(NUM_TESTS); + cleanup_CreateThread_test2(NUM_TESTS); Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/testinfo.dat deleted file mode 100644 index d08bc095d6a6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateThread -Name = Positive Test for CreateThread -TYPE = DEFAULT -EXE1 = test2 -Description -= Test that lpThreadId is assigned the correct threadId value and -= that lpThreadId can be NULL. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/CMakeLists.txt deleted file mode 100644 index d621877ca26c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_createthread_test3 - ${SOURCES} -) - -add_dependencies(paltest_createthread_test3 coreclrpal) - -target_link_libraries(paltest_createthread_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/test3.cpp index 62c28f382a67..526fbb31c7f0 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/test3.cpp @@ -13,20 +13,20 @@ #include -HANDLE hThread; -HANDLE hEvent; +HANDLE hThread_CreateThread_test3; +HANDLE hEvent_CreateThread_test3; -DWORD PALAPI Thread( LPVOID lpParameter) +DWORD PALAPI Thread_CreateThread_test3( LPVOID lpParameter) { DWORD dwRet; - dwRet = WaitForSingleObject(hEvent, INFINITE); + dwRet = WaitForSingleObject(hEvent_CreateThread_test3, INFINITE); /* if this thread continues beyond here, fail */ Fail(""); return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CreateThread_test3_paltest_createthread_test3, "threading/CreateThread/test3/paltest_createthread_test3") { DWORD dwThreadId; DWORD dwRet; @@ -36,60 +36,60 @@ int __cdecl main(int argc, char **argv) return (FAIL); } - hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + hEvent_CreateThread_test3 = CreateEvent(NULL, TRUE, FALSE, NULL); - if (hEvent == NULL) + if (hEvent_CreateThread_test3 == NULL) { Fail("PALSUITE ERROR: CreateEvent call #0 failed. GetLastError " "returned %u.\n", GetLastError()); } /* pass the index as the thread argument */ - hThread = CreateThread( NULL, + hThread_CreateThread_test3 = CreateThread( NULL, 0, - &Thread, + &Thread_CreateThread_test3, (LPVOID) 0, 0, &dwThreadId); - if (hThread == NULL) + if (hThread_CreateThread_test3 == NULL) { Trace("PALSUITE ERROR: CreateThread('%p' '%d' '%p' '%p' '%d' '%p') " "call failed.\nGetLastError returned '%u'.\n", NULL, - 0, &Thread, (LPVOID) 0, 0, &dwThreadId, GetLastError()); - if (0 == CloseHandle(hEvent)) + 0, &Thread_CreateThread_test3, (LPVOID) 0, 0, &dwThreadId, GetLastError()); + if (0 == CloseHandle(hEvent_CreateThread_test3)) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%u'.\n", hEvent); + "clean up.\nGetLastError returned '%u'.\n", hEvent_CreateThread_test3); } Fail(""); } - dwRet = WaitForSingleObject(hThread, 10000); + dwRet = WaitForSingleObject(hThread_CreateThread_test3, 10000); if (dwRet != WAIT_TIMEOUT) { Trace ("PALSUITE ERROR: WaitForSingleObject('%p' '%d') " "call returned %d instead of WAIT_TIMEOUT ('%d').\n" - "GetLastError returned '%u'.\n", hThread, 10000, + "GetLastError returned '%u'.\n", hThread_CreateThread_test3, 10000, dwRet, WAIT_TIMEOUT, GetLastError()); Fail(""); } - if (0 == CloseHandle(hThread)) + if (0 == CloseHandle(hThread_CreateThread_test3)) { Trace("PALSUITE ERROR: Unable to CloseHandle(%p) on a running thread." - "\nGetLastError returned '%u'.\n", hThread, GetLastError()); - if (0 == CloseHandle(hEvent)) + "\nGetLastError returned '%u'.\n", hThread_CreateThread_test3, GetLastError()); + if (0 == CloseHandle(hEvent_CreateThread_test3)) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "cleanup.\nGetLastError returned '%u'.\n", hEvent, + "cleanup.\nGetLastError returned '%u'.\n", hEvent_CreateThread_test3, GetLastError()); } Fail(""); } - if (0 == CloseHandle(hEvent)) + if (0 == CloseHandle(hEvent_CreateThread_test3)) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "cleanup.\nGetLastError returned '%u'.\n", hEvent, + "cleanup.\nGetLastError returned '%u'.\n", hEvent_CreateThread_test3, GetLastError()); Fail(""); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/testinfo.dat deleted file mode 100644 index 6d854f379808..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CreateThread/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CreateThread -Name = Positive Test for CreateThread -TYPE = DEFAULT -EXE1 = test3 -Description -= Check to see that the handle CreateThread returns can be closed while -= the thread is still running. - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/CMakeLists.txt deleted file mode 100644 index ba9a8a2f5766..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/CMakeLists.txt deleted file mode 100644 index cbdff5a4f534..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - InitializeCriticalSection.cpp -) - -add_executable(paltest_criticalsectionfunctions_test1 - ${SOURCES} -) - -add_dependencies(paltest_criticalsectionfunctions_test1 coreclrpal) - -target_link_libraries(paltest_criticalsectionfunctions_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.cpp index 6f4dbe43b698..750e42d0672b 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.cpp @@ -26,11 +26,11 @@ #define _BUF_SIZE 10 -DWORD dwThreadId; /* consumer thread identifier */ +DWORD dwThreadId_CriticalSectionFunctions_test1; /* consumer thread identifier */ -HANDLE hThread; /* handle to consumer thread */ +HANDLE hThread_CriticalSectionFunctions_test1; /* handle to consumer thread */ -CRITICAL_SECTION CriticalSectionM; /* Critical Section Object (used as mutex) */ +CRITICAL_SECTION CriticalSectionM_CriticalSectionFunctions_test1; /* Critical Section Object (used as mutex) */ typedef struct Buffer { @@ -40,16 +40,16 @@ typedef struct Buffer } BufferStructure; -CHAR producerItems[PRODUCTION_TOTAL + 1]; +CHAR producerItems_CriticalSectionFunctions_test1[PRODUCTION_TOTAL + 1]; -CHAR consumerItems[PRODUCTION_TOTAL + 1]; +CHAR consumerItems_CriticalSectionFunctions_test1[PRODUCTION_TOTAL + 1]; /* * Read next message from the Buffer into provided pointer. * Returns: 0 on failure, 1 on success. */ int -readBuf(BufferStructure *Buffer, char *c) +readBuf_CriticalSectionFunctions_test1(BufferStructure *Buffer, char *c) { if( Buffer -> writeIndex == Buffer -> readIndex ) { @@ -65,7 +65,7 @@ readBuf(BufferStructure *Buffer, char *c) * Returns: 0 on failure, 1 on success. */ int -writeBuf(BufferStructure *Buffer, CHAR c) +writeBuf_CriticalSectionFunctions_test1(BufferStructure *Buffer, CHAR c) { if( ( ((Buffer -> writeIndex) + 1) % _BUF_SIZE) == (Buffer -> readIndex) ) @@ -81,7 +81,7 @@ writeBuf(BufferStructure *Buffer, CHAR c) * Sleep 500 milleseconds. */ VOID -consumerSleep(VOID) +consumerSleep_CriticalSectionFunctions_test1(VOID) { Sleep(500); } @@ -90,7 +90,7 @@ consumerSleep(VOID) * Sleep between 10 milleseconds. */ VOID -producerSleep(VOID) +producerSleep_CriticalSectionFunctions_test1(VOID) { Sleep(10); } @@ -99,7 +99,7 @@ producerSleep(VOID) * Produce a message and write the message to Buffer. */ VOID -producer(BufferStructure *Buffer) +producer_CriticalSectionFunctions_test1(BufferStructure *Buffer) { int n = 0; @@ -109,17 +109,17 @@ producer(BufferStructure *Buffer) { c = 'A' + n ; /* Produce Item */ - EnterCriticalSection(&CriticalSectionM); + EnterCriticalSection(&CriticalSectionM_CriticalSectionFunctions_test1); - if (writeBuf(Buffer, c)) + if (writeBuf_CriticalSectionFunctions_test1(Buffer, c)) { printf("Producer produces %c.\n", c); - producerItems[n++] = c; + producerItems_CriticalSectionFunctions_test1[n++] = c; } - LeaveCriticalSection(&CriticalSectionM); + LeaveCriticalSection(&CriticalSectionM_CriticalSectionFunctions_test1); - producerSleep(); + producerSleep_CriticalSectionFunctions_test1(); } return; @@ -130,33 +130,33 @@ producer(BufferStructure *Buffer) */ DWORD PALAPI -consumer( LPVOID lpParam ) +consumer_CriticalSectionFunctions_test1( LPVOID lpParam ) { int n = 0; char c; - consumerSleep(); + consumerSleep_CriticalSectionFunctions_test1(); while (n < PRODUCTION_TOTAL) { - EnterCriticalSection(&CriticalSectionM); + EnterCriticalSection(&CriticalSectionM_CriticalSectionFunctions_test1); - if (readBuf((BufferStructure*)lpParam, &c)) + if (readBuf_CriticalSectionFunctions_test1((BufferStructure*)lpParam, &c)) { printf("\tConsumer consumes %c.\n", c); - consumerItems[n++] = c; + consumerItems_CriticalSectionFunctions_test1[n++] = c; } - LeaveCriticalSection(&CriticalSectionM); + LeaveCriticalSection(&CriticalSectionM_CriticalSectionFunctions_test1); - consumerSleep(); + consumerSleep_CriticalSectionFunctions_test1(); } return 0; } -int __cdecl main (int argc, char **argv) +PALTEST(threading_CriticalSectionFunctions_test1_paltest_criticalsectionfunctions_test1, "threading/CriticalSectionFunctions/test1/paltest_criticalsectionfunctions_test1") { BufferStructure Buffer, *pBuffer; @@ -172,7 +172,7 @@ int __cdecl main (int argc, char **argv) * Create mutual exclusion mechanisms */ - InitializeCriticalSection ( &CriticalSectionM ); + InitializeCriticalSection ( &CriticalSectionM_CriticalSectionFunctions_test1 ); /* * Initialize Buffer @@ -184,15 +184,15 @@ int __cdecl main (int argc, char **argv) /* * Create Consumer */ - hThread = CreateThread( + hThread_CriticalSectionFunctions_test1 = CreateThread( NULL, 0, - consumer, + consumer_CriticalSectionFunctions_test1, &Buffer, 0, - &dwThreadId); + &dwThreadId_CriticalSectionFunctions_test1); - if ( NULL == hThread ) + if ( NULL == hThread_CriticalSectionFunctions_test1 ) { Fail ( "CreateThread() returned NULL. Failing test.\n" "GetLastError returned %d\n", GetLastError()); @@ -201,30 +201,30 @@ int __cdecl main (int argc, char **argv) /* * Start producing */ - producer(pBuffer); + producer_CriticalSectionFunctions_test1(pBuffer); /* * Wait for consumer to complete */ - WaitForSingleObject (hThread, INFINITE); + WaitForSingleObject (hThread_CriticalSectionFunctions_test1, INFINITE); /* * Compare items produced vs. items consumed */ - if ( 0 != strncmp (producerItems, consumerItems, PRODUCTION_TOTAL) ) + if ( 0 != strncmp (producerItems_CriticalSectionFunctions_test1, consumerItems_CriticalSectionFunctions_test1, PRODUCTION_TOTAL) ) { - Fail("The producerItems string %s\n and the consumerItems string " + Fail("The producerItems_CriticalSectionFunctions_test1 string %s\n and the consumerItems_CriticalSectionFunctions_test1 string " "%s\ndo not match. This could be a problem with the strncmp()" " function\n FailingTest\nGetLastError() returned %d\n", - producerItems, consumerItems, GetLastError()); + producerItems_CriticalSectionFunctions_test1, consumerItems_CriticalSectionFunctions_test1, GetLastError()); } /* * Clean up Critical Section object */ - DeleteCriticalSection(&CriticalSectionM); + DeleteCriticalSection(&CriticalSectionM_CriticalSectionFunctions_test1); - Trace("producerItems and consumerItems arrays match. All %d\nitems " + Trace("producerItems_CriticalSectionFunctions_test1 and consumerItems_CriticalSectionFunctions_test1 arrays match. All %d\nitems " "were produced and consumed in order.\nTest passed.\n", PRODUCTION_TOTAL); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/testinfo.dat deleted file mode 100644 index 41db3e985c08..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/testinfo.dat +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = InitializeCriticalSection / EnterCriticalSection / LeaveCriticalSection / DeleteCriticalSection -Name = Positive Test for InitializeCriticalSection, EnterCriticalSection, LeaveCriticalSection and DeleteCriticalSection -TYPE = DEFAULT -EXE1 = initializecriticalsection -Description -= Implementation of Producer / Consumer IPC problem using the -= "CriticalSection" functions to provide a mutual exclusion mechanism. -= This test case exercises InitializeCriticalSection, EnterCriticalSection, -= LeaveCriticalSection, DeleteCriticalSection, and WaitForSingleObject -= functions. -= This case doesn't work with more than one producer and one consumer. -= The producer thread and consumer thread each take turns blocking on -= the CriticalSection object and do not have any other synchronization -= mechanisms. This prevents adding producers or consumers as there are -= no mechanisms to block them once the buffer is full. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/CMakeLists.txt deleted file mode 100644 index 9f537dd1ecfd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_criticalsectionfunctions_test2 - ${SOURCES} -) - -add_dependencies(paltest_criticalsectionfunctions_test2 coreclrpal) - -target_link_libraries(paltest_criticalsectionfunctions_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.cpp index 41b104935e09..4bb75dfcf95f 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.cpp @@ -25,14 +25,12 @@ #include -CRITICAL_SECTION CriticalSection; - volatile BOOL t0_tflag = FAIL; /* thread 0 timeout flag */ volatile BOOL t1_aflag = FAIL; /* thread 1 access flag */ volatile BOOL t1_cflag = FAIL; /* thread 1 critical section flag */ volatile BOOL bTestResult = FAIL; -DWORD PALAPI Thread(LPVOID lpParam) +DWORD PALAPI Thread_CriticalSectionFunctions_test2(LPVOID lpParam) { t1_aflag = PASS; EnterCriticalSection(&CriticalSection); @@ -41,7 +39,7 @@ DWORD PALAPI Thread(LPVOID lpParam) return 0; } -int __cdecl main (int argc, char **argv) +PALTEST(threading_CriticalSectionFunctions_test2_paltest_criticalsectionfunctions_test2, "threading/CriticalSectionFunctions/test2/paltest_criticalsectionfunctions_test2") { HANDLE hThread; DWORD dwThreadId; @@ -63,7 +61,7 @@ int __cdecl main (int argc, char **argv) */ hThread = CreateThread(NULL, 0, - &Thread, + &Thread_CriticalSectionFunctions_test2, (LPVOID) NULL, CREATE_SUSPENDED, &dwThreadId); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/testinfo.dat deleted file mode 100644 index 22f5d1445ce6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/testinfo.dat +++ /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. - -Version = 1.0 -Section = threading -Function = CriticalSectionFunctions -Name = Positive test to ensure CRITICAL_SECTION objects can be nested -TYPE = DEFAULT -EXE1 = test2 -Description -= Test that we are able to nest critical section calls. -= The initial thread makes a call to EnterCriticalSection once, -= blocking on a CRITICAL_SECTION object and creates a new thread. -= The newly created thread blocks on the same CRITICAL_SECTION object. -= The first thread now makes a call to LeaveCriticalSection. -= Test to see that the new thread doesn't get unblocked. - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/CMakeLists.txt deleted file mode 100644 index 7435fdaf2e70..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_criticalsectionfunctions_test3 - ${SOURCES} -) - -add_dependencies(paltest_criticalsectionfunctions_test3 coreclrpal) - -target_link_libraries(paltest_criticalsectionfunctions_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.cpp index 12096eba27fe..c86344a295ad 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.cpp @@ -30,95 +30,94 @@ #define NUM_THREADS 2 -HANDLE hThread[NUM_THREADS]; -HANDLE hEvent[NUM_THREADS]; -CRITICAL_SECTION CriticalSection; -BOOL bRet = FAIL; +HANDLE hThread_CriticalSectionFunctions_test3[NUM_THREADS]; +HANDLE hEvent_CriticalSectionFunctions_test3[NUM_THREADS]; +BOOL bRet_CriticalSectionFunctions_test3 = FAIL; -DWORD PALAPI Thread(LPVOID lpParam) +DWORD PALAPI Thread_CriticalSectionFunctions_test3(LPVOID lpParam) { DWORD dwRet; if (0 == TryEnterCriticalSection(&CriticalSection)) { - dwRet = WaitForMultipleObjects(NUM_THREADS, hEvent, TRUE, 10000); + dwRet = WaitForMultipleObjects(NUM_THREADS, hEvent_CriticalSectionFunctions_test3, TRUE, 10000); if ((WAIT_OBJECT_0 > dwRet) || ((WAIT_OBJECT_0 + NUM_THREADS - 1) < dwRet)) { #if 0 - if (0 == CloseHandle(hThread[1])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) " "during clean up.\nGetLastError returned '%d'.\n", - hThread[1], GetLastError()); + hThread_CriticalSectionFunctions_test3[1], GetLastError()); } #endif Trace("PALSUITE ERROR: WaitForMultipleObjects(%d, %p, %d, %d) call" "returned an unexpected value, '%d'.\nGetLastError returned " - "%d.\n", NUM_THREADS, hEvent, TRUE, 10000, dwRet, + "%d.\n", NUM_THREADS, hEvent_CriticalSectionFunctions_test3, TRUE, 10000, dwRet, GetLastError()); } else { - bRet = PASS; + bRet_CriticalSectionFunctions_test3 = PASS; } } else { /* signal thread 0 */ - if (0 == SetEvent(hEvent[0])) + if (0 == SetEvent(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute SetEvent(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[0], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0], GetLastError()); LeaveCriticalSection(&CriticalSection); - if (0 == CloseHandle(hThread[0])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) " "during clean up\nGetLastError returned '%d'.\n", - hThread[0], GetLastError()); + hThread_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) " "during clean up\nGetLastError returned '%d'.\n", - hEvent[0], GetLastError()); + hEvent_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[1])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) " "during clean up\nGetLastError returned '%d'.\n", - hEvent[1], GetLastError()); + hEvent_CriticalSectionFunctions_test3[1], GetLastError()); } DeleteCriticalSection(&CriticalSection); Fail(""); } /* wait to be signaled */ - dwRet = WaitForSingleObject(hEvent[1], 10000); + dwRet = WaitForSingleObject(hEvent_CriticalSectionFunctions_test3[1], 10000); if (WAIT_OBJECT_0 != dwRet) { Trace("PALSUITE ERROR: WaitForSingleObject(%p,%d) should have " "returned\nWAIT_OBJECT_0 ('%d'), instead it returned " "('%d').\nGetLastError returned '%d'.\n", - hEvent[0], 10000, WAIT_OBJECT_0, dwRet, GetLastError()); - if (0 == CloseHandle(hThread[0])) + hEvent_CriticalSectionFunctions_test3[0], 10000, WAIT_OBJECT_0, dwRet, GetLastError()); + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) " "during clean up.\nGetLastError returned '%d'.\n", - hThread[0], GetLastError()); + hThread_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) " "during clean up.\nGetLastError returned '%d'.\n", - hEvent[0], GetLastError()); + hEvent_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[1])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) " "during clean up.\nGetLastError returned '%d.'\n", - hEvent[1], GetLastError()); + hEvent_CriticalSectionFunctions_test3[1], GetLastError()); } DeleteCriticalSection(&CriticalSection); Fail(""); @@ -128,64 +127,64 @@ DWORD PALAPI Thread(LPVOID lpParam) return FAIL; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CriticalSectionFunctions_test3_paltest_criticalsectionfunctions_test3, "threading/CriticalSectionFunctions/test3/paltest_criticalsectionfunctions_test3") { - HANDLE hThread[NUM_THREADS]; + HANDLE hThread_CriticalSectionFunctions_test3[NUM_THREADS]; DWORD dwThreadId[NUM_THREADS]; DWORD dwRet; if ((PAL_Initialize(argc,argv)) != 0) { - return(bRet); + return(bRet_CriticalSectionFunctions_test3); } /* thread 0 event */ - hEvent[0] = CreateEvent(NULL, TRUE, FALSE, NULL); + hEvent_CriticalSectionFunctions_test3[0] = CreateEvent(NULL, TRUE, FALSE, NULL); - if (hEvent[0] == NULL) + if (hEvent_CriticalSectionFunctions_test3[0] == NULL) { Fail("PALSUITE ERROR: CreateEvent call #0 failed. GetLastError " "returned %d.\n", GetLastError()); } /* thread 1 event */ - hEvent[1] = CreateEvent(NULL, TRUE, FALSE, NULL); + hEvent_CriticalSectionFunctions_test3[1] = CreateEvent(NULL, TRUE, FALSE, NULL); - if (hEvent[1] == NULL) + if (hEvent_CriticalSectionFunctions_test3[1] == NULL) { Trace("PALSUITE ERROR: CreateEvent call #1 failed. GetLastError " "returned %d.\n", GetLastError()); - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[0]); + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0]); } Fail(""); } InitializeCriticalSection ( &CriticalSection ); - hThread[0] = CreateThread(NULL, + hThread_CriticalSectionFunctions_test3[0] = CreateThread(NULL, 0, - &Thread, + &Thread_CriticalSectionFunctions_test3, (LPVOID) NULL, 0, &dwThreadId[0]); - if (hThread[0] == NULL) + if (hThread_CriticalSectionFunctions_test3[0] == NULL) { Trace("PALSUITE ERROR: CreateThread call #0 failed. GetLastError " "returned %d.\n", GetLastError()); - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[0], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[1])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[1], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[1], GetLastError()); } DeleteCriticalSection(&CriticalSection); @@ -194,29 +193,29 @@ int __cdecl main(int argc, char **argv) /* wait for thread 0 to be signaled */ - dwRet = WaitForSingleObject(hEvent[0], 10000); + dwRet = WaitForSingleObject(hEvent_CriticalSectionFunctions_test3[0], 10000); if (WAIT_OBJECT_0 != dwRet) { Trace("PALSUITE ERROR: WaitForSingleObject(%p,%d) should have " "returned\nWAIT_OBJECT_0 ('%d'), instead it returned " - "('%d').\nGetLastError returned '%d'.\n", hEvent[0], 10000, + "('%d').\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0], 10000, WAIT_OBJECT_0, dwRet, GetLastError()); - if (0 == CloseHandle(hThread[0])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hThread[0], + "clean up.\nGetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[0], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[1])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[1], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[1], GetLastError()); } Fail(""); @@ -229,10 +228,10 @@ int __cdecl main(int argc, char **argv) if (0 == TryEnterCriticalSection(&CriticalSection)) { /* signal thread 1 */ - if (0 == SetEvent(hEvent[1])) + if (0 == SetEvent(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute SetEvent(%p) call.\n" - "GetLastError returned '%d'.\n", hEvent[1], + "GetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[1], GetLastError()); goto done; } @@ -242,22 +241,22 @@ int __cdecl main(int argc, char **argv) Trace("PALSUITE_ERROR: TryEnterCriticalSection was able to grab a" " CRITICAL_SECTION object\nwhich was already owned.\n"); LeaveCriticalSection(&CriticalSection); - if (0 == CloseHandle(hThread[0])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hThread[0], + "clean up.\nGetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[0], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[1])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[1], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[1], GetLastError()); } DeleteCriticalSection(&CriticalSection); @@ -269,71 +268,71 @@ int __cdecl main(int argc, char **argv) */ EnterCriticalSection(&CriticalSection); - hThread[1] = CreateThread(NULL, + hThread_CriticalSectionFunctions_test3[1] = CreateThread(NULL, 0, - &Thread, + &Thread_CriticalSectionFunctions_test3, (LPVOID) NULL, 0, &dwThreadId[1]); - if (hThread[1] == NULL) + if (hThread_CriticalSectionFunctions_test3[1] == NULL) { Trace("PALSUITE ERROR: CreateThread call #1 failed. GetLastError " "returned %d.\n", GetLastError()); LeaveCriticalSection(&CriticalSection); - if (0 == CloseHandle(hThread[0])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hThread[0], + "clean up.\nGetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[0], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[1])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[1], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[1], GetLastError()); } DeleteCriticalSection(&CriticalSection); Fail(""); } - dwRet = WaitForMultipleObjects(NUM_THREADS, hThread, TRUE, 10000); + dwRet = WaitForMultipleObjects(NUM_THREADS, hThread_CriticalSectionFunctions_test3, TRUE, 10000); if ((WAIT_OBJECT_0 > dwRet) || ((WAIT_OBJECT_0 + NUM_THREADS - 1) < dwRet)) { Trace("PALSUITE ERROR: WaitForMultipleObjects(%d, %p, %d, %d) call " "returned an unexpected value, '%d'.\nGetLastError returned " - "%d.\n", NUM_THREADS, hThread, TRUE, 10000, dwRet, + "%d.\n", NUM_THREADS, hThread_CriticalSectionFunctions_test3, TRUE, 10000, dwRet, GetLastError()); LeaveCriticalSection(&CriticalSection); - if (0 == CloseHandle(hThread[0])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hThread[0], + "clean up.\nGetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hThread[1])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hThread[1], + "clean up.\nGetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test3[1], GetLastError()); } - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[0], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[1])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[1], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[1], GetLastError()); } DeleteCriticalSection(&CriticalSection); @@ -341,35 +340,35 @@ int __cdecl main(int argc, char **argv) } LeaveCriticalSection(&CriticalSection); - if (0 == CloseHandle(hThread[1])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hThread[1], + "clean up.\nGetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test3[1], GetLastError()); } done: - if (0 == CloseHandle(hThread[0])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hThread[0], + "clean up.\nGetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[0])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[0])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[0], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[0], GetLastError()); } - if (0 == CloseHandle(hEvent[1])) + if (0 == CloseHandle(hEvent_CriticalSectionFunctions_test3[1])) { Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%d'.\n", hEvent[1], + "clean up.\nGetLastError returned '%d'.\n", hEvent_CriticalSectionFunctions_test3[1], GetLastError()); } DeleteCriticalSection(&CriticalSection); - PAL_TerminateEx(bRet); + PAL_TerminateEx(bRet_CriticalSectionFunctions_test3); - return (bRet); + return (bRet_CriticalSectionFunctions_test3); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/testinfo.dat deleted file mode 100644 index cf9cf558bc83..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/testinfo.dat +++ /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. - -Version = 1.0 -Section = threading -Function = CriticalSectionFunctions -Name = Positive Test for TryEnterCriticalSection -TYPE = DEFAULT -EXE1 = test3 -Description -= Create two threads to exercise TryEnterCriticalSection -= and EnterCriticalSection. TryEnterCriticalSection acquires -= and holds a CRITICAL_SECTION object. Another call to -= TryEnterCriticalSection is made from a different thread, at -= this time, to establish a call to TryEnterCriticalSection -= will return immediatly and to establish -= TryEnterCriticalSection returns the proper value when it -= attempts to lock a CRITICAL_SECTION that is already owned -= by another thread. The CRITICAL_SECTION object is then -= released and held by a call to EnterCriticalSection. A new -= thread is invoked and attempts to acquire the held -= CRITICAL_SECTION with a call to TryEnterCriticalSection. -= TryEnterCriticalSection returns immediatly and returns -= with the value that states the CRITICAL_SECTION object is -= held by another thread. This establishes -= TryEnterCriticalSection behaves the same way with -= CriticalSections locked by TryEnterCriticalSection and -= EnterCriticalSection. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/CMakeLists.txt deleted file mode 100644 index 6fe8258cec30..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_criticalsectionfunctions_test4 - ${SOURCES} -) - -add_dependencies(paltest_criticalsectionfunctions_test4 coreclrpal) - -target_link_libraries(paltest_criticalsectionfunctions_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.cpp index ee3e60008a4f..14a737abd3a9 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.cpp @@ -28,108 +28,108 @@ #define NUM_BLOCKING_THREADS 2 -BOOL bTestResult; -CRITICAL_SECTION CriticalSection; -HANDLE hThread[NUM_BLOCKING_THREADS]; -HANDLE hEvent; -DWORD dwThreadId[NUM_BLOCKING_THREADS]; -volatile int flags[NUM_BLOCKING_THREADS] = {0,0}; - -DWORD PALAPI ThreadTest1(LPVOID lpParam) +BOOL bTestResult_CriticalSectionFunctions_test4; +CRITICAL_SECTION CriticalSection_CriticalSectionFunctions_test4; +HANDLE hThread_CriticalSectionFunctions_test4[NUM_BLOCKING_THREADS]; +HANDLE hEvent_CriticalSectionFunctions_test4; +DWORD dwThreadId_CriticalSectionFunctions_test4[NUM_BLOCKING_THREADS]; +volatile int flags_CriticalSectionFunctions_test4[NUM_BLOCKING_THREADS] = {0,0}; + +DWORD PALAPI ThreadTest1_CriticalSectionFunctions_test4(LPVOID lpParam) { - EnterCriticalSection ( &CriticalSection ); + EnterCriticalSection ( &CriticalSection_CriticalSectionFunctions_test4 ); - flags[0] = 1; + flags_CriticalSectionFunctions_test4[0] = 1; return 0; } -DWORD PALAPI ThreadTest2(LPVOID lpParam) +DWORD PALAPI ThreadTest2_CriticalSectionFunctions_test4(LPVOID lpParam) { - EnterCriticalSection ( &CriticalSection ); + EnterCriticalSection ( &CriticalSection_CriticalSectionFunctions_test4 ); - flags[1] = 1; + flags_CriticalSectionFunctions_test4[1] = 1; return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CriticalSectionFunctions_test4_paltest_criticalsectionfunctions_test4, "threading/CriticalSectionFunctions/test4/paltest_criticalsectionfunctions_test4") { DWORD dwRet; DWORD dwRet1; - bTestResult = FAIL; + bTestResult_CriticalSectionFunctions_test4 = FAIL; if ((PAL_Initialize(argc,argv)) != 0) { - return(bTestResult); + return(bTestResult_CriticalSectionFunctions_test4); } /* * Create Critical Section Object */ - InitializeCriticalSection ( &CriticalSection ); + InitializeCriticalSection ( &CriticalSection_CriticalSectionFunctions_test4 ); - EnterCriticalSection ( &CriticalSection ); + EnterCriticalSection ( &CriticalSection_CriticalSectionFunctions_test4 ); - hThread[0] = CreateThread(NULL, + hThread_CriticalSectionFunctions_test4[0] = CreateThread(NULL, 0, - &ThreadTest1, + &ThreadTest1_CriticalSectionFunctions_test4, (LPVOID) 0, CREATE_SUSPENDED, - &dwThreadId[0]); - if (hThread[0] == NULL) + &dwThreadId_CriticalSectionFunctions_test4[0]); + if (hThread_CriticalSectionFunctions_test4[0] == NULL) { Trace("PALSUITE ERROR: CreateThread(%p, %d, %p, %p, %d, %p) call " - "failed.\nGetLastError returned %d.\n", NULL, 0, &ThreadTest1, - (LPVOID) 0, CREATE_SUSPENDED, &dwThreadId[0], GetLastError()); - LeaveCriticalSection(&CriticalSection); - DeleteCriticalSection ( &CriticalSection ); + "failed.\nGetLastError returned %d.\n", NULL, 0, &ThreadTest1_CriticalSectionFunctions_test4, + (LPVOID) 0, CREATE_SUSPENDED, &dwThreadId_CriticalSectionFunctions_test4[0], GetLastError()); + LeaveCriticalSection(&CriticalSection_CriticalSectionFunctions_test4); + DeleteCriticalSection ( &CriticalSection_CriticalSectionFunctions_test4 ); Fail(""); } - hThread[1] = CreateThread(NULL, + hThread_CriticalSectionFunctions_test4[1] = CreateThread(NULL, 0, - &ThreadTest2, + &ThreadTest2_CriticalSectionFunctions_test4, (LPVOID) 0, CREATE_SUSPENDED, - &dwThreadId[1]); - if (hThread[1] == NULL) + &dwThreadId_CriticalSectionFunctions_test4[1]); + if (hThread_CriticalSectionFunctions_test4[1] == NULL) { Trace("PALSUITE ERROR: CreateThread(%p, %d, %p, %p, %d, %p) call " - "failed.\nGetLastError returned %d.\n", NULL, 0, &ThreadTest2, - (LPVOID) 0, CREATE_SUSPENDED, &dwThreadId[1], GetLastError()); - LeaveCriticalSection(&CriticalSection); + "failed.\nGetLastError returned %d.\n", NULL, 0, &ThreadTest2_CriticalSectionFunctions_test4, + (LPVOID) 0, CREATE_SUSPENDED, &dwThreadId_CriticalSectionFunctions_test4[1], GetLastError()); + LeaveCriticalSection(&CriticalSection_CriticalSectionFunctions_test4); - dwRet = ResumeThread(hThread[0]); + dwRet = ResumeThread(hThread_CriticalSectionFunctions_test4[0]); if (-1 == dwRet) { Trace("PALSUITE ERROR: ResumeThread(%p) call failed.\n" - "GetLastError returned '%d'.\n", hThread[0], + "GetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test4[0], GetLastError()); } - dwRet = WaitForSingleObject(hThread[0], 10000); + dwRet = WaitForSingleObject(hThread_CriticalSectionFunctions_test4[0], 10000); if (WAIT_OBJECT_0 == dwRet) { Trace("PALSUITE ERROR: WaitForSingleObject(%p, %d) call " "failed. '%d' was returned instead of the expected '%d'.\n" - "GetLastError returned '%d'.\n", hThread[0], 10000, dwRet, + "GetLastError returned '%d'.\n", hThread_CriticalSectionFunctions_test4[0], 10000, dwRet, WAIT_OBJECT_0, GetLastError()); } - if (0 == CloseHandle(hThread[0])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test4[0])) { Trace("PALSUITE NOTIFICATION: CloseHandle(%p) call failed.\n" "GetLastError returned %d. Not failing tests.\n", - hThread[0], GetLastError()); + hThread_CriticalSectionFunctions_test4[0], GetLastError()); } - DeleteCriticalSection(&CriticalSection); + DeleteCriticalSection(&CriticalSection_CriticalSectionFunctions_test4); Fail(""); } @@ -137,104 +137,104 @@ int __cdecl main(int argc, char **argv) * Set other thread priorities to be higher than ours & Sleep to ensure * we give up the processor. */ - dwRet = (DWORD) SetThreadPriority(hThread[0], + dwRet = (DWORD) SetThreadPriority(hThread_CriticalSectionFunctions_test4[0], THREAD_PRIORITY_ABOVE_NORMAL); if (0 == dwRet) { Trace("PALSUITE ERROR: SetThreadPriority(%p, %d) call failed.\n" - "GetLastError returned %d", hThread[0], + "GetLastError returned %d", hThread_CriticalSectionFunctions_test4[0], THREAD_PRIORITY_ABOVE_NORMAL, GetLastError()); } - dwRet = (DWORD) SetThreadPriority(hThread[1], + dwRet = (DWORD) SetThreadPriority(hThread_CriticalSectionFunctions_test4[1], THREAD_PRIORITY_ABOVE_NORMAL); if (0 == dwRet) { Trace("PALSUITE ERROR: SetThreadPriority(%p, %d) call failed.\n" - "GetLastError returned %d", hThread[1], + "GetLastError returned %d", hThread_CriticalSectionFunctions_test4[1], THREAD_PRIORITY_ABOVE_NORMAL, GetLastError()); } - dwRet = ResumeThread(hThread[0]); + dwRet = ResumeThread(hThread_CriticalSectionFunctions_test4[0]); if (-1 == dwRet) { Trace("PALSUITE ERROR: ResumeThread(%p, %d) call failed.\n" - "GetLastError returned %d", hThread[0], + "GetLastError returned %d", hThread_CriticalSectionFunctions_test4[0], GetLastError() ); } - dwRet = ResumeThread(hThread[1]); + dwRet = ResumeThread(hThread_CriticalSectionFunctions_test4[1]); if (-1 == dwRet) { Trace("PALSUITE ERROR: ResumeThread(%p, %d) call failed.\n" - "GetLastError returned %d", hThread[0], + "GetLastError returned %d", hThread_CriticalSectionFunctions_test4[0], GetLastError()); } Sleep (0); - LeaveCriticalSection (&CriticalSection); + LeaveCriticalSection (&CriticalSection_CriticalSectionFunctions_test4); - dwRet = WaitForSingleObject(hThread[0], 10000); - dwRet1 = WaitForSingleObject(hThread[1], 10000); + dwRet = WaitForSingleObject(hThread_CriticalSectionFunctions_test4[0], 10000); + dwRet1 = WaitForSingleObject(hThread_CriticalSectionFunctions_test4[1], 10000); if ((WAIT_OBJECT_0 == dwRet) || (WAIT_OBJECT_0 == dwRet1)) { - if ((1 == flags[0] && 0 == flags[1]) || - (0 == flags[0] && 1 == flags[1])) + if ((1 == flags_CriticalSectionFunctions_test4[0] && 0 == flags_CriticalSectionFunctions_test4[1]) || + (0 == flags_CriticalSectionFunctions_test4[0] && 1 == flags_CriticalSectionFunctions_test4[1])) { - bTestResult = PASS; + bTestResult_CriticalSectionFunctions_test4 = PASS; } else { - bTestResult = FAIL; + bTestResult_CriticalSectionFunctions_test4 = FAIL; Trace ("PALSUITE ERROR: flags[%d] = {%d,%d}. These values are" "inconsistent.\nCriticalSection test failed.\n", - NUM_BLOCKING_THREADS, flags[0], flags[1]); + NUM_BLOCKING_THREADS, flags_CriticalSectionFunctions_test4[0], flags_CriticalSectionFunctions_test4[1]); } /* Fail the test if both threads returned WAIT_OBJECT_0 */ if ((WAIT_OBJECT_0 == dwRet) && (WAIT_OBJECT_0 == dwRet1)) { - bTestResult = FAIL; + bTestResult_CriticalSectionFunctions_test4 = FAIL; Trace ("PALSUITE ERROR: WaitForSingleObject(%p, %d) and " "WaitForSingleObject(%p, %d)\nboth returned dwRet = '%d'\n" "One should have returned WAIT_TIMEOUT ('%d').\n", - hThread[0], 10000, hThread[1], 10000, dwRet, WAIT_TIMEOUT); + hThread_CriticalSectionFunctions_test4[0], 10000, hThread_CriticalSectionFunctions_test4[1], 10000, dwRet, WAIT_TIMEOUT); } } else { - bTestResult = FAIL; + bTestResult_CriticalSectionFunctions_test4 = FAIL; Trace ("PALSUITE ERROR: WaitForSingleObject(%p, %d) and " "WaitForSingleObject(%p, %d)\nReturned dwRet = '%d' and\n" - "dwRet1 = '%d' respectively.\n", hThread[0], 10000, hThread[1], + "dwRet1 = '%d' respectively.\n", hThread_CriticalSectionFunctions_test4[0], 10000, hThread_CriticalSectionFunctions_test4[1], 10000, dwRet, dwRet1); } if (WAIT_OBJECT_0 == dwRet) { - if (0 == CloseHandle(hThread[0])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test4[0])) { Trace("PALSUITE NOTIFICATION: CloseHandle(%p) call failed.\n" "GetLastError returned %d. Not failing tests.\n", - hThread[0], GetLastError()); + hThread_CriticalSectionFunctions_test4[0], GetLastError()); } } if (WAIT_OBJECT_0 == dwRet1) { - if (0 == CloseHandle(hThread[1])) + if (0 == CloseHandle(hThread_CriticalSectionFunctions_test4[1])) { Trace("PALSUITE NOTIFICATION: CloseHandle(%p) call failed.\n" "GetLastError returned %d. Not failing tests.\n", - hThread[1], GetLastError()); + hThread_CriticalSectionFunctions_test4[1], GetLastError()); } } /* Leaking the CS on purpose, since there is still a thread waiting on it */ - PAL_TerminateEx(bTestResult); - return (bTestResult); + PAL_TerminateEx(bTestResult_CriticalSectionFunctions_test4); + return (bTestResult_CriticalSectionFunctions_test4); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/testinfo.dat deleted file mode 100644 index c31a70ac4272..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = LeaveCriticalSection -Name = Positive test to ensure CRITICAL_SECTION objects are released properly -TYPE = DEFAULT -EXE1 = test4 -Description -= Test to see if threads blocked on a CRITICAL_SECTION object will -= be released in an orderly manner. This case looks at the following -= scenario. If one thread owns a CRITICAL_SECTION object and two threads -= block in EnterCriticalSection, trying to hold the already owned -= CRITICAL_SECTION object, when the first thread releases the CRITICAL_SECTION -= object, will one and only one of the waiters get unblocked? diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/CMakeLists.txt deleted file mode 100644 index 34ff67e6c801..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_criticalsectionfunctions_test5 - ${SOURCES} -) - -add_dependencies(paltest_criticalsectionfunctions_test5 coreclrpal) - -target_link_libraries(paltest_criticalsectionfunctions_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.cpp index c62a75d3f0f4..4556c082f67e 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.cpp @@ -12,51 +12,7 @@ **===================================================================*/ #include -/* - * Tokens 0 and 1 are events. Token 2 is the thread. - */ -#define NUM_TOKENS 3 - -HANDLE hToken[NUM_TOKENS]; -CRITICAL_SECTION CriticalSection; - -BOOL CleanupHelper (HANDLE *hArray, DWORD dwIndex) -{ - BOOL bCHRet; - - bCHRet = CloseHandle(hArray[dwIndex]); - if (!bCHRet) - { - Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%u'.\n", hArray[dwIndex], - GetLastError()); - } - - return (bCHRet); -} - -BOOL Cleanup(HANDLE *hArray, DWORD dwIndex) -{ - BOOL bCRet; - BOOL bCHRet = FALSE; - - while (--dwIndex > 0) - { - bCHRet = CleanupHelper(&hArray[0], dwIndex); - } - - bCRet = CloseHandle(hArray[0]); - if (!bCRet) - { - Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%u'.\n", hArray[dwIndex], - GetLastError()); - } - - return (bCRet&&bCHRet); -} - -DWORD PALAPI Thread(LPVOID lpParam) +DWORD PALAPI Thread_CriticalSectionFunctions_test5(LPVOID lpParam) { DWORD dwTRet; @@ -93,7 +49,7 @@ DWORD PALAPI Thread(LPVOID lpParam) return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CriticalSectionFunctions_test5_paltest_criticalsectionfunctions_test5, "threading/CriticalSectionFunctions/test5/paltest_criticalsectionfunctions_test5") { DWORD dwThreadId; DWORD dwMRet; @@ -125,7 +81,7 @@ int __cdecl main(int argc, char **argv) hToken[2] = CreateThread(NULL, 0, - &Thread, + &Thread_CriticalSectionFunctions_test5, (LPVOID) NULL, 0, &dwThreadId); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/testinfo.dat deleted file mode 100644 index c35fcf001912..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CriticalSectionFunctions -Name = Positive test for DeleteCriticalSection -TYPE = DEFAULT -EXE1 = test5 -Description -= Attempt to delete a critical section owned by another thread. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/CMakeLists.txt deleted file mode 100644 index 12f3239d6cb9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_criticalsectionfunctions_test6 - ${SOURCES} -) - -add_dependencies(paltest_criticalsectionfunctions_test6 coreclrpal) - -target_link_libraries(paltest_criticalsectionfunctions_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.cpp index b56bde195551..672637159c3d 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.cpp @@ -12,51 +12,8 @@ **===================================================================*/ #include -/* - * Tokens 0 and 1 are events. Token 2 is the thread. - */ -#define NUM_TOKENS 3 -HANDLE hToken[NUM_TOKENS]; -CRITICAL_SECTION CriticalSection; - -BOOL CleanupHelper (HANDLE *hArray, DWORD dwIndex) -{ - BOOL bCHRet; - - bCHRet = CloseHandle(hArray[dwIndex]); - if (!bCHRet) - { - Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%u'.\n", hArray[dwIndex], - GetLastError()); - } - - return (bCHRet); -} - -BOOL Cleanup(HANDLE *hArray, DWORD dwIndex) -{ - BOOL bCRet; - BOOL bCHRet; - - while (--dwIndex > 0) - { - bCHRet = CleanupHelper(&hArray[0], dwIndex); - } - - bCRet = CloseHandle(hArray[0]); - if (!bCRet) - { - Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%u'.\n", hArray[dwIndex], - GetLastError()); - } - - return (bCRet&&bCHRet); -} - -DWORD PALAPI Thread(LPVOID lpParam) +DWORD PALAPI Thread_CriticalSectionFunctions_test6(LPVOID lpParam) { DWORD dwTRet; @@ -93,7 +50,7 @@ DWORD PALAPI Thread(LPVOID lpParam) return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CriticalSectionFunctions_test6_paltest_criticalsectionfunctions_test6, "threading/CriticalSectionFunctions/test6/paltest_criticalsectionfunctions_test6") { DWORD dwThreadId; DWORD dwMRet; @@ -127,7 +84,7 @@ int __cdecl main(int argc, char **argv) hToken[2] = CreateThread(NULL, 0, - &Thread, + &Thread_CriticalSectionFunctions_test6, (LPVOID) NULL, 0, &dwThreadId); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/testinfo.dat deleted file mode 100644 index adeb1a18ce91..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CriticalSectionFunctions -Name = Positive Test for LeaveCriticalSection -TYPE = DEFAULT -EXE1 = test6 -Description -= Attempt to leave a critical section which is owned by another thread. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/CMakeLists.txt deleted file mode 100644 index 751bf68e77bc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_criticalsectionfunctions_test7 - ${SOURCES} -) - -add_dependencies(paltest_criticalsectionfunctions_test7 coreclrpal) - -target_link_libraries(paltest_criticalsectionfunctions_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.cpp index aa39ad6b4a9c..e4ad81364c4a 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.cpp @@ -12,51 +12,7 @@ **===================================================================*/ #include -/* - * Tokens 0 and 1 are events. Token 2 is the thread. - */ -#define NUM_TOKENS 3 - -HANDLE hToken[NUM_TOKENS]; -CRITICAL_SECTION CriticalSection; - -BOOL CleanupHelper (HANDLE *hArray, DWORD dwIndex) -{ - BOOL bCHRet; - - bCHRet = CloseHandle(hArray[dwIndex]); - if (!bCHRet) - { - Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%u'.\n", hArray[dwIndex], - GetLastError()); - } - - return (bCHRet); -} - -BOOL Cleanup(HANDLE *hArray, DWORD dwIndex) -{ - BOOL bCRet; - BOOL bCHRet = 0; - - while (--dwIndex > 0) - { - bCHRet = CleanupHelper(&hArray[0], dwIndex); - } - - bCRet = CloseHandle(hArray[0]); - if (!bCRet) - { - Trace("PALSUITE ERROR: Unable to execute CloseHandle(%p) during " - "clean up.\nGetLastError returned '%u'.\n", hArray[dwIndex], - GetLastError()); - } - - return (bCRet&&bCHRet); -} - -DWORD PALAPI Thread(LPVOID lpParam) +DWORD PALAPI Thread_CriticalSectionFunctions_test7(LPVOID lpParam) { DWORD dwTRet; @@ -93,7 +49,7 @@ DWORD PALAPI Thread(LPVOID lpParam) return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CriticalSectionFunctions_test7_paltest_criticalsectionfunctions_test7, "threading/CriticalSectionFunctions/test7/paltest_criticalsectionfunctions_test7") { DWORD dwThreadId; DWORD dwMRet; @@ -127,7 +83,7 @@ int __cdecl main(int argc, char **argv) hToken[2] = CreateThread(NULL, 0, - &Thread, + &Thread_CriticalSectionFunctions_test7, (LPVOID) NULL, 0, &dwThreadId); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/testinfo.dat deleted file mode 100644 index a14c248df2af..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = CriticalSectionFunctions -Name = Positive test for DeleteCriticalSection -TYPE = DEFAULT -EXE1 = test7 -Description -= Attempt to delete a critical section owned by the current thread. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/CMakeLists.txt deleted file mode 100644 index a008315da613..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_criticalsectionfunctions_test8 - ${SOURCES} -) - -add_dependencies(paltest_criticalsectionfunctions_test8 coreclrpal) - -target_link_libraries(paltest_criticalsectionfunctions_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.cpp index 239c4d5f3458..24f22afa456c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.cpp @@ -27,7 +27,7 @@ volatile LONG g_lCriticalCount = 0; HANDLE g_hEvStart = NULL; CRITICAL_SECTION g_cs; -DWORD PALAPI Thread(LPVOID lpParam) +DWORD PALAPI Thread_CriticalSectionFunctions_test8(LPVOID lpParam) { int i, j, iLpCnt; DWORD dwRet = 0; @@ -109,7 +109,7 @@ DWORD PALAPI Thread(LPVOID lpParam) return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_CriticalSectionFunctions_test8_paltest_criticalsectionfunctions_test8, "threading/CriticalSectionFunctions/test8/paltest_criticalsectionfunctions_test8") { DWORD dwThreadId; DWORD dwRet; @@ -175,7 +175,7 @@ int __cdecl main(int argc, char **argv) { hThreads[iThreadCount] = CreateThread(NULL, 0, - &Thread, + &Thread_CriticalSectionFunctions_test8, (LPVOID) NULL, 0, &dwThreadId); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/thistest.dat b/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/thistest.dat deleted file mode 100644 index 1057eca5c576..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/thistest.dat +++ /dev/null @@ -1,2 +0,0 @@ - -PAL,threading,palsuite\threading\criticalsectionfunctions\test8,Test8forCriticalSectionFunctionalities=test8.c, diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.cpp index 7e86ba15e1b4..fad9e2b1c081 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.cpp @@ -25,11 +25,13 @@ #define GETCALLCOUNT "_GetCallCount@0" #endif -DWORD PALAPI ThreadFunc(LPVOID lpParam); -int RunTest(int DisableThreadCalls); +DWORD PALAPI ThreadFunc_DisableThreadLibraryCalls_test1(LPVOID lpParam); +int RunTest_DisableThreadLibraryCalls_test1(int DisableThreadCalls); -int __cdecl main(int argc, char **argv) -{ +int __cdecl threading_DisableThreadLibraryCalls_test1(int argc, char* argv[]); +static PALTest threading_DisableThreadLibraryCalls_test1_lookup(threading_DisableThreadLibraryCalls_test1, "threading/DisableThreadLibraryCalls/test1"); +int __cdecl threading_DisableThreadLibraryCalls_test1(int argc, char* argv[]) +{ int ret; if ((PAL_Initialize(argc,argv)) != 0) @@ -54,7 +56,7 @@ int __cdecl main(int argc, char **argv) * Test once without calling DisableThreadLibraryCalls and make sure we * get expected results. */ - ret = RunTest(0); + ret = RunTest_DisableThreadLibraryCalls_test1(0); if (ret != 2) { Fail("Expected to get 2 thread library calls, got %d!\n", ret); @@ -64,7 +66,7 @@ int __cdecl main(int argc, char **argv) /* * Test again, this time calling DisableThreadLibraryCalls. */ - ret = RunTest(1); + ret = RunTest_DisableThreadLibraryCalls_test1(1); if (ret != 0) { Fail("Expected to get 0 thread library calls, got %d!\n", ret); @@ -77,7 +79,7 @@ int __cdecl main(int argc, char **argv) /* * Thread entry point. Doesn't do anything. */ -DWORD PALAPI ThreadFunc(LPVOID lpParam) +DWORD PALAPI ThreadFunc_DisableThreadLibraryCalls_test1(LPVOID lpParam) { return 0; } @@ -115,7 +117,7 @@ int RunTest(int DisableThreadCalls) } } - hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) ThreadFunc, + hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) ThreadFunc_DisableThreadLibraryCalls_test1, NULL, 0, &threadID); if (hThread == NULL) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.cpp deleted file mode 100644 index b9a6e6701394..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: dllmain1.c -** -** Purpose: Test to ensure DllMain() is called with THREAD_ATTACH -** when a thread in the application is started. -** -** Dependencies: none -** -** -**===========================================================================*/ - -#include - -/* count of the number of times DllMain() was called with THREAD_DETACH */ -static int g_attachCount = 0; - - -/* standard DllMain() */ -BOOL PALAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID lpvReserved) -{ - BOOL bResult = TRUE; - - switch( reason ) - { - case DLL_PROCESS_ATTACH: - { - break; - } - - case DLL_PROCESS_DETACH: - { - break; - } - - case DLL_THREAD_ATTACH: - /* increment g_attachCount */ - g_attachCount++; - break; - - case DLL_THREAD_DETACH: - break; - } - return bResult; -} - - -#ifdef WIN32 -BOOL PALAPI _DllMainCRTStartup(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - return DllMain(hinstDLL, fdwReason, lpvReserved); -} -#endif - -/* function to return the current attach count */ -#ifdef WIN32 -__declspec(dllexport) -#endif -int PALAPI GetAttachCount( void ) -{ - return g_attachCount; -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.cpp deleted file mode 100644 index 833fbe4155bc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Source: dllmain2.c -** -** Purpose: Test to ensure DllMain() is called with THREAD_ATTACH -** when a thread in the application is started. -** -** Dependencies: none -** -** -**===========================================================================*/ - -#include - -/* count of the number of times DllMain() was called with THREAD_DETACH */ -static int g_attachCount = 0; - - -/* standard DllMain() */ -BOOL PALAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID lpvReserved) -{ - BOOL bResult = TRUE; - - switch( reason ) - { - case DLL_PROCESS_ATTACH: - { - break; - } - - case DLL_PROCESS_DETACH: - { - break; - } - - case DLL_THREAD_ATTACH: - /* increment g_attachCount */ - g_attachCount++; - break; - - case DLL_THREAD_DETACH: - break; - } - return bResult; -} - - -#ifdef WIN32 -BOOL PALAPI _DllMainCRTStartup(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - return DllMain(hinstDLL, fdwReason, lpvReserved); -} -#endif - -/* function to return the current attach count */ -#ifdef WIN32 -__declspec(dllexport) -#endif -int PALAPI GetAttachCount( void ) -{ - return g_attachCount; -} diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.cpp index 448db98b8a6d..58fb4429f7a2 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.cpp @@ -46,7 +46,7 @@ typedef int ( PALAPI *LPTESTFUNC )( void ); * * Dummy thread function for causing DLL thread notifications. */ -DWORD PALAPI ThreadFunc( LPVOID param ) +DWORD PALAPI ThreadFunc_DisableThreadLibraryCalls_test2( LPVOID param ) { /* simulate some brief "work" */ int i; @@ -145,7 +145,7 @@ int __cdecl main( int argc, char **argv ) /* run another dummy thread to cause notification of the libraries */ hThread = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE) ThreadFunc, /* thread function */ + (LPTHREAD_START_ROUTINE) ThreadFunc_DisableThreadLibraryCalls_test2, /* thread function */ (LPVOID) NULL, /* pass thread index as */ /* function argument */ CREATE_SUSPENDED, /* create suspended */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/CMakeLists.txt deleted file mode 100644 index 21851e4c1e34..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test10) -add_subdirectory(test11) -add_subdirectory(test12) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) -add_subdirectory(test8) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/CMakeLists.txt deleted file mode 100644 index ddf7ca846edb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_duplicatehandle_test1 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test1 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.cpp index 15c0c22f77a8..241499e4d1cc 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.cpp @@ -14,7 +14,7 @@ **===================================================================*/ #include -int __cdecl main(int argc, char **argv) +PALTEST(threading_DuplicateHandle_test1_paltest_duplicatehandle_test1, "threading/DuplicateHandle/test1/paltest_duplicatehandle_test1") { HANDLE hFile; HANDLE hDupFile; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/testinfo.dat deleted file mode 100644 index c19896bb4187..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Positive Test for DuplicateHandle -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the DuplicateHandle function. -= This test will create two handles to file, one to write and -= one to read what was written. Test on a closed handle and a -= NULL handle, both should fail. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/CMakeLists.txt deleted file mode 100644 index 8a2b02bfd93f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test10.cpp -) - -add_executable(paltest_duplicatehandle_test10 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test10 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test10 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.cpp index 995670018926..2f1d27dec632 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.cpp @@ -21,12 +21,12 @@ enum wait_results WR_RELEASED }; - -volatile int t1_result=WR_WAITING; -volatile int t2_result=WR_WAITING; +volatile int t1_result_DuplicateHandle_test10=WR_WAITING; +volatile int t2_result_DuplicateHandle_test10=WR_WAITING; -DWORD PALAPI ThreadTest1(LPVOID lpParam) + +DWORD PALAPI ThreadTest1_DuplicateHandle_test10(LPVOID lpParam) { DWORD dwWait; @@ -34,24 +34,24 @@ DWORD PALAPI ThreadTest1(LPVOID lpParam) if (dwWait == WAIT_OBJECT_0) { /* tell the main thread we got the mutex */ - t1_result=WR_GOT_MUTEX; + t1_result_DuplicateHandle_test10=WR_GOT_MUTEX; /* wait for main thread to tell us to release the mutex */ - while(WR_GOT_MUTEX == t1_result) + while(WR_GOT_MUTEX == t1_result_DuplicateHandle_test10) Sleep(1); ReleaseSemaphore((HANDLE)lpParam, 1, NULL); /* tell the main thread we released the mutex */ - t1_result = WR_RELEASED; + t1_result_DuplicateHandle_test10 = WR_RELEASED; } else { - t1_result = WR_TIMED_OUT; + t1_result_DuplicateHandle_test10 = WR_TIMED_OUT; } return 0; } -DWORD PALAPI ThreadTest2(LPVOID lpParam) +DWORD PALAPI ThreadTest2_DuplicateHandle_test10(LPVOID lpParam) { DWORD dwWait; @@ -59,20 +59,20 @@ DWORD PALAPI ThreadTest2(LPVOID lpParam) if (dwWait == WAIT_OBJECT_0) { ReleaseSemaphore((HANDLE)lpParam, 1, NULL); - t2_result = WR_GOT_MUTEX; + t2_result_DuplicateHandle_test10 = WR_GOT_MUTEX; } else { - t2_result = WR_TIMED_OUT; + t2_result_DuplicateHandle_test10 = WR_TIMED_OUT; } return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_DuplicateHandle_test10_paltest_duplicatehandle_test10, "threading/DuplicateHandle/test10/paltest_duplicatehandle_test10") { - + HANDLE hDupSemaphore; HANDLE hSemaphore; HANDLE hThread; @@ -84,22 +84,24 @@ int __cdecl main(int argc, char **argv) { return(FAIL); } - - hSemaphore = CreateSemaphoreW( NULL, - 1, - 1, - NULL); - if (hSemaphore == NULL) + + hSemaphore = CreateSemaphoreExW( NULL, + 1, + 1, + NULL, + 0, + 0); + if (hSemaphore == NULL) { - Fail("PALSUITE ERROR:%u: Unable to create mutex\n", + Fail("PALSUITE ERROR:%u: Unable to create mutex\n", GetLastError()); } /*Create Duplicate of the Semaphore above*/ - bDupHandle = DuplicateHandle(GetCurrentProcess(), - hSemaphore, - GetCurrentProcess(), - &hDupSemaphore, + bDupHandle = DuplicateHandle(GetCurrentProcess(), + hSemaphore, + GetCurrentProcess(), + &hDupSemaphore, GENERIC_READ|GENERIC_WRITE, FALSE, DUPLICATE_SAME_ACCESS); @@ -113,10 +115,10 @@ int __cdecl main(int argc, char **argv) Fail(""); } - /*Create a thread to test the Semaphore*/ + /*Create a thread to test the Semaphore*/ hThread = CreateThread(NULL, 0, - &ThreadTest1, + &ThreadTest1_DuplicateHandle_test10, hSemaphore, 0, &dwThreadId); @@ -130,10 +132,10 @@ int __cdecl main(int argc, char **argv) } /* wait until thread has taken the mutex */ - while (WR_WAITING == t1_result) + while (WR_WAITING == t1_result_DuplicateHandle_test10) Sleep(1); - if(WR_TIMED_OUT == t1_result) + if(WR_TIMED_OUT == t1_result_DuplicateHandle_test10) { Trace("PALSUITE ERROR: %u: thread couldn't acquire the semaphore\n", GetLastError()); @@ -146,11 +148,11 @@ int __cdecl main(int argc, char **argv) /*Create a second thread to use the Semaphore's duplicate handle*/ /*This thread should block since the Semaphore is owned by another thread*/ - hThread2 = CreateThread(NULL, - 0, - &ThreadTest2, - hDupSemaphore, - 0, + hThread2 = CreateThread(NULL, + 0, + &ThreadTest2_DuplicateHandle_test10, + hDupSemaphore, + 0, &dwThreadId); if (hThread2 == NULL) @@ -162,15 +164,15 @@ int __cdecl main(int argc, char **argv) CloseHandle(hThread); Fail(""); } - + /* wait until thread has tried to take the mutex */ - while (WR_WAITING == t2_result) + while (WR_WAITING == t2_result_DuplicateHandle_test10) Sleep(1); - if (WR_TIMED_OUT != t2_result ) + if (WR_TIMED_OUT != t2_result_DuplicateHandle_test10 ) { Trace("PALSUITE ERROR:%u: Able to take mutex %#x while its " - "duplicate %#x is held\n", GetLastError(), hDupSemaphore, + "duplicate %#x is held\n", GetLastError(), hDupSemaphore, hSemaphore); CloseHandle(hSemaphore); CloseHandle(hDupSemaphore); @@ -180,25 +182,25 @@ int __cdecl main(int argc, char **argv) } /* reset second thread status */ - t2_result = WR_WAITING; + t2_result_DuplicateHandle_test10 = WR_WAITING; /* tell thread 1 to release the mutex */ - t1_result = WR_WAITING; + t1_result_DuplicateHandle_test10 = WR_WAITING; /* wait for thread 1 to release the mutex */ - while (WR_WAITING == t1_result) + while (WR_WAITING == t1_result_DuplicateHandle_test10) Sleep(1); - + CloseHandle(hThread2); /*Re-Create the second thread to reuse the duplicated Semaphore*/ - /*Since the Semaphore has since been released, the thread should + /*Since the Semaphore has since been released, the thread should put WR_GOT_MUTEX into t2_result */ - hThread2 = CreateThread(NULL, - 0, - &ThreadTest2, - hDupSemaphore, - 0, + hThread2 = CreateThread(NULL, + 0, + &ThreadTest2_DuplicateHandle_test10, + hDupSemaphore, + 0, &dwThreadId); if (hThread2 == NULL) @@ -210,15 +212,15 @@ int __cdecl main(int argc, char **argv) CloseHandle(hThread); Fail(""); } - + /* wait until thread has taken the semaphore */ - while (WR_WAITING == t2_result) + while (WR_WAITING == t2_result_DuplicateHandle_test10) Sleep(1); - if (WR_GOT_MUTEX != t2_result ) + if (WR_GOT_MUTEX != t2_result_DuplicateHandle_test10 ) { Trace("PALSUITE ERROR:%u: Unable to take semaphore %#x after its" - " duplicate %#x was released\n", GetLastError(), hDupSemaphore, + " duplicate %#x was released\n", GetLastError(), hDupSemaphore, hSemaphore); CloseHandle(hSemaphore); CloseHandle(hDupSemaphore); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/testinfo.dat deleted file mode 100644 index 875ab4f503f0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test10/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle (CreateSemaphore) -TYPE = DEFAULT -EXE1 = test10 -Description -= Tests the PAL implementation of the DuplicateHandle function. -= This test duplication of a Semaphore handle. The test will -= create a Semaphore and duplicate a handle to it. -= Then two subthreads will be used to verify that they can selectively -= block each other with different handles that refer to the -= same Semaphore diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/CMakeLists.txt deleted file mode 100644 index e30228a511ec..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test11.cpp -) - -add_executable(paltest_duplicatehandle_test11 - ${TESTSOURCES} -) - -add_dependencies(paltest_duplicatehandle_test11 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test11 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childprocess.cpp -) - -add_executable(paltest_duplicatehandle_test11_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_duplicatehandle_test11_child coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test11_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.cpp index 7ec6bcd05312..aafa76918ee3 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.cpp @@ -20,7 +20,7 @@ #include "myexitcode.h" -int __cdecl main( int argc, char **argv ) +PALTEST(threading_DuplicateHandle_test11_paltest_duplicatehandle_test11_child, "threading/DuplicateHandle/test11/paltest_duplicatehandle_test11_child") { HANDLE hMutex; WCHAR wszMutexName[] = { 'T','E','S','T','1','1','\0' }; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.cpp index c2182244e458..2efe1c66fb57 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.cpp @@ -35,40 +35,7 @@ #include #include "myexitcode.h" - -static const char* rgchPathDelim = "\\"; - - -int -mkAbsoluteFilename( LPSTR dirName, - DWORD dwDirLength, - LPCSTR fileName, - DWORD dwFileLength, - LPSTR absPathName ) -{ - DWORD sizeDN, sizeFN, sizeAPN; - - sizeDN = strlen( dirName ); - sizeFN = strlen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* ensure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - strncpy( absPathName, dirName, dwDirLength +1 ); - strncpy( absPathName, rgchPathDelim, 2 ); - strncpy( absPathName, fileName, dwFileLength +1 ); - - return (sizeAPN); - -} - - -int __cdecl main( int argc, char **argv ) - +PALTEST(threading_DuplicateHandle_test11_paltest_duplicatehandle_test11, "threading/DuplicateHandle/test11/paltest_duplicatehandle_test11") { const char* rgchChildFile = "childprocess"; @@ -151,9 +118,10 @@ int __cdecl main( int argc, char **argv ) "not build absolute path name to file\n. Exiting.\n" ); } + LPWSTR rgchAbsPathNameW = convert(rgchAbsPathName); /* launch the child process */ if( !CreateProcess( NULL, /* module name to execute */ - rgchAbsPathName, /* command line */ + rgchAbsPathNameW, /* command line */ NULL, /* process handle not */ /* inheritable */ NULL, /* thread handle not */ @@ -168,6 +136,7 @@ int __cdecl main( int argc, char **argv ) ) { dwError = GetLastError(); + free(rgchAbsPathNameW); if( ReleaseMutex( hMutex ) == 0 ) { Trace( "ERROR:%lu:ReleaseMutex() call failed\n", GetLastError() ); @@ -180,6 +149,8 @@ int __cdecl main( int argc, char **argv ) dwError ); } + free(rgchAbsPathNameW); + /* open another handle to the child process */ hChildProcess = OpenProcess( PROCESS_ALL_ACCESS, /* access */ FALSE, /* inheritable */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/testinfo.dat deleted file mode 100644 index b671dd6e60eb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test11/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = DuplicateHandle -Name = Test for DuplicateHandle -TYPE = DEFAULT -EXE1 = test11 -EXE2 = childprocess -Description -= Test to ensure proper operation of the DuplicateHandle API. -= The test launches a trivial child process, then opens -= a handle to it using OpenProcess. It then duplicates that -= handle and uses it to wait for the child process to terminate, -= and then checks the exit code of the child process in order to -= verify that it was in fact a handle to the correct= process. The test tries to duplicate the handle again after -= the process has been closed, to verify that failure ensues. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/CMakeLists.txt deleted file mode 100644 index d83e46e6da8d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test12.cpp -) - -add_executable(paltest_duplicatehandle_test12 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test12 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test12 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.cpp index e600c5e1d002..9711a3375edb 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.cpp @@ -13,7 +13,7 @@ **===================================================================*/ #include -int __cdecl main(int argc, char **argv) +PALTEST(threading_DuplicateHandle_test12_paltest_duplicatehandle_test12, "threading/DuplicateHandle/test12/paltest_duplicatehandle_test12") { HANDLE hFile; HANDLE hDupFile; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/testinfo.dat deleted file mode 100644 index 93bc1a64d754..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test12/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Positive Test for DuplicateHandle -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the DuplicateHandle function. -= This test will create handle to file (to write), -= then call duplicate handle, and close the original handle -= and then use duplicated handle to read what was written. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/CMakeLists.txt deleted file mode 100644 index e962a1191a3e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_duplicatehandle_test2 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test2 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.cpp index 9554b17118fc..ed766202189c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.cpp @@ -16,7 +16,7 @@ **===================================================================*/ #include -int __cdecl main(int argc, char **argv) +PALTEST(threading_DuplicateHandle_test2_paltest_duplicatehandle_test2, "threading/DuplicateHandle/test2/paltest_duplicatehandle_test2") { HANDLE hEvent; HANDLE hDupEvent; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/testinfo.dat deleted file mode 100644 index df07a395ac42..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test2/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle -TYPE = DEFAULT -EXE1 = test2 -Description -= Tests the PAL implementation of the DuplicateHandle function. -= This will test duplication of an CreateEvent handle. Test an -= event in a signaled state to wait, and then set the duplicate -= to nonsignaled state and perform the wait again. The wait on -= the event should fail. Test the duplication of closed and NULL -= events, these should fail. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/CMakeLists.txt deleted file mode 100644 index 172616ad4026..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_duplicatehandle_test3 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test3 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.cpp index 206438d22ad0..4852648471ab 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.cpp @@ -16,7 +16,7 @@ **===================================================================*/ #include -int __cdecl main(int argc, char **argv) +PALTEST(threading_DuplicateHandle_test3_paltest_duplicatehandle_test3, "threading/DuplicateHandle/test3/paltest_duplicatehandle_test3") { HANDLE hCreateEvent; HANDLE hOpenEvent; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/testinfo.dat deleted file mode 100644 index 61ff7c89788b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test3/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle -TYPE = DEFAULT -EXE1 = test3 -Description -= Tests the PAL implementation of the DuplicateHandle function. -= This will test duplication of an OpenEvent handle. Test an -= event in a signaled state to wait, and then set the duplicate -= to nonsignaled state and perform the wait again. The wait on -= the event should fail. Test the duplication of closed and NULL -= events, these should fail. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/CMakeLists.txt deleted file mode 100644 index 605365d3efcf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_duplicatehandle_test4 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test4 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.cpp index c1854cd370b0..e489f54aa5f6 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.cpp @@ -27,11 +27,11 @@ enum wait_results }; -volatile int t1_result=WR_WAITING; -volatile int t2_result=WR_WAITING; +volatile int t1_result_DuplicateHandle_test4=WR_WAITING; +volatile int t2_result_DuplicateHandle_test4=WR_WAITING; -DWORD PALAPI ThreadTest1(LPVOID lpParam) +DWORD PALAPI ThreadTest1_DuplicateHandle_test4(LPVOID lpParam) { DWORD dwWait; @@ -39,24 +39,24 @@ DWORD PALAPI ThreadTest1(LPVOID lpParam) if (dwWait == WAIT_OBJECT_0) { /* tell the main thread we got the mutex */ - t1_result=WR_GOT_MUTEX; + t1_result_DuplicateHandle_test4=WR_GOT_MUTEX; /* wait for main thread to tell us to release the mutex */ - while(WR_GOT_MUTEX == t1_result) + while(WR_GOT_MUTEX == t1_result_DuplicateHandle_test4) Sleep(1); ReleaseMutex((HANDLE)lpParam); /* tell the main thread we released the mutex */ - t1_result = WR_RELEASED; + t1_result_DuplicateHandle_test4 = WR_RELEASED; } else { - t1_result = WR_TIMED_OUT; + t1_result_DuplicateHandle_test4 = WR_TIMED_OUT; } return 0; } -DWORD PALAPI ThreadTest2(LPVOID lpParam) +DWORD PALAPI ThreadTest2_DuplicateHandle_test4(LPVOID lpParam) { DWORD dwWait; @@ -64,18 +64,18 @@ DWORD PALAPI ThreadTest2(LPVOID lpParam) if (dwWait == WAIT_OBJECT_0) { ReleaseMutex((HANDLE)lpParam); - t2_result = WR_GOT_MUTEX; + t2_result_DuplicateHandle_test4 = WR_GOT_MUTEX; } else { - t2_result = WR_TIMED_OUT; + t2_result_DuplicateHandle_test4 = WR_TIMED_OUT; } return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_DuplicateHandle_test4_paltest_duplicatehandle_test4, "threading/DuplicateHandle/test4/paltest_duplicatehandle_test4") { HANDLE hDupMutex; @@ -121,7 +121,7 @@ int __cdecl main(int argc, char **argv) /*Create a thread to test the Mutex*/ hThread = CreateThread(NULL, 0, - &ThreadTest1, + &ThreadTest1_DuplicateHandle_test4, hMutex, 0, &dwThreadId); @@ -135,10 +135,10 @@ int __cdecl main(int argc, char **argv) } /* wait until thread has taken the mutex */ - while (WR_WAITING == t1_result) + while (WR_WAITING == t1_result_DuplicateHandle_test4) Sleep(1); - if(WR_TIMED_OUT == t1_result) + if(WR_TIMED_OUT == t1_result_DuplicateHandle_test4) { Trace("ERROR: %u: thread 1 couldn't acquire the mutex\n"); CloseHandle(hMutex); @@ -151,7 +151,7 @@ int __cdecl main(int argc, char **argv) /*This should fail since the Mutex is owned hThread*/ hThread2 = CreateThread(NULL, 0, - &ThreadTest2, + &ThreadTest2_DuplicateHandle_test4, hDupMutex, 0, &dwThreadId); @@ -167,10 +167,10 @@ int __cdecl main(int argc, char **argv) } /* wait until thread has tried to take the mutex */ - while (WR_WAITING == t2_result) + while (WR_WAITING == t2_result_DuplicateHandle_test4) Sleep(1); - if (WR_TIMED_OUT != t2_result ) + if (WR_TIMED_OUT != t2_result_DuplicateHandle_test4 ) { Trace("ERROR:%u: Able to take mutex %#x while its duplicate %#x is " "held\n", hDupMutex, hMutex); @@ -182,13 +182,13 @@ int __cdecl main(int argc, char **argv) } /* reset second thread status */ - t2_result = WR_WAITING; + t2_result_DuplicateHandle_test4 = WR_WAITING; /* tell thread 1 to release the mutex */ - t1_result = WR_WAITING; + t1_result_DuplicateHandle_test4 = WR_WAITING; /* wait for thread 1 to release the mutex */ - while (WR_WAITING == t1_result) + while (WR_WAITING == t1_result_DuplicateHandle_test4) Sleep(1); CloseHandle(hThread2); @@ -197,7 +197,7 @@ int __cdecl main(int argc, char **argv) /*This test should pass, the Mutex has since been released*/ hThread2 = CreateThread(NULL, 0, - &ThreadTest2, + &ThreadTest2_DuplicateHandle_test4, hDupMutex, 0, &dwThreadId); @@ -213,10 +213,10 @@ int __cdecl main(int argc, char **argv) } /* wait until thread has taken the mutex */ - while (WR_WAITING == t2_result) + while (WR_WAITING == t2_result_DuplicateHandle_test4) Sleep(1); - if (WR_GOT_MUTEX != t2_result ) + if (WR_GOT_MUTEX != t2_result_DuplicateHandle_test4 ) { Trace("ERROR:%u: Unable to take mutex %#x after its duplicate %#x was " "released\n", hDupMutex, hMutex); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/testinfo.dat deleted file mode 100644 index accb13526994..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test4/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle (CreateMutex) -TYPE = DEFAULT -EXE1 = test4 -Description -= Tests the PAL implementation of the DuplicateHandle function. -= This test duplication of a Mutex handle. The test will comprise -= of creating a Mutex and its duplicate and create a thread that will -= get ownership. Another thread will be create that will attempt to -= get ownership of the duplicate Mutex, this will fail, since the -= Mutex is owned by another thread. The Mutex will be released and -= then the thread will attempt to get ownership of the duplicate -= Mutex, this will succeed. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/CMakeLists.txt deleted file mode 100644 index 9f4b8aa17d61..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_duplicatehandle_test5 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test5 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.cpp index a9eaa62daa35..1a21d6f3ccce 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.cpp @@ -19,9 +19,9 @@ #include -const char* cTestString = "one fish, two fish, red fish, blue fish."; +#define cTestString "one fish, two fish, read fish, blue fish." -int __cdecl main(int argc, char **argv) +PALTEST(threading_DuplicateHandle_test5_paltest_duplicatehandle_test5, "threading/DuplicateHandle/test5/paltest_duplicatehandle_test5") { HANDLE hReadPipe = NULL; HANDLE hWritePipe = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/testinfo.dat deleted file mode 100644 index 142a4674b984..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test5/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle (CreatePipe) -TYPE = DEFAULT -EXE1 = test5 -Description -= Tests the PAL implementation of the DuplicateHandle function, -= with CreatePipe. This test will create a pipe and write to it, -= then duplicate the read handle and read what was written. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/CMakeLists.txt deleted file mode 100644 index fa37e1c0e76c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_duplicatehandle_test6 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test6 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.cpp index a6a1b1f2579d..f3ceac6a2ba4 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.cpp @@ -20,9 +20,9 @@ #include -const char* cTestString = "one fish, two fish, red fish, blue fish."; +#define cTestString "one fish, two fish, read fish, blue fish." -int __cdecl main(int argc, char **argv) +PALTEST(threading_DuplicateHandle_test6_paltest_duplicatehandle_test6, "threading/DuplicateHandle/test6/paltest_duplicatehandle_test6") { HANDLE hReadPipe = NULL; HANDLE hWritePipe = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/testinfo.dat deleted file mode 100644 index 6ad1cf89f640..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test6/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle (CreatePipe) -TYPE = DEFAULT -EXE1 = test6 -Description -= Tests the PAL implementation of the DuplicateHandle function, -= with CreatePipe. This test will create a pipe, then duplicate -= the write handle, write to the handle, and use the read to -= verify. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/CMakeLists.txt deleted file mode 100644 index d3be5f2e5ed5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_duplicatehandle_test7 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test7 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.cpp index fa2f6c363635..d50b1bfb27c2 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.cpp @@ -16,14 +16,14 @@ #include -DWORD PALAPI CreateTestThread(LPVOID lpParam); +DWORD PALAPI CreateTestThread_DuplicateHandle_test7(LPVOID lpParam); -int __cdecl main(int argc, char* argv[]) +PALTEST(threading_DuplicateHandle_test7_paltest_duplicatehandle_test7, "threading/DuplicateHandle/test7/paltest_duplicatehandle_test7") { HANDLE hThread; HANDLE hDupThread; DWORD dwThreadId = 0; - LPTHREAD_START_ROUTINE lpStartAddress = &CreateTestThread; + LPTHREAD_START_ROUTINE lpStartAddress = &CreateTestThread_DuplicateHandle_test7; HANDLE hSyncEvent; int threadPriority; @@ -165,7 +165,7 @@ int __cdecl main(int argc, char* argv[]) } /*Thread testing function*/ -DWORD PALAPI CreateTestThread(LPVOID lpParam) +DWORD PALAPI CreateTestThread_DuplicateHandle_test7(LPVOID lpParam) { HANDLE hSyncEvent = (HANDLE)lpParam; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/testinfo.dat deleted file mode 100644 index d10d857c7db0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test7/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle (CreateThread) -TYPE = DEFAULT -EXE1 = test7 -Description -= Tests the PAL implementation of the DuplicateHandle function, -= with a handle from CreateThread. The test will create a thread -= handle and its duplicate. Then get the priorities of the threads, -= set the priority of one and the change should be seen in the -= other. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/CMakeLists.txt deleted file mode 100644 index 60ebe7a785b1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test8.cpp -) - -add_executable(paltest_duplicatehandle_test8 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test8 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test8 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.cpp index 47083e3cd0f8..e90fcd43f4b7 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.cpp @@ -16,15 +16,15 @@ #include -DWORD PALAPI CreateTestThread(LPVOID lpParam); +DWORD PALAPI CreateTestThread_DuplicateHandle_test8(LPVOID lpParam); -int __cdecl main(int argc, char* argv[]) +PALTEST(threading_DuplicateHandle_test8_paltest_duplicatehandle_test8, "threading/DuplicateHandle/test8/paltest_duplicatehandle_test8") { HANDLE hThread; HANDLE hCurrentThread; HANDLE hDupThread; DWORD dwThreadId = 0; - LPTHREAD_START_ROUTINE lpStartAddress = &CreateTestThread; + LPTHREAD_START_ROUTINE lpStartAddress = &CreateTestThread_DuplicateHandle_test8; int threadPriority; int duplicatePriority; @@ -157,7 +157,7 @@ int __cdecl main(int argc, char* argv[]) } /*Thread testing function, only return '0'*/ -DWORD PALAPI CreateTestThread(LPVOID lpParam) +DWORD PALAPI CreateTestThread_DuplicateHandle_test8(LPVOID lpParam) { return (DWORD)0; } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/testinfo.dat deleted file mode 100644 index 5340ffe92fa1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test8/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle (GetCurrentThread) -TYPE = DEFAULT -EXE1 = test8 -Description -=Tests the PAL implementation of the DuplicateHandle function, -=with a handle from GetCurrentThread. The test will create a thread -=handle, get the current thread and its duplicate. Then get the -=priorities of the threads, set the priority of one and the change -=should be seen in the other. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/CMakeLists.txt deleted file mode 100644 index 96aee8c926a8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test9.cpp -) - -add_executable(paltest_duplicatehandle_test9 - ${SOURCES} -) - -add_dependencies(paltest_duplicatehandle_test9 coreclrpal) - -target_link_libraries(paltest_duplicatehandle_test9 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.cpp b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.cpp index c223f9a4a6eb..e5a0abcc6cfc 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.cpp @@ -17,7 +17,7 @@ #include -int __cdecl main(int argc, char* argv[]) +PALTEST(threading_DuplicateHandle_test9_paltest_duplicatehandle_test9, "threading/DuplicateHandle/test9/paltest_duplicatehandle_test9") { HANDLE hProcess; HANDLE hDupProcess; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/testinfo.dat deleted file mode 100644 index 179eabc13ba4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/DuplicateHandle/test9/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = DuplicateHandle -Name = Test for DuplicateHandle (GetCurrentProcess) -TYPE = DEFAULT -EXE1 = test9 -Description -= Tests the PAL implementation of the DuplicateHandle function, -= with a handle from GetCurrentProcess. The test will create a -= process, duplicate it, then using ReadProcessMemory will -= read from the memory location of the CreateProcess process -= memory and the DuplicateHandle process memory. If the -= duplication is correct the memory will be the same for both. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/CMakeLists.txt deleted file mode 100644 index d243b82668a3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt deleted file mode 100644 index 2aae5fa16722..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ExitProcess.cpp -) - -add_executable(paltest_exitprocess_test1 - ${SOURCES} -) - -add_dependencies(paltest_exitprocess_test1 coreclrpal) - -target_link_libraries(paltest_exitprocess_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.cpp index 74e41afe3514..b25a54f804a2 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.cpp @@ -13,7 +13,7 @@ #include -int __cdecl main( int argc, char **argv ) +PALTEST(threading_ExitProcess_test1_paltest_exitprocess_test1, "threading/ExitProcess/test1/paltest_exitprocess_test1") { diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/testinfo.dat deleted file mode 100644 index 61906c783931..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ExitProcess -Name = Positive Test for ExitProcess -TYPE = DEFAULT -EXE1 = exitprocess -Description -= Test the ExitProcess function. The test runs the ExitProcess function -= with the TEST_RETURN enumeration value PASS diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt deleted file mode 100644 index e9022f892ac2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_exitprocess_test2 - ${SOURCES} -) - -add_dependencies(paltest_exitprocess_test2 coreclrpal) - -target_link_libraries(paltest_exitprocess_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.cpp index 58698c1dc866..0fa74fcbed22 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.cpp @@ -16,7 +16,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_ExitProcess_test2_paltest_exitprocess_test2, "threading/ExitProcess/test2/paltest_exitprocess_test2") { /* call ExitProcess() -- should work without PAL_Initialize() */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/testinfo.dat deleted file mode 100644 index 0a1dd2be8c88..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ExitProcess -Name = Positive test for ExitProcess -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to ensure proper operation of the ExitProcess() -= API by ensuring it works before PAL_Initialize() is -= called. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt deleted file mode 100644 index c4ede3cf8930..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_exitprocess_test3 - ${SOURCES} -) - -add_dependencies(paltest_exitprocess_test3 coreclrpal) - -target_link_libraries(paltest_exitprocess_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.cpp index 6b3f4afc5388..74671b3a21cb 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.cpp @@ -17,7 +17,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_ExitProcess_test3_paltest_exitprocess_test3, "threading/ExitProcess/test3/paltest_exitprocess_test3") { /* initialize the PAL */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/testinfo.dat deleted file mode 100644 index 3bdc45cd2d5e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitProcess/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ExitProcess -Name = Positive test for ExitProcess -TYPE = DEFAULT -EXE1 = test3 -Description -= Test to ensure proper operation of the ExitProcess() -= API by ensuring it works after PAL_Terminate() is -= called. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/CMakeLists.txt deleted file mode 100644 index 710ddaa6dd64..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_exitthread_test1 - ${SOURCES} -) - -add_dependencies(paltest_exitthread_test1 coreclrpal) - -target_link_libraries(paltest_exitthread_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/test1.cpp index 9cdfe6fcde6f..084ddc504b47 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/test1.cpp @@ -96,7 +96,7 @@ BOOL ExitThreadTest() return bRet; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_ExitThread_test1_paltest_exitthread_test1, "threading/ExitThread/test1/paltest_exitthread_test1") { if(0 != (PAL_Initialize(argc, argv))) { diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/testinfo.dat deleted file mode 100644 index 7b1f6cdec309..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ExitThread -Name = Positive Test for ExitThread -TYPE = DEFAULT -EXE1 = test1 -Description -= Test for ExitThread. Create a thread and then call -= exit thread within the threading function. Ensure that it exits -= immediatly. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/CMakeLists.txt deleted file mode 100644 index 5a3d672594c4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test2.cpp -) - -add_executable(paltest_exitthread_test2 - ${TESTSOURCES} -) - -add_dependencies(paltest_exitthread_test2 coreclrpal) - -target_link_libraries(paltest_exitthread_test2 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childprocess.cpp -) - -add_executable(paltest_exitthread_test2_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_exitthread_test2_child coreclrpal) - -target_link_libraries(paltest_exitthread_test2_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.cpp index ea439628ad9e..2cd743fbd377 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.cpp @@ -19,7 +19,7 @@ #include #include "myexitcode.h" -int __cdecl main( int argc, char **argv ) +PALTEST(threading_ExitThread_test2_paltest_exitthread_test2_child, "threading/ExitThread/test2/paltest_exitthread_test2_child") { /* initialize the PAL */ if( PAL_Initialize(argc, argv) != 0 ) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/test2.cpp index 6de6d2fbdb35..4b9418d859ed 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/test2.cpp @@ -8,7 +8,7 @@ ** Purpose: Test to ensure ExitThread() called from the last thread of ** a process shuts down that process and returns the proper ** exit code as specified in the ExitThread() call. -** +** ** Dependencies: PAL_Initialize ** PAL_Terminate ** Fail @@ -19,50 +19,17 @@ ** GetLastError ** strlen ** strncpy -** +** ** **===========================================================================*/ #include #include "myexitcode.h" - -static const char* rgchPathDelim = "\\"; - - -int -mkAbsoluteFilename( LPSTR dirName, - DWORD dwDirLength, - LPCSTR fileName, - DWORD dwFileLength, - LPSTR absPathName ) -{ - DWORD sizeDN, sizeFN, sizeAPN; - - sizeDN = strlen( dirName ); - sizeFN = strlen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* ensure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - strncpy( absPathName, dirName, dwDirLength +1 ); - strncpy( absPathName, rgchPathDelim, 2 ); - strncpy( absPathName, fileName, dwFileLength +1 ); - - return (sizeAPN); - -} - - -int __cdecl main( int argc, char **argv ) - +PALTEST(threading_ExitThread_test2_paltest_exitthread_test2, "threading/ExitThread/test2/paltest_exitthread_test2") { const char* rgchChildFile = "childprocess"; - + STARTUPINFO si; PROCESS_INFORMATION pi; @@ -72,8 +39,8 @@ int __cdecl main( int argc, char **argv ) DWORD dwDirLength; DWORD dwSize; DWORD dwExpected = TEST_EXIT_CODE; - - char rgchDirName[_MAX_DIR]; + + char rgchDirName[_MAX_DIR]; char absPathBuf[_MAX_PATH]; char* rgchAbsPathName; @@ -82,38 +49,39 @@ int __cdecl main( int argc, char **argv ) { return( FAIL ); } - + /* zero our process and startup info structures */ ZeroMemory( &si, sizeof(si) ); si.cb = sizeof( si ); ZeroMemory( &pi, sizeof(pi) ); - + /* build the absolute path to the child process */ rgchAbsPathName = &absPathBuf[0]; dwFileLength = strlen( rgchChildFile ); - + dwDirLength = GetCurrentDirectory( _MAX_PATH, rgchDirName ); - if( dwDirLength == 0 ) + if( dwDirLength == 0 ) { dwError = GetLastError(); - Fail( "GetCurrentDirectory call failed with error code %d\n", - dwError ); + Fail( "GetCurrentDirectory call failed with error code %d\n", + dwError ); } dwSize = mkAbsoluteFilename( rgchDirName, dwDirLength, - rgchChildFile, + rgchChildFile, dwFileLength, rgchAbsPathName ); if( dwSize == 0 ) { - Fail( "Palsuite Code: mkAbsoluteFilename() call failed. Could ", - "not build absolute path name to file\n. Exiting.\n" ); + Fail( "Palsuite Code: mkAbsoluteFilename() call failed. Could ", + "not build absolute path name to file\n. Exiting.\n" ); } + LPWSTR rgchAbsPathNameW = convert(rgchAbsPathName); /* launch the child process */ if( !CreateProcess( NULL, /* module name to execute */ - rgchAbsPathName, /* command line */ + rgchAbsPathNameW, /* command line */ NULL, /* process handle not */ /* inheritable */ NULL, /* thread handle not */ @@ -128,10 +96,13 @@ int __cdecl main( int argc, char **argv ) ) { dwError = GetLastError(); - Fail( "CreateProcess call failed with error code %d\n", - dwError ); + free(rgchAbsPathNameW); + Fail( "CreateProcess call failed with error code %d\n", + dwError ); } - + + free(rgchAbsPathNameW); + /* wait for the child process to complete */ WaitForSingleObject ( pi.hProcess, INFINITE ); @@ -141,27 +112,27 @@ int __cdecl main( int argc, char **argv ) dwError = GetLastError(); CloseHandle ( pi.hProcess ); CloseHandle ( pi.hThread ); - Fail( "GetExitCodeProcess call failed with error code %d\n", - dwError ); + Fail( "GetExitCodeProcess call failed with error code %d\n", + dwError ); } - + /* close process and thread handle */ CloseHandle ( pi.hProcess ); CloseHandle ( pi.hThread ); - + /* check for the expected exit code */ /* exit code for some systems is as small as a char, so that's all */ /* we'll compare for checking success */ if( LOBYTE(LOWORD(dwExitCode)) != LOBYTE(LOWORD(dwExpected)) ) { Fail( "GetExitCodeProcess returned an incorrect exit code %d, " - "expected value is %d\n", - LOWORD(dwExitCode), dwExpected ); + "expected value is %d\n", + LOWORD(dwExitCode), dwExpected ); } /* terminate the PAL */ PAL_Terminate(); - + /* return success */ - return PASS; + return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/testinfo.dat deleted file mode 100644 index dbda37f8246d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test2/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ExitThread -Name = Test for ExitThread -TYPE = DEFAULT -EXE1 = test2 -EXE2 = childprocess -Description -= Test to ensure proper operation of the ExitThread -= API. This test launches a simple child process that exits -= by calling ExitThread() with a known value, and checks -= that the correct value is returned to the parent process. -= This verifies that when the last thread of a process exits -= via ExitThread, the process exits with the proper return -= code. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test3/test3.cpp index 034bbf48be9e..473edde728e5 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ExitThread/test3/test3.cpp @@ -47,7 +47,7 @@ typedef int ( PALAPI *LPTESTFUNC )( void ); * * Dummy thread function for causing DLL thread notifications. */ -DWORD PALAPI ThreadFunc( LPVOID param ) +DWORD PALAPI ThreadFunc_ExitThread_test3( LPVOID param ) { /* simulate some brief "work" */ int i; @@ -108,7 +108,7 @@ int __cdecl main( int argc, char **argv ) /* run another dummy thread to cause notification of the library */ hThread = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE) ThreadFunc, /* thread function */ + (LPTHREAD_START_ROUTINE) ThreadFunc_ExitThread_test3, /* thread function */ (LPVOID) NULL, /* pass thread index as */ /* function argument */ CREATE_SUSPENDED, /* create suspended */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt deleted file mode 100644 index 3a8efb8abc1a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - process.cpp -) - -add_executable(paltest_getcurrentprocess_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcurrentprocess_test1 coreclrpal) - -target_link_libraries(paltest_getcurrentprocess_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.cpp index 4a05dc80b29d..b7708d024fed 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.cpp @@ -15,7 +15,7 @@ #include -INT __cdecl main( int argc, char **argv ) +PALTEST(threading_GetCurrentProcess_test1_paltest_getcurrentprocess_test1, "threading/GetCurrentProcess/test1/paltest_getcurrentprocess_test1") { HANDLE hProcess; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/testinfo.dat deleted file mode 100644 index f930e4c75dba..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = GetCurrentProcess -Name = Positive Test for GetCurrentProcess -TYPE = DEFAULT -EXE1 = process -Description -= Test to see if the function GetCurrentProcess returns a handle to the -= current process or not. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/CMakeLists.txt deleted file mode 100644 index bb650f960705..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - processId.cpp -) - -add_executable(paltest_getcurrentprocessid_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcurrentprocessid_test1 coreclrpal) - -target_link_libraries(paltest_getcurrentprocessid_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.cpp index 879292013857..57dc8818faab 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.cpp @@ -14,7 +14,7 @@ #include -INT __cdecl main( int argc, char **argv ) +PALTEST(threading_GetCurrentProcessId_test1_paltest_getcurrentprocessid_test1, "threading/GetCurrentProcessId/test1/paltest_getcurrentprocessid_test1") { DWORD dwProcessId; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/testinfo.dat deleted file mode 100644 index 8bdc0e414de8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = GetCurrentProcessId -Name = Positive Test for GetCurrentProcessId -TYPE = DEFAULT -EXE1 = processid -Description -= Test to ensure GetCurrentProcessId returns the current process id number. -= This test compares the result of GetCurrentProcessId to getpid. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/CMakeLists.txt deleted file mode 100644 index aba630f0fb98..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - thread.cpp -) - -add_executable(paltest_getcurrentthread_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcurrentthread_test1 coreclrpal) - -target_link_libraries(paltest_getcurrentthread_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/testinfo.dat deleted file mode 100644 index c11cba188f5a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = GetCurrentThread -Name = Positive Test for GetCurrentThread -TYPE = DEFAULT -EXE1 = thread -Description -= Test to ensure GetCurrentThread returns a handle to the current thread. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.cpp index d19e18f90369..c0e4f25203ae 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.cpp @@ -19,7 +19,7 @@ #include -int __cdecl main( int argc, char **argv ) +PALTEST(threading_GetCurrentThread_test1_paltest_getcurrentthread_test1, "threading/GetCurrentThread/test1/paltest_getcurrentthread_test1") { HANDLE hThread; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/CMakeLists.txt deleted file mode 100644 index b73f90e271a5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_getcurrentthread_test2 - ${SOURCES} -) - -add_dependencies(paltest_getcurrentthread_test2 coreclrpal) - -target_link_libraries(paltest_getcurrentthread_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.cpp index 3598437b4426..ad5d5c27a385 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.cpp @@ -42,7 +42,7 @@ static int g_priority = 0; * Thread function that calls GetCurrentThread() to get a pseudo-handle * to itself, then checks its priority and exits with that value. */ -DWORD PALAPI ThreadFunc( LPVOID param ) +DWORD PALAPI ThreadFunc_GetCurrentThread_test2( LPVOID param ) { int priority; HANDLE hThread; @@ -75,7 +75,7 @@ DWORD PALAPI ThreadFunc( LPVOID param ) * * executable entry point */ -INT __cdecl main( INT argc, CHAR **argv ) +PALTEST(threading_GetCurrentThread_test2_paltest_getcurrentthread_test2, "threading/GetCurrentThread/test2/paltest_getcurrentthread_test2") { HANDLE hThread = NULL; DWORD IDThread; @@ -98,7 +98,7 @@ INT __cdecl main( INT argc, CHAR **argv ) /* Create multiple threads. */ hThread = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE) ThreadFunc, /* thread function */ + (LPTHREAD_START_ROUTINE) ThreadFunc_GetCurrentThread_test2, /* thread function */ (LPVOID) i, /* pass thread index as */ /* function argument */ CREATE_SUSPENDED, /* create suspended */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/testinfo.dat deleted file mode 100644 index 437dcfcdc0d0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThread/test2/testinfo.dat +++ /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. - -Version = 1.0 -Section = threading -Function = GetCurrentThread -Name = Test for GetCurrentThread -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to ensure proper operation of the GetCurrentThread() -= API. The test launches a thread in suspended mode, and sets -= its priority to a non-default value using the handle returned -= by CreateThread(). The new thread calls GetCurrentThred() to -= retrieve a handle to itself, and calls GetThreadPriority() -= to verify that its priority matches what it was set to on -= the main execution thread. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/CMakeLists.txt deleted file mode 100644 index 93ddf44a36ce..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - threadId.cpp -) - -add_executable(paltest_getcurrentthreadid_test1 - ${SOURCES} -) - -add_dependencies(paltest_getcurrentthreadid_test1 coreclrpal) - -target_link_libraries(paltest_getcurrentthreadid_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/testinfo.dat deleted file mode 100644 index 44dec989648b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = GetCurrentThreadId -Name = Positive Test for GetCurrentThreadId -TYPE = DEFAULT -EXE1 = threadid -Description -= Test to ensure GetCurrentThreadId returns the threadId of the current -= thread. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.cpp index 8288f93aa70c..e8c90ebd955e 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.cpp @@ -28,7 +28,7 @@ DWORD PALAPI ThreadFunction ( LPVOID lpParam ) return 0; } -int __cdecl main( int argc, char **argv ) +PALTEST(threading_GetCurrentThreadId_test1_paltest_getcurrentthreadid_test1, "threading/GetCurrentThreadId/test1/paltest_getcurrentthreadid_test1") { extern DWORD dwThreadIdTF; DWORD dwThreadIdCT; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/CMakeLists.txt deleted file mode 100644 index 2cf8b3c0d682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test1.cpp -) - -add_executable(paltest_getexitcodeprocess_test1 - ${TESTSOURCES} -) - -add_dependencies(paltest_getexitcodeprocess_test1 coreclrpal) - -target_link_libraries(paltest_getexitcodeprocess_test1 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childProcess.cpp -) - -add_executable(paltest_getexitcodeprocess_test1_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_getexitcodeprocess_test1_child coreclrpal) - -target_link_libraries(paltest_getexitcodeprocess_test1_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.cpp index 4ee5f0a194b6..4848bb499804 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.cpp @@ -16,8 +16,9 @@ #include #include "myexitcode.h" +#include -int __cdecl main( int argc, char **argv ) +PALTEST(threading_GetExitCodeProcess_test1_paltest_getexitcodeprocess_test1_child, "threading/GetExitCodeProcess/test1/paltest_getexitcodeprocess_test1_child") { int i; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.cpp index dff574cadf30..cfce4169bf5c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.cpp @@ -6,7 +6,7 @@ ** Source: test1.c ** ** Purpose: Test to ensure GetExitCodeProcess works properly. -** +** ** Dependencies: PAL_Initialize ** PAL_Terminate ** Fail @@ -17,50 +17,17 @@ ** GetLastError ** strlen ** strncpy -** +** ** **===========================================================================*/ #include #include "myexitcode.h" - -static const char* rgchPathDelim = "\\"; - - -int -mkAbsoluteFilename( LPSTR dirName, - DWORD dwDirLength, - LPCSTR fileName, - DWORD dwFileLength, - LPSTR absPathName ) -{ - DWORD sizeDN, sizeFN, sizeAPN; - - sizeDN = strlen( dirName ); - sizeFN = strlen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* ensure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - strncpy( absPathName, dirName, dwDirLength +1 ); - strncpy( absPathName, rgchPathDelim, 2 ); - strncpy( absPathName, fileName, dwFileLength +1 ); - - return (sizeAPN); - -} - - -int __cdecl main( int argc, char **argv ) - +PALTEST(threading_GetExitCodeProcess_test1_paltest_getexitcodeprocess_test1, "threading/GetExitCodeProcess/test1/paltest_getexitcodeprocess_test1") { const char* rgchChildFile = "childprocess"; - + STARTUPINFO si; PROCESS_INFORMATION pi; @@ -69,8 +36,8 @@ int __cdecl main( int argc, char **argv ) DWORD dwFileLength; DWORD dwDirLength; DWORD dwSize; - - char rgchDirName[_MAX_DIR]; + + char rgchDirName[_MAX_DIR]; char absPathBuf[_MAX_PATH]; char* rgchAbsPathName; @@ -79,38 +46,39 @@ int __cdecl main( int argc, char **argv ) { return( FAIL ); } - + /* zero our process and startup info structures */ ZeroMemory( &si, sizeof(si) ); si.cb = sizeof( si ); ZeroMemory( &pi, sizeof(pi) ); - + /* build the absolute path to the child process */ rgchAbsPathName = &absPathBuf[0]; dwFileLength = strlen( rgchChildFile ); - + dwDirLength = GetCurrentDirectory( _MAX_PATH, rgchDirName ); - if( dwDirLength == 0 ) + if( dwDirLength == 0 ) { dwError = GetLastError(); - Fail( "GetCurrentDirectory call failed with error code %d\n", - dwError ); + Fail( "GetCurrentDirectory call failed with error code %d\n", + dwError ); } dwSize = mkAbsoluteFilename( rgchDirName, dwDirLength, - rgchChildFile, + rgchChildFile, dwFileLength, rgchAbsPathName ); if( dwSize == 0 ) { - Fail( "Palsuite Code: mkAbsoluteFilename() call failed. Could ", - "not build absolute path name to file\n. Exiting.\n" ); + Fail( "Palsuite Code: mkAbsoluteFilename() call failed. Could ", + "not build absolute path name to file\n. Exiting.\n" ); } + LPWSTR rgchAbsPathNameW = convert(rgchAbsPathName); /* launch the child process */ if( !CreateProcess( NULL, /* module name to execute */ - rgchAbsPathName, /* command line */ + rgchAbsPathNameW, /* command line */ NULL, /* process handle not */ /* inheritable */ NULL, /* thread handle not */ @@ -125,10 +93,13 @@ int __cdecl main( int argc, char **argv ) ) { dwError = GetLastError(); - Fail( "CreateProcess call failed with error code %d\n", - dwError ); + free(rgchAbsPathNameW); + Fail( "CreateProcess call failed with error code %d\n", + dwError ); } - + + free(rgchAbsPathNameW); + /* wait for the child process to complete */ WaitForSingleObject ( pi.hProcess, INFINITE ); @@ -138,25 +109,25 @@ int __cdecl main( int argc, char **argv ) dwError = GetLastError(); CloseHandle ( pi.hProcess ); CloseHandle ( pi.hThread ); - Fail( "GetExitCodeProcess call failed with error code %d\n", - dwError ); + Fail( "GetExitCodeProcess call failed with error code %d\n", + dwError ); } - + /* close process and thread handle */ CloseHandle ( pi.hProcess ); CloseHandle ( pi.hThread ); - + /* check for the expected exit code */ if( dwExitCode != TEST_EXIT_CODE ) { Fail( "GetExitCodeProcess returned an incorrect exit code %d, " - "expected value is %d\n", - dwExitCode, TEST_EXIT_CODE ); + "expected value is %d\n", + dwExitCode, TEST_EXIT_CODE ); } /* terminate the PAL */ PAL_Terminate(); - + /* return success */ - return PASS; + return PASS; } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/testinfo.dat deleted file mode 100644 index b015aee999af..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = GetExitCodeProcess -Name = Test for GetExitCodeProcess -TYPE = DEFAULT -EXE1 = test1 -EXE2 = childprocess -Description -= Test to ensure proper operation of the GetExitCodeProcess -= API. This test launches a simple child process that exits -= with a known value, and checks that the correct value is -= returned by the function. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/CMakeLists.txt deleted file mode 100644 index 174958dc70fd..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/CMakeLists.txt deleted file mode 100644 index 9bcd6b7fa18e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_getprocesstimes_test2 - ${SOURCES} -) - -add_dependencies(paltest_getprocesstimes_test2 coreclrpal) - -target_link_libraries(paltest_getprocesstimes_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.cpp index 410f63793ad4..7c1c7a10f656 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.cpp @@ -20,7 +20,7 @@ #include -int __cdecl main( int argc, char **argv ) +PALTEST(threading_GetProcessTimes_test2_paltest_getprocesstimes_test2, "threading/GetProcessTimes/test2/paltest_getprocesstimes_test2") { int i, j, k; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/testinfo.dat deleted file mode 100644 index 71871ab36fa0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetProcessTimes/test2/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = GetProcessTimes -Name = Test for GetProcessTimes -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to ensure proper operation of the GetProcessTimes() -= API. This test simply checks the kernel/user times for the -= the current process, which is the only thing supported -= for this function under the PAL. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/test1/CMakeLists.txt deleted file mode 100644 index 91581de4641c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_getthreadtimes_test1 - ${SOURCES} -) - -add_dependencies(paltest_getthreadtimes_test1 coreclrpal) - -target_link_libraries(paltest_getthreadtimes_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.cpp index 3d91bfaecb4c..255fab77642c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.cpp @@ -14,7 +14,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(threading_GetThreadTimes_test1_paltest_getthreadtimes_test1, "threading/GetThreadTimes/test1/paltest_getthreadtimes_test1") +{ int ret = FAIL; //Test is failing unreliably, so for now we always return pass. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/CMakeLists.txt deleted file mode 100644 index 5199246aec03..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(SOURCES - namedmutex.cpp - nopal.cpp -) - -add_executable(paltest_namedmutex_test1 - ${SOURCES} -) - -add_dependencies(paltest_namedmutex_test1 coreclrpal) - -target_link_libraries(paltest_namedmutex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp b/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp index 89e9e85a86c4..7956a955455c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp @@ -177,7 +177,9 @@ class AutoCloseMutexHandle void TestCreateMutex(AutoCloseMutexHandle &m, const char *name, bool initiallyOwned = false) { m.Close(); - m = CreateMutexA(nullptr, initiallyOwned, name); + LPWSTR nameW = convert(name); + m = CreateMutex(nullptr, initiallyOwned, nameW); + free(nameW); } HANDLE TestOpenMutex(const char *name) @@ -195,6 +197,8 @@ bool StartProcess(const char *funcName) processCommandLinePathLength += test_strlen(g_processPath); g_processCommandLinePath[processCommandLinePathLength++] = '\"'; g_processCommandLinePath[processCommandLinePathLength++] = ' '; + processCommandLinePathLength += test_sprintf(&g_processCommandLinePath[processCommandLinePathLength], "%s ", "threading/NamedMutex/test1/paltest_namedmutex_test1"); + processCommandLinePathLength += test_sprintf(&g_processCommandLinePath[processCommandLinePathLength], "%u", g_parentPid); g_processCommandLinePath[processCommandLinePathLength++] = ' '; test_strcpy(&g_processCommandLinePath[processCommandLinePathLength], funcName); @@ -211,10 +215,14 @@ bool StartProcess(const char *funcName) si.cb = sizeof(si); PROCESS_INFORMATION pi; memset(&pi, 0, sizeof(pi)); - if (!CreateProcessA(nullptr, g_processCommandLinePath, nullptr, nullptr, false, 0, nullptr, nullptr, &si, &pi)) + LPWSTR nameW = convert(g_processCommandLinePath); + if (!CreateProcessW(nullptr, nameW, nullptr, nullptr, false, 0, nullptr, nullptr, &si, &pi)) { + free(nameW); return false; } + + free(nameW); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); return true; @@ -841,7 +849,7 @@ DWORD AbandonTests_Child_AbruptExit(void *arg = nullptr) // This child process acquires the mutex lock, creates another child process (to ensure that file locks are not inherited), and // abandons the mutex abruptly. The second child process detects the abandonment and abandons the mutex again for the parent to -// detect. Issue: https://github.com/dotnet/coreclr/issues/21455 +// detect. Issue: https://github.com/dotnet/runtime/issues/11636 DWORD AbandonTests_Child_FileLocksNotInherited_Parent_AbruptExit(void *arg = nullptr) { const char *testName = "AbandonTests"; @@ -1182,7 +1190,7 @@ bool StressTests(DWORD durationMinutes) return static_cast(g_stressResult); } -int __cdecl main(int argc, char **argv) +PALTEST(threading_NamedMutex_test1_paltest_namedmutex_test1, "threading/NamedMutex/test1/paltest_namedmutex_test1") { if (argc < 1 || argc > 4) { diff --git a/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/testinfo.dat deleted file mode 100644 index a1b6aab6a26d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/NamedMutex/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = Named mutex -Name = Tests for named mutexes -TYPE = DEFAULT -EXE1 = namedmutex -Description -= These test cases test named mutexes, including positive -= and negative cases, cross-thread and cross-process, mutual -= exclusion, abandon detection, etc. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/CMakeLists.txt deleted file mode 100644 index dcf480bf226b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/CMakeLists.txt deleted file mode 100644 index a33d65defdd4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_openeventw_test1 - ${SOURCES} -) - -add_dependencies(paltest_openeventw_test1 coreclrpal) - -target_link_libraries(paltest_openeventw_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/test1.cpp index b143faac7bfd..3b119acaf8aa 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/test1.cpp @@ -14,7 +14,7 @@ **==========================================================================*/ #include -int __cdecl main(int argc, char **argv) +PALTEST(threading_OpenEventW_test1_paltest_openeventw_test1, "threading/OpenEventW/test1/paltest_openeventw_test1") { BOOL bRet = FAIL; DWORD dwRet; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/testinfo.dat deleted file mode 100644 index 12393a714da7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = OpenEventW -Name = Positive Test for OpenEventW -TYPE = DEFAULT -EXE1 = test1 -Description -= Purpose: Test for OpenEventW. This test creates an event, -= opens a handle to the same event, then waits on both handles -= in both a signalled and non-signalled state to verify they're -= pointing to the same event object. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/CMakeLists.txt deleted file mode 100644 index 96fb22fc67c3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_openeventw_test2 - ${SOURCES} -) - -add_dependencies(paltest_openeventw_test2 coreclrpal) - -target_link_libraries(paltest_openeventw_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/test2.cpp index 0edffc457255..4a2ac38e72dd 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/test2.cpp @@ -28,7 +28,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_OpenEventW_test2_paltest_openeventw_test2, "threading/OpenEventW/test2/paltest_openeventw_test2") { /* local variables */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/testinfo.dat deleted file mode 100644 index 0e1fac095935..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test2/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = OpenEventW -Name = Positive test for OpenEventW -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to ensure proper operation of the OpenEventW() -= API by creating a new named event and verifying that -= it can be used interchangeably by setting the event -= with the original handle and waiting on it with the -= new one, then resetting it with the new one and waiting -= on it with the original one. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/CMakeLists.txt deleted file mode 100644 index 4d95f7225cf8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test3.cpp -) - -add_executable(paltest_openeventw_test3 - ${TESTSOURCES} -) - -add_dependencies(paltest_openeventw_test3 coreclrpal) - -target_link_libraries(paltest_openeventw_test3 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childprocess.cpp -) - -add_executable(paltest_openeventw_test3_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_openeventw_test3_child coreclrpal) - -target_link_libraries(paltest_openeventw_test3_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.cpp index d2fab36c9968..a868b7da4d69 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.cpp @@ -26,7 +26,7 @@ #include -int __cdecl main( int argc, char **argv ) +PALTEST(threading_OpenEventW_test3_paltest_openeventw_test3_child, "threading/OpenEventW/test3/paltest_openeventw_test3_child") { /* local variables */ HANDLE hEvent = NULL; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.cpp index 18f88b52a8dd..58e21465f9a2 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.cpp @@ -33,7 +33,7 @@ #define TIMEOUT 60000 -int __cdecl main( int argc, char **argv ) +PALTEST(threading_OpenEventW_test3_paltest_openeventw_test3, "threading/OpenEventW/test3/paltest_openeventw_test3") { BOOL ret = FAIL; LPSECURITY_ATTRIBUTES lpEventAttributes = NULL; @@ -79,9 +79,10 @@ int __cdecl main( int argc, char **argv ) Fail ("Error: Insufficient lpCommandline for\n"); } + LPWSTR lpCommandLineW = convert(lpCommandLine); /* launch the child process */ if( !CreateProcess( NULL, /* module name to execute */ - lpCommandLine, /* command line */ + lpCommandLineW, /* command line */ NULL, /* process handle not */ /* inheritable */ NULL, /* thread handle not */ @@ -95,10 +96,14 @@ int __cdecl main( int argc, char **argv ) &pi ) /* process info struct */ ) { + DWORD dwError = GetLastError(); + free(lpCommandLineW); Fail( "ERROR:%lu:CreateProcess call failed\n", - GetLastError() ); + dwError); } + free(lpCommandLineW); + /* verify that the event is signalled by the child process */ dwRet = WaitForSingleObject( hEvent, TIMEOUT ); if( dwRet != WAIT_OBJECT_0 ) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/testinfo.dat deleted file mode 100644 index d5ebeb05c9ff..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test3/testinfo.dat +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = OpenEventW -Name = Test for OpenEventW -TYPE = DEFAULT -EXE1 = test3 -EXE2 = childprocess -Description -= Purpose: Test to ensure that OpenEventW() works when -= opening an event created by another process. This test -= program launches a child process which creates a -= named, initially-unset event. The child waits up to -= 10 seconds for the parent process to open that event -= and set it, and returns PASS if the event was set or FAIL -= otherwise. The parent process checks the return value -= from the child to verify that the opened event was -= properly used across processes. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/CMakeLists.txt deleted file mode 100644 index 5c727e3f9b5c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_openeventw_test4 - ${SOURCES} -) - -add_dependencies(paltest_openeventw_test4 coreclrpal) - -target_link_libraries(paltest_openeventw_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/test4.cpp index 9d062bd6d56a..b56af149a4db 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/test4.cpp @@ -25,7 +25,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_OpenEventW_test4_paltest_openeventw_test4, "threading/OpenEventW/test4/paltest_openeventw_test4") { /* local variables */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/testinfo.dat deleted file mode 100644 index 31e512e75683..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = OpenEventW -Name = Negative test for OpenEventW -TYPE = DEFAULT -EXE1 = test4 -Description -= Test to ensure proper operation of the OpenEventW() -= API by trying to open an event with a name that is -= already taken by a non-event object. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/CMakeLists.txt deleted file mode 100644 index cd4b6116fdec..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_openeventw_test5 - ${SOURCES} -) - -add_dependencies(paltest_openeventw_test5 coreclrpal) - -target_link_libraries(paltest_openeventw_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/test5.cpp index 5d4e90dba04c..6c692ba3b9b9 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/test5.cpp @@ -16,7 +16,7 @@ ** Purpose: ** ** Test to ensure proper operation of the OpenEventW() -** API by creating a new named event with CreateEventA() +** API by creating a new named event with CreateEventW() ** and verifying that it can be opened with OpenEventW(). ** It should be possible to use the event handles ** interchangeably, we test by setting the event with the @@ -30,7 +30,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_OpenEventW_test5_paltest_openeventw_test5, "threading/OpenEventW/test5/paltest_openeventw_test5") { /* local variables */ @@ -41,7 +41,6 @@ int __cdecl main( int argc, char **argv ) LPSECURITY_ATTRIBUTES lpEventAttributes = NULL; BOOL bManualReset = TRUE; BOOL bInitialState = FALSE; - LPSTR lpNameA = "ShakeIt"; WCHAR wcName[] = {'S','h','a','k','e','I','t','\0'}; LPWSTR lpNameW = wcName; @@ -54,10 +53,10 @@ int __cdecl main( int argc, char **argv ) /* create an event which we can use with SetEvent */ - hEvent = CreateEventA( lpEventAttributes, - bManualReset, - bInitialState, - lpNameA ); + hEvent = CreateEvent( lpEventAttributes, + bManualReset, + bInitialState, + lpNameW ); if( hEvent == NULL ) { @@ -189,7 +188,7 @@ int __cdecl main( int argc, char **argv ) /* PAL termination */ - PAL_Terminate(); + PAL_TerminateEx(ret); /* return success or failure */ return ret; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/testinfo.dat deleted file mode 100644 index f88f33731ca1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenEventW/test5/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = OpenEventW -Name = Positive test for OpenEventW -TYPE = DEFAULT -EXE1 = test5 -Description -= Test to ensure proper operation of the OpenEventW() -= API by creating a new named event with CreateEventA() -= and verifying that it can be opened with OpenEventW(). -= It should be possible to use the event handles -= interchangeably, we test by setting the event with the -= original handle and waiting on it with the new one, -= then resetting it with the new one and waiting -= on it with the original one. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/CMakeLists.txt deleted file mode 100644 index 2066846eef32..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test1.cpp -) - -add_executable(paltest_openprocess_test1 - ${TESTSOURCES} -) - -add_dependencies(paltest_openprocess_test1 coreclrpal) - -target_link_libraries(paltest_openprocess_test1 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - childProcess.cpp -) - -add_executable(paltest_openprocess_test1_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_openprocess_test1_child coreclrpal) - -target_link_libraries(paltest_openprocess_test1_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.cpp b/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.cpp index a3dd3aa2a590..db78c20ebc77 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.cpp @@ -21,7 +21,7 @@ #include "myexitcode.h" -int __cdecl main( int argc, char **argv ) +PALTEST(threading_OpenProcess_test1_paltest_openprocess_test1_child, "threading/OpenProcess/test1/paltest_openprocess_test1_child") { HANDLE hMutex; WCHAR wszMutexName[] = { 'T','E','S','T','1','\0' }; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/test1.cpp index 57fc97a27678..6a4b3cb97894 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/test1.cpp @@ -26,40 +26,7 @@ #include #include "myexitcode.h" - -static const char* rgchPathDelim = "\\"; - - -int -mkAbsoluteFilename( LPSTR dirName, - DWORD dwDirLength, - LPCSTR fileName, - DWORD dwFileLength, - LPSTR absPathName ) -{ - DWORD sizeDN, sizeFN, sizeAPN; - - sizeDN = strlen( dirName ); - sizeFN = strlen( fileName ); - sizeAPN = (sizeDN + 1 + sizeFN + 1); - - /* ensure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */ - if( sizeAPN > _MAX_PATH ) - { - return ( 0 ); - } - - strncpy( absPathName, dirName, dwDirLength +1 ); - strncpy( absPathName, rgchPathDelim, 2 ); - strncpy( absPathName, fileName, dwFileLength +1 ); - - return (sizeAPN); - -} - - -int __cdecl main( int argc, char **argv ) - +PALTEST(threading_OpenProcess_test1_paltest_openprocess_test1, "threading/OpenProcess/test1/paltest_openprocess_test1") { const char* rgchChildFile = "childprocess"; @@ -141,9 +108,10 @@ int __cdecl main( int argc, char **argv ) "not build absolute path name to file\n. Exiting.\n" ); } + LPWSTR rgchAbsPathNameW = convert(rgchAbsPathName); /* launch the child process */ if( !CreateProcess( NULL, /* module name to execute */ - rgchAbsPathName, /* command line */ + rgchAbsPathNameW, /* command line */ NULL, /* process handle not */ /* inheritable */ NULL, /* thread handle not */ @@ -158,6 +126,7 @@ int __cdecl main( int argc, char **argv ) ) { dwError = GetLastError(); + free(rgchAbsPathNameW); if( ReleaseMutex( hMutex ) == 0 ) { Trace( "ERROR:%lu:ReleaseMutex() call failed\n", GetLastError() ); @@ -170,6 +139,8 @@ int __cdecl main( int argc, char **argv ) dwError ); } + free(rgchAbsPathNameW); + /* open another handle to the child process */ hChildProcess = OpenProcess( PROCESS_ALL_ACCESS, /* access */ FALSE, /* inheritable */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/testinfo.dat deleted file mode 100644 index 11a7c9826533..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/OpenProcess/test1/testinfo.dat +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = OpenProcess -Name = Test for OpenProcess -TYPE = DEFAULT -EXE1 = test1 -EXE2 = childprocess -Description -= Test to ensure proper operation of the OpenProcess API. -= The test launches a trivial child process, then opens -= a handle to it using OpenProcess. It uses that handle -= to wait for the child process to terminate, and then -= checks the exit code of the child process in order to -= verify that it was in fact a handle to the correct -= process. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/CMakeLists.txt deleted file mode 100644 index e46df5775755..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(test1) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/CMakeLists.txt deleted file mode 100644 index df6b87667c54..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_querythreadcycletime_test1 - ${SOURCES} -) - -add_dependencies(paltest_querythreadcycletime_test1 coreclrpal) - -target_link_libraries(paltest_querythreadcycletime_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.cpp index 0bb9d87a4ffb..ff332fd0b3a2 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.cpp @@ -14,7 +14,8 @@ #include -int __cdecl main(int argc, char *argv[]) { +PALTEST(threading_QueryThreadCycleTime_test1_paltest_querythreadcycletime_test1, "threading/QueryThreadCycleTime/test1/paltest_querythreadcycletime_test1") +{ int ret = FAIL; //Test is failing unreliably, so for now we always return pass. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/CMakeLists.txt deleted file mode 100644 index 7cd88f8e86da..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) -add_subdirectory(test7) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/CMakeLists.txt deleted file mode 100644 index c07fcfa04b8a..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_queueuserapc_test1 - ${SOURCES} -) - -add_dependencies(paltest_queueuserapc_test1 coreclrpal) - -target_link_libraries(paltest_queueuserapc_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.cpp index 886ba439a6c8..8e5ff257d963 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.cpp @@ -22,21 +22,21 @@ VOID PALAPI APCFuncA(ULONG_PTR dwParam); VOID PALAPI APCFuncB(ULONG_PTR dwParam); VOID PALAPI APCFuncC(ULONG_PTR dwParam); VOID PALAPI APCFuncD(ULONG_PTR dwParam); -DWORD PALAPI SleeperProc(LPVOID lpParameter); +DWORD PALAPI SleeperProc_QueueUserAPC_test1(LPVOID lpParameter); -const char *ExpectedResults = "A0B0C0D0A1B1C1D1A2B2C2D2A3B3C3D3"; -char ResultBuffer[256]; -char *ResultPtr; -DWORD ChildThread; +const char *ExpectedResults_QueueUserAPC_test1 = "A0B0C0D0A1B1C1D1A2B2C2D2A3B3C3D3"; +char ResultBuffer_QueueUserAPC_test1[256]; +char *ResultPtr_QueueUserAPC_test1; +DWORD ChildThread_QueueUserAPC_test1; /* synchronization events */ -static HANDLE hSyncEvent1 = NULL; -static HANDLE hSyncEvent2 = NULL; +static HANDLE hSyncEvent1_QueueUserAPC_test1 = NULL; +static HANDLE hSyncEvent2_QueueUserAPC_test1 = NULL; /* thread result because we have no GetExitCodeThread() API */ -BOOL bThreadResult = FAIL; +BOOL bThreadResult_QueueUserAPC_test1 = FAIL; -int __cdecl main (int argc, char **argv) +PALTEST(threading_QueueUserAPC_test1_paltest_queueuserapc_test1, "threading/QueueUserAPC/test1/paltest_queueuserapc_test1") { HANDLE hThread = NULL; int ret; @@ -57,18 +57,18 @@ int __cdecl main (int argc, char **argv) return FAIL; } - ResultPtr = ResultBuffer; + ResultPtr_QueueUserAPC_test1 = ResultBuffer_QueueUserAPC_test1; /* create a pair of synchronization events to coordinate our threads */ - hSyncEvent1 = CreateEvent( NULL, FALSE, FALSE, NULL ); - if( hSyncEvent1 == NULL ) + hSyncEvent1_QueueUserAPC_test1 = CreateEvent( NULL, FALSE, FALSE, NULL ); + if( hSyncEvent1_QueueUserAPC_test1 == NULL ) { Trace( "ERROR:%lu:CreateEvent() call failed\n", GetLastError() ); goto cleanup; } - hSyncEvent2 = CreateEvent( NULL, FALSE, FALSE, NULL ); - if( hSyncEvent2 == NULL ) + hSyncEvent2_QueueUserAPC_test1 = CreateEvent( NULL, FALSE, FALSE, NULL ); + if( hSyncEvent2_QueueUserAPC_test1 == NULL ) { Trace( "ERROR:%lu:CreateEvent() call failed\n", GetLastError() ); goto cleanup; @@ -77,10 +77,10 @@ int __cdecl main (int argc, char **argv) /* create a child thread which will call SleepEx */ hThread = CreateThread( NULL, 0, - (LPTHREAD_START_ROUTINE)SleeperProc, + (LPTHREAD_START_ROUTINE)SleeperProc_QueueUserAPC_test1, 0, 0, - &ChildThread); + &ChildThread_QueueUserAPC_test1); if( hThread == NULL ) { @@ -91,7 +91,7 @@ int __cdecl main (int argc, char **argv) /* wait on our synchronization event to ensure the thread is running */ - ret = WaitForSingleObject( hSyncEvent1, 20000 ); + ret = WaitForSingleObject( hSyncEvent1_QueueUserAPC_test1, 20000 ); if( ret != WAIT_OBJECT_0 ) { Trace( "ERROR:WaitForSingleObject() returned %lu, " @@ -117,7 +117,7 @@ int __cdecl main (int argc, char **argv) } /* signal the child thread to continue */ - if( ! SetEvent( hSyncEvent2 ) ) + if( ! SetEvent( hSyncEvent2_QueueUserAPC_test1 ) ) { Trace( "ERROR:%lu:SetEvent() call failed\n", GetLastError() ); goto cleanup; @@ -125,7 +125,7 @@ int __cdecl main (int argc, char **argv) /* wait on our synchronization event to ensure the other thread is done */ - ret = WaitForSingleObject( hSyncEvent1, 20000 ); + ret = WaitForSingleObject( hSyncEvent1_QueueUserAPC_test1, 20000 ); if( ret != WAIT_OBJECT_0 ) { Trace( "ERROR:WaitForSingleObject() returned %lu, " @@ -136,19 +136,19 @@ int __cdecl main (int argc, char **argv) /* check that the thread executed successfully */ - if( bThreadResult == FAIL ) + if( bThreadResult_QueueUserAPC_test1 == FAIL ) { goto cleanup; } /* check the result buffer */ - if (strcmp(ExpectedResults, ResultBuffer) != 0) + if (strcmp(ExpectedResults_QueueUserAPC_test1, ResultBuffer_QueueUserAPC_test1) != 0) { Trace( "FAIL:Expected the APC function calls to produce a result of " " \"%s\", got \"%s\"\n", - ExpectedResults, - ResultBuffer ); + ExpectedResults_QueueUserAPC_test1, + ResultBuffer_QueueUserAPC_test1 ); goto cleanup; } @@ -170,18 +170,18 @@ int __cdecl main (int argc, char **argv) } /* close our synchronization handles */ - if( hSyncEvent1 != NULL ) + if( hSyncEvent1_QueueUserAPC_test1 != NULL ) { - if( ! CloseHandle( hSyncEvent1 ) ) + if( ! CloseHandle( hSyncEvent1_QueueUserAPC_test1 ) ) { Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() ); bResult = FAIL; } } - if( hSyncEvent2 != NULL ) + if( hSyncEvent2_QueueUserAPC_test1 != NULL ) { - if( ! CloseHandle( hSyncEvent2 ) ) + if( ! CloseHandle( hSyncEvent2_QueueUserAPC_test1 ) ) { Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() ); bResult = FAIL; @@ -204,83 +204,83 @@ VOID PALAPI APCFuncA(ULONG_PTR dwParam) { char val = (int) dwParam; - if (GetCurrentThreadId() != ChildThread) + if (GetCurrentThreadId() != ChildThread_QueueUserAPC_test1) { Fail("Executing APC in thread %d, should be in %d!\n", - GetCurrentThreadId(), ChildThread); + GetCurrentThreadId(), ChildThread_QueueUserAPC_test1); } - *ResultPtr++ = 'A'; - *ResultPtr++ = val; - *ResultPtr = 0; + *ResultPtr_QueueUserAPC_test1++ = 'A'; + *ResultPtr_QueueUserAPC_test1++ = val; + *ResultPtr_QueueUserAPC_test1 = 0; } VOID PALAPI APCFuncB(ULONG_PTR dwParam) { char val = (int) dwParam; - if (GetCurrentThreadId() != ChildThread) + if (GetCurrentThreadId() != ChildThread_QueueUserAPC_test1) { Fail("Executing APC in thread %d, should be in %d!\n", - GetCurrentThreadId(), ChildThread); + GetCurrentThreadId(), ChildThread_QueueUserAPC_test1); } - *ResultPtr++ = 'B'; - *ResultPtr++ = val; - *ResultPtr = 0; + *ResultPtr_QueueUserAPC_test1++ = 'B'; + *ResultPtr_QueueUserAPC_test1++ = val; + *ResultPtr_QueueUserAPC_test1 = 0; } VOID PALAPI APCFuncC(ULONG_PTR dwParam) { char val = (int) dwParam; - if (GetCurrentThreadId() != ChildThread) + if (GetCurrentThreadId() != ChildThread_QueueUserAPC_test1) { Fail("Executing APC in thread %d, should be in %d!\n", - GetCurrentThreadId(), ChildThread); + GetCurrentThreadId(), ChildThread_QueueUserAPC_test1); } - *ResultPtr++ = 'C'; - *ResultPtr++ = val; - *ResultPtr = 0; + *ResultPtr_QueueUserAPC_test1++ = 'C'; + *ResultPtr_QueueUserAPC_test1++ = val; + *ResultPtr_QueueUserAPC_test1 = 0; } VOID PALAPI APCFuncD(ULONG_PTR dwParam) { char val = (int) dwParam; - if (GetCurrentThreadId() != ChildThread) + if (GetCurrentThreadId() != ChildThread_QueueUserAPC_test1) { Fail("Executing APC in thread %d, should be in %d!\n", - GetCurrentThreadId(), ChildThread); + GetCurrentThreadId(), ChildThread_QueueUserAPC_test1); } - *ResultPtr++ = 'D'; - *ResultPtr++ = val; - *ResultPtr = 0; + *ResultPtr_QueueUserAPC_test1++ = 'D'; + *ResultPtr_QueueUserAPC_test1++ = val; + *ResultPtr_QueueUserAPC_test1 = 0; } /* Entry Point for child thread. All it does is call SleepEx. */ -DWORD PALAPI SleeperProc(LPVOID lpParameter) +DWORD PALAPI SleeperProc_QueueUserAPC_test1(LPVOID lpParameter) { DWORD ret; /* signal the main thread that we're ready to proceed */ - if( ! SetEvent( hSyncEvent1 ) ) + if( ! SetEvent( hSyncEvent1_QueueUserAPC_test1 ) ) { Trace( "ERROR:%lu:SetEvent() call failed\n", GetLastError() ); - bThreadResult = FAIL; + bThreadResult_QueueUserAPC_test1 = FAIL; goto done; } /* wait for notification from the main thread */ - ret = WaitForSingleObject( hSyncEvent2, 20000 ); + ret = WaitForSingleObject( hSyncEvent2_QueueUserAPC_test1, 20000 ); if( ret != WAIT_OBJECT_0 ) { Trace( "ERROR:WaitForSingleObject() returned %lu, " "expected WAIT_OBJECT_0\n", ret ); - bThreadResult = FAIL; + bThreadResult_QueueUserAPC_test1 = FAIL; goto done; } @@ -291,22 +291,22 @@ DWORD PALAPI SleeperProc(LPVOID lpParameter) Trace( "ERROR:SleepEx() call returned %lu, " "expected WAIT_IO_COMPLETION\n", ret ); - bThreadResult = FAIL; + bThreadResult_QueueUserAPC_test1 = FAIL; goto done; } /* everything passed here */ - bThreadResult = PASS; + bThreadResult_QueueUserAPC_test1 = PASS; done: /* signal the main thread that we're finished */ - if( ! SetEvent( hSyncEvent1 ) ) + if( ! SetEvent( hSyncEvent1_QueueUserAPC_test1 ) ) { Trace( "ERROR:%lu:SetEvent() call failed\n", GetLastError() ); - bThreadResult = FAIL; + bThreadResult_QueueUserAPC_test1 = FAIL; } /* return success or failure */ - return bThreadResult; + return bThreadResult_QueueUserAPC_test1; } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/testinfo.dat deleted file mode 100644 index 812a128ac831..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = QueueUserAPC -Name = Test #1 for QueueUserAPC -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that APCs sent to a thread in an alertable state via -=QueueUserAPC are executed in FIFO order. Also tests that the APC -=function is executed within the context of the correct thread and -=that the dwData parameter gets sent correctly. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/CMakeLists.txt deleted file mode 100644 index 7247214b55f3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_queueuserapc_test2 - ${SOURCES} -) - -add_dependencies(paltest_queueuserapc_test2 coreclrpal) - -target_link_libraries(paltest_queueuserapc_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.cpp index b7ec387647c5..cc362393e9c4 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.cpp @@ -27,12 +27,12 @@ static HANDLE hSyncEvent2 = NULL; static BOOL bThreadResult = FAIL; -VOID PALAPI APCFunc(ULONG_PTR dwParam) +VOID PALAPI APCFunc_QueueUserAPC_test2(ULONG_PTR dwParam) { InAPC = TRUE; } -DWORD PALAPI SleeperProc(LPVOID lpParameter) +DWORD PALAPI SleeperProc_QueueUserAPC_test2(LPVOID lpParameter) { DWORD ret; @@ -76,7 +76,7 @@ DWORD PALAPI SleeperProc(LPVOID lpParameter) } -int __cdecl main (int argc, char **argv) +PALTEST(threading_QueueUserAPC_test2_paltest_queueuserapc_test2, "threading/QueueUserAPC/test2/paltest_queueuserapc_test2") { /* local variables */ HANDLE hThread = 0; @@ -109,7 +109,7 @@ int __cdecl main (int argc, char **argv) /* create a child thread */ hThread = CreateThread( NULL, 0, - (LPTHREAD_START_ROUTINE)SleeperProc, + (LPTHREAD_START_ROUTINE)SleeperProc_QueueUserAPC_test2, 0, 0, &ChildThread); @@ -133,7 +133,7 @@ int __cdecl main (int argc, char **argv) } /* queue a user APC on the child thread */ - ret = QueueUserAPC(APCFunc, hThread, 0); + ret = QueueUserAPC(APCFunc_QueueUserAPC_test2, hThread, 0); if (ret == 0) { Trace( "ERROR:%lu:QueueUserAPC() call failed\n", diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/testinfo.dat deleted file mode 100644 index c915a5415bc7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = QueueUserAPC -Name = Test #2 for QueueUserAPC -TYPE = DEFAULT -EXE1 = test2 -Description -=Tests that APCs are not executed if a thread never enters an -=alertable state after they are queued. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/CMakeLists.txt deleted file mode 100644 index 0cacac7a7337..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_queueuserapc_test3 - ${SOURCES} -) - -add_dependencies(paltest_queueuserapc_test3 coreclrpal) - -target_link_libraries(paltest_queueuserapc_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.cpp index a5f694bb41e8..d1265191b55e 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.cpp @@ -12,7 +12,7 @@ #include -int __cdecl main (int argc, char **argv) +PALTEST(threading_QueueUserAPC_test3_paltest_queueuserapc_test3, "threading/QueueUserAPC/test3/paltest_queueuserapc_test3") { int ret; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/testinfo.dat deleted file mode 100644 index 4dd3fc6b0984..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test3/testinfo.dat +++ /dev/null @@ -1,11 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = QueueUserAPC -Name = Test #3 for QueueUserAPC -TYPE = DEFAULT -EXE1 = test3 -Description -=Tests how QueueUserAPC handles an invalid thread. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/CMakeLists.txt deleted file mode 100644 index a46730424da5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_queueuserapc_test4 - ${SOURCES} -) - -add_dependencies(paltest_queueuserapc_test4 coreclrpal) - -target_link_libraries(paltest_queueuserapc_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.cpp index 4b54513d5ed8..5a4add3a8117 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.cpp @@ -21,14 +21,14 @@ #include -static BOOL bAPCExecuted = FALSE; +static BOOL bAPCExecuted_QueueUserAPC_test4 = FALSE; -VOID PALAPI APCFunc( ULONG_PTR dwParam ) +VOID PALAPI APCFunc_QueueUserAPC_test4( ULONG_PTR dwParam ) { - bAPCExecuted = TRUE; + bAPCExecuted_QueueUserAPC_test4 = TRUE; } -int __cdecl main( int argc, char **argv ) +PALTEST(threading_QueueUserAPC_test4_paltest_queueuserapc_test4, "threading/QueueUserAPC/test4/paltest_queueuserapc_test4") { /* local variables */ @@ -43,7 +43,7 @@ int __cdecl main( int argc, char **argv ) /* get the current thread */ hThread = GetCurrentThread(); - ret = QueueUserAPC( APCFunc, hThread, 0 ); + ret = QueueUserAPC( APCFunc_QueueUserAPC_test4, hThread, 0 ); if( ret == 0 ) { Fail( "ERROR:%lu:QueueUserAPC call failed\n", GetLastError() ); @@ -58,7 +58,7 @@ int __cdecl main( int argc, char **argv ) } /* check that the APC function was executed */ - if( bAPCExecuted == FALSE ) + if( bAPCExecuted_QueueUserAPC_test4 == FALSE ) { Fail( "ERROR:APC function was not executed\n" ); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/testinfo.dat deleted file mode 100644 index 7813384a4ae5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = QueueUserAPC -Name = Positive test for QueueUserAPC -TYPE = DEFAULT -EXE1 = test4 -Description -= Test to ensure proper operation of the QueueUserAPC() -= API by trying to queue APC functions on the current -= thread. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/CMakeLists.txt deleted file mode 100644 index 0756fbd4a8e1..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test5.cpp -) - -add_executable(paltest_queueuserapc_test5 - ${SOURCES} -) - -add_dependencies(paltest_queueuserapc_test5 coreclrpal) - -target_link_libraries(paltest_queueuserapc_test5 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.cpp index 6095ffcbcce5..f31773947eb4 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.cpp @@ -31,12 +31,12 @@ #include -static HANDLE hEvent = NULL; -static BOOL bAPCExecuted = FALSE; +static HANDLE hEvent_QueueUserAPC_test5 = NULL; +static BOOL bAPCExecuted_QueueUserAPC_test5 = FALSE; -VOID PALAPI APCFunc( ULONG_PTR dwParam ) +VOID PALAPI APCFunc_QueueUserAPC_test5( ULONG_PTR dwParam ) { - bAPCExecuted = TRUE; + bAPCExecuted_QueueUserAPC_test5 = TRUE; } /** @@ -44,12 +44,12 @@ VOID PALAPI APCFunc( ULONG_PTR dwParam ) * * Dummy thread function for APC queuing. */ -DWORD PALAPI ThreadFunc( LPVOID param ) +DWORD PALAPI ThreadFunc_QueueUserAPC_test5( LPVOID param ) { DWORD ret = 0; /* alertable wait until the global event is signalled */ - ret = WaitForSingleObject( hEvent, INFINITE ); + ret = WaitForSingleObject( hEvent_QueueUserAPC_test5, INFINITE ); if( ret != WAIT_OBJECT_0 ) { Fail( "ERROR:WaitForSingleObject() returned %lu, " @@ -61,7 +61,7 @@ DWORD PALAPI ThreadFunc( LPVOID param ) } -int __cdecl main( int argc, char **argv ) +PALTEST(threading_QueueUserAPC_test5_paltest_queueuserapc_test5, "threading/QueueUserAPC/test5/paltest_queueuserapc_test5") { /* local variables */ @@ -77,8 +77,8 @@ int __cdecl main( int argc, char **argv ) } /* create an event for the other thread to wait on */ - hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); - if( hEvent == NULL ) + hEvent_QueueUserAPC_test5 = CreateEvent( NULL, TRUE, FALSE, NULL ); + if( hEvent_QueueUserAPC_test5 == NULL ) { Fail( "ERROR:%lu:CreateEvent() call failed\n", GetLastError() ); } @@ -86,7 +86,7 @@ int __cdecl main( int argc, char **argv ) /* run another dummy thread to cause notification of the library */ hThread = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE) ThreadFunc, /* thread function */ + (LPTHREAD_START_ROUTINE) ThreadFunc_QueueUserAPC_test5, /* thread function */ (LPVOID) NULL, /* pass thread index as */ /* function argument */ CREATE_SUSPENDED, /* create suspended */ @@ -97,7 +97,7 @@ int __cdecl main( int argc, char **argv ) { /* error creating thread */ Trace( "ERROR:%lu:CreateThread call failed\n", GetLastError() ); - if( ! CloseHandle( hEvent ) ) + if( ! CloseHandle( hEvent_QueueUserAPC_test5 ) ) { Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() ); } @@ -105,7 +105,7 @@ int __cdecl main( int argc, char **argv ) } /* queue our APC on the suspended thread */ - ret = QueueUserAPC( APCFunc, hThread, 0 ); + ret = QueueUserAPC( APCFunc_QueueUserAPC_test5, hThread, 0 ); if( ret == 0 ) { Fail( "ERROR:%lu:QueueUserAPC call failed\n", GetLastError() ); @@ -122,7 +122,7 @@ int __cdecl main( int argc, char **argv ) } /* verify that the APC function was not executed */ - if( bAPCExecuted == TRUE ) + if( bAPCExecuted_QueueUserAPC_test5 == TRUE ) { Trace( "ERROR:APC function was executed for a suspended thread\n" ); goto cleanup; @@ -144,7 +144,7 @@ int __cdecl main( int argc, char **argv ) } /* check that the APC function was actually executed */ - if( bAPCExecuted == FALSE ) + if( bAPCExecuted_QueueUserAPC_test5 == FALSE ) { Trace( "ERROR:APC function was not executed\n" ); goto cleanup; @@ -155,14 +155,14 @@ int __cdecl main( int argc, char **argv ) cleanup: /* signal the event so the other thread will exit */ - if( ! SetEvent( hEvent ) ) + if( ! SetEvent( hEvent_QueueUserAPC_test5 ) ) { Trace( "ERROR:%lu:SetEvent() call failed\n", GetLastError() ); bResult = FAIL; } /* close the global event handle */ - if( ! CloseHandle( hEvent ) ) + if( ! CloseHandle( hEvent_QueueUserAPC_test5 ) ) { Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() ); bResult = FAIL; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/testinfo.dat deleted file mode 100644 index 8fe1d93b7b9c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test5/testinfo.dat +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = QueueUserAPC -Name = Positive test for QueueUserAPC -TYPE = DEFAULT -EXE1 = test5 -Description -= Test to ensure proper operation of the QueueUserAPC() -= API by trying to queue and activate APC functions on -= a thread that was created suspended, prior to resuming -= it. We're verifying the following behavior: -= -= "If an application queues an APC before the thread begins -= running, the thread begins by calling the APC function. -= After the thread calls an APC function, it calls the APC -= functions for all APCs in its APC queue." diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/CMakeLists.txt deleted file mode 100644 index d6c7a27db5e2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test6.cpp -) - -add_executable(paltest_queueuserapc_test6 - ${SOURCES} -) - -add_dependencies(paltest_queueuserapc_test6 coreclrpal) - -target_link_libraries(paltest_queueuserapc_test6 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.cpp index 2cf30224f4d2..1bcbfbfb0a4f 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.cpp @@ -25,11 +25,11 @@ #include -static BOOL bAPCExecuted = FALSE; +static BOOL bAPCExecuted_QueueUserAPC_test6 = FALSE; -VOID PALAPI APCFunc( ULONG_PTR dwParam ) +VOID PALAPI APCFunc_QueueUserAPC_test6( ULONG_PTR dwParam ) { - bAPCExecuted = TRUE; + bAPCExecuted_QueueUserAPC_test6 = TRUE; } /** @@ -37,7 +37,7 @@ VOID PALAPI APCFunc( ULONG_PTR dwParam ) * * Dummy thread function for APC queuing. */ -DWORD PALAPI ThreadFunc( LPVOID param ) +DWORD PALAPI ThreadFunc_QueueUserAPC_test6( LPVOID param ) { int i; @@ -49,7 +49,7 @@ DWORD PALAPI ThreadFunc( LPVOID param ) } -int __cdecl main( int argc, char **argv ) +PALTEST(threading_QueueUserAPC_test6_paltest_queueuserapc_test6, "threading/QueueUserAPC/test6/paltest_queueuserapc_test6") { /* local variables */ @@ -66,7 +66,7 @@ int __cdecl main( int argc, char **argv ) /* run another dummy thread to cause notification of the library */ hThread = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE) ThreadFunc, /* thread function */ + (LPTHREAD_START_ROUTINE) ThreadFunc_QueueUserAPC_test6, /* thread function */ (LPVOID) NULL, /* pass thread index as */ /* function argument */ CREATE_SUSPENDED, /* create suspended */ @@ -97,7 +97,7 @@ int __cdecl main( int argc, char **argv ) } /* queue our APC on the finished thread */ - ret = QueueUserAPC( APCFunc, hThread, 0 ); + ret = QueueUserAPC( APCFunc_QueueUserAPC_test6, hThread, 0 ); if( ret != 0 ) { Trace( "ERROR:QueueUserAPC call succeeded on a terminated thread\n" ); @@ -114,7 +114,7 @@ int __cdecl main( int argc, char **argv ) } /* dummy check that the APC function wasn't actually executed */ - if( bAPCExecuted != FALSE ) + if( bAPCExecuted_QueueUserAPC_test6 != FALSE ) { Fail( "ERROR:APC function was executed\n" ); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/testinfo.dat deleted file mode 100644 index 402fa57c44fc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test6/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = QueueUserAPC -Name = Negative test for QueueUserAPC -TYPE = DEFAULT -EXE1 = test6 -Description -= Test to ensure proper operation of the QueueUserAPC() -= API by trying to queue APC functions on a thread that -= has already terminated. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/CMakeLists.txt deleted file mode 100644 index 4bfc4d6ebf9f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test7.cpp -) - -add_executable(paltest_queueuserapc_test7 - ${SOURCES} -) - -add_dependencies(paltest_queueuserapc_test7 coreclrpal) - -target_link_libraries(paltest_queueuserapc_test7 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.cpp b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.cpp index cef429233646..555b4955ed37 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.cpp @@ -25,14 +25,14 @@ #include -static HANDLE hSyncEvent = NULL; -static HANDLE hTestEvent = NULL; -static int nAPCExecuted = 0; -static BOOL bThreadResult = FALSE; +static HANDLE hSyncEvent_QueueUserAPC_test7 = NULL; +static HANDLE hTestEvent_QueueUserAPC_test7 = NULL; +static int nAPCExecuted_QueueUserAPC_test7 = 0; +static BOOL bThreadResult_QueueUserAPC_test7 = FALSE; -VOID PALAPI APCFunc( ULONG_PTR dwParam ) +VOID PALAPI APCFunc_QueueUserAPC_test7( ULONG_PTR dwParam ) { - ++nAPCExecuted; + ++nAPCExecuted_QueueUserAPC_test7; } /** @@ -40,22 +40,22 @@ VOID PALAPI APCFunc( ULONG_PTR dwParam ) * * Dummy thread function for APC queuing. */ -DWORD PALAPI ThreadFunc( LPVOID param ) +DWORD PALAPI ThreadFunc_QueueUserAPC_test7( LPVOID param ) { DWORD ret = 0; /* pessimism */ - bThreadResult = FALSE; + bThreadResult_QueueUserAPC_test7 = FALSE; /* set the sync event to notify the main thread */ - if( ! SetEvent( hSyncEvent ) ) + if( ! SetEvent( hSyncEvent_QueueUserAPC_test7 ) ) { Trace( "ERROR:%lu:SetEvent() call failed\n", GetLastError() ); goto done; } /* wait until the test event is signalled */ - ret = WaitForSingleObject( hTestEvent, INFINITE ); + ret = WaitForSingleObject( hTestEvent_QueueUserAPC_test7, INFINITE ); if( ret != WAIT_OBJECT_0 ) { Trace( "ERROR:WaitForSingleObject() returned %lu, " @@ -66,7 +66,7 @@ DWORD PALAPI ThreadFunc( LPVOID param ) /* now do an alertable wait on the same event, which is now in an unsignalled state */ - ret = WaitForMultipleObjectsEx( 1, &hTestEvent, TRUE, 2000, TRUE ); + ret = WaitForMultipleObjectsEx( 1, &hTestEvent_QueueUserAPC_test7, TRUE, 2000, TRUE ); /* verify that we got a WAIT_IO_COMPLETION result */ if( ret != WAIT_IO_COMPLETION ) @@ -78,14 +78,14 @@ DWORD PALAPI ThreadFunc( LPVOID param ) } /* set the event again */ - if( ! SetEvent( hTestEvent ) ) + if( ! SetEvent( hTestEvent_QueueUserAPC_test7 ) ) { Trace( "ERROR:%lu:SetEvent() call failed\n", GetLastError() ); goto done; } /* do a non-alertable wait on the same event */ - ret = WaitForMultipleObjectsEx( 1, &hTestEvent, TRUE, INFINITE, FALSE ); + ret = WaitForMultipleObjectsEx( 1, &hTestEvent_QueueUserAPC_test7, TRUE, INFINITE, FALSE ); /* verify that we got a WAIT_OBJECT_0 result */ if( ret != WAIT_OBJECT_0 ) @@ -97,15 +97,15 @@ DWORD PALAPI ThreadFunc( LPVOID param ) } /* success at this point */ - bThreadResult = TRUE; + bThreadResult_QueueUserAPC_test7 = TRUE; done: - return bThreadResult; + return bThreadResult_QueueUserAPC_test7; } -int __cdecl main( int argc, char **argv ) +PALTEST(threading_QueueUserAPC_test7_paltest_queueuserapc_test7, "threading/QueueUserAPC/test7/paltest_queueuserapc_test7") { /* local variables */ @@ -121,18 +121,18 @@ int __cdecl main( int argc, char **argv ) } /* create an auto-reset event for the other thread to wait on */ - hTestEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); - if( hTestEvent == NULL ) + hTestEvent_QueueUserAPC_test7 = CreateEvent( NULL, FALSE, FALSE, NULL ); + if( hTestEvent_QueueUserAPC_test7 == NULL ) { Fail( "ERROR:%lu:CreateEvent() call failed\n", GetLastError() ); } /* create an auto-reset event for synchronization */ - hSyncEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); - if( hSyncEvent == NULL ) + hSyncEvent_QueueUserAPC_test7 = CreateEvent( NULL, FALSE, FALSE, NULL ); + if( hSyncEvent_QueueUserAPC_test7 == NULL ) { Trace( "ERROR:%lu:CreateEvent() call failed\n", GetLastError() ); - if( ! CloseHandle( hTestEvent ) ) + if( ! CloseHandle( hTestEvent_QueueUserAPC_test7 ) ) { Trace( "ERROR:%lu:CreateEvent() call failed\n", GetLastError() ); } @@ -142,7 +142,7 @@ int __cdecl main( int argc, char **argv ) /* run another dummy thread to cause notification of the library */ hThread = CreateThread( NULL, /* no security attributes */ 0, /* use default stack size */ - (LPTHREAD_START_ROUTINE) ThreadFunc, /* thread function */ + (LPTHREAD_START_ROUTINE) ThreadFunc_QueueUserAPC_test7, /* thread function */ (LPVOID) NULL, /* pass thread index as */ /* function argument */ CREATE_SUSPENDED, /* create suspended */ @@ -153,7 +153,7 @@ int __cdecl main( int argc, char **argv ) { /* error creating thread */ Trace( "ERROR:%lu:CreateThread call failed\n", GetLastError() ); - if( ! CloseHandle( hTestEvent ) ) + if( ! CloseHandle( hTestEvent_QueueUserAPC_test7 ) ) { Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() ); } @@ -164,7 +164,7 @@ int __cdecl main( int argc, char **argv ) ResumeThread( hThread ); /* wait until the other thread is ready to proceed */ - ret = WaitForSingleObject( hSyncEvent, 10000 ); + ret = WaitForSingleObject( hSyncEvent_QueueUserAPC_test7, 10000 ); if( ret != WAIT_OBJECT_0 ) { Trace( "ERROR:WaitForSingleObject returned %lu, " @@ -175,7 +175,7 @@ int __cdecl main( int argc, char **argv ) /* now queue our APC on the test thread */ - ret = QueueUserAPC( APCFunc, hThread, 0 ); + ret = QueueUserAPC( APCFunc_QueueUserAPC_test7, hThread, 0 ); if( ret == 0 ) { Trace( "ERROR:%lu:QueueUserAPC call failed\n", GetLastError() ); @@ -183,7 +183,7 @@ int __cdecl main( int argc, char **argv ) } /* signal the test event so the other thread will proceed */ - if( ! SetEvent( hTestEvent ) ) + if( ! SetEvent( hTestEvent_QueueUserAPC_test7 ) ) { Trace( "ERROR:%lu:SetEvent() call failed\n", GetLastError() ); goto cleanup; @@ -200,16 +200,16 @@ int __cdecl main( int argc, char **argv ) } /* check the result of the other thread */ - if( bThreadResult == FALSE ) + if( bThreadResult_QueueUserAPC_test7 == FALSE ) { goto cleanup; } /* check that the APC function was actually executed exactly one time */ - if( nAPCExecuted != 1 ) + if( nAPCExecuted_QueueUserAPC_test7 != 1 ) { Trace( "ERROR:APC function was executed %d times, " - "expected once\n", nAPCExecuted ); + "expected once\n", nAPCExecuted_QueueUserAPC_test7 ); goto cleanup; } @@ -219,13 +219,13 @@ int __cdecl main( int argc, char **argv ) cleanup: /* close the global event handles */ - if( ! CloseHandle( hTestEvent ) ) + if( ! CloseHandle( hTestEvent_QueueUserAPC_test7 ) ) { Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() ); bResult = FAIL; } - if( ! CloseHandle( hSyncEvent ) ) + if( ! CloseHandle( hSyncEvent_QueueUserAPC_test7 ) ) { Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() ); bResult = FAIL; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/testinfo.dat deleted file mode 100644 index 23b4288e0eac..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/QueueUserAPC/test7/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = QueueUserAPC -Name = Positive test for QueueUserAPC -TYPE = DEFAULT -EXE1 = test7 -Description -= Test to ensure proper operation of the QueueUserAPC() -= API by trying to queue an APC function on a thread and -= activating it with WaitForMultipleObjectsEx. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/CMakeLists.txt deleted file mode 100644 index a267d29f5562..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test3) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/CMakeLists.txt deleted file mode 100644 index 4c626bf14ff5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ReleaseMutex.cpp -) - -add_executable(paltest_releasemutex_test3 - ${SOURCES} -) - -add_dependencies(paltest_releasemutex_test3 coreclrpal) - -target_link_libraries(paltest_releasemutex_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.cpp index 26fe09687d05..be43bce844ef 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.cpp @@ -17,28 +17,28 @@ #include -DWORD dwTestResult; /* global for test result */ +DWORD dwTestResult_ReleaseMutex_test3; /* global for test result */ -DWORD dwThreadId; /* consumer thread identifier */ +DWORD dwThreadId_ReleaseMutex_test3; /* consumer thread identifier */ -HANDLE hMutex; /* handle to mutex */ +HANDLE hMutex_ReleaseMutex_test3; /* handle to mutex */ -HANDLE hThread; /* handle to thread */ +HANDLE hThread_ReleaseMutex_test3; /* handle to thread */ /* * Thread function. */ DWORD PALAPI -ThreadFunction( LPVOID lpNoArg ) +ThreadFunction_ReleaseMutex_test3( LPVOID lpNoArg ) { - dwTestResult = ReleaseMutex(hMutex); + dwTestResult_ReleaseMutex_test3 = ReleaseMutex(hMutex_ReleaseMutex_test3); return 0; } -int __cdecl main (int argc, char **argv) +PALTEST(threading_ReleaseMutex_test3_paltest_releasemutex_test3, "threading/ReleaseMutex/test3/paltest_releasemutex_test3") { if(0 != (PAL_Initialize(argc, argv))) @@ -49,17 +49,17 @@ int __cdecl main (int argc, char **argv) /* * set dwTestResult so test fails even if ReleaseMutex is not called */ - dwTestResult = 1; + dwTestResult_ReleaseMutex_test3 = 1; /* * Create mutex */ - hMutex = CreateMutexW ( + hMutex_ReleaseMutex_test3 = CreateMutexW ( NULL, TRUE, NULL); - if ( NULL == hMutex ) + if ( NULL == hMutex_ReleaseMutex_test3 ) { Fail ( "hMutex = CreateMutex () - returned NULL\n" "Failing Test.\nGetLastError returned %d\n", GetLastError()); @@ -68,15 +68,15 @@ int __cdecl main (int argc, char **argv) /* * Create ThreadFunction */ - hThread = CreateThread( + hThread_ReleaseMutex_test3 = CreateThread( NULL, 0, - ThreadFunction, + ThreadFunction_ReleaseMutex_test3, NULL, 0, - &dwThreadId); + &dwThreadId_ReleaseMutex_test3); - if ( NULL == hThread ) + if ( NULL == hThread_ReleaseMutex_test3 ) { Fail ( "CreateThread() returned NULL. Failing test.\n" @@ -86,12 +86,12 @@ int __cdecl main (int argc, char **argv) /* * Wait for ThreadFunction to complete */ - WaitForSingleObject (hThread, INFINITE); + WaitForSingleObject (hThread_ReleaseMutex_test3, INFINITE); - if (dwTestResult) + if (dwTestResult_ReleaseMutex_test3) { Fail ("ReleaseMutex() test was expected to return 0.\n" - "It returned %d. Failing test.\n", dwTestResult ); + "It returned %d. Failing test.\n", dwTestResult_ReleaseMutex_test3 ); } Trace ("ReleaseMutex() test returned 0.\nTest passed.\n"); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/testinfo.dat deleted file mode 100644 index b88a8fa5ce2b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ReleaseMutex/test3/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ReleaseMutex -Name = Positive Test for ReleaseMutex -TYPE = DEFAULT -EXE1 = releasemutex -Description -= Calls ReleaseMutex from a thread which should not have ownership of the -= mutex. If ReleaseMutex fails correctly this test will succeed. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/CMakeLists.txt deleted file mode 100644 index 85026ccc717b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_resetevent_test1 - ${SOURCES} -) - -add_dependencies(paltest_resetevent_test1 coreclrpal) - -target_link_libraries(paltest_resetevent_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.cpp index b2fef7b19282..80ce8b64a391 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.cpp @@ -79,7 +79,7 @@ BOOL ResetEventTest() return bRet; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_ResetEvent_test1_paltest_resetevent_test1, "threading/ResetEvent/test1/paltest_resetevent_test1") { if(0 != (PAL_Initialize(argc, argv))) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/testinfo.dat deleted file mode 100644 index c3caf1f4dd3d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ResetEvent -Name = Positive Test for ResetEvent -TYPE = DEFAULT -EXE1 = test1 -Description -= Test for ResetEvent. Create an event with an intial -= state signaled. Then reset that signal, and check to see that -= the event is now not signaled. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/CMakeLists.txt deleted file mode 100644 index 11a1fbf26a7c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_resetevent_test2 - ${SOURCES} -) - -add_dependencies(paltest_resetevent_test2 coreclrpal) - -target_link_libraries(paltest_resetevent_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.cpp index 1f23d79bb6ce..2e04bec00091 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.cpp @@ -22,7 +22,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_ResetEvent_test2_paltest_resetevent_test2, "threading/ResetEvent/test2/paltest_resetevent_test2") { /* local variables */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/testinfo.dat deleted file mode 100644 index 91d105e294db..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ResetEvent -Name = Positive test for ResetEvent -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to ensure proper operation of the ResetEvent() -= API by calling it on an event handle that's already -= unsignalled. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/CMakeLists.txt deleted file mode 100644 index db50041da874..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_resetevent_test3 - ${SOURCES} -) - -add_dependencies(paltest_resetevent_test3 coreclrpal) - -target_link_libraries(paltest_resetevent_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.cpp index 601b6b4e3534..f0c64499bd74 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.cpp @@ -25,7 +25,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_ResetEvent_test3_paltest_resetevent_test3, "threading/ResetEvent/test3/paltest_resetevent_test3") { /* local variables */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/testinfo.dat deleted file mode 100644 index 652085c22621..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ResetEvent -Name = Negative test for ResetEvent -TYPE = DEFAULT -EXE1 = test3 -Description -= Test to ensure proper operation of the ResetEvent() -= API by calling it on an event handle that's been -= closed. We expect it to return an appropriate error -= result. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/CMakeLists.txt deleted file mode 100644 index 4a82944dea67..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_resetevent_test4 - ${SOURCES} -) - -add_dependencies(paltest_resetevent_test4 coreclrpal) - -target_link_libraries(paltest_resetevent_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.cpp index 0efe87f32286..cf89cd551a7f 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.cpp @@ -27,7 +27,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_ResetEvent_test4_paltest_resetevent_test4, "threading/ResetEvent/test4/paltest_resetevent_test4") { /* local variables */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/testinfo.dat deleted file mode 100644 index 9ae938ef2846..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResetEvent/test4/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ResetEvent -Name = Positive test for ResetEvent -TYPE = DEFAULT -EXE1 = test4 -Description -= Test to ensure proper operation of the ResetEvent() -= API by calling it on an event handle that's the -= result of a DuplicateHandle() call on another event -= handle. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/CMakeLists.txt deleted file mode 100644 index 7f2046fb060c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_resumethread_test1 - ${SOURCES} -) - -add_dependencies(paltest_resumethread_test1 coreclrpal) - -target_link_libraries(paltest_resumethread_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.cpp index 952b8c614a59..565cc527c4f2 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.cpp @@ -121,7 +121,7 @@ BOOL ResumeThreadTest() return bRet; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_ResumeThread_test1_paltest_resumethread_test1, "threading/ResumeThread/test1/paltest_resumethread_test1") { if(0 != (PAL_Initialize(argc, argv))) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/testinfo.dat deleted file mode 100644 index a0e64fb5bdb9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ResumeThread/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ResumeThread -Name = Positive Test for ResumeThread -TYPE = DEFAULT -EXE1 = test1 -Description -= Test for ResumeThread. Create a suspended Thread. -= First, ensure that it is indeed suspended. Then call resumethread -= and check to ensure that the function has now run. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/CMakeLists.txt deleted file mode 100644 index 8696f23d0099..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_seterrormode_test1 - ${SOURCES} -) - -add_dependencies(paltest_seterrormode_test1 coreclrpal) - -target_link_libraries(paltest_seterrormode_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.cpp index ad4d278cbcd1..6774312fb5df 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.cpp @@ -14,7 +14,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(threading_SetErrorMode_test1_paltest_seterrormode_test1, "threading/SetErrorMode/test1/paltest_seterrormode_test1") { DWORD dErrorReturn; UINT dErrorModes[] = {SEM_NOOPENFILEERRORBOX, SEM_FAILCRITICALERRORS, 0}; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/testinfo.dat deleted file mode 100644 index b3e71e9f078e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetErrorMode/test1/testinfo.dat +++ /dev/null @@ -1,15 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = Threading -Function = SetErrorMode -Name = Positive Test for SetErrorMode -TYPE = DEFAULT -EXE1 = test1 -Description -= Tests the PAL implementation of the SetErrorMode function. -= This test will set the error mode and then read the error -= set with GetLastError(). - - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/CMakeLists.txt deleted file mode 100644 index 070e42183682..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/CMakeLists.txt deleted file mode 100644 index df55cadc70ef..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_setevent_test1 - ${SOURCES} -) - -add_dependencies(paltest_setevent_test1 coreclrpal) - -target_link_libraries(paltest_setevent_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/test1.cpp index b5bfe85a0ed4..b374e7136441 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/test1.cpp @@ -75,7 +75,7 @@ BOOL SetEventTest() } -int __cdecl main(int argc, char **argv) +PALTEST(threading_SetEvent_test1_paltest_setevent_test1, "threading/SetEvent/test1/paltest_setevent_test1") { if(0 != (PAL_Initialize(argc, argv))) { diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/testinfo.dat deleted file mode 100644 index b44ad50a5072..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = SetEvent -Name = Positive Test for SetEvent -TYPE = DEFAULT -EXE1 = test1 -Description -=Test for SetEvent. Create an Event and then set -=this event, checking the return value. Ensure that it returns -=positive. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/CMakeLists.txt deleted file mode 100644 index d8bf0b957cf3..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_setevent_test2 - ${SOURCES} -) - -add_dependencies(paltest_setevent_test2 coreclrpal) - -target_link_libraries(paltest_setevent_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/test2.cpp index 275ed146c0c7..373d0f7a53f6 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/test2.cpp @@ -23,7 +23,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_SetEvent_test2_paltest_setevent_test2, "threading/SetEvent/test2/paltest_setevent_test2") { /* local variables */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/testinfo.dat deleted file mode 100644 index 6a1f6b93d516..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = SetEvent -Name = Positive test for SetEvent -TYPE = DEFAULT -EXE1 = test2 -Description -= Test to ensure proper operation of the SetEvent() -= API by calling it on an event handle that's already set. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/CMakeLists.txt deleted file mode 100644 index bc9bd267ab47..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_setevent_test3 - ${SOURCES} -) - -add_dependencies(paltest_setevent_test3 coreclrpal) - -target_link_libraries(paltest_setevent_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/test3.cpp index a4c032d5cec6..057661d45807 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/test3.cpp @@ -24,7 +24,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_SetEvent_test3_paltest_setevent_test3, "threading/SetEvent/test3/paltest_setevent_test3") { /* local variables */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/testinfo.dat deleted file mode 100644 index b9842b2ed315..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test3/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = SetEvent -Name = Negative test for SetEvent -TYPE = DEFAULT -EXE1 = test3 -Description -= Test to ensure proper operation of the SetEvent() -= API by calling it on an event handle that's been -= closed. We expect it to return an appropriate error -= result. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/CMakeLists.txt deleted file mode 100644 index 129c11a9e402..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_setevent_test4 - ${SOURCES} -) - -add_dependencies(paltest_setevent_test4 coreclrpal) - -target_link_libraries(paltest_setevent_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/test4.cpp index 1433c2306d43..8a86ecf9bada 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/test4.cpp @@ -27,7 +27,7 @@ -int __cdecl main( int argc, char **argv ) +PALTEST(threading_SetEvent_test4_paltest_setevent_test4, "threading/SetEvent/test4/paltest_setevent_test4") { /* local variables */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/testinfo.dat deleted file mode 100644 index 9f77ba4e74cf..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SetEvent/test4/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = SetEvent -Name = Positive test for SetEvent -TYPE = DEFAULT -EXE1 = test4 -Description -= Test to ensure proper operation of the SetEvent() -= API by calling it on an event handle that's the -= result of a DuplicateHandle() call on another event -= handle. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SignalObjectAndWait/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SignalObjectAndWait/CMakeLists.txt deleted file mode 100644 index cc05747facd5..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SignalObjectAndWait/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - SignalObjectAndWaitTest.cpp -) - -add_executable(paltest_signalobjectandwaittest - ${SOURCES} -) - -add_dependencies(paltest_signalobjectandwaittest coreclrpal) - -target_link_libraries(paltest_signalobjectandwaittest - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SignalObjectAndWait/SignalObjectAndWaitTest.cpp b/src/coreclr/src/pal/tests/palsuite/threading/SignalObjectAndWait/SignalObjectAndWaitTest.cpp index e9ef3946dc37..5bdccd4dbd48 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/SignalObjectAndWait/SignalObjectAndWaitTest.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/SignalObjectAndWait/SignalObjectAndWaitTest.cpp @@ -88,10 +88,10 @@ HANDLE CreateObjectToSignal(SignalableObjectType objectType) return CreateEvent(nullptr, false, false, nullptr); case SignalableObjectType::Semaphore: - return CreateSemaphore(nullptr, 0, 1, nullptr); + return CreateSemaphoreExW(nullptr, 0, 1, nullptr, 0, 0); case SignalableObjectType::FullSemaphore: - return CreateSemaphore(nullptr, 1, 1, nullptr); + return CreateSemaphoreExW(nullptr, 1, 1, nullptr, 0, 0); case SignalableObjectType::Mutex: return CreateMutex(nullptr, true, nullptr); @@ -158,10 +158,10 @@ HANDLE CreateObjectToWaitOn(WaitableObjectType objectType) return CreateEvent(nullptr, false, false, nullptr); case WaitableObjectType::Semaphore: - return CreateSemaphore(nullptr, 1, 1, nullptr); + return CreateSemaphoreExW(nullptr, 1, 1, nullptr, 0, 0); case WaitableObjectType::EmptySemaphore: - return CreateSemaphore(nullptr, 0, 1, nullptr); + return CreateSemaphoreExW(nullptr, 0, 1, nullptr, 0, 0); case WaitableObjectType::Mutex: return CreateMutex(nullptr, false, nullptr); @@ -382,7 +382,7 @@ void Run() } } -int _cdecl main(int argc, char **argv) +PALTEST(threading_SignalObjectAndWait_paltest_signalobjectandwaittest, "threading/SignalObjectAndWait/paltest_signalobjectandwaittest") { if (PAL_Initialize(argc, argv) != 0) { diff --git a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/CMakeLists.txt deleted file mode 100644 index 47b2a2dbec79..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - Sleep.cpp -) - -add_executable(paltest_sleep_test1 - ${SOURCES} -) - -add_dependencies(paltest_sleep_test1 coreclrpal) - -target_link_libraries(paltest_sleep_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp index d08e6da20d99..3cc3d9244828 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp @@ -18,20 +18,20 @@ #include -DWORD SleepTimes[] = +PALTEST(threading_Sleep_test1_paltest_sleep_test1, "threading/Sleep/test1/paltest_sleep_test1") { - 0, - 50, - 100, - 500, - 2000 -}; + DWORD SleepTimes[] = + { + 0, + 50, + 100, + 500, + 2000 + }; -/* Milliseconds of error which are acceptable Function execution time, etc. */ -DWORD AcceptableTimeError = 150; + /* Milliseconds of error which are acceptable Function execution time, etc. */ + DWORD AcceptableTimeError = 150; -int __cdecl main( int argc, char **argv ) -{ UINT64 OldTimeStamp; UINT64 NewTimeStamp; DWORD MaxDelta; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/testinfo.dat deleted file mode 100644 index b0355f830f0e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = Sleep -Name = Positive Test for Sleep -TYPE = DEFAULT -EXE1 = sleep -Description -= Test to see if the Sleep function stops the thread from executing for the -= specified amount of time. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/CMakeLists.txt deleted file mode 100644 index 770404fce0d2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - sleep.cpp -) - -add_executable(paltest_sleep_test2 - ${SOURCES} -) - -add_dependencies(paltest_sleep_test2 coreclrpal) - -target_link_libraries(paltest_sleep_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/sleep.cpp b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/sleep.cpp index 1393ce3170bd..a4e1b465af2c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/sleep.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/sleep.cpp @@ -16,23 +16,23 @@ #include -/* - * times in 10^(-3) seconds - */ - -DWORD SleepTimes[] = +PALTEST(threading_Sleep_test2_paltest_sleep_test2, "threading/Sleep/test2/paltest_sleep_test2") { - 60000, - 300000, - 1800000, - 3200000 -}; + /* + * times in 10^(-3) seconds + */ + + DWORD SleepTimes[] = + { + 60000, + 300000, + 1800000, + 3200000 + }; -/* Milliseconds of error which are acceptable Function execution time, etc. */ -DWORD AcceptableTimeError = 150; + /* Milliseconds of error which are acceptable Function execution time, etc. */ + DWORD AcceptableTimeError = 150; -int __cdecl main( int argc, char **argv ) -{ UINT64 OldTimeStamp; UINT64 NewTimeStamp; DWORD MaxDelta; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/testinfo.dat deleted file mode 100644 index b0355f830f0e..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/Sleep/test2/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = Sleep -Name = Positive Test for Sleep -TYPE = DEFAULT -EXE1 = sleep -Description -= Test to see if the Sleep function stops the thread from executing for the -= specified amount of time. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/CMakeLists.txt deleted file mode 100644 index 65453539668f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/CMakeLists.txt deleted file mode 100644 index 492fa180c874..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_sleepex_test1 - ${SOURCES} -) - -add_dependencies(paltest_sleepex_test1 coreclrpal) - -target_link_libraries(paltest_sleepex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/test1.cpp index ea82e7e9b6fa..61bdf136b8f8 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/test1.cpp @@ -19,26 +19,26 @@ typedef struct BOOL Alertable; } testCase; -testCase testCases[] = -{ - {0, FALSE}, - {50, FALSE}, - {100, FALSE}, - {500, FALSE}, - {2000, FALSE}, - - {0, TRUE}, - {50, TRUE}, - {100, TRUE}, - {500, TRUE}, - {2000, TRUE}, -}; - -/* Milliseconds of error which are acceptable Function execution time, etc. */ -DWORD AcceptableTimeError = 150; - -int __cdecl main( int argc, char **argv ) +PALTEST(threading_SleepEx_test1_paltest_sleepex_test1, "threading/SleepEx/test1/paltest_sleepex_test1") { + /* Milliseconds of error which are acceptable Function execution time, etc. */ + DWORD AcceptableTimeError = 150; + + testCase testCases[] = + { + {0, FALSE}, + {50, FALSE}, + {100, FALSE}, + {500, FALSE}, + {2000, FALSE}, + + {0, TRUE}, + {50, TRUE}, + {100, TRUE}, + {500, TRUE}, + {2000, TRUE}, + }; + UINT64 OldTimeStamp; UINT64 NewTimeStamp; DWORD MaxDelta; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/testinfo.dat deleted file mode 100644 index 29045410a0b7..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test1/testinfo.dat +++ /dev/null @@ -1,12 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = SleepEx -Name = Test #1 for SleepEx -TYPE = DEFAULT -EXE1 = test1 -Description -=Tests that SleepEx correctly sleeps for a given amount of time, -=regardless of the alertable flag. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test2/CMakeLists.txt deleted file mode 100644 index f39774949134..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_sleepex_test2 - ${SOURCES} -) - -add_dependencies(paltest_sleepex_test2 coreclrpal) - -target_link_libraries(paltest_sleepex_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test2/test2.cpp index 6365b73412c4..96efe6e35d27 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/SleepEx/test2/test2.cpp @@ -32,13 +32,13 @@ const DWORD AcceptableDelta = 150; const int Iterations = 5; -void RunTest(BOOL AlertThread); -VOID PALAPI APCFunc(ULONG_PTR dwParam); -DWORD PALAPI SleeperProc(LPVOID lpParameter); +void RunTest_SleepEx_test2(BOOL AlertThread); +VOID PALAPI APCFunc_SleepEx_test2(ULONG_PTR dwParam); +DWORD PALAPI SleeperProc_SleepEx_test2(LPVOID lpParameter); DWORD ThreadSleepDelta; -int __cdecl main( int argc, char **argv ) +PALTEST(threading_SleepEx_test2_paltest_sleepex_test2, "threading/SleepEx/test2/paltest_sleepex_test2") { int i; DWORD dwAvgDelta; @@ -64,7 +64,7 @@ int __cdecl main( int argc, char **argv ) dwAvgDelta = 0; for (i=0;i -INT __cdecl main( int argc, char **argv ) +PALTEST(threading_TerminateProcess_test1_paltest_terminateprocess_test1, "threading/TerminateProcess/test1/paltest_terminateprocess_test1") { HANDLE hProcess; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/TerminateProcess/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/TerminateProcess/test1/testinfo.dat deleted file mode 100644 index fa9c848c34c2..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/TerminateProcess/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = TerminateProcess -Name = Positive Test for TerminateProcess -TYPE = DEFAULT -EXE1 = terminateprocess -Description -= Test to see if the function TerminateProcess terminates the currently -= running process and passes the appropriate value through uExitCode. - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/CMakeLists.txt deleted file mode 100644 index 333586eac5f9..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - ThreadPriority.cpp -) - -add_executable(paltest_threadpriority_test1 - ${SOURCES} -) - -add_dependencies(paltest_threadpriority_test1 coreclrpal) - -target_link_libraries(paltest_threadpriority_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.cpp b/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.cpp index b74816560da8..eae28fa2e0dc 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.cpp @@ -54,7 +54,7 @@ static VOID CheckThreadPriority( HANDLE hThread, int expectedPriority ) * * executable entry point */ -INT __cdecl main( INT argc, CHAR **argv ) +PALTEST(threading_ThreadPriority_test1_paltest_threadpriority_test1, "threading/ThreadPriority/test1/paltest_threadpriority_test1") { /* PAL initialization */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/testinfo.dat deleted file mode 100644 index 8decb5fd48b6..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/ThreadPriority/test1/testinfo.dat +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ThreadPriority -Name = Test for GetThreadPriority and SetThreadPriority -TYPE = DEFAULT -EXE1 = threadpriority -Description -= Test to ensure proper operation of the GetThreadPriority -= and SetThreadPriority APIs. The test launches several threads -= of varying priorities, and verifies that the correct priority -= is reported for each. It also verifies that the processing -= time for each test thread is consistent with the priority -= that's set for it. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/CMakeLists.txt deleted file mode 100644 index 91794df7d0fb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(test1) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/CMakeLists.txt deleted file mode 100644 index 7825b6ac58c0..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_waitformultipleobjects_test1 - ${SOURCES} -) - -add_dependencies(paltest_waitformultipleobjects_test1 coreclrpal) - -target_link_libraries(paltest_waitformultipleobjects_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp index 327ca5968573..03a1849bdb61 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp @@ -169,7 +169,7 @@ BOOL WaitForMultipleObjectsTest() return bRet; } -BOOL WaitMultipleDuplicateHandleTest() +BOOL WaitMultipleDuplicateHandleTest_WFMO_test1() { BOOL testResult = TRUE; const HANDLE eventHandle = CreateEvent(NULL, TRUE, TRUE, NULL); @@ -199,7 +199,7 @@ BOOL WaitMultipleDuplicateHandleTest() return testResult; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_WaitForMultipleObjects_test1_paltest_waitformultipleobjects_test1, "threading/WaitForMultipleObjects/test1/paltest_waitformultipleobjects_test1") { if(0 != (PAL_Initialize(argc, argv))) @@ -212,7 +212,7 @@ int __cdecl main(int argc, char **argv) Fail ("Test failed\n"); } - if (!WaitMultipleDuplicateHandleTest()) + if (!WaitMultipleDuplicateHandleTest_WFMO_test1()) { Fail("Test failed\n"); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/testinfo.dat deleted file mode 100644 index 8bd5de43087d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = WaitForMultipleObjects -Name = Positive Test for WaitForMultipleObjects -TYPE = DEFAULT -EXE1 = test1 -Description -= Test for WaitForMultipleObjects. Call the function -= on an array of 4 events, and ensure that it returns correct -= results when we do so. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/CMakeLists.txt deleted file mode 100644 index 828a2878bf12..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(test2) -add_subdirectory(test3) -add_subdirectory(test4) -add_subdirectory(test5) -add_subdirectory(test6) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/CMakeLists.txt deleted file mode 100644 index b6598c97624f..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test1.cpp -) - -add_executable(paltest_waitformultipleobjectsex_test1 - ${SOURCES} -) - -add_dependencies(paltest_waitformultipleobjectsex_test1 coreclrpal) - -target_link_libraries(paltest_waitformultipleobjectsex_test1 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp index 88f3c33dfcd2..a6248f6b519f 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp @@ -172,7 +172,7 @@ BOOL WaitForMultipleObjectsExTest() return bRet; } -BOOL WaitMultipleDuplicateHandleTest() +BOOL WaitMultipleDuplicateHandleTest_WFMOEx_test1() { BOOL testResult = TRUE; const HANDLE eventHandle = CreateEvent(NULL, TRUE, TRUE, NULL); @@ -202,7 +202,7 @@ BOOL WaitMultipleDuplicateHandleTest() return testResult; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_WaitForMultipleObjectsEx_test1_paltest_waitformultipleobjectsex_test1, "threading/WaitForMultipleObjectsEx/test1/paltest_waitformultipleobjectsex_test1") { if(0 != (PAL_Initialize(argc, argv))) @@ -215,7 +215,7 @@ int __cdecl main(int argc, char **argv) Fail ("Test failed\n"); } - if (!WaitMultipleDuplicateHandleTest()) + if (!WaitMultipleDuplicateHandleTest_WFMOEx_test1()) { Fail("Test failed\n"); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/testinfo.dat deleted file mode 100644 index cfaac3da7da8..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = WaitForMultipleObjectsEx -Name = Test #1 for WaitForMultipleObjectsEx -TYPE = DEFAULT -EXE1 = test1 -Description -= Test for WaitForMultipleObjectsEx. Call the function -= on an array of 4 events, and ensure that it returns correct -= results when we do so. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/CMakeLists.txt deleted file mode 100644 index 8379cc8b96af..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test2.cpp -) - -add_executable(paltest_waitformultipleobjectsex_test2 - ${SOURCES} -) - -add_dependencies(paltest_waitformultipleobjectsex_test2 coreclrpal) - -target_link_libraries(paltest_waitformultipleobjectsex_test2 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp index ec27bed4897f..f464e9afe787 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp @@ -5,7 +5,7 @@ ** ** Source: test2.c ** -** Purpose: Tests that a child thread in the middle of a +** Purpose: Tests that a child thread in the middle of a ** WaitForMultipleObjectsEx call will be interrupted by QueueUserAPC ** if the alert flag was set. ** @@ -17,17 +17,17 @@ /* Based on SleepEx/test2 */ const unsigned int ChildThreadWaitTime = 1000; -const unsigned int InterruptTime = 500; +const unsigned int InterruptTime = 500; #define TOLERANCE 10 -void RunTest(BOOL AlertThread); -VOID PALAPI APCFunc(ULONG_PTR dwParam); -DWORD PALAPI WaiterProc(LPVOID lpParameter); +void RunTest_WFMO_test2(BOOL AlertThread); +VOID PALAPI APCFunc_WFMO_test2(ULONG_PTR dwParam); +DWORD PALAPI WaiterProc_WFMO_test2(LPVOID lpParameter); -DWORD ThreadWaitDelta; +DWORD ThreadWaitDelta_WFMO_test2; -int __cdecl main( int argc, char **argv ) +PALTEST(threading_WaitForMultipleObjectsEx_test2_paltest_waitformultipleobjectsex_test2, "threading/WaitForMultipleObjectsEx/test2/paltest_waitformultipleobjectsex_test2") { DWORD delta = 0; @@ -38,47 +38,47 @@ int __cdecl main( int argc, char **argv ) } /* - On some platforms (e.g. FreeBSD 4.9) the first call to some synch objects - (such as conditions) involves some pthread internal initialization that + On some platforms (e.g. FreeBSD 4.9) the first call to some synch objects + (such as conditions) involves some pthread internal initialization that can make the first wait slighty longer, potentially going above the acceptable delta for this test. Let's add a dummy wait to preinitialize internal structures */ Sleep(100); - - /* + + /* * Check that Queueing an APC in the middle of a wait does interrupt * it, if it's in an alertable state. */ - RunTest(TRUE); - // Make sure that the wait returns in time greater than interrupt and less than + RunTest_WFMO_test2(TRUE); + // Make sure that the wait returns in time greater than interrupt and less than // wait timeout if ( - ((ThreadWaitDelta >= ChildThreadWaitTime) && (ThreadWaitDelta - ChildThreadWaitTime) > TOLERANCE) - || (( ThreadWaitDelta < InterruptTime) && (ThreadWaitDelta - InterruptTime) > TOLERANCE) + ((ThreadWaitDelta_WFMO_test2 >= ChildThreadWaitTime) && (ThreadWaitDelta_WFMO_test2 - ChildThreadWaitTime) > TOLERANCE) + || (( ThreadWaitDelta_WFMO_test2 < InterruptTime) && (InterruptTime - ThreadWaitDelta_WFMO_test2) > TOLERANCE) ) { Fail("Expected thread to wait for %d ms (and get interrupted).\n" - "Interrupt Time: %d ms, ThreadWaitDelta %u\n", - ChildThreadWaitTime, InterruptTime, ThreadWaitDelta); + "Interrupt Time: %d ms, ThreadWaitDelta %u\n", + ChildThreadWaitTime, InterruptTime, ThreadWaitDelta_WFMO_test2); } - /* - * Check that Queueing an APC in the middle of a wait does NOT interrupt + /* + * Check that Queueing an APC in the middle of a wait does NOT interrupt * it, if it is not in an alertable state. */ - RunTest(FALSE); + RunTest_WFMO_test2(FALSE); // Make sure that time taken for thread to return from wait is more than interrupt // and also not less than the complete child thread wait time - delta = ThreadWaitDelta - ChildThreadWaitTime; - if( (ThreadWaitDelta < ChildThreadWaitTime) && ( delta > TOLERANCE) ) + delta = ThreadWaitDelta_WFMO_test2 - ChildThreadWaitTime; + if( (ThreadWaitDelta_WFMO_test2 < ChildThreadWaitTime) && ( delta > TOLERANCE) ) { Fail("Expected thread to wait for %d ms (and not get interrupted).\n" - "Interrupt Time: %d ms, ThreadWaitDelta %u\n", - ChildThreadWaitTime, InterruptTime, ThreadWaitDelta); + "Interrupt Time: %d ms, ThreadWaitDelta %u\n", + ChildThreadWaitTime, InterruptTime, ThreadWaitDelta_WFMO_test2); } @@ -86,15 +86,15 @@ int __cdecl main( int argc, char **argv ) return PASS; } -void RunTest(BOOL AlertThread) +void RunTest_WFMO_test2(BOOL AlertThread) { HANDLE hThread = 0; DWORD dwThreadId = 0; int ret; - hThread = CreateThread( NULL, - 0, - (LPTHREAD_START_ROUTINE)WaiterProc, + hThread = CreateThread( NULL, + 0, + (LPTHREAD_START_ROUTINE)WaiterProc_WFMO_test2, (LPVOID) AlertThread, 0, &dwThreadId); @@ -107,28 +107,28 @@ void RunTest(BOOL AlertThread) Sleep(InterruptTime); - ret = QueueUserAPC(APCFunc, hThread, 0); + ret = QueueUserAPC(APCFunc_WFMO_test2, hThread, 0); if (ret == 0) { - Fail("QueueUserAPC failed! GetLastError returned %d\n", + Fail("QueueUserAPC failed! GetLastError returned %d\n", GetLastError()); } ret = WaitForSingleObject(hThread, INFINITE); if (ret == WAIT_FAILED) { - Fail("Unable to wait on child thread!\nGetLastError returned %d.\n", + Fail("Unable to wait on child thread!\nGetLastError returned %d.\n", GetLastError()); } } /* Function doesn't do anything, just needed to interrupt the wait*/ -VOID PALAPI APCFunc(ULONG_PTR dwParam) -{ +VOID PALAPI APCFunc_WFMO_test2(ULONG_PTR dwParam) +{ } /* Entry Point for child thread. */ -DWORD PALAPI WaiterProc(LPVOID lpParameter) +DWORD PALAPI WaiterProc_WFMO_test2(LPVOID lpParameter) { HANDLE Semaphore; UINT64 OldTimeStamp; @@ -137,7 +137,7 @@ DWORD PALAPI WaiterProc(LPVOID lpParameter) DWORD ret; /* Create a semaphore that is not in the signalled state */ - Semaphore = CreateSemaphoreW(NULL, 0, 1, NULL); + Semaphore = CreateSemaphoreExW(NULL, 0, 1, NULL, 0, 0); if (Semaphore == NULL) { @@ -155,9 +155,9 @@ DWORD PALAPI WaiterProc(LPVOID lpParameter) OldTimeStamp = GetHighPrecisionTimeStamp(performanceFrequency); - ret = WaitForMultipleObjectsEx(1, &Semaphore, FALSE, ChildThreadWaitTime, + ret = WaitForMultipleObjectsEx(1, &Semaphore, FALSE, ChildThreadWaitTime, Alertable); - + NewTimeStamp = GetHighPrecisionTimeStamp(performanceFrequency); @@ -172,7 +172,7 @@ DWORD PALAPI WaiterProc(LPVOID lpParameter) "Expected return of WAIT_TIMEOUT, got %d.\n", ret); } - ThreadWaitDelta = NewTimeStamp - OldTimeStamp; + ThreadWaitDelta_WFMO_test2 = NewTimeStamp - OldTimeStamp; ret = CloseHandle(Semaphore); if (!ret) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/testinfo.dat deleted file mode 100644 index b07246550250..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = WaitForMultipleObjectsEx -Name = Test #2 for WaitForMultipleObjectsEx -TYPE = DEFAULT -EXE1 = test2 -Description -=Tests that a child thread in the middle of a -=WaitForMultipleObjectsEx call will be interrupted by QueueUserAPC -=if the alert flag was set. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/CMakeLists.txt deleted file mode 100644 index ce267b1742dc..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test3.cpp -) - -add_executable(paltest_waitformultipleobjectsex_test3 - ${SOURCES} -) - -add_dependencies(paltest_waitformultipleobjectsex_test3 coreclrpal) - -target_link_libraries(paltest_waitformultipleobjectsex_test3 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.cpp index 88ff567566cb..319690e5ed0f 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.cpp @@ -20,7 +20,7 @@ const int ParentDelayTime = 2000; DWORD PALAPI AcquiringProc(LPVOID lpParameter); -int __cdecl main( int argc, char **argv) +PALTEST(threading_WaitForMultipleObjectsEx_test3_paltest_waitformultipleobjectsex_test3, "threading/WaitForMultipleObjectsEx/test3/paltest_waitformultipleobjectsex_test3") { HANDLE Mutex; HANDLE hThread = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/testinfo.dat deleted file mode 100644 index 09a5127c84e4..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = WaitForMultipleObjectsEx -Name = Test #3 for WaitForMultipleObjectsEx -TYPE = DEFAULT -EXE1 = test3 -Description -=Tests that waiting on an open mutex will a return -=WAIT_OBJECT_0. Does this by creating a child thread that -=acquires the mutex, releases it, and exits. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/CMakeLists.txt deleted file mode 100644 index ed81a5323d0c..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - test4.cpp -) - -add_executable(paltest_waitformultipleobjectsex_test4 - ${SOURCES} -) - -add_dependencies(paltest_waitformultipleobjectsex_test4 coreclrpal) - -target_link_libraries(paltest_waitformultipleobjectsex_test4 - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.cpp index c648a7c1e2ed..c1589702a44c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.cpp @@ -20,7 +20,7 @@ const int ParentDelayTime = 2000; DWORD PALAPI AbandoningProc(LPVOID lpParameter); -int __cdecl main( int argc, char **argv ) +PALTEST(threading_WaitForMultipleObjectsEx_test4_paltest_waitformultipleobjectsex_test4, "threading/WaitForMultipleObjectsEx/test4/paltest_waitformultipleobjectsex_test4") { HANDLE Mutex; HANDLE hThread = 0; diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/testinfo.dat deleted file mode 100644 index a7c0264de62b..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/testinfo.dat +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = WaitForMultipleObjectsEx -Name = Test #4 for WaitForMultipleObjectsEx -TYPE = DEFAULT -EXE1 = test4 -Description -=Tests that waiting on an abandonded mutex will a return -=WAIT_ABANDONED_0. Does this by creating a child thread that -=acquires the mutex and exits. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/CMakeLists.txt deleted file mode 100644 index bf7846aa87ae..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test5.cpp -) - -add_executable(paltest_waitformultipleobjectsex_test5 - ${TESTSOURCES} -) - -add_dependencies(paltest_waitformultipleobjectsex_test5 coreclrpal) - -target_link_libraries(paltest_waitformultipleobjectsex_test5 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - helper.cpp -) - -add_executable(paltest_waitformultipleobjectsex_test5_helper - ${HELPERSOURCES} -) - -add_dependencies(paltest_waitformultipleobjectsex_test5_helper coreclrpal) - -target_link_libraries(paltest_waitformultipleobjectsex_test5_helper - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/commonconsts.h b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/commonconsts.h index 79283500546b..d4e26e4d4783 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/commonconsts.h +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/commonconsts.h @@ -15,9 +15,9 @@ const int TIMEOUT = 60 * 5 * 1000; -char *szcHelperProcessStartEvName = "start"; -char *szcHelperProcessReadyEvName = "ready"; -char *szcHelperProcessFinishEvName = "finish"; +#define szcHelperProcessStartEvName "start" +#define szcHelperProcessReadyEvName "ready" +#define szcHelperProcessFinishEvName "finish" /* PEDANTIC and PEDANTIC0 is a helper macro that just grumps about any * zero return codes in a generic way. with little typing */ diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.cpp index 9bfb85af357a..de39bad98a3c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.cpp @@ -16,13 +16,13 @@ #include -HANDLE hProcessStartEvent; +HANDLE hProcessStartEvent_WFMO_test5_helper; HANDLE hProcessReadyEvent; HANDLE hProcessFinishEvent; HANDLE hProcessCleanupEvent; -int __cdecl main(int argc, char *argv[]) +PALTEST(threading_WaitForMultipleObjectsEx_test5_paltest_waitformultipleobjectsex_test5_helper, "threading/WaitForMultipleObjectsEx/test5/paltest_waitformultipleobjectsex_test5_helper") { BOOL success = TRUE; /* assume success */ @@ -38,9 +38,9 @@ int __cdecl main(int argc, char *argv[]) /* Open the event to let test thread tell us to get started. */ uniString = convert(szcHelperProcessStartEvName); - hProcessStartEvent = OpenEventW(EVENT_ALL_ACCESS, 0, uniString); + hProcessStartEvent_WFMO_test5_helper = OpenEventW(EVENT_ALL_ACCESS, 0, uniString); free(uniString); - if (!hProcessStartEvent) + if (!hProcessStartEvent_WFMO_test5_helper) { Fail("helper.main: OpenEvent of '%S' failed (%u). " "(the event should already exist!)\n", @@ -48,7 +48,7 @@ int __cdecl main(int argc, char *argv[]) } /* Wait for signal from test thread. */ - dwRet = WaitForSingleObject(hProcessStartEvent, TIMEOUT); + dwRet = WaitForSingleObject(hProcessStartEvent_WFMO_test5_helper, TIMEOUT); if (dwRet != WAIT_OBJECT_0) { Fail("helper.main: WaitForSingleObject '%s' failed\n" @@ -111,11 +111,11 @@ int __cdecl main(int argc, char *argv[]) szcHelperProcessFinishEvName, dwProcessId, GetLastError()); } - PEDANTIC(CloseHandle, (hProcessStartEvent)); + PEDANTIC(CloseHandle, (hProcessStartEvent_WFMO_test5_helper)); PEDANTIC(CloseHandle, (hProcessReadyEvent)); PEDANTIC(CloseHandle, (hProcessFinishEvent)); - PAL_Terminate(); + PAL_TerminateEx(success ? PASS : FAIL); return success ? PASS : FAIL; } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.cpp index 0704fad832a0..23c7e5eb028b 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.cpp @@ -54,7 +54,7 @@ struct helper_process_t HANDLE hProcessFinishEvent; } helper_process[MAX_HELPER_PROCESS]; -HANDLE hProcessStartEvent; +HANDLE hProcessStartEvent_WFMO_test5; struct helper_thread_t { @@ -149,9 +149,9 @@ Setup() /* Create the event to start helper process after it was created. */ uniString = convert(szcHelperProcessStartEvName); - hProcessStartEvent = CreateEvent(NULL, TRUE, FALSE, uniString); + hProcessStartEvent_WFMO_test5 = CreateEvent(NULL, TRUE, FALSE, uniString); free(uniString); - if (!hProcessStartEvent) + if (!hProcessStartEvent_WFMO_test5) { Fail("test5.Setup: CreateEvent of '%s' failed. " "GetLastError() returned %d.\n", szcHelperProcessStartEvName, @@ -214,7 +214,7 @@ Setup() free(uniStringHelper); /* Signal all helper processes to start. */ - if (!SetEvent(hProcessStartEvent)) + if (!SetEvent(hProcessStartEvent_WFMO_test5)) { Fail("test5.Setup: SetEvent '%s' failed\n", "LastError:(%u)\n", @@ -282,7 +282,7 @@ Setup() * Cleanup the helper processes and helper threads. */ DWORD -Cleanup() +Cleanup_WFMO_test5() { DWORD dwExitCode; DWORD dwRet; @@ -323,7 +323,7 @@ Cleanup() } /* Close all process start event. */ - PEDANTIC(CloseHandle, (hProcessStartEvent)); + PEDANTIC(CloseHandle, (hProcessStartEvent_WFMO_test5)); return dwExitCode; } @@ -463,7 +463,7 @@ TestWakeupAllThread() } } -int __cdecl main(int argc, char *argv[]) +PALTEST(threading_WaitForMultipleObjectsEx_test5_paltest_waitformultipleobjectsex_test5, "threading/WaitForMultipleObjectsEx/test5/paltest_waitformultipleobjectsex_test5") { DWORD dwExitCode; @@ -491,13 +491,13 @@ int __cdecl main(int argc, char *argv[]) Setup(); ThreadIndexOfThreadFinishEvent = 3; TestWakeupOneThread(); - dwExitCode = Cleanup(); + dwExitCode = Cleanup_WFMO_test5(); if (PASS == dwExitCode) { Setup(); TestWakeupAllThread(); - dwExitCode = Cleanup(); + dwExitCode = Cleanup_WFMO_test5(); } PAL_TerminateEx(dwExitCode); diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/testinfo.dat deleted file mode 100644 index d782113d10ad..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/testinfo.dat +++ /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. - -Version = 1.0 -Section = threading -Function = WaitForMultipleObjectsEx -Name = Check simultaneously waiting on multiple processes. -TYPE = DEFAULT -EXE1 = test5 -EXE2 = helper -Description -= Create a number of helper processes and helper threads. -= Helper threads wait on helper processes to finish. -= Helper processes wait on the event signal from test -= thread before exit. The test thread then selectively -= signals helper process to finish and then wait on the -= selected helper thread to finish. diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/CMakeLists.txt deleted file mode 100644 index 6775951ada46..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -set(TESTSOURCES - test6.cpp -) - -add_executable(paltest_waitformultipleobjectsex_test6 - ${TESTSOURCES} -) - -add_dependencies(paltest_waitformultipleobjectsex_test6 coreclrpal) - -target_link_libraries(paltest_waitformultipleobjectsex_test6 - ${COMMON_TEST_LIBRARIES} -) - - -set(HELPERSOURCES - child6.cpp -) - -add_executable(paltest_waitformultipleobjectsex_test6_child - ${HELPERSOURCES} -) - -add_dependencies(paltest_waitformultipleobjectsex_test6_child coreclrpal) - -target_link_libraries(paltest_waitformultipleobjectsex_test6_child - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.cpp index bec5bb3f1160..618c5edeca55 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.cpp @@ -3,9 +3,9 @@ /*============================================================ ** -** Source: child6.c +** Source: child6.c ** -** Purpose: Test for WaitForMultipleObjectsEx in multiple +** Purpose: Test for WaitForMultipleObjectsEx in multiple ** scenarios - child process ** ** @@ -13,7 +13,7 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(threading_WaitForMultipleObjectsEx_test6_paltest_waitformultipleobjectsex_test6_child, "threading/WaitForMultipleObjectsEx/test6/paltest_waitformultipleobjectsex_test6_child") { int i, iRet; BOOL bRet; @@ -34,7 +34,7 @@ int __cdecl main(int argc, char **argv) WCHAR wszSemName[128]; DWORD iExitCode = 0; HANDLE hSemaphore; - + if(0 != (PAL_Initialize(argc, argv))) { return ( FAIL ); @@ -71,7 +71,7 @@ int __cdecl main(int argc, char **argv) { strncpy(szTestName, argv[i], 256); szTestName[255] = 0; - iRet = MultiByteToWideChar(CP_ACP, 0, szTestName, strlen(szTestName)+1, wszTestName, 256); + iRet = MultiByteToWideChar(CP_ACP, 0, szTestName, strlen(szTestName)+1, wszTestName, 256); if (0 == iRet) { Fail("Failed to convert test string\n"); @@ -106,19 +106,19 @@ int __cdecl main(int argc, char **argv) hMutex = OpenMutexW(0, FALSE, wszMutexName); if (NULL == hMutex) { - Fail("[child] OpenMutexW failed [GetLastError()=%u]\n", + Fail("[child] OpenMutexW failed [GetLastError()=%u]\n", GetLastError()); } - hSemaphore = CreateSemaphoreW(NULL, 0, 256, wszSemName); + hSemaphore = CreateSemaphoreExW(NULL, 0, 256, wszSemName, 0, 0); if (NULL == hSemaphore) { Fail("[child] CreateSemaphore failed [GetLastError()=%u]\n", GetLastError()); } - + if (bMutex) - { + { Trace("[child] Going to wait on mutex %s\n", szMutexName); dwRet = WaitForSingleObject(hMutex, INFINITE); if (WAIT_FAILED == dwRet) @@ -135,10 +135,10 @@ int __cdecl main(int argc, char **argv) GetLastError()); } - // mutex will be abandoned + // mutex will be abandoned } else if (bMutexAndNamedEvent) - { + { dwRet = WaitForSingleObject(hMutex, INFINITE); if (WAIT_FAILED == dwRet) { @@ -166,7 +166,7 @@ int __cdecl main(int argc, char **argv) } else if (bSemaphore) { - LONG lPrevCount = 42; + LONG lPrevCount = 42; Trace("[child] Going to wait on event %s\n", szEventName); @@ -187,12 +187,12 @@ int __cdecl main(int argc, char **argv) if (0 != lPrevCount) { Fail("Previous count from semaphore=%d, expected 0\n", lPrevCount); - } + } } else if (bNamedEvent) - { + { Sleep(1000); - + bRet = SetEvent(hNamedEvent); if (FALSE == bRet) { @@ -204,7 +204,7 @@ int __cdecl main(int argc, char **argv) Sleep(1000); Trace("[child] Done\n"); - + PAL_TerminateEx(iExitCode); return iExitCode; } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.cpp index 45e8c7f04aeb..80ecbaa2016c 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.cpp @@ -3,9 +3,9 @@ /*============================================================ ** -** Source: test6.c +** Source: test6.c ** -** Purpose: Test for WaitForMultipleObjectsEx in multiple +** Purpose: Test for WaitForMultipleObjectsEx in multiple ** scenarios ** ** @@ -42,9 +42,9 @@ DWORD PALAPI EventTestThread(PVOID pArg) Trace("[EventTestThread] Starting\n"); - bRet = DuplicateHandle(GetCurrentProcess(), (*prgHandles)[0], GetCurrentProcess(), + bRet = DuplicateHandle(GetCurrentProcess(), (*prgHandles)[0], GetCurrentProcess(), &hEvent[0], 0, FALSE, DUPLICATE_SAME_ACCESS); - bRet &= DuplicateHandle(GetCurrentProcess(), (*prgHandles)[1], GetCurrentProcess(), + bRet &= DuplicateHandle(GetCurrentProcess(), (*prgHandles)[1], GetCurrentProcess(), &hEvent[1], 0, FALSE, DUPLICATE_SAME_ACCESS); if (FALSE == bRet) { @@ -66,7 +66,7 @@ DWORD PALAPI EventTestThread(PVOID pArg) Fail("[EventTestThread] WaitForMultipleObjects failed [GetLastError()=%u]\n", GetLastError()); } - + Sleep(1000); bRet = SetEvent(hEvent[0]); if (FALSE == bRet) @@ -98,7 +98,7 @@ DWORD PALAPI MutexTestThread(PVOID pArg) Trace("[MutexTestThread] Starting\n"); - bRet = DuplicateHandle(GetCurrentProcess(), (HANDLE)pArg, GetCurrentProcess(), &hMutex, + bRet = DuplicateHandle(GetCurrentProcess(), (HANDLE)pArg, GetCurrentProcess(), &hMutex, 0, FALSE, DUPLICATE_SAME_ACCESS); if (FALSE == bRet) { @@ -132,7 +132,7 @@ DWORD PALAPI TestThread(PVOID pArg) HANDLE hMutex = 0; HANDLE hSemaphore = 0; HANDLE hObjs[2]; - DWORD dwThreadNum; + DWORD dwThreadNum; DWORD dwSlaveThreadTid = 0; HANDLE hThread; int i, iCnt, iRet; @@ -152,7 +152,7 @@ DWORD PALAPI TestThread(PVOID pArg) BOOL bLocalWaitAll = g_bLocalWaitAll; BOOL bRemoteWaitAll = g_bRemoteWaitAll; int iDesiredExitCode; - + dwThreadNum = (DWORD)(SIZE_T)pArg; sprintf_s (szTestName, 128, "Test6_%u", dwThreadNum); @@ -177,14 +177,14 @@ DWORD PALAPI TestThread(PVOID pArg) Trace("[TestThread] TestName=%s Event: %S, Mutex: %S, Semaphore = %S\n", szTestName, wszEventName, wszMutexName, wszSemName); - hEvent[0] = CreateEventA(NULL, FALSE, FALSE, NULL); - hEvent[1] = CreateEventA(NULL, FALSE, FALSE, NULL); + hEvent[0] = CreateEvent(NULL, FALSE, FALSE, NULL); + hEvent[1] = CreateEvent(NULL, FALSE, FALSE, NULL); hNamedEvent = CreateEventW(NULL, FALSE, FALSE, wszEventName); hMutex = CreateMutexW(NULL, FALSE, wszMutexName); - hSemaphore = CreateSemaphoreW(NULL, 0, 256, wszSemName); + hSemaphore = CreateSemaphoreExW(NULL, 0, 256, wszSemName, 0, 0); - if (NULL == hEvent[0] || NULL == hEvent[1] || NULL == hMutex || + if (NULL == hEvent[0] || NULL == hEvent[1] || NULL == hMutex || NULL == hNamedEvent || NULL == hSemaphore) { Fail("[TestThread] Failed to create objects " @@ -244,14 +244,14 @@ DWORD PALAPI TestThread(PVOID pArg) Fail("Failed to create thread\n"); } - hObjs[0] = hEvent[0]; + hObjs[0] = hEvent[0]; dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE); if (WAIT_FAILED == dwRet) { Fail("WaitForMultipleObjects failed\n"); } - hObjs[0] = hThread; + hObjs[0] = hThread; dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE); if (WAIT_FAILED == dwRet) { @@ -321,14 +321,16 @@ DWORD PALAPI TestThread(PVOID pArg) ZeroMemory ( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory ( &pi, sizeof(pi) ); - + sprintf_s (szCmd, 128, "child6 -event %s", szTestName); szCmd[127] = 0; - bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + LPWSTR szCmdW = convert(szCmd); + bRet = CreateProcessW(NULL, szCmdW, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + free(szCmdW); if (FALSE == bRet) { - Fail("CreateProcess failed [GetLastError()=%u]\n", + Fail("CreateProcessW failed [GetLastError()=%u]\n", GetLastError()); } @@ -341,7 +343,7 @@ DWORD PALAPI TestThread(PVOID pArg) Fail("WaitForMultipleObjects failed [dwRet=%u GetLastError()=%u]\n", dwRet, GetLastError()); } - + dwRet = WaitForSingleObject(pi.hProcess, INFINITE); if (WAIT_FAILED == dwRet) { @@ -364,15 +366,18 @@ DWORD PALAPI TestThread(PVOID pArg) sprintf_s (szCmd, 128, "child6 -semaphore %s", szTestName); szCmd[127] = 0; - - bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, + + LPWSTR szCmdW = convert(szCmd); + bRet = CreateProcessW(NULL, szCmdW, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + free(szCmdW); if (FALSE == bRet) { - Fail("CreateProcessA failed [GetLastError()=%u]\n", + Fail("CreateProcessW failed [GetLastError()=%u]\n", GetLastError()); } + Trace("Setting event %s\n", szEventName); bRet = SetEvent(hNamedEvent); if (FALSE == bRet) @@ -407,28 +412,30 @@ DWORD PALAPI TestThread(PVOID pArg) Trace("Semaphore with remote thread awakening test done\n"); Trace("======================================================================\n"); } - + if (bProcess) - { - DWORD dwExitCode; + { + DWORD dwExitCode; Trace("======================================================================\n"); Trace("Process wait test\n"); Trace("----------------------------------------\n"); - - iDesiredExitCode = rand() % 0xFF; - - ZeroMemory ( &si, sizeof(si) ); + + iDesiredExitCode = rand() % 0xFF; + + ZeroMemory ( &si, sizeof(si) ); si.cb = sizeof(si); - ZeroMemory ( &pi, sizeof(pi) ); - + ZeroMemory ( &pi, sizeof(pi) ); + sprintf_s (szCmd, 128, "child6 -mutex %s -exitcode %d", szTestName, iDesiredExitCode); szCmd[127] = 0; - - bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + + LPWSTR szCmdW = convert(szCmd); + bRet = CreateProcessW(NULL, szCmdW, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + free(szCmdW); if (FALSE == bRet) { - Fail("CreateProcess failed [GetLastError()=%u]\n", + Fail("CreateProcessW failed [GetLastError()=%u]\n", GetLastError()); } @@ -458,7 +465,7 @@ DWORD PALAPI TestThread(PVOID pArg) GetLastError()); } } - + dwRet = WaitForSingleObject(pi.hProcess, INFINITE); if (WAIT_FAILED == dwRet) { @@ -468,8 +475,8 @@ DWORD PALAPI TestThread(PVOID pArg) if (!GetExitCodeProcess(pi.hProcess, &dwExitCode)) { - Trace("GetExitCodeProcess call failed LastError:(%u)\n", - GetLastError()); + Trace("GetExitCodeProcess call failed LastError:(%u)\n", + GetLastError()); dwExitCode = FAIL; } @@ -503,7 +510,7 @@ DWORD PALAPI TestThread(PVOID pArg) GetLastError()); } - hObjs[0] = hThread; + hObjs[0] = hThread; dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE); if (WAIT_FAILED == dwRet) { @@ -525,15 +532,17 @@ DWORD PALAPI TestThread(PVOID pArg) ZeroMemory ( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory ( &pi, sizeof(pi) ); - + sprintf_s (szCmd, 128, "child6 -mutex_and_named_event %s", szTestName); szCmd[127] = 0; - bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, + LPWSTR szCmdW = convert(szCmd); + bRet = CreateProcessW(NULL, szCmdW, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + free(szCmdW); if (FALSE == bRet) { - Fail("CreateProcess failed [GetLastError()=%u]\n", + Fail("CreateProcessW failed [GetLastError()=%u]\n", GetLastError()); } @@ -555,7 +564,7 @@ DWORD PALAPI TestThread(PVOID pArg) Fail("ReleaseMutex failed [GetLastError()=%u]\n", GetLastError()); } - + dwRet = WaitForSingleObject(pi.hProcess, INFINITE); if (WAIT_FAILED == dwRet) { @@ -568,12 +577,12 @@ DWORD PALAPI TestThread(PVOID pArg) Trace("WaitAll with remote thread awakening test done\n"); Trace("======================================================================\n"); } - } + } return 0; } -int __cdecl main(int argc, char **argv) +PALTEST(threading_WaitForMultipleObjectsEx_test6_paltest_waitformultipleobjectsex_test6, "threading/WaitForMultipleObjectsEx/test6/paltest_waitformultipleobjectsex_test6") { DWORD dwRet; DWORD dwSlaveThreadTid = 0; @@ -596,7 +605,7 @@ int __cdecl main(int argc, char **argv) g_bLocalWaitAll = 1; g_bRemoteWaitAll = 1; } - else + else { for (i=1;i diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/CMakeLists.txt deleted file mode 100644 index 9620d700dd41..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_subdirectory(test1) -add_subdirectory(WFSOExMutexTest) -add_subdirectory(WFSOExSemaphoreTest) -add_subdirectory(WFSOExThreadTest) -add_subdirectory(WFSOMutexTest) -add_subdirectory(WFSOProcessTest) -add_subdirectory(WFSOSemaphoreTest) -add_subdirectory(WFSOThreadTest) - diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/CMakeLists.txt deleted file mode 100644 index 838108b33106..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - WFSOExMutexTest.cpp -) - -add_executable(paltest_waitforsingleobject_wfsoexmutextest - ${SOURCES} -) - -add_dependencies(paltest_waitforsingleobject_wfsoexmutextest coreclrpal) - -target_link_libraries(paltest_waitforsingleobject_wfsoexmutextest - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp index 086a876d6e86..4241df19f98b 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp @@ -20,16 +20,16 @@ const int ChildThreadWaitTime = 4000; const int InterruptTime = 2000; const DWORD AcceptableDelta = 300; -void RunTest(BOOL AlertThread); -VOID PALAPI APCFunc(ULONG_PTR dwParam); -DWORD PALAPI WaiterProc(LPVOID lpParameter); +void RunTest_WFSOExMutexTest(BOOL AlertThread); +VOID PALAPI APCFunc_WFSOExMutexTest(ULONG_PTR dwParam); +DWORD PALAPI WaiterProc_WFSOExMutexTest(LPVOID lpParameter); -DWORD ThreadWaitDelta; -HANDLE hMutex; +DWORD ThreadWaitDelta_WFSOExMutexTest; +HANDLE hMutex_WFSOExMutexTest; -int __cdecl main( int argc, char **argv ) +PALTEST(threading_WaitForSingleObject_WFSOExMutexTest_paltest_waitforsingleobject_wfsoexmutextest, "threading/WaitForSingleObject/WFSOExMutexTest/paltest_waitforsingleobject_wfsoexmutextest") { int ret=0; @@ -58,11 +58,11 @@ int __cdecl main( int argc, char **argv ) */ /* Create a mutex that is not in the signalled state */ - hMutex = CreateMutex(NULL, //No security attributes + hMutex_WFSOExMutexTest = CreateMutex(NULL, //No security attributes TRUE, //Iniitally owned NULL); //Name of mutex - if (hMutex == NULL) + if (hMutex_WFSOExMutexTest == NULL) { Fail("Failed to create mutex! GetLastError returned %d.\n", GetLastError()); @@ -72,12 +72,12 @@ int __cdecl main( int argc, char **argv ) * it, if it's in an alertable state. */ - RunTest(TRUE); - if ((ThreadWaitDelta - InterruptTime) > AcceptableDelta) + RunTest_WFSOExMutexTest(TRUE); + if ((ThreadWaitDelta_WFSOExMutexTest - InterruptTime) > AcceptableDelta) { Fail("Expected thread to wait for %d ms (and get interrupted).\n" "Thread waited for %d ms! (Acceptable delta: %d)\n", - InterruptTime, ThreadWaitDelta, AcceptableDelta); + InterruptTime, ThreadWaitDelta_WFSOExMutexTest, AcceptableDelta); } @@ -85,18 +85,18 @@ int __cdecl main( int argc, char **argv ) * Check that Queueing an APC in the middle of a wait does NOT interrupt * it, if it is not in an alertable state. */ - RunTest(FALSE); - if ((ThreadWaitDelta - ChildThreadWaitTime) > AcceptableDelta) + RunTest_WFSOExMutexTest(FALSE); + if ((ThreadWaitDelta_WFSOExMutexTest - ChildThreadWaitTime) > AcceptableDelta) { Fail("Expected thread to wait for %d ms (and not be interrupted).\n" "Thread waited for %d ms! (Acceptable delta: %d)\n", - ChildThreadWaitTime, ThreadWaitDelta, AcceptableDelta); + ChildThreadWaitTime, ThreadWaitDelta_WFSOExMutexTest, AcceptableDelta); } //Release Mutex - ret = ReleaseMutex(hMutex); + ret = ReleaseMutex(hMutex_WFSOExMutexTest); if (0==ret) { Fail("Unable to Release Mutex!\n" @@ -104,7 +104,7 @@ int __cdecl main( int argc, char **argv ) } //Close Mutex Handle - ret = CloseHandle(hMutex); + ret = CloseHandle(hMutex_WFSOExMutexTest); if (!ret) { Fail("Unable to close handle to Mutex!\n" @@ -115,7 +115,7 @@ int __cdecl main( int argc, char **argv ) return PASS; } -void RunTest(BOOL AlertThread) +void RunTest_WFSOExMutexTest(BOOL AlertThread) { HANDLE hThread = 0; @@ -125,7 +125,7 @@ void RunTest(BOOL AlertThread) hThread = CreateThread( NULL, 0, - (LPTHREAD_START_ROUTINE)WaiterProc, + (LPTHREAD_START_ROUTINE)WaiterProc_WFSOExMutexTest, (LPVOID) AlertThread, 0, &dwThreadId); @@ -140,7 +140,7 @@ void RunTest(BOOL AlertThread) Sleep(InterruptTime); - ret = QueueUserAPC(APCFunc, hThread, 0); + ret = QueueUserAPC(APCFunc_WFSOExMutexTest, hThread, 0); if (ret == 0) { @@ -165,12 +165,12 @@ void RunTest(BOOL AlertThread) } /* Function doesn't do anything, just needed to interrupt the wait*/ -VOID PALAPI APCFunc(ULONG_PTR dwParam) +VOID PALAPI APCFunc_WFSOExMutexTest(ULONG_PTR dwParam) { } /* Entry Point for child thread. */ -DWORD PALAPI WaiterProc(LPVOID lpParameter) +DWORD PALAPI WaiterProc_WFSOExMutexTest(LPVOID lpParameter) { UINT64 OldTimeStamp; UINT64 NewTimeStamp; @@ -187,7 +187,7 @@ DWORD PALAPI WaiterProc(LPVOID lpParameter) OldTimeStamp = GetHighPrecisionTimeStamp(performanceFrequency); - ret = WaitForSingleObjectEx( hMutex, + ret = WaitForSingleObjectEx( hMutex_WFSOExMutexTest, ChildThreadWaitTime, Alertable); @@ -204,7 +204,7 @@ DWORD PALAPI WaiterProc(LPVOID lpParameter) "Expected return of WAIT_TIMEOUT, got %d.\n", ret); } - ThreadWaitDelta = NewTimeStamp - OldTimeStamp; + ThreadWaitDelta_WFSOExMutexTest = NewTimeStamp - OldTimeStamp; return 0; } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/CMakeLists.txt deleted file mode 100644 index d28d3eba34bb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - WFSOExSemaphoreTest.cpp -) - -add_executable(paltest_waitforsingleobject_wfsoexsemaphoretest - ${SOURCES} -) - -add_dependencies(paltest_waitforsingleobject_wfsoexsemaphoretest coreclrpal) - -target_link_libraries(paltest_waitforsingleobject_wfsoexsemaphoretest - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp index 56675cb79527..0f10218bcd05 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp @@ -5,7 +5,7 @@ ** ** Source: WFSOExSemaphore.c ** -** Purpose: Tests a child thread in the middle of a +** Purpose: Tests a child thread in the middle of a ** WaitForSingleObjectEx call will be interrupted by QueueUserAPC ** if the alert flag was set. ** @@ -20,13 +20,13 @@ const int ChildThreadWaitTime = 4000; const int InterruptTime = 2000; const DWORD AcceptableDelta = 300; -void RunTest(BOOL AlertThread); -VOID PALAPI APCFunc(ULONG_PTR dwParam); -DWORD PALAPI WaiterProc(LPVOID lpParameter); +void RunTest_WFSOExSemaphoreTest(BOOL AlertThread); +VOID PALAPI APCFunc_WFSOExSemaphoreTest(ULONG_PTR dwParam); +DWORD PALAPI WaiterProc_WFSOExSemaphoreTest(LPVOID lpParameter); -DWORD ThreadWaitDelta; +DWORD ThreadWaitDelta_WFSOExSemaphoreTest; -int __cdecl main( int argc, char **argv ) +PALTEST(threading_WaitForSingleObject_WFSOExSemaphoreTest_paltest_waitforsingleobject_wfsoexsemaphoretest, "threading/WaitForSingleObject/WFSOExSemaphoreTest/paltest_waitforsingleobject_wfsoexsemaphoretest") { if (0 != (PAL_Initialize(argc, argv))) { @@ -34,38 +34,38 @@ int __cdecl main( int argc, char **argv ) } /* - On some platforms (e.g. FreeBSD 4.9) the first call to some synch objects - (such as conditions) involves some pthread internal initialization that + On some platforms (e.g. FreeBSD 4.9) the first call to some synch objects + (such as conditions) involves some pthread internal initialization that can make the first wait slighty longer, potentially going above the acceptable delta for this test. Let's add a dummy wait to preinitialize internal structures */ Sleep(100); - /* + /* * Check that Queueing an APC in the middle of a wait does interrupt * it, if it's in an alertable state. */ - RunTest(TRUE); - if ((ThreadWaitDelta - InterruptTime) > AcceptableDelta) + RunTest_WFSOExSemaphoreTest(TRUE); + if ((ThreadWaitDelta_WFSOExSemaphoreTest - InterruptTime) > AcceptableDelta) { Fail("Expected thread to wait for %d ms (and get interrupted).\n" - "Thread waited for %d ms! (Acceptable delta: %d)\n", - InterruptTime, ThreadWaitDelta, AcceptableDelta); + "Thread waited for %d ms! (Acceptable delta: %d)\n", + InterruptTime, ThreadWaitDelta_WFSOExSemaphoreTest, AcceptableDelta); } - /* - * Check that Queueing an APC in the middle of a wait does NOT interrupt + /* + * Check that Queueing an APC in the middle of a wait does NOT interrupt * it, if it is not in an alertable state. */ - RunTest(FALSE); - if ((ThreadWaitDelta - ChildThreadWaitTime) > AcceptableDelta) + RunTest_WFSOExSemaphoreTest(FALSE); + if ((ThreadWaitDelta_WFSOExSemaphoreTest - ChildThreadWaitTime) > AcceptableDelta) { Fail("Expected thread to wait for %d ms (and not be interrupted).\n" - "Thread waited for %d ms! (Acceptable delta: %d)\n", - ChildThreadWaitTime, ThreadWaitDelta, AcceptableDelta); + "Thread waited for %d ms! (Acceptable delta: %d)\n", + ChildThreadWaitTime, ThreadWaitDelta_WFSOExSemaphoreTest, AcceptableDelta); } @@ -73,15 +73,15 @@ int __cdecl main( int argc, char **argv ) return PASS; } -void RunTest(BOOL AlertThread) +void RunTest_WFSOExSemaphoreTest(BOOL AlertThread) { HANDLE hThread = 0; DWORD dwThreadId = 0; int ret; - hThread = CreateThread( NULL, - 0, - (LPTHREAD_START_ROUTINE)WaiterProc, + hThread = CreateThread( NULL, + 0, + (LPTHREAD_START_ROUTINE)WaiterProc_WFSOExSemaphoreTest, (LPVOID) AlertThread, 0, &dwThreadId); @@ -94,34 +94,34 @@ void RunTest(BOOL AlertThread) Sleep(InterruptTime); - ret = QueueUserAPC(APCFunc, hThread, 0); + ret = QueueUserAPC(APCFunc_WFSOExSemaphoreTest, hThread, 0); if (ret == 0) { - Fail("QueueUserAPC failed! GetLastError returned %d\n", + Fail("QueueUserAPC failed! GetLastError returned %d\n", GetLastError()); } ret = WaitForSingleObject(hThread, INFINITE); if (ret == WAIT_FAILED) { - Fail("Unable to wait on child thread!\nGetLastError returned %d.\n", + Fail("Unable to wait on child thread!\nGetLastError returned %d.\n", GetLastError()); } if (0==CloseHandle(hThread)) { - Trace("Could not close Thread handle\n"); - Fail ( "GetLastError returned %d\n", GetLastError()); - } + Trace("Could not close Thread handle\n"); + Fail ( "GetLastError returned %d\n", GetLastError()); + } } /* Function doesn't do anything, just needed to interrupt the wait*/ -VOID PALAPI APCFunc(ULONG_PTR dwParam) -{ +VOID PALAPI APCFunc_WFSOExSemaphoreTest(ULONG_PTR dwParam) +{ } /* Entry Point for child thread. */ -DWORD PALAPI WaiterProc(LPVOID lpParameter) +DWORD PALAPI WaiterProc_WFSOExSemaphoreTest(LPVOID lpParameter) { HANDLE hSemaphore; UINT64 OldTimeStamp; @@ -136,7 +136,7 @@ DWORD PALAPI WaiterProc(LPVOID lpParameter) } /* Create a semaphore that is not in the signalled state */ - hSemaphore = CreateSemaphoreW(NULL, 0, 1, NULL); + hSemaphore = CreateSemaphoreExW(NULL, 0, 1, NULL, 0, 0); if (hSemaphore == NULL) { @@ -148,10 +148,10 @@ DWORD PALAPI WaiterProc(LPVOID lpParameter) OldTimeStamp = GetHighPrecisionTimeStamp(performanceFrequency); - ret = WaitForSingleObjectEx( hSemaphore, - ChildThreadWaitTime, + ret = WaitForSingleObjectEx( hSemaphore, + ChildThreadWaitTime, Alertable); - + NewTimeStamp = GetHighPrecisionTimeStamp(performanceFrequency); @@ -167,7 +167,7 @@ DWORD PALAPI WaiterProc(LPVOID lpParameter) } - ThreadWaitDelta = NewTimeStamp - OldTimeStamp; + ThreadWaitDelta_WFSOExSemaphoreTest = NewTimeStamp - OldTimeStamp; ret = CloseHandle(hSemaphore); if (!ret) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/CMakeLists.txt deleted file mode 100644 index 683525d8c21d..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - WFSOExThreadTest.cpp -) - -add_executable(paltest_waitforsingleobject_wfsoexthreadtest - ${SOURCES} -) - -add_dependencies(paltest_waitforsingleobject_wfsoexthreadtest coreclrpal) - -target_link_libraries(paltest_waitforsingleobject_wfsoexthreadtest - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp index c1068b4f6005..632e8ead536d 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp @@ -20,14 +20,14 @@ const int ChildThreadWaitTime = 4000; const int InterruptTime = 2000; const DWORD AcceptableDelta = 300; -void RunTest(BOOL AlertThread); -VOID PALAPI APCFunc(ULONG_PTR dwParam); -DWORD PALAPI WaiterProc(LPVOID lpParameter); -void WorkerThread(void); +void RunTest_WFSOExThreadTest(BOOL AlertThread); +VOID PALAPI APCFunc_WFSOExThreadTest(ULONG_PTR dwParam); +DWORD PALAPI WaiterProc_WFSOExThreadTest(LPVOID lpParameter); +void WorkerThread_WFSOExThreadTest(void); -int ThreadWaitDelta; +int ThreadWaitDelta_WFSOExThreadTest; -int __cdecl main( int argc, char **argv ) +PALTEST(threading_WaitForSingleObject_WFSOExThreadTest_paltest_waitforsingleobject_wfsoexthreadtest, "threading/WaitForSingleObject/WFSOExThreadTest/paltest_waitforsingleobject_wfsoexthreadtest") { if (0 != (PAL_Initialize(argc, argv))) { @@ -48,12 +48,12 @@ int __cdecl main( int argc, char **argv ) * it, if it's in an alertable state. */ - RunTest(TRUE); - if (abs(ThreadWaitDelta - InterruptTime) > AcceptableDelta) + RunTest_WFSOExThreadTest(TRUE); + if (abs(ThreadWaitDelta_WFSOExThreadTest - InterruptTime) > AcceptableDelta) { Fail("Expected thread to wait for %d ms (and get interrupted).\n" "Thread waited for %d ms! (Acceptable delta: %d)\n", - InterruptTime, ThreadWaitDelta, AcceptableDelta); + InterruptTime, ThreadWaitDelta_WFSOExThreadTest, AcceptableDelta); } @@ -61,12 +61,12 @@ int __cdecl main( int argc, char **argv ) * Check that Queueing an APC in the middle of a wait does NOT interrupt * it, if it is not in an alertable state. */ - RunTest(FALSE); - if (abs(ThreadWaitDelta - ChildThreadWaitTime) > AcceptableDelta) + RunTest_WFSOExThreadTest(FALSE); + if (abs(ThreadWaitDelta_WFSOExThreadTest - ChildThreadWaitTime) > AcceptableDelta) { Fail("Expected thread to wait for %d ms (and not be interrupted).\n" "Thread waited for %d ms! (Acceptable delta: %d)\n", - ChildThreadWaitTime, ThreadWaitDelta, AcceptableDelta); + ChildThreadWaitTime, ThreadWaitDelta_WFSOExThreadTest, AcceptableDelta); } @@ -74,7 +74,7 @@ int __cdecl main( int argc, char **argv ) return PASS; } -void RunTest(BOOL AlertThread) +void RunTest_WFSOExThreadTest(BOOL AlertThread) { HANDLE hThread = 0; DWORD dwThreadId = 0; @@ -83,7 +83,7 @@ void RunTest(BOOL AlertThread) //Create thread hThread = CreateThread( NULL, 0, - (LPTHREAD_START_ROUTINE)WaiterProc, + (LPTHREAD_START_ROUTINE)WaiterProc_WFSOExThreadTest, (LPVOID) AlertThread, 0, &dwThreadId); @@ -96,7 +96,7 @@ void RunTest(BOOL AlertThread) Sleep(InterruptTime); - ret = QueueUserAPC(APCFunc, hThread, 0); + ret = QueueUserAPC(APCFunc_WFSOExThreadTest, hThread, 0); if (ret == 0) { Fail("QueueUserAPC failed! GetLastError returned %d\n", @@ -119,12 +119,12 @@ void RunTest(BOOL AlertThread) } /* Function doesn't do anything, just needed to interrupt the wait*/ -VOID PALAPI APCFunc(ULONG_PTR dwParam) +VOID PALAPI APCFunc_WFSOExThreadTest(ULONG_PTR dwParam) { } /* Entry Point for child thread. */ -DWORD PALAPI WaiterProc(LPVOID lpParameter) +DWORD PALAPI WaiterProc_WFSOExThreadTest(LPVOID lpParameter) { HANDLE hWaitThread; UINT64 OldTimeStamp; @@ -141,7 +141,7 @@ satisfying any threads that were waiting on the object. /* Create a thread that does not return immediately to maintain a non signaled test*/ hWaitThread = CreateThread( NULL, 0, - (LPTHREAD_START_ROUTINE)WorkerThread, + (LPTHREAD_START_ROUTINE)WorkerThread_WFSOExThreadTest, NULL, 0, &dwThreadId); @@ -180,7 +180,7 @@ satisfying any threads that were waiting on the object. "Expected return of WAIT_TIMEOUT, got %d.\n", ret); } - ThreadWaitDelta = NewTimeStamp - OldTimeStamp; + ThreadWaitDelta_WFSOExThreadTest = NewTimeStamp - OldTimeStamp; ret = CloseHandle(hWaitThread); if (!ret) @@ -193,7 +193,7 @@ satisfying any threads that were waiting on the object. } -void WorkerThread(void) +void WorkerThread_WFSOExThreadTest(void) { //Make the worker thread sleep to test WFSOEx Functionality diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/CMakeLists.txt deleted file mode 100644 index 478787f67d97..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - WFSOMutexTest.cpp -) - -add_executable(paltest_waitforsingleobject_wfsomutextest - ${SOURCES} -) - -add_dependencies(paltest_waitforsingleobject_wfsomutextest coreclrpal) - -target_link_libraries(paltest_waitforsingleobject_wfsomutextest - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp index aa12b37dcfab..9ac6c11bc52a 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp @@ -24,17 +24,17 @@ #define NUMBER_OF_WORKER_THREADS 2 //Declaring Variables -HANDLE hMutex = NULL; -unsigned int globalcounter =0; -int testReturnCode = PASS; +HANDLE hMutex_WFSOMutexTest = NULL; +unsigned int globalcounter_WFSOMutexTest =0; +int testReturnCode_WFSOMutexTest = PASS; //Declaring Function Prototypes DWORD PALAPI WFSOMutexTest(LPVOID params); -void incrementCounter(void); +void incrementCounter_WFSOMutexTest(void); -int __cdecl main(int argc, char **argv) +PALTEST(threading_WaitForSingleObject_WFSOMutexTest_paltest_waitforsingleobject_wfsomutextest, "threading/WaitForSingleObject/WFSOMutexTest/paltest_waitforsingleobject_wfsomutextest") { //Declare local variables @@ -52,13 +52,13 @@ int __cdecl main(int argc, char **argv) } //Create Mutex - hMutex = CreateMutex(NULL, // no security attributes + hMutex_WFSOMutexTest = CreateMutex(NULL, // no security attributes FALSE, // initially not owned NULL); // name of mutex //Check for Mutex Creation - if (hMutex == NULL) + if (hMutex_WFSOMutexTest == NULL) { Fail("Create Mutex Failed, GetLastError: %d\n", GetLastError()); } @@ -90,7 +90,7 @@ int __cdecl main(int argc, char **argv) if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) returned %d, and GetLastError value is %d\n", returnCode, GetLastError()); - testReturnCode = FAIL; + testReturnCode_WFSOMutexTest = FAIL; } //Close thread handles @@ -105,28 +105,28 @@ for (i=0;i -int __cdecl main(int argc, char **argv) +PALTEST(threading_WaitForSingleObject_WFSOProcessTest_paltest_waitforsingleobject_wfsoprocesstest_child, "threading/WaitForSingleObject/WFSOProcessTest/paltest_waitforsingleobject_wfsoprocesstest_child") { //Declare local variables diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.cpp index d8f550edd644..dae1fab6f345 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.cpp @@ -3,14 +3,14 @@ /*============================================================ ** -** Source: WFSOProcessTest.c +** Source: WFSOProcessTest.c ** -** Purpose: Test for WaitForSingleObjectTest. +** Purpose: Test for WaitForSingleObjectTest. ** Create One Process and do some work -** Use WFSO For the Process to finish -** +** Use WFSO For the Process to finish +** ** Test Passes if the above operations are successful -** +** ** ** **=========================================================*/ @@ -19,16 +19,16 @@ #include -int __cdecl main(int argc, char **argv) +PALTEST(threading_WaitForSingleObject_WFSOProcessTest_paltest_waitforsingleobject_wfsoprocesstest, "threading/WaitForSingleObject/WFSOProcessTest/paltest_waitforsingleobject_wfsoprocesstest") { //Declare local variables STARTUPINFO si; PROCESS_INFORMATION pi; -DWORD dwWaitResult=0; +DWORD dwWaitResult=0; -//Initialize PAL +//Initialize PAL if(0 != (PAL_Initialize(argc, argv))) { return ( FAIL ); @@ -39,58 +39,63 @@ ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); -// Start the child process. -if( !CreateProcess( NULL, // No module name (use command line). - "childprocess", // Command line. - NULL, // Process handle not inheritable. - NULL, // Thread handle not inheritable. - FALSE, // Set handle inheritance to FALSE. - 0, // No creation flags. - NULL, // Use parent's environment block. - NULL, // Use parent's starting directory. +LPWSTR nameW = convert("childprocess"); +// Start the child process. +if( !CreateProcess( NULL, // No module name (use command line). + nameW, // Command line. + NULL, // Process handle not inheritable. + NULL, // Thread handle not inheritable. + FALSE, // Set handle inheritance to FALSE. + 0, // No creation flags. + NULL, // Use parent's environment block. + NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. -) +) { +DWORD dwError = GetLastError(); +free(nameW); Fail ( "Create Process Failed. Failing test.\n" - "GetLastError returned %d\n", GetLastError()); + "GetLastError returned %d\n", GetLastError()); } +free(nameW); + // Wait until child process exits. dwWaitResult = WaitForSingleObject( pi.hProcess, INFINITE ); -switch (dwWaitResult) +switch (dwWaitResult) { // The Process wait was successful - case WAIT_OBJECT_0: + case WAIT_OBJECT_0: { Trace("Wait for Process was successful\n"); - break; - } + break; + } // Time-out. - case WAIT_TIMEOUT: + case WAIT_TIMEOUT: { Fail ( "Time -out. Failing test.\n" - "GetLastError returned %d\n", GetLastError()); + "GetLastError returned %d\n", GetLastError()); return FALSE; } // Got ownership of the abandoned process object. - case WAIT_ABANDONED: + case WAIT_ABANDONED: { Fail ( "Got ownership of the abandoned Process object. Failing test.\n" - "GetLastError returned %d\n", GetLastError()); - return FALSE; + "GetLastError returned %d\n", GetLastError()); + return FALSE; } //Error condition case WAIT_FAILED: { Fail ( "Wait for Process Failed. Failing test.\n" - "GetLastError returned %d\n", GetLastError()); - return FALSE; + "GetLastError returned %d\n", GetLastError()); + return FALSE; } } @@ -100,8 +105,8 @@ switch (dwWaitResult) // Close process handle if (0==CloseHandle(pi.hProcess)) { - Trace("Could not close process handle\n"); - Fail ( "GetLastError returned %d\n", GetLastError()); + Trace("Could not close process handle\n"); + Fail ( "GetLastError returned %d\n", GetLastError()); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/CMakeLists.txt deleted file mode 100644 index c995da695562..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -set(SOURCES - WFSOSemaphoreTest.cpp -) - -add_executable(paltest_waitforsingleobject_wfsosemaphoretest - ${SOURCES} -) - -add_dependencies(paltest_waitforsingleobject_wfsosemaphoretest coreclrpal) - -target_link_libraries(paltest_waitforsingleobject_wfsosemaphoretest - ${COMMON_TEST_LIBRARIES} -) diff --git a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp index ba032f00d37d..14a223097557 100644 --- a/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp +++ b/src/coreclr/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp @@ -3,15 +3,15 @@ /*============================================================ ** -** Source: WFSOMutexTest.c +** Source: WFSOMutexTest.c ** -** Purpose: Test for WaitForSingleObjectTest. +** Purpose: Test for WaitForSingleObjectTest. ** Create Semaphore Object ** Create Two Threads, Each Threads does WFSO for the Semaphore Object ** Increments Counter ** Releases Semaphore ** Test Passes if the above operations are successful -** +** ** ** **=========================================================*/ @@ -25,18 +25,18 @@ //Declaring Variables -HANDLE hSemaphore = NULL; -unsigned int globalcounter =0; -int testReturnCode = PASS; +HANDLE hSemaphore_WFSOSemaphore = NULL; +unsigned int globalcounter_WFSOSemaphore =0; //Declaring Function Prototypes DWORD PALAPI WFSOSemaphoreTest(LPVOID params); -void incrementCounter(void); +void incrementCounter_WFSOSemaphore(void); -int __cdecl main(int argc, char **argv) +PALTEST(threading_WaitForSingleObject_WFSOSemaphoreTest_paltest_waitforsingleobject_wfsosemaphoretest, "threading/WaitForSingleObject/WFSOSemaphoreTest/paltest_waitforsingleobject_wfsosemaphoretest") { //Declare local variables + int testReturnCode = PASS; int i =0; int cMax = 2; @@ -44,27 +44,29 @@ int __cdecl main(int argc, char **argv) // 2 dimensional array to hold thread handles for each worker thread HANDLE hThread[NUMBER_OF_WORKER_THREADS]; - DWORD dwThreadId=0; + DWORD dwThreadId=0; - //Initialize PAL + //Initialize PAL if(0 != (PAL_Initialize(argc, argv))) { return ( FAIL ); } //Create Semaphore - hSemaphore = CreateSemaphore( + hSemaphore_WFSOSemaphore = CreateSemaphoreExW( NULL, // no security attributes cMax, // initial count cMax, // maximum count - NULL); // unnamed semaphore + NULL, // unnamed semaphore + 0, + 0); - if (hSemaphore == NULL) + if (hSemaphore_WFSOSemaphore == NULL) { // Check for error. Fail("Create Semaphore Failed, GetLastError: %d\n", GetLastError()); } - + //Spawn 2 worker threads @@ -73,24 +75,24 @@ int __cdecl main(int argc, char **argv) //Create Thread hThread[i] = CreateThread( - NULL, - 0, - WFSOSemaphoreTest, - NULL, - 0, + NULL, + 0, + WFSOSemaphoreTest, + NULL, + 0, &dwThreadId); - if ( NULL == hThread[i] ) + if ( NULL == hThread[i] ) { Fail ( "CreateThread() returned NULL. Failing test.\n" - "GetLastError returned %d\n", GetLastError()); + "GetLastError returned %d\n", GetLastError()); } - + } /* Test running */ - returnCode = WaitForMultipleObjects( NUMBER_OF_WORKER_THREADS, hThread, TRUE, 5000); + returnCode = WaitForMultipleObjects( NUMBER_OF_WORKER_THREADS, hThread, TRUE, 5000); if( WAIT_OBJECT_0 != returnCode ) { Trace("Wait for Object(s) returned %d, and GetLastError value is %d\n", returnCode, GetLastError()); @@ -103,16 +105,16 @@ for (i=0;i -HANDLE hSemaphore; -int __cdecl main (int argc, char **argv) +PALTEST(threading_releasesemaphore_test1_paltest_releasesemaphore_test1, "threading/releasesemaphore/test1/paltest_releasesemaphore_test1") { + HANDLE hSemaphore; if(0 != (PAL_Initialize(argc, argv))) { return (FAIL); } - hSemaphore = CreateSemaphoreA (NULL, 1, 2, NULL); - + hSemaphore = CreateSemaphoreExW (NULL, 1, 2, NULL, 0, 0); + if (NULL == hSemaphore) { - Fail("PALSUITE ERROR: CreateSemaphoreA ('%p' '%ld' '%ld' " - "'%p') returned NULL.\nGetLastError returned %d.\n", - NULL, 1, 2, NULL, GetLastError()); + Fail("PALSUITE ERROR: CreateSemaphoreExW ('%p' '%ld' '%ld' " + "'%p' '0' '0') returned NULL.\nGetLastError returned %d.\n", + NULL, 1, 2, NULL, GetLastError()); } if(ReleaseSemaphore(hSemaphore, 0, NULL)) { Fail("PALSUITE ERROR: ReleaseSemaphore('%p' '%ld' '%p') " "call returned %d\nwhen it should have returned " - "%d.\nGetLastError returned %d.\n", + "%d.\nGetLastError returned %d.\n", hSemaphore, 0, NULL, FALSE, TRUE, GetLastError()); } @@ -44,7 +44,7 @@ int __cdecl main (int argc, char **argv) { Fail("PALSUITE ERROR: ReleaseSemaphore('%p' '%ld' '%p') " "call returned %d\nwhen it should have returned " - "%d.\nGetLastError returned %d.\n", + "%d.\nGetLastError returned %d.\n", hSemaphore, -1, NULL, TRUE, FALSE, GetLastError()); } @@ -61,7 +61,7 @@ int __cdecl main (int argc, char **argv) "was closed by a call to CloseHandle.\n GetLastError returned " "%d.\n", hSemaphore, -1, NULL, hSemaphore, GetLastError()); } - + PAL_Terminate(); return (PASS); } diff --git a/src/coreclr/src/pal/tests/palsuite/threading/releasesemaphore/test1/testinfo.dat b/src/coreclr/src/pal/tests/palsuite/threading/releasesemaphore/test1/testinfo.dat deleted file mode 100644 index 5af762fd8bdb..000000000000 --- a/src/coreclr/src/pal/tests/palsuite/threading/releasesemaphore/test1/testinfo.dat +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -Version = 1.0 -Section = threading -Function = ReleaseSemaphore -Name = Positive Test for ReleaseSemaphore -TYPE = DEFAULT -EXE1 = test -Description -= Check that ReleaseSemaphore fails when using a semaphore handle -= which has been closed by a call to CloseHandle. Check that -= ReleaseSemaphore fails when using a ReleaseCount of zero or less than -= zero. diff --git a/src/coreclr/src/pal/tools/gen-buildsys.cmd b/src/coreclr/src/pal/tools/gen-buildsys.cmd deleted file mode 100644 index 612ce9b8a548..000000000000 --- a/src/coreclr/src/pal/tools/gen-buildsys.cmd +++ /dev/null @@ -1,52 +0,0 @@ -@if not defined _echo @echo off -rem -rem This file invokes cmake and generates the build system for windows. - -set argC=0 -for %%x in (%*) do Set /A argC+=1 - -if %argC% lss 4 GOTO :USAGE -if %1=="/?" GOTO :USAGE - -setlocal -set basePath=%~dp0 -:: remove quotes -set "basePath=%basePath:"=%" -:: remove trailing slash -if %basePath:~-1%==\ set "basePath=%basePath:~0,-1%" - -set __SourceDir=%1 -set __IntermediatesDir=%2 -set __VSVersion=%3 -set __Arch=%4 -set __CmakeGenerator=Visual Studio - -if /i "%__NMakeMakefiles%" == "1" ( - set __CmakeGenerator=NMake Makefiles -) else ( - if /i "%__VSVersion%" == "vs2019" (set __CmakeGenerator=%__CmakeGenerator% 16 2019) - if /i "%__VSVersion%" == "vs2017" (set __CmakeGenerator=%__CmakeGenerator% 15 2017) - - if /i "%__Arch%" == "x64" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A x64) - if /i "%__Arch%" == "arm" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A ARM) - if /i "%__Arch%" == "arm64" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A ARM64) - if /i "%__Arch%" == "x86" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A Win32) -) - -:loop -if [%5] == [] goto end_loop -set __ExtraCmakeParams=%__ExtraCmakeParams% %5 -shift -goto loop -:end_loop - -"%CMakePath%" "-DCMAKE_INSTALL_PREFIX=%__CMakeBinDir%" "-DCLR_CMAKE_HOST_ARCH=%__Arch%" %__ExtraCmakeParams% -G "%__CmakeGenerator%" -S %__SourceDir% -B %__IntermediatesDir% -endlocal -exit /B !errorlevel! - -:USAGE - echo "Usage..." - echo "gen-buildsys.cmd " - echo "Specify the path to the top level CMake file - /src/NDP" - echo "Specify the VSVersion to be used - VS2017 or VS2019" - EXIT /B 1 diff --git a/src/coreclr/src/pal/tools/gen-dactable-rva.sh b/src/coreclr/src/pal/tools/gen-dactable-rva.sh index c1fc13118deb..62bb961015e6 100644 --- a/src/coreclr/src/pal/tools/gen-dactable-rva.sh +++ b/src/coreclr/src/pal/tools/gen-dactable-rva.sh @@ -1 +1,7 @@ -${NM:-nm} -P -t x $1 | awk -F ' ' '/g_dacTable/ { print "#define DAC_TABLE_RVA 0x" substr("0000000000000000" $3, length($3) + 1); exit }' > $2 +if [ "$1" = "--dynamic" ]; then + __DynamicSymbolsOption="-D" + shift +else + __DynamicSymbolsOption="" +fi +${NM:-nm} $__DynamicSymbolsOption -P -t x $1 | awk -F ' ' '/g_dacTable/ { print "#define DAC_TABLE_RVA 0x" substr("0000000000000000" $3, length($3) + 1); exit }' > $2 diff --git a/src/coreclr/src/palrt/CMakeLists.txt b/src/coreclr/src/palrt/CMakeLists.txt index 77fdc67a52d7..a4c6fdd5ae83 100644 --- a/src/coreclr/src/palrt/CMakeLists.txt +++ b/src/coreclr/src/palrt/CMakeLists.txt @@ -8,7 +8,6 @@ set(PALRT_SOURCES guid.cpp memorystream.cpp path.cpp - unicode.cpp variant.cpp ) diff --git a/src/coreclr/src/palrt/comem.cpp b/src/coreclr/src/palrt/comem.cpp index bb1bdf28a5fb..e56e720cc80c 100644 --- a/src/coreclr/src/palrt/comem.cpp +++ b/src/coreclr/src/palrt/comem.cpp @@ -12,15 +12,10 @@ STDAPI_(LPVOID) CoTaskMemAlloc(SIZE_T cb) { - return LocalAlloc(LMEM_FIXED, cb); -} - -STDAPI_(LPVOID) CoTaskMemRealloc(LPVOID pv, SIZE_T cb) -{ - return LocalReAlloc(pv, cb, LMEM_MOVEABLE); + return malloc(cb); } STDAPI_(void) CoTaskMemFree(LPVOID pv) { - LocalFree(pv); + free(pv); } diff --git a/src/coreclr/src/palrt/unicode.cpp b/src/coreclr/src/palrt/unicode.cpp deleted file mode 100644 index 1d8372642ec0..000000000000 --- a/src/coreclr/src/palrt/unicode.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// 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" - -// This is a simplified implementation of IsTextUnicode. -// https://github.com/dotnet/coreclr/issues/2307 -BOOL IsTextUnicode(CONST VOID* lpv, int iSize, LPINT lpiResult) -{ - *lpiResult = 0; - - if (iSize < 2) return FALSE; - - BYTE * p = (BYTE *)lpv; - - // Check for Unicode BOM - if ((*p == 0xFF) && (*(p+1) == 0xFE)) - { - *lpiResult |= IS_TEXT_UNICODE_SIGNATURE; - return TRUE; - } - - return FALSE; -} - diff --git a/src/coreclr/src/scripts/genEventPipe.py b/src/coreclr/src/scripts/genEventPipe.py index 86d0dfea4a88..d8c6cdca24fe 100644 --- a/src/coreclr/src/scripts/genEventPipe.py +++ b/src/coreclr/src/scripts/genEventPipe.py @@ -392,10 +392,10 @@ def generateEventPipeImplFiles( eventpipeImpl.write(stdprolog_cpp) header = """ -#include "{root:s}/vm/common.h" -#include "{root:s}/vm/eventpipeprovider.h" -#include "{root:s}/vm/eventpipeevent.h" -#include "{root:s}/vm/eventpipe.h" +#include +#include +#include +#include #if defined(TARGET_UNIX) #define wcslen PAL_wcslen diff --git a/src/coreclr/src/tools/Common/CommandLine/Argument.cs b/src/coreclr/src/tools/Common/CommandLine/Argument.cs new file mode 100644 index 000000000000..f3b5af2c3152 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/Argument.cs @@ -0,0 +1,109 @@ +// 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.Collections.ObjectModel; + +namespace Internal.CommandLine +{ + public abstract class Argument + { + internal Argument(ArgumentCommand command, IEnumerable names, bool isOption, bool isRequired) + { + var nameArray = names.ToArray(); + Command = command; + Name = nameArray.First(); + Names = new ReadOnlyCollection(nameArray); + IsOption = isOption; + IsRequired = isRequired; + } + + public ArgumentCommand Command { get; private set; } + + public string Name { get; private set; } + + public ReadOnlyCollection Names { get; private set; } + + public string Help { get; set; } + + public bool IsOption { get; private set; } + + public bool IsParameter + { + get { return !IsOption; } + } + + public bool IsSpecified { get; private set; } + + public bool IsHidden { get; set; } + + public bool IsRequired { get; private set; } + + public virtual bool IsList + { + get { return false; } + } + + public object Value + { + get { return GetValue(); } + } + + public object DefaultValue + { + get { return GetDefaultValue(); } + } + + public bool IsActive + { + get { return Command == null || Command.IsActive; } + } + + public abstract bool IsFlag { get; } + + internal abstract object GetValue(); + + internal abstract object GetDefaultValue(); + + internal void MarkSpecified() + { + IsSpecified = true; + } + + public string GetDisplayName() + { + return GetDisplayName(Name); + } + + public IEnumerable GetDisplayNames() + { + return Names.Select(GetDisplayName); + } + + private string GetDisplayName(string name) + { + return IsOption ? GetOptionDisplayName(name) : GetParameterDisplayName(name); + } + + private static string GetOptionDisplayName(string name) + { + var modifier = name.Length == 1 ? @"-" : @"--"; + return modifier + name; + } + + private static string GetParameterDisplayName(string name) + { + return @"<" + name + @">"; + } + + public virtual string GetDisplayValue() + { + return Value == null ? string.Empty : Value.ToString(); + } + + public override string ToString() + { + return GetDisplayName(); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentCommand.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentCommand.cs new file mode 100644 index 000000000000..fe2f9c1bc9f2 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentCommand.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. + +namespace Internal.CommandLine +{ + public abstract class ArgumentCommand + { + internal ArgumentCommand(string name) + { + Name = name; + } + + public string Name { get; private set; } + + public string Help { get; set; } + + public object Value + { + get { return GetValue(); } + } + + public bool IsHidden { get; set; } + + public bool IsActive { get; private set; } + + internal abstract object GetValue(); + + internal void MarkActive() + { + IsActive = true; + } + + public override string ToString() + { + return Name; + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentCommand_1.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentCommand_1.cs new file mode 100644 index 000000000000..d3dae3ecaa9c --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentCommand_1.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. + +namespace Internal.CommandLine +{ + public sealed class ArgumentCommand : ArgumentCommand + { + internal ArgumentCommand(string name, T value) + : base(name) + { + Value = value; + } + + public new T Value { get; private set; } + + internal override object GetValue() + { + return Value; + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentLexer.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentLexer.cs new file mode 100644 index 000000000000..387f32075865 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentLexer.cs @@ -0,0 +1,200 @@ +// 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 Internal.CommandLine +{ + internal static class ArgumentLexer + { + public static IReadOnlyList Lex(IEnumerable args, Func> responseFileReader = null) + { + var result = new List(); + + // We'll split the arguments into tokens. + // + // A token combines the modifier (/, -, --), the option name, and the option + // value. + // + // Please note that this code doesn't combine arguments. It only provides + // some pre-processing over the arguments to split out the modifier, + // option, and value: + // + // { "--out", "out.exe" } ==> { new ArgumentToken("--", "out", null), + // new ArgumentToken(null, null, "out.exe") } + // + // {"--out:out.exe" } ==> { new ArgumentToken("--", "out", "out.exe") } + // + // The reason it doesn't combine arguments is because it depends on the actual + // definition. For example, if --out is a flag (meaning it's of type bool) then + // out.exe in the first example wouldn't be considered its value. + // + // The code also handles the special -- token which indicates that the following + // arguments shouldn't be considered options. + // + // Finally, this code will also expand any reponse file entries, assuming the caller + // gave us a non-null reader. + + var hasSeenDashDash = false; + + foreach (var arg in ExpandResponseFiles(args, responseFileReader)) + { + // If we've seen a -- already, then we'll treat one as a plain name, that is + // without a modifier or value. + + if (!hasSeenDashDash && arg == @"--") + { + hasSeenDashDash = true; + continue; + } + + string modifier; + string name; + string value; + + if (hasSeenDashDash) + { + modifier = null; + name = arg; + value = null; + } + else + { + // If we haven't seen the -- separator, we're looking for options. + // Options have leading modifiers, i.e. /, -, or --. + // + // Options can also have values, such as: + // + // -f:false + // --name=hello + + + if (!TryExtractOption(arg, out modifier, out string nameAndValue)) + { + name = arg; + value = null; + } + else if (!TrySplitNameValue(nameAndValue, out name, out value)) + { + name = nameAndValue; + value = null; + } + else + { + value = value.Trim('"'); + } + } + + var token = new ArgumentToken(modifier, name, value); + result.Add(token); + } + + // Single letter options can be combined, for example the following two + // forms are considered equivalent: + // + // (1) -xdf + // (2) -x -d -f + // + // In order to free later phases from handling this case, we simply expand + // single letter options to the second form. + + for (var i = result.Count - 1; i >= 0; i--) + { + if (IsOptionBundle(result[i])) + ExpandOptionBundle(result, i); + } + + return result.ToArray(); + } + + private static IEnumerable ExpandResponseFiles(IEnumerable args, Func> responseFileReader) + { + foreach (var arg in args) + { + if (responseFileReader == null || !arg.StartsWith(@"@")) + { + yield return arg; + } + else + { + var fileName = arg.Substring(1); + + var responseFileArguments = responseFileReader(fileName); + + // The reader can suppress expanding this response file by + // returning null. In that case, we'll treat the response + // file token as a regular argument. + + if (responseFileArguments == null) + { + yield return arg; + } + else + { + foreach (var responseFileArgument in responseFileArguments) + yield return responseFileArgument.Trim(); + } + } + } + } + + private static bool IsOptionBundle(ArgumentToken token) + { + return token.IsOption && + token.Modifier == @"-" && + token.Name.Length > 1; + } + + private static void ExpandOptionBundle(IList receiver, int index) + { + var options = receiver[index].Name; + receiver.RemoveAt(index); + + foreach (var c in options) + { + var name = char.ToString(c); + var expandedToken = new ArgumentToken(@"-", name, null); + receiver.Insert(index, expandedToken); + index++; + } + } + + private static bool TryExtractOption(string text, out string modifier, out string remainder) + { + return TryExtractOption(text, @"--", out modifier, out remainder) || + TryExtractOption(text, @"-", out modifier, out remainder); + } + + private static bool TryExtractOption(string text, string prefix, out string modifier, out string remainder) + { + if (text.StartsWith(prefix)) + { + remainder = text.Substring(prefix.Length); + modifier = prefix; + return true; + } + + remainder = null; + modifier = null; + return false; + } + + private static bool TrySplitNameValue(string text, out string name, out string value) + { + for (int idx = 0; idx < text.Length; idx++) + { + char ch = text[idx]; + if (ch == ':' || ch == '=') + { + name = text.Substring(0, idx); + value = text.Substring(idx + 1); + return true; + } + } + name = null; + value = null; + return false; + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentList_1.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentList_1.cs new file mode 100644 index 000000000000..a0072a0abaa7 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentList_1.cs @@ -0,0 +1,59 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; + +namespace Internal.CommandLine +{ + public sealed class ArgumentList : Argument + { + internal ArgumentList(ArgumentCommand command, IEnumerable names, IReadOnlyList defaultValue, bool isRequired) + : base(command, names, true, isRequired) + { + Value = defaultValue; + DefaultValue = defaultValue; + } + + internal ArgumentList(ArgumentCommand command, string name, IReadOnlyList defaultValue) + : base(command, new[] { name }, false, true) + { + Value = defaultValue; + DefaultValue = defaultValue; + } + + public override bool IsList + { + get { return true; } + } + + public new IReadOnlyList Value { get; private set; } + + public new IReadOnlyList DefaultValue { get; private set; } + + public override bool IsFlag + { + get { return typeof(T) == typeof(bool); } + } + + internal override object GetValue() + { + return Value; + } + + internal override object GetDefaultValue() + { + return DefaultValue; + } + + internal void SetValue(IReadOnlyList value) + { + Value = value; + MarkSpecified(); + } + + public override string GetDisplayValue() + { + return string.Join(@", ", Value); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentParser.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentParser.cs new file mode 100644 index 000000000000..86515f5cb132 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentParser.cs @@ -0,0 +1,265 @@ +// 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 Internal.CommandLine +{ + internal sealed class ArgumentParser + { + private readonly IReadOnlyList _tokens; + + public ArgumentParser(IEnumerable arguments) + : this(arguments, null) + { + } + + public ArgumentParser(IEnumerable arguments, Func> responseFileReader) + { + if (arguments == null) + throw new ArgumentNullException("arguments"); + + _tokens = ArgumentLexer.Lex(arguments, responseFileReader); + } + + public bool TryParseCommand(string name) + { + var token = _tokens.FirstOrDefault(); + + if (token == null || token.IsOption || token.IsSeparator) + return false; + + if (!string.Equals(token.Name, name, StringComparison.Ordinal)) + return false; + + token.MarkMatched(); + return true; + } + + public bool TryParseOption(string diagnosticName, IReadOnlyCollection names, Func valueConverter, bool isRequired, out T value, out bool specified) + { + if (!TryParseOptionList(diagnosticName, names, valueConverter, isRequired, out IReadOnlyList values, out specified)) + { + value = default; + return false; + } + + // Please note that we don't verify that the option is only specified once. + // It's tradition on Unix to allow single options to occur more than once, + // with 'last one wins' semantics. This simplifies scripting because you + // can easily combine arguments. + + value = values.Last(); + return true; + } + + public bool TryParseOptionList(string diagnosticName, IReadOnlyCollection names, Func valueConverter, bool isRequired, out IReadOnlyList values, out bool specified) + { + var result = new List(); + var tokenIndex = 0; + var isFlag = typeof(T) == typeof(bool); + specified = false; + + while (tokenIndex < _tokens.Count) + { + if (TryParseOption(ref tokenIndex, names)) + { + specified = true; + if (TryParseOptionArgument(ref tokenIndex, isFlag, out string valueText)) + { + var value = ParseValue(diagnosticName, valueConverter, valueText); + result.Add(value); + } + else if (isFlag) + { + var value = (T)(object)true; + result.Add(value); + } + else if (isRequired) + { + var message = string.Format(Strings.OptionRequiresValueFmt, diagnosticName); + throw new ArgumentSyntaxException(message); + } + } + + tokenIndex++; + } + + if (!result.Any()) + { + values = null; + return false; + } + + values = result.ToArray(); + return true; + } + + public bool TryParseParameter(string diagnosticName, Func valueConverter, out T value) + { + foreach (var token in _tokens) + { + if (token.IsMatched || token.IsOption || token.IsSeparator) + continue; + + token.MarkMatched(); + + var valueText = token.Name; + value = ParseValue(diagnosticName, valueConverter, valueText); + return true; + } + + value = default; + return false; + } + + public bool TryParseParameterList(string diagnosticName, Func valueConverter, out IReadOnlyList values) + { + var result = new List(); + + while (TryParseParameter(diagnosticName, valueConverter, out T value)) + { + result.Add(value); + } + + if (!result.Any()) + { + values = null; + return false; + } + + values = result.ToArray(); + return true; + } + + private bool TryParseOption(ref int tokenIndex, IReadOnlyCollection names) + { + while (tokenIndex < _tokens.Count) + { + var a = _tokens[tokenIndex]; + + if (a.IsOption) + { + if (names.Any(n => string.Equals(a.Name, n, StringComparison.Ordinal))) + { + a.MarkMatched(); + return true; + } + } + + tokenIndex++; + } + + return false; + } + + private bool TryParseOptionArgument(ref int tokenIndex, bool isFlag, out string argument) + { + argument = null; + + // Let's see whether the current token already has value, like "-o:value" + + var a = _tokens[tokenIndex]; + if (a.HasValue) + { + a.MarkMatched(); + argument = a.Value; + return true; + } + + // OK, we may need to have to advance one or two tokens. Since we don't know + // up front, we'll take a look ahead. + + + // So, do we have a token? + + if (!TryGetNextToken(tokenIndex, out ArgumentToken lookahead)) + return false; + + // If it's an option, then it's not an argument and we're done. + + if (lookahead.IsOption) + return false; + + // OK, the lookahead is either a separator or it's an argument. + + if (!lookahead.IsSeparator) + { + // If this is a flag, we need an explicit separator. + // Since there is none, we don't consume this token. + + if (isFlag) + return false; + + lookahead.MarkMatched(); + argument = lookahead.Name; + tokenIndex++; + return true; + } + + // Skip separator + + lookahead.MarkMatched(); + tokenIndex++; + + // See whether the next token is an argument. + + if (!TryGetNextToken(tokenIndex, out lookahead)) + return false; + + if (lookahead.IsOption || lookahead.IsSeparator) + return false; + + lookahead.MarkMatched(); + argument = lookahead.Name; + tokenIndex++; + return true; + } + + private bool TryGetNextToken(int tokenIndex, out ArgumentToken token) + { + if (++tokenIndex >= _tokens.Count) + { + token = null; + return false; + } + + token = _tokens[tokenIndex]; + return true; + } + + private static T ParseValue(string diagnosticName, Func valueConverter, string valueText) + { + try + { + return valueConverter(valueText); + } + catch (FormatException ex) + { + var message = string.Format(Strings.CannotParseValueFmt, valueText, diagnosticName, ex.Message); + throw new ArgumentSyntaxException(message); + } + } + + public string GetUnreadCommand() + { + return _tokens.Where(t => !t.IsOption && !t.IsSeparator).Select(t => t.Name).FirstOrDefault(); + } + + public IReadOnlyList GetUnreadOptionNames() + { + return _tokens.Where(t => !t.IsMatched && t.IsOption).Select(t => t.Modifier + t.Name).ToArray(); + } + + public IReadOnlyList GetUnreadParameters() + { + return _tokens.Where(t => !t.IsMatched && !t.IsOption).Select(t => t.ToString()).ToArray(); + } + + public IReadOnlyList GetUnreadArguments() + { + return _tokens.Where(t => !t.IsMatched).Select(t => t.ToString()).ToArray(); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntax.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntax.cs new file mode 100644 index 000000000000..f5adb9f2f786 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntax.cs @@ -0,0 +1,441 @@ +// 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.IO; + +namespace Internal.CommandLine +{ + public sealed partial class ArgumentSyntax + { + private readonly IEnumerable _arguments; + private readonly List _commands = new List(); + private readonly List _options = new List(); + private readonly List _parameters = new List(); + + private ArgumentParser _parser; + private ArgumentCommand _definedCommand; + private ArgumentCommand _activeCommand; + + internal ArgumentSyntax(IEnumerable arguments) + { + _arguments = arguments; + + ApplicationName = GetApplicationName(); + HandleErrors = true; + HandleHelp = true; + HandleResponseFiles = true; + ErrorOnUnexpectedArguments = true; + } + + public static ArgumentSyntax Parse(IEnumerable arguments, Action defineAction) + { + if (arguments == null) + throw new ArgumentNullException("arguments"); + + if (defineAction == null) + throw new ArgumentNullException("defineAction"); + + var syntax = new ArgumentSyntax(arguments); + defineAction(syntax); + syntax.Validate(); + return syntax; + } + + private void Validate() + { + // Check whether help is requested + + if (HandleHelp && IsHelpRequested()) + { + var helpText = GetHelpText(); + Console.Error.Write(helpText); + Environment.Exit(0); + } + + // Check for invalid or missing command + + if (_activeCommand == null && _commands.Any()) + { + var unreadCommand = Parser.GetUnreadCommand(); + var message = unreadCommand == null + ? Strings.MissingCommand + : string.Format(Strings.UnknownCommandFmt, unreadCommand); + ReportError(message); + } + + if (ErrorOnUnexpectedArguments) + { + // Check for invalid options and extra parameters + + foreach (var option in Parser.GetUnreadOptionNames()) + { + var message = string.Format(Strings.InvalidOptionFmt, option); + ReportError(message); + } + + foreach (var parameter in Parser.GetUnreadParameters()) + { + var message = string.Format(Strings.ExtraParameterFmt, parameter); + ReportError(message); + } + } + } + + private bool IsHelpRequested() + { + return Parser.GetUnreadOptionNames() + .Any(a => string.Equals(a, @"-?", StringComparison.Ordinal) || + string.Equals(a, @"-h", StringComparison.Ordinal) || + string.Equals(a, @"--help", StringComparison.Ordinal)); + } + + public void ReportError(string message) + { + if (HandleErrors) + { + Console.Error.WriteLine(Strings.ErrorWithMessageFmt, message); + Environment.Exit(1); + } + + throw new ArgumentSyntaxException(message); + } + + public ArgumentCommand DefineCommand(string name, T value) + { + if (string.IsNullOrEmpty(name)) + throw new ArgumentException(Strings.NameMissing, "name"); + + if (!IsValidName(name)) + { + var message = string.Format(Strings.CommandNameIsNotValidFmt, name); + throw new ArgumentException(message, "name"); + } + + if (_commands.Any(c => string.Equals(c.Name, name, StringComparison.Ordinal))) + { + var message = string.Format(Strings.CommandAlreadyDefinedFmt, name); + throw new InvalidOperationException(message); + } + + if (_options.Concat(_parameters).Any(c => c.Command == null)) + throw new InvalidOperationException(Strings.CannotDefineCommandsIfArgumentsExist); + + var definedCommand = new ArgumentCommand(name, value); + _commands.Add(definedCommand); + _definedCommand = definedCommand; + + if (_activeCommand != null) + return definedCommand; + + if (!Parser.TryParseCommand(name)) + return definedCommand; + + _activeCommand = _definedCommand; + _activeCommand.MarkActive(); + + return definedCommand; + } + + public Argument DefineOption(string name, T defaultValue, Func valueConverter, bool isRequired) + { + if (string.IsNullOrEmpty(name)) + throw new ArgumentException(Strings.NameMissing, "name"); + + if (DefinedParameters.Any()) + throw new InvalidOperationException(Strings.OptionsMustBeDefinedBeforeParameters); + + var names = ParseOptionNameList(name); + var option = new Argument(_definedCommand, names, defaultValue, isRequired); + _options.Add(option); + + if (_activeCommand != _definedCommand) + return option; + + try + { + if (Parser.TryParseOption(option.GetDisplayName(), option.Names, valueConverter, isRequired, out T value, out bool specified)) + { + option.SetValue(value); + } + else if (specified) + { + // No value was provided, but the option was specified and a value wasn't required + option.MarkSpecified(); + } + } + catch (ArgumentSyntaxException ex) + { + ReportError(ex.Message); + } + + return option; + } + + public ArgumentList DefineOptionList(string name, IReadOnlyList defaultValue, Func valueConverter, bool isRequired) + { + if (string.IsNullOrEmpty(name)) + throw new ArgumentException(Strings.NameMissing, "name"); + + if (DefinedParameters.Any()) + throw new InvalidOperationException(Strings.OptionsMustBeDefinedBeforeParameters); + + var names = ParseOptionNameList(name); + var optionList = new ArgumentList(_definedCommand, names, defaultValue, isRequired); + _options.Add(optionList); + + if (_activeCommand != _definedCommand) + return optionList; + + try + { + if (Parser.TryParseOptionList(optionList.GetDisplayName(), optionList.Names, valueConverter, isRequired, out IReadOnlyList value, out bool specified)) + { + optionList.SetValue(value); + } + else if (specified) + { + // No value was provided, but the option was specified and a value wasn't required + optionList.MarkSpecified(); + } + } + catch (ArgumentSyntaxException ex) + { + ReportError(ex.Message); + } + + return optionList; + } + + public Argument DefineParameter(string name, T defaultValue, Func valueConverter) + { + if (string.IsNullOrEmpty(name)) + throw new ArgumentException(Strings.NameMissing, "name"); + + if (!IsValidName(name)) + { + var message = string.Format(Strings.ParameterNameIsNotValidFmt, name); + throw new ArgumentException(message, "name"); + } + + if (DefinedParameters.Any(p => p.IsList)) + throw new InvalidOperationException(Strings.ParametersCannotBeDefinedAfterLists); + + if (DefinedParameters.Any(p => string.Equals(name, p.Name, StringComparison.OrdinalIgnoreCase))) + { + var message = string.Format(Strings.ParameterAlreadyDefinedFmt, name); + throw new InvalidOperationException(message); + } + + var parameter = new Argument(_definedCommand, name, defaultValue); + _parameters.Add(parameter); + + if (_activeCommand != _definedCommand) + return parameter; + + try + { + if (Parser.TryParseParameter(parameter.GetDisplayName(), valueConverter, out T value)) + parameter.SetValue(value); + } + catch (ArgumentSyntaxException ex) + { + ReportError(ex.Message); + } + + return parameter; + } + + public ArgumentList DefineParameterList(string name, IReadOnlyList defaultValue, Func valueConverter) + { + if (string.IsNullOrEmpty(name)) + throw new ArgumentException(Strings.NameMissing, "name"); + + if (!IsValidName(name)) + { + var message = string.Format(Strings.ParameterNameIsNotValidFmt, name); + throw new ArgumentException(message, "name"); + } + + if (DefinedParameters.Any(p => p.IsList)) + throw new InvalidOperationException(Strings.CannotDefineMultipleParameterLists); + + var parameterList = new ArgumentList(_definedCommand, name, defaultValue); + _parameters.Add(parameterList); + + if (_activeCommand != _definedCommand) + return parameterList; + + try + { + if (Parser.TryParseParameterList(parameterList.GetDisplayName(), valueConverter, out IReadOnlyList values)) + parameterList.SetValue(values); + } + catch (ArgumentSyntaxException ex) + { + ReportError(ex.Message); + } + + return parameterList; + } + + private static bool IsValidName(string name) + { + if (string.IsNullOrEmpty(name)) + return false; + + if (name[0] == '-') + return false; + + return name.All(c => char.IsLetterOrDigit(c) || + c == '-' || + c == '_'); + } + + private IEnumerable ParseOptionNameList(string name) + { + var names = name.Split('|').Select(n => n.Trim()).ToArray(); + + foreach (var alias in names) + { + if (!IsValidName(alias)) + { + var message = string.Format(Strings.OptionNameIsNotValidFmt, alias); + throw new ArgumentException(message, "name"); + } + + foreach (var option in DefinedOptions) + { + if (option.Names.Any(n => string.Equals(n, alias, StringComparison.Ordinal))) + { + var message = string.Format(Strings.OptionAlreadyDefinedFmt, alias); + throw new InvalidOperationException(message); + } + } + } + + return names; + } + + private IEnumerable ParseResponseFile(string fileName) + { + if (!HandleResponseFiles) + return null; + + if (!File.Exists(fileName)) + { + var message = string.Format(Strings.ResponseFileDoesNotExistFmt, fileName); + ReportError(message); + } + + return File.ReadLines(fileName); + } + + private static string GetApplicationName() + { + var processPath = Environment.GetCommandLineArgs()[0]; + var processName = Path.GetFileNameWithoutExtension(processPath); + return processName; + } + + public string ApplicationName { get; set; } + + public bool HandleErrors { get; set; } + + public bool HandleHelp { get; set; } + + public bool HandleResponseFiles { get; set; } + + public bool ErrorOnUnexpectedArguments { get; set; } + + public IEnumerable RemainingArguments + => Parser.GetUnreadArguments(); + + private ArgumentParser Parser + { + get + { + if (_parser == null) + _parser = new ArgumentParser(_arguments, ParseResponseFile); + + return _parser; + } + } + + private IEnumerable DefinedOptions + { + get { return _options.Where(o => o.Command == null || o.Command == _definedCommand); } + } + + private IEnumerable DefinedParameters + { + get { return _parameters.Where(p => p.Command == null || p.Command == _definedCommand); } + } + + public ArgumentCommand ActiveCommand + { + get { return _activeCommand; } + } + + public IReadOnlyList Commands + { + get { return _commands; } + } + + public IEnumerable GetArguments() + { + return _options.Concat(_parameters); + } + + public IEnumerable GetArguments(ArgumentCommand command) + { + return GetArguments().Where(c => c.Command == null || c.Command == command); + } + + public IEnumerable GetOptions() + { + return _options; + } + + public IEnumerable GetOptions(ArgumentCommand command) + { + return _options.Where(c => c.Command == null || c.Command == command); + } + + public IEnumerable GetParameters() + { + return _parameters; + } + + public IEnumerable GetParameters(ArgumentCommand command) + { + return _parameters.Where(c => c.Command == null || c.Command == command); + } + + public IEnumerable GetActiveArguments() + { + return GetArguments(ActiveCommand); + } + + public IEnumerable GetActiveOptions() + { + return GetOptions(ActiveCommand); + } + + public IEnumerable GetActiveParameters() + { + return GetParameters(ActiveCommand); + } + + public string GetHelpText() + { + return GetHelpText(Console.WindowWidth - 2); + } + + public string GetHelpText(int maxWidth) + { + return HelpTextGenerator.Generate(this, maxWidth); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntaxException.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntaxException.cs new file mode 100644 index 000000000000..ddc12b8a0a58 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntaxException.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. + +using System; + +namespace Internal.CommandLine +{ + public sealed class ArgumentSyntaxException : Exception + { + public ArgumentSyntaxException() + { + } + + public ArgumentSyntaxException(string message) + : base(message) + { + } + + public ArgumentSyntaxException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntax_Definers.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntax_Definers.cs new file mode 100644 index 000000000000..0d98ced079d9 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentSyntax_Definers.cs @@ -0,0 +1,253 @@ +// 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.Globalization; + +namespace Internal.CommandLine +{ + public partial class ArgumentSyntax + { + private static readonly Func s_stringParser = v => v; + private static readonly Func s_booleanParser = v => bool.Parse(v); + private static readonly Func s_int32Parser = v => int.Parse(v, CultureInfo.InvariantCulture); + + // Commands + + public ArgumentCommand DefineCommand(string name) + { + return DefineCommand(name, name); + } + + public ArgumentCommand DefineCommand(string name, ref T command, T value, string help) + { + var result = DefineCommand(name, value); + result.Help = help; + + if (_activeCommand == result) + command = value; + + return result; + } + + public ArgumentCommand DefineCommand(string name, ref string value, string help) + { + return DefineCommand(name, ref value, name, help); + } + + // Options + + public Argument DefineOption(string name, string defaultValue) + { + return DefineOption(name, defaultValue, s_stringParser); + } + + public Argument DefineOption(string name, bool defaultValue) + { + return DefineOption(name, defaultValue, s_booleanParser); + } + + public Argument DefineOption(string name, int defaultValue) + { + return DefineOption(name, defaultValue, s_int32Parser); + } + + public Argument DefineOption(string name, string defaultValue, bool requireValue) + { + return DefineOption(name, defaultValue, s_stringParser, requireValue); + } + + public Argument DefineOption(string name, bool defaultValue, bool requireValue) + { + return DefineOption(name, defaultValue, s_booleanParser, requireValue); + } + + public Argument DefineOption(string name, int defaultValue, bool requireValue) + { + return DefineOption(name, defaultValue, s_int32Parser, requireValue); + } + + public Argument DefineOption(string name, T defaultValue, Func valueConverter) + { + return DefineOption(name, defaultValue, valueConverter, true); + } + + public Argument DefineOption(string name, ref T value, Func valueConverter, string help) + { + return DefineOption(name, ref value, valueConverter, true, help); + } + + public Argument DefineOption(string name, ref T value, Func valueConverter, bool requireValue, string help) + { + var option = DefineOption(name, value, valueConverter, requireValue); + option.Help = help; + + value = option.Value; + return option; + } + + public Argument DefineOption(string name, ref string value, string help) + { + return DefineOption(name, ref value, s_stringParser, help); + } + + public Argument DefineOption(string name, ref bool value, string help) + { + return DefineOption(name, ref value, s_booleanParser, help); + } + + public Argument DefineOption(string name, ref int value, string help) + { + return DefineOption(name, ref value, s_int32Parser, help); + } + + public Argument DefineOption(string name, ref string value, bool requireValue, string help) + { + return DefineOption(name, ref value, s_stringParser, requireValue, help); + } + + public Argument DefineOption(string name, ref bool value, bool requireValue, string help) + { + return DefineOption(name, ref value, s_booleanParser, requireValue, help); + } + + public Argument DefineOption(string name, ref int value, bool requireValue, string help) + { + return DefineOption(name, ref value, s_int32Parser, requireValue, help); + } + + // Option lists + + public ArgumentList DefineOptionList(string name, IReadOnlyList defaultValue) + { + return DefineOptionList(name, defaultValue, s_stringParser); + } + + public ArgumentList DefineOptionList(string name, IReadOnlyList defaultValue) + { + return DefineOptionList(name, defaultValue, s_int32Parser); + } + + public ArgumentList DefineOptionList(string name, IReadOnlyList defaultValue, bool requireValue) + { + return DefineOptionList(name, defaultValue, s_stringParser, requireValue); + } + + public ArgumentList DefineOptionList(string name, IReadOnlyList defaultValue, bool requireValue) + { + return DefineOptionList(name, defaultValue, s_int32Parser, requireValue); + } + + public ArgumentList DefineOptionList(string name, IReadOnlyList defaultValue, Func valueConverter) + { + return DefineOptionList(name, defaultValue, valueConverter, true); + } + + public ArgumentList DefineOptionList(string name, ref IReadOnlyList value, Func valueConverter, string help) + { + return DefineOptionList(name, ref value, valueConverter, true, help); + } + + public ArgumentList DefineOptionList(string name, ref IReadOnlyList value, Func valueConverter, bool requireValue, string help) + { + var optionList = DefineOptionList(name, value, valueConverter, requireValue); + optionList.Help = help; + + value = optionList.Value; + return optionList; + } + + public ArgumentList DefineOptionList(string name, ref IReadOnlyList value, string help) + { + return DefineOptionList(name, ref value, s_stringParser, help); + } + + public ArgumentList DefineOptionList(string name, ref IReadOnlyList value, string help) + { + return DefineOptionList(name, ref value, s_int32Parser, help); + } + + public ArgumentList DefineOptionList(string name, ref IReadOnlyList value, bool requireValue, string help) + { + return DefineOptionList(name, ref value, s_stringParser, requireValue, help); + } + + public ArgumentList DefineOptionList(string name, ref IReadOnlyList value, bool requireValue, string help) + { + return DefineOptionList(name, ref value, s_int32Parser, requireValue, help); + } + + // Parameters + + public Argument DefineParameter(string name, string defaultValue) + { + return DefineParameter(name, defaultValue, s_stringParser); + } + + public Argument DefineParameter(string name, bool defaultValue) + { + return DefineParameter(name, defaultValue, s_booleanParser); + } + + public Argument DefineParameter(string name, int defaultValue) + { + return DefineParameter(name, defaultValue, s_int32Parser); + } + + public Argument DefineParameter(string name, ref T value, Func valueConverter, string help) + { + var parameter = DefineParameter(name, value, valueConverter); + parameter.Help = help; + + value = parameter.Value; + return parameter; + } + + public Argument DefineParameter(string name, ref string value, string help) + { + return DefineParameter(name, ref value, s_stringParser, help); + } + + public Argument DefineParameter(string name, ref bool value, string help) + { + return DefineParameter(name, ref value, s_booleanParser, help); + } + + public Argument DefineParameter(string name, ref int value, string help) + { + return DefineParameter(name, ref value, s_int32Parser, help); + } + + // Parameter list + + public ArgumentList DefineParameterList(string name, IReadOnlyList defaultValue) + { + return DefineParameterList(name, defaultValue, s_stringParser); + } + + public ArgumentList DefineParameterList(string name, IReadOnlyList defaultValue) + { + return DefineParameterList(name, defaultValue, s_int32Parser); + } + + public ArgumentList DefineParameterList(string name, ref IReadOnlyList value, Func valueConverter, string help) + { + var parameterList = DefineParameterList(name, value, valueConverter); + parameterList.Help = help; + + value = parameterList.Value; + return parameterList; + } + + public ArgumentList DefineParameterList(string name, ref IReadOnlyList value, string help) + { + return DefineParameterList(name, ref value, s_stringParser, help); + } + + public ArgumentList DefineParameterList(string name, ref IReadOnlyList value, string help) + { + return DefineParameterList(name, ref value, s_int32Parser, help); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/ArgumentToken.cs b/src/coreclr/src/tools/Common/CommandLine/ArgumentToken.cs new file mode 100644 index 000000000000..c93c63f961b5 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/ArgumentToken.cs @@ -0,0 +1,80 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Internal.CommandLine +{ + internal sealed class ArgumentToken + { + internal ArgumentToken(string modifier, string name, string value) + { + Modifier = modifier; + Name = name; + Value = value; + } + + public string Modifier { get; private set; } + + public string Name { get; private set; } + + public string Value { get; private set; } + + public bool IsOption + { + get { return !string.IsNullOrEmpty(Modifier); } + } + + public bool IsSeparator + { + get { return Name == @":" || Name == @"="; } + } + + public bool HasValue + { + get { return !string.IsNullOrEmpty(Value); } + } + + public bool IsMatched { get; private set; } + + public void MarkMatched() + { + IsMatched = true; + } + + private bool Equals(ArgumentToken other) + { + return string.Equals(Modifier, other.Modifier) && + string.Equals(Name, other.Name) && + string.Equals(Value, other.Value); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(obj, null)) + return false; + + if (ReferenceEquals(obj, this)) + return true; + + var other = obj as ArgumentToken; + return !ReferenceEquals(other, null) && Equals(other); + } + + public override int GetHashCode() + { + unchecked + { + var hashCode = (Modifier != null ? Modifier.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); + hashCode = (hashCode * 397) ^ (Value != null ? Value.GetHashCode() : 0); + return hashCode; + } + } + + public override string ToString() + { + return HasValue + ? string.Format(@"{0}{1}:{2}", Modifier, Name, Value) + : string.Format(@"{0}{1}", Modifier, Name); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/Argument_1.cs b/src/coreclr/src/tools/Common/CommandLine/Argument_1.cs new file mode 100644 index 000000000000..8928ab3872a1 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/Argument_1.cs @@ -0,0 +1,49 @@ +// 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; + +namespace Internal.CommandLine +{ + public sealed class Argument : Argument + { + internal Argument(ArgumentCommand command, IEnumerable names, T defaultValue, bool isRequired) + : base(command, names, true, isRequired) + { + Value = defaultValue; + Value = DefaultValue = defaultValue; + } + + internal Argument(ArgumentCommand command, string name, T defaultValue) + : base(command, new[] { name }, false, true) + { + Value = defaultValue; + DefaultValue = defaultValue; + } + + public new T Value { get; private set; } + + public new T DefaultValue { get; private set; } + + public override bool IsFlag + { + get { return typeof(T) == typeof(bool); } + } + + internal override object GetValue() + { + return Value; + } + + internal override object GetDefaultValue() + { + return DefaultValue; + } + + internal void SetValue(T value) + { + Value = value; + MarkSpecified(); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/Enumerable.cs b/src/coreclr/src/tools/Common/CommandLine/Enumerable.cs new file mode 100644 index 000000000000..a29dbbf30f25 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/Enumerable.cs @@ -0,0 +1,87 @@ +// 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 Linq = System.Linq; + +namespace Internal.CommandLine +{ + // Low-level replacement of LINQ Enumerable class. In particular, this implementation + // doesn't use generic virtual methods. + internal static class Enumerable + { + public static IEnumerable Empty() + { + return Linq.Enumerable.Empty(); + } + + public static IEnumerable Select(this IEnumerable values, Func func) + { + Debug.Assert(values != null); + + foreach (T value in values) + { + yield return func(value); + } + } + + public static IEnumerable Where(this IEnumerable values, Func func) + { + Debug.Assert(values != null); + + foreach (T value in values) + { + if (func(value)) + yield return value; + } + } + + public static IEnumerable Concat(this IEnumerable first, IEnumerable second) + { + return Linq.Enumerable.Concat(first, second); + } + + public static bool All(this IEnumerable source, Func predicate) + { + return Linq.Enumerable.All(source, predicate); + } + + public static bool Any(this IEnumerable source, Func predicate) + { + return Linq.Enumerable.Any(source, predicate); + } + + public static bool Any(this IEnumerable source) + { + return Linq.Enumerable.Any(source); + } + + public static T[] ToArray(this IEnumerable source) + { + return Linq.Enumerable.ToArray(source); + } + + public static T Last(this IEnumerable source) + { + return Linq.Enumerable.Last(source); + } + + public static T FirstOrDefault(this IEnumerable source) + { + return Linq.Enumerable.FirstOrDefault(source); + } + + public static T First(this IEnumerable source) + { + return Linq.Enumerable.First(source); + } + + public static int Max(this IEnumerable source) + { + return Linq.Enumerable.Max(source); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/HelpTextGenerator.cs b/src/coreclr/src/tools/Common/CommandLine/HelpTextGenerator.cs new file mode 100644 index 000000000000..372cf052f32c --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/HelpTextGenerator.cs @@ -0,0 +1,259 @@ +// 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.Text; + +namespace Internal.CommandLine +{ + internal static class HelpTextGenerator + { + public static string Generate(ArgumentSyntax argumentSyntax, int maxWidth) + { + var forCommandList = argumentSyntax.ActiveCommand == null && + argumentSyntax.Commands.Any(); + + var page = forCommandList + ? GetCommandListHelp(argumentSyntax) + : GetCommandHelp(argumentSyntax, argumentSyntax.ActiveCommand); + + var sb = new StringBuilder(); + sb.WriteHelpPage(page, maxWidth); + return sb.ToString(); + } + + private struct HelpPage + { + public string ApplicationName; + public IEnumerable SyntaxElements; + public IReadOnlyList Rows; + } + + private struct HelpRow + { + public string Header; + public string Text; + } + + private static void WriteHelpPage(this StringBuilder sb, HelpPage page, int maxWidth) + { + sb.WriteUsage(page.ApplicationName, page.SyntaxElements, maxWidth); + + if (!page.Rows.Any()) + return; + + sb.AppendLine(); + + sb.WriteRows(page.Rows, maxWidth); + + sb.AppendLine(); + } + + private static void WriteUsage(this StringBuilder sb, string applicationName, IEnumerable syntaxElements, int maxWidth) + { + var usageHeader = string.Format(Strings.HelpUsageOfApplicationFmt, applicationName); + sb.Append(usageHeader); + + if (syntaxElements.Any()) + sb.Append(@" "); + + var syntaxIndent = usageHeader.Length + 1; + var syntaxMaxWidth = maxWidth - syntaxIndent; + + sb.WriteWordWrapped(syntaxElements, syntaxIndent, syntaxMaxWidth); + } + + private static void WriteRows(this StringBuilder sb, IReadOnlyList rows, int maxWidth) + { + const int indent = 4; + var maxColumnWidth = rows.Select(r => r.Header.Length).Max(); + var helpStartColumn = maxColumnWidth + 2 * indent; + + var maxHelpWidth = maxWidth - helpStartColumn; + if (maxHelpWidth < 0) + maxHelpWidth = maxWidth; + + foreach (var row in rows) + { + var headerStart = sb.Length; + + sb.Append(' ', indent); + sb.Append(row.Header); + + var headerLength = sb.Length - headerStart; + var requiredSpaces = helpStartColumn - headerLength; + + sb.Append(' ', requiredSpaces); + + var words = SplitWords(row.Text); + sb.WriteWordWrapped(words, helpStartColumn, maxHelpWidth); + } + } + + private static void WriteWordWrapped(this StringBuilder sb, IEnumerable words, int indent, int maxidth) + { + var helpLines = WordWrapLines(words, maxidth); + var isFirstHelpLine = true; + + foreach (var helpLine in helpLines) + { + if (isFirstHelpLine) + isFirstHelpLine = false; + else + sb.Append(' ', indent); + + sb.AppendLine(helpLine); + } + + if (isFirstHelpLine) + sb.AppendLine(); + } + + private static HelpPage GetCommandListHelp(ArgumentSyntax argumentSyntax) + { + return new HelpPage + { + ApplicationName = argumentSyntax.ApplicationName, + SyntaxElements = GetGlobalSyntax(), + Rows = GetCommandRows(argumentSyntax).ToArray() + }; + } + + private static HelpPage GetCommandHelp(ArgumentSyntax argumentSyntax, ArgumentCommand command) + { + return new HelpPage + { + ApplicationName = argumentSyntax.ApplicationName, + SyntaxElements = GetCommandSyntax(argumentSyntax, command), + Rows = GetArgumentRows(argumentSyntax, command).ToArray() + }; + } + + private static IEnumerable GetGlobalSyntax() + { + yield return @""; + yield return @"[]"; + } + + private static IEnumerable GetCommandSyntax(ArgumentSyntax argumentSyntax, ArgumentCommand command) + { + if (command != null) + yield return command.Name; + + foreach (var option in argumentSyntax.GetOptions(command).Where(o => !o.IsHidden)) + yield return GetOptionSyntax(option); + + if (argumentSyntax.GetParameters(command).All(p => p.IsHidden)) + yield break; + + if (argumentSyntax.GetOptions(command).Any(o => !o.IsHidden)) + yield return @"[--]"; + + foreach (var parameter in argumentSyntax.GetParameters(command).Where(o => !o.IsHidden)) + yield return GetParameterSyntax(parameter); + } + + private static string GetOptionSyntax(Argument option) + { + var sb = new StringBuilder(); + + sb.Append(@"["); + sb.Append(option.GetDisplayName()); + + if (!option.IsFlag) + sb.Append(option.IsRequired ? @" " : @" [arg]"); + + if (option.IsList) + sb.Append(@"..."); + + sb.Append(@"]"); + + return sb.ToString(); + } + + private static string GetParameterSyntax(Argument parameter) + { + var sb = new StringBuilder(); + + sb.Append(parameter.GetDisplayName()); + if (parameter.IsList) + sb.Append(@"..."); + + return sb.ToString(); + } + + private static IEnumerable GetCommandRows(ArgumentSyntax argumentSyntax) + { + return argumentSyntax.Commands + .Where(c => !c.IsHidden) + .Select(c => new HelpRow { Header = c.Name, Text = c.Help }); + } + + private static IEnumerable GetArgumentRows(ArgumentSyntax argumentSyntax, ArgumentCommand command) + { + return argumentSyntax.GetArguments(command) + .Where(a => !a.IsHidden) + .Select(a => new HelpRow { Header = GetArgumentRowHeader(a), Text = a.Help }); + } + + private static string GetArgumentRowHeader(Argument argument) + { + var sb = new StringBuilder(); + + foreach (var displayName in argument.GetDisplayNames()) + { + if (sb.Length > 0) + sb.Append(@", "); + + sb.Append(displayName); + } + + if (argument.IsOption && !argument.IsFlag) + sb.Append(argument.IsRequired ? @" " : @" [arg]"); + + if (argument.IsList) + sb.Append(@"..."); + + return sb.ToString(); + } + + private static IEnumerable WordWrapLines(IEnumerable tokens, int maxWidth) + { + var sb = new StringBuilder(); + + foreach (var token in tokens) + { + var newLength = sb.Length == 0 + ? token.Length + : sb.Length + 1 + token.Length; + + if (newLength > maxWidth) + { + if (sb.Length == 0) + { + yield return token; + continue; + } + + yield return sb.ToString(); + sb.Clear(); + } + + if (sb.Length > 0) + sb.Append(@" "); + + sb.Append(token); + } + + if (sb.Length > 0) + yield return sb.ToString(); + } + + private static IEnumerable SplitWords(string text) + { + return string.IsNullOrEmpty(text) + ? Enumerable.Empty() + : text.Split(' '); + } + } +} diff --git a/src/coreclr/src/tools/Common/CommandLine/Resources/Strings.resx b/src/coreclr/src/tools/Common/CommandLine/Resources/Strings.resx new file mode 100644 index 000000000000..0949d6fa0448 --- /dev/null +++ b/src/coreclr/src/tools/Common/CommandLine/Resources/Strings.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Cannot define commands if global options or parameters exist. + + + value '{0}' isn't valid for {1}: {2} + + + Command '{0}' is already defined. + + + error: {0} + + + extra parameter '{0}' + + + usage: {0} + + + invalid option {0} + + + missing command + + + You must specify a name. + + + Option '{0}' is already defined. + + + Options must be defined before any parameters. + + + Response file '{0}' doesn't exist. + + + unknown command '{0}' + + + Unmatched quote at position {0}. + + + option {0} requires a value + + + Parameter '{0}' is already defined. + + + Cannot define multiple parameter lists. + + + Parameters cannot be defined after parameter lists. + + + Name '{0}' cannot be used for a command. + + + Name '{0}' cannot be used for an option. + + + Name '{0}' cannot be used for a parameter. + + \ No newline at end of file diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs index ffc8db575bc0..da20de18b9f8 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs @@ -302,6 +302,8 @@ public void EmitReloc(ISymbolNode symbol, RelocType relocType, int delta = 0) case RelocType.IMAGE_REL_BASED_THUMB_MOV32: case RelocType.IMAGE_REL_BASED_ARM64_PAGEBASE_REL21: case RelocType.IMAGE_REL_BASED_ARM64_PAGEOFFSET_12L: + case RelocType.IMAGE_REL_BASED_ARM64_PAGEOFFSET_12A: + Debug.Assert(delta == 0); // Do not vacate space for this kind of relocation, because // the space is embedded in the instruction. break; diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Relocation.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Relocation.cs index fbb9408222ca..5b50701a2b97 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Relocation.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Relocation.cs @@ -257,6 +257,45 @@ private static unsafe void PutArm64Rel12(uint* pCode, int imm12) Debug.Assert(GetArm64Rel12(pCode) == imm12); } + private static unsafe int GetArm64Rel28(uint* pCode) + { + uint branchInstr = *pCode; + + // first shift 6 bits left to set the sign bit, + // then arithmetic shift right by 4 bits + int imm28 = (((int)(branchInstr & 0x03FFFFFF)) << 6) >> 4; + + return imm28; + } + + private static bool FitsInArm64Rel28(long imm28) + { + return (imm28 >= -0x08000000L) && (imm28 < 0x08000000L); + } + + private static unsafe void PutArm64Rel28(uint* pCode, long imm28) + { + // Verify that we got a valid offset + Debug.Assert(FitsInArm64Rel28(imm28)); + + Debug.Assert((imm28 & 0x3) == 0); // the low two bits must be zero + + uint branchInstr = *pCode; + + branchInstr &= 0xFC000000; // keep bits 31-26 + + Debug.Assert((branchInstr & 0x7FFFFFFF) == 0x14000000); // Must be B or BL + + // Assemble the pc-relative delta 'imm28' into the branch instruction + branchInstr |= (uint)(((imm28 >> 2) & 0x03FFFFFFU)); + + *pCode = branchInstr; // write the assembled instruction + + Debug.Assert(GetArm64Rel28(pCode) == imm28); + } + + + public Relocation(RelocType relocType, int offset, ISymbolNode target) { RelocType = relocType; @@ -286,6 +325,9 @@ public static unsafe void WriteValue(RelocType relocType, void* location, long v case RelocType.IMAGE_REL_BASED_THUMB_BRANCH24: PutThumb2BlRel24((ushort*)location, (uint)value); break; + case RelocType.IMAGE_REL_BASED_ARM64_BRANCH26: + PutArm64Rel28((uint*)location, value); + break; case RelocType.IMAGE_REL_BASED_ARM64_PAGEBASE_REL21: PutArm64Rel21((uint*)location, (int)value); break; @@ -318,6 +360,8 @@ public static unsafe long ReadValue(RelocType relocType, void* location) return (long)GetThumb2Mov32((ushort*)location); case RelocType.IMAGE_REL_BASED_THUMB_BRANCH24: return (long)GetThumb2BlRel24((ushort*)location); + case RelocType.IMAGE_REL_BASED_ARM64_BRANCH26: + return (long)GetArm64Rel28((uint*)location); case RelocType.IMAGE_REL_BASED_ARM64_PAGEBASE_REL21: return GetArm64Rel21((uint*)location); case RelocType.IMAGE_REL_BASED_ARM64_PAGEOFFSET_12A: diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs index ee2a3c7516b0..895f2f9d1a05 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/ARM64Emitter.cs @@ -18,14 +18,10 @@ public ARM64Emitter(NodeFactory factory, bool relocsOnly) public TargetRegisterMap TargetRegister; // Assembly stub creation api. TBD, actually make this general purpose - public void EmitMOV(Register regDst, ref AddrMode memory) - { - throw new NotImplementedException(); - } public void EmitMOV(Register regDst, Register regSrc) { - throw new NotImplementedException(); + Builder.EmitUInt((uint)(0b1_0_1_01010_000_00000_000000_11111_00000u | ((uint)regSrc << 16) | (uint)regDst)); } public void EmitMOV(Register regDst, ushort imm16) @@ -35,6 +31,17 @@ public void EmitMOV(Register regDst, ushort imm16) Builder.EmitUInt(instruction); } + public void EmitMOV(Register regDst, ISymbolNode symbol) + { + // ADRP regDst, [symbol (21bit ADRP thing)] + Builder.EmitReloc(symbol, RelocType.IMAGE_REL_BASED_ARM64_PAGEBASE_REL21); + Builder.EmitUInt(0x90000000u | (byte)regDst); + + // Add regDst, (12bit LDR page offset reloc) + Builder.EmitReloc(symbol, RelocType.IMAGE_REL_BASED_ARM64_PAGEOFFSET_12A); + Builder.EmitUInt((uint)(0b1_0_0_100010_0_000000000000_00000_00000 | ((byte)regDst << 5) | (byte)regDst)); + } + // ldr regDst, [PC + imm19] public void EmitLDR(Register regDst, short offset) { @@ -54,19 +61,35 @@ public void EmitLDR(Register regDst, Register regAddr) Builder.EmitUInt(instruction); } - public void EmitLEAQ(Register reg, ISymbolNode symbol, int delta = 0) + public void EmitLDR(Register regDst, Register regSrc, int offset) { - throw new NotImplementedException(); - } + Debug.Assert(offset >= -255 && offset <= 4095); + if (offset >= 0) + { + Debug.Assert(offset % 8 == 0); - public void EmitLEA(Register reg, ref AddrMode addrMode) - { - throw new NotImplementedException(); + offset /= 8; + + Builder.EmitUInt((uint)(0b11_1110_0_1_0_1_000000000000_00000_00000u | ((uint)offset << 10) | ((uint)regSrc << 5) | (uint)regDst)); + } + else + { + uint o = (uint)offset & 0x1FF; + + Builder.EmitUInt((uint)(0b11_1110_0_0_010_000000000_1_1_00000_00000u | (o << 12) | ((uint)regSrc << 5) | (uint)regDst)); + } } - public void EmitCMP(ref AddrMode addrMode, sbyte immediate) + public void EmitCMP(Register reg, sbyte immediate) { - throw new NotImplementedException(); + if (immediate >= 0) + { + Builder.EmitUInt((uint)(0b1_1_1_100010_0_000000000000_00000_11111u | immediate << 10) | ((uint)reg << 5)); + } + else + { + throw new NotImplementedException(); + } } // add reg, immediate @@ -75,6 +98,35 @@ public void EmitADD(Register reg, byte immediate) Builder.EmitInt((int)(0x91 << 24) | (immediate << 10) | ((byte)reg << 5) | (byte) reg); } + public void EmitSUB(Register reg, int immediate) + { + if (immediate >= 0) + { + Debug.Assert(immediate % 4 == 0); + + Builder.EmitUInt((uint)(0b1_1_0_100010_0_000000000000_00000_00000u | immediate << 10) | ((uint)reg << 5) | (uint)reg); + } + else + { + throw new NotImplementedException(); + } + } + + public void EmitSUB(Register regDst, Register regSrc, int immediate) + { + if (immediate >= 0) + { + Debug.Assert(immediate % 4 == 0); + + Builder.EmitUInt((uint)(0b1_1_0_100010_0_000000000000_00000_00000u | immediate << 10) | ((uint)regSrc << 5) | (uint)regDst); + } + else + { + throw new NotImplementedException(); + } + } + + public void EmitJMP(ISymbolNode symbol) { if (symbol.RepresentsIndirectionCell) @@ -93,31 +145,38 @@ public void EmitJMP(ISymbolNode symbol) else { Builder.EmitReloc(symbol, RelocType.IMAGE_REL_BASED_ARM64_BRANCH26); - Builder.EmitByte(0); - Builder.EmitByte(0); - Builder.EmitByte(0); - Builder.EmitByte(0x14); + Builder.EmitUInt(0x14000000); } } - public void EmitINT3() + public void EmitJMP(Register reg) { - throw new NotImplementedException(); + Builder.EmitUInt((uint)(0b11010110_0_0_0_11111_00000_0_00000_00000u | ((uint)reg << 5))); } - public void EmitJmpToAddrMode(ref AddrMode addrMode) + public void EmitINT3() { - throw new NotImplementedException(); + Builder.EmitUInt(0b11010100_001_1111111111111111_000_0_0); } public void EmitRET() { - throw new NotImplementedException(); + Builder.EmitUInt(0b11010110_0_1_0_11111_00000_0_11110_00000); } public void EmitRETIfEqual() { - throw new NotImplementedException(); + Builder.EmitUInt(0b01010100_0000000000000000010_0_0001u); + EmitRET(); + } + + public void EmitJE(ISymbolNode symbol) + { + uint offset = symbol.RepresentsIndirectionCell ? 6u : 2u; + + Builder.EmitUInt(0b01010100_0000000000000000000_0_0001u | offset << 5); + + EmitJMP(symbol); } private bool InSignedByteRange(int i) diff --git a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs index ad69fdf94519..5a328f4c650a 100644 --- a/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs +++ b/src/coreclr/src/tools/Common/Compiler/DependencyAnalysis/Target_ARM64/TargetRegisterMap.cs @@ -20,6 +20,7 @@ public struct TargetRegisterMap public readonly Register Arg5; public readonly Register Arg6; public readonly Register Arg7; + public readonly Register IntraProcedureCallScratch1; public readonly Register Result; public TargetRegisterMap(TargetOS os) @@ -32,6 +33,7 @@ public TargetRegisterMap(TargetOS os) Arg5 = Register.X5; Arg6 = Register.X6; Arg7 = Register.X7; + IntraProcedureCallScratch1 = Register.X16; Result = Register.X0; } } diff --git a/src/coreclr/src/tools/Common/Compiler/InstructionSetSupport.cs b/src/coreclr/src/tools/Common/Compiler/InstructionSetSupport.cs index c961e8af0594..2f35f083f24d 100644 --- a/src/coreclr/src/tools/Common/Compiler/InstructionSetSupport.cs +++ b/src/coreclr/src/tools/Common/Compiler/InstructionSetSupport.cs @@ -64,6 +64,8 @@ public static string GetHardwareIntrinsicId(TargetArchitecture architecture, Typ } else if (architecture == TargetArchitecture.X86) { + if (potentialType.Name == "X64") + potentialType = (MetadataType)potentialType.ContainingType; if (potentialType.Namespace != "System.Runtime.Intrinsics.X86") return ""; } @@ -230,6 +232,9 @@ public bool ComputeInstructionSetFlags(out InstructionSetFlags supportedInstruct unsupportedInstructionSets.ExpandInstructionSetByReverseImplication(_architecture); unsupportedInstructionSets.Set64BitInstructionSetVariants(_architecture); + if ((_architecture == TargetArchitecture.X86) || (_architecture == TargetArchitecture.ARM)) + unsupportedInstructionSets.Set64BitInstructionSetVariantsUnconditionally(_architecture); + foreach (string supported in _supportedInstructionSets) { supportedInstructionSets.AddInstructionSet(instructionSetConversion[supported]); diff --git a/src/coreclr/src/tools/Common/Compiler/TypeExtensions.cs b/src/coreclr/src/tools/Common/Compiler/TypeExtensions.cs index 89fd08f3dbab..efaee58e9e08 100644 --- a/src/coreclr/src/tools/Common/Compiler/TypeExtensions.cs +++ b/src/coreclr/src/tools/Common/Compiler/TypeExtensions.cs @@ -97,6 +97,19 @@ public static bool IsArrayAddressMethod(this MethodDesc method) return arrayMethod != null && arrayMethod.Kind == ArrayMethodKind.Address; } + + /// + /// Returns true if '' is one of the special methods on multidimensional array types (set, get, address). + /// + public static bool IsArrayMethod(this MethodDesc method) + { + var arrayMethod = method as ArrayMethod; + return arrayMethod != null && (arrayMethod.Kind == ArrayMethodKind.Address || + arrayMethod.Kind == ArrayMethodKind.Get || + arrayMethod.Kind == ArrayMethodKind.Set || + arrayMethod.Kind == ArrayMethodKind.Ctor); + } + /// /// Gets a value indicating whether this type has any generic virtual methods. /// @@ -200,33 +213,6 @@ public static bool IsArrayTypeWithoutGenericInterfaces(this TypeDesc type) return type.IsMdArray || elementType.IsPointer || elementType.IsFunctionPointer; } - /// - /// Determines whether an object of type '' requires 8-byte alignment on - /// 32bit ARM architectures. - /// - public static bool RequiresAlign8(this TypeDesc type) - { - if (type.Context.Target.Architecture != TargetArchitecture.ARM) - { - return false; - } - - if (type.IsArray) - { - var elementType = ((ArrayType)type).ElementType; - if ((elementType.IsValueType) && ((DefType)elementType).InstanceByteAlignment.AsInt > 4) - { - return true; - } - } - else if (type.IsDefType && ((DefType)type).InstanceByteAlignment.AsInt > 4) - { - return true; - } - - return false; - } - public static TypeDesc MergeTypesToCommonParent(TypeDesc ta, TypeDesc tb) { if (ta == tb) diff --git a/src/coreclr/src/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs index dd71f2772966..95bbf3559b2b 100644 --- a/src/coreclr/src/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/Common/Compiler/VectorFieldLayoutAlgorithm.cs @@ -13,9 +13,11 @@ namespace ILCompiler public class VectorFieldLayoutAlgorithm : FieldLayoutAlgorithm { private readonly FieldLayoutAlgorithm _fallbackAlgorithm; + private readonly bool _vectorAbiIsStable; - public VectorFieldLayoutAlgorithm(FieldLayoutAlgorithm fallbackAlgorithm) + public VectorFieldLayoutAlgorithm(FieldLayoutAlgorithm fallbackAlgorithm, bool vectorAbiIsStable = true) { + _vectorAbiIsStable = vectorAbiIsStable; _fallbackAlgorithm = fallbackAlgorithm; } @@ -73,6 +75,7 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp FieldAlignment = alignment, FieldSize = layoutFromMetadata.FieldSize, Offsets = layoutFromMetadata.Offsets, + LayoutAbiStable = _vectorAbiIsStable }; } diff --git a/src/coreclr/src/tools/Common/Internal/NativeFormat/NativeFormat.cs b/src/coreclr/src/tools/Common/Internal/NativeFormat/NativeFormat.cs index e92c689d658b..2fde8d221ebe 100644 --- a/src/coreclr/src/tools/Common/Internal/NativeFormat/NativeFormat.cs +++ b/src/coreclr/src/tools/Common/Internal/NativeFormat/NativeFormat.cs @@ -6,11 +6,11 @@ // // Native Format // -// NativeFormat is a binary metadata format. It primarily designed for storing layout decisions done by static code -// generator that the dynamic code generator needs to be aware of. However, it can be also used for storing general +// NativeFormat is a binary metadata format. It primarily designed for storing layout decisions done by static code +// generator that the dynamic code generator needs to be aware of. However, it can be also used for storing general // managed code metadata in future. The key properties of the format are: // -// - Extensible: It should be possible to attach new data to existing records without breaking existing consumers that +// - Extensible: It should be possible to attach new data to existing records without breaking existing consumers that // do not understand the new data yet. // // - Naturally compressed: Integers are stored using variable length encoding. Offsets are stored as relative offsets. @@ -25,7 +25,7 @@ namespace Internal.NativeFormat { // - // Bag is the key record type for extensibility. It is a list pairs. Data is integer that + // Bag is the key record type for extensibility. It is a list pairs. Data is integer that // is interpretted according to the id. It is typically relative offset of another record. // #if NATIVEFORMAT_PUBLICWRITER @@ -84,8 +84,8 @@ enum FixupSignatureKind : uint MethodLdToken = 0x08, AllocateObject = 0x09, DefaultConstructor = 0x0a, - TlsIndex = 0x0b, - TlsOffset = 0x0c, + ThreadStaticIndex = 0x0b, + // unused = 0x0c, Method = 0x0d, IsInst = 0x0e, CastClass = 0x0f, @@ -105,7 +105,7 @@ enum FixupSignatureKind : uint } // - // TypeSignature describes type. The low 4 bits of the integer that is starts with describe the kind. Upper 28 bits are kind + // TypeSignature describes type. The low 4 bits of the integer that is starts with describe the kind. Upper 28 bits are kind // specific data. The argument signatures immediately follow for nested types. // #if NATIVEFORMAT_PUBLICWRITER diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/CorConstants.cs b/src/coreclr/src/tools/Common/Internal/Runtime/CorConstants.cs index 0b9f35726a13..57a3353a805d 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/CorConstants.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/CorConstants.cs @@ -81,7 +81,7 @@ public enum CorElementType : byte // where the encoding/decoding takes place. ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG = 0x3d, - ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for [mscorlib]System.__Canon + ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for System.__Canon ELEMENT_TYPE_MODULE_ZAPSIG = 0x3f, // zapsig encoding for external module id# ELEMENT_TYPE_HANDLE = 64, diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs index e953a209a086..caee23c7e81c 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/ModuleHeaders.cs @@ -7,7 +7,7 @@ namespace Internal.Runtime { // // Please keep the data structures in this file in sync with the native version at - // src/Native/Runtime/inc/ModuleHeaders.h + // src/coreclr/src/inc/readytorun.h // internal struct ReadyToRunHeaderConstants @@ -15,7 +15,7 @@ internal struct ReadyToRunHeaderConstants public const uint Signature = 0x00525452; // 'RTR' public const ushort CurrentMajorVersion = 4; - public const ushort CurrentMinorVersion = 1; + public const ushort CurrentMinorVersion = 2; } #pragma warning disable 0169 diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs index ce6de5de37ca..6d92e7b5d122 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs @@ -314,6 +314,17 @@ public enum ReadyToRunHelper TypeHandleToRuntimeTypeHandle, } + // Enum used for HFA type recognition. + // Supported across architectures, so that it can be used in altjits and cross-compilation. + public enum ReadyToRunHFAElemType + { + None = 0, + Float32 = 1, + Float64 = 2, + Vector64 = 3, + Vector128 = 4, + } + public static class ReadyToRunRuntimeConstants { public const int READYTORUN_PInvokeTransitionFrameSizeInPointerUnits = 11; diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs index 0a9726239b72..059f13eba29a 100644 --- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs +++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs @@ -95,21 +95,37 @@ public static class ReadyToRunInstructionSetHelper switch (instructionSet) { case InstructionSet.X86_X86Base: return ReadyToRunInstructionSet.X86Base; + case InstructionSet.X86_X86Base_X64: return null; case InstructionSet.X86_SSE: return ReadyToRunInstructionSet.Sse; + case InstructionSet.X86_SSE_X64: return null; case InstructionSet.X86_SSE2: return ReadyToRunInstructionSet.Sse2; + case InstructionSet.X86_SSE2_X64: return null; case InstructionSet.X86_SSE3: return ReadyToRunInstructionSet.Sse3; + case InstructionSet.X86_SSE3_X64: return null; case InstructionSet.X86_SSSE3: return ReadyToRunInstructionSet.Ssse3; + case InstructionSet.X86_SSSE3_X64: return null; case InstructionSet.X86_SSE41: return ReadyToRunInstructionSet.Sse41; + case InstructionSet.X86_SSE41_X64: return null; case InstructionSet.X86_SSE42: return ReadyToRunInstructionSet.Sse42; + case InstructionSet.X86_SSE42_X64: return null; case InstructionSet.X86_AVX: return ReadyToRunInstructionSet.Avx; + case InstructionSet.X86_AVX_X64: return null; case InstructionSet.X86_AVX2: return ReadyToRunInstructionSet.Avx2; + case InstructionSet.X86_AVX2_X64: return null; case InstructionSet.X86_AES: return ReadyToRunInstructionSet.Aes; + case InstructionSet.X86_AES_X64: return null; case InstructionSet.X86_BMI1: return ReadyToRunInstructionSet.Bmi1; + case InstructionSet.X86_BMI1_X64: return null; case InstructionSet.X86_BMI2: return ReadyToRunInstructionSet.Bmi2; + case InstructionSet.X86_BMI2_X64: return null; case InstructionSet.X86_FMA: return ReadyToRunInstructionSet.Fma; + case InstructionSet.X86_FMA_X64: return null; case InstructionSet.X86_LZCNT: return ReadyToRunInstructionSet.Lzcnt; + case InstructionSet.X86_LZCNT_X64: return null; case InstructionSet.X86_PCLMULQDQ: return ReadyToRunInstructionSet.Pclmulqdq; + case InstructionSet.X86_PCLMULQDQ_X64: return null; case InstructionSet.X86_POPCNT: return ReadyToRunInstructionSet.Popcnt; + case InstructionSet.X86_POPCNT_X64: return null; case InstructionSet.X86_Vector128: return null; case InstructionSet.X86_Vector256: return null; diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs index 67475c44629a..1c8c7ba76ae0 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoBase.cs @@ -9,347 +9,7 @@ namespace Internal.JitInterface { unsafe partial class CorInfoImpl { - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getMethodAttribs(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __setMethodAttribs(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CorInfoMethodRuntimeFlags attribs); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getMethodSig(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_STRUCT_* memberParent); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __getMethodInfo(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* info); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoInline __canInline(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, ref uint pRestrictions); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __reportInliningDecision(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* inlinerHnd, CORINFO_METHOD_STRUCT_* inlineeHnd, CorInfoInline inlineResult, byte* reason); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __canTailCall(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* declaredCalleeHnd, CORINFO_METHOD_STRUCT_* exactCalleeHnd, [MarshalAs(UnmanagedType.I1)]bool fIsTailPrefix); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __reportTailCallDecision(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, [MarshalAs(UnmanagedType.I1)]bool fIsTailPrefix, CorInfoTailCall tailCallResult, byte* reason); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getEHinfo(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint EHnumber, ref CORINFO_EH_CLAUSE clause); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getMethodClass(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_MODULE_STRUCT_* __getMethodModule(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getMethodVTableOffset(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection, [MarshalAs(UnmanagedType.U1)] ref bool isRelative); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_METHOD_STRUCT_* __resolveVirtualMethod(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* virtualMethod, CORINFO_CLASS_STRUCT_* implementingClass, CORINFO_CONTEXT_STRUCT* ownerType); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_METHOD_STRUCT_* __getUnboxedEntry(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte* requiresInstMethodTableArg); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getDefaultEqualityComparerClass(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* elemType); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __expandRawHandleIntrinsic(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_GENERICHANDLE_RESULT pResult); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoIntrinsics __getIntrinsicID(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, byte* pMustExpand); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __isIntrinsicType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* classHnd); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoUnmanagedCallConv __getUnmanagedCallConv(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __pInvokeMarshalingRequired(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __satisfiesMethodConstraints(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* parent, CORINFO_METHOD_STRUCT_* method); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isCompatibleDelegate(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, [MarshalAs(UnmanagedType.Bool)] ref bool pfIsOpenDelegate); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __methodMustBeLoadedBeforeCodeIsRun(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_METHOD_STRUCT_* __mapMethodDeclToMethodImpl(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getGSCookie(IntPtr _this, IntPtr* ppException, IntPtr* pCookieVal, IntPtr** ppCookieVal); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __setPatchpointInfo(IntPtr _this, IntPtr* ppException, PatchpointInfo* patchpointInfo); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate PatchpointInfo* __getOSRInfo(IntPtr _this, IntPtr* ppException, ref uint ilOffset); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __resolveToken(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __tryResolveToken(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __findSig(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __findCallSiteSig(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint methTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getTokenTypeAsHandle(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValidToken(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValidStringRef(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate char* __getStringLiteral(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoType __asCorInfoType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __getClassName(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __getClassNameFromMetadata(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte** namespaceName); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getTypeInstantiationArgument(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, uint index); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate int __appendClassName(IntPtr _this, IntPtr* ppException, char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isValueClass(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoInlineTypeCheck __canInlineTypeCheck(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CorInfoInlineTypeCheckSource source); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getClassAttribs(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isStructRequiringStackAllocRetBuf(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_MODULE_STRUCT_* __getClassModule(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_ASSEMBLY_STRUCT_* __getModuleAssembly(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* mod); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __getAssemblyName(IntPtr _this, IntPtr* ppException, CORINFO_ASSEMBLY_STRUCT_* assem); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __LongLifetimeMalloc(IntPtr _this, IntPtr* ppException, UIntPtr sz); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __LongLifetimeFree(IntPtr _this, IntPtr* ppException, void* obj); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __getClassModuleIdForStatics(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CORINFO_MODULE_STRUCT_** pModule, void** ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getClassSize(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getHeapClassSize(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __canAllocateOnStack(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getClassAlignmentRequirement(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fDoubleAlignHint); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getClassGClayout(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte* gcPtrs); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getClassNumInstanceFields(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_FIELD_STRUCT_* __getFieldInClass(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd, int num); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __checkMethodModifier(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod, byte* modifier, [MarshalAs(UnmanagedType.Bool)]bool fOptional); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoHelpFunc __getNewHelper(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, byte* pHasSideEffects); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoHelpFunc __getNewArrHelper(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* arrayCls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoHelpFunc __getCastingHelper(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, [MarshalAs(UnmanagedType.I1)]bool fThrowing); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoHelpFunc __getSharedCCtorHelper(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getTypeForBox(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoHelpFunc __getBoxHelper(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoHelpFunc __getUnBoxHelper(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __getReadyToRunHelper(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_LOOKUP_KIND pGenericLookupKind, CorInfoHelpFunc id, ref CORINFO_CONST_LOOKUP pLookup); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getReadyToRunDelegateCtorHelper(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pTargetMethod, CORINFO_CLASS_STRUCT_* delegateType, ref CORINFO_LOOKUP pLookup); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __getHelperName(IntPtr _this, IntPtr* ppException, CorInfoHelpFunc helpFunc); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoInitClassResult __initClass(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, CORINFO_METHOD_STRUCT_* method, CORINFO_CONTEXT_STRUCT* context); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __classMustBeLoadedBeforeCodeIsRun(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getBuiltinClass(IntPtr _this, IntPtr* ppException, CorInfoClassId classId); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoType __getTypeForPrimitiveValueClass(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoType __getTypeForPrimitiveNumericClass(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __canCast(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* child, CORINFO_CLASS_STRUCT_* parent); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __areTypesEquivalent(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate TypeCompareState __compareTypesForCast(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* fromClass, CORINFO_CLASS_STRUCT_* toClass); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate TypeCompareState __compareTypesForEquality(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __mergeClasses(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isMoreSpecificType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getParentType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoType __getChildType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_CLASS_STRUCT_** clsRet); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __satisfiesClassConstraints(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isSDArray(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getArrayRank(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __getArrayInitializationData(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, uint size); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoIsAccessAllowedResult __canAccessClass(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, ref CORINFO_HELPER_DESC pAccessHelper); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __getFieldName(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* ftn, byte** moduleName); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getFieldClass(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoType __getFieldType(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, CORINFO_CLASS_STRUCT_** structType, CORINFO_CLASS_STRUCT_* memberParent); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getFieldOffset(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getFieldInfo(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __isFieldStatic(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* fldHnd); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getBoundaries(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref uint cILOffsets, ref uint* pILOffsets, BoundaryTypes* implictBoundaries); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __setBoundaries(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cMap, OffsetMapping* pMap); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getVars(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref uint cVars, ILVarInfo** vars, [MarshalAs(UnmanagedType.U1)] ref bool extendOthers); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __setVars(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cVars, NativeVarInfo* vars); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __allocateArray(IntPtr _this, IntPtr* ppException, UIntPtr cBytes); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __freeArray(IntPtr _this, IntPtr* ppException, void* array); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_ARG_LIST_STRUCT_* __getArgNext(IntPtr _this, IntPtr* ppException, CORINFO_ARG_LIST_STRUCT_* args); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoTypeWithMod __getArgType(IntPtr _this, IntPtr* ppException, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args, CORINFO_CLASS_STRUCT_** vcTypeRet); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getArgClass(IntPtr _this, IntPtr* ppException, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoHFAElemType __getHFAType(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* hClass); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate HRESULT __GetErrorHRESULT(IntPtr _this, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __GetErrorMessage(IntPtr _this, IntPtr* ppException, char* buffer, uint bufferLength); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate int __FilterException(IntPtr _this, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __HandleException(IntPtr _this, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __ThrowExceptionForJitResult(IntPtr _this, IntPtr* ppException, HRESULT result); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __ThrowExceptionForHelper(IntPtr _this, IntPtr* ppException, ref CORINFO_HELPER_DESC throwHelper); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __runWithErrorTrap(IntPtr _this, IntPtr* ppException, void* function, void* parameter); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getEEInfo(IntPtr _this, IntPtr* ppException, ref CORINFO_EE_INFO pEEInfoOut); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate char* __getJitTimeLogFilename(IntPtr _this, IntPtr* ppException); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate mdToken __getMethodDefFromMethod(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __getMethodName(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte** moduleName); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __getMethodNameFromMetadata(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte** className, byte** namespaceName, byte** enclosingClassName); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getMethodHash(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate byte* __findNameOfToken(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __getSystemVAmd64PassStructInRegisterDescriptor(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getThreadTLSIndex(IntPtr _this, IntPtr* ppException, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __getInlinedCallFrameVptr(IntPtr _this, IntPtr* ppException, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate int* __getAddrOfCaptureThreadGlobal(IntPtr _this, IntPtr* ppException, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __getHelperFtn(IntPtr _this, IntPtr* ppException, CorInfoHelpFunc ftnNum, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getFunctionEntryPoint(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref CORINFO_CONST_LOOKUP pResult, CORINFO_ACCESS_FLAGS accessFlags); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getFunctionFixedEntryPoint(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref CORINFO_CONST_LOOKUP pResult); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __getMethodSync(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CorInfoHelpFunc __getLazyStringLiteralHelper(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_MODULE_STRUCT_* __embedModuleHandle(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __embedClassHandle(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* handle, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_METHOD_STRUCT_* __embedMethodHandle(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* handle, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_FIELD_STRUCT_* __embedFieldHandle(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* handle, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __embedGenericHandle(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, [MarshalAs(UnmanagedType.Bool)]bool fEmbedParent, ref CORINFO_GENERICHANDLE_RESULT pResult); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getLocationOfThisType(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* context, ref CORINFO_LOOKUP_KIND pLookupKind); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getAddressOfPInvokeTarget(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref CORINFO_CONST_LOOKUP pLookup); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __GetCookieForPInvokeCalliSig(IntPtr _this, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __canGetCookieForPInvokeCalliSig(IntPtr _this, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_JUST_MY_CODE_HANDLE_* __getJustMyCodeHandle(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref CORINFO_JUST_MY_CODE_HANDLE_* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __GetProfilingHandle(IntPtr _this, IntPtr* ppException, [MarshalAs(UnmanagedType.Bool)] ref bool pbHookFunction, ref void* pProfilerHandle, [MarshalAs(UnmanagedType.Bool)] ref bool pbIndirectedHandles); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __getCallInfo(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __canAccessFamily(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hCaller, CORINFO_CLASS_STRUCT_* hInstanceType); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __isRIDClassDomainID(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getClassDomainID(IntPtr _this, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __getFieldAddress(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, void** ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_CLASS_STRUCT_* __getStaticFieldCurrentClass(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, byte* pIsSpeculative); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate IntPtr __getVarArgsHandle(IntPtr _this, IntPtr* ppException, CORINFO_SIG_INFO* pSig, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __canGetVarArgsHandle(IntPtr _this, IntPtr* ppException, CORINFO_SIG_INFO* pSig); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate InfoAccessType __constructStringLiteral(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, mdToken metaTok, ref void* ppValue); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate InfoAccessType __emptyStringLiteral(IntPtr _this, IntPtr* ppException, ref void* ppValue); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getFieldThreadLocalStoreID(IntPtr _this, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, ref void* ppIndirection); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __setOverride(IntPtr _this, IntPtr* ppException, IntPtr pOverride, CORINFO_METHOD_STRUCT_* currentMethod); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __addActiveDependency(IntPtr _this, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleFrom, CORINFO_MODULE_STRUCT_* moduleTo); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate CORINFO_METHOD_STRUCT_* __GetDelegateCtor(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_METHOD_STRUCT_* targetMethodHnd, ref DelegateCtorArgs pCtorData); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __MethodCompileComplete(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __getTailCallHelpers(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN callToken, CORINFO_SIG_INFO* sig, CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, ref CORINFO_TAILCALL_HELPERS pResult); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.I1)]delegate bool __convertPInvokeCalliToCall(IntPtr _this, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, [MarshalAs(UnmanagedType.I1)]bool mustConvert); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __notifyInstructionSetUsage(IntPtr _this, IntPtr* ppException, InstructionSet instructionSet, [MarshalAs(UnmanagedType.I1)]bool supportEnabled); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __allocMem(IntPtr _this, IntPtr* ppException, uint hotCodeSize, uint coldCodeSize, uint roDataSize, uint xcptnsCount, CorJitAllocMemFlag flag, ref void* hotCodeBlock, ref void* coldCodeBlock, ref void* roDataBlock); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __reserveUnwindInfo(IntPtr _this, IntPtr* ppException, [MarshalAs(UnmanagedType.Bool)]bool isFunclet, [MarshalAs(UnmanagedType.Bool)]bool isColdCode, uint unwindSize); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __allocUnwindInfo(IntPtr _this, IntPtr* ppException, byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void* __allocGCInfo(IntPtr _this, IntPtr* ppException, UIntPtr size); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __setEHcount(IntPtr _this, IntPtr* ppException, uint cEH); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __setEHinfo(IntPtr _this, IntPtr* ppException, uint EHnumber, ref CORINFO_EH_CLAUSE clause); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - [return: MarshalAs(UnmanagedType.Bool)]delegate bool __logMsg(IntPtr _this, IntPtr* ppException, uint level, byte* fmt, IntPtr args); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate int __doAssert(IntPtr _this, IntPtr* ppException, byte* szFile, int iLine, byte* szExpr); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __reportFatalError(IntPtr _this, IntPtr* ppException, CorJitResult result); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate HRESULT __allocMethodBlockCounts(IntPtr _this, IntPtr* ppException, uint count, ref BlockCounts* pBlockCounts); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate HRESULT __getMethodBlockCounts(IntPtr _this, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHnd, ref uint pCount, ref BlockCounts* pBlockCounts, ref uint pNumRuns); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __recordCallSite(IntPtr _this, IntPtr* ppException, uint instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_STRUCT_* methodHandle); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate void __recordRelocation(IntPtr _this, IntPtr* ppException, void* location, void* target, ushort fRelocType, ushort slotNum, int addlDelta); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate ushort __getRelocTypeHint(IntPtr _this, IntPtr* ppException, void* target); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getExpectedTargetArchitecture(IntPtr _this, IntPtr* ppException); - [UnmanagedFunctionPointerAttribute(default(CallingConvention))] - delegate uint __getJitFlags(IntPtr _this, IntPtr* ppException, ref CORJIT_FLAGS flags, uint sizeInBytes); - + [UnmanagedCallersOnly] static uint _getMethodAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn) { var _this = GetThis(thisHandle); @@ -360,10 +20,11 @@ static uint _getMethodAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_ME catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static void _setMethodAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CorInfoMethodRuntimeFlags attribs) { var _this = GetThis(thisHandle); @@ -377,6 +38,7 @@ static void _setMethodAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_ME } } + [UnmanagedCallersOnly] static void _getMethodSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_SIG_INFO* sig, CORINFO_CLASS_STRUCT_* memberParent) { var _this = GetThis(thisHandle); @@ -390,34 +52,37 @@ static void _getMethodSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD } } - [return: MarshalAs(UnmanagedType.I1)]static bool _getMethodInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* info) + [UnmanagedCallersOnly] + static byte _getMethodInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* info) { var _this = GetThis(thisHandle); try { - return _this.getMethodInfo(ftn, info); + return _this.getMethodInfo(ftn, info) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static CorInfoInline _canInline(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, ref uint pRestrictions) + [UnmanagedCallersOnly] + static CorInfoInline _canInline(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, uint* pRestrictions) { var _this = GetThis(thisHandle); try { - return _this.canInline(callerHnd, calleeHnd, ref pRestrictions); + return _this.canInline(callerHnd, calleeHnd, ref *pRestrictions); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoInline); + return default; } } + [UnmanagedCallersOnly] static void _reportInliningDecision(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* inlinerHnd, CORINFO_METHOD_STRUCT_* inlineeHnd, CorInfoInline inlineResult, byte* reason) { var _this = GetThis(thisHandle); @@ -431,26 +96,28 @@ static void _reportInliningDecision(IntPtr thisHandle, IntPtr* ppException, CORI } } - [return: MarshalAs(UnmanagedType.I1)]static bool _canTailCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* declaredCalleeHnd, CORINFO_METHOD_STRUCT_* exactCalleeHnd, [MarshalAs(UnmanagedType.I1)]bool fIsTailPrefix) + [UnmanagedCallersOnly] + static byte _canTailCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* declaredCalleeHnd, CORINFO_METHOD_STRUCT_* exactCalleeHnd, byte fIsTailPrefix) { var _this = GetThis(thisHandle); try { - return _this.canTailCall(callerHnd, declaredCalleeHnd, exactCalleeHnd, fIsTailPrefix); + return _this.canTailCall(callerHnd, declaredCalleeHnd, exactCalleeHnd, fIsTailPrefix != 0) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static void _reportTailCallDecision(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, [MarshalAs(UnmanagedType.I1)]bool fIsTailPrefix, CorInfoTailCall tailCallResult, byte* reason) + [UnmanagedCallersOnly] + static void _reportTailCallDecision(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, byte fIsTailPrefix, CorInfoTailCall tailCallResult, byte* reason) { var _this = GetThis(thisHandle); try { - _this.reportTailCallDecision(callerHnd, calleeHnd, fIsTailPrefix, tailCallResult, reason); + _this.reportTailCallDecision(callerHnd, calleeHnd, fIsTailPrefix != 0, tailCallResult, reason); } catch (Exception ex) { @@ -458,12 +125,13 @@ static void _reportTailCallDecision(IntPtr thisHandle, IntPtr* ppException, CORI } } - static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint EHnumber, ref CORINFO_EH_CLAUSE clause) + [UnmanagedCallersOnly] + static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint EHnumber, CORINFO_EH_CLAUSE* clause) { var _this = GetThis(thisHandle); try { - _this.getEHinfo(ftn, EHnumber, ref clause); + _this.getEHinfo(ftn, EHnumber, ref *clause); } catch (Exception ex) { @@ -471,6 +139,7 @@ static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_ST } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getMethodClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method) { var _this = GetThis(thisHandle); @@ -481,10 +150,11 @@ static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_ST catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CORINFO_MODULE_STRUCT_* _getMethodModule(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method) { var _this = GetThis(thisHandle); @@ -495,16 +165,17 @@ static void _getEHinfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_ST catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_MODULE_STRUCT_*); + return default; } } - static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection, [MarshalAs(UnmanagedType.U1)] ref bool isRelative) + [UnmanagedCallersOnly] + static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, uint* offsetOfIndirection, uint* offsetAfterIndirection, bool* isRelative) { var _this = GetThis(thisHandle); try { - _this.getMethodVTableOffset(method, ref offsetOfIndirection, ref offsetAfterIndirection, ref isRelative); + _this.getMethodVTableOffset(method, ref *offsetOfIndirection, ref *offsetAfterIndirection, ref *isRelative); } catch (Exception ex) { @@ -512,6 +183,7 @@ static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORIN } } + [UnmanagedCallersOnly] static CORINFO_METHOD_STRUCT_* _resolveVirtualMethod(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* virtualMethod, CORINFO_CLASS_STRUCT_* implementingClass, CORINFO_CONTEXT_STRUCT* ownerType) { var _this = GetThis(thisHandle); @@ -522,10 +194,11 @@ static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORIN catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_METHOD_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CORINFO_METHOD_STRUCT_* _getUnboxedEntry(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte* requiresInstMethodTableArg) { var _this = GetThis(thisHandle); @@ -536,10 +209,11 @@ static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORIN catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_METHOD_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getDefaultEqualityComparerClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* elemType) { var _this = GetThis(thisHandle); @@ -550,16 +224,17 @@ static void _getMethodVTableOffset(IntPtr thisHandle, IntPtr* ppException, CORIN catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } - static void _expandRawHandleIntrinsic(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_GENERICHANDLE_RESULT pResult) + [UnmanagedCallersOnly] + static void _expandRawHandleIntrinsic(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_GENERICHANDLE_RESULT* pResult) { var _this = GetThis(thisHandle); try { - _this.expandRawHandleIntrinsic(ref pResolvedToken, ref pResult); + _this.expandRawHandleIntrinsic(ref *pResolvedToken, ref *pResult); } catch (Exception ex) { @@ -567,6 +242,7 @@ static void _expandRawHandleIntrinsic(IntPtr thisHandle, IntPtr* ppException, re } } + [UnmanagedCallersOnly] static CorInfoIntrinsics _getIntrinsicID(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, byte* pMustExpand) { var _this = GetThis(thisHandle); @@ -577,24 +253,26 @@ static CorInfoIntrinsics _getIntrinsicID(IntPtr thisHandle, IntPtr* ppException, catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoIntrinsics); + return default; } } - [return: MarshalAs(UnmanagedType.I1)]static bool _isIntrinsicType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* classHnd) + [UnmanagedCallersOnly] + static byte _isIntrinsicType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* classHnd) { var _this = GetThis(thisHandle); try { - return _this.isIntrinsicType(classHnd); + return _this.isIntrinsicType(classHnd) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } + [UnmanagedCallersOnly] static CorInfoUnmanagedCallConv _getUnmanagedCallConv(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method) { var _this = GetThis(thisHandle); @@ -605,52 +283,56 @@ static CorInfoUnmanagedCallConv _getUnmanagedCallConv(IntPtr thisHandle, IntPtr* catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoUnmanagedCallConv); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _pInvokeMarshalingRequired(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig) + [UnmanagedCallersOnly] + static int _pInvokeMarshalingRequired(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_SIG_INFO* callSiteSig) { var _this = GetThis(thisHandle); try { - return _this.pInvokeMarshalingRequired(method, callSiteSig); + return _this.pInvokeMarshalingRequired(method, callSiteSig) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _satisfiesMethodConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* parent, CORINFO_METHOD_STRUCT_* method) + [UnmanagedCallersOnly] + static int _satisfiesMethodConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* parent, CORINFO_METHOD_STRUCT_* method) { var _this = GetThis(thisHandle); try { - return _this.satisfiesMethodConstraints(parent, method); + return _this.satisfiesMethodConstraints(parent, method) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _isCompatibleDelegate(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, [MarshalAs(UnmanagedType.Bool)] ref bool pfIsOpenDelegate) + [UnmanagedCallersOnly] + static int _isCompatibleDelegate(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, BOOL* pfIsOpenDelegate) { var _this = GetThis(thisHandle); try { - return _this.isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, ref pfIsOpenDelegate); + return _this.isCompatibleDelegate(objCls, methodParentCls, method, delegateCls, pfIsOpenDelegate) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } + [UnmanagedCallersOnly] static void _methodMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method) { var _this = GetThis(thisHandle); @@ -664,6 +346,7 @@ static void _methodMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppExce } } + [UnmanagedCallersOnly] static CORINFO_METHOD_STRUCT_* _mapMethodDeclToMethodImpl(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method) { var _this = GetThis(thisHandle); @@ -674,10 +357,11 @@ static void _methodMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppExce catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_METHOD_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static void _getGSCookie(IntPtr thisHandle, IntPtr* ppException, IntPtr* pCookieVal, IntPtr** ppCookieVal) { var _this = GetThis(thisHandle); @@ -691,6 +375,7 @@ static void _getGSCookie(IntPtr thisHandle, IntPtr* ppException, IntPtr* pCookie } } + [UnmanagedCallersOnly] static void _setPatchpointInfo(IntPtr thisHandle, IntPtr* ppException, PatchpointInfo* patchpointInfo) { var _this = GetThis(thisHandle); @@ -704,26 +389,28 @@ static void _setPatchpointInfo(IntPtr thisHandle, IntPtr* ppException, Patchpoin } } - static PatchpointInfo* _getOSRInfo(IntPtr thisHandle, IntPtr* ppException, ref uint ilOffset) + [UnmanagedCallersOnly] + static PatchpointInfo* _getOSRInfo(IntPtr thisHandle, IntPtr* ppException, uint* ilOffset) { var _this = GetThis(thisHandle); try { - return _this.getOSRInfo(ref ilOffset); + return _this.getOSRInfo(ref *ilOffset); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(PatchpointInfo*); + return default; } } - static void _resolveToken(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken) + [UnmanagedCallersOnly] + static void _resolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken) { var _this = GetThis(thisHandle); try { - _this.resolveToken(ref pResolvedToken); + _this.resolveToken(ref *pResolvedToken); } catch (Exception ex) { @@ -731,12 +418,13 @@ static void _resolveToken(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RE } } - static void _tryResolveToken(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken) + [UnmanagedCallersOnly] + static void _tryResolveToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken) { var _this = GetThis(thisHandle); try { - _this.tryResolveToken(ref pResolvedToken); + _this.tryResolveToken(ref *pResolvedToken); } catch (Exception ex) { @@ -744,6 +432,7 @@ static void _tryResolveToken(IntPtr thisHandle, IntPtr* ppException, ref CORINFO } } + [UnmanagedCallersOnly] static void _findSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig) { var _this = GetThis(thisHandle); @@ -757,6 +446,7 @@ static void _findSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRU } } + [UnmanagedCallersOnly] static void _findCallSiteSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint methTOK, CORINFO_CONTEXT_STRUCT* context, CORINFO_SIG_INFO* sig) { var _this = GetThis(thisHandle); @@ -770,62 +460,67 @@ static void _findCallSiteSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_MOD } } - static CORINFO_CLASS_STRUCT_* _getTokenTypeAsHandle(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken) + [UnmanagedCallersOnly] + static CORINFO_CLASS_STRUCT_* _getTokenTypeAsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken) { var _this = GetThis(thisHandle); try { - return _this.getTokenTypeAsHandle(ref pResolvedToken); + return _this.getTokenTypeAsHandle(ref *pResolvedToken); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _isValidToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK) + [UnmanagedCallersOnly] + static int _isValidToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK) { var _this = GetThis(thisHandle); try { - return _this.isValidToken(module, metaTOK); + return _this.isValidToken(module, metaTOK) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _isValidStringRef(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK) + [UnmanagedCallersOnly] + static int _isValidStringRef(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK) { var _this = GetThis(thisHandle); try { - return _this.isValidStringRef(module, metaTOK); + return _this.isValidStringRef(module, metaTOK) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static char* _getStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, ref int length) + [UnmanagedCallersOnly] + static char* _getStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, uint metaTOK, int* length) { var _this = GetThis(thisHandle); try { - return _this.getStringLiteral(module, metaTOK, ref length); + return _this.getStringLiteral(module, metaTOK, ref *length); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(char*); + return default; } } + [UnmanagedCallersOnly] static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -836,10 +531,11 @@ static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINF catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoType); + return default; } } + [UnmanagedCallersOnly] static byte* _getClassName(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -850,10 +546,11 @@ static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINF catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } + [UnmanagedCallersOnly] static byte* _getClassNameFromMetadata(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte** namespaceName) { var _this = GetThis(thisHandle); @@ -864,10 +561,11 @@ static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINF catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getTypeInstantiationArgument(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, uint index) { var _this = GetThis(thisHandle); @@ -878,38 +576,41 @@ static CorInfoType _asCorInfoType(IntPtr thisHandle, IntPtr* ppException, CORINF catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } - static int _appendClassName(IntPtr thisHandle, IntPtr* ppException, char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fNamespace, [MarshalAs(UnmanagedType.Bool)]bool fFullInst, [MarshalAs(UnmanagedType.Bool)]bool fAssembly) + [UnmanagedCallersOnly] + static int _appendClassName(IntPtr thisHandle, IntPtr* ppException, char** ppBuf, int* pnBufLen, CORINFO_CLASS_STRUCT_* cls, int fNamespace, int fFullInst, int fAssembly) { var _this = GetThis(thisHandle); try { - return _this.appendClassName(ppBuf, ref pnBufLen, cls, fNamespace, fFullInst, fAssembly); + return _this.appendClassName(ppBuf, ref *pnBufLen, cls, fNamespace != 0, fFullInst != 0, fAssembly != 0); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(int); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _isValueClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) + [UnmanagedCallersOnly] + static int _isValueClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); try { - return _this.isValueClass(cls); + return _this.isValueClass(cls) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } + [UnmanagedCallersOnly] static CorInfoInlineTypeCheck _canInlineTypeCheck(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CorInfoInlineTypeCheckSource source) { var _this = GetThis(thisHandle); @@ -920,10 +621,11 @@ static CorInfoInlineTypeCheck _canInlineTypeCheck(IntPtr thisHandle, IntPtr* ppE catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoInlineTypeCheck); + return default; } } + [UnmanagedCallersOnly] static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -934,24 +636,26 @@ static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLA catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _isStructRequiringStackAllocRetBuf(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) + [UnmanagedCallersOnly] + static int _isStructRequiringStackAllocRetBuf(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); try { - return _this.isStructRequiringStackAllocRetBuf(cls); + return _this.isStructRequiringStackAllocRetBuf(cls) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } + [UnmanagedCallersOnly] static CORINFO_MODULE_STRUCT_* _getClassModule(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -962,10 +666,11 @@ static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLA catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_MODULE_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CORINFO_ASSEMBLY_STRUCT_* _getModuleAssembly(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* mod) { var _this = GetThis(thisHandle); @@ -976,10 +681,11 @@ static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLA catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_ASSEMBLY_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static byte* _getAssemblyName(IntPtr thisHandle, IntPtr* ppException, CORINFO_ASSEMBLY_STRUCT_* assem) { var _this = GetThis(thisHandle); @@ -990,10 +696,11 @@ static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLA catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } + [UnmanagedCallersOnly] static void* _LongLifetimeMalloc(IntPtr thisHandle, IntPtr* ppException, UIntPtr sz) { var _this = GetThis(thisHandle); @@ -1004,10 +711,11 @@ static uint _getClassAttribs(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLA catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } + [UnmanagedCallersOnly] static void _LongLifetimeFree(IntPtr thisHandle, IntPtr* ppException, void* obj) { var _this = GetThis(thisHandle); @@ -1021,7 +729,8 @@ static void _LongLifetimeFree(IntPtr thisHandle, IntPtr* ppException, void* obj) } } - static byte* _getClassModuleIdForStatics(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CORINFO_MODULE_STRUCT_** pModule, void** ppIndirection) + [UnmanagedCallersOnly] + static UIntPtr _getClassModuleIdForStatics(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, CORINFO_MODULE_STRUCT_** pModule, void** ppIndirection) { var _this = GetThis(thisHandle); try @@ -1031,10 +740,11 @@ static void _LongLifetimeFree(IntPtr thisHandle, IntPtr* ppException, void* obj) catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } + [UnmanagedCallersOnly] static uint _getClassSize(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1045,10 +755,11 @@ static uint _getClassSize(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_ catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static uint _getHeapClassSize(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1059,38 +770,41 @@ static uint _getHeapClassSize(IntPtr thisHandle, IntPtr* ppException, CORINFO_CL catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _canAllocateOnStack(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) + [UnmanagedCallersOnly] + static int _canAllocateOnStack(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); try { - return _this.canAllocateOnStack(cls); + return _this.canAllocateOnStack(cls) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static uint _getClassAlignmentRequirement(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, [MarshalAs(UnmanagedType.Bool)]bool fDoubleAlignHint) + [UnmanagedCallersOnly] + static uint _getClassAlignmentRequirement(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, int fDoubleAlignHint) { var _this = GetThis(thisHandle); try { - return _this.getClassAlignmentRequirement(cls, fDoubleAlignHint); + return _this.getClassAlignmentRequirement(cls, fDoubleAlignHint != 0); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static uint _getClassGClayout(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, byte* gcPtrs) { var _this = GetThis(thisHandle); @@ -1101,10 +815,11 @@ static uint _getClassGClayout(IntPtr thisHandle, IntPtr* ppException, CORINFO_CL catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static uint _getClassNumInstanceFields(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1115,10 +830,11 @@ static uint _getClassNumInstanceFields(IntPtr thisHandle, IntPtr* ppException, C catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static CORINFO_FIELD_STRUCT_* _getFieldInClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd, int num) { var _this = GetThis(thisHandle); @@ -1129,38 +845,41 @@ static uint _getClassNumInstanceFields(IntPtr thisHandle, IntPtr* ppException, C catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_FIELD_STRUCT_*); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _checkMethodModifier(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod, byte* modifier, [MarshalAs(UnmanagedType.Bool)]bool fOptional) + [UnmanagedCallersOnly] + static int _checkMethodModifier(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod, byte* modifier, int fOptional) { var _this = GetThis(thisHandle); try { - return _this.checkMethodModifier(hMethod, modifier, fOptional); + return _this.checkMethodModifier(hMethod, modifier, fOptional != 0) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static CorInfoHelpFunc _getNewHelper(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, byte* pHasSideEffects) + [UnmanagedCallersOnly] + static CorInfoHelpFunc _getNewHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, byte* pHasSideEffects) { var _this = GetThis(thisHandle); try { - return _this.getNewHelper(ref pResolvedToken, callerHandle, pHasSideEffects); + return _this.getNewHelper(ref *pResolvedToken, callerHandle, pHasSideEffects); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoHelpFunc); + return default; } } + [UnmanagedCallersOnly] static CorInfoHelpFunc _getNewArrHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* arrayCls) { var _this = GetThis(thisHandle); @@ -1171,24 +890,26 @@ static CorInfoHelpFunc _getNewArrHelper(IntPtr thisHandle, IntPtr* ppException, catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoHelpFunc); + return default; } } - static CorInfoHelpFunc _getCastingHelper(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, [MarshalAs(UnmanagedType.I1)]bool fThrowing) + [UnmanagedCallersOnly] + static CorInfoHelpFunc _getCastingHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, byte fThrowing) { var _this = GetThis(thisHandle); try { - return _this.getCastingHelper(ref pResolvedToken, fThrowing); + return _this.getCastingHelper(ref *pResolvedToken, fThrowing != 0); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoHelpFunc); + return default; } } + [UnmanagedCallersOnly] static CorInfoHelpFunc _getSharedCCtorHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd) { var _this = GetThis(thisHandle); @@ -1199,10 +920,11 @@ static CorInfoHelpFunc _getSharedCCtorHelper(IntPtr thisHandle, IntPtr* ppExcept catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoHelpFunc); + return default; } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getTypeForBox(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1213,10 +935,11 @@ static CorInfoHelpFunc _getSharedCCtorHelper(IntPtr thisHandle, IntPtr* ppExcept catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CorInfoHelpFunc _getBoxHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1227,10 +950,11 @@ static CorInfoHelpFunc _getBoxHelper(IntPtr thisHandle, IntPtr* ppException, COR catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoHelpFunc); + return default; } } + [UnmanagedCallersOnly] static CorInfoHelpFunc _getUnBoxHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1241,30 +965,32 @@ static CorInfoHelpFunc _getUnBoxHelper(IntPtr thisHandle, IntPtr* ppException, C catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoHelpFunc); + return default; } } - [return: MarshalAs(UnmanagedType.I1)]static bool _getReadyToRunHelper(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_LOOKUP_KIND pGenericLookupKind, CorInfoHelpFunc id, ref CORINFO_CONST_LOOKUP pLookup) + [UnmanagedCallersOnly] + static byte _getReadyToRunHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_LOOKUP_KIND* pGenericLookupKind, CorInfoHelpFunc id, CORINFO_CONST_LOOKUP* pLookup) { var _this = GetThis(thisHandle); try { - return _this.getReadyToRunHelper(ref pResolvedToken, ref pGenericLookupKind, id, ref pLookup); + return _this.getReadyToRunHelper(ref *pResolvedToken, ref *pGenericLookupKind, id, ref *pLookup) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static void _getReadyToRunDelegateCtorHelper(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pTargetMethod, CORINFO_CLASS_STRUCT_* delegateType, ref CORINFO_LOOKUP pLookup) + [UnmanagedCallersOnly] + static void _getReadyToRunDelegateCtorHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pTargetMethod, CORINFO_CLASS_STRUCT_* delegateType, CORINFO_LOOKUP* pLookup) { var _this = GetThis(thisHandle); try { - _this.getReadyToRunDelegateCtorHelper(ref pTargetMethod, delegateType, ref pLookup); + _this.getReadyToRunDelegateCtorHelper(ref *pTargetMethod, delegateType, ref *pLookup); } catch (Exception ex) { @@ -1272,6 +998,7 @@ static void _getReadyToRunDelegateCtorHelper(IntPtr thisHandle, IntPtr* ppExcept } } + [UnmanagedCallersOnly] static byte* _getHelperName(IntPtr thisHandle, IntPtr* ppException, CorInfoHelpFunc helpFunc) { var _this = GetThis(thisHandle); @@ -1282,10 +1009,11 @@ static void _getReadyToRunDelegateCtorHelper(IntPtr thisHandle, IntPtr* ppExcept catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } + [UnmanagedCallersOnly] static CorInfoInitClassResult _initClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, CORINFO_METHOD_STRUCT_* method, CORINFO_CONTEXT_STRUCT* context) { var _this = GetThis(thisHandle); @@ -1296,10 +1024,11 @@ static CorInfoInitClassResult _initClass(IntPtr thisHandle, IntPtr* ppException, catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoInitClassResult); + return default; } } + [UnmanagedCallersOnly] static void _classMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1313,6 +1042,7 @@ static void _classMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppExcep } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getBuiltinClass(IntPtr thisHandle, IntPtr* ppException, CorInfoClassId classId) { var _this = GetThis(thisHandle); @@ -1323,10 +1053,11 @@ static void _classMustBeLoadedBeforeCodeIsRun(IntPtr thisHandle, IntPtr* ppExcep catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CorInfoType _getTypeForPrimitiveValueClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1337,10 +1068,11 @@ static CorInfoType _getTypeForPrimitiveValueClass(IntPtr thisHandle, IntPtr* ppE catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoType); + return default; } } + [UnmanagedCallersOnly] static CorInfoType _getTypeForPrimitiveNumericClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1351,38 +1083,41 @@ static CorInfoType _getTypeForPrimitiveNumericClass(IntPtr thisHandle, IntPtr* p catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoType); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _canCast(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* child, CORINFO_CLASS_STRUCT_* parent) + [UnmanagedCallersOnly] + static int _canCast(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* child, CORINFO_CLASS_STRUCT_* parent) { var _this = GetThis(thisHandle); try { - return _this.canCast(child, parent); + return _this.canCast(child, parent) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _areTypesEquivalent(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) + [UnmanagedCallersOnly] + static int _areTypesEquivalent(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) { var _this = GetThis(thisHandle); try { - return _this.areTypesEquivalent(cls1, cls2); + return _this.areTypesEquivalent(cls1, cls2) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } + [UnmanagedCallersOnly] static TypeCompareState _compareTypesForCast(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* fromClass, CORINFO_CLASS_STRUCT_* toClass) { var _this = GetThis(thisHandle); @@ -1393,10 +1128,11 @@ static TypeCompareState _compareTypesForCast(IntPtr thisHandle, IntPtr* ppExcept catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(TypeCompareState); + return default; } } + [UnmanagedCallersOnly] static TypeCompareState _compareTypesForEquality(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) { var _this = GetThis(thisHandle); @@ -1407,10 +1143,11 @@ static TypeCompareState _compareTypesForEquality(IntPtr thisHandle, IntPtr* ppEx catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(TypeCompareState); + return default; } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _mergeClasses(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) { var _this = GetThis(thisHandle); @@ -1421,24 +1158,26 @@ static TypeCompareState _compareTypesForEquality(IntPtr thisHandle, IntPtr* ppEx catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _isMoreSpecificType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) + [UnmanagedCallersOnly] + static int _isMoreSpecificType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls1, CORINFO_CLASS_STRUCT_* cls2) { var _this = GetThis(thisHandle); try { - return _this.isMoreSpecificType(cls1, cls2); + return _this.isMoreSpecificType(cls1, cls2) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getParentType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1449,10 +1188,11 @@ static TypeCompareState _compareTypesForEquality(IntPtr thisHandle, IntPtr* ppEx catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CorInfoType _getChildType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_CLASS_STRUCT_** clsRet) { var _this = GetThis(thisHandle); @@ -1463,38 +1203,41 @@ static CorInfoType _getChildType(IntPtr thisHandle, IntPtr* ppException, CORINFO catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoType); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _satisfiesClassConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) + [UnmanagedCallersOnly] + static int _satisfiesClassConstraints(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); try { - return _this.satisfiesClassConstraints(cls); + return _this.satisfiesClassConstraints(cls) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _isSDArray(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) + [UnmanagedCallersOnly] + static int _isSDArray(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); try { - return _this.isSDArray(cls); + return _this.isSDArray(cls) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } + [UnmanagedCallersOnly] static uint _getArrayRank(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); @@ -1505,10 +1248,11 @@ static uint _getArrayRank(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_ catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static void* _getArrayInitializationData(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, uint size) { var _this = GetThis(thisHandle); @@ -1519,24 +1263,26 @@ static uint _getArrayRank(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_ catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } - static CorInfoIsAccessAllowedResult _canAccessClass(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, ref CORINFO_HELPER_DESC pAccessHelper) + [UnmanagedCallersOnly] + static CorInfoIsAccessAllowedResult _canAccessClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_HELPER_DESC* pAccessHelper) { var _this = GetThis(thisHandle); try { - return _this.canAccessClass(ref pResolvedToken, callerHandle, ref pAccessHelper); + return _this.canAccessClass(ref *pResolvedToken, callerHandle, ref *pAccessHelper); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoIsAccessAllowedResult); + return default; } } + [UnmanagedCallersOnly] static byte* _getFieldName(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* ftn, byte** moduleName) { var _this = GetThis(thisHandle); @@ -1547,10 +1293,11 @@ static CorInfoIsAccessAllowedResult _canAccessClass(IntPtr thisHandle, IntPtr* p catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getFieldClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field) { var _this = GetThis(thisHandle); @@ -1561,10 +1308,11 @@ static CorInfoIsAccessAllowedResult _canAccessClass(IntPtr thisHandle, IntPtr* p catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CorInfoType _getFieldType(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, CORINFO_CLASS_STRUCT_** structType, CORINFO_CLASS_STRUCT_* memberParent) { var _this = GetThis(thisHandle); @@ -1575,10 +1323,11 @@ static CorInfoType _getFieldType(IntPtr thisHandle, IntPtr* ppException, CORINFO catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoType); + return default; } } + [UnmanagedCallersOnly] static uint _getFieldOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field) { var _this = GetThis(thisHandle); @@ -1589,16 +1338,17 @@ static uint _getFieldOffset(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIEL catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } - static void _getFieldInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult) + [UnmanagedCallersOnly] + static void _getFieldInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_ACCESS_FLAGS flags, CORINFO_FIELD_INFO* pResult) { var _this = GetThis(thisHandle); try { - _this.getFieldInfo(ref pResolvedToken, callerHandle, flags, pResult); + _this.getFieldInfo(ref *pResolvedToken, callerHandle, flags, pResult); } catch (Exception ex) { @@ -1606,26 +1356,28 @@ static void _getFieldInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RE } } - [return: MarshalAs(UnmanagedType.I1)]static bool _isFieldStatic(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* fldHnd) + [UnmanagedCallersOnly] + static byte _isFieldStatic(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* fldHnd) { var _this = GetThis(thisHandle); try { - return _this.isFieldStatic(fldHnd); + return _this.isFieldStatic(fldHnd) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static void _getBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref uint cILOffsets, ref uint* pILOffsets, BoundaryTypes* implictBoundaries) + [UnmanagedCallersOnly] + static void _getBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint* cILOffsets, uint** pILOffsets, BoundaryTypes* implictBoundaries) { var _this = GetThis(thisHandle); try { - _this.getBoundaries(ftn, ref cILOffsets, ref pILOffsets, implictBoundaries); + _this.getBoundaries(ftn, ref *cILOffsets, ref *pILOffsets, implictBoundaries); } catch (Exception ex) { @@ -1633,6 +1385,7 @@ static void _getBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHO } } + [UnmanagedCallersOnly] static void _setBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cMap, OffsetMapping* pMap) { var _this = GetThis(thisHandle); @@ -1646,12 +1399,13 @@ static void _setBoundaries(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHO } } - static void _getVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref uint cVars, ILVarInfo** vars, [MarshalAs(UnmanagedType.U1)] ref bool extendOthers) + [UnmanagedCallersOnly] + static void _getVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint* cVars, ILVarInfo** vars, bool* extendOthers) { var _this = GetThis(thisHandle); try { - _this.getVars(ftn, ref cVars, vars, ref extendOthers); + _this.getVars(ftn, ref *cVars, vars, ref *extendOthers); } catch (Exception ex) { @@ -1659,6 +1413,7 @@ static void _getVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRU } } + [UnmanagedCallersOnly] static void _setVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, uint cVars, NativeVarInfo* vars) { var _this = GetThis(thisHandle); @@ -1672,6 +1427,7 @@ static void _setVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRU } } + [UnmanagedCallersOnly] static void* _allocateArray(IntPtr thisHandle, IntPtr* ppException, UIntPtr cBytes) { var _this = GetThis(thisHandle); @@ -1682,10 +1438,11 @@ static void _setVars(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRU catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } + [UnmanagedCallersOnly] static void _freeArray(IntPtr thisHandle, IntPtr* ppException, void* array) { var _this = GetThis(thisHandle); @@ -1699,6 +1456,7 @@ static void _freeArray(IntPtr thisHandle, IntPtr* ppException, void* array) } } + [UnmanagedCallersOnly] static CORINFO_ARG_LIST_STRUCT_* _getArgNext(IntPtr thisHandle, IntPtr* ppException, CORINFO_ARG_LIST_STRUCT_* args) { var _this = GetThis(thisHandle); @@ -1709,10 +1467,11 @@ static void _freeArray(IntPtr thisHandle, IntPtr* ppException, void* array) catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_ARG_LIST_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CorInfoTypeWithMod _getArgType(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args, CORINFO_CLASS_STRUCT_** vcTypeRet) { var _this = GetThis(thisHandle); @@ -1723,10 +1482,11 @@ static CorInfoTypeWithMod _getArgType(IntPtr thisHandle, IntPtr* ppException, CO catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoTypeWithMod); + return default; } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getArgClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* sig, CORINFO_ARG_LIST_STRUCT_* args) { var _this = GetThis(thisHandle); @@ -1737,10 +1497,11 @@ static CorInfoTypeWithMod _getArgType(IntPtr thisHandle, IntPtr* ppException, CO catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static CorInfoHFAElemType _getHFAType(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* hClass) { var _this = GetThis(thisHandle); @@ -1751,10 +1512,11 @@ static CorInfoHFAElemType _getHFAType(IntPtr thisHandle, IntPtr* ppException, CO catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoHFAElemType); + return default; } } + [UnmanagedCallersOnly] static HRESULT _GetErrorHRESULT(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers) { var _this = GetThis(thisHandle); @@ -1765,10 +1527,11 @@ static HRESULT _GetErrorHRESULT(IntPtr thisHandle, IntPtr* ppException, _EXCEPTI catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(HRESULT); + return default; } } + [UnmanagedCallersOnly] static uint _GetErrorMessage(IntPtr thisHandle, IntPtr* ppException, char* buffer, uint bufferLength) { var _this = GetThis(thisHandle); @@ -1779,10 +1542,11 @@ static uint _GetErrorMessage(IntPtr thisHandle, IntPtr* ppException, char* buffe catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static int _FilterException(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers) { var _this = GetThis(thisHandle); @@ -1793,10 +1557,11 @@ static int _FilterException(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_P catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(int); + return default; } } + [UnmanagedCallersOnly] static void _HandleException(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_POINTERS* pExceptionPointers) { var _this = GetThis(thisHandle); @@ -1810,6 +1575,7 @@ static void _HandleException(IntPtr thisHandle, IntPtr* ppException, _EXCEPTION_ } } + [UnmanagedCallersOnly] static void _ThrowExceptionForJitResult(IntPtr thisHandle, IntPtr* ppException, HRESULT result) { var _this = GetThis(thisHandle); @@ -1823,12 +1589,13 @@ static void _ThrowExceptionForJitResult(IntPtr thisHandle, IntPtr* ppException, } } - static void _ThrowExceptionForHelper(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_HELPER_DESC throwHelper) + [UnmanagedCallersOnly] + static void _ThrowExceptionForHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_HELPER_DESC* throwHelper) { var _this = GetThis(thisHandle); try { - _this.ThrowExceptionForHelper(ref throwHelper); + _this.ThrowExceptionForHelper(ref *throwHelper); } catch (Exception ex) { @@ -1836,26 +1603,28 @@ static void _ThrowExceptionForHelper(IntPtr thisHandle, IntPtr* ppException, ref } } - [return: MarshalAs(UnmanagedType.I1)]static bool _runWithErrorTrap(IntPtr thisHandle, IntPtr* ppException, void* function, void* parameter) + [UnmanagedCallersOnly] + static byte _runWithErrorTrap(IntPtr thisHandle, IntPtr* ppException, void* function, void* parameter) { var _this = GetThis(thisHandle); try { - return _this.runWithErrorTrap(function, parameter); + return _this.runWithErrorTrap(function, parameter) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_EE_INFO pEEInfoOut) + [UnmanagedCallersOnly] + static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_EE_INFO* pEEInfoOut) { var _this = GetThis(thisHandle); try { - _this.getEEInfo(ref pEEInfoOut); + _this.getEEInfo(ref *pEEInfoOut); } catch (Exception ex) { @@ -1863,6 +1632,7 @@ static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_EE_IN } } + [UnmanagedCallersOnly] static char* _getJitTimeLogFilename(IntPtr thisHandle, IntPtr* ppException) { var _this = GetThis(thisHandle); @@ -1873,10 +1643,11 @@ static void _getEEInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_EE_IN catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(char*); + return default; } } + [UnmanagedCallersOnly] static mdToken _getMethodDefFromMethod(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hMethod) { var _this = GetThis(thisHandle); @@ -1887,10 +1658,11 @@ static mdToken _getMethodDefFromMethod(IntPtr thisHandle, IntPtr* ppException, C catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(mdToken); + return default; } } + [UnmanagedCallersOnly] static byte* _getMethodName(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte** moduleName) { var _this = GetThis(thisHandle); @@ -1901,10 +1673,11 @@ static mdToken _getMethodDefFromMethod(IntPtr thisHandle, IntPtr* ppException, C catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } + [UnmanagedCallersOnly] static byte* _getMethodNameFromMetadata(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, byte** className, byte** namespaceName, byte** enclosingClassName) { var _this = GetThis(thisHandle); @@ -1915,10 +1688,11 @@ static mdToken _getMethodDefFromMethod(IntPtr thisHandle, IntPtr* ppException, C catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } + [UnmanagedCallersOnly] static uint _getMethodHash(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn) { var _this = GetThis(thisHandle); @@ -1929,11 +1703,12 @@ static uint _getMethodHash(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHO catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } - static byte* _findNameOfToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity) + [UnmanagedCallersOnly] + static UIntPtr _findNameOfToken(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity) { var _this = GetThis(thisHandle); try @@ -1943,86 +1718,92 @@ static uint _getMethodHash(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHO catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(byte*); + return default; } } - [return: MarshalAs(UnmanagedType.I1)]static bool _getSystemVAmd64PassStructInRegisterDescriptor(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) + [UnmanagedCallersOnly] + static byte _getSystemVAmd64PassStructInRegisterDescriptor(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) { var _this = GetThis(thisHandle); try { - return _this.getSystemVAmd64PassStructInRegisterDescriptor(structHnd, structPassInRegDescPtr); + return _this.getSystemVAmd64PassStructInRegisterDescriptor(structHnd, structPassInRegDescPtr) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static uint _getThreadTLSIndex(IntPtr thisHandle, IntPtr* ppException, ref void* ppIndirection) + [UnmanagedCallersOnly] + static uint _getThreadTLSIndex(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getThreadTLSIndex(ref ppIndirection); + return _this.getThreadTLSIndex(ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } - static void* _getInlinedCallFrameVptr(IntPtr thisHandle, IntPtr* ppException, ref void* ppIndirection) + [UnmanagedCallersOnly] + static void* _getInlinedCallFrameVptr(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getInlinedCallFrameVptr(ref ppIndirection); + return _this.getInlinedCallFrameVptr(ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } - static int* _getAddrOfCaptureThreadGlobal(IntPtr thisHandle, IntPtr* ppException, ref void* ppIndirection) + [UnmanagedCallersOnly] + static int* _getAddrOfCaptureThreadGlobal(IntPtr thisHandle, IntPtr* ppException, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getAddrOfCaptureThreadGlobal(ref ppIndirection); + return _this.getAddrOfCaptureThreadGlobal(ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(int*); + return default; } } - static void* _getHelperFtn(IntPtr thisHandle, IntPtr* ppException, CorInfoHelpFunc ftnNum, ref void* ppIndirection) + [UnmanagedCallersOnly] + static void* _getHelperFtn(IntPtr thisHandle, IntPtr* ppException, CorInfoHelpFunc ftnNum, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getHelperFtn(ftnNum, ref ppIndirection); + return _this.getHelperFtn(ftnNum, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } - static void _getFunctionEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref CORINFO_CONST_LOOKUP pResult, CORINFO_ACCESS_FLAGS accessFlags) + [UnmanagedCallersOnly] + static void _getFunctionEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_CONST_LOOKUP* pResult, CORINFO_ACCESS_FLAGS accessFlags) { var _this = GetThis(thisHandle); try { - _this.getFunctionEntryPoint(ftn, ref pResult, accessFlags); + _this.getFunctionEntryPoint(ftn, ref *pResult, accessFlags); } catch (Exception ex) { @@ -2030,12 +1811,13 @@ static void _getFunctionEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORIN } } - static void _getFunctionFixedEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref CORINFO_CONST_LOOKUP pResult) + [UnmanagedCallersOnly] + static void _getFunctionFixedEntryPoint(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, CORINFO_CONST_LOOKUP* pResult) { var _this = GetThis(thisHandle); try { - _this.getFunctionFixedEntryPoint(ftn, ref pResult); + _this.getFunctionFixedEntryPoint(ftn, ref *pResult); } catch (Exception ex) { @@ -2043,20 +1825,22 @@ static void _getFunctionFixedEntryPoint(IntPtr thisHandle, IntPtr* ppException, } } - static void* _getMethodSync(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, ref void* ppIndirection) + [UnmanagedCallersOnly] + static void* _getMethodSync(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftn, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getMethodSync(ftn, ref ppIndirection); + return _this.getMethodSync(ftn, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } + [UnmanagedCallersOnly] static CorInfoHelpFunc _getLazyStringLiteralHelper(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle) { var _this = GetThis(thisHandle); @@ -2067,72 +1851,77 @@ static CorInfoHelpFunc _getLazyStringLiteralHelper(IntPtr thisHandle, IntPtr* pp catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CorInfoHelpFunc); + return default; } } - static CORINFO_MODULE_STRUCT_* _embedModuleHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle, ref void* ppIndirection) + [UnmanagedCallersOnly] + static CORINFO_MODULE_STRUCT_* _embedModuleHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* handle, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.embedModuleHandle(handle, ref ppIndirection); + return _this.embedModuleHandle(handle, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_MODULE_STRUCT_*); + return default; } } - static CORINFO_CLASS_STRUCT_* _embedClassHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* handle, ref void* ppIndirection) + [UnmanagedCallersOnly] + static CORINFO_CLASS_STRUCT_* _embedClassHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* handle, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.embedClassHandle(handle, ref ppIndirection); + return _this.embedClassHandle(handle, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } - static CORINFO_METHOD_STRUCT_* _embedMethodHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* handle, ref void* ppIndirection) + [UnmanagedCallersOnly] + static CORINFO_METHOD_STRUCT_* _embedMethodHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* handle, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.embedMethodHandle(handle, ref ppIndirection); + return _this.embedMethodHandle(handle, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_METHOD_STRUCT_*); + return default; } } - static CORINFO_FIELD_STRUCT_* _embedFieldHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* handle, ref void* ppIndirection) + [UnmanagedCallersOnly] + static CORINFO_FIELD_STRUCT_* _embedFieldHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* handle, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.embedFieldHandle(handle, ref ppIndirection); + return _this.embedFieldHandle(handle, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_FIELD_STRUCT_*); + return default; } } - static void _embedGenericHandle(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, [MarshalAs(UnmanagedType.Bool)]bool fEmbedParent, ref CORINFO_GENERICHANDLE_RESULT pResult) + [UnmanagedCallersOnly] + static void _embedGenericHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, int fEmbedParent, CORINFO_GENERICHANDLE_RESULT* pResult) { var _this = GetThis(thisHandle); try { - _this.embedGenericHandle(ref pResolvedToken, fEmbedParent, ref pResult); + _this.embedGenericHandle(ref *pResolvedToken, fEmbedParent != 0, ref *pResult); } catch (Exception ex) { @@ -2140,12 +1929,13 @@ static void _embedGenericHandle(IntPtr thisHandle, IntPtr* ppException, ref CORI } } - static void _getLocationOfThisType(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* context, ref CORINFO_LOOKUP_KIND pLookupKind) + [UnmanagedCallersOnly] + static void _getLocationOfThisType(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* context, CORINFO_LOOKUP_KIND* pLookupKind) { var _this = GetThis(thisHandle); try { - _this.getLocationOfThisType(context, ref pLookupKind); + _this.getLocationOfThisType(context, ref *pLookupKind); } catch (Exception ex) { @@ -2153,12 +1943,13 @@ static void _getLocationOfThisType(IntPtr thisHandle, IntPtr* ppException, CORIN } } - static void _getAddressOfPInvokeTarget(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref CORINFO_CONST_LOOKUP pLookup) + [UnmanagedCallersOnly] + static void _getAddressOfPInvokeTarget(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_CONST_LOOKUP* pLookup) { var _this = GetThis(thisHandle); try { - _this.getAddressOfPInvokeTarget(method, ref pLookup); + _this.getAddressOfPInvokeTarget(method, ref *pLookup); } catch (Exception ex) { @@ -2166,54 +1957,58 @@ static void _getAddressOfPInvokeTarget(IntPtr thisHandle, IntPtr* ppException, C } } - static void* _GetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig, ref void* ppIndirection) + [UnmanagedCallersOnly] + static void* _GetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.GetCookieForPInvokeCalliSig(szMetaSig, ref ppIndirection); + return _this.GetCookieForPInvokeCalliSig(szMetaSig, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } - [return: MarshalAs(UnmanagedType.I1)]static bool _canGetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig) + [UnmanagedCallersOnly] + static byte _canGetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig) { var _this = GetThis(thisHandle); try { - return _this.canGetCookieForPInvokeCalliSig(szMetaSig); + return _this.canGetCookieForPInvokeCalliSig(szMetaSig) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static CORINFO_JUST_MY_CODE_HANDLE_* _getJustMyCodeHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, ref CORINFO_JUST_MY_CODE_HANDLE_* ppIndirection) + [UnmanagedCallersOnly] + static CORINFO_JUST_MY_CODE_HANDLE_* _getJustMyCodeHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* method, CORINFO_JUST_MY_CODE_HANDLE_** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getJustMyCodeHandle(method, ref ppIndirection); + return _this.getJustMyCodeHandle(method, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_JUST_MY_CODE_HANDLE_*); + return default; } } - static void _GetProfilingHandle(IntPtr thisHandle, IntPtr* ppException, [MarshalAs(UnmanagedType.Bool)] ref bool pbHookFunction, ref void* pProfilerHandle, [MarshalAs(UnmanagedType.Bool)] ref bool pbIndirectedHandles) + [UnmanagedCallersOnly] + static void _GetProfilingHandle(IntPtr thisHandle, IntPtr* ppException, BOOL* pbHookFunction, void** pProfilerHandle, BOOL* pbIndirectedHandles) { var _this = GetThis(thisHandle); try { - _this.GetProfilingHandle(ref pbHookFunction, ref pProfilerHandle, ref pbIndirectedHandles); + _this.GetProfilingHandle(pbHookFunction, ref *pProfilerHandle, pbIndirectedHandles); } catch (Exception ex) { @@ -2221,12 +2016,13 @@ static void _GetProfilingHandle(IntPtr thisHandle, IntPtr* ppException, [Marshal } } - static void _getCallInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult) + [UnmanagedCallersOnly] + static void _getCallInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult) { var _this = GetThis(thisHandle); try { - _this.getCallInfo(ref pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); + _this.getCallInfo(ref *pResolvedToken, pConstrainedResolvedToken, callerHandle, flags, pResult); } catch (Exception ex) { @@ -2234,48 +2030,52 @@ static void _getCallInfo(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RES } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _canAccessFamily(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hCaller, CORINFO_CLASS_STRUCT_* hInstanceType) + [UnmanagedCallersOnly] + static int _canAccessFamily(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* hCaller, CORINFO_CLASS_STRUCT_* hInstanceType) { var _this = GetThis(thisHandle); try { - return _this.canAccessFamily(hCaller, hInstanceType); + return _this.canAccessFamily(hCaller, hInstanceType) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _isRIDClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) + [UnmanagedCallersOnly] + static int _isRIDClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls) { var _this = GetThis(thisHandle); try { - return _this.isRIDClassDomainID(cls); + return _this.isRIDClassDomainID(cls) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static uint _getClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, ref void* ppIndirection) + [UnmanagedCallersOnly] + static uint _getClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CLASS_STRUCT_* cls, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getClassDomainID(cls, ref ppIndirection); + return _this.getClassDomainID(cls, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static void* _getFieldAddress(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, void** ppIndirection) { var _this = GetThis(thisHandle); @@ -2286,10 +2086,11 @@ static uint _getClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CL catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } + [UnmanagedCallersOnly] static CORINFO_CLASS_STRUCT_* _getStaticFieldCurrentClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, byte* pIsSpeculative) { var _this = GetThis(thisHandle); @@ -2300,80 +2101,86 @@ static uint _getClassDomainID(IntPtr thisHandle, IntPtr* ppException, CORINFO_CL catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_CLASS_STRUCT_*); + return default; } } - static IntPtr _getVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig, ref void* ppIndirection) + [UnmanagedCallersOnly] + static IntPtr _getVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getVarArgsHandle(pSig, ref ppIndirection); + return _this.getVarArgsHandle(pSig, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(IntPtr); + return default; } } - [return: MarshalAs(UnmanagedType.I1)]static bool _canGetVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig) + [UnmanagedCallersOnly] + static byte _canGetVarArgsHandle(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* pSig) { var _this = GetThis(thisHandle); try { - return _this.canGetVarArgsHandle(pSig); + return _this.canGetVarArgsHandle(pSig) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static InfoAccessType _constructStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, mdToken metaTok, ref void* ppValue) + [UnmanagedCallersOnly] + static InfoAccessType _constructStringLiteral(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* module, mdToken metaTok, void** ppValue) { var _this = GetThis(thisHandle); try { - return _this.constructStringLiteral(module, metaTok, ref ppValue); + return _this.constructStringLiteral(module, metaTok, ref *ppValue); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(InfoAccessType); + return default; } } - static InfoAccessType _emptyStringLiteral(IntPtr thisHandle, IntPtr* ppException, ref void* ppValue) + [UnmanagedCallersOnly] + static InfoAccessType _emptyStringLiteral(IntPtr thisHandle, IntPtr* ppException, void** ppValue) { var _this = GetThis(thisHandle); try { - return _this.emptyStringLiteral(ref ppValue); + return _this.emptyStringLiteral(ref *ppValue); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(InfoAccessType); + return default; } } - static uint _getFieldThreadLocalStoreID(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, ref void* ppIndirection) + [UnmanagedCallersOnly] + static uint _getFieldThreadLocalStoreID(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* field, void** ppIndirection) { var _this = GetThis(thisHandle); try { - return _this.getFieldThreadLocalStoreID(field, ref ppIndirection); + return _this.getFieldThreadLocalStoreID(field, ref *ppIndirection); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); + return default; } } + [UnmanagedCallersOnly] static void _setOverride(IntPtr thisHandle, IntPtr* ppException, IntPtr pOverride, CORINFO_METHOD_STRUCT_* currentMethod) { var _this = GetThis(thisHandle); @@ -2387,6 +2194,7 @@ static void _setOverride(IntPtr thisHandle, IntPtr* ppException, IntPtr pOverrid } } + [UnmanagedCallersOnly] static void _addActiveDependency(IntPtr thisHandle, IntPtr* ppException, CORINFO_MODULE_STRUCT_* moduleFrom, CORINFO_MODULE_STRUCT_* moduleTo) { var _this = GetThis(thisHandle); @@ -2400,20 +2208,22 @@ static void _addActiveDependency(IntPtr thisHandle, IntPtr* ppException, CORINFO } } - static CORINFO_METHOD_STRUCT_* _GetDelegateCtor(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_METHOD_STRUCT_* targetMethodHnd, ref DelegateCtorArgs pCtorData) + [UnmanagedCallersOnly] + static CORINFO_METHOD_STRUCT_* _GetDelegateCtor(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd, CORINFO_CLASS_STRUCT_* clsHnd, CORINFO_METHOD_STRUCT_* targetMethodHnd, DelegateCtorArgs* pCtorData) { var _this = GetThis(thisHandle); try { - return _this.GetDelegateCtor(methHnd, clsHnd, targetMethodHnd, ref pCtorData); + return _this.GetDelegateCtor(methHnd, clsHnd, targetMethodHnd, ref *pCtorData); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(CORINFO_METHOD_STRUCT_*); + return default; } } + [UnmanagedCallersOnly] static void _MethodCompileComplete(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* methHnd) { var _this = GetThis(thisHandle); @@ -2427,40 +2237,43 @@ static void _MethodCompileComplete(IntPtr thisHandle, IntPtr* ppException, CORIN } } - [return: MarshalAs(UnmanagedType.I1)]static bool _getTailCallHelpers(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN callToken, CORINFO_SIG_INFO* sig, CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, ref CORINFO_TAILCALL_HELPERS pResult) + [UnmanagedCallersOnly] + static byte _getTailCallHelpers(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* callToken, CORINFO_SIG_INFO* sig, CORINFO_GET_TAILCALL_HELPERS_FLAGS flags, CORINFO_TAILCALL_HELPERS* pResult) { var _this = GetThis(thisHandle); try { - return _this.getTailCallHelpers(ref callToken, sig, flags, ref pResult); + return _this.getTailCallHelpers(ref *callToken, sig, flags, ref *pResult) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - [return: MarshalAs(UnmanagedType.I1)]static bool _convertPInvokeCalliToCall(IntPtr thisHandle, IntPtr* ppException, ref CORINFO_RESOLVED_TOKEN pResolvedToken, [MarshalAs(UnmanagedType.I1)]bool mustConvert) + [UnmanagedCallersOnly] + static byte _convertPInvokeCalliToCall(IntPtr thisHandle, IntPtr* ppException, CORINFO_RESOLVED_TOKEN* pResolvedToken, byte mustConvert) { var _this = GetThis(thisHandle); try { - return _this.convertPInvokeCalliToCall(ref pResolvedToken, mustConvert); + return _this.convertPInvokeCalliToCall(ref *pResolvedToken, mustConvert != 0) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } - static void _notifyInstructionSetUsage(IntPtr thisHandle, IntPtr* ppException, InstructionSet instructionSet, [MarshalAs(UnmanagedType.I1)]bool supportEnabled) + [UnmanagedCallersOnly] + static void _notifyInstructionSetUsage(IntPtr thisHandle, IntPtr* ppException, InstructionSet instructionSet, byte supportEnabled) { var _this = GetThis(thisHandle); try { - _this.notifyInstructionSetUsage(instructionSet, supportEnabled); + _this.notifyInstructionSetUsage(instructionSet, supportEnabled != 0); } catch (Exception ex) { @@ -2468,12 +2281,13 @@ static void _notifyInstructionSetUsage(IntPtr thisHandle, IntPtr* ppException, I } } - static void _allocMem(IntPtr thisHandle, IntPtr* ppException, uint hotCodeSize, uint coldCodeSize, uint roDataSize, uint xcptnsCount, CorJitAllocMemFlag flag, ref void* hotCodeBlock, ref void* coldCodeBlock, ref void* roDataBlock) + [UnmanagedCallersOnly] + static void _allocMem(IntPtr thisHandle, IntPtr* ppException, uint hotCodeSize, uint coldCodeSize, uint roDataSize, uint xcptnsCount, CorJitAllocMemFlag flag, void** hotCodeBlock, void** coldCodeBlock, void** roDataBlock) { var _this = GetThis(thisHandle); try { - _this.allocMem(hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, ref hotCodeBlock, ref coldCodeBlock, ref roDataBlock); + _this.allocMem(hotCodeSize, coldCodeSize, roDataSize, xcptnsCount, flag, ref *hotCodeBlock, ref *coldCodeBlock, ref *roDataBlock); } catch (Exception ex) { @@ -2481,12 +2295,13 @@ static void _allocMem(IntPtr thisHandle, IntPtr* ppException, uint hotCodeSize, } } - static void _reserveUnwindInfo(IntPtr thisHandle, IntPtr* ppException, [MarshalAs(UnmanagedType.Bool)]bool isFunclet, [MarshalAs(UnmanagedType.Bool)]bool isColdCode, uint unwindSize) + [UnmanagedCallersOnly] + static void _reserveUnwindInfo(IntPtr thisHandle, IntPtr* ppException, int isFunclet, int isColdCode, uint unwindSize) { var _this = GetThis(thisHandle); try { - _this.reserveUnwindInfo(isFunclet, isColdCode, unwindSize); + _this.reserveUnwindInfo(isFunclet != 0, isColdCode != 0, unwindSize); } catch (Exception ex) { @@ -2494,6 +2309,7 @@ static void _reserveUnwindInfo(IntPtr thisHandle, IntPtr* ppException, [MarshalA } } + [UnmanagedCallersOnly] static void _allocUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte* pHotCode, byte* pColdCode, uint startOffset, uint endOffset, uint unwindSize, byte* pUnwindBlock, CorJitFuncKind funcKind) { var _this = GetThis(thisHandle); @@ -2507,6 +2323,7 @@ static void _allocUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte* pHotC } } + [UnmanagedCallersOnly] static void* _allocGCInfo(IntPtr thisHandle, IntPtr* ppException, UIntPtr size) { var _this = GetThis(thisHandle); @@ -2517,10 +2334,11 @@ static void _allocUnwindInfo(IntPtr thisHandle, IntPtr* ppException, byte* pHotC catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(void*); + return default; } } + [UnmanagedCallersOnly] static void _setEHcount(IntPtr thisHandle, IntPtr* ppException, uint cEH) { var _this = GetThis(thisHandle); @@ -2534,12 +2352,13 @@ static void _setEHcount(IntPtr thisHandle, IntPtr* ppException, uint cEH) } } - static void _setEHinfo(IntPtr thisHandle, IntPtr* ppException, uint EHnumber, ref CORINFO_EH_CLAUSE clause) + [UnmanagedCallersOnly] + static void _setEHinfo(IntPtr thisHandle, IntPtr* ppException, uint EHnumber, CORINFO_EH_CLAUSE* clause) { var _this = GetThis(thisHandle); try { - _this.setEHinfo(EHnumber, ref clause); + _this.setEHinfo(EHnumber, ref *clause); } catch (Exception ex) { @@ -2547,20 +2366,22 @@ static void _setEHinfo(IntPtr thisHandle, IntPtr* ppException, uint EHnumber, re } } - [return: MarshalAs(UnmanagedType.Bool)]static bool _logMsg(IntPtr thisHandle, IntPtr* ppException, uint level, byte* fmt, IntPtr args) + [UnmanagedCallersOnly] + static int _logMsg(IntPtr thisHandle, IntPtr* ppException, uint level, byte* fmt, IntPtr args) { var _this = GetThis(thisHandle); try { - return _this.logMsg(level, fmt, args); + return _this.logMsg(level, fmt, args) ? 1 : 0; } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(bool); + return default; } } + [UnmanagedCallersOnly] static int _doAssert(IntPtr thisHandle, IntPtr* ppException, byte* szFile, int iLine, byte* szExpr) { var _this = GetThis(thisHandle); @@ -2571,10 +2392,11 @@ static int _doAssert(IntPtr thisHandle, IntPtr* ppException, byte* szFile, int i catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(int); + return default; } } + [UnmanagedCallersOnly] static void _reportFatalError(IntPtr thisHandle, IntPtr* ppException, CorJitResult result) { var _this = GetThis(thisHandle); @@ -2588,34 +2410,37 @@ static void _reportFatalError(IntPtr thisHandle, IntPtr* ppException, CorJitResu } } - static HRESULT _allocMethodBlockCounts(IntPtr thisHandle, IntPtr* ppException, uint count, ref BlockCounts* pBlockCounts) + [UnmanagedCallersOnly] + static HRESULT _allocMethodBlockCounts(IntPtr thisHandle, IntPtr* ppException, uint count, BlockCounts** pBlockCounts) { var _this = GetThis(thisHandle); try { - return _this.allocMethodBlockCounts(count, ref pBlockCounts); + return _this.allocMethodBlockCounts(count, ref *pBlockCounts); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(HRESULT); + return default; } } - static HRESULT _getMethodBlockCounts(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHnd, ref uint pCount, ref BlockCounts* pBlockCounts, ref uint pNumRuns) + [UnmanagedCallersOnly] + static HRESULT _getMethodBlockCounts(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* ftnHnd, uint* pCount, BlockCounts** pBlockCounts, uint* pNumRuns) { var _this = GetThis(thisHandle); try { - return _this.getMethodBlockCounts(ftnHnd, ref pCount, ref pBlockCounts, ref pNumRuns); + return _this.getMethodBlockCounts(ftnHnd, ref *pCount, ref *pBlockCounts, ref *pNumRuns); } catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(HRESULT); + return default; } } + [UnmanagedCallersOnly] static void _recordCallSite(IntPtr thisHandle, IntPtr* ppException, uint instrOffset, CORINFO_SIG_INFO* callSig, CORINFO_METHOD_STRUCT_* methodHandle) { var _this = GetThis(thisHandle); @@ -2629,6 +2454,7 @@ static void _recordCallSite(IntPtr thisHandle, IntPtr* ppException, uint instrOf } } + [UnmanagedCallersOnly] static void _recordRelocation(IntPtr thisHandle, IntPtr* ppException, void* location, void* target, ushort fRelocType, ushort slotNum, int addlDelta) { var _this = GetThis(thisHandle); @@ -2642,6 +2468,7 @@ static void _recordRelocation(IntPtr thisHandle, IntPtr* ppException, void* loca } } + [UnmanagedCallersOnly] static ushort _getRelocTypeHint(IntPtr thisHandle, IntPtr* ppException, void* target) { var _this = GetThis(thisHandle); @@ -2652,10 +2479,11 @@ static ushort _getRelocTypeHint(IntPtr thisHandle, IntPtr* ppException, void* ta catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(ushort); + return default; } } + [UnmanagedCallersOnly] static uint _getExpectedTargetArchitecture(IntPtr thisHandle, IntPtr* ppException) { var _this = GetThis(thisHandle); @@ -2666,542 +2494,201 @@ static uint _getExpectedTargetArchitecture(IntPtr thisHandle, IntPtr* ppExceptio catch (Exception ex) { *ppException = _this.AllocException(ex); - return default(uint); - } - } - - static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, ref CORJIT_FLAGS flags, uint sizeInBytes) - { - var _this = GetThis(thisHandle); - try - { - return _this.getJitFlags(ref flags, sizeInBytes); - } - catch (Exception ex) - { - *ppException = _this.AllocException(ex); - return default(uint); - } - } - - - static IntPtr GetUnmanagedCallbacks(out Object keepAlive) - { - IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 170); - Object[] delegates = new Object[170]; - - var d0 = new __getMethodAttribs(_getMethodAttribs); - callbacks[0] = Marshal.GetFunctionPointerForDelegate(d0); - delegates[0] = d0; - var d1 = new __setMethodAttribs(_setMethodAttribs); - callbacks[1] = Marshal.GetFunctionPointerForDelegate(d1); - delegates[1] = d1; - var d2 = new __getMethodSig(_getMethodSig); - callbacks[2] = Marshal.GetFunctionPointerForDelegate(d2); - delegates[2] = d2; - var d3 = new __getMethodInfo(_getMethodInfo); - callbacks[3] = Marshal.GetFunctionPointerForDelegate(d3); - delegates[3] = d3; - var d4 = new __canInline(_canInline); - callbacks[4] = Marshal.GetFunctionPointerForDelegate(d4); - delegates[4] = d4; - var d5 = new __reportInliningDecision(_reportInliningDecision); - callbacks[5] = Marshal.GetFunctionPointerForDelegate(d5); - delegates[5] = d5; - var d6 = new __canTailCall(_canTailCall); - callbacks[6] = Marshal.GetFunctionPointerForDelegate(d6); - delegates[6] = d6; - var d7 = new __reportTailCallDecision(_reportTailCallDecision); - callbacks[7] = Marshal.GetFunctionPointerForDelegate(d7); - delegates[7] = d7; - var d8 = new __getEHinfo(_getEHinfo); - callbacks[8] = Marshal.GetFunctionPointerForDelegate(d8); - delegates[8] = d8; - var d9 = new __getMethodClass(_getMethodClass); - callbacks[9] = Marshal.GetFunctionPointerForDelegate(d9); - delegates[9] = d9; - var d10 = new __getMethodModule(_getMethodModule); - callbacks[10] = Marshal.GetFunctionPointerForDelegate(d10); - delegates[10] = d10; - var d11 = new __getMethodVTableOffset(_getMethodVTableOffset); - callbacks[11] = Marshal.GetFunctionPointerForDelegate(d11); - delegates[11] = d11; - var d12 = new __resolveVirtualMethod(_resolveVirtualMethod); - callbacks[12] = Marshal.GetFunctionPointerForDelegate(d12); - delegates[12] = d12; - var d13 = new __getUnboxedEntry(_getUnboxedEntry); - callbacks[13] = Marshal.GetFunctionPointerForDelegate(d13); - delegates[13] = d13; - var d14 = new __getDefaultEqualityComparerClass(_getDefaultEqualityComparerClass); - callbacks[14] = Marshal.GetFunctionPointerForDelegate(d14); - delegates[14] = d14; - var d15 = new __expandRawHandleIntrinsic(_expandRawHandleIntrinsic); - callbacks[15] = Marshal.GetFunctionPointerForDelegate(d15); - delegates[15] = d15; - var d16 = new __getIntrinsicID(_getIntrinsicID); - callbacks[16] = Marshal.GetFunctionPointerForDelegate(d16); - delegates[16] = d16; - var d17 = new __isIntrinsicType(_isIntrinsicType); - callbacks[17] = Marshal.GetFunctionPointerForDelegate(d17); - delegates[17] = d17; - var d18 = new __getUnmanagedCallConv(_getUnmanagedCallConv); - callbacks[18] = Marshal.GetFunctionPointerForDelegate(d18); - delegates[18] = d18; - var d19 = new __pInvokeMarshalingRequired(_pInvokeMarshalingRequired); - callbacks[19] = Marshal.GetFunctionPointerForDelegate(d19); - delegates[19] = d19; - var d20 = new __satisfiesMethodConstraints(_satisfiesMethodConstraints); - callbacks[20] = Marshal.GetFunctionPointerForDelegate(d20); - delegates[20] = d20; - var d21 = new __isCompatibleDelegate(_isCompatibleDelegate); - callbacks[21] = Marshal.GetFunctionPointerForDelegate(d21); - delegates[21] = d21; - var d22 = new __methodMustBeLoadedBeforeCodeIsRun(_methodMustBeLoadedBeforeCodeIsRun); - callbacks[22] = Marshal.GetFunctionPointerForDelegate(d22); - delegates[22] = d22; - var d23 = new __mapMethodDeclToMethodImpl(_mapMethodDeclToMethodImpl); - callbacks[23] = Marshal.GetFunctionPointerForDelegate(d23); - delegates[23] = d23; - var d24 = new __getGSCookie(_getGSCookie); - callbacks[24] = Marshal.GetFunctionPointerForDelegate(d24); - delegates[24] = d24; - var d25 = new __setPatchpointInfo(_setPatchpointInfo); - callbacks[25] = Marshal.GetFunctionPointerForDelegate(d25); - delegates[25] = d25; - var d26 = new __getOSRInfo(_getOSRInfo); - callbacks[26] = Marshal.GetFunctionPointerForDelegate(d26); - delegates[26] = d26; - var d27 = new __resolveToken(_resolveToken); - callbacks[27] = Marshal.GetFunctionPointerForDelegate(d27); - delegates[27] = d27; - var d28 = new __tryResolveToken(_tryResolveToken); - callbacks[28] = Marshal.GetFunctionPointerForDelegate(d28); - delegates[28] = d28; - var d29 = new __findSig(_findSig); - callbacks[29] = Marshal.GetFunctionPointerForDelegate(d29); - delegates[29] = d29; - var d30 = new __findCallSiteSig(_findCallSiteSig); - callbacks[30] = Marshal.GetFunctionPointerForDelegate(d30); - delegates[30] = d30; - var d31 = new __getTokenTypeAsHandle(_getTokenTypeAsHandle); - callbacks[31] = Marshal.GetFunctionPointerForDelegate(d31); - delegates[31] = d31; - var d32 = new __isValidToken(_isValidToken); - callbacks[32] = Marshal.GetFunctionPointerForDelegate(d32); - delegates[32] = d32; - var d33 = new __isValidStringRef(_isValidStringRef); - callbacks[33] = Marshal.GetFunctionPointerForDelegate(d33); - delegates[33] = d33; - var d34 = new __getStringLiteral(_getStringLiteral); - callbacks[34] = Marshal.GetFunctionPointerForDelegate(d34); - delegates[34] = d34; - var d35 = new __asCorInfoType(_asCorInfoType); - callbacks[35] = Marshal.GetFunctionPointerForDelegate(d35); - delegates[35] = d35; - var d36 = new __getClassName(_getClassName); - callbacks[36] = Marshal.GetFunctionPointerForDelegate(d36); - delegates[36] = d36; - var d37 = new __getClassNameFromMetadata(_getClassNameFromMetadata); - callbacks[37] = Marshal.GetFunctionPointerForDelegate(d37); - delegates[37] = d37; - var d38 = new __getTypeInstantiationArgument(_getTypeInstantiationArgument); - callbacks[38] = Marshal.GetFunctionPointerForDelegate(d38); - delegates[38] = d38; - var d39 = new __appendClassName(_appendClassName); - callbacks[39] = Marshal.GetFunctionPointerForDelegate(d39); - delegates[39] = d39; - var d40 = new __isValueClass(_isValueClass); - callbacks[40] = Marshal.GetFunctionPointerForDelegate(d40); - delegates[40] = d40; - var d41 = new __canInlineTypeCheck(_canInlineTypeCheck); - callbacks[41] = Marshal.GetFunctionPointerForDelegate(d41); - delegates[41] = d41; - var d42 = new __getClassAttribs(_getClassAttribs); - callbacks[42] = Marshal.GetFunctionPointerForDelegate(d42); - delegates[42] = d42; - var d43 = new __isStructRequiringStackAllocRetBuf(_isStructRequiringStackAllocRetBuf); - callbacks[43] = Marshal.GetFunctionPointerForDelegate(d43); - delegates[43] = d43; - var d44 = new __getClassModule(_getClassModule); - callbacks[44] = Marshal.GetFunctionPointerForDelegate(d44); - delegates[44] = d44; - var d45 = new __getModuleAssembly(_getModuleAssembly); - callbacks[45] = Marshal.GetFunctionPointerForDelegate(d45); - delegates[45] = d45; - var d46 = new __getAssemblyName(_getAssemblyName); - callbacks[46] = Marshal.GetFunctionPointerForDelegate(d46); - delegates[46] = d46; - var d47 = new __LongLifetimeMalloc(_LongLifetimeMalloc); - callbacks[47] = Marshal.GetFunctionPointerForDelegate(d47); - delegates[47] = d47; - var d48 = new __LongLifetimeFree(_LongLifetimeFree); - callbacks[48] = Marshal.GetFunctionPointerForDelegate(d48); - delegates[48] = d48; - var d49 = new __getClassModuleIdForStatics(_getClassModuleIdForStatics); - callbacks[49] = Marshal.GetFunctionPointerForDelegate(d49); - delegates[49] = d49; - var d50 = new __getClassSize(_getClassSize); - callbacks[50] = Marshal.GetFunctionPointerForDelegate(d50); - delegates[50] = d50; - var d51 = new __getHeapClassSize(_getHeapClassSize); - callbacks[51] = Marshal.GetFunctionPointerForDelegate(d51); - delegates[51] = d51; - var d52 = new __canAllocateOnStack(_canAllocateOnStack); - callbacks[52] = Marshal.GetFunctionPointerForDelegate(d52); - delegates[52] = d52; - var d53 = new __getClassAlignmentRequirement(_getClassAlignmentRequirement); - callbacks[53] = Marshal.GetFunctionPointerForDelegate(d53); - delegates[53] = d53; - var d54 = new __getClassGClayout(_getClassGClayout); - callbacks[54] = Marshal.GetFunctionPointerForDelegate(d54); - delegates[54] = d54; - var d55 = new __getClassNumInstanceFields(_getClassNumInstanceFields); - callbacks[55] = Marshal.GetFunctionPointerForDelegate(d55); - delegates[55] = d55; - var d56 = new __getFieldInClass(_getFieldInClass); - callbacks[56] = Marshal.GetFunctionPointerForDelegate(d56); - delegates[56] = d56; - var d57 = new __checkMethodModifier(_checkMethodModifier); - callbacks[57] = Marshal.GetFunctionPointerForDelegate(d57); - delegates[57] = d57; - var d58 = new __getNewHelper(_getNewHelper); - callbacks[58] = Marshal.GetFunctionPointerForDelegate(d58); - delegates[58] = d58; - var d59 = new __getNewArrHelper(_getNewArrHelper); - callbacks[59] = Marshal.GetFunctionPointerForDelegate(d59); - delegates[59] = d59; - var d60 = new __getCastingHelper(_getCastingHelper); - callbacks[60] = Marshal.GetFunctionPointerForDelegate(d60); - delegates[60] = d60; - var d61 = new __getSharedCCtorHelper(_getSharedCCtorHelper); - callbacks[61] = Marshal.GetFunctionPointerForDelegate(d61); - delegates[61] = d61; - var d62 = new __getTypeForBox(_getTypeForBox); - callbacks[62] = Marshal.GetFunctionPointerForDelegate(d62); - delegates[62] = d62; - var d63 = new __getBoxHelper(_getBoxHelper); - callbacks[63] = Marshal.GetFunctionPointerForDelegate(d63); - delegates[63] = d63; - var d64 = new __getUnBoxHelper(_getUnBoxHelper); - callbacks[64] = Marshal.GetFunctionPointerForDelegate(d64); - delegates[64] = d64; - var d65 = new __getReadyToRunHelper(_getReadyToRunHelper); - callbacks[65] = Marshal.GetFunctionPointerForDelegate(d65); - delegates[65] = d65; - var d66 = new __getReadyToRunDelegateCtorHelper(_getReadyToRunDelegateCtorHelper); - callbacks[66] = Marshal.GetFunctionPointerForDelegate(d66); - delegates[66] = d66; - var d67 = new __getHelperName(_getHelperName); - callbacks[67] = Marshal.GetFunctionPointerForDelegate(d67); - delegates[67] = d67; - var d68 = new __initClass(_initClass); - callbacks[68] = Marshal.GetFunctionPointerForDelegate(d68); - delegates[68] = d68; - var d69 = new __classMustBeLoadedBeforeCodeIsRun(_classMustBeLoadedBeforeCodeIsRun); - callbacks[69] = Marshal.GetFunctionPointerForDelegate(d69); - delegates[69] = d69; - var d70 = new __getBuiltinClass(_getBuiltinClass); - callbacks[70] = Marshal.GetFunctionPointerForDelegate(d70); - delegates[70] = d70; - var d71 = new __getTypeForPrimitiveValueClass(_getTypeForPrimitiveValueClass); - callbacks[71] = Marshal.GetFunctionPointerForDelegate(d71); - delegates[71] = d71; - var d72 = new __getTypeForPrimitiveNumericClass(_getTypeForPrimitiveNumericClass); - callbacks[72] = Marshal.GetFunctionPointerForDelegate(d72); - delegates[72] = d72; - var d73 = new __canCast(_canCast); - callbacks[73] = Marshal.GetFunctionPointerForDelegate(d73); - delegates[73] = d73; - var d74 = new __areTypesEquivalent(_areTypesEquivalent); - callbacks[74] = Marshal.GetFunctionPointerForDelegate(d74); - delegates[74] = d74; - var d75 = new __compareTypesForCast(_compareTypesForCast); - callbacks[75] = Marshal.GetFunctionPointerForDelegate(d75); - delegates[75] = d75; - var d76 = new __compareTypesForEquality(_compareTypesForEquality); - callbacks[76] = Marshal.GetFunctionPointerForDelegate(d76); - delegates[76] = d76; - var d77 = new __mergeClasses(_mergeClasses); - callbacks[77] = Marshal.GetFunctionPointerForDelegate(d77); - delegates[77] = d77; - var d78 = new __isMoreSpecificType(_isMoreSpecificType); - callbacks[78] = Marshal.GetFunctionPointerForDelegate(d78); - delegates[78] = d78; - var d79 = new __getParentType(_getParentType); - callbacks[79] = Marshal.GetFunctionPointerForDelegate(d79); - delegates[79] = d79; - var d80 = new __getChildType(_getChildType); - callbacks[80] = Marshal.GetFunctionPointerForDelegate(d80); - delegates[80] = d80; - var d81 = new __satisfiesClassConstraints(_satisfiesClassConstraints); - callbacks[81] = Marshal.GetFunctionPointerForDelegate(d81); - delegates[81] = d81; - var d82 = new __isSDArray(_isSDArray); - callbacks[82] = Marshal.GetFunctionPointerForDelegate(d82); - delegates[82] = d82; - var d83 = new __getArrayRank(_getArrayRank); - callbacks[83] = Marshal.GetFunctionPointerForDelegate(d83); - delegates[83] = d83; - var d84 = new __getArrayInitializationData(_getArrayInitializationData); - callbacks[84] = Marshal.GetFunctionPointerForDelegate(d84); - delegates[84] = d84; - var d85 = new __canAccessClass(_canAccessClass); - callbacks[85] = Marshal.GetFunctionPointerForDelegate(d85); - delegates[85] = d85; - var d86 = new __getFieldName(_getFieldName); - callbacks[86] = Marshal.GetFunctionPointerForDelegate(d86); - delegates[86] = d86; - var d87 = new __getFieldClass(_getFieldClass); - callbacks[87] = Marshal.GetFunctionPointerForDelegate(d87); - delegates[87] = d87; - var d88 = new __getFieldType(_getFieldType); - callbacks[88] = Marshal.GetFunctionPointerForDelegate(d88); - delegates[88] = d88; - var d89 = new __getFieldOffset(_getFieldOffset); - callbacks[89] = Marshal.GetFunctionPointerForDelegate(d89); - delegates[89] = d89; - var d90 = new __getFieldInfo(_getFieldInfo); - callbacks[90] = Marshal.GetFunctionPointerForDelegate(d90); - delegates[90] = d90; - var d91 = new __isFieldStatic(_isFieldStatic); - callbacks[91] = Marshal.GetFunctionPointerForDelegate(d91); - delegates[91] = d91; - var d92 = new __getBoundaries(_getBoundaries); - callbacks[92] = Marshal.GetFunctionPointerForDelegate(d92); - delegates[92] = d92; - var d93 = new __setBoundaries(_setBoundaries); - callbacks[93] = Marshal.GetFunctionPointerForDelegate(d93); - delegates[93] = d93; - var d94 = new __getVars(_getVars); - callbacks[94] = Marshal.GetFunctionPointerForDelegate(d94); - delegates[94] = d94; - var d95 = new __setVars(_setVars); - callbacks[95] = Marshal.GetFunctionPointerForDelegate(d95); - delegates[95] = d95; - var d96 = new __allocateArray(_allocateArray); - callbacks[96] = Marshal.GetFunctionPointerForDelegate(d96); - delegates[96] = d96; - var d97 = new __freeArray(_freeArray); - callbacks[97] = Marshal.GetFunctionPointerForDelegate(d97); - delegates[97] = d97; - var d98 = new __getArgNext(_getArgNext); - callbacks[98] = Marshal.GetFunctionPointerForDelegate(d98); - delegates[98] = d98; - var d99 = new __getArgType(_getArgType); - callbacks[99] = Marshal.GetFunctionPointerForDelegate(d99); - delegates[99] = d99; - var d100 = new __getArgClass(_getArgClass); - callbacks[100] = Marshal.GetFunctionPointerForDelegate(d100); - delegates[100] = d100; - var d101 = new __getHFAType(_getHFAType); - callbacks[101] = Marshal.GetFunctionPointerForDelegate(d101); - delegates[101] = d101; - var d102 = new __GetErrorHRESULT(_GetErrorHRESULT); - callbacks[102] = Marshal.GetFunctionPointerForDelegate(d102); - delegates[102] = d102; - var d103 = new __GetErrorMessage(_GetErrorMessage); - callbacks[103] = Marshal.GetFunctionPointerForDelegate(d103); - delegates[103] = d103; - var d104 = new __FilterException(_FilterException); - callbacks[104] = Marshal.GetFunctionPointerForDelegate(d104); - delegates[104] = d104; - var d105 = new __HandleException(_HandleException); - callbacks[105] = Marshal.GetFunctionPointerForDelegate(d105); - delegates[105] = d105; - var d106 = new __ThrowExceptionForJitResult(_ThrowExceptionForJitResult); - callbacks[106] = Marshal.GetFunctionPointerForDelegate(d106); - delegates[106] = d106; - var d107 = new __ThrowExceptionForHelper(_ThrowExceptionForHelper); - callbacks[107] = Marshal.GetFunctionPointerForDelegate(d107); - delegates[107] = d107; - var d108 = new __runWithErrorTrap(_runWithErrorTrap); - callbacks[108] = Marshal.GetFunctionPointerForDelegate(d108); - delegates[108] = d108; - var d109 = new __getEEInfo(_getEEInfo); - callbacks[109] = Marshal.GetFunctionPointerForDelegate(d109); - delegates[109] = d109; - var d110 = new __getJitTimeLogFilename(_getJitTimeLogFilename); - callbacks[110] = Marshal.GetFunctionPointerForDelegate(d110); - delegates[110] = d110; - var d111 = new __getMethodDefFromMethod(_getMethodDefFromMethod); - callbacks[111] = Marshal.GetFunctionPointerForDelegate(d111); - delegates[111] = d111; - var d112 = new __getMethodName(_getMethodName); - callbacks[112] = Marshal.GetFunctionPointerForDelegate(d112); - delegates[112] = d112; - var d113 = new __getMethodNameFromMetadata(_getMethodNameFromMetadata); - callbacks[113] = Marshal.GetFunctionPointerForDelegate(d113); - delegates[113] = d113; - var d114 = new __getMethodHash(_getMethodHash); - callbacks[114] = Marshal.GetFunctionPointerForDelegate(d114); - delegates[114] = d114; - var d115 = new __findNameOfToken(_findNameOfToken); - callbacks[115] = Marshal.GetFunctionPointerForDelegate(d115); - delegates[115] = d115; - var d116 = new __getSystemVAmd64PassStructInRegisterDescriptor(_getSystemVAmd64PassStructInRegisterDescriptor); - callbacks[116] = Marshal.GetFunctionPointerForDelegate(d116); - delegates[116] = d116; - var d117 = new __getThreadTLSIndex(_getThreadTLSIndex); - callbacks[117] = Marshal.GetFunctionPointerForDelegate(d117); - delegates[117] = d117; - var d118 = new __getInlinedCallFrameVptr(_getInlinedCallFrameVptr); - callbacks[118] = Marshal.GetFunctionPointerForDelegate(d118); - delegates[118] = d118; - var d119 = new __getAddrOfCaptureThreadGlobal(_getAddrOfCaptureThreadGlobal); - callbacks[119] = Marshal.GetFunctionPointerForDelegate(d119); - delegates[119] = d119; - var d120 = new __getHelperFtn(_getHelperFtn); - callbacks[120] = Marshal.GetFunctionPointerForDelegate(d120); - delegates[120] = d120; - var d121 = new __getFunctionEntryPoint(_getFunctionEntryPoint); - callbacks[121] = Marshal.GetFunctionPointerForDelegate(d121); - delegates[121] = d121; - var d122 = new __getFunctionFixedEntryPoint(_getFunctionFixedEntryPoint); - callbacks[122] = Marshal.GetFunctionPointerForDelegate(d122); - delegates[122] = d122; - var d123 = new __getMethodSync(_getMethodSync); - callbacks[123] = Marshal.GetFunctionPointerForDelegate(d123); - delegates[123] = d123; - var d124 = new __getLazyStringLiteralHelper(_getLazyStringLiteralHelper); - callbacks[124] = Marshal.GetFunctionPointerForDelegate(d124); - delegates[124] = d124; - var d125 = new __embedModuleHandle(_embedModuleHandle); - callbacks[125] = Marshal.GetFunctionPointerForDelegate(d125); - delegates[125] = d125; - var d126 = new __embedClassHandle(_embedClassHandle); - callbacks[126] = Marshal.GetFunctionPointerForDelegate(d126); - delegates[126] = d126; - var d127 = new __embedMethodHandle(_embedMethodHandle); - callbacks[127] = Marshal.GetFunctionPointerForDelegate(d127); - delegates[127] = d127; - var d128 = new __embedFieldHandle(_embedFieldHandle); - callbacks[128] = Marshal.GetFunctionPointerForDelegate(d128); - delegates[128] = d128; - var d129 = new __embedGenericHandle(_embedGenericHandle); - callbacks[129] = Marshal.GetFunctionPointerForDelegate(d129); - delegates[129] = d129; - var d130 = new __getLocationOfThisType(_getLocationOfThisType); - callbacks[130] = Marshal.GetFunctionPointerForDelegate(d130); - delegates[130] = d130; - var d131 = new __getAddressOfPInvokeTarget(_getAddressOfPInvokeTarget); - callbacks[131] = Marshal.GetFunctionPointerForDelegate(d131); - delegates[131] = d131; - var d132 = new __GetCookieForPInvokeCalliSig(_GetCookieForPInvokeCalliSig); - callbacks[132] = Marshal.GetFunctionPointerForDelegate(d132); - delegates[132] = d132; - var d133 = new __canGetCookieForPInvokeCalliSig(_canGetCookieForPInvokeCalliSig); - callbacks[133] = Marshal.GetFunctionPointerForDelegate(d133); - delegates[133] = d133; - var d134 = new __getJustMyCodeHandle(_getJustMyCodeHandle); - callbacks[134] = Marshal.GetFunctionPointerForDelegate(d134); - delegates[134] = d134; - var d135 = new __GetProfilingHandle(_GetProfilingHandle); - callbacks[135] = Marshal.GetFunctionPointerForDelegate(d135); - delegates[135] = d135; - var d136 = new __getCallInfo(_getCallInfo); - callbacks[136] = Marshal.GetFunctionPointerForDelegate(d136); - delegates[136] = d136; - var d137 = new __canAccessFamily(_canAccessFamily); - callbacks[137] = Marshal.GetFunctionPointerForDelegate(d137); - delegates[137] = d137; - var d138 = new __isRIDClassDomainID(_isRIDClassDomainID); - callbacks[138] = Marshal.GetFunctionPointerForDelegate(d138); - delegates[138] = d138; - var d139 = new __getClassDomainID(_getClassDomainID); - callbacks[139] = Marshal.GetFunctionPointerForDelegate(d139); - delegates[139] = d139; - var d140 = new __getFieldAddress(_getFieldAddress); - callbacks[140] = Marshal.GetFunctionPointerForDelegate(d140); - delegates[140] = d140; - var d141 = new __getStaticFieldCurrentClass(_getStaticFieldCurrentClass); - callbacks[141] = Marshal.GetFunctionPointerForDelegate(d141); - delegates[141] = d141; - var d142 = new __getVarArgsHandle(_getVarArgsHandle); - callbacks[142] = Marshal.GetFunctionPointerForDelegate(d142); - delegates[142] = d142; - var d143 = new __canGetVarArgsHandle(_canGetVarArgsHandle); - callbacks[143] = Marshal.GetFunctionPointerForDelegate(d143); - delegates[143] = d143; - var d144 = new __constructStringLiteral(_constructStringLiteral); - callbacks[144] = Marshal.GetFunctionPointerForDelegate(d144); - delegates[144] = d144; - var d145 = new __emptyStringLiteral(_emptyStringLiteral); - callbacks[145] = Marshal.GetFunctionPointerForDelegate(d145); - delegates[145] = d145; - var d146 = new __getFieldThreadLocalStoreID(_getFieldThreadLocalStoreID); - callbacks[146] = Marshal.GetFunctionPointerForDelegate(d146); - delegates[146] = d146; - var d147 = new __setOverride(_setOverride); - callbacks[147] = Marshal.GetFunctionPointerForDelegate(d147); - delegates[147] = d147; - var d148 = new __addActiveDependency(_addActiveDependency); - callbacks[148] = Marshal.GetFunctionPointerForDelegate(d148); - delegates[148] = d148; - var d149 = new __GetDelegateCtor(_GetDelegateCtor); - callbacks[149] = Marshal.GetFunctionPointerForDelegate(d149); - delegates[149] = d149; - var d150 = new __MethodCompileComplete(_MethodCompileComplete); - callbacks[150] = Marshal.GetFunctionPointerForDelegate(d150); - delegates[150] = d150; - var d151 = new __getTailCallHelpers(_getTailCallHelpers); - callbacks[151] = Marshal.GetFunctionPointerForDelegate(d151); - delegates[151] = d151; - var d152 = new __convertPInvokeCalliToCall(_convertPInvokeCalliToCall); - callbacks[152] = Marshal.GetFunctionPointerForDelegate(d152); - delegates[152] = d152; - var d153 = new __notifyInstructionSetUsage(_notifyInstructionSetUsage); - callbacks[153] = Marshal.GetFunctionPointerForDelegate(d153); - delegates[153] = d153; - var d154 = new __allocMem(_allocMem); - callbacks[154] = Marshal.GetFunctionPointerForDelegate(d154); - delegates[154] = d154; - var d155 = new __reserveUnwindInfo(_reserveUnwindInfo); - callbacks[155] = Marshal.GetFunctionPointerForDelegate(d155); - delegates[155] = d155; - var d156 = new __allocUnwindInfo(_allocUnwindInfo); - callbacks[156] = Marshal.GetFunctionPointerForDelegate(d156); - delegates[156] = d156; - var d157 = new __allocGCInfo(_allocGCInfo); - callbacks[157] = Marshal.GetFunctionPointerForDelegate(d157); - delegates[157] = d157; - var d158 = new __setEHcount(_setEHcount); - callbacks[158] = Marshal.GetFunctionPointerForDelegate(d158); - delegates[158] = d158; - var d159 = new __setEHinfo(_setEHinfo); - callbacks[159] = Marshal.GetFunctionPointerForDelegate(d159); - delegates[159] = d159; - var d160 = new __logMsg(_logMsg); - callbacks[160] = Marshal.GetFunctionPointerForDelegate(d160); - delegates[160] = d160; - var d161 = new __doAssert(_doAssert); - callbacks[161] = Marshal.GetFunctionPointerForDelegate(d161); - delegates[161] = d161; - var d162 = new __reportFatalError(_reportFatalError); - callbacks[162] = Marshal.GetFunctionPointerForDelegate(d162); - delegates[162] = d162; - var d163 = new __allocMethodBlockCounts(_allocMethodBlockCounts); - callbacks[163] = Marshal.GetFunctionPointerForDelegate(d163); - delegates[163] = d163; - var d164 = new __getMethodBlockCounts(_getMethodBlockCounts); - callbacks[164] = Marshal.GetFunctionPointerForDelegate(d164); - delegates[164] = d164; - var d165 = new __recordCallSite(_recordCallSite); - callbacks[165] = Marshal.GetFunctionPointerForDelegate(d165); - delegates[165] = d165; - var d166 = new __recordRelocation(_recordRelocation); - callbacks[166] = Marshal.GetFunctionPointerForDelegate(d166); - delegates[166] = d166; - var d167 = new __getRelocTypeHint(_getRelocTypeHint); - callbacks[167] = Marshal.GetFunctionPointerForDelegate(d167); - delegates[167] = d167; - var d168 = new __getExpectedTargetArchitecture(_getExpectedTargetArchitecture); - callbacks[168] = Marshal.GetFunctionPointerForDelegate(d168); - delegates[168] = d168; - var d169 = new __getJitFlags(_getJitFlags); - callbacks[169] = Marshal.GetFunctionPointerForDelegate(d169); - delegates[169] = d169; - - keepAlive = delegates; + return default; + } + } + + [UnmanagedCallersOnly] + static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_FLAGS* flags, uint sizeInBytes) + { + var _this = GetThis(thisHandle); + try + { + return _this.getJitFlags(ref *flags, sizeInBytes); + } + catch (Exception ex) + { + *ppException = _this.AllocException(ex); + return default; + } + } + + + static IntPtr GetUnmanagedCallbacks() + { + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 170); + + callbacks[0] = (delegate* unmanaged)&_getMethodAttribs; + callbacks[1] = (delegate* unmanaged)&_setMethodAttribs; + callbacks[2] = (delegate* unmanaged)&_getMethodSig; + callbacks[3] = (delegate* unmanaged)&_getMethodInfo; + callbacks[4] = (delegate* unmanaged)&_canInline; + callbacks[5] = (delegate* unmanaged)&_reportInliningDecision; + callbacks[6] = (delegate* unmanaged)&_canTailCall; + callbacks[7] = (delegate* unmanaged)&_reportTailCallDecision; + callbacks[8] = (delegate* unmanaged)&_getEHinfo; + callbacks[9] = (delegate* unmanaged)&_getMethodClass; + callbacks[10] = (delegate* unmanaged)&_getMethodModule; + callbacks[11] = (delegate* unmanaged)&_getMethodVTableOffset; + callbacks[12] = (delegate* unmanaged)&_resolveVirtualMethod; + callbacks[13] = (delegate* unmanaged)&_getUnboxedEntry; + callbacks[14] = (delegate* unmanaged)&_getDefaultEqualityComparerClass; + callbacks[15] = (delegate* unmanaged)&_expandRawHandleIntrinsic; + callbacks[16] = (delegate* unmanaged)&_getIntrinsicID; + callbacks[17] = (delegate* unmanaged)&_isIntrinsicType; + callbacks[18] = (delegate* unmanaged)&_getUnmanagedCallConv; + callbacks[19] = (delegate* unmanaged)&_pInvokeMarshalingRequired; + callbacks[20] = (delegate* unmanaged)&_satisfiesMethodConstraints; + callbacks[21] = (delegate* unmanaged)&_isCompatibleDelegate; + callbacks[22] = (delegate* unmanaged)&_methodMustBeLoadedBeforeCodeIsRun; + callbacks[23] = (delegate* unmanaged)&_mapMethodDeclToMethodImpl; + callbacks[24] = (delegate* unmanaged)&_getGSCookie; + callbacks[25] = (delegate* unmanaged)&_setPatchpointInfo; + callbacks[26] = (delegate* unmanaged)&_getOSRInfo; + callbacks[27] = (delegate* unmanaged)&_resolveToken; + callbacks[28] = (delegate* unmanaged)&_tryResolveToken; + callbacks[29] = (delegate* unmanaged)&_findSig; + callbacks[30] = (delegate* unmanaged)&_findCallSiteSig; + callbacks[31] = (delegate* unmanaged)&_getTokenTypeAsHandle; + callbacks[32] = (delegate* unmanaged)&_isValidToken; + callbacks[33] = (delegate* unmanaged)&_isValidStringRef; + callbacks[34] = (delegate* unmanaged)&_getStringLiteral; + callbacks[35] = (delegate* unmanaged)&_asCorInfoType; + callbacks[36] = (delegate* unmanaged)&_getClassName; + callbacks[37] = (delegate* unmanaged)&_getClassNameFromMetadata; + callbacks[38] = (delegate* unmanaged)&_getTypeInstantiationArgument; + callbacks[39] = (delegate* unmanaged)&_appendClassName; + callbacks[40] = (delegate* unmanaged)&_isValueClass; + callbacks[41] = (delegate* unmanaged)&_canInlineTypeCheck; + callbacks[42] = (delegate* unmanaged)&_getClassAttribs; + callbacks[43] = (delegate* unmanaged)&_isStructRequiringStackAllocRetBuf; + callbacks[44] = (delegate* unmanaged)&_getClassModule; + callbacks[45] = (delegate* unmanaged)&_getModuleAssembly; + callbacks[46] = (delegate* unmanaged)&_getAssemblyName; + callbacks[47] = (delegate* unmanaged)&_LongLifetimeMalloc; + callbacks[48] = (delegate* unmanaged)&_LongLifetimeFree; + callbacks[49] = (delegate* unmanaged)&_getClassModuleIdForStatics; + callbacks[50] = (delegate* unmanaged)&_getClassSize; + callbacks[51] = (delegate* unmanaged)&_getHeapClassSize; + callbacks[52] = (delegate* unmanaged)&_canAllocateOnStack; + callbacks[53] = (delegate* unmanaged)&_getClassAlignmentRequirement; + callbacks[54] = (delegate* unmanaged)&_getClassGClayout; + callbacks[55] = (delegate* unmanaged)&_getClassNumInstanceFields; + callbacks[56] = (delegate* unmanaged)&_getFieldInClass; + callbacks[57] = (delegate* unmanaged)&_checkMethodModifier; + callbacks[58] = (delegate* unmanaged)&_getNewHelper; + callbacks[59] = (delegate* unmanaged)&_getNewArrHelper; + callbacks[60] = (delegate* unmanaged)&_getCastingHelper; + callbacks[61] = (delegate* unmanaged)&_getSharedCCtorHelper; + callbacks[62] = (delegate* unmanaged)&_getTypeForBox; + callbacks[63] = (delegate* unmanaged)&_getBoxHelper; + callbacks[64] = (delegate* unmanaged)&_getUnBoxHelper; + callbacks[65] = (delegate* unmanaged)&_getReadyToRunHelper; + callbacks[66] = (delegate* unmanaged)&_getReadyToRunDelegateCtorHelper; + callbacks[67] = (delegate* unmanaged)&_getHelperName; + callbacks[68] = (delegate* unmanaged)&_initClass; + callbacks[69] = (delegate* unmanaged)&_classMustBeLoadedBeforeCodeIsRun; + callbacks[70] = (delegate* unmanaged)&_getBuiltinClass; + callbacks[71] = (delegate* unmanaged)&_getTypeForPrimitiveValueClass; + callbacks[72] = (delegate* unmanaged)&_getTypeForPrimitiveNumericClass; + callbacks[73] = (delegate* unmanaged)&_canCast; + callbacks[74] = (delegate* unmanaged)&_areTypesEquivalent; + callbacks[75] = (delegate* unmanaged)&_compareTypesForCast; + callbacks[76] = (delegate* unmanaged)&_compareTypesForEquality; + callbacks[77] = (delegate* unmanaged)&_mergeClasses; + callbacks[78] = (delegate* unmanaged)&_isMoreSpecificType; + callbacks[79] = (delegate* unmanaged)&_getParentType; + callbacks[80] = (delegate* unmanaged)&_getChildType; + callbacks[81] = (delegate* unmanaged)&_satisfiesClassConstraints; + callbacks[82] = (delegate* unmanaged)&_isSDArray; + callbacks[83] = (delegate* unmanaged)&_getArrayRank; + callbacks[84] = (delegate* unmanaged)&_getArrayInitializationData; + callbacks[85] = (delegate* unmanaged)&_canAccessClass; + callbacks[86] = (delegate* unmanaged)&_getFieldName; + callbacks[87] = (delegate* unmanaged)&_getFieldClass; + callbacks[88] = (delegate* unmanaged)&_getFieldType; + callbacks[89] = (delegate* unmanaged)&_getFieldOffset; + callbacks[90] = (delegate* unmanaged)&_getFieldInfo; + callbacks[91] = (delegate* unmanaged)&_isFieldStatic; + callbacks[92] = (delegate* unmanaged)&_getBoundaries; + callbacks[93] = (delegate* unmanaged)&_setBoundaries; + callbacks[94] = (delegate* unmanaged)&_getVars; + callbacks[95] = (delegate* unmanaged)&_setVars; + callbacks[96] = (delegate* unmanaged)&_allocateArray; + callbacks[97] = (delegate* unmanaged)&_freeArray; + callbacks[98] = (delegate* unmanaged)&_getArgNext; + callbacks[99] = (delegate* unmanaged)&_getArgType; + callbacks[100] = (delegate* unmanaged)&_getArgClass; + callbacks[101] = (delegate* unmanaged)&_getHFAType; + callbacks[102] = (delegate* unmanaged)&_GetErrorHRESULT; + callbacks[103] = (delegate* unmanaged)&_GetErrorMessage; + callbacks[104] = (delegate* unmanaged)&_FilterException; + callbacks[105] = (delegate* unmanaged)&_HandleException; + callbacks[106] = (delegate* unmanaged)&_ThrowExceptionForJitResult; + callbacks[107] = (delegate* unmanaged)&_ThrowExceptionForHelper; + callbacks[108] = (delegate* unmanaged)&_runWithErrorTrap; + callbacks[109] = (delegate* unmanaged)&_getEEInfo; + callbacks[110] = (delegate* unmanaged)&_getJitTimeLogFilename; + callbacks[111] = (delegate* unmanaged)&_getMethodDefFromMethod; + callbacks[112] = (delegate* unmanaged)&_getMethodName; + callbacks[113] = (delegate* unmanaged)&_getMethodNameFromMetadata; + callbacks[114] = (delegate* unmanaged)&_getMethodHash; + callbacks[115] = (delegate* unmanaged)&_findNameOfToken; + callbacks[116] = (delegate* unmanaged)&_getSystemVAmd64PassStructInRegisterDescriptor; + callbacks[117] = (delegate* unmanaged)&_getThreadTLSIndex; + callbacks[118] = (delegate* unmanaged)&_getInlinedCallFrameVptr; + callbacks[119] = (delegate* unmanaged)&_getAddrOfCaptureThreadGlobal; + callbacks[120] = (delegate* unmanaged)&_getHelperFtn; + callbacks[121] = (delegate* unmanaged)&_getFunctionEntryPoint; + callbacks[122] = (delegate* unmanaged)&_getFunctionFixedEntryPoint; + callbacks[123] = (delegate* unmanaged)&_getMethodSync; + callbacks[124] = (delegate* unmanaged)&_getLazyStringLiteralHelper; + callbacks[125] = (delegate* unmanaged)&_embedModuleHandle; + callbacks[126] = (delegate* unmanaged)&_embedClassHandle; + callbacks[127] = (delegate* unmanaged)&_embedMethodHandle; + callbacks[128] = (delegate* unmanaged)&_embedFieldHandle; + callbacks[129] = (delegate* unmanaged)&_embedGenericHandle; + callbacks[130] = (delegate* unmanaged)&_getLocationOfThisType; + callbacks[131] = (delegate* unmanaged)&_getAddressOfPInvokeTarget; + callbacks[132] = (delegate* unmanaged)&_GetCookieForPInvokeCalliSig; + callbacks[133] = (delegate* unmanaged)&_canGetCookieForPInvokeCalliSig; + callbacks[134] = (delegate* unmanaged)&_getJustMyCodeHandle; + callbacks[135] = (delegate* unmanaged)&_GetProfilingHandle; + callbacks[136] = (delegate* unmanaged)&_getCallInfo; + callbacks[137] = (delegate* unmanaged)&_canAccessFamily; + callbacks[138] = (delegate* unmanaged)&_isRIDClassDomainID; + callbacks[139] = (delegate* unmanaged)&_getClassDomainID; + callbacks[140] = (delegate* unmanaged)&_getFieldAddress; + callbacks[141] = (delegate* unmanaged)&_getStaticFieldCurrentClass; + callbacks[142] = (delegate* unmanaged)&_getVarArgsHandle; + callbacks[143] = (delegate* unmanaged)&_canGetVarArgsHandle; + callbacks[144] = (delegate* unmanaged)&_constructStringLiteral; + callbacks[145] = (delegate* unmanaged)&_emptyStringLiteral; + callbacks[146] = (delegate* unmanaged)&_getFieldThreadLocalStoreID; + callbacks[147] = (delegate* unmanaged)&_setOverride; + callbacks[148] = (delegate* unmanaged)&_addActiveDependency; + callbacks[149] = (delegate* unmanaged)&_GetDelegateCtor; + callbacks[150] = (delegate* unmanaged)&_MethodCompileComplete; + callbacks[151] = (delegate* unmanaged)&_getTailCallHelpers; + callbacks[152] = (delegate* unmanaged)&_convertPInvokeCalliToCall; + callbacks[153] = (delegate* unmanaged)&_notifyInstructionSetUsage; + callbacks[154] = (delegate* unmanaged)&_allocMem; + callbacks[155] = (delegate* unmanaged)&_reserveUnwindInfo; + callbacks[156] = (delegate* unmanaged)&_allocUnwindInfo; + callbacks[157] = (delegate* unmanaged)&_allocGCInfo; + callbacks[158] = (delegate* unmanaged)&_setEHcount; + callbacks[159] = (delegate* unmanaged)&_setEHinfo; + callbacks[160] = (delegate* unmanaged)&_logMsg; + callbacks[161] = (delegate* unmanaged)&_doAssert; + callbacks[162] = (delegate* unmanaged)&_reportFatalError; + callbacks[163] = (delegate* unmanaged)&_allocMethodBlockCounts; + callbacks[164] = (delegate* unmanaged)&_getMethodBlockCounts; + callbacks[165] = (delegate* unmanaged)&_recordCallSite; + callbacks[166] = (delegate* unmanaged)&_recordRelocation; + callbacks[167] = (delegate* unmanaged)&_getRelocTypeHint; + callbacks[168] = (delegate* unmanaged)&_getExpectedTargetArchitecture; + callbacks[169] = (delegate* unmanaged)&_getJitFlags; + return (IntPtr)callbacks; } } diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.Intrinsics.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.Intrinsics.cs index 3f6c089744b2..46cac9f2e8d4 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.Intrinsics.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.Intrinsics.cs @@ -76,55 +76,6 @@ static IntrinsicHashtable InitializeIntrinsicHashtable() { IntrinsicHashtable table = new IntrinsicHashtable(); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Sin, "Sin", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Sin, "Sin", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Cos, "Cos", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Cos, "Cos", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Cbrt, "Cbrt", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Cbrt, "Cbrt", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Sqrt, "Sqrt", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Sqrt, "Sqrt", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Abs, "Abs", "System", "Math"); - // No System.MathF entry for CORINFO_INTRTINSIC_Abs as System.Math exposes and handles both float and double - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Round, "Round", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Round, "Round", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Cosh, "Cosh", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Cosh, "Cosh", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Sinh, "Sinh", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Sinh, "Sinh", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Tan, "Tan", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Tan, "Tan", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Tanh, "Tanh", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Tanh, "Tanh", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Asin, "Asin", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Asin, "Asin", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Asinh, "Asinh", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Asinh, "Asinh", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Acos, "Acos", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Acos, "Acos", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Acosh, "Acosh", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Acosh, "Acosh", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Atan, "Atan", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Atan, "Atan", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Atan2, "Atan2", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Atan2, "Atan2", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Atanh, "Atanh", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Atanh, "Atanh", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Log10, "Log10", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Log10, "Log10", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Pow, "Pow", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Pow, "Pow", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Exp, "Exp", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Exp, "Exp", "System", "MathF"); -#if !READYTORUN - // These are normally handled via the SSE4.1 instructions ROUNDSS/ROUNDSD. - // However, we don't know the ISAs the target machine supports so we should - // fallback to the method call implementation instead. - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Ceiling, "Ceiling", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Ceiling, "Ceiling", "System", "MathF"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Floor, "Floor", "System", "Math"); - table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Floor, "Floor", "System", "MathF"); -#endif // table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_GetChar, null, null, null); // unused // table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Array_GetDimLength, "GetLength", "System", "Array"); // not handled table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_Array_Get, "Get", null, null); @@ -163,7 +114,7 @@ static IntrinsicHashtable InitializeIntrinsicHashtable() table.Add(CorInfoIntrinsics.CORINFO_INTRINSIC_GetRawHandle, "AllocatorOf", "System", "Activator"); // If this assert fails, make sure to add the new intrinsics to the table above and update the expected count below. - Debug.Assert((int)CorInfoIntrinsics.CORINFO_INTRINSIC_Count == 56, "Please update intrinsic hash table"); + Debug.Assert((int)CorInfoIntrinsics.CORINFO_INTRINSIC_Count == 34, "Please update intrinsic hash table"); return table; } @@ -201,14 +152,6 @@ private CorInfoIntrinsics getIntrinsicID(MethodDesc method, byte* pMustExpand) CorInfoIntrinsics id = entry.Id; switch (id) { - case CorInfoIntrinsics.CORINFO_INTRINSIC_Abs: - { - // RyuJIT handles floating point overloads only - var returnTypeCategory = method.Signature.ReturnType.Category; - if (returnTypeCategory != TypeFlags.Double && returnTypeCategory != TypeFlags.Single) - return CorInfoIntrinsics.CORINFO_INTRINSIC_Illegal; - } - break; case CorInfoIntrinsics.CORINFO_INTRINSIC_Array_Get: case CorInfoIntrinsics.CORINFO_INTRINSIC_Array_Address: case CorInfoIntrinsics.CORINFO_INTRINSIC_Array_Set: diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs index da5d691a39cf..56873fe0b651 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs @@ -22,6 +22,7 @@ using ILCompiler; using ILCompiler.DependencyAnalysis; +using Internal.IL.Stubs; #if READYTORUN using System.Reflection.Metadata.Ecma335; @@ -49,13 +50,12 @@ private enum ImageFileMachine #if SUPPORT_JIT private const string JitSupportLibrary = "*"; #else - private const string JitSupportLibrary = "jitinterface"; + internal const string JitSupportLibrary = "jitinterface"; #endif private IntPtr _jit; private IntPtr _unmanagedCallbacks; // array of pointers to JIT-EE interface callbacks - private Object _keepAlive; // Keeps delegates for the callbacks alive private ExceptionDispatchInfo _lastException; @@ -122,7 +122,7 @@ public CorInfoImpl() throw new IOException("Failed to initialize JIT"); } - _unmanagedCallbacks = GetUnmanagedCallbacks(out _keepAlive); + _unmanagedCallbacks = GetUnmanagedCallbacks(); } public TextWriter Log @@ -199,6 +199,14 @@ private void CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, Method { ThrowHelper.ThrowInvalidProgramException(); } + if (result == CorJitResult.CORJIT_IMPLLIMITATION) + { +#if READYTORUN + throw new RequiresRuntimeJitException("JIT implementation limitation"); +#else + ThrowHelper.ThrowInvalidProgramException(); +#endif + } if (result != CorJitResult.CORJIT_OK) { #if SUPPORT_JIT @@ -397,12 +405,21 @@ private void CompileMethodCleanup() private const int handleMultipler = 8; private const int handleBase = 0x420000; +#if DEBUG + private static readonly IntPtr s_handleHighBitSet = (sizeof(IntPtr) == 4) ? new IntPtr(0x40000000) : new IntPtr(0x4000000000000000); +#endif + private IntPtr ObjectToHandle(Object obj) { + // SuperPMI relies on the handle returned from this function being stable for the lifetime of the crossgen2 process + // If handle deletion is implemented, please update SuperPMI IntPtr handle; if (!_objectToHandle.TryGetValue(obj, out handle)) { handle = (IntPtr)(handleMultipler * _handleToObject.Count + handleBase); +#if DEBUG + handle = new IntPtr((long)s_handleHighBitSet | (long)handle); +#endif _handleToObject.Add(obj); _objectToHandle.Add(obj, handle); } @@ -411,6 +428,9 @@ private IntPtr ObjectToHandle(Object obj) private Object HandleToObject(IntPtr handle) { +#if DEBUG + handle = new IntPtr(~(long)s_handleHighBitSet & (long) handle); +#endif int index = ((int)handle - handleBase) / handleMultipler; return _handleToObject[index]; } @@ -508,6 +528,7 @@ private bool TryGetUnmanagedCallingConventionFromModOpt(MethodSignature signatur if (!signature.HasEmbeddedSignatureData || signature.GetEmbeddedSignatureData() == null) return false; + bool found = false; foreach (EmbeddedSignatureData data in signature.GetEmbeddedSignatureData()) { if (data.kind != EmbeddedSignatureDataKind.OptionalCustomModifier) @@ -524,25 +545,28 @@ private bool TryGetUnmanagedCallingConventionFromModOpt(MethodSignature signatur if (defType.Namespace != "System.Runtime.CompilerServices") continue; - // Take the first recognized calling convention in metadata. - switch (defType.Name) + // Look for a recognized calling convention in metadata. + CorInfoCallConv? callConvLocal = defType.Name switch + { + "CallConvCdecl" => CorInfoCallConv.CORINFO_CALLCONV_C, + "CallConvStdcall" => CorInfoCallConv.CORINFO_CALLCONV_STDCALL, + "CallConvFastcall" => CorInfoCallConv.CORINFO_CALLCONV_FASTCALL, + "CallConvThiscall" => CorInfoCallConv.CORINFO_CALLCONV_THISCALL, + _ => null + }; + + if (callConvLocal.HasValue) { - case "CallConvCdecl": - callConv = CorInfoCallConv.CORINFO_CALLCONV_C; - return true; - case "CallConvStdcall": - callConv = CorInfoCallConv.CORINFO_CALLCONV_STDCALL; - return true; - case "CallConvFastcall": - callConv = CorInfoCallConv.CORINFO_CALLCONV_FASTCALL; - return true; - case "CallConvThiscall": - callConv = CorInfoCallConv.CORINFO_CALLCONV_THISCALL; - return true; + // Error if there are multiple recognized calling conventions + if (found) + ThrowHelper.ThrowInvalidProgramException(ExceptionStringID.InvalidProgramMultipleCallConv, MethodBeingCompiled); + + callConv = callConvLocal.Value; + found = true; } } - return false; + return found; } private void Get_CORINFO_SIG_INFO(MethodSignature signature, CORINFO_SIG_INFO* sig) @@ -618,6 +642,11 @@ private void Get_CORINFO_SIG_INFO(LocalVariableDefinition[] locals, CORINFO_SIG_ } private CorInfoType asCorInfoType(TypeDesc type) + { + return asCorInfoType(type, out _); + } + + private CorInfoType asCorInfoType(TypeDesc type, out TypeDesc typeIfNotPrimitive) { if (type.IsEnum) { @@ -626,12 +655,15 @@ private CorInfoType asCorInfoType(TypeDesc type) if (type.IsPrimitive) { + typeIfNotPrimitive = null; Debug.Assert((CorInfoType)TypeFlags.Void == CorInfoType.CORINFO_TYPE_VOID); Debug.Assert((CorInfoType)TypeFlags.Double == CorInfoType.CORINFO_TYPE_DOUBLE); return (CorInfoType)type.Category; } + typeIfNotPrimitive = type; + if (type.IsPointer || type.IsFunctionPointer) { return CorInfoType.CORINFO_TYPE_PTR; @@ -644,6 +676,32 @@ private CorInfoType asCorInfoType(TypeDesc type) if (type.IsValueType) { + if (_compilation.TypeSystemContext.Target.Architecture == TargetArchitecture.X86) + { + LayoutInt elementSize = type.GetElementSize(); + +#if READYTORUN + if (elementSize.IsIndeterminate) + { + throw new RequiresRuntimeJitException(type); + } +#endif +#if READYTORUN + if (elementSize.AsInt == 4) + { + var normalizedCategory = _compilation.TypeSystemContext.NormalizedCategoryFor4ByteStructOnX86(type); + if (normalizedCategory != type.Category) + { + if (NeedsTypeLayoutCheck(type)) + { + ISymbolNode node = _compilation.SymbolNodeFactory.CheckTypeLayout(type); + _methodCodeNode.Fixups.Add(node); + } + return (CorInfoType)normalizedCategory; + } + } +#endif + } return CorInfoType.CORINFO_TYPE_VALUECLASS; } @@ -652,11 +710,8 @@ private CorInfoType asCorInfoType(TypeDesc type) private CorInfoType asCorInfoType(TypeDesc type, CORINFO_CLASS_STRUCT_** structType) { - var corInfoType = asCorInfoType(type); - *structType = ((corInfoType == CorInfoType.CORINFO_TYPE_CLASS) || - (corInfoType == CorInfoType.CORINFO_TYPE_VALUECLASS) || - (corInfoType == CorInfoType.CORINFO_TYPE_BYREF) || - (corInfoType == CorInfoType.CORINFO_TYPE_PTR)) ? ObjectToHandle(type) : null; + var corInfoType = asCorInfoType(type, out TypeDesc typeIfNotPrimitive); + *structType = (typeIfNotPrimitive != null) ? ObjectToHandle(typeIfNotPrimitive) : null; return corInfoType; } @@ -811,7 +866,7 @@ private uint getMethodAttribsInternal(MethodDesc method) // do a dynamic check instead. if ( !HardwareIntrinsicHelpers.IsIsSupportedMethod(method) - || !_compilation.IsHardwareInstrinsicWithRuntimeDeterminedSupport(method)) + || !_compilation.IsHardwareIntrinsicWithRuntimeDeterminedSupport(method)) #endif { result |= CorInfoFlag.CORINFO_FLG_JIT_INTRINSIC; @@ -1001,7 +1056,7 @@ private CorInfoUnmanagedCallConv getUnmanagedCallConv(CORINFO_METHOD_STRUCT_* me private bool satisfiesMethodConstraints(CORINFO_CLASS_STRUCT_* parent, CORINFO_METHOD_STRUCT_* method) { throw new NotImplementedException("satisfiesMethodConstraints"); } - private bool isCompatibleDelegate(CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, ref bool pfIsOpenDelegate) + private bool isCompatibleDelegate(CORINFO_CLASS_STRUCT_* objCls, CORINFO_CLASS_STRUCT_* methodParentCls, CORINFO_METHOD_STRUCT_* method, CORINFO_CLASS_STRUCT_* delegateCls, BOOL* pfIsOpenDelegate) { throw new NotImplementedException("isCompatibleDelegate"); } private void setPatchpointInfo(PatchpointInfo* patchpointInfo) { throw new NotImplementedException("setPatchpointInfo"); } @@ -1243,11 +1298,20 @@ private void findSig(CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEX { var methodIL = (MethodIL)HandleToObject((IntPtr)module); var methodSig = (MethodSignature)methodIL.GetObject((int)sigTOK); + Get_CORINFO_SIG_INFO(methodSig, sig); - if (sig->callConv == CorInfoCallConv.CORINFO_CALLCONV_UNMANAGED) + // CORINFO_CALLCONV_UNMANAGED is handled by Get_CORINFO_SIG_INFO + Debug.Assert(sig->callConv != CorInfoCallConv.CORINFO_CALLCONV_UNMANAGED); + + // TODO: Replace this with a public mechanism to mark calli with SuppressGCTransition once it becomes available. + if (methodIL is PInvokeILStubMethodIL stubIL) { - throw new NotImplementedException(); + var method = stubIL.OwningMethod; + if (method.IsPInvoke && method.IsSuppressGCTransition()) + { + sig->flags |= CorInfoSigInfoFlags.CORINFO_SIGFLAG_SUPPRESS_GC_TRANSITION; + } } #if !READYTORUN @@ -1256,6 +1320,8 @@ private void findSig(CORINFO_MODULE_STRUCT_* module, uint sigTOK, CORINFO_CONTEX { sig->flags |= CorInfoSigInfoFlags.CORINFO_SIGFLAG_FAT_CALL; } +#else + VerifyMethodSignatureIsStable(methodSig); #endif } @@ -1484,7 +1550,7 @@ private void LongLifetimeFree(void* obj) Marshal.FreeCoTaskMem((IntPtr)obj); } - private byte* getClassModuleIdForStatics(CORINFO_CLASS_STRUCT_* cls, CORINFO_MODULE_STRUCT_** pModule, void** ppIndirection) + private UIntPtr getClassModuleIdForStatics(CORINFO_CLASS_STRUCT_* cls, CORINFO_MODULE_STRUCT_** pModule, void** ppIndirection) { throw new NotImplementedException("getClassModuleIdForStatics"); } private uint getClassSize(CORINFO_CLASS_STRUCT_* cls) @@ -1537,10 +1603,99 @@ private bool canAllocateOnStack(CORINFO_CLASS_STRUCT_* cls) return result; } + /// + /// Managed implementation of CEEInfo::getClassAlignmentRequirementStatic + /// + public static int GetClassAlignmentRequirementStatic(DefType type) + { + int alignment = type.Context.Target.PointerSize; + + if (type is MetadataType metadataType && metadataType.HasLayout()) + { + if (metadataType.IsSequentialLayout || MarshalUtils.IsBlittableType(metadataType)) + { + alignment = metadataType.InstanceFieldAlignment.AsInt; + } + } + + if (type.Context.Target.Architecture == TargetArchitecture.ARM && + alignment < 8 && type.RequiresAlign8()) + { + // If the structure contains 64-bit primitive fields and the platform requires 8-byte alignment for + // such fields then make sure we return at least 8-byte alignment. Note that it's technically possible + // to create unmanaged APIs that take unaligned structures containing such fields and this + // unconditional alignment bump would cause us to get the calling convention wrong on platforms such + // as ARM. If we see such cases in the future we'd need to add another control (such as an alignment + // property for the StructLayout attribute or a marshaling directive attribute for p/invoke arguments) + // that allows more precise control. For now we'll go with the likely scenario. + alignment = 8; + } + + return alignment; + } + + private Dictionary _doubleAlignHeuristicCache = new Dictionary(); + + //******************************************************************************* + // + // Heuristic to determine if we should have instances of this class 8 byte aligned + // + static bool ShouldAlign8(int dwR8Fields, int dwTotalFields) + { + return dwR8Fields*2>dwTotalFields && dwR8Fields>=2; + } + + static bool ShouldAlign8(DefType type) + { + int instanceFields = 0; + int doubleFields = 0; + var doubleType = type.Context.GetWellKnownType(WellKnownType.Double); + foreach (var field in type.GetFields()) + { + if (field.IsStatic) + continue; + + instanceFields++; + + if (field.FieldType == doubleType) + doubleFields++; + } + + return ShouldAlign8(doubleFields, instanceFields); + } + private uint getClassAlignmentRequirement(CORINFO_CLASS_STRUCT_* cls, bool fDoubleAlignHint) { DefType type = (DefType)HandleToObject(cls); - return (uint)type.InstanceFieldAlignment.AsInt; + + + var target = type.Context.Target; + if (fDoubleAlignHint) + { + if (target.Architecture == TargetArchitecture.X86) + { + if ((type.IsValueType) && (type.InstanceFieldAlignment.AsInt > 4)) + { + // On X86, double aligning the stack is expensive. if fDoubleAlignHint is true + // only align the local variable if it has a large enough fraction of double fields + // in comparison to the total field count. + if (!_doubleAlignHeuristicCache.TryGetValue(type, out bool doDoubleAlign)) + { + doDoubleAlign = ShouldAlign8(type); + _doubleAlignHeuristicCache.Add(type, doDoubleAlign); + } + + // Return the size of the double align hint. Ignore the actual alignment info account + // so that structs with 64-bit integer fields do not trigger double aligned frames on x86. + if (doDoubleAlign) + return 8; + } + + return (uint)target.PointerSize; + } + } + + return (uint)GetClassAlignmentRequirementStatic(type); } private int MarkGcField(byte* gcPtrs, CorInfoGCType gcType) @@ -2480,7 +2635,7 @@ private uint getMethodHash(CORINFO_METHOD_STRUCT_* ftn) return (uint)HandleToObject(ftn).GetHashCode(); } - private byte* findNameOfToken(CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity) + private UIntPtr findNameOfToken(CORINFO_MODULE_STRUCT_* moduleHandle, mdToken token, byte* szFQName, UIntPtr FQNameCapacity) { throw new NotImplementedException("findNameOfToken"); } private bool getSystemVAmd64PassStructInRegisterDescriptor(CORINFO_CLASS_STRUCT_* structHnd, SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) @@ -2570,7 +2725,7 @@ private void getLocationOfThisType(CORINFO_METHOD_STRUCT_* context, ref CORINFO_ ppIndirection = null; return null; } - private void GetProfilingHandle(ref bool pbHookFunction, ref void* pProfilerHandle, ref bool pbIndirectedHandles) + private void GetProfilingHandle(BOOL* pbHookFunction, ref void* pProfilerHandle, BOOL* pbIndirectedHandles) { throw new NotImplementedException("GetProfilingHandle"); } /// @@ -2643,7 +2798,11 @@ private bool getTailCallHelpers(ref CORINFO_RESOLVED_TOKEN callToken, CORINFO_SI { // Slow tailcalls are not supported yet // https://github.com/dotnet/runtime/issues/35423 +#if READYTORUN throw new NotImplementedException(nameof(getTailCallHelpers)); +#else + return false; +#endif } private byte[] _code; @@ -2858,11 +3017,14 @@ private static RelocType GetRelocType(TargetArchitecture targetArchitecture, ush if (targetArchitecture != TargetArchitecture.ARM64) return (RelocType)fRelocType; + const ushort IMAGE_REL_ARM64_BRANCH26 = 3; const ushort IMAGE_REL_ARM64_PAGEBASE_REL21 = 4; const ushort IMAGE_REL_ARM64_PAGEOFFSET_12A = 6; switch (fRelocType) { + case IMAGE_REL_ARM64_BRANCH26: + return RelocType.IMAGE_REL_BASED_ARM64_BRANCH26; case IMAGE_REL_ARM64_PAGEBASE_REL21: return RelocType.IMAGE_REL_BASED_ARM64_PAGEBASE_REL21; case IMAGE_REL_ARM64_PAGEOFFSET_12A: @@ -2912,6 +3074,14 @@ private void recordRelocation(void* location, void* target, ushort fRelocType, u default: // Reloc points to something outside of the generated blocks var targetObject = HandleToObject((IntPtr)target); + +#if READYTORUN + if (targetObject is RequiresRuntimeJitIfUsedSymbol requiresRuntimeSymbol) + { + throw new RequiresRuntimeJitException(requiresRuntimeSymbol.Message); + } +#endif + relocTarget = (ISymbolNode)targetObject; break; } diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs index c04ffa4bd941..4fc31bd7f345 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs @@ -662,5 +662,62 @@ public void Set64BitInstructionSetVariants(TargetArchitecture architecture) } } + + public void Set64BitInstructionSetVariantsUnconditionally(TargetArchitecture architecture) + { + switch (architecture) + { + + case TargetArchitecture.ARM64: + AddInstructionSet(InstructionSet.ARM64_ArmBase_Arm64); + AddInstructionSet(InstructionSet.ARM64_AdvSimd_Arm64); + AddInstructionSet(InstructionSet.ARM64_Aes_Arm64); + AddInstructionSet(InstructionSet.ARM64_Crc32_Arm64); + AddInstructionSet(InstructionSet.ARM64_Dp_Arm64); + AddInstructionSet(InstructionSet.ARM64_Rdm_Arm64); + AddInstructionSet(InstructionSet.ARM64_Sha1_Arm64); + AddInstructionSet(InstructionSet.ARM64_Sha256_Arm64); + break; + + case TargetArchitecture.X64: + AddInstructionSet(InstructionSet.X64_X86Base_X64); + AddInstructionSet(InstructionSet.X64_SSE_X64); + AddInstructionSet(InstructionSet.X64_SSE2_X64); + AddInstructionSet(InstructionSet.X64_SSE3_X64); + AddInstructionSet(InstructionSet.X64_SSSE3_X64); + AddInstructionSet(InstructionSet.X64_SSE41_X64); + AddInstructionSet(InstructionSet.X64_SSE42_X64); + AddInstructionSet(InstructionSet.X64_AVX_X64); + AddInstructionSet(InstructionSet.X64_AVX2_X64); + AddInstructionSet(InstructionSet.X64_AES_X64); + AddInstructionSet(InstructionSet.X64_BMI1_X64); + AddInstructionSet(InstructionSet.X64_BMI2_X64); + AddInstructionSet(InstructionSet.X64_FMA_X64); + AddInstructionSet(InstructionSet.X64_LZCNT_X64); + AddInstructionSet(InstructionSet.X64_PCLMULQDQ_X64); + AddInstructionSet(InstructionSet.X64_POPCNT_X64); + break; + + case TargetArchitecture.X86: + AddInstructionSet(InstructionSet.X86_X86Base_X64); + AddInstructionSet(InstructionSet.X86_SSE_X64); + AddInstructionSet(InstructionSet.X86_SSE2_X64); + AddInstructionSet(InstructionSet.X86_SSE3_X64); + AddInstructionSet(InstructionSet.X86_SSSE3_X64); + AddInstructionSet(InstructionSet.X86_SSE41_X64); + AddInstructionSet(InstructionSet.X86_SSE42_X64); + AddInstructionSet(InstructionSet.X86_AVX_X64); + AddInstructionSet(InstructionSet.X86_AVX2_X64); + AddInstructionSet(InstructionSet.X86_AES_X64); + AddInstructionSet(InstructionSet.X86_BMI1_X64); + AddInstructionSet(InstructionSet.X86_BMI2_X64); + AddInstructionSet(InstructionSet.X86_FMA_X64); + AddInstructionSet(InstructionSet.X86_LZCNT_X64); + AddInstructionSet(InstructionSet.X86_PCLMULQDQ_X64); + AddInstructionSet(InstructionSet.X86_POPCNT_X64); + break; + + } + } } } diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs index c3a5bac23671..5e84af72a4c4 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.VarInfo.cs @@ -52,7 +52,7 @@ public struct VarLoc /* Changes to the following types may require revisiting the above layout. - + In coreclr\src\inc\cordebuginfo.h enum VarLocType @@ -140,7 +140,7 @@ struct VarLoc } vlStkReg; // VLT_STK2 -- Any 64 bit value which is on the stack, - // in 2 successsive DWords. + // in 2 successive DWords. // eg 2 DWords at [ESP+0x10] struct diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs index c1a9f87533ad..01add8fcfdee 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs @@ -8,6 +8,12 @@ namespace Internal.JitInterface { + public enum BOOL : int + { + FALSE = 0, + TRUE = 1, + } + public static class CORINFO { // CORINFO_MAXINDIRECTIONS is the maximum number of @@ -20,40 +26,14 @@ public static class CORINFO public struct CORINFO_METHOD_STRUCT_ { - internal static unsafe CORINFO_METHOD_STRUCT_* Construct(int i) - { - return (CORINFO_METHOD_STRUCT_*)((i + 1) << 4); - } - - internal static unsafe int GetValue(CORINFO_METHOD_STRUCT_* val) - { - return ((int)val - 1) >> 4; - } } public struct CORINFO_FIELD_STRUCT_ { - internal static unsafe CORINFO_FIELD_STRUCT_* Construct(int i) - { - return (CORINFO_FIELD_STRUCT_*)((i + 1) << 4); - } - internal static unsafe int GetValue(CORINFO_FIELD_STRUCT_* val) - { - return ((int)val - 1) >> 4; - } } public struct CORINFO_CLASS_STRUCT_ { - internal static unsafe CORINFO_CLASS_STRUCT_* Construct(int i) - { - return (CORINFO_CLASS_STRUCT_*)((i + 1) << 4); - } - - internal static unsafe int GetValue(CORINFO_CLASS_STRUCT_* val) - { - return ((int)val - 1) >> 4; - } } public struct CORINFO_ARG_LIST_STRUCT_ @@ -62,14 +42,6 @@ public struct CORINFO_ARG_LIST_STRUCT_ public struct CORINFO_MODULE_STRUCT_ { - internal static unsafe CORINFO_MODULE_STRUCT_* Construct(int i) - { - return (CORINFO_MODULE_STRUCT_*)((i + 1) << 4); - } - internal static unsafe int GetValue(CORINFO_MODULE_STRUCT_* val) - { - return ((int)val - 1) >> 4; - } } public struct CORINFO_ASSEMBLY_STRUCT_ @@ -416,28 +388,6 @@ public enum CorInfoOptions public enum CorInfoIntrinsics { - CORINFO_INTRINSIC_Sin, - CORINFO_INTRINSIC_Cos, - CORINFO_INTRINSIC_Cbrt, - CORINFO_INTRINSIC_Sqrt, - CORINFO_INTRINSIC_Abs, - CORINFO_INTRINSIC_Round, - CORINFO_INTRINSIC_Cosh, - CORINFO_INTRINSIC_Sinh, - CORINFO_INTRINSIC_Tan, - CORINFO_INTRINSIC_Tanh, - CORINFO_INTRINSIC_Asin, - CORINFO_INTRINSIC_Asinh, - CORINFO_INTRINSIC_Acos, - CORINFO_INTRINSIC_Acosh, - CORINFO_INTRINSIC_Atan, - CORINFO_INTRINSIC_Atan2, - CORINFO_INTRINSIC_Atanh, - CORINFO_INTRINSIC_Log10, - CORINFO_INTRINSIC_Pow, - CORINFO_INTRINSIC_Exp, - CORINFO_INTRINSIC_Ceiling, - CORINFO_INTRINSIC_Floor, CORINFO_INTRINSIC_GetChar, // fetch character out of string CORINFO_INTRINSIC_Array_GetDimLength, // Get number of elements in a given dimension of an array CORINFO_INTRINSIC_Array_Get, // Get the value of an element in an array @@ -1291,7 +1241,8 @@ public enum CorJitResult CORJIT_OUTOFMEM = unchecked((int)0x80000002)/*MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NULL, 2)*/, CORJIT_INTERNALERROR = unchecked((int)0x80000003)/*MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NULL, 3)*/, CORJIT_SKIPPED = unchecked((int)0x80000004)/*MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NULL, 4)*/, - CORJIT_RECOVERABLEERROR = unchecked((int)0x80000005)/*MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NULL, 5)*/ + CORJIT_RECOVERABLEERROR = unchecked((int)0x80000005)/*MAKE_HRESULT(SEVERITY_ERROR, FACILITY_NULL, 5)*/, + CORJIT_IMPLLIMITATION = unchecked((int)0x80000006)/*MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 6)*/, }; public enum TypeCompareState @@ -1311,14 +1262,14 @@ public enum CorJitFlag : uint CORJIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode CORJIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necesarily debuggable code) - CORJIT_FLAG_GCPOLL_CALLS = 6, // Emit calls to JIT_POLLGC for thread suspension. + CORJIT_FLAG_UNUSED1 = 6, CORJIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete - CORJIT_FLAG_UNUSED1 = 8, - CORJIT_FLAG_UNUSED2 = 9, - CORJIT_FLAG_UNUSED3 = 10, - CORJIT_FLAG_UNUSED4 = 11, - CORJIT_FLAG_UNUSED5 = 12, - CORJIT_FLAG_UNUSED6 = 13, + CORJIT_FLAG_UNUSED2 = 8, + CORJIT_FLAG_UNUSED3 = 9, + CORJIT_FLAG_UNUSED4 = 10, + CORJIT_FLAG_UNUSED5 = 11, + CORJIT_FLAG_UNUSED6 = 12, + CORJIT_FLAG_UNUSED7 = 13, CORJIT_FLAG_FEATURE_SIMD = 17, CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter. CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation @@ -1336,11 +1287,11 @@ public enum CorJitFlag : uint CORJIT_FLAG_FRAMED = 31, // All methods have an EBP frame CORJIT_FLAG_ALIGN_LOOPS = 32, // add NOPs before loops to align them at 16 byte boundaries CORJIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - CORJIT_FLAG_GCPOLL_INLINE = 34, // JIT must inline calls to GCPoll when possible + CORJIT_FLAG_UNUSED8 = 34, CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - // CORJIT_FLAG_UNUSED = 38, + CORJIT_FLAG_UNUSED9 = 38, CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records diff --git a/src/coreclr/src/tools/Common/JitInterface/JitConfigProvider.cs b/src/coreclr/src/tools/Common/JitInterface/JitConfigProvider.cs index 1635c5ab3fd1..94352584177c 100644 --- a/src/coreclr/src/tools/Common/JitInterface/JitConfigProvider.cs +++ b/src/coreclr/src/tools/Common/JitInterface/JitConfigProvider.cs @@ -27,7 +27,6 @@ public static JitConfigProvider Instance private CorJitFlag[] _jitFlags; private Dictionary _config = new Dictionary(StringComparer.OrdinalIgnoreCase); - private object _keepAlive; // Keeps callback delegates alive public static void Initialize( TargetDetails target, @@ -54,9 +53,13 @@ public static void Initialize( } else { - libHandle = NativeLibrary.Load("clrjit-" + GetTargetSpec(target), assembly, searchPath); + libHandle = NativeLibrary.Load("clrjit_" + GetTargetSpec(target), assembly, searchPath); } } + if (libName == CorInfoImpl.JitSupportLibrary) + { + libHandle = NativeLibrary.Load("jitinterface_" + RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(), assembly, searchPath); + } return libHandle; }); #else @@ -141,48 +144,40 @@ private static string GetTargetSpec(TargetDetails target) TargetArchitecture.ARM64 => "arm64", _ => throw new NotImplementedException(target.Architecture.ToString()) }; - return targetOSComponent + '-' + targetArchComponent; + + return targetOSComponent + '_' + targetArchComponent + "_" + RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); } #region Unmanaged instance - private unsafe IntPtr CreateUnmanagedInstance() + private static unsafe IntPtr CreateUnmanagedInstance() { - // TODO: this potentially leaks memory, but since we only expect to have one per compilation, + // This potentially leaks memory, but since we only expect to have one per compilation, // it shouldn't matter... const int numCallbacks = 2; - IntPtr* callbacks = (IntPtr*)Marshal.AllocCoTaskMem(sizeof(IntPtr) * numCallbacks); - object[] delegates = new object[numCallbacks]; - - var d0 = new __getIntConfigValue(getIntConfigValue); - callbacks[0] = Marshal.GetFunctionPointerForDelegate(d0); - delegates[0] = d0; + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * numCallbacks); - var d1 = new __getStringConfigValue(getStringConfigValue); - callbacks[1] = Marshal.GetFunctionPointerForDelegate(d1); - delegates[1] = d1; + callbacks[0] = (delegate* unmanaged)&getIntConfigValue; + callbacks[1] = (delegate* unmanaged)&getStringConfigValue; - _keepAlive = delegates; IntPtr instance = Marshal.AllocCoTaskMem(sizeof(IntPtr)); - *(IntPtr**)instance = callbacks; + *(IntPtr*)instance = (IntPtr)callbacks; return instance; } - [UnmanagedFunctionPointer(default(CallingConvention))] - private unsafe delegate int __getIntConfigValue(IntPtr thisHandle, [MarshalAs(UnmanagedType.LPWStr)] string name, int defaultValue); - private unsafe int getIntConfigValue(IntPtr thisHandle, string name, int defaultValue) + [UnmanagedCallersOnly] + private static unsafe int getIntConfigValue(IntPtr thisHandle, char* name, int defaultValue) { - return GetIntConfigValue(name, defaultValue); + return s_instance.GetIntConfigValue(new string(name), defaultValue); } - [UnmanagedFunctionPointer(default(CallingConvention))] - private unsafe delegate int __getStringConfigValue(IntPtr thisHandle, [MarshalAs(UnmanagedType.LPWStr)] string name, char* retBuffer, int retBufferLength); - private unsafe int getStringConfigValue(IntPtr thisHandle, string name, char* retBuffer, int retBufferLength) + [UnmanagedCallersOnly] + private static unsafe int getStringConfigValue(IntPtr thisHandle, char* name, char* retBuffer, int retBufferLength) { - string result = GetStringConfigValue(name); + string result = s_instance.GetStringConfigValue(new string(name)); for (int i = 0; i < Math.Min(retBufferLength, result.Length); i++) retBuffer[i] = result[i]; diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt index 615fc9648ed5..d8fe3984a925 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt @@ -15,6 +15,10 @@ ; Copy instruction sets defined for other architecture at this point in the file. ; copyinstructionsets,, +; UPDATE JIT/EE INTERFACE GUID WHEN CHANGING THESE DEFINITIONS. The instruction set definitions are part of JIT/EE interface contract. + +; DO NOT CHANGE R2R NUMERIC VALUES OF THE EXISTING SETS. Changing R2R numberic values definitions would be R2R format breaking change. + ; Definition of X86 instruction sets definearch ,X86 ,32Bit ,X64 diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs index ae5892ddbab3..05019075c770 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs @@ -244,8 +244,7 @@ public bool ParseInput(TextReader tr) public void WriteManagedReadyToRunInstructionSet(TextWriter tr) { // Write header - tr.Write(@" -// Licensed to the .NET Foundation under one or more agreements. + tr.Write(@"// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // DO NOT EDIT THIS FILE! IT IS AUTOGENERATED @@ -274,8 +273,7 @@ public enum ReadyToRunInstructionSet public void WriteManagedReadyToRunInstructionSetHelper(TextWriter tr) { // Write header - tr.Write(@" -// Licensed to the .NET Foundation under one or more agreements. + tr.Write(@"// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // DO NOT EDIT THIS FILE! IT IS AUTOGENERATED @@ -315,8 +313,17 @@ public static class ReadyToRunInstructionSetHelper r2rEnumerationValue = $"null"; tr.WriteLine($" case InstructionSet.{architecture}_{instructionSet.JitName}: return {r2rEnumerationValue};"); - if (_64BitArchitectures.Contains(architecture) && _64bitVariants[architecture].Contains(instructionSet.JitName)) - tr.WriteLine($" case InstructionSet.{architecture}_{instructionSet.JitName}_{ArchToInstructionSetSuffixArch(architecture)}: return {r2rEnumerationValue};"); + if (_64bitVariants[architecture].Contains(instructionSet.JitName)) + { + if (_64BitArchitectures.Contains(architecture)) + { + tr.WriteLine($" case InstructionSet.{architecture}_{instructionSet.JitName}_{ArchToInstructionSetSuffixArch(architecture)}: return {r2rEnumerationValue};"); + } + else + { + tr.WriteLine($" case InstructionSet.{architecture}_{instructionSet.JitName}_{ArchToInstructionSetSuffixArch(architecture)}: return null;"); + } + } } tr.Write(@" @@ -338,8 +345,7 @@ public static class ReadyToRunInstructionSetHelper public void WriteManagedJitInstructionSet(TextWriter tr) { // Write header - tr.Write(@" -// Licensed to the .NET Foundation under one or more agreements. + tr.Write(@"// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // DO NOT EDIT THIS FILE! IT IS AUTOGENERATED @@ -583,6 +589,30 @@ public void Set64BitInstructionSetVariants(TargetArchitecture architecture) tr.Write(@" } } + + public void Set64BitInstructionSetVariantsUnconditionally(TargetArchitecture architecture) + { + switch (architecture) + { +"); + foreach (string architecture in _architectures) + { + tr.Write($@" + case TargetArchitecture.{architecture}: +"); + foreach (var instructionSet in _instructionSets) + { + if (instructionSet.Architecture != architecture) continue; + + if (_64bitVariants[architecture].Contains(instructionSet.JitName)) + tr.WriteLine($" AddInstructionSet(InstructionSet.{architecture}_{instructionSet.JitName}_{ArchToInstructionSetSuffixArch(architecture)});"); + } + + tr.WriteLine(" break;"); + } + tr.Write(@" + } + } } } "); @@ -602,8 +632,7 @@ void AddImplication(string architecture, string jitName, string impliedJitName) public void WriteNativeCorInfoInstructionSet(TextWriter tr) { // Write header - tr.Write(@" -// Licensed to the .NET Foundation under one or more agreements. + tr.Write(@"// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // DO NOT EDIT THIS FILE! IT IS AUTOGENERATED @@ -823,8 +852,7 @@ void AddImplication(string architecture, string jitName, string impliedJitName) public void WriteNativeReadyToRunInstructionSet(TextWriter tr) { // Write header - tr.Write(@" -// Licensed to the .NET Foundation under one or more agreements. + tr.Write(@"// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // DO NOT EDIT THIS FILE! IT IS AUTOGENERATED diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs index 40d651881a07..8f27ec82d1e2 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/Program.cs @@ -66,6 +66,28 @@ public TypeReplacement(string line) public readonly string ThunkTypeName; public readonly string NativeTypeName; public readonly string ManagedTypeName; + + public bool IsByRef => ManagedTypeName.Contains("ref "); + public bool IsBoolean => ManagedTypeName == "[MarshalAs(UnmanagedType.I1)]bool"; + public bool IsBOOL => ManagedTypeName == "[MarshalAs(UnmanagedType.Bool)]bool"; + + public string UnmanagedTypeName + { + get + { + if (IsBoolean) + return "byte"; + + if (IsBOOL) + return "int"; + + if (IsByRef) + return ManagedTypeName.Replace("ref ", "") + "*"; + + // No special marshaling rules + return ManagedTypeName; + } + } } class Parameter @@ -92,12 +114,6 @@ public FunctionDecl(string line, Dictionary ThunkReturn line = line.Replace("[ManualNativeWrapper]", string.Empty); } - if (line.Contains("[ReturnAsParm]")) - { - ReturnAsParm = true; - line = line.Replace("[ReturnAsParm]", string.Empty); - } - int indexOfOpenParen = line.IndexOf('('); int indexOfCloseParen = line.IndexOf(')'); string returnTypeAndFunctionName = line.Substring(0, indexOfOpenParen).Canonicalize(); @@ -136,7 +152,6 @@ public FunctionDecl(string line, Dictionary ThunkReturn public readonly TypeReplacement ReturnType; public readonly Parameter[] Parameters; public readonly bool ManualNativeWrapper = false; - public readonly bool ReturnAsParm = false; } class Program @@ -236,8 +251,7 @@ static IEnumerable ParseInput(TextReader tr) static void WriteManagedThunkInterface(TextWriter tr, IEnumerable functionData) { // Write header - tr.Write(@" -// Licensed to the .NET Foundation under one or more agreements. + tr.Write(@"// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // DO NOT EDIT THIS FILE! It IS AUTOGENERATED @@ -250,65 +264,13 @@ unsafe partial class CorInfoImpl { "); -#if false foreach (FunctionDecl decl in functionData) { - string returnType = decl.ReturnType.ManagedTypeName; - - tr.Write(" " + returnType + " " + decl.FunctionName + "("); - tr.Write("IntPtr thisHandle"); + tr.WriteLine(" [UnmanagedCallersOnly]"); + tr.Write($" static {decl.ReturnType.UnmanagedTypeName} _{decl.FunctionName}(IntPtr thisHandle, IntPtr* ppException"); foreach (Parameter param in decl.Parameters) { - tr.Write(", "); - tr.Write(param.Type.ManagedTypeName + " " + param.Name); - } - tr.WriteLine(")"); - tr.WriteLine(" { throw new NotImplementedException(); }"); - } - tr.WriteLine(); -#endif - - foreach (FunctionDecl decl in functionData) - { - tr.WriteLine(" [UnmanagedFunctionPointerAttribute(default(CallingConvention))]"); - - string returnType = decl.ReturnAsParm ? "void" : decl.ReturnType.ManagedTypeName; - int marshalAs = returnType.LastIndexOf(']'); - string returnTypeWithDelegate = returnType.Insert((marshalAs != -1) ? (marshalAs + 1) : 0, "delegate "); - - tr.Write(" " + returnTypeWithDelegate + " " + "__" + decl.FunctionName + "("); - tr.Write("IntPtr _this"); - tr.Write(", IntPtr* ppException"); - if (decl.ReturnAsParm) - { - tr.Write(", out " + decl.ReturnType.ManagedTypeName + " _return"); - } - foreach (Parameter param in decl.Parameters) - { - tr.Write(", "); - tr.Write(param.Type.ManagedTypeName + " " + param.Name); - } - tr.WriteLine(");"); - } - tr.WriteLine(); - - foreach (FunctionDecl decl in functionData) - { - string returnType = decl.ReturnAsParm ? "void" : decl.ReturnType.ManagedTypeName; - int marshalAs = returnType.LastIndexOf(']'); - string returnTypeWithStatic = returnType.Insert((marshalAs != -1) ? (marshalAs + 1) : 0, "static "); - - tr.Write(" " + returnTypeWithStatic + " " + "_" + decl.FunctionName + "("); - tr.Write("IntPtr thisHandle"); - tr.Write(", IntPtr* ppException"); - if (decl.ReturnAsParm) - { - tr.Write(", out " + decl.ReturnType.ManagedTypeName + " _return"); - } - foreach (Parameter param in decl.Parameters) - { - tr.Write(", "); - tr.Write(param.Type.ManagedTypeName + " " + param.Name); + tr.Write($", {param.Type.UnmanagedTypeName} {param.Name}"); } tr.Write(@") { @@ -316,14 +278,9 @@ unsafe partial class CorInfoImpl try { "); - bool isVoid = decl.ReturnAsParm || decl.ReturnType.ManagedTypeName == "void"; - tr.Write(" " + (isVoid ? "" : "return ") + "_this." + decl.FunctionName + "("); + bool isVoid = decl.ReturnType.ManagedTypeName == "void"; + tr.Write($" {(isVoid ? "" : "return ")}_this.{decl.FunctionName}("); bool isFirst = true; - if (decl.ReturnAsParm) - { - tr.Write("out _return"); - isFirst = false; - } foreach (Parameter param in decl.Parameters) { if (isFirst) @@ -335,13 +292,22 @@ unsafe partial class CorInfoImpl tr.Write(", "); } - if (param.Type.ManagedTypeName.Contains("ref ")) + if (param.Type.IsByRef) { - tr.Write("ref "); + tr.Write("ref *"); } tr.Write(param.Name); + if (param.Type.IsBoolean || param.Type.IsBOOL) + { + tr.Write(" != 0"); + } } - tr.Write(");"); + tr.Write(")"); + if (decl.ReturnType.IsBOOL || decl.ReturnType.IsBoolean) + { + tr.Write(" ? 1 : 0"); + } + tr.Write(";"); tr.Write(@" } catch (Exception ex) @@ -350,12 +316,7 @@ unsafe partial class CorInfoImpl "); if (!isVoid) { - string retunTypeWithoutMarshalAs = marshalAs == -1 ? returnType : returnType.Substring(marshalAs + 1); - tr.WriteLine(" return default(" + retunTypeWithoutMarshalAs + ");"); - } - else if (decl.ReturnAsParm) - { - tr.WriteLine(" _return = default(" + decl.ReturnType.ManagedTypeName + ");"); + tr.WriteLine(" return default;"); } tr.WriteLine(@" }"); tr.WriteLine(" }"); @@ -364,23 +325,24 @@ unsafe partial class CorInfoImpl int total = functionData.Count(); tr.WriteLine(@" - static IntPtr GetUnmanagedCallbacks(out Object keepAlive) + static IntPtr GetUnmanagedCallbacks() { - IntPtr * callbacks = (IntPtr *)Marshal.AllocCoTaskMem(sizeof(IntPtr) * " + total + @"); - Object[] delegates = new Object[" + total + @"]; + void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * " + total + @"); "); int index = 0; foreach (FunctionDecl decl in functionData) { - tr.WriteLine(" var d" + index + " = new " + "__" + decl.FunctionName + "(" + "_" + decl.FunctionName + ");"); - tr.WriteLine(" callbacks[" + index + "] = Marshal.GetFunctionPointerForDelegate(d" + index + ");"); - tr.WriteLine(" delegates[" + index + "] = d" + index + ";"); + tr.Write($" callbacks[{index}] = (delegate* unmanaged)&_{decl.FunctionName};"); index++; } tr.WriteLine(@" - keepAlive = delegates; return (IntPtr)callbacks; } } @@ -390,33 +352,22 @@ static IntPtr GetUnmanagedCallbacks(out Object keepAlive) static void WriteNativeWrapperInterface(TextWriter tw, IEnumerable functionData) { - tw.Write(@" -// Licensed to the .NET Foundation under one or more agreements. + tw.Write(@"// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // DO NOT EDIT THIS FILE! It IS AUTOGENERATED #include ""corinfoexception.h"" -struct CORINFO_LOOKUP_KIND; - struct JitInterfaceCallbacks { "); foreach (FunctionDecl decl in functionData) { - string returnType = decl.ReturnAsParm ? "void" : decl.ReturnType.NativeTypeName; - tw.Write(" " + returnType + " (* " + decl.FunctionName + ")("); - tw.Write("void * thisHandle"); - tw.Write(", CorInfoException** ppException"); - if (decl.ReturnAsParm) - { - tw.Write(", " + decl.ReturnType.NativeTypeName + "* _return"); - } + tw.Write($" {decl.ReturnType.NativeTypeName} (* {decl.FunctionName})(void * thisHandle, CorInfoException** ppException"); foreach (Parameter param in decl.Parameters) { - tw.Write(", "); - tw.Write(param.Type.NativeTypeName + " " + param.Name); + tw.Write($", {param.Type.NativeTypeName} {param.Name}"); } tw.WriteLine(");"); } @@ -466,12 +417,12 @@ class JitInterfaceWrapper "); if (decl.ReturnType.NativeTypeName != "void") { - tw.Write(decl.ReturnType.NativeTypeName + " _ret = "); + tw.Write($"{decl.ReturnType.NativeTypeName} _ret = "); } - tw.Write("_callbacks->" + decl.FunctionName + "(_thisHandle, &pException"); + tw.Write($"_callbacks->{decl.FunctionName}(_thisHandle, &pException"); foreach (Parameter param in decl.Parameters) { - tw.Write(", " + param.Name); + tw.Write($", {param.Name}"); } tw.Write(@"); if (pException != nullptr) diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkGenerator.csproj b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkGenerator.csproj index 06ad79da63cc..19e3a46d17f1 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkGenerator.csproj +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkGenerator.csproj @@ -2,7 +2,7 @@ Exe - $(NetCoreAppCurrent) + $(NetCoreAppToolCurrent) diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt index 389fffc2f1ef..348c59ec9f0b 100644 --- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt +++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt @@ -59,8 +59,8 @@ BYTE*,byte*,unsigned char* GSCookie*,IntPtr*,void* GSCookie**,IntPtr**,void** -BOOL*,[MarshalAs(UnmanagedType.Bool)] ref bool,int* -bool*,[MarshalAs(UnmanagedType.U1)] ref bool +BOOL*,BOOL*,int* +bool*,ref bool,bool* BoolStar,byte*,bool* UINT32*,ref uint,unsigned int* ULONG*,ref uint,unsigned long* @@ -155,12 +155,6 @@ ICorDebugInfo::BoundaryTypes*,BoundaryTypes*,void* struct _EXCEPTION_POINTERS*,_EXCEPTION_POINTERS*,void* -RETURNTYPES -BOOL,[return: MarshalAs(UnmanagedType.Bool)]bool,int -bool,[return: MarshalAs(UnmanagedType.I1)]bool -; NOTE in managed SIZE_T is an enum that is 64bits in size, and returning one of those causing mcg to do the wrong thing. -size_t,byte*,size_t - FUNCTIONS DWORD getMethodAttribs( CORINFO_METHOD_HANDLE ftn ); void setMethodAttribs( CORINFO_METHOD_HANDLE ftn, CorInfoMethodRuntimeFlags attribs ); diff --git a/src/coreclr/src/tools/Common/System/Collections/Generic/ArrayBuilder.cs b/src/coreclr/src/tools/Common/System/Collections/Generic/ArrayBuilder.cs index 8fb76479e6e8..32023e27c19f 100644 --- a/src/coreclr/src/tools/Common/System/Collections/Generic/ArrayBuilder.cs +++ b/src/coreclr/src/tools/Common/System/Collections/Generic/ArrayBuilder.cs @@ -44,7 +44,7 @@ public void Append(T[] newItems, int offset, int length) EnsureCapacity(_count + length); Array.Copy(newItems, offset, _items, _count, length); - _count += length; + _count += length; } public void Append(ArrayBuilder newItems) @@ -104,5 +104,18 @@ public bool Contains(T t) return false; } + + public bool Any(Func func) + { + for (int i = 0; i < _count; i++) + { + if (func(_items[i])) + { + return true; + } + } + + return false; + } } } diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.cs index b5e30caadf30..9e5d56e613a8 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/CanonTypes.cs @@ -158,7 +158,7 @@ protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind) Debug.Assert(kind == CanonicalFormKind.Specific); return this; } - + protected override TypeFlags ComputeTypeFlags(TypeFlags mask) { TypeFlags flags = 0; @@ -240,7 +240,7 @@ public override DefType BaseType public override bool IsCanonicalSubtype(CanonicalFormKind policy) { - return policy == CanonicalFormKind.Universal || + return policy == CanonicalFormKind.Universal || policy == CanonicalFormKind.Any; } diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/GenericParameterDesc.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/GenericParameterDesc.Canon.cs index 5883cf0a2e45..5a7f85497de6 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/GenericParameterDesc.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/GenericParameterDesc.Canon.cs @@ -5,7 +5,7 @@ namespace Internal.TypeSystem { - // Implements canonicalization of generic parameters + // Implements canonicalization of generic parameters public partial class GenericParameterDesc { public sealed override bool IsCanonicalSubtype(CanonicalFormKind policy) diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs index 973c86f44598..263615253fa0 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/InstantiatedMethod.Canon.cs @@ -12,8 +12,8 @@ partial class InstantiatedMethod /// Stores a cached version of the canonicalized form of this method since /// calculating it is a recursive operation /// - InstantiatedMethod _specificCanonCache = null; - InstantiatedMethod _universalCanonCache = null; + InstantiatedMethod _specificCanonCache; + InstantiatedMethod _universalCanonCache; /// /// Returns the result of canonicalizing this method over the given kind of Canon @@ -40,7 +40,7 @@ public override MethodDesc GetCanonMethodTarget(CanonicalFormKind kind) // This is to not end up having method instantiations like Foo<__UniversalCanon>.Method or Foo<__UniversalCanon>.Method // or Foo<__UniversalCanon>.Method<__Canon> or Foo.Method<__UniversalCanon> // It should just be Foo<__UniversalCanon>.Method<__UniversalCanon> - if ((kind == CanonicalFormKind.Specific) && + if ((kind == CanonicalFormKind.Specific) && canonicalMethodResult.IsCanonicalMethod(CanonicalFormKind.Universal)) { canonicalMethodResult = (InstantiatedMethod)canonicalMethodResult.GetCanonMethodTarget(CanonicalFormKind.Universal); @@ -48,7 +48,7 @@ public override MethodDesc GetCanonMethodTarget(CanonicalFormKind kind) SetCachedCanonValue(kind, canonicalMethodResult); } - + return canonicalMethodResult; } @@ -70,7 +70,7 @@ InstantiatedMethod GetCachedCanonValue(CanonicalFormKind kind) void SetCachedCanonValue(CanonicalFormKind kind, InstantiatedMethod value) { - switch(kind) + switch (kind) { case CanonicalFormKind.Specific: Debug.Assert(_specificCanonCache == null || _specificCanonCache == value); diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/StandardCanonicalizationAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/StandardCanonicalizationAlgorithm.cs index ed0f4123dad5..26b7ee2571f6 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/StandardCanonicalizationAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/StandardCanonicalizationAlgorithm.cs @@ -14,6 +14,8 @@ public static class StandardCanonicalizationAlgorithm /// Returns a new instantiation that canonicalizes all types in /// if possible under the policy of '' /// + /// Instantiation to canonicalize. + /// The type of cannonicalization to apply. /// True if the returned instantiation is different from ''. public static Instantiation ConvertInstantiationToCanonForm(Instantiation instantiation, CanonicalFormKind kind, out bool changed) { @@ -64,14 +66,12 @@ public static Instantiation ConvertInstantiationToCanonForm(Instantiation instan return instantiation; } - /// - /// Helper API to convert a type to its canonical or universal canonical form. - /// Note that for now, there is no mixture between specific canonical and universal canonical forms, - /// meaning that the canonical form or Foo can either be Foo<__Canon, int> or - /// Foo<__UniversalCanon, __UniversalCanon>. It cannot be Foo<__Canon, __UniversalCanon> (yet) - /// for simplicity. We can always change that rule in the futue and add support for the mixture, but - /// for now we are keeping it simple. - /// + // Helper API to convert a type to its canonical or universal canonical form. + // Note that for now, there is no mixture between specific canonical and universal canonical forms, + // meaning that the canonical form or Foo can either be Foo<__Canon, int> or + // Foo<__UniversalCanon, __UniversalCanon>. It cannot be Foo<__Canon, __UniversalCanon> (yet) + // for simplicity. We can always change that rule in the futue and add support for the mixture, but + // for now we are keeping it simple. public static TypeDesc ConvertToCanon(TypeDesc typeToConvert, CanonicalFormKind kind) { // Wrap the call to the version that potentially modifies the parameter. External diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs index c87408e652d4..c0ce80263aad 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeDesc.Canon.cs @@ -12,8 +12,8 @@ partial class TypeDesc /// Stores a cached version of the canonicalized form of this type since /// calculating it is a recursive operation /// - TypeDesc _specificCanonCache = null; - TypeDesc _universalCanonCache = null; + TypeDesc _specificCanonCache; + TypeDesc _universalCanonCache; TypeDesc GetCachedCanonValue(CanonicalFormKind kind) { switch (kind) diff --git a/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeSystemContext.Canon.cs b/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeSystemContext.Canon.cs index 5da631b5968b..091f26bfda51 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeSystemContext.Canon.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Canon/TypeSystemContext.Canon.cs @@ -11,7 +11,7 @@ namespace Internal.TypeSystem // Includes canonicalization objects local to a particular context public partial class TypeSystemContext { - private CanonType _canonType = null; + private CanonType _canonType; /// /// Instance of System.__Canon for this context /// @@ -27,7 +27,7 @@ public CanonBaseType CanonType } } - private UniversalCanonType _universalCanonType = null; + private UniversalCanonType _universalCanonType; /// /// Instance of System.__UniversalCanon for this context /// diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/ArrayType.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/ArrayType.cs index 55b0c49b429a..44a4ad886c9b 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/ArrayType.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/ArrayType.cs @@ -165,7 +165,7 @@ public enum ArrayMethodKind /// and the type system needs to provide a way to represent them. /// /// - /// There are two array Address methods ( and + /// There are two array Address methods ( and /// ). One is used when referencing Address /// method from IL, the other is used when *compiling* the method body. /// The reason we need to do this is that the Address method is required to do a type check using a type diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/CastingHelper.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/CastingHelper.cs index d10a2dc0fec2..7b21c989ec76 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/CastingHelper.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/CastingHelper.cs @@ -166,10 +166,21 @@ private static bool CanCastToInternal(this TypeDesc thisType, TypeDesc otherType case TypeFlags.SzArray: return ((ArrayType)thisType).CanCastArrayTo(otherType, protect); + case TypeFlags.ByRef: + case TypeFlags.Pointer: + if (otherType.Category == thisType.Category) + { + return ((ParameterizedType)thisType).CanCastParamTo(((ParameterizedType)otherType).ParameterType, protect); + } + return false; + + case TypeFlags.FunctionPointer: + return false; + default: Debug.Assert(thisType.IsDefType); return thisType.CanCastToClassOrInterface(otherType, protect); - } + } } private static bool CanCastGenericParameterTo(this GenericParameterDesc thisType, TypeDesc otherType, StackOverflowProtect protect) @@ -349,7 +360,7 @@ private static bool CanCastToInterface(this TypeDesc thisType, TypeDesc otherTyp { if (!otherType.HasVariance) { - return thisType.CanCastToNonVariantInterface(otherType,protect); + return thisType.CanCastToNonVariantInterface(otherType, protect); } else { @@ -415,7 +426,7 @@ private static bool CanCastByVarianceToInterfaceOrDelegate(this TypeDesc thisTyp { TypeDesc arg = instantiationThis[i]; TypeDesc targetArg = instantiationTarget[i]; - + if (arg != targetArg) { GenericParameterDesc openArgType = (GenericParameterDesc)instantiationOpen[i]; diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs index 2bf083f8525d..73c4dfd43f7b 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/ConstructedTypeRewritingHelpers.cs @@ -13,7 +13,7 @@ public static class ConstructedTypeRewritingHelpers /// Determine if the construction of a type contains one of a given set of types. This is a deep /// scan. For instance, given type MyType<SomeGeneric<int[]>>, and a set of typesToFind /// that includes int, this function will return true. Does not detect the open generics that may be - /// instantiated over in this type. IsConstructedOverType would return false if only passed MyType, + /// instantiated over in this type. IsConstructedOverType would return false if only passed MyType, /// or SomeGeneric for the above examplt. /// /// type to examine @@ -58,15 +58,15 @@ public static bool IsConstructedOverType(this TypeDesc type, TypeDesc[] typesToF } /// - /// Replace some of the types in a type's construction with a new set of types. This function does not - /// support any situation where there is an instantiated generic that is not represented by an + /// Replace some of the types in a type's construction with a new set of types. This function does not + /// support any situation where there is an instantiated generic that is not represented by an /// InstantiatedType. Does not replace the open generics that may be instantiated over in this type. - /// + /// /// For instance, Given MyType<object, int[]>, - /// an array of types to replace such as {int,object}, and + /// an array of types to replace such as {int,object}, and /// an array of replacement types such as {string,__Canon}. /// The result shall be MyType<__Canon, string[]> - /// + /// /// This function cannot be used to replace MyType in the above example. /// public static TypeDesc ReplaceTypesInConstructionOfType(this TypeDesc type, TypeDesc[] typesToReplace, TypeDesc[] replacementTypes) @@ -144,12 +144,12 @@ public static TypeDesc ReplaceTypesInConstructionOfType(this TypeDesc type, Type /// /// Replace some of the types in a method's construction with a new set of types. /// Does not replace the open generics that may be instantiated over in this type. - /// + /// /// For instance, Given MyType<object, int[]>.Function<short>(), - /// an array of types to replace such as {int,short}, and + /// an array of types to replace such as {int,short}, and /// an array of replacement types such as {string,char}. /// The result shall be MyType<object, string[]>.Function<char> - /// + /// /// This function cannot be used to replace MyType in the above example. /// public static MethodDesc ReplaceTypesInConstructionOfMethod(this MethodDesc method, TypeDesc[] typesToReplace, TypeDesc[] replacementTypes) diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs index 6c9c2b22e5cf..6c6c7ddecd9e 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/DefType.FieldLayout.cs @@ -10,7 +10,7 @@ namespace Internal.TypeSystem public abstract partial class DefType : TypeDesc { /// - /// Bit flags for layout + /// Bit flags for layout /// private class FieldLayoutFlags { @@ -48,6 +48,11 @@ private class FieldLayoutFlags /// True if information about the shape of value type has been computed. /// public const int ComputedValueTypeShapeCharacteristics = 0x40; + + /// + /// True if the layout of the type is not stable for use in the ABI + /// + public const int ComputedInstanceLayoutAbiUnstable = 0x80; } private class StaticBlockInfo @@ -156,6 +161,21 @@ public LayoutInt InstanceByteAlignment } } + /// + /// The type has stable Abi layout + /// + public bool LayoutAbiStable + { + get + { + if (!_fieldLayoutFlags.HasFlags(FieldLayoutFlags.ComputedInstanceTypeLayout)) + { + ComputeInstanceLayout(InstanceLayoutKind.TypeOnly); + } + return !_fieldLayoutFlags.HasFlags(FieldLayoutFlags.ComputedInstanceLayoutAbiUnstable); + } + } + /// /// How many bytes must be allocated to represent the non GC visible static fields of this type. /// @@ -335,6 +355,10 @@ public void ComputeInstanceLayout(InstanceLayoutKind layoutKind) _instanceFieldAlignment = computedLayout.FieldAlignment; _instanceByteCountUnaligned = computedLayout.ByteCountUnaligned; _instanceByteAlignment = computedLayout.ByteCountAlignment; + if (!computedLayout.LayoutAbiStable) + { + _fieldLayoutFlags.AddFlags(FieldLayoutFlags.ComputedInstanceLayoutAbiUnstable); + } if (computedLayout.Offsets != null) { diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/ExceptionStringID.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/ExceptionStringID.cs index 00286eabe3a9..d9d3de41634d 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/ExceptionStringID.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/ExceptionStringID.cs @@ -36,6 +36,7 @@ public enum ExceptionStringID InvalidProgramNonStaticMethod, InvalidProgramGenericMethod, InvalidProgramNonBlittableTypes, + InvalidProgramMultipleCallConv, // BadImageFormatException BadImageFormatGeneric, diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/FieldDesc.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/FieldDesc.cs index 41536c5189fa..ad44d4857479 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/FieldDesc.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/FieldDesc.cs @@ -10,7 +10,9 @@ namespace Internal.TypeSystem { public abstract partial class FieldDesc : TypeSystemEntity { +#pragma warning disable CA1825 // avoid Array.Empty() instantiation for TypeLoader public static readonly FieldDesc[] EmptyFields = new FieldDesc[0]; +#pragma warning restore CA1825 public override int GetHashCode() { @@ -18,11 +20,11 @@ public override int GetHashCode() return RuntimeHelpers.GetHashCode(this); } - public override bool Equals(Object o) + public override bool Equals(object o) { // Its only valid to compare two FieldDescs in the same context - Debug.Assert(Object.ReferenceEquals(o, null) || !(o is FieldDesc) || Object.ReferenceEquals(((FieldDesc)o).Context, this.Context)); - return Object.ReferenceEquals(this, o); + Debug.Assert(o is not FieldDesc || object.ReferenceEquals(((FieldDesc)o).Context, this.Context)); + return object.ReferenceEquals(this, o); } public virtual string Name diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/FieldLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/FieldLayoutAlgorithm.cs index cff8364566b2..47c86385c15b 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/FieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/FieldLayoutAlgorithm.cs @@ -76,6 +76,7 @@ public struct ComputedInstanceFieldLayout public LayoutInt FieldAlignment; public LayoutInt ByteCountUnaligned; public LayoutInt ByteCountAlignment; + public bool LayoutAbiStable; // Is the layout stable such that it can safely be used in function calling conventions /// /// If Offsets is non-null, then all field based layout is complete. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/GenericParameterDesc.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/GenericParameterDesc.cs index 5615efc256b6..eec341114e40 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/GenericParameterDesc.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/GenericParameterDesc.cs @@ -18,7 +18,7 @@ public enum GenericParameterKind public enum GenericVariance { None = 0, - + /// /// The generic type parameter is covariant. A covariant type parameter can appear /// as the result type of a method, the type of a read-only field, a declared base @@ -45,10 +45,10 @@ public enum GenericConstraints /// A type can be substituted for the generic type parameter only if it is a reference type. /// ReferenceTypeConstraint = 0x04, - + /// - // A type can be substituted for the generic type parameter only if it is a value - // type and is not nullable. + /// A type can be substituted for the generic type parameter only if it is a value + /// type and is not nullable. /// NotNullableValueTypeConstraint = 0x08, @@ -68,7 +68,7 @@ public virtual string Name { get { - return String.Concat("T", Index.ToStringInvariant()); + return string.Concat("T", Index.ToStringInvariant()); } } @@ -76,7 +76,7 @@ public virtual string Name /// Gets a value indicating whether this is a type or method generic parameter. /// public abstract GenericParameterKind Kind { get; } - + /// /// Gets the zero based index of the generic parameter within the declaring type or method. /// @@ -103,7 +103,7 @@ public virtual GenericConstraints Constraints return GenericConstraints.None; } } - + /// /// Gets type constraints imposed on substitutions. /// diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs index 33d38d0bf320..9e4cae522347 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/InstantiatedType.Interfaces.cs @@ -10,13 +10,12 @@ namespace Internal.TypeSystem public sealed partial class InstantiatedType : MetadataType { - private DefType[] _implementedInterfaces = null; + private DefType[] _implementedInterfaces; private DefType[] InitializeImplementedInterfaces() { - return InstantiateTypeArray(_typeDef.ExplicitlyImplementedInterfaces, _instantiation, new Instantiation()); - // TODO Add duplicate detection + return (_implementedInterfaces = InstantiateTypeArray(_typeDef.ExplicitlyImplementedInterfaces, _instantiation, new Instantiation())); } /// diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/InstantiatedType.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/InstantiatedType.cs index 90267a4c53bf..8d9d18c1a99f 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/InstantiatedType.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/InstantiatedType.cs @@ -178,8 +178,8 @@ public override MethodDesc GetFinalizer() MetadataType typeInHierarchy = this; // Note, we go back to the type definition/typical method definition in this code. - // If the finalizer is implemented on a base type that is also a generic, then the - // typicalFinalizer in that case is a MethodForInstantiatedType for an instantiated type + // If the finalizer is implemented on a base type that is also a generic, then the + // typicalFinalizer in that case is a MethodForInstantiatedType for an instantiated type // which is instantiated over the open type variables of the derived type. while (typicalFinalizer.OwningType.GetTypeDefinition() != typeInHierarchy.GetTypeDefinition()) diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/Instantiation.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/Instantiation.cs index f0e3588c6577..0d0fc3e318d4 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/Instantiation.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/Instantiation.cs @@ -64,7 +64,7 @@ public Enumerator GetEnumerator() public override string ToString() { if (_genericParameters == null) - return String.Empty; + return string.Empty; StringBuilder sb = new StringBuilder(); for (int i = 0; i < _genericParameters.Length; i++) diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/LayoutInt.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/LayoutInt.cs index 461d74133808..2ec3883af9f0 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/LayoutInt.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/LayoutInt.cs @@ -9,7 +9,7 @@ namespace Internal.TypeSystem /// /// A integer type used for layout calculations. Supports addition, max, min, comparison and alignup operations /// A custom type is used to allow the concept of an indeterminate value. (Some types representable in the - /// type system do not have a known size. This type is used to make such sizes viral through the type layout + /// type system do not have a known size. This type is used to make such sizes viral through the type layout /// computations) /// public struct LayoutInt @@ -74,7 +74,7 @@ public string ToStringInvariant() return left._value != right._value; } - public static LayoutInt operator+(LayoutInt left, LayoutInt right) + public static LayoutInt operator +(LayoutInt left, LayoutInt right) { if (left.IsIndeterminate || right.IsIndeterminate) return Indeterminate; @@ -82,6 +82,14 @@ public string ToStringInvariant() return new LayoutInt(checked(left._value + right._value)); } + public static LayoutInt operator -(LayoutInt left, LayoutInt right) + { + if (left.IsIndeterminate || right.IsIndeterminate) + return Indeterminate; + + return new LayoutInt(checked(left._value - right._value)); + } + public override bool Equals(object obj) { if (obj is LayoutInt) @@ -116,7 +124,7 @@ public static LayoutInt AlignUp(LayoutInt value, LayoutInt alignment, TargetDeta { if (value.IsIndeterminate || alignment.IsIndeterminate) { - // If value is already aligned to maximum possible alignment, then whatever + // If value is already aligned to maximum possible alignment, then whatever // alignment is can't change value if (!value.IsIndeterminate) { diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs index c0b317e201ee..2e23688d1a06 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs @@ -22,7 +22,7 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp ThrowHelper.ThrowTypeLoadException(ExceptionStringID.ClassLoadGeneral, type); } - // CLI - Partition 1, section 9.5 - Generic types shall not be marked explicitlayout. + // CLI - Partition 1, section 9.5 - Generic types shall not be marked explicitlayout. if (type.HasInstantiation && type.IsExplicitLayout) { ThrowHelper.ThrowTypeLoadException(ExceptionStringID.ClassLoadExplicitGeneric, type.GetTypeDefinition()); @@ -63,8 +63,8 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp } // CLI - Partition 2, section 22.8 - // A type has layout if it is marked SequentialLayout or ExplicitLayout. If any type within an inheritance chain has layout, - // then so shall all its base classes, up to the one that descends immediately from System.ValueType (if it exists in the type's + // A type has layout if it is marked SequentialLayout or ExplicitLayout. If any type within an inheritance chain has layout, + // then so shall all its base classes, up to the one that descends immediately from System.ValueType (if it exists in the type's // hierarchy); otherwise, from System.Object // Note: While the CLI isn't clearly worded, the layout needs to be the same for the entire chain. // If the current type isn't ValueType or System.Object and has a layout and the parent type isn't @@ -112,6 +112,7 @@ out instanceByteSizeAndAlignment ByteCountAlignment = instanceByteSizeAndAlignment.Alignment, FieldAlignment = sizeAndAlignment.Alignment, FieldSize = sizeAndAlignment.Size, + LayoutAbiStable = true }; if (numInstanceFields > 0) @@ -171,7 +172,7 @@ protected virtual ComputedInstanceFieldLayout ComputeInstanceFieldLayout(Metadat { return ComputeExplicitFieldLayout(type, numInstanceFields); } - else if (type.IsSequentialLayout || type.Context.Target.Abi == TargetAbi.CppCodegen) + else if (type.IsSequentialLayout || type.IsEnum || type.Context.Target.Abi == TargetAbi.CppCodegen) { return ComputeSequentialFieldLayout(type, numInstanceFields); } @@ -227,7 +228,7 @@ public override ComputedStaticFieldLayout ComputeStaticFieldLayout(DefType defTy } ref StaticsBlock block = ref GetStaticsBlockForField(ref result, field); - SizeAndAlignment sizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, context.Target.DefaultPackingSize); + SizeAndAlignment sizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, context.Target.DefaultPackingSize, out bool _); block.Size = LayoutInt.AlignUp(block.Size, sizeAndAlignment.Alignment, context.Target); result.Offsets[index] = new FieldAndOffset(field, block.Size); @@ -318,11 +319,14 @@ protected static ComputedInstanceFieldLayout ComputeExplicitFieldLayout(Metadata var offsets = new FieldAndOffset[numInstanceFields]; int fieldOrdinal = 0; + bool layoutAbiStable = true; foreach (var fieldAndOffset in layoutMetadata.Offsets) { TypeDesc fieldType = fieldAndOffset.Field.FieldType; - var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, packingSize); + var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, packingSize, out bool fieldLayoutAbiStable); + if (!fieldLayoutAbiStable) + layoutAbiStable = false; largestAlignmentRequired = LayoutInt.Max(fieldSizeAndAlignment.Alignment, largestAlignmentRequired); @@ -367,12 +371,31 @@ protected static ComputedInstanceFieldLayout ComputeExplicitFieldLayout(Metadata computedLayout.ByteCountUnaligned = instanceByteSizeAndAlignment.Size; computedLayout.ByteCountAlignment = instanceByteSizeAndAlignment.Alignment; computedLayout.Offsets = offsets; + computedLayout.LayoutAbiStable = layoutAbiStable; + ExplicitLayoutValidator.Validate(type, computedLayout); return computedLayout; } + private static LayoutInt AlignUpInstanceFieldOffset(TypeDesc typeWithField, LayoutInt cumulativeInstanceFieldPos, LayoutInt alignment, TargetDetails target, bool armAlignFromStartOfFields = false) + { + if (!typeWithField.IsValueType && (target.Architecture == TargetArchitecture.X86 || (armAlignFromStartOfFields && target.Architecture == TargetArchitecture.ARM)) && cumulativeInstanceFieldPos != new LayoutInt(0)) + { + // Alignment of fields is relative to the start of the field list, not the start of the object + // + // The code in the VM is written as if this is the rule for all architectures, but for ARM 32bit platforms + // there is an additional adjustment via dwOffsetBias that aligns fields based on the start of the object + cumulativeInstanceFieldPos = cumulativeInstanceFieldPos - new LayoutInt(target.PointerSize); + return LayoutInt.AlignUp(cumulativeInstanceFieldPos, alignment, target) + new LayoutInt(target.PointerSize); + } + else + { + return LayoutInt.AlignUp(cumulativeInstanceFieldPos, alignment, target); + } + } + protected static ComputedInstanceFieldLayout ComputeSequentialFieldLayout(MetadataType type, int numInstanceFields) { var offsets = new FieldAndOffset[numInstanceFields]; @@ -385,17 +408,23 @@ protected static ComputedInstanceFieldLayout ComputeSequentialFieldLayout(Metada LayoutInt largestAlignmentRequirement = LayoutInt.One; int fieldOrdinal = 0; int packingSize = ComputePackingSize(type, layoutMetadata); + bool layoutAbiStable = true; foreach (var field in type.GetFields()) { if (field.IsStatic) continue; - var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(field.FieldType, packingSize); + var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(field.FieldType, packingSize, out bool fieldLayoutAbiStable); + if (!fieldLayoutAbiStable) + layoutAbiStable = false; largestAlignmentRequirement = LayoutInt.Max(fieldSizeAndAlignment.Alignment, largestAlignmentRequirement); - cumulativeInstanceFieldPos = LayoutInt.AlignUp(cumulativeInstanceFieldPos, fieldSizeAndAlignment.Alignment, type.Context.Target); + cumulativeInstanceFieldPos = AlignUpInstanceFieldOffset(type, cumulativeInstanceFieldPos, fieldSizeAndAlignment.Alignment, type.Context.Target, + armAlignFromStartOfFields: true // In what appears to have been a bug in the design of the arm32 type layout code + // this portion of the layout algorithm does not layout from the start of the object + ); offsets[fieldOrdinal] = new FieldAndOffset(field, cumulativeInstanceFieldPos); cumulativeInstanceFieldPos = checked(cumulativeInstanceFieldPos + fieldSizeAndAlignment.Size); @@ -411,6 +440,7 @@ protected static ComputedInstanceFieldLayout ComputeSequentialFieldLayout(Metada computedLayout.ByteCountUnaligned = instanceByteSizeAndAlignment.Size; computedLayout.ByteCountAlignment = instanceByteSizeAndAlignment.Alignment; computedLayout.Offsets = offsets; + computedLayout.LayoutAbiStable = layoutAbiStable; return computedLayout; } @@ -423,15 +453,16 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, { // For types inheriting from another type, field offsets continue on from where they left off LayoutInt cumulativeInstanceFieldPos = ComputeBytesUsedInParentType(type); + TypeSystemContext context = type.Context; var layoutMetadata = type.GetClassLayout(); int packingSize = ComputePackingSize(type, layoutMetadata); + packingSize = Math.Min(context.Target.MaximumAutoLayoutPackingSize, packingSize); var offsets = new FieldAndOffset[numInstanceFields]; int fieldOrdinal = 0; - TypeSystemContext context = type.Context; // Iterate over the instance fields and keep track of the number of fields of each category // For the non-GC Pointer fields, we will keep track of the number of fields by log2(size) @@ -457,10 +488,10 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, instanceGCPointerFieldsCount++; } else - { + { Debug.Assert(fieldType.IsPrimitive || fieldType.IsPointer || fieldType.IsFunctionPointer || fieldType.IsEnum); - var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, packingSize); + var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, packingSize, out bool _); instanceNonGCPointerFieldsCount[CalculateLog2(fieldSizeAndAlignment.Size.AsInt)]++; } } @@ -485,6 +516,7 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, instanceGCPointerFieldsCount = 0; instanceValueClassFieldCount = 0; LayoutInt largestAlignmentRequired = LayoutInt.One; + bool layoutAbiStable = true; // Iterate over all fields and do the following // - Add instance fields to the appropriate array (while maintaining the enumerated order) @@ -496,7 +528,10 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, TypeDesc fieldType = field.FieldType; - var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, packingSize); + var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(fieldType, packingSize, out bool fieldLayoutAbiStable); + if (!fieldLayoutAbiStable) + layoutAbiStable = false; + largestAlignmentRequired = LayoutInt.Max(fieldSizeAndAlignment.Alignment, largestAlignmentRequired); if (IsByValueClass(fieldType)) @@ -514,9 +549,22 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, } } - largestAlignmentRequired = type.Context.Target.GetObjectAlignment(largestAlignmentRequired); + largestAlignmentRequired = context.Target.GetObjectAlignment(largestAlignmentRequired); bool requiresAlign8 = !largestAlignmentRequired.IsIndeterminate && largestAlignmentRequired.AsInt > 4; - AlignBaseOffsetIfNecessary(type, ref cumulativeInstanceFieldPos, requiresAlign8); + + if (!type.IsValueType) + { + DefType baseType = type.BaseType; + if (baseType != null && !baseType.IsObject) + { + if (!requiresAlign8 && baseType.RequiresAlign8()) + { + requiresAlign8 = true; + } + + AlignBaseOffsetIfNecessary(type, ref cumulativeInstanceFieldPos, requiresAlign8); + } + } // We've finished placing the fields into their appropriate arrays // The next optimization may place non-GC Pointers, so repurpose our @@ -558,7 +606,7 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, // (the subsequent loop will place fields from large to small fields) if (j > maxLog2Size) break; - + // Check whether there are any small enough fields // We must consider both GC Pointers and non-GC Pointers for (j = i; j >= 0; j--) @@ -624,16 +672,18 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, // If the field has an indeterminate alignment, align the cumulative field offset to the indeterminate value // Otherwise, align the cumulative field offset to the PointerSize // This avoids issues with Universal Generic Field layouts whose fields may have Indeterminate sizes or alignments - var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(instanceValueClassFieldsArr[i].FieldType, packingSize); + var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(instanceValueClassFieldsArr[i].FieldType, packingSize, out bool fieldLayoutAbiStable); + if (!fieldLayoutAbiStable) + layoutAbiStable = false; if (fieldSizeAndAlignment.Alignment.IsIndeterminate) { - cumulativeInstanceFieldPos = LayoutInt.AlignUp(cumulativeInstanceFieldPos, fieldSizeAndAlignment.Alignment, context.Target); + cumulativeInstanceFieldPos = AlignUpInstanceFieldOffset(type, cumulativeInstanceFieldPos, fieldSizeAndAlignment.Alignment, context.Target); } else { LayoutInt AlignmentRequired = LayoutInt.Max(fieldSizeAndAlignment.Alignment, context.Target.LayoutPointerSize); - cumulativeInstanceFieldPos = LayoutInt.AlignUp(cumulativeInstanceFieldPos, AlignmentRequired, context.Target); + cumulativeInstanceFieldPos = AlignUpInstanceFieldOffset(type, cumulativeInstanceFieldPos, AlignmentRequired, context.Target); } offsets[fieldOrdinal] = new FieldAndOffset(instanceValueClassFieldsArr[i], cumulativeInstanceFieldPos); @@ -654,9 +704,13 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, { minAlign = LayoutInt.Indeterminate; } - else if (cumulativeInstanceFieldPos.AsInt > type.Context.Target.PointerSize) + else if (cumulativeInstanceFieldPos.AsInt > context.Target.PointerSize) { - minAlign = type.Context.Target.LayoutPointerSize; + minAlign = context.Target.LayoutPointerSize; + if (requiresAlign8 && minAlign.AsInt == 4) + { + minAlign = new LayoutInt(8); + } } else { @@ -674,15 +728,16 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type, computedLayout.ByteCountUnaligned = instanceByteSizeAndAlignment.Size; computedLayout.ByteCountAlignment = instanceByteSizeAndAlignment.Alignment; computedLayout.Offsets = offsets; + computedLayout.LayoutAbiStable = layoutAbiStable; return computedLayout; } private static void PlaceInstanceField(FieldDesc field, int packingSize, FieldAndOffset[] offsets, ref LayoutInt instanceFieldPos, ref int fieldOrdinal) { - var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(field.FieldType, packingSize); + var fieldSizeAndAlignment = ComputeFieldSizeAndAlignment(field.FieldType, packingSize, out bool _); - instanceFieldPos = LayoutInt.AlignUp(instanceFieldPos, fieldSizeAndAlignment.Alignment, field.Context.Target); + instanceFieldPos = AlignUpInstanceFieldOffset(field.OwningType, instanceFieldPos, fieldSizeAndAlignment.Alignment, field.Context.Target); offsets[fieldOrdinal] = new FieldAndOffset(field, instanceFieldPos); instanceFieldPos = checked(instanceFieldPos + fieldSizeAndAlignment.Size); @@ -732,9 +787,10 @@ private static LayoutInt ComputeBytesUsedInParentType(DefType type) return cumulativeInstanceFieldPos; } - private static SizeAndAlignment ComputeFieldSizeAndAlignment(TypeDesc fieldType, int packingSize) + private static SizeAndAlignment ComputeFieldSizeAndAlignment(TypeDesc fieldType, int packingSize, out bool layoutAbiStable) { SizeAndAlignment result; + layoutAbiStable = true; if (fieldType.IsDefType) { @@ -743,6 +799,7 @@ private static SizeAndAlignment ComputeFieldSizeAndAlignment(TypeDesc fieldType, DefType metadataType = (DefType)fieldType; result.Size = metadataType.InstanceFieldSize; result.Alignment = metadataType.InstanceFieldAlignment; + layoutAbiStable = metadataType.LayoutAbiStable; } else { @@ -782,7 +839,7 @@ private static int ComputePackingSize(MetadataType type, ClassLayoutMetadata lay private static SizeAndAlignment ComputeInstanceSize(MetadataType type, LayoutInt instanceSize, LayoutInt alignment, int classLayoutSize, out SizeAndAlignment byteCount) { SizeAndAlignment result; - + // Pad the length of structs to be 1 if they are empty so we have no zero-length structures if (type.IsValueType && instanceSize == LayoutInt.Zero) { @@ -825,7 +882,7 @@ private static SizeAndAlignment ComputeInstanceSize(MetadataType type, LayoutInt } // Determine the alignment needed by the type when allocated - // This is target specific, and not just pointer sized due to + // This is target specific, and not just pointer sized due to // 8 byte alignment requirements on ARM for longs and doubles alignment = target.GetObjectAlignment(alignment); @@ -861,7 +918,7 @@ private ValueTypeShapeCharacteristics ComputeHomogeneousAggregateCharacteristic( MetadataType metadataType = (MetadataType)type; // No HAs with explicit layout. There may be cases where explicit layout may be still - // eligible for HA, but it is hard to tell the real intent. Make it simple and just + // eligible for HA, but it is hard to tell the real intent. Make it simple and just // unconditionally disable HAs for explicit layout. if (metadataType.IsExplicitLayout) return NotHA; diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs index 67a6ca012c3d..b92ba0aa5458 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataType.MethodImpls.cs @@ -28,7 +28,7 @@ public partial class MetadataType private MethodImplRecord[] _allVirtualMethodImplsForType; /// - /// Get an array of all MethodImpls that pertain to overriding virtual (non-interface methods) on this type. + /// Get an array of all MethodImpls that pertain to overriding virtual (non-interface methods) on this type. /// Expected to cache results so this api can be used repeatedly. /// public MethodImplRecord[] VirtualMethodImplsForType diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs index c2554217ea51..cfd0a643ad0e 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataVirtualMethodAlgorithm.cs @@ -24,13 +24,13 @@ protected override int GetValueHashCode(MethodDesc value) protected override bool CompareKeyToValue(MethodDesc key, MethodDesc value) { Debug.Assert(key.Context == value.Context); - return Object.ReferenceEquals(key, value); + return object.ReferenceEquals(key, value); } protected override bool CompareValueToValue(MethodDesc value1, MethodDesc value2) { Debug.Assert(value1.Context == value2.Context); - return Object.ReferenceEquals(value1, value2); + return object.ReferenceEquals(value1, value2); } protected override MethodDesc CreateValueFromKey(MethodDesc key) @@ -42,10 +42,10 @@ protected override MethodDesc CreateValueFromKey(MethodDesc key) private class UnificationGroup { private MethodDesc[] _members = MethodDesc.EmptyMethods; - private int _memberCount = 0; + private int _memberCount; private MethodDesc[] _methodsRequiringSlotUnification = MethodDesc.EmptyMethods; - private int _methodsRequiringSlotUnificationCount = 0; + private int _methodsRequiringSlotUnificationCount; /// /// Custom enumerator struct for Unification group. Makes enumeration require 0 allocations. @@ -130,7 +130,7 @@ public void AddMethodRequiringSlotUnification(MethodDesc method) public bool RequiresSlotUnification(MethodDesc method) { - for(int i = 0; i < _methodsRequiringSlotUnificationCount; i++) + for (int i = 0; i < _methodsRequiringSlotUnificationCount; i++) { if (_methodsRequiringSlotUnification[i] == method) return true; @@ -318,9 +318,9 @@ private static bool IsInterfaceExplicitlyImplementedOnType(MetadataType type, Me /// /// /// - /// Used to control the order of the search. For historical purposes to - /// match .NET Framework behavior, this is typically true, but not always. There is no particular rationale - /// for the particular orders other than to attempt to be consistent in virtual method override behavior + /// Used to control the order of the search. For historical purposes to + /// match .NET Framework behavior, this is typically true, but not always. There is no particular rationale + /// for the particular orders other than to attempt to be consistent in virtual method override behavior /// betweeen runtimes. /// /// @@ -355,7 +355,7 @@ private static MethodDesc FindMatchingVirtualMethodOnTypeByNameAndSig(MethodDesc return implMethod; } - // This function is used to find the name/sig based override for a given method. This method ignores all + // This function is used to find the name/sig based override for a given method. This method ignores all // method impl's as it assumes they have been resolved. The algorithm is simple. Walk to the base type looking // for overrides by name and signature. If one is found, return it as long as the newslot defining method // for the found method matches that of the target method. @@ -408,9 +408,9 @@ public static MethodDesc FindSlotDefiningMethodForVirtualMethod(MethodDesc metho /// /// /// - /// Used to control the order of the search. For historical purposes to - /// match .NET Framework behavior, this is typically true, but not always. There is no particular rationale - /// for the particular orders other than to attempt to be consistent in virtual method override behavior + /// Used to control the order of the search. For historical purposes to + /// match .NET Framework behavior, this is typically true, but not always. There is no particular rationale + /// for the particular orders other than to attempt to be consistent in virtual method override behavior /// betweeen runtimes. /// private static MethodDesc FindMatchingVirtualMethodOnTypeByNameAndSigWithSlotCheck(MethodDesc method, DefType currentType, bool reverseMethodSearch) @@ -434,7 +434,7 @@ private static void FindBaseUnificationGroup(MetadataType currentType, Unificati MethodDesc methodImpl = FindImplFromDeclFromMethodImpls(currentType, unificationGroup.DefiningMethod); if (methodImpl != null) { - if(methodImpl.RequiresSlotUnification()) + if (methodImpl.RequiresSlotUnification()) { unificationGroup.AddMethodRequiringSlotUnification(unificationGroup.DefiningMethod); unificationGroup.AddMethodRequiringSlotUnification(methodImpl); @@ -518,7 +518,7 @@ private static void FindBaseUnificationGroup(MetadataType currentType, Unificati addDeclGroup.IsInGroupOrIsDefiningSlot(declSlot) || (addDeclGroup.RequiresSlotUnification(declSlot) && addDeclGroup.DefiningMethod.Signature.EqualsWithCovariantReturnType(declSlot.Signature))); - foreach(MethodDesc methodImplRequiredToRemainInEffect in addDeclGroup.MethodsRequiringSlotUnification) + foreach (MethodDesc methodImplRequiredToRemainInEffect in addDeclGroup.MethodsRequiringSlotUnification) { unificationGroup.AddMethodRequiringSlotUnification(methodImplRequiredToRemainInEffect); } @@ -538,7 +538,7 @@ private static void FindBaseUnificationGroup(MetadataType currentType, Unificati } } - if(unificationGroup.RequiresSlotUnification(declSlot)) + if (unificationGroup.RequiresSlotUnification(declSlot)) { unificationGroup.AddMethodRequiringSlotUnification(implSlot); } @@ -574,14 +574,14 @@ public override MethodDesc ResolveVariantInterfaceMethodToVirtualMethodOnType(Me //Interface function resolution // Interface function resolution follows the following rules // 1. Apply any method impl that may exist, if once of these exists, resolve to target immediately. - // 2. If an interface is explicitly defined on a type, then attempt to perform a namesig match on the - // current type to resolve.If the interface isn't resolved, if it isn't implemented on a base type, + // 2. If an interface is explicitly defined on a type, then attempt to perform a namesig match on the + // current type to resolve.If the interface isn't resolved, if it isn't implemented on a base type, // scan all base types for name / sig matches. - // 3. If implicitly defined, attempt to perform a namesig match if the interface method implementation + // 3. If implicitly defined, attempt to perform a namesig match if the interface method implementation // has not been found on some base type. - // The above will resolve an interface to a virtual method slot. From there perform virtual resolution - // to find out the actual target.Note, to preserve correct behavior in the presence of variance, this - // function returns null if the interface method implementation is not defined by the current type in + // The above will resolve an interface to a virtual method slot. From there perform virtual resolution + // to find out the actual target.Note, to preserve correct behavior in the presence of variance, this + // function returns null if the interface method implementation is not defined by the current type in // the hierarchy.For variance to work correctly, this requires that interfaces be queried in correct order. // See current interface call resolution for details on how that happens. private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, MetadataType currentType) @@ -601,9 +601,9 @@ private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc if (foundExplicitInterface) { - MethodDesc foundOnCurrentType = FindMatchingVirtualMethodOnTypeByNameAndSig(interfaceMethod, currentType - , reverseMethodSearch: false /* When searching for name/sig overrides on a type that explicitly defines an interface, search through the type in the forward direction*/ - , nameSigMatchMethodIsValidCandidate :null); + MethodDesc foundOnCurrentType = FindMatchingVirtualMethodOnTypeByNameAndSig(interfaceMethod, currentType, + reverseMethodSearch: false, /* When searching for name/sig overrides on a type that explicitly defines an interface, search through the type in the forward direction*/ + nameSigMatchMethodIsValidCandidate :null); foundOnCurrentType = FindSlotDefiningMethodForVirtualMethod(foundOnCurrentType); if (baseType == null) @@ -630,7 +630,7 @@ private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc } // This is an implicitly implemented interface method. Only return a vlaue if this is the first type in the class - // hierarchy that implements the interface. NOTE: If we pay attention to whether or not the parent type is + // hierarchy that implements the interface. NOTE: If we pay attention to whether or not the parent type is // abstract or not, we may be able to be more efficient here, but let's skip that for now MethodDesc baseClassImplementationOfInterfaceMethod = ResolveInterfaceMethodToVirtualMethodOnTypeRecursive(interfaceMethod, baseType); if (baseClassImplementationOfInterfaceMethod != null) @@ -639,9 +639,9 @@ private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc } else { - MethodDesc foundOnCurrentType = FindMatchingVirtualMethodOnTypeByNameAndSig(interfaceMethod, currentType - , reverseMethodSearch: false /* When searching for name/sig overrides on a type that is the first type in the hierarchy to require the interface, search through the type in the forward direction*/ - , nameSigMatchMethodIsValidCandidate: null); + MethodDesc foundOnCurrentType = FindMatchingVirtualMethodOnTypeByNameAndSig(interfaceMethod, currentType, + reverseMethodSearch: false, /* When searching for name/sig overrides on a type that is the first type in the hierarchy to require the interface, search through the type in the forward direction*/ + nameSigMatchMethodIsValidCandidate: null); foundOnCurrentType = FindSlotDefiningMethodForVirtualMethod(foundOnCurrentType); @@ -685,7 +685,7 @@ public static MethodDesc ResolveVariantInterfaceMethodToVirtualMethodOnType(Meth private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnTypeRecursive(MethodDesc interfaceMethod, MetadataType currentType) { while (true) - { + { if (currentType == null) return null; @@ -713,9 +713,9 @@ private static MethodDesc FindNameSigOverrideForInterfaceMethodRecursive(MethodD if (currentType == null) return null; - MethodDesc nameSigOverride = FindMatchingVirtualMethodOnTypeByNameAndSig(interfaceMethod, currentType - , reverseMethodSearch: true /* When searching for a name sig match for an interface on parent types search in reverse order of declaration */ - , nameSigMatchMethodIsValidCandidate:null); + MethodDesc nameSigOverride = FindMatchingVirtualMethodOnTypeByNameAndSig(interfaceMethod, currentType, + reverseMethodSearch: true, /* When searching for a name sig match for an interface on parent types search in reverse order of declaration */ + nameSigMatchMethodIsValidCandidate:null); if (nameSigOverride != null) { diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs index 0545857397ba..7f2d124dc554 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs @@ -51,6 +51,14 @@ public sealed partial class MethodSignature : TypeSystemEntity // Value of for any custom modifiers on the return type public const string IndexOfCustomModifiersOnReturnType = "0.1.1.1"; + // Value of for any custom modifiers on + // SomeStruct when SomeStruct *, or SomeStruct & is the type of a parameter or return type + // Parameter index 0 represents the return type, and indices 1-n represent the parameters to the signature + public static string GetIndexOfCustomModifierOnPointedAtTypeByParameterIndex(int parameterIndex) + { + return $"0.1.1.2.{(parameterIndex + 1).ToStringInvariant()}.1"; + } + public MethodSignature(MethodSignatureFlags flags, int genericParameterCount, TypeDesc returnType, TypeDesc[] parameters, EmbeddedSignatureData[] embeddedSignatureData = null) { _flags = flags; @@ -364,7 +372,9 @@ public MethodSignature ToSignature() /// public abstract partial class MethodDesc : TypeSystemEntity { +#pragma warning disable CA1825 // avoid Array.Empty() instantiation for TypeLoader public static readonly MethodDesc[] EmptyMethods = new MethodDesc[0]; +#pragma warning restore CA1825 private int _hashcode; @@ -406,11 +416,11 @@ protected virtual int ComputeHashCode() return TypeHashingAlgorithms.ComputeMethodHashCode(OwningType.GetHashCode(), TypeHashingAlgorithms.ComputeNameHashCode(Name)); } - public override bool Equals(Object o) + public override bool Equals(object o) { // Its only valid to compare two MethodDescs in the same context - Debug.Assert(Object.ReferenceEquals(o, null) || !(o is MethodDesc) || Object.ReferenceEquals(((MethodDesc)o).Context, this.Context)); - return Object.ReferenceEquals(this, o); + Debug.Assert(o is not MethodDesc || object.ReferenceEquals(((MethodDesc)o).Context, this.Context)); + return object.ReferenceEquals(this, o); } /// diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx b/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx index 368145929e05..b0efd67b4adc 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx @@ -174,7 +174,10 @@ UnmanagedCallersOnly attribute specified on method with non-blittable parameters '{0}' + + Multiple unmanaged calling conventions are specified. Only a single calling convention is supported. + The format of a DLL or executable being loaded is invalid - \ No newline at end of file + diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/RuntimeInterfacesAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/RuntimeInterfacesAlgorithm.cs index 79ebe412bded..e77dabadb288 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/RuntimeInterfacesAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/RuntimeInterfacesAlgorithm.cs @@ -16,7 +16,7 @@ namespace Internal.TypeSystem public abstract class RuntimeInterfacesAlgorithm { /// - /// Compute the RuntimeInterfaces for a TypeDesc, is permitted to depend on + /// Compute the RuntimeInterfaces for a TypeDesc, is permitted to depend on /// RuntimeInterfaces of base type, but must not depend on any other /// details of the base type. /// diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs index 79601a4eedd5..26858543adbb 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TargetDetails.cs @@ -274,7 +274,8 @@ public LayoutInt GetObjectAlignment(LayoutInt fieldAlignment) switch (Architecture) { case TargetArchitecture.ARM: - // ARM supports two alignments for objects on the GC heap (4 byte and 8 byte) + case TargetArchitecture.Wasm32: + // ARM & Wasm32 support two alignments for objects on the GC heap (4 byte and 8 byte) if (fieldAlignment.IsIndeterminate) return LayoutInt.Indeterminate; @@ -286,7 +287,6 @@ public LayoutInt GetObjectAlignment(LayoutInt fieldAlignment) case TargetArchitecture.ARM64: return new LayoutInt(8); case TargetArchitecture.X86: - case TargetArchitecture.Wasm32: return new LayoutInt(4); default: throw new NotSupportedException(); @@ -333,5 +333,20 @@ public int MaxHomogeneousAggregateElementCount return 4; } } + + public int MaximumAutoLayoutPackingSize + { + get + { + if (Abi == TargetAbi.CoreRT) + { + if (Architecture == TargetArchitecture.X86) + { + return PointerSize; + } + } + return MaximumAlignment; + } + } } } diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs index 3eefd5fec066..bfe36b4cd829 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/ThrowHelper.Common.cs @@ -77,7 +77,7 @@ public static string Type(TypeDesc type) public static string Type(string @namespace, string name) { - return String.IsNullOrEmpty(@namespace) ? name : @namespace + "." + name; + return string.IsNullOrEmpty(@namespace) ? name : @namespace + "." + name; } public static string Field(TypeDesc owningType, string fieldName) diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/ThrowHelper.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/ThrowHelper.cs index 9ab806e77ffe..094ade10faca 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/ThrowHelper.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/ThrowHelper.cs @@ -41,6 +41,12 @@ public static void ThrowInvalidProgramException() throw new TypeSystemException.InvalidProgramException(); } + [System.Diagnostics.DebuggerHidden] + public static void ThrowInvalidProgramException(ExceptionStringID id) + { + throw new TypeSystemException.InvalidProgramException(id); + } + [System.Diagnostics.DebuggerHidden] public static void ThrowInvalidProgramException(ExceptionStringID id, MethodDesc method) { diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs index b8345c88ad4b..ce778fa590e7 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeDesc.Interfaces.cs @@ -16,7 +16,7 @@ public partial class TypeDesc /// /// The interfaces implemented by this type at runtime. There may be duplicates in this list. /// - /// + /// public DefType[] RuntimeInterfaces { get diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeDesc.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeDesc.cs index a4bacb6ed1ce..f0dbed1b57fb 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeDesc.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeDesc.cs @@ -13,32 +13,34 @@ namespace Internal.TypeSystem /// public abstract partial class TypeDesc : TypeSystemEntity { +#pragma warning disable CA1825 // avoid Array.Empty() instantiation for TypeLoader public static readonly TypeDesc[] EmptyTypes = new TypeDesc[0]; +#pragma warning restore CA1825 /// Inherited types are required to override, and should use the algorithms /// in TypeHashingAlgorithms in their implementation. public abstract override int GetHashCode(); - public override bool Equals(Object o) + public override bool Equals(object o) { // Its only valid to compare two TypeDescs in the same context - Debug.Assert(o == null || !(o is TypeDesc) || Object.ReferenceEquals(((TypeDesc)o).Context, this.Context)); - return Object.ReferenceEquals(this, o); + Debug.Assert(o is not TypeDesc || object.ReferenceEquals(((TypeDesc)o).Context, this.Context)); + return object.ReferenceEquals(this, o); } #if DEBUG public static bool operator ==(TypeDesc left, TypeDesc right) { // Its only valid to compare two TypeDescs in the same context - Debug.Assert(Object.ReferenceEquals(left, null) || Object.ReferenceEquals(right, null) || Object.ReferenceEquals(left.Context, right.Context)); - return Object.ReferenceEquals(left, right); + Debug.Assert(left is null || right is null || object.ReferenceEquals(left.Context, right.Context)); + return object.ReferenceEquals(left, right); } public static bool operator !=(TypeDesc left, TypeDesc right) { // Its only valid to compare two TypeDescs in the same context - Debug.Assert(Object.ReferenceEquals(left, null) || Object.ReferenceEquals(right, null) || Object.ReferenceEquals(left.Context, right.Context)); - return !Object.ReferenceEquals(left, right); + Debug.Assert(left is null || right is null || object.ReferenceEquals(left.Context, right.Context)); + return !object.ReferenceEquals(left, right); } #endif diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemContext.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemContext.cs index 2346036fec30..21c17d47d991 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemContext.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemContext.cs @@ -740,7 +740,7 @@ public virtual VirtualMethodAlgorithm GetVirtualMethodAlgorithmForType(TypeDesc throw new NotSupportedException(); } - // Abstraction to allow different runtimes to have different policy about which fields are + // Abstraction to allow different runtimes to have different policy about which fields are // in the GC static region, and which are not protected internal virtual bool ComputeHasGCStaticBase(FieldDesc field) { @@ -758,7 +758,7 @@ internal TypeFlags ComputeTypeFlags(TypeDesc type, TypeFlags flags, TypeFlags ma if ((mask & TypeFlags.HasStaticConstructorComputed) == TypeFlags.HasStaticConstructorComputed) { TypeDesc typeDefinition = type.GetTypeDefinition(); - + if (typeDefinition != type) { // If the type definition is different, the code was working with an instantiated generic or some such. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs index 931136950f1a..17836ca309bd 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs @@ -138,6 +138,11 @@ internal InvalidProgramException(ExceptionStringID id, string method) { } + internal InvalidProgramException(ExceptionStringID id) + : base(id) + { + } + internal InvalidProgramException() : base(ExceptionStringID.InvalidProgramDefault) { diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs index 0ae8d679104a..a72d9a1d7d9f 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemHelpers.cs @@ -211,7 +211,7 @@ public static MethodDesc TryResolveConstraintMethodApprox(this TypeDesc constrai } else { - // The method will be null if calling a non-virtual instance + // The method will be null if calling a non-virtual instance // methods on System.Object, i.e. when these are used as a constraint. method = null; } @@ -223,7 +223,7 @@ public static MethodDesc TryResolveConstraintMethodApprox(this TypeDesc constrai } //#TryResolveConstraintMethodApprox_DoNotReturnParentMethod - // Only return a method if the value type itself declares the method, + // Only return a method if the value type itself declares the method, // otherwise we might get a method from Object or System.ValueType if (!method.OwningType.IsValueType) { @@ -250,7 +250,7 @@ public static MethodDesc TryResolveConstraintMethodApprox(this TypeDesc constrai public static string GetFullName(this DefType metadataType) { string ns = metadataType.Namespace; - return ns.Length > 0 ? String.Concat(ns, ".", metadataType.Name) : metadataType.Name; + return ns.Length > 0 ? string.Concat(ns, ".", metadataType.Name) : metadataType.Name; } /// @@ -350,7 +350,7 @@ public static MethodDesc InstantiateAsOpen(this MethodDesc method) } /// - /// Scan the type and its base types for an implementation of an interface method. Returns null if no + /// Scan the type and its base types for an implementation of an interface method. Returns null if no /// implementation is found. /// public static MethodDesc ResolveInterfaceMethodTarget(this TypeDesc thisType, MethodDesc interfaceMethodToResolve) @@ -438,5 +438,40 @@ public static bool RequiresSlotUnification(this MethodDesc method) return false; } + + /// + /// Determines whether an object of type '' requires 8-byte alignment on + /// 32bit ARM or 32bit Wasm architectures. + /// + public static bool RequiresAlign8(this TypeDesc type) + { + if (type.Context.Target.Architecture != TargetArchitecture.ARM && type.Context.Target.Architecture != TargetArchitecture.Wasm32) + { + return false; + } + + if (type.IsArray) + { + var elementType = ((ArrayType)type).ElementType; + if (elementType.IsValueType) + { + var alignment = ((DefType)elementType).InstanceByteAlignment; + if (!alignment.IsIndeterminate && alignment.AsInt > 4) + { + return true; + } + } + } + else if (type.IsDefType) + { + var alignment = ((DefType)type).InstanceByteAlignment; + if (!alignment.IsIndeterminate && alignment.AsInt > 4) + { + return true; + } + } + + return false; + } } } diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs index f32daba077b2..9b58069b5758 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/UniversalCanonLayoutAlgorithm.cs @@ -29,7 +29,8 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType type, FieldAlignment = LayoutInt.Indeterminate, ByteCountUnaligned = LayoutInt.Indeterminate, ByteCountAlignment = LayoutInt.Indeterminate, - Offsets = Array.Empty() + Offsets = Array.Empty(), + LayoutAbiStable = true }; } diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs index 99431f937851..e353a592df40 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/DebugNameFormatter.cs @@ -80,7 +80,7 @@ public override Void AppendName(StringBuilder sb, SignatureMethodVariable type, public override Void AppendName(StringBuilder sb, SignatureTypeVariable type, FormatOptions options) { - sb.Append("!"); + sb.Append('!'); sb.Append(type.Index.ToStringInvariant()); return Void.Value; @@ -174,7 +174,6 @@ protected override Void AppendNameForNamespaceType(StringBuilder sb, DefType typ { sb.Length = initialLen; - // AssemblyQualify(sb, type, options); NamespaceQualify(sb, type, options); sb.Append(type.DiagnosticName); diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.cs index 31fccdcaaa93..8fcbab6ef1da 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/ExceptionTypeNameFormatter.cs @@ -28,7 +28,7 @@ public override void AppendName(StringBuilder sb, GenericParameterDesc type) public override void AppendName(StringBuilder sb, SignatureTypeVariable type) { - sb.Append("!"); + sb.Append('!'); sb.Append(type.Index.ToStringInvariant()); } @@ -114,4 +114,3 @@ protected override void AppendNameForNestedType(StringBuilder sb, DefType nested } } } - diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs index 59204c234972..1c56f36a33e7 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/Utilities/LockFreeReaderHashtable.cs @@ -21,7 +21,7 @@ namespace Internal.TypeSystem /// /// /// - abstract public class LockFreeReaderHashtable where TValue : class + public abstract class LockFreeReaderHashtable where TValue : class { private const int _initialSize = 16; private const int _fillPercentageBeforeResize = 60; @@ -45,7 +45,7 @@ abstract public class LockFreeReaderHashtable where TValue : class /// Any modifications to this array must be additive only, and there must /// never be a situation where the visible _hashtable has less data than /// it did at an earlier time. This value is initialized to an array of size - /// 1. (That array is never mutated as any additions will trigger an Expand + /// 1. (That array is never mutated as any additions will trigger an Expand /// operation, but we don't use an empty array as the /// initial step, as this approach allows the TryGetValue logic to always /// succeed without needing any length or null checks.) @@ -61,17 +61,17 @@ abstract public class LockFreeReaderHashtable where TValue : class /// /// _count represents the current count of elements in the hashtable - /// _count is used in combination with _resizeCount to control when the + /// _count is used in combination with _resizeCount to control when the /// hashtable should expand /// - private volatile int _count = 0; + private volatile int _count; /// /// Represents _count plus the number of potential adds currently happening. /// If this reaches _hashTable.Length-1, an expansion is required (because /// one slot must always be null for seeks to complete). /// - private int _reserve = 0; + private int _reserve; /// /// _resizeCount represents the size at which the hashtable should resize. @@ -81,7 +81,7 @@ abstract public class LockFreeReaderHashtable where TValue : class private volatile int _resizeCount = _initialSize * _fillPercentageBeforeResize / 100; /// - /// Get the underlying array for the hashtable at this time. + /// Get the underlying array for the hashtable at this time. /// private TValue[] GetCurrentHashtable() { @@ -175,8 +175,8 @@ public LockFreeReaderHashtable() /// Gets the value associated with the specified key. /// /// The key of the value to get. - /// When this method returns, contains the value associated with - /// the specified key, if the key is found; otherwise, the default value for the type + /// When this method returns, contains the value associated with + /// the specified key, if the key is found; otherwise, the default value for the type /// of the value parameter. This parameter is passed uninitialized. This function is threadsafe, /// and wait-free /// true if a value was found @@ -239,7 +239,7 @@ public bool TryGetValue(TKey key, out TValue value) /// /// /// The value that replaced the sentinel, or null - TValue WaitForSentinelInHashtableToDisappear(TValue[] hashtable, int tableIndex) + private TValue WaitForSentinelInHashtableToDisappear(TValue[] hashtable, int tableIndex) { TValue sentinel = Volatile.Read(ref _entryInProcessOfWritingSentinel); if (sentinel == null) @@ -267,15 +267,15 @@ TValue WaitForSentinelInHashtableToDisappear(TValue[] hashtable, int tableIndex) /// private void Expand(TValue[] oldHashtable) { - lock(this) + lock (this) { // If somebody else already resized, don't try to do it based on an old table - if(oldHashtable != _hashtable) + if (oldHashtable != _hashtable) { return; } - // The checked statement here protects against both the hashTable size and _reserve overflowing. That does mean + // The checked statement here protects against both the hashTable size and _reserve overflowing. That does mean // the maximum size of _hashTable is 0x70000000 int newSize = checked(oldHashtable.Length * 2); @@ -404,7 +404,7 @@ private TValue AddOrGetExistingInner(TValue value, out bool addedValue) return result; } - TValue VolatileReadNonSentinelFromHashtable(TValue[] hashTable, int tableIndex) + private TValue VolatileReadNonSentinelFromHashtable(TValue[] hashTable, int tableIndex) { TValue examineEntry = Volatile.Read(ref hashTable[tableIndex]); @@ -418,7 +418,7 @@ TValue VolatileReadNonSentinelFromHashtable(TValue[] hashTable, int tableIndex) /// Attemps to add a value to the hashtable, or find a value which is already present in the hashtable. /// In some cases, this will fail due to contention with other additions and must be retried. /// Note that the key is not specified as it is implicit in the value. This function is thread-safe, - /// but must only take locks around internal operations and GetValueHashCode. + /// but must only take locks around internal operations and GetValueHashCode. /// /// Value to attempt to add to the hashtable, must not be null /// Set to true if was added to the table. False if the value @@ -497,7 +497,7 @@ private TValue TryAddOrGetExisting(TValue value, out bool addedValue) WriteAbortNullToLocation(hashTableLocal, tableIndex); // Pulse the lock so we don't spin during an expansion - lock(this) { } + lock (this) { } Interlocked.Decrement(ref _reserve); return null; } @@ -530,7 +530,6 @@ private bool TryWriteSentinelToLocation(TValue[] hashTableLocal, int tableIndex) /// Attempts to write a value into the table. Should never fail as the sentinel should be the only /// entry that can be in the table at this point /// - /// True if the value was successfully written private void WriteValueToLocation(TValue value, TValue[] hashTableLocal, int tableIndex) { // Add to hash, use a volatile write to ensure that @@ -543,7 +542,6 @@ private void WriteValueToLocation(TValue value, TValue[] hashTableLocal, int tab /// Attempts to abort write a value into the table. Should never fail as the sentinel should be the only /// entry that can be in the table at this point /// - /// True if the value was successfully written private void WriteAbortNullToLocation(TValue[] hashTableLocal, int tableIndex) { // Add to hash, use a volatile write to ensure that @@ -664,8 +662,8 @@ public struct Enumerator : IEnumerator private TValue _current; /// - /// Use this to get an enumerable collection from a LockFreeReaderHashtable. - /// Used instead of a GetEnumerator method on the LockFreeReaderHashtable to + /// Use this to get an enumerable collection from a LockFreeReaderHashtable. + /// Used instead of a GetEnumerator method on the LockFreeReaderHashtable to /// reduce excess type creation. (By moving the method here, the generic dictionary for /// LockFreeReaderHashtable does not need to contain a reference to the /// enumerator type. diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/VirtualMethodAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/VirtualMethodAlgorithm.cs index 3a291fb69802..2ccf63094936 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/VirtualMethodAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/VirtualMethodAlgorithm.cs @@ -17,7 +17,7 @@ namespace Internal.TypeSystem public abstract class VirtualMethodAlgorithm { /// - /// Resolves interface method '' to a method on '' + /// Resolves interface method '' to a method on '' /// that implements the the method. /// public abstract MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType); diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/WellKnownType.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/WellKnownType.cs index 2a6b425ee1e5..cc3e5636058f 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Common/WellKnownType.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Common/WellKnownType.cs @@ -6,7 +6,7 @@ namespace Internal.TypeSystem { // The following enum is required for interop with the VS Debugger - // Prior to making any changes to this enum, please reach out to the VS Debugger + // Prior to making any changes to this enum, please reach out to the VS Debugger // team to make sure that your changes are not going to prevent the debugger // from working. public enum WellKnownType diff --git a/src/coreclr/src/tools/Common/TypeSystem/IL/EcmaMethodIL.cs b/src/coreclr/src/tools/Common/TypeSystem/IL/EcmaMethodIL.cs index 5f1389bb1aa9..e0142800be95 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/IL/EcmaMethodIL.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/IL/EcmaMethodIL.cs @@ -22,24 +22,19 @@ public sealed partial class EcmaMethodIL : MethodIL private LocalVariableDefinition[] _locals; private ILExceptionRegion[] _ilExceptionRegions; - // TODO: Remove: Workaround for missing ClearInitLocals transforms in CoreRT CoreLib - private readonly bool _clearInitLocals; - - public static EcmaMethodIL Create(EcmaMethod method, bool clearInitLocals = false) + public static EcmaMethodIL Create(EcmaMethod method) { var rva = method.MetadataReader.GetMethodDefinition(method.Handle).RelativeVirtualAddress; if (rva == 0) return null; - return new EcmaMethodIL(method, rva, clearInitLocals); + return new EcmaMethodIL(method, rva); } - private EcmaMethodIL(EcmaMethod method, int rva, bool clearInitLocals) + private EcmaMethodIL(EcmaMethod method, int rva) { _method = method; _module = method.Module; _methodBody = _module.PEReader.GetMethodBody(rva); - - _clearInitLocals = clearInitLocals; } public EcmaModule Module @@ -71,7 +66,7 @@ public override bool IsInitLocals { get { - return !_clearInitLocals && _methodBody.LocalVariablesInitialized; + return _methodBody.LocalVariablesInitialized; } } diff --git a/src/coreclr/src/tools/Common/TypeSystem/IL/Stubs/VolatileIntrinsics.cs b/src/coreclr/src/tools/Common/TypeSystem/IL/Stubs/VolatileIntrinsics.cs index f9ab4c106055..35dca8644ac9 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/IL/Stubs/VolatileIntrinsics.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/IL/Stubs/VolatileIntrinsics.cs @@ -63,7 +63,7 @@ public static MethodIL EmitIL(MethodDesc method) // // Ordinary volatile loads and stores only guarantee atomicity for pointer-sized (or smaller) data. // So, on 32-bit platforms we must use Interlocked operations instead for the 64-bit types. - // The implementation in mscorlib already does this, so we will only substitute a new + // The implementation in CoreLib already does this, so we will only substitute a new // IL body if we're running on a 64-bit platform. // case TypeFlags.Int64 when method.Context.Target.PointerSize == 8: diff --git a/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs b/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs index 956e4fc8e274..730812ed495c 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalHelpers.cs @@ -166,13 +166,44 @@ internal static TypeDesc GetNativeTypeFromMarshallerKind(TypeDesc type, } } + private static bool HasCopyConstructorCustomModifier(int? parameterIndex, + EmbeddedSignatureData[] customModifierData) + { + if (!parameterIndex.HasValue || customModifierData == null) + return false; + + string customModifierIndex = MethodSignature.GetIndexOfCustomModifierOnPointedAtTypeByParameterIndex(parameterIndex.Value); + foreach (var customModifier in customModifierData) + { + if (customModifier.kind != EmbeddedSignatureDataKind.RequiredCustomModifier) + continue; + + if (customModifier.index != customModifierIndex) + continue; + + var customModifierType = customModifier.type as DefType; + if (customModifierType == null) + continue; + + if ((customModifierType.Namespace == "System.Runtime.CompilerServices" && customModifierType.Name == "IsCopyConstructed") || + (customModifierType.Namespace == "Microsoft.VisualC" && customModifierType.Name == "NeedsCopyConstructorModifier")) + { + return true; + } + } + + return false; + } + internal static MarshallerKind GetMarshallerKind( - TypeDesc type, - MarshalAsDescriptor marshalAs, - bool isReturn, - bool isAnsi, - MarshallerType marshallerType, - out MarshallerKind elementMarshallerKind) + TypeDesc type, + int? parameterIndex, + EmbeddedSignatureData[] customModifierData, + MarshalAsDescriptor marshalAs, + bool isReturn, + bool isAnsi, + MarshallerType marshallerType, + out MarshallerKind elementMarshallerKind) { elementMarshallerKind = MarshallerKind.Invalid; @@ -183,6 +214,12 @@ internal static MarshallerKind GetMarshallerKind( type = type.GetParameterType(); + if (!type.IsPrimitive && type.IsValueType && marshallerType != MarshallerType.Field + && HasCopyConstructorCustomModifier(parameterIndex, customModifierData)) + { + return MarshallerKind.BlittableValueClassWithCopyCtor; + } + // Compat note: CLR allows ref returning blittable structs for IJW if (isReturn) return MarshallerKind.Invalid; @@ -444,7 +481,15 @@ internal static MarshallerKind GetMarshallerKind( else if (type.IsPointer) { if (nativeType == NativeTypeKind.Default) + { + var pointedAtType = type.GetParameterType(); + if (!pointedAtType.IsPrimitive && !type.IsEnum && marshallerType != MarshallerType.Field + && HasCopyConstructorCustomModifier(parameterIndex, customModifierData)) + { + return MarshallerKind.BlittableValueClassWithCopyCtor; + } return MarshallerKind.BlittableValue; + } else return MarshallerKind.Invalid; } @@ -734,6 +779,8 @@ private static MarshallerKind GetArrayElementMarshallerKind( return MarshallerKind.AnsiString; case NativeTypeKind.LPWStr: return MarshallerKind.UnicodeString; + case NativeTypeKind.LPUTF8Str: + return MarshallerKind.UTF8String; default: return MarshallerKind.Invalid; } diff --git a/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs b/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs index 65f0956943fb..f713f9cb0c29 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/MarshalUtils.cs @@ -44,6 +44,8 @@ public static bool IsBlittableType(TypeDesc type) MarshallerKind marshallerKind = MarshalHelpers.GetMarshallerKind( field.FieldType, + parameterIndex : null, + customModifierData: null, field.GetMarshalAsDescriptor(), isReturn: false, isAnsi: mdType.PInvokeStringFormat == PInvokeStringFormat.AnsiClass, diff --git a/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/Marshaller.cs b/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/Marshaller.cs index 31c869463025..087630d007af 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/Marshaller.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Interop/IL/Marshaller.cs @@ -50,6 +50,7 @@ enum MarshallerKind AsAnyA, AsAnyW, ComInterface, + BlittableValueClassWithCopyCtor, Invalid } public enum MarshalDirection @@ -271,6 +272,8 @@ protected Marshaller() /// type of the parameter to marshal /// The created Marshaller public static Marshaller CreateMarshaller(TypeDesc parameterType, + int? parameterIndex, + EmbeddedSignatureData[] customModifierData, MarshallerType marshallerType, MarshalAsDescriptor marshalAs, MarshalDirection direction, @@ -286,6 +289,8 @@ public static Marshaller CreateMarshaller(TypeDesc parameterType, { MarshallerKind elementMarshallerKind; MarshallerKind marshallerKind = MarshalHelpers.GetMarshallerKind(parameterType, + parameterIndex, + customModifierData, marshalAs, isReturn, flags.CharSet == CharSet.Ansi, @@ -1079,7 +1084,7 @@ protected override void AllocManagedToNative(ILCodeStream codeStream) codeStream.Emit(ILOpcode.brfalse, lNullArray); // allocate memory - // nativeParameter = (byte**)CoTaskMemAllocAndZeroMemory((IntPtr)(checked(managedParameter.Length * sizeof(byte*)))); + // nativeParameter = AllocCoTaskMem(checked(managedParameter.Length * sizeof(NativeElementType))); // loads the number of elements EmitElementCount(codeStream, MarshalDirection.Forward); @@ -1681,25 +1686,9 @@ private void AllocSafeHandle(ILCodeStream codeStream) var ctor = ManagedType.GetParameterlessConstructor(); if (ctor == null || ((MetadataType)ManagedType).IsAbstract) { -#if READYTORUN - // Let the runtime generate the proper MissingMemberException for this. - throw new NotSupportedException(); -#else - var emitter = _ilCodeStreams.Emitter; - - MethodSignature ctorSignature = new MethodSignature(0, 0, Context.GetWellKnownType(WellKnownType.Void), - new TypeDesc[] { - Context.GetWellKnownType(WellKnownType.String) - }); - MethodDesc exceptionCtor = InteropTypes.GetMissingMemberException(Context).GetKnownMethod(".ctor", ctorSignature); - - string name = ((MetadataType)ManagedType).Name; - codeStream.Emit(ILOpcode.ldstr, emitter.NewToken(String.Format("'{0}' does not have a default constructor. Subclasses of SafeHandle must have a default constructor to support marshaling a Windows HANDLE into managed code.", name))); - codeStream.Emit(ILOpcode.newobj, emitter.NewToken(exceptionCtor)); - codeStream.Emit(ILOpcode.throw_); - - return; -#endif + ThrowHelper.ThrowMissingMethodException(ManagedType, ".ctor", + new MethodSignature(MethodSignatureFlags.None, genericParameterCount: 0, + ManagedType.Context.GetWellKnownType(WellKnownType.Void), TypeDesc.EmptyTypes)); } codeStream.Emit(ILOpcode.newobj, _ilCodeStreams.Emitter.NewToken(ctor)); diff --git a/src/coreclr/src/tools/Common/TypeSystem/Interop/InteropTypes.cs b/src/coreclr/src/tools/Common/TypeSystem/Interop/InteropTypes.cs index d602d449c47f..ff219c6418ca 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/Interop/InteropTypes.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/Interop/InteropTypes.cs @@ -29,11 +29,6 @@ public static MetadataType GetHandleRef(TypeSystemContext context) return context.SystemModule.GetKnownType("System.Runtime.InteropServices", "HandleRef"); } - public static MetadataType GetMissingMemberException(TypeSystemContext context) - { - return context.SystemModule.GetKnownType("System", "MissingMemberException"); - } - public static MetadataType GetPInvokeMarshal(TypeSystemContext context) { return context.SystemModule.GetKnownType("System.Runtime.InteropServices", "PInvokeMarshal"); diff --git a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs index 65ee522f5273..59857683b10c 100644 --- a/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/Common/TypeSystem/RuntimeDetermined/RuntimeDeterminedFieldLayoutAlgorithm.cs @@ -30,7 +30,8 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp ByteCountAlignment = canonicalType.InstanceByteAlignment, FieldAlignment = canonicalType.InstanceFieldAlignment, FieldSize = canonicalType.InstanceFieldSize, - Offsets = Array.Empty() + Offsets = Array.Empty(), + LayoutAbiStable = canonicalType.LayoutAbiStable }; return result; diff --git a/src/coreclr/src/tools/Directory.Build.props b/src/coreclr/src/tools/Directory.Build.props index d7eed0273181..d3d6aedf615f 100644 --- a/src/coreclr/src/tools/Directory.Build.props +++ b/src/coreclr/src/tools/Directory.Build.props @@ -3,5 +3,6 @@ false false + false diff --git a/src/coreclr/src/tools/GCLogParser/parse-hb-log.csproj b/src/coreclr/src/tools/GCLogParser/parse-hb-log.csproj index 73ea1b718287..5bff6087f510 100644 --- a/src/coreclr/src/tools/GCLogParser/parse-hb-log.csproj +++ b/src/coreclr/src/tools/GCLogParser/parse-hb-log.csproj @@ -9,7 +9,6 @@ parse_hb_log parse-hb-log v4.7.2 - 512 true true @@ -20,8 +19,6 @@ false artifacts\Debug\ DEBUG;TRACE - prompt - 4 AnyCPU @@ -29,8 +26,6 @@ true artifacts\Release\ TRACE - prompt - 4 true @@ -38,7 +33,6 @@ DEBUG;TRACE full x64 - prompt MinimumRecommendedRules.ruleset true @@ -48,7 +42,6 @@ true pdbonly x64 - prompt MinimumRecommendedRules.ruleset true diff --git a/src/coreclr/src/tools/GenClrDebugResource/CMakeLists.txt b/src/coreclr/src/tools/GenClrDebugResource/CMakeLists.txt index 9efed80ddcd6..0db21fa5d7cc 100644 --- a/src/coreclr/src/tools/GenClrDebugResource/CMakeLists.txt +++ b/src/coreclr/src/tools/GenClrDebugResource/CMakeLists.txt @@ -1,4 +1,4 @@ -add_definitions(-MT) +set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) add_executable(GenClrDebugResource GenClrDebugResource.cpp) target_link_libraries(GenClrDebugResource diff --git a/src/coreclr/src/tools/ILVerification/README.md b/src/coreclr/src/tools/ILVerification/README.md index 2c3277a23a10..48ed8724f664 100644 --- a/src/coreclr/src/tools/ILVerification/README.md +++ b/src/coreclr/src/tools/ILVerification/README.md @@ -1,3 +1,3 @@ # ILVerification -The ILVerification library is part of the ILVerify project. See details under [src/coreclr/src/tools/ILVerify](../ILVerify). \ No newline at end of file +The ILVerification library is part of the ILVerify project. See details under [src/coreclr/src/tools/ILVerify](../ILVerify). diff --git a/src/coreclr/src/tools/ILVerify/README.md b/src/coreclr/src/tools/ILVerify/README.md index a3c0001a6456..7f61e432569b 100644 --- a/src/coreclr/src/tools/ILVerify/README.md +++ b/src/coreclr/src/tools/ILVerify/README.md @@ -92,17 +92,7 @@ The methods are automatically fed into appropriate XUnit theories based on the n You can run the tests either in Visual Studio (in Test Explorer) or with the ```dotnet test ``` command from the command line. ## How to contribute -All ILVerify issues are labeled with [area-ILVerification](https://github.com/search?utf8=%E2%9C%93&q=label%3Aarea-ILVerification&type=). - -ILVerify basically runs through the IL commands in an assembly and does all the verification steps that are specified in ECMA-335. - -Currently every IL command falls into one of these categories: - - - Not implemented: the implementation is completely missing. The easiest way is to pick one of them (look for NotImplentedException in the code) and implement it. First you should 100% understand the spec. (see [ECMA-335](https://www.ecma-international.org/publications/standards/Ecma-335.htm)), then try to port an existing implementation (sources below). - - Partially implemented: These are typically methods with TODOs in it. As the first phase we want to make sure that for every command the stack is correctly maintained, therefore for some commands we either have no verification or we have only a not complete verification. You can also pick one of these and finish it. - - Implemented: find and fix bugs ;) . - -Another option to contribute is to write tests (see Tests section). +All ILVerify issues are labeled with [area-ILVerification](https://github.com/search?utf8=%E2%9C%93&q=label%3Aarea-ILVerification&type=). You can also look and fix TODOs in the source code. Useful sources: - [PEVerify source code](https://github.com/lewischeng-ms/sscli/blob/master/clr/src/jit64/newverify.cpp) diff --git a/src/coreclr/src/tools/InjectResource/CMakeLists.txt b/src/coreclr/src/tools/InjectResource/CMakeLists.txt index 71d871e295b3..0e987aedd1ee 100644 --- a/src/coreclr/src/tools/InjectResource/CMakeLists.txt +++ b/src/coreclr/src/tools/InjectResource/CMakeLists.txt @@ -1,6 +1,6 @@ remove_definitions(-DUNICODE) remove_definitions(-D_UNICODE) -add_definitions(-MT) +set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) add_executable(InjectResource InjectResource.cpp) diff --git a/src/coreclr/src/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj b/src/coreclr/src/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj index 1b715742062a..291136d46ae9 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj +++ b/src/coreclr/src/tools/aot/ILCompiler.DependencyAnalysisFramework/ILCompiler.DependencyAnalysisFramework.csproj @@ -3,7 +3,7 @@ Library ILCompiler.DependencyAnalysisFramework ILCompiler.DependencyAnalysisFramework - netstandard1.3 + netstandard2.0 false x64;x86 AnyCPU diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs index 20d6dac16b8a..df25e0310789 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Reflection.Metadata; using System.Reflection.PortableExecutable; using ILCompiler.DependencyAnalysis.ReadyToRun; @@ -52,12 +53,20 @@ internal class ReadyToRunObjectWriter /// Set to non-null when the executable generator should output a map file. /// private readonly MapFileBuilder _mapFileBuilder; + /// + /// True when the map file builder should emit a textual map file + /// + private bool _generateMapFile; + /// + /// True when the map file builder should emit a CSV formatted map file + /// + private bool _generateMapCsvFile; /// - /// If non-null, the PE file will be laid out such that it can naturally be mapped with a higher alignment than 4KB - /// This is used to support loading via large pages on Linux + /// If non-zero, the PE file will be laid out such that it can naturally be mapped with a higher alignment than 4KB. + /// This is used to support loading via large pages on Linux. /// - private readonly int? _customPESectionAlignment; + private readonly int _customPESectionAlignment; #if DEBUG @@ -78,15 +87,17 @@ public NodeInfo(ISymbolNode node, int nodeIndex, int symbolIndex) Dictionary _previouslyWrittenNodeNames = new Dictionary(); #endif - public ReadyToRunObjectWriter(string objectFilePath, EcmaModule componentModule, IEnumerable nodes, NodeFactory factory, bool generateMapFile, int? customPESectionAlignment) + public ReadyToRunObjectWriter(string objectFilePath, EcmaModule componentModule, IEnumerable nodes, NodeFactory factory, bool generateMapFile, bool generateMapCsvFile, int customPESectionAlignment) { _objectFilePath = objectFilePath; _componentModule = componentModule; _nodes = nodes; _nodeFactory = factory; _customPESectionAlignment = customPESectionAlignment; - - if (generateMapFile) + _generateMapFile = generateMapFile; + _generateMapCsvFile = generateMapCsvFile; + + if (generateMapFile || generateMapCsvFile) { _mapFileBuilder = new MapFileBuilder(); } @@ -102,8 +113,9 @@ public void EmitPortableExecutable() stopwatch.Start(); PEHeaderBuilder headerBuilder; - int timeDateStamp; + int? timeDateStamp; ISymbolNode r2rHeaderExportSymbol; + Func, BlobContentId> peIdProvider = null; if (_nodeFactory.CompilationModuleGroup.IsCompositeBuildMode && _componentModule == null) { @@ -112,8 +124,8 @@ public void EmitPortableExecutable() dllCharacteristics: default(DllCharacteristics), Subsystem.Unknown, _nodeFactory.Target); - // TODO: generate a non-zero timestamp: https://github.com/dotnet/runtime/issues/32507 - timeDateStamp = 0; + peIdProvider = new Func, BlobContentId>(content => BlobContentId.FromHash(CryptographicHashProvider.ComputeSourceHash(content))); + timeDateStamp = null; r2rHeaderExportSymbol = _nodeFactory.Header; } else @@ -135,7 +147,8 @@ public void EmitPortableExecutable() r2rHeaderExportSymbol, Path.GetFileName(_objectFilePath), getRuntimeFunctionsTable, - _customPESectionAlignment); + _customPESectionAlignment, + peIdProvider); NativeDebugDirectoryEntryNode nativeDebugDirectoryEntryNode = null; ISymbolDefinitionNode firstImportThunk = null; @@ -238,8 +251,18 @@ public void EmitPortableExecutable() { r2rPeBuilder.AddSections(_mapFileBuilder); - string mapFileName = Path.ChangeExtension(_objectFilePath, ".map"); - _mapFileBuilder.Save(mapFileName); + if (_generateMapFile) + { + string mapFileName = Path.ChangeExtension(_objectFilePath, ".map"); + _mapFileBuilder.SaveMap(mapFileName); + } + + if (_generateMapCsvFile) + { + string nodeStatsCsvFileName = Path.ChangeExtension(_objectFilePath, ".nodestats.csv"); + string mapCsvFileName = Path.ChangeExtension(_objectFilePath, ".map.csv"); + _mapFileBuilder.SaveCsv(nodeStatsCsvFileName, mapCsvFileName); + } } succeeded = true; @@ -299,10 +322,10 @@ private void EmitObjectData(R2RPEBuilder r2rPeBuilder, ObjectData data, int node r2rPeBuilder.AddObjectData(data, section, name, mapFileBuilder); } - public static void EmitObject(string objectFilePath, EcmaModule componentModule, IEnumerable nodes, NodeFactory factory, bool generateMapFile, int? customPESectionAlignment) + public static void EmitObject(string objectFilePath, EcmaModule componentModule, IEnumerable nodes, NodeFactory factory, bool generateMapFile, bool generateMapCsvFile, int customPESectionAlignment) { Console.WriteLine($@"Emitting R2R PE file: {objectFilePath}"); - ReadyToRunObjectWriter objectWriter = new ReadyToRunObjectWriter(objectFilePath, componentModule, nodes, factory, generateMapFile, customPESectionAlignment); + ReadyToRunObjectWriter objectWriter = new ReadyToRunObjectWriter(objectFilePath, componentModule, nodes, factory, generateMapFile, generateMapCsvFile, customPESectionAlignment); objectWriter.EmitPortableExecutable(); } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/CryptographicHashProvider.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/CryptographicHashProvider.cs new file mode 100644 index 000000000000..dafd0c1ae7bb --- /dev/null +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/CryptographicHashProvider.cs @@ -0,0 +1,252 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#nullable enable + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Reflection.Metadata; +using System.Security.Cryptography; + +namespace ILCompiler +{ + /// + /// Specifies a hash algorithms used for hashing source files. + /// + public enum SourceHashAlgorithm + { + /// + /// No algorithm specified. + /// + None = 0, + + /// + /// Secure Hash Algorithm 1. + /// + Sha1 = 1, + + /// + /// Secure Hash Algorithm 2 with a hash size of 256 bits. + /// + Sha256 = 2, + } + + internal static class SourceHashAlgorithmUtils + { + public const SourceHashAlgorithm DefaultContentHashAlgorithm = SourceHashAlgorithm.Sha256; + } + + internal abstract class CryptographicHashProvider + { + private ImmutableArray _lazySHA1Hash; + private ImmutableArray _lazySHA256Hash; + private ImmutableArray _lazySHA384Hash; + private ImmutableArray _lazySHA512Hash; + private ImmutableArray _lazyMD5Hash; + + internal abstract ImmutableArray ComputeHash(HashAlgorithm algorithm); + + internal ImmutableArray GetHash(AssemblyHashAlgorithm algorithmId) + { + using (HashAlgorithm? algorithm = TryGetAlgorithm(algorithmId)) + { + // ERR_CryptoHashFailed has already been reported: + if (algorithm == null) + { + return ImmutableArray.Create(); + } + + switch (algorithmId) + { + case AssemblyHashAlgorithm.None: + case AssemblyHashAlgorithm.Sha1: + return GetHash(ref _lazySHA1Hash, algorithm); + + case AssemblyHashAlgorithm.Sha256: + return GetHash(ref _lazySHA256Hash, algorithm); + + case AssemblyHashAlgorithm.Sha384: + return GetHash(ref _lazySHA384Hash, algorithm); + + case AssemblyHashAlgorithm.Sha512: + return GetHash(ref _lazySHA512Hash, algorithm); + + case AssemblyHashAlgorithm.MD5: + return GetHash(ref _lazyMD5Hash, algorithm); + + default: + throw new ArgumentException("algorithmId"); + } + } + } + + internal static int GetHashSize(SourceHashAlgorithm algorithmId) + { + switch (algorithmId) + { + case SourceHashAlgorithm.Sha1: + return 160 / 8; + + case SourceHashAlgorithm.Sha256: + return 256 / 8; + + default: + throw new ArgumentException("algorithmId"); + } + } + + internal static HashAlgorithm? TryGetAlgorithm(SourceHashAlgorithm algorithmId) + { + switch (algorithmId) + { + case SourceHashAlgorithm.Sha1: + return SHA1.Create(); + + case SourceHashAlgorithm.Sha256: + return SHA256.Create(); + + default: + return null; + } + } + + internal static HashAlgorithmName GetAlgorithmName(SourceHashAlgorithm algorithmId) + { + switch (algorithmId) + { + case SourceHashAlgorithm.Sha1: + return HashAlgorithmName.SHA1; + + case SourceHashAlgorithm.Sha256: + return HashAlgorithmName.SHA256; + + default: + throw new ArgumentException("algorithmId"); + } + } + + internal static HashAlgorithm? TryGetAlgorithm(AssemblyHashAlgorithm algorithmId) + { + switch (algorithmId) + { + case AssemblyHashAlgorithm.None: + case AssemblyHashAlgorithm.Sha1: + return SHA1.Create(); + + case AssemblyHashAlgorithm.Sha256: + return SHA256.Create(); + + case AssemblyHashAlgorithm.Sha384: + return SHA384.Create(); + + case AssemblyHashAlgorithm.Sha512: + return SHA512.Create(); + + case AssemblyHashAlgorithm.MD5: + return MD5.Create(); + + default: + return null; + } + } + + internal static bool IsSupportedAlgorithm(AssemblyHashAlgorithm algorithmId) + { + switch (algorithmId) + { + case AssemblyHashAlgorithm.None: + case AssemblyHashAlgorithm.Sha1: + case AssemblyHashAlgorithm.Sha256: + case AssemblyHashAlgorithm.Sha384: + case AssemblyHashAlgorithm.Sha512: + case AssemblyHashAlgorithm.MD5: + return true; + + default: + return false; + } + } + + private ImmutableArray GetHash(ref ImmutableArray lazyHash, HashAlgorithm algorithm) + { + if (lazyHash.IsDefault) + { + ImmutableInterlocked.InterlockedCompareExchange(ref lazyHash, ComputeHash(algorithm), default(ImmutableArray)); + } + + return lazyHash; + } + + internal const int Sha1HashSize = 20; + + internal static ImmutableArray ComputeSha1(Stream stream) + { + if (stream != null) + { + stream.Seek(0, SeekOrigin.Begin); + using (var hashProvider = SHA1.Create()) + { + return ImmutableArray.Create(hashProvider.ComputeHash(stream)); + } + } + + return ImmutableArray.Empty; + } + + internal static ImmutableArray ComputeSha1(ImmutableArray bytes) + { + return ComputeSha1(bytes.ToArray()); + } + + internal static ImmutableArray ComputeSha1(byte[] bytes) + { + using (var hashProvider = SHA1.Create()) + { + return ImmutableArray.Create(hashProvider.ComputeHash(bytes)); + } + } + + internal static ImmutableArray ComputeHash(HashAlgorithmName algorithmName, IEnumerable bytes) + { + using (var incrementalHash = IncrementalHash.CreateHash(algorithmName)) + { + foreach (var blob in bytes) + { + incrementalHash.AppendData(blob.GetBytes()); + } + return ImmutableArray.Create(incrementalHash.GetHashAndReset()); + } + } + + internal static ImmutableArray ComputeHash(HashAlgorithmName algorithmName, IEnumerable> bytes) + { + using (var incrementalHash = IncrementalHash.CreateHash(algorithmName)) + { + foreach (var segment in bytes) + { + incrementalHash.AppendData(segment); + } + return ImmutableArray.Create(incrementalHash.GetHashAndReset()); + } + } + + internal static ImmutableArray ComputeSourceHash(ImmutableArray bytes, SourceHashAlgorithm hashAlgorithm = SourceHashAlgorithmUtils.DefaultContentHashAlgorithm) + { + var algorithmName = GetAlgorithmName(hashAlgorithm); + using (var incrementalHash = IncrementalHash.CreateHash(algorithmName)) + { + incrementalHash.AppendData(bytes.ToArray()); + return ImmutableArray.Create(incrementalHash.GetHashAndReset()); + } + } + + internal static ImmutableArray ComputeSourceHash(IEnumerable bytes, SourceHashAlgorithm hashAlgorithm = SourceHashAlgorithmUtils.DefaultContentHashAlgorithm) + { + return ComputeHash(GetAlgorithmName(hashAlgorithm), bytes); + } + } +} diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs index 9c56ff338e8a..f5e324e04b6e 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ArgIterator.cs @@ -120,8 +120,19 @@ public CorElementType GetCorElementType() return CorElementType.ELEMENT_TYPE_BYREF; } + Internal.TypeSystem.TypeFlags category; + switch (_type.Context.Target.Architecture) + { + case TargetArchitecture.X86: + category = ((CompilerTypeSystemContext)_type.Context).NormalizedCategoryFor4ByteStructOnX86(_type.UnderlyingType); + break; + + default: + category = _type.UnderlyingType.Category; + break; + } // We use the UnderlyingType to handle Enums properly - return _type.UnderlyingType.Category switch + return category switch { Internal.TypeSystem.TypeFlags.Boolean => CorElementType.ELEMENT_TYPE_BOOLEAN, Internal.TypeSystem.TypeFlags.Char => CorElementType.ELEMENT_TYPE_CHAR, @@ -308,7 +319,7 @@ private int GetStructGenRegDestinationAddress() // fieldBytes - size of the structure internal void ReportPointersFromStructInRegisters(TypeDesc type, int delta, CORCOMPILE_GCREFMAP_TOKENS[] frame) { - // SPAN-TODO: GC reporting - https://github.com/dotnet/coreclr/issues/8517 + // SPAN-TODO: GC reporting - https://github.com/dotnet/runtime/issues/7103 Debug.Assert(IsStructPassedInRegs()); @@ -682,9 +693,9 @@ public int GetParamTypeArgOffset() switch (_paramTypeLoc) { case ParamTypeLocation.Ecx:// PARAM_TYPE_REGISTER_ECX: - return _transitionBlock.OffsetOfArgumentRegisters + OffsetOfEcx; + return _transitionBlock.OffsetOfArgumentRegisters + TransitionBlock.X86Constants.OffsetOfEcx; case ParamTypeLocation.Edx: - return _transitionBlock.OffsetOfArgumentRegisters + OffsetOfEdx; + return _transitionBlock.OffsetOfArgumentRegisters + TransitionBlock.X86Constants.OffsetOfEdx; default: break; } @@ -726,16 +737,22 @@ public int GetNextOffset() if (!_ITERATION_STARTED) { int numRegistersUsed = 0; + +#if PROJECTN || FEATURE_INTERPRETER int initialArgOffset = 0; +#endif if (HasThis) numRegistersUsed++; if (HasRetBuffArg() && _transitionBlock.IsRetBuffPassedAsFirstArg) { +#if PROJECTN if (!_transitionBlock.IsX86) +#endif { numRegistersUsed++; } +#if PROJECTN else { // DESKTOP BEHAVIOR is to do nothing here, as ret buf is never reached by the scan algorithm that walks backwards @@ -743,14 +760,20 @@ public int GetNextOffset() // on the stack) initialArgOffset = _transitionBlock.PointerSize; } +#endif } Debug.Assert(!IsVarArg || !HasParamType); +#if !PROJECTN // DESKTOP BEHAVIOR - This block is disabled for x86 as the param arg is the last argument on .NET Framework x86. - if (HasParamType) + if (!_transitionBlock.IsX86) +#endif { - numRegistersUsed++; + if (HasParamType) + { + numRegistersUsed++; + } } if (!_transitionBlock.IsX86 && IsVarArg) @@ -787,8 +810,11 @@ public int GetNextOffset() } #endif _x86NumRegistersUsed = numRegistersUsed; - // DESKTOP BEHAVIOR _curOfs = (int)(TransitionBlock.GetOffsetOfArgs() + SizeOfArgStack()); +#if PROJECTN _x86CurOfs = (int)(_transitionBlock.OffsetOfArgs + initialArgOffset); +#else + _x86CurOfs = (int)(_transitionBlock.OffsetOfArgs + SizeOfArgStack()); +#endif break; case TargetArchitecture.X64: @@ -862,10 +888,13 @@ public int GetNextOffset() return _transitionBlock.OffsetOfArgumentRegisters + (_transitionBlock.NumArgumentRegisters - _x86NumRegistersUsed) * _transitionBlock.PointerSize; } - // DESKTOP BEHAVIOR _curOfs -= ArchitectureConstants.StackElemSize(argSize); - // DESKTOP BEHAVIOR return _curOfs; +#if PROJECTN argOfs = _x86CurOfs; _x86CurOfs += _transitionBlock.StackElemSize(argSize); +#else + _x86CurOfs -= _transitionBlock.StackElemSize(argSize); + argOfs = _x86CurOfs; +#endif Debug.Assert(argOfs >= _transitionBlock.OffsetOfArgs); return argOfs; @@ -1321,11 +1350,15 @@ private void ForceSigWalk() if (HasRetBuffArg() && _transitionBlock.IsRetBuffPassedAsFirstArg) { - // DESKTOP BEHAVIOR numRegistersUsed++; +#if PROJECTN // On ProjectN ret buff arg is passed on the call stack as the top stack arg nSizeOfArgStack += _transitionBlock.PointerSize; +#else + numRegistersUsed++; +#endif } +#if PROJECTN // DESKTOP BEHAVIOR - This block is disabled for x86 as the param arg is the last argument on .NET Framework x86. if (HasParamType) { @@ -1334,6 +1367,7 @@ private void ForceSigWalk() ParamTypeLocation.Ecx : ParamTypeLocation.Edx; Debug.Assert(numRegistersUsed <= 2); } +#endif if (IsVarArg) { @@ -1380,22 +1414,22 @@ private void ForceSigWalk() } } -#if DESKTOP // DESKTOP BEHAVIOR - if (HasParamType()) +#if !PROJECTN + if (HasParamType) { - if (numRegistersUsed < ArchitectureConstants.NUM_ARGUMENT_REGISTERS) + if (numRegistersUsed < _transitionBlock.NumArgumentRegisters) { numRegistersUsed++; - paramTypeLoc = (numRegistersUsed == 1) ? + _paramTypeLoc = (numRegistersUsed == 1) ? ParamTypeLocation.Ecx : ParamTypeLocation.Edx; } else { nSizeOfArgStack += _transitionBlock.PointerSize; - paramTypeLoc = ParamTypeLocation.Stack; + _paramTypeLoc = ParamTypeLocation.Stack; } } -#endif // DESKTOP BEHAVIOR +#endif } else { @@ -1654,8 +1688,6 @@ private enum ParamTypeLocation Ecx, Edx } - private const int OffsetOfEcx = 0 * sizeof(int); - private const int OffsetOfEdx = 1 * sizeof(int); private ParamTypeLocation _paramTypeLoc; /* X86: PARAM_TYPE_REGISTER_MASK = 0x0030, diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs index 08093ecd3671..175025449039 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DebugDirectoryNode.cs @@ -26,10 +26,12 @@ public class DebugDirectoryNode : ObjectNode, ISymbolDefinitionNode private EcmaModule _module; private NativeDebugDirectoryEntryNode _nativeEntry; + private bool _insertDeterministicEntry; public DebugDirectoryNode(EcmaModule sourceModule, string outputFileName) { _module = sourceModule; + _insertDeterministicEntry = sourceModule == null; // Mark module as deterministic if generating composite image string pdbNameRoot = Path.GetFileNameWithoutExtension(outputFileName); if (sourceModule != null) { @@ -50,7 +52,7 @@ public DebugDirectoryNode(EcmaModule sourceModule, string outputFileName) public int Offset => 0; - public int Size => (GetNumDebugDirectoryEntriesInModule() + 1) * ImageDebugDirectorySize; + public int Size => (GetNumDebugDirectoryEntriesInModule() + 1 + (_insertDeterministicEntry ? 1 : 0)) * ImageDebugDirectorySize; public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { @@ -112,8 +114,21 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) builder.EmitReloc(entry, RelocType.IMAGE_REL_FILE_ABSOLUTE); } + // If generating a composite image, emit the deterministic marker + if (_insertDeterministicEntry) + { + builder.EmitUInt(0 /* Characteristics */); + builder.EmitUInt(0); + builder.EmitUShort(0); + builder.EmitUShort(0); + builder.EmitInt((int)DebugDirectoryEntryType.Reproducible); + builder.EmitInt(0); + builder.EmitUInt(0); + builder.EmitUInt(0); + } + // Second, copy existing entries from input module - for(int i = 0; i < numEntries; i++) + for (int i = 0; i < numEntries; i++) { builder.EmitUInt(0 /* Characteristics */); builder.EmitUInt(entries[i].Stamp); diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs index b0463ee3de8b..e450f816b666 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs @@ -1,6 +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.Collections.Generic; diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs index 5c2650c52616..c9863573cf65 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelegateCtorSignature.cs @@ -14,12 +14,12 @@ public class DelegateCtorSignature : Signature private readonly IMethodNode _targetMethod; - private readonly ModuleToken _methodToken; + private readonly MethodWithToken _methodToken; public DelegateCtorSignature( TypeDesc delegateType, IMethodNode targetMethod, - ModuleToken methodToken) + MethodWithToken methodToken) { _delegateType = delegateType; _targetMethod = targetMethod; @@ -40,10 +40,10 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) if (!relocsOnly) { - SignatureContext innerContext = builder.EmitFixup(factory, ReadyToRunFixupKind.DelegateCtor, _methodToken.Module, factory.SignatureContext); + SignatureContext innerContext = builder.EmitFixup(factory, ReadyToRunFixupKind.DelegateCtor, _methodToken.Token.Module, factory.SignatureContext); builder.EmitMethodSignature( - new MethodWithToken(_targetMethod.Method, _methodToken, constrainedType: null, unboxing: false), + _methodToken, enforceDefEncoding: false, enforceOwningType: false, innerContext, @@ -88,7 +88,7 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer if (result != 0) return result; - return _methodToken.CompareTo(otherNode._methodToken); + return _methodToken.CompareTo(otherNode._methodToken, comparer); } } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExceptionInfoLookupTableNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExceptionInfoLookupTableNode.cs index d340b62e6dca..4fa4e5e0297d 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExceptionInfoLookupTableNode.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ExceptionInfoLookupTableNode.cs @@ -48,7 +48,7 @@ public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { - return new ObjectData(_ehInfoBuilder.ToArray(), Array.Empty(), alignment: 1, definedSymbols: new ISymbolDefinitionNode[] { this }); + return new ObjectData(_ehInfoBuilder.ToArray(), Array.Empty(), alignment: 4, definedSymbols: new ISymbolDefinitionNode[] { this }); } protected override string GetName(NodeFactory context) diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs index ebeb537f5f15..62b5f5ce8c18 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/FieldFixupSignature.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics; using Internal.JitInterface; using Internal.Text; @@ -13,17 +14,19 @@ namespace ILCompiler.DependencyAnalysis.ReadyToRun { public class FieldFixupSignature : Signature { + public const int MaxCheckableOffset = 0x1FFFFFFF; private readonly ReadyToRunFixupKind _fixupKind; private readonly FieldDesc _fieldDesc; - public FieldFixupSignature(ReadyToRunFixupKind fixupKind, FieldDesc fieldDesc) + public FieldFixupSignature(ReadyToRunFixupKind fixupKind, FieldDesc fieldDesc, NodeFactory factory) { _fixupKind = fixupKind; _fieldDesc = fieldDesc; // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature ((CompilerTypeSystemContext)fieldDesc.Context).EnsureLoadableType(fieldDesc.OwningType); + Debug.Assert(factory.SignatureContext.GetTargetModule(_fieldDesc) != null); } public override int ClassCode => 271828182; @@ -43,7 +46,9 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { TypeDesc baseType = _fieldDesc.OwningType.BaseType; if ((_fieldDesc.OwningType.BaseType != null) && !_fieldDesc.IsStatic && !_fieldDesc.OwningType.IsValueType) - dataBuilder.EmitUInt((uint)_fieldDesc.OwningType.BaseType.InstanceByteCount.AsInt); + { + dataBuilder.EmitUInt((uint)_fieldDesc.OwningType.FieldBaseOffset().AsInt); + } else dataBuilder.EmitUInt(0); } @@ -63,7 +68,8 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { sb.Append(nameMangler.CompilationUnitPrefix); - sb.Append($@"TypeFixupSignature({_fixupKind.ToString()}): {_fieldDesc.ToString()}"); + sb.Append($@"FieldFixupSignature({_fixupKind.ToString()}): "); + sb.Append(nameMangler.GetMangledFieldName(_fieldDesc)); } public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs index 624f464e7ea2..fb6b4f9a2b89 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs @@ -79,6 +79,15 @@ public void GetCallRefMap(MethodDesc method, bool isUnboxingStub) } CallingConventions callingConventions = (hasThis ? CallingConventions.ManagedInstance : CallingConventions.ManagedStatic); bool hasParamType = method.RequiresInstArg() && !isUnboxingStub; + + // On X86 the Array address method doesn't use IL stubs, and instead has a custom calling convention + if ((method.Context.Target.Architecture == TargetArchitecture.X86) && + (method.IsArrayAddressMethod()) && + method.OwningType.ConvertToCanonForm(CanonicalFormKind.Specific).IsCanonicalSubtype(CanonicalFormKind.Any)) + { + hasParamType = true; + } + bool extraFunctionPointerArg = false; bool[] forcedByRefParams = new bool[parameterTypes.Length]; bool skipFirstArg = false; diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs index 5ff1eeccad72..72102d606ad6 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics; using Internal.Runtime; using Internal.Text; @@ -120,6 +121,13 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) if (!relocsOnly && item.Node is ObjectNode on && on.ShouldSkipEmittingObjectNode(factory)) continue; + // Unmarked nodes are not part of the graph + if (!item.Node.Marked && !(item.Node is ObjectNode)) + { + Debug.Assert(item.Node is DelayLoadMethodCallThunkNodeRange); + continue; + } + builder.EmitInt((int)item.Id); builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_BASED_ADDR32NB); diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportThunk.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportThunk.cs index 7b5d1b4bdbd6..23e5f0a4ff7a 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportThunk.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/ImportThunk.cs @@ -3,6 +3,7 @@ using Internal.Text; using Internal.ReadyToRunConstants; +using System.Diagnostics; namespace ILCompiler.DependencyAnalysis.ReadyToRun { @@ -83,5 +84,13 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer return comparer.Compare(_instanceCell, otherNode._instanceCell); } + + protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory) + { + Debug.Assert(base.ComputeNonRelocationBasedDependencies(factory) == null); + DependencyList dependencies = new DependencyList(); + dependencies.Add(factory.DelayLoadMethodCallThunks, "MethodCallThunksList"); + return dependencies; + } } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs index e337c0ea7120..03ccc73b7343 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/InstanceEntryPointTableNode.cs @@ -61,7 +61,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) ArraySignatureBuilder signatureBuilder = new ArraySignatureBuilder(); signatureBuilder.EmitMethodSignature( - new MethodWithToken(method.Method, moduleToken, constrainedType: null, unboxing: false), + new MethodWithToken(method.Method, moduleToken, constrainedType: null, unboxing: false, context: null), enforceDefEncoding: true, enforceOwningType: _factory.CompilationModuleGroup.EnforceOwningType(moduleToken.Module), factory.SignatureContext, diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs index 6c07ad33df00..eaeddd907ea5 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodFixupSignature.cs @@ -2,6 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics; +using System.Reflection.Metadata; +using System.Reflection.Metadata.Ecma335; using Internal.JitInterface; using Internal.Text; @@ -32,6 +35,8 @@ public MethodFixupSignature( // Ensure types in signature are loadable and resolvable, otherwise we'll fail later while emitting the signature CompilerTypeSystemContext compilerContext = (CompilerTypeSystemContext)method.Method.Context; compilerContext.EnsureLoadableMethod(method.Method); + compilerContext.EnsureLoadableType(_method.OwningType); + if (method.ConstrainedType != null) compilerContext.EnsureLoadableType(method.ConstrainedType); } @@ -59,7 +64,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) if (!_method.Unboxing && !_isInstantiatingStub && _method.ConstrainedType == null && fixupKind == ReadyToRunFixupKind.MethodEntry) { - if (!_method.Method.OwningType.HasInstantiation && !_method.Method.OwningType.IsArray) + if (!_method.Method.HasInstantiation && !_method.Method.OwningType.HasInstantiation && !_method.Method.OwningType.IsArray) { if (_method.Token.TokenType == CorTokenType.mdtMethodDef) { @@ -68,8 +73,11 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) } else if (_method.Token.TokenType == CorTokenType.mdtMemberRef) { - fixupKind = ReadyToRunFixupKind.MethodEntry_RefToken; - optimized = true; + if (!_method.OwningTypeNotDerivedFromToken) + { + fixupKind = ReadyToRunFixupKind.MethodEntry_RefToken; + optimized = true; + } } } } @@ -80,13 +88,13 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) { if (method.Token.TokenType == CorTokenType.mdtMethodSpec) { - method = new MethodWithToken(method.Method, factory.SignatureContext.GetModuleTokenForMethod(method.Method, throwIfNotFound: false), method.ConstrainedType, unboxing: _method.Unboxing); + method = new MethodWithToken(method.Method, factory.SignatureContext.GetModuleTokenForMethod(method.Method, throwIfNotFound: false), method.ConstrainedType, unboxing: _method.Unboxing, null); } else if (!optimized && (method.Token.TokenType == CorTokenType.mdtMemberRef)) { if (method.Method.OwningType.GetTypeDefinition() is EcmaType) { - method = new MethodWithToken(method.Method, factory.SignatureContext.GetModuleTokenForMethod(method.Method, throwIfNotFound: false), method.ConstrainedType, unboxing: _method.Unboxing); + method = new MethodWithToken(method.Method, factory.SignatureContext.GetModuleTokenForMethod(method.Method, throwIfNotFound: false), method.ConstrainedType, unboxing: _method.Unboxing, null); } } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodGCInfoNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodGCInfoNode.cs index 18f7a17d84fa..8af04297293f 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodGCInfoNode.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodGCInfoNode.cs @@ -90,7 +90,13 @@ public override void EncodeData(ref ObjectDataBuilder dataBuilder, NodeFactory f { bool isFilterFunclet = (_methodNode.FrameInfos[frameInfoIndex].Flags & FrameInfoFlags.Filter) != 0; ISymbolNode personalityRoutine = (isFilterFunclet ? factory.FilterFuncletPersonalityRoutine : factory.PersonalityRoutine); - dataBuilder.EmitReloc(personalityRoutine, RelocType.IMAGE_REL_BASED_ADDR32NB); + int codeDelta = 0; + if (targetArch == TargetArchitecture.ARM) + { + // THUMB_CODE + codeDelta = 1; + } + dataBuilder.EmitReloc(personalityRoutine, RelocType.IMAGE_REL_BASED_ADDR32NB, codeDelta); } if (frameInfoIndex == 0 && _methodNode.GCInfo != null) diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureBuilder.cs index 54b9849aed8c..a91aecaa25e4 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureBuilder.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/SignatureBuilder.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Reflection.Metadata; +using System.Reflection.Metadata.Ecma335; using Internal.TypeSystem; using Internal.TypeSystem.Ecma; @@ -411,55 +412,12 @@ public void EmitMethodSignature( { flags |= (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_Constrained; } - if (enforceOwningType) + if (enforceOwningType || method.OwningTypeNotDerivedFromToken) { flags |= (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_OwnerType; } - if ((method.Method.HasInstantiation || method.Method.OwningType.HasInstantiation) && !method.Method.IsGenericMethodDefinition) - { - EmitMethodSpecificationSignature(method, flags, enforceDefEncoding, context); - } - else - { - switch (method.Token.TokenType) - { - case CorTokenType.mdtMethodDef: - { - EmitUInt(flags); - if ((flags & (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_OwnerType) != 0) - { - EmitTypeSignature(method.Method.OwningType, context); - } - EmitMethodDefToken(method.Token); - } - break; - - case CorTokenType.mdtMemberRef: - { - flags |= (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_MemberRefToken; - - // Owner type is needed for type specs to instantiating stubs or generics with signature variables still present - if (!method.Method.OwningType.IsDefType && - ((flags & (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_InstantiatingStub) != 0 || method.Method.OwningType.ContainsSignatureVariables()) - || method.Method.IsArrayAddressMethod()) - { - flags |= (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_OwnerType; - } - - EmitUInt(flags); - if ((flags & (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_OwnerType) != 0) - { - EmitTypeSignature(method.Method.OwningType, context); - } - EmitMethodRefToken(method.Token); - } - break; - - default: - throw new NotImplementedException(); - } - } + EmitMethodSpecificationSignature(method, flags, enforceDefEncoding, context); if (method.ConstrainedType != null) { @@ -483,7 +441,7 @@ private void EmitMethodSpecificationSignature(MethodWithToken method, uint flags, bool enforceDefEncoding, SignatureContext context) { ModuleToken methodToken = method.Token; - if (method.Method.HasInstantiation) + if (method.Method.HasInstantiation && !method.Method.IsGenericMethodDefinition) { flags |= (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_MethodInstantiation; if (!method.Token.IsNull) @@ -496,23 +454,7 @@ private void EmitMethodSpecificationSignature(MethodWithToken method, } } - if (methodToken.IsNull && !enforceDefEncoding) - { - methodToken = context.GetModuleTokenForMethod(method.Method, throwIfNotFound: false); - } - if (methodToken.IsNull) - { - flags |= (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_OwnerType; - methodToken = context.GetModuleTokenForMethod(method.Method); - } - - if (method.Method.OwningType.HasInstantiation) - { - // resolveToken currently resolves the token in the context of a given scope; - // in such case, we receive a method on instantiated type along with the - // generic definition token. - flags |= (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_OwnerType; - } + Debug.Assert(!methodToken.IsNull); switch (methodToken.TokenType) { @@ -530,7 +472,8 @@ private void EmitMethodSpecificationSignature(MethodWithToken method, EmitUInt(flags); if ((flags & (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_OwnerType) != 0) { - EmitTypeSignature(method.Method.OwningType, context); + // The type here should be the type referred to by the memberref (if this is one, not the type where the method was eventually found! + EmitTypeSignature(method.OwningType, context); } EmitTokenRid(methodToken.Token); if ((flags & (uint)ReadyToRunMethodSigFlags.READYTORUN_METHOD_SIG_MethodInstantiation) != 0) diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs index e698e54ad58f..fac7217077b8 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TransitionBlock.cs @@ -183,7 +183,7 @@ public bool IsArgumentInRegister(ref int pNumRegistersUsed, CorElementType typ, case CorElementType.ELEMENT_TYPE_SZARRAY: pNumRegistersUsed++; return true; - +#if PROJECTN case CorElementType.ELEMENT_TYPE_VALUETYPE: { // On ProjectN valuetypes of integral size are passed enregistered @@ -198,6 +198,7 @@ public bool IsArgumentInRegister(ref int pNumRegistersUsed, CorElementType typ, } break; } +#endif } } @@ -334,6 +335,12 @@ public void ComputeReturnValueTreatment(CorElementType type, TypeHandle thRetTyp public const int InvalidOffset = -1; + public sealed class X86Constants + { + public const int OffsetOfEcx = 1 * sizeof(int); + public const int OffsetOfEdx = 0 * sizeof(int); + } + private sealed class X86TransitionBlock : TransitionBlock { public static TransitionBlock Instance = new X86TransitionBlock(); @@ -350,7 +357,7 @@ private sealed class X86TransitionBlock : TransitionBlock // CALLDESCR_FPARGREGS is not set for X86 public override int OffsetOfFloatArgumentRegisters => 0; // offsetof(ArgumentRegisters.ECX) - public override int ThisOffset => 4; + public override int ThisOffset => X86Constants.OffsetOfEcx; public override int EnregisteredParamTypeMaxSize => 0; public override int EnregisteredReturnTypeIntegerMaxSize => 4; @@ -366,11 +373,19 @@ public override int OffsetFromGCRefMapPos(int pos) } } + public override bool IsArgPassedByRef(TypeHandle th) => false; + /// /// x86 is special as always - /// DESKTOP BEHAVIOR ret += this.HasThis() ? ArgumentRegisters.GetOffsetOfEdx() : ArgumentRegisters.GetOffsetOfEcx(); /// - public override int GetRetBuffArgOffset(bool hasThis) => OffsetOfArgs; + public override int GetRetBuffArgOffset(bool hasThis) + { +#if PROJECTN + return OffsetOfArgs; +#else + return hasThis ? X86Constants.OffsetOfEdx : X86Constants.OffsetOfEcx; +#endif + } } public const int SizeOfM128A = 16; diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs index 0bc86c7794cb..87295b01d3d2 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/TypeFixupSignature.cs @@ -59,7 +59,7 @@ private static void EncodeTypeLayout(ObjectDataSignatureBuilder dataBuilder, Typ int pointerSize = type.Context.Target.PointerSize; int size = defType.InstanceFieldSize.AsInt; - int alignment = GetClassAlignmentRequirement(defType); + int alignment = Internal.JitInterface.CorInfoImpl.GetClassAlignmentRequirementStatic(defType); ReadyToRunTypeLayoutFlags flags = ReadyToRunTypeLayoutFlags.READYTORUN_LAYOUT_Alignment | ReadyToRunTypeLayoutFlags.READYTORUN_LAYOUT_GCLayout; if (alignment == pointerSize) { @@ -81,16 +81,16 @@ private static void EncodeTypeLayout(ObjectDataSignatureBuilder dataBuilder, Typ if (defType.IsHomogeneousAggregate) { - CorElementType elementType = (defType.ValueTypeShapeCharacteristics & ValueTypeShapeCharacteristics.AggregateMask) switch + ReadyToRunHFAElemType hfaElementType = (defType.ValueTypeShapeCharacteristics & ValueTypeShapeCharacteristics.AggregateMask) switch { - ValueTypeShapeCharacteristics.Float32Aggregate => CorElementType.ELEMENT_TYPE_R4, - ValueTypeShapeCharacteristics.Float64Aggregate => CorElementType.ELEMENT_TYPE_R8, - ValueTypeShapeCharacteristics.Vector64Aggregate => CorElementType.ELEMENT_TYPE_R8, + ValueTypeShapeCharacteristics.Float32Aggregate => ReadyToRunHFAElemType.Float32, + ValueTypeShapeCharacteristics.Float64Aggregate => ReadyToRunHFAElemType.Float64, + ValueTypeShapeCharacteristics.Vector64Aggregate => ReadyToRunHFAElemType.Vector64, // See MethodTable::GetHFAType - ValueTypeShapeCharacteristics.Vector128Aggregate => CorElementType.ELEMENT_TYPE_VALUETYPE, - _ => CorElementType.Invalid + ValueTypeShapeCharacteristics.Vector128Aggregate => ReadyToRunHFAElemType.Vector128, + _ => throw new NotSupportedException() }; - dataBuilder.EmitUInt((uint)elementType); + dataBuilder.EmitUInt((uint)hfaElementType); } if (alignment != pointerSize) @@ -119,37 +119,6 @@ private static void EncodeTypeLayout(ObjectDataSignatureBuilder dataBuilder, Typ } } - /// - /// Managed implementation of CEEInfo::getClassAlignmentRequirementStatic - /// - private static int GetClassAlignmentRequirement(MetadataType type) - { - int alignment = type.Context.Target.PointerSize; - - if (type.HasLayout()) - { - if (type.IsSequentialLayout || MarshalUtils.IsBlittableType(type)) - { - alignment = type.InstanceFieldAlignment.AsInt; - } - } - - if (type.Context.Target.Architecture == TargetArchitecture.ARM && - alignment < 8 && type.RequiresAlign8()) - { - // If the structure contains 64-bit primitive fields and the platform requires 8-byte alignment for - // such fields then make sure we return at least 8-byte alignment. Note that it's technically possible - // to create unmanaged APIs that take unaligned structures containing such fields and this - // unconditional alignment bump would cause us to get the calling convention wrong on platforms such - // as ARM. If we see such cases in the future we'd need to add another control (such as an alignment - // property for the StructLayout attribute or a marshaling directive attribute for p/invoke arguments) - // that allows more precise control. For now we'll go with the likely scenario. - alignment = 8; - } - - return alignment; - } - public override void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) { sb.Append(nameMangler.CompilationUnitPrefix); diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs index 9f9ebf936628..cf1e452041c3 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs @@ -396,7 +396,7 @@ public IEnumerable EnumerateCompiledMethods(EcmaModule moduleT EcmaModule module = ((EcmaMethod)method.GetTypicalMethodDefinition()).Module; ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true); - IMethodNode methodNodeDebug = MethodEntrypoint(new MethodWithToken(method, moduleToken, constrainedType: null, unboxing: false), false, false); + IMethodNode methodNodeDebug = MethodEntrypoint(new MethodWithToken(method, moduleToken, constrainedType: null, unboxing: false, context: null), false, false); MethodWithGCInfo methodCodeNodeDebug = methodNodeDebug as MethodWithGCInfo; if (methodCodeNodeDebug == null && methodNodeDebug is DelayLoadMethodImport DelayLoadMethodImport) { diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs index 7ae68230d8a6..539d4404ebca 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs @@ -70,7 +70,7 @@ private void CreateNodeCaches() _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper, - new FieldFixupSignature(ReadyToRunFixupKind.FieldAddress, key) + new FieldFixupSignature(ReadyToRunFixupKind.FieldAddress, key, _codegenNodeFactory) ); }); @@ -78,7 +78,7 @@ private void CreateNodeCaches() { return new PrecodeHelperImport( _codegenNodeFactory, - new FieldFixupSignature(ReadyToRunFixupKind.FieldOffset, key) + new FieldFixupSignature(ReadyToRunFixupKind.FieldOffset, key, _codegenNodeFactory) ); }); @@ -94,7 +94,7 @@ private void CreateNodeCaches() { return new PrecodeHelperImport( _codegenNodeFactory, - new FieldFixupSignature(_verifyTypeAndFieldLayout ? ReadyToRunFixupKind.Verify_FieldOffset : ReadyToRunFixupKind.Check_FieldOffset, key) + new FieldFixupSignature(_verifyTypeAndFieldLayout ? ReadyToRunFixupKind.Verify_FieldOffset : ReadyToRunFixupKind.Check_FieldOffset, key, _codegenNodeFactory) ); }); @@ -124,7 +124,7 @@ private void CreateNodeCaches() _codegenNodeFactory, _codegenNodeFactory.HelperImports, ReadyToRunHelper.DelayLoad_Helper_ObjObj, - new DelegateCtorSignature(ctorKey.Type, targetMethodNode, ctorKey.Method.Token)); + new DelegateCtorSignature(ctorKey.Type, targetMethodNode, ctorKey.Method)); }); _checkTypeLayoutCache = new NodeCache(key => @@ -356,7 +356,7 @@ private ISymbolNode CreateFieldHandleHelper(FieldDesc field) { return new PrecodeHelperImport( _codegenNodeFactory, - new FieldFixupSignature(ReadyToRunFixupKind.FieldHandle, field)); + new FieldFixupSignature(ReadyToRunFixupKind.FieldHandle, field, _codegenNodeFactory)); } private ISymbolNode CreateCctorTrigger(TypeDesc type) diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs index d7d134ac77bd..79888b3e89a9 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs @@ -2,6 +2,7 @@ // 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.IO; @@ -12,6 +13,7 @@ using Internal.IL; using Internal.IL.Stubs; using Internal.JitInterface; +using Internal.ReadyToRunConstants; using Internal.TypeSystem; using ILCompiler.DependencyAnalysis; @@ -228,13 +230,19 @@ public sealed class ReadyToRunCodegenCompilation : Compilation private int _parallelism; private bool _generateMapFile; + private bool _generateMapCsvFile; private ProfileDataManager _profileData; private ReadyToRunFileLayoutOptimizer _fileLayoutOptimizer; public ReadyToRunSymbolNodeFactory SymbolNodeFactory { get; } public ReadyToRunCompilationModuleGroupBase CompilationModuleGroup { get; } - private readonly int? _customPESectionAlignment; + private readonly int _customPESectionAlignment; + /// + /// Determining whether a type's layout is fixed is a little expensive and the question can be asked many times + /// for the same type during compilation so preserve the computed value. + /// + private ConcurrentDictionary _computedFixedLayoutTypes = new ConcurrentDictionary(); internal ReadyToRunCodegenCompilation( DependencyAnalyzerBase dependencyGraph, @@ -248,11 +256,12 @@ internal ReadyToRunCodegenCompilation( InstructionSetSupport instructionSetSupport, bool resilient, bool generateMapFile, + bool generateMapCsvFile, int parallelism, ProfileDataManager profileData, ReadyToRunMethodLayoutAlgorithm methodLayoutAlgorithm, ReadyToRunFileLayoutAlgorithm fileLayoutAlgorithm, - int? customPESectionAlignment, + int customPESectionAlignment, bool verifyTypeAndFieldLayout) : base( dependencyGraph, @@ -267,6 +276,7 @@ internal ReadyToRunCodegenCompilation( _resilient = resilient; _parallelism = parallelism; _generateMapFile = generateMapFile; + _generateMapCsvFile = generateMapCsvFile; _customPESectionAlignment = customPESectionAlignment; SymbolNodeFactory = new ReadyToRunSymbolNodeFactory(nodeFactory, verifyTypeAndFieldLayout); _corInfoImpls = new ConditionalWeakTable(); @@ -297,7 +307,7 @@ public override void Compile(string outputFile) using (PerfEventSource.StartStopEvents.EmittingEvents()) { NodeFactory.SetMarkingComplete(); - ReadyToRunObjectWriter.EmitObject(outputFile, componentModule: null, nodes, NodeFactory, _generateMapFile, _customPESectionAlignment); + ReadyToRunObjectWriter.EmitObject(outputFile, componentModule: null, nodes, NodeFactory, _generateMapFile, _generateMapCsvFile, _customPESectionAlignment); CompilationModuleGroup moduleGroup = _nodeFactory.CompilationModuleGroup; if (moduleGroup.IsCompositeBuildMode) @@ -328,6 +338,15 @@ private void RewriteComponentFile(string inputFile, string outputFile, string ow Directory.CreateDirectory(Path.GetDirectoryName(outputFile)); + ReadyToRunFlags flags = + ReadyToRunFlags.READYTORUN_FLAG_Component | + ReadyToRunFlags.READYTORUN_FLAG_NonSharedPInvokeStubs; + + if (inputModule.IsPlatformNeutral) + { + flags |= ReadyToRunFlags.READYTORUN_FLAG_PlatformNeutralSource; + } + CopiedCorHeaderNode copiedCorHeader = new CopiedCorHeaderNode(inputModule); DebugDirectoryNode debugDirectory = new DebugDirectoryNode(inputModule, outputFile); NodeFactory componentFactory = new NodeFactory( @@ -337,8 +356,7 @@ private void RewriteComponentFile(string inputFile, string outputFile, string ow copiedCorHeader, debugDirectory, win32Resources: new Win32Resources.ResourceData(inputModule), - Internal.ReadyToRunConstants.ReadyToRunFlags.READYTORUN_FLAG_Component | - Internal.ReadyToRunConstants.ReadyToRunFlags.READYTORUN_FLAG_NonSharedPInvokeStubs); + flags); IComparer> comparer = new SortableDependencyNode.ObjectNodeComparer(new CompilerComparer()); DependencyAnalyzerBase componentGraph = new DependencyAnalyzer, NodeFactory>(componentFactory, comparer); @@ -354,7 +372,7 @@ private void RewriteComponentFile(string inputFile, string outputFile, string ow } componentGraph.ComputeMarkedNodes(); componentFactory.Header.Add(Internal.Runtime.ReadyToRunSectionType.OwnerCompositeExecutable, ownerExecutableNode, ownerExecutableNode); - ReadyToRunObjectWriter.EmitObject(outputFile, componentModule: inputModule, componentGraph.MarkedNodeList, componentFactory, generateMapFile: false, customPESectionAlignment: null); + ReadyToRunObjectWriter.EmitObject(outputFile, componentModule: inputModule, componentGraph.MarkedNodeList, componentFactory, generateMapFile: false, generateMapCsvFile: false, customPESectionAlignment: 0); } public override void WriteDependencyLog(string outputFileName) @@ -366,7 +384,7 @@ public override void WriteDependencyLog(string outputFileName) } } - public bool IsLayoutFixedInCurrentVersionBubble(TypeDesc type) + private bool IsLayoutFixedInCurrentVersionBubbleInternal(TypeDesc type) { // Primitive types and enums have fixed layout if (type.IsPrimitive || type.IsEnum) @@ -414,6 +432,9 @@ public bool IsLayoutFixedInCurrentVersionBubble(TypeDesc type) return true; } + public bool IsLayoutFixedInCurrentVersionBubble(TypeDesc type) => + _computedFixedLayoutTypes.GetOrAdd(type, (t) => IsLayoutFixedInCurrentVersionBubbleInternal(t)); + public bool IsInheritanceChainLayoutFixedInCurrentVersionBubble(TypeDesc type) { // This method is not expected to be called for value types @@ -458,11 +479,7 @@ protected override void ComputeDependencyNodeDependencies(List + Action> compileOneMethod = (DependencyNodeCore dependency) => { MethodWithGCInfo methodCodeNodeNeedingCode = dependency as MethodWithGCInfo; MethodDesc method = methodCodeNodeNeedingCode.Method; @@ -477,6 +494,8 @@ protected override void ComputeDependencyNodeDependencies(List new CorInfoImpl(this)); corInfoImpl.CompileMethod(methodCodeNodeNeedingCode); } @@ -497,7 +516,23 @@ protected override void ComputeDependencyNodeDependencies(List 1000) diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs index 61b92c8b8b9e..f9c8c1cf16d2 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilationBuilder.cs @@ -23,12 +23,13 @@ public sealed class ReadyToRunCodegenCompilationBuilder : CompilationBuilder private bool _ibcTuning; private bool _resilient; private bool _generateMapFile; + private bool _generateMapCsvFile; private int _parallelism; private InstructionSetSupport _instructionSetSupport; private ProfileDataManager _profileData; private ReadyToRunMethodLayoutAlgorithm _r2rMethodLayoutAlgorithm; private ReadyToRunFileLayoutAlgorithm _r2rFileLayoutAlgorithm; - private int? _customPESectionAlignment; + private int _customPESectionAlignment; private bool _verifyTypeAndFieldLayout; private string _jitPath; @@ -73,6 +74,9 @@ public override CompilationBuilder UseBackendOptions(IEnumerable options builder.Add(new KeyValuePair(name, value)); } + // As we always use an AltJit to compile, tell the jit to always generate code + builder.Add(new KeyValuePair("AltJitNgen", "*")); + _ryujitOptions = builder.ToArray(); return this; @@ -89,9 +93,9 @@ protected override ILProvider GetILProvider() return _ilProvider; } - public ReadyToRunCodegenCompilationBuilder UseJitPath(FileInfo jitPath) + public ReadyToRunCodegenCompilationBuilder UseJitPath(string jitPath) { - _jitPath = jitPath == null ? null : jitPath.FullName; + _jitPath = jitPath; return this; } @@ -126,6 +130,12 @@ public ReadyToRunCodegenCompilationBuilder UseMapFile(bool generateMapFile) return this; } + public ReadyToRunCodegenCompilationBuilder UseMapCsvFile(bool generateMapCsvFile) + { + _generateMapCsvFile = generateMapCsvFile; + return this; + } + public ReadyToRunCodegenCompilationBuilder UseParallelism(int parallelism) { _parallelism = parallelism; @@ -144,7 +154,7 @@ public ReadyToRunCodegenCompilationBuilder GenerateOutputFile(string outputFile) return this; } - public ReadyToRunCodegenCompilationBuilder UseCustomPESectionAlignment(int? customPESectionAlignment) + public ReadyToRunCodegenCompilationBuilder UseCustomPESectionAlignment(int customPESectionAlignment) { _customPESectionAlignment = customPESectionAlignment; return this; @@ -240,6 +250,7 @@ public override ICompilation ToCompilation() _instructionSetSupport, _resilient, _generateMapFile, + _generateMapCsvFile, _parallelism, _profileData, _r2rMethodLayoutAlgorithm, diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs index 2e0a760e9725..2106e15d1162 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilationModuleGroupBase.cs @@ -333,6 +333,12 @@ public sealed override bool GeneratesPInvoke(MethodDesc method) Debug.Assert(method is EcmaMethod); + if (method.Context.Target.Architecture == TargetArchitecture.X86) + { + // X86 architecture does not yet support inline pinvokes + return false; + } + // If the PInvoke is declared on an external module, we can only compile it if // that module is part of the version bubble. if (!_versionBubbleModuleSet.Contains(((EcmaMethod)method).Module)) diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs index 0f7fc68f0794..86b179a0264a 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs @@ -17,6 +17,70 @@ public CompilerTypeSystemContext(TargetDetails details, SharedGenericsMode gener { _genericsMode = genericsMode; } + + private object _normalizedLock = new object(); + private HashSet _nonNormalizedTypes = new HashSet(); + private Dictionary _normalizedTypeCategory = new Dictionary(); + + public TypeFlags NormalizedCategoryFor4ByteStructOnX86(TypeDesc type) + { + // Fast early out for cases which don't need normalization + var typeCategory = type.Category; + + if (((typeCategory != TypeFlags.ValueType) && (typeCategory != TypeFlags.Enum)) || (type.GetElementSize().AsInt != 4)) + { + return typeCategory; + } + + lock(_normalizedLock) + { + if (_nonNormalizedTypes.Contains(type)) + return typeCategory; + + if (_normalizedTypeCategory.TryGetValue(type, out TypeFlags category)) + return category; + + if (Target.Architecture != TargetArchitecture.X86) + { + throw new NotSupportedException(); + } + + TypeDesc typeOfEmbeddedField = null; + foreach (var field in type.GetFields()) + { + if (field.IsStatic) + continue; + if (typeOfEmbeddedField != null) + { + // Type has more than one instance field + _nonNormalizedTypes.Add(type); + return typeCategory; + } + + typeOfEmbeddedField = field.FieldType; + } + + if ((typeOfEmbeddedField != null) && ((typeOfEmbeddedField.IsValueType) || (typeOfEmbeddedField.IsPointer))) + { + TypeFlags singleElementFieldType = NormalizedCategoryFor4ByteStructOnX86(typeOfEmbeddedField); + if (singleElementFieldType == TypeFlags.Pointer) + singleElementFieldType = TypeFlags.UIntPtr; + + switch (singleElementFieldType) + { + case TypeFlags.IntPtr: + case TypeFlags.UIntPtr: + case TypeFlags.Int32: + case TypeFlags.UInt32: + _normalizedTypeCategory.Add(type, singleElementFieldType); + return singleElementFieldType; + } + } + + _nonNormalizedTypes.Add(type); + return typeCategory; + } + } } public partial class ReadyToRunCompilerContext : CompilerTypeSystemContext @@ -26,12 +90,14 @@ public partial class ReadyToRunCompilerContext : CompilerTypeSystemContext private VectorOfTFieldLayoutAlgorithm _vectorOfTFieldLayoutAlgorithm; private VectorFieldLayoutAlgorithm _vectorFieldLayoutAlgorithm; - public ReadyToRunCompilerContext(TargetDetails details, SharedGenericsMode genericsMode) + public ReadyToRunCompilerContext(TargetDetails details, SharedGenericsMode genericsMode, bool bubbleIncludesCorelib) : base(details, genericsMode) { _r2rFieldLayoutAlgorithm = new ReadyToRunMetadataFieldLayoutAlgorithm(); _systemObjectFieldLayoutAlgorithm = new SystemObjectFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm); - _vectorFieldLayoutAlgorithm = new VectorFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm); + + // Only the Arm64 JIT respects the OS rules for vector type abi currently + _vectorFieldLayoutAlgorithm = new VectorFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm, (details.Architecture == TargetArchitecture.ARM64) ? true : bubbleIncludesCorelib); string matchingVectorType = "Unknown"; if (details.MaximumSimdVectorLength == SimdVectorLength.Vector128Bit) @@ -39,8 +105,8 @@ public ReadyToRunCompilerContext(TargetDetails details, SharedGenericsMode gener else if (details.MaximumSimdVectorLength == SimdVectorLength.Vector256Bit) matchingVectorType = "Vector256`1"; - _vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm, _vectorFieldLayoutAlgorithm, matchingVectorType); - + // No architecture has completely stable handling of Vector in the abi (Arm64 may change to SVE) + _vectorOfTFieldLayoutAlgorithm = new VectorOfTFieldLayoutAlgorithm(_r2rFieldLayoutAlgorithm, _vectorFieldLayoutAlgorithm, matchingVectorType, bubbleIncludesCorelib); } public override FieldLayoutAlgorithm GetLayoutAlgorithmForType(DefType type) @@ -112,12 +178,14 @@ internal class VectorOfTFieldLayoutAlgorithm : FieldLayoutAlgorithm private FieldLayoutAlgorithm _vectorFallbackAlgorithm; private string _similarVectorName; private DefType _similarVectorOpenType; + private bool _vectorAbiIsStable; - public VectorOfTFieldLayoutAlgorithm(FieldLayoutAlgorithm fallbackAlgorithm, FieldLayoutAlgorithm vectorFallbackAlgorithm, string similarVector) + public VectorOfTFieldLayoutAlgorithm(FieldLayoutAlgorithm fallbackAlgorithm, FieldLayoutAlgorithm vectorFallbackAlgorithm, string similarVector, bool vectorAbiIsStable = true) { _fallbackAlgorithm = fallbackAlgorithm; _vectorFallbackAlgorithm = vectorFallbackAlgorithm; _similarVectorName = similarVector; + _vectorAbiIsStable = vectorAbiIsStable; } private DefType GetSimilarVector(DefType vectorOfTType) @@ -158,6 +226,7 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType type, ByteCountUnaligned = LayoutInt.Indeterminate, ByteCountAlignment = LayoutInt.Indeterminate, Offsets = fieldsAndOffsets.ToArray(), + LayoutAbiStable = false, }; return instanceLayout; } @@ -175,6 +244,7 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType type, FieldAlignment = layoutFromSimilarIntrinsicVector.FieldAlignment, FieldSize = layoutFromSimilarIntrinsicVector.FieldSize, Offsets = layoutFromMetadata.Offsets, + LayoutAbiStable = _vectorAbiIsStable, }; #else return new ComputedInstanceFieldLayout @@ -184,6 +254,7 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType type, FieldAlignment = layoutFromMetadata.FieldAlignment, FieldSize = layoutFromSimilarIntrinsicVector.FieldSize, Offsets = layoutFromMetadata.Offsets, + LayoutAbiStable = _vectorAbiIsStable, }; #endif } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs index a9695ef00a0e..be653fdcab1c 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunMetadataFieldLayoutAlgorithm.cs @@ -16,6 +16,20 @@ namespace ILCompiler { + public static class ReadyToRunTypeExtensions + { + public static LayoutInt FieldBaseOffset(this TypeDesc type) + { + LayoutInt baseOffset = type.BaseType.InstanceByteCount; + if (type.RequiresAlign8()) + { + baseOffset = LayoutInt.AlignUp(baseOffset, new LayoutInt(8), type.Context.Target); + } + + return baseOffset; + } + } + internal class ReadyToRunMetadataFieldLayoutAlgorithm : MetadataFieldLayoutAlgorithm { /// @@ -795,7 +809,7 @@ protected override ComputedInstanceFieldLayout ComputeInstanceFieldLayout(Metada return ComputeExplicitFieldLayout(type, numInstanceFields); } else - if (MarshalUtils.IsBlittableType(type) || IsManagedSequentialType(type)) + if (type.IsEnum || MarshalUtils.IsBlittableType(type) || IsManagedSequentialType(type)) { return ComputeSequentialFieldLayout(type, numInstanceFields); } @@ -811,16 +825,8 @@ protected override ComputedInstanceFieldLayout ComputeInstanceFieldLayout(Metada /// protected override void AlignBaseOffsetIfNecessary(MetadataType type, ref LayoutInt baseOffset, bool requiresAlign8) { - if (type.IsValueType) - { - return; - } DefType baseType = type.BaseType; - if (baseType == null || baseType.IsObject) - { - return; - } - + if (!_compilationGroup.NeedsAlignmentBetweenBaseTypeAndDerived(baseType: (MetadataType)baseType, derivedType: type)) { // The type is defined in the module that's currently being compiled and the type layout doesn't depend on other modules diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/SystemObjectFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/SystemObjectFieldLayoutAlgorithm.cs index a88cdb011353..2d04a02448a7 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/SystemObjectFieldLayoutAlgorithm.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/SystemObjectFieldLayoutAlgorithm.cs @@ -36,6 +36,7 @@ public override ComputedInstanceFieldLayout ComputeInstanceLayout(DefType defTyp FieldAlignment = layoutFromMetadata.FieldAlignment, FieldSize = layoutFromMetadata.FieldSize, Offsets = layoutFromMetadata.Offsets, + LayoutAbiStable = true, }; } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/IBC/IBCProfileParser.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/IBC/IBCProfileParser.cs index c42ecaa13c1c..718d4e650fa6 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/IBC/IBCProfileParser.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/IBC/IBCProfileParser.cs @@ -113,7 +113,8 @@ public ProfileData ParseIBCDataFromModule(EcmaModule ecmaModule) } else { - _logger.Writer.WriteLine($"Token {0:x} does not refer to a method"); + if (_logger.IsVerbose) + _logger.Writer.WriteLine($"Token {(int)entry.Token:x} does not refer to a method"); } break; diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs index 6a86e0629b42..cc030b315566 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/IBC/MIbcProfileParser.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Buffers.Binary; using System.Collections.Generic; using System.IO.Compression; using System.Reflection; @@ -78,7 +79,7 @@ public static ProfileData ParseMIbcFile(CompilerTypeSystemContext tsc, string fi case ILOpcode.ldstr: if (mibcGroupName == "") { - UInt32 userStringToken = (UInt32)(ilBytes[currentOffset + 1] + (ilBytes[currentOffset + 2] << 8) + (ilBytes[currentOffset + 3] << 16) + (ilBytes[currentOffset + 4] << 24)); + UInt32 userStringToken = BinaryPrimitives.ReadUInt32LittleEndian(ilBytes.AsSpan(currentOffset + 1)); mibcGroupName = (string)ilBody.GetObject((int)userStringToken); } break; @@ -110,7 +111,7 @@ public static ProfileData ParseMIbcFile(CompilerTypeSystemContext tsc, string fi if (!areAllEntriesInVersionBubble) break; - uint token = (uint)(ilBytes[currentOffset + 1] + (ilBytes[currentOffset + 2] << 8) + (ilBytes[currentOffset + 3] << 16) + (ilBytes[currentOffset + 4] << 24)); + uint token = BinaryPrimitives.ReadUInt32LittleEndian(ilBytes.AsSpan(currentOffset + 1)); loadedMethodProfileData = loadedMethodProfileData.Concat(ReadMIbcGroup(tsc, (EcmaMethod)ilBody.GetObject((int)token))); break; case ILOpcode.pop: diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj index 483973871a90..aa2bf84c4da8 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj @@ -2,7 +2,7 @@ Library ILCompiler.ReadyToRun - $(NetCoreAppCurrent) + $(NetCoreAppToolCurrent) true READYTORUN;$(DefineConstants) false @@ -98,6 +98,7 @@ + diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Interop/IL/Marshaller.ReadyToRun.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Interop/IL/Marshaller.ReadyToRun.cs index 4ca7a6f95965..04b939334a21 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Interop/IL/Marshaller.ReadyToRun.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Interop/IL/Marshaller.ReadyToRun.cs @@ -70,6 +70,8 @@ public static Marshaller[] GetMarshallersForMethod(MethodDesc targetMethod) TypeDesc parameterType = (i == 0) ? methodSig.ReturnType : methodSig[i - 1]; //first item is the return type marshallers[i] = CreateMarshaller(parameterType, + parameterIndex, + methodSig.GetEmbeddedSignatureData(), MarshallerType.Argument, parameterMetadata.MarshalAsDescriptor, direction, @@ -121,6 +123,8 @@ public static bool IsMarshallingRequired(MethodSignature methodSig, ParameterMet MarshallerKind marshallerKind = MarshalHelpers.GetMarshallerKind( parameterType, + parameterIndex: i, + customModifierData: methodSig.GetEmbeddedSignatureData(), parameterMetadata.MarshalAsDescriptor, parameterMetadata.Return, isAnsi: true, diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs index 2c2085635f34..67a9f9eefa7f 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs @@ -24,20 +24,155 @@ namespace Internal.JitInterface { + internal class RequiresRuntimeJitIfUsedSymbol + { + public RequiresRuntimeJitIfUsedSymbol(string message) + { + Message = message; + } + + public string Message { get; } + } + public class MethodWithToken { public readonly MethodDesc Method; public readonly ModuleToken Token; public readonly TypeDesc ConstrainedType; public readonly bool Unboxing; + public readonly bool OwningTypeNotDerivedFromToken; + public readonly TypeDesc OwningType; + - public MethodWithToken(MethodDesc method, ModuleToken token, TypeDesc constrainedType, bool unboxing) + public MethodWithToken(MethodDesc method, ModuleToken token, TypeDesc constrainedType, bool unboxing, object context) { Debug.Assert(!method.IsUnboxingThunk()); Method = method; Token = token; ConstrainedType = constrainedType; Unboxing = unboxing; + OwningType = GetMethodTokenOwningType(this, constrainedType, context, out OwningTypeNotDerivedFromToken); + } + + private static TypeDesc GetMethodTokenOwningType(MethodWithToken methodToken, TypeDesc constrainedType, object context, out bool owningTypeNotDerivedFromToken) + { + ModuleToken moduleToken = methodToken.Token; + owningTypeNotDerivedFromToken = false; + + // Strip off method spec details. The owning type is only associated with a MethodDef or a MemberRef + if (moduleToken.TokenType == CorTokenType.mdtMethodSpec) + { + var methodSpecification = moduleToken.MetadataReader.GetMethodSpecification((MethodSpecificationHandle)moduleToken.Handle); + moduleToken = new ModuleToken(moduleToken.Module, methodSpecification.Method); + } + + if (moduleToken.TokenType == CorTokenType.mdtMethodDef) + { + var methodDefinition = moduleToken.MetadataReader.GetMethodDefinition((MethodDefinitionHandle)moduleToken.Handle); + return HandleContext(moduleToken.Module, methodDefinition.GetDeclaringType(), methodToken.Method.OwningType, constrainedType, context, ref owningTypeNotDerivedFromToken); + } + + // At this point moduleToken must point at a MemberRef. + Debug.Assert(moduleToken.TokenType == CorTokenType.mdtMemberRef); + var memberRef = moduleToken.MetadataReader.GetMemberReference((MemberReferenceHandle)moduleToken.Handle); + switch (memberRef.Parent.Kind) + { + case HandleKind.TypeDefinition: + case HandleKind.TypeReference: + case HandleKind.TypeSpecification: + { + return HandleContext(moduleToken.Module, memberRef.Parent, methodToken.Method.OwningType, constrainedType, context, ref owningTypeNotDerivedFromToken); + } + + default: + return methodToken.Method.OwningType; + } + + TypeDesc HandleContext(EcmaModule module, EntityHandle handle, TypeDesc methodTargetOwner, TypeDesc constrainedType, object context, ref bool owningTypeNotDerivedFromToken) + { + var tokenOnlyOwningType = module.GetType(handle); + TypeDesc actualOwningType; + + if (context == null) + { + actualOwningType = methodTargetOwner; + } + else + { + Instantiation typeInstantiation; + Instantiation methodInstantiation = new Instantiation(); + + if (context is MethodDesc methodContext) + { + typeInstantiation = methodContext.OwningType.Instantiation; + methodInstantiation = methodContext.Instantiation; + } + else + { + TypeDesc typeContext = (TypeDesc)context; + typeInstantiation = typeContext.Instantiation; + } + + var instantiatedOwningType = tokenOnlyOwningType.InstantiateSignature(typeInstantiation, methodInstantiation); + var canonicalizedOwningType = instantiatedOwningType.ConvertToCanonForm(CanonicalFormKind.Specific); + if ((instantiatedOwningType == canonicalizedOwningType) || (constrainedType != null)) + { + actualOwningType = instantiatedOwningType; + } + else + { + actualOwningType = ComputeActualOwningType(methodTargetOwner, instantiatedOwningType, canonicalizedOwningType); + + // Implement via a helper function, so that managing the loop escape behavior is easier to read + TypeDesc ComputeActualOwningType(TypeDesc methodTargetOwner, TypeDesc instantiatedOwningType, TypeDesc canonicalizedOwningType) + { + // Pick between Canonical and Exact OwningTypes. + // + // If the canonicalizedOwningType is the OwningType (or parent type) of the associated method + // Then return canonicalizedOwningType + // Else If the Exact Owning type is the OwningType (or parent type) of the associated method + // Then return actualOwningType + // Else If the canonicallized owningType (or canonicalized parent type) of the associated method + // Return the canonicalizedOwningType + // Else + // Fail, unexpected behavior + var currentType = canonicalizedOwningType; + while (currentType != null) + { + if (currentType == methodTargetOwner) + return canonicalizedOwningType; + currentType = currentType.BaseType; + } + + currentType = instantiatedOwningType; + while (currentType != null) + { + if (currentType == methodTargetOwner) + return instantiatedOwningType; + currentType = currentType.BaseType; + } + + currentType = canonicalizedOwningType; + while (currentType != null) + { + currentType = currentType.ConvertToCanonForm(CanonicalFormKind.Specific); + if (currentType == methodTargetOwner) + return canonicalizedOwningType; + currentType = currentType.BaseType; + } + + Debug.Assert(false); + throw new Exception(); + } + } + } + + if (actualOwningType != tokenOnlyOwningType) + { + owningTypeNotDerivedFromToken = true; + } + return actualOwningType; + } } public override bool Equals(object obj) @@ -53,7 +188,15 @@ public override int GetHashCode() public bool Equals(MethodWithToken methodWithToken) { - return Method == methodWithToken.Method && Token.Equals(methodWithToken.Token) && ConstrainedType == methodWithToken.ConstrainedType && Unboxing == methodWithToken.Unboxing; + bool equals = Method == methodWithToken.Method && Token.Equals(methodWithToken.Token) && ConstrainedType == methodWithToken.ConstrainedType && + Unboxing == methodWithToken.Unboxing; + if (equals) + { + Debug.Assert(OwningTypeNotDerivedFromToken == methodWithToken.OwningTypeNotDerivedFromToken); + Debug.Assert(OwningType == methodWithToken.OwningType); + } + + return equals; } public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) @@ -93,7 +236,23 @@ public int CompareTo(MethodWithToken other, TypeSystemComparer comparer) if (result != 0) return result; - return Unboxing.CompareTo(other.Unboxing); + result = Unboxing.CompareTo(other.Unboxing); + if (result != 0) + return result; + + // The OwningType/OwningTypeNotDerivedFromToken shoud be equivalent if the above conditions are equal. + Debug.Assert(OwningTypeNotDerivedFromToken == other.OwningTypeNotDerivedFromToken); + Debug.Assert(OwningType == other.OwningType); + + if (OwningTypeNotDerivedFromToken != other.OwningTypeNotDerivedFromToken) + { + if (OwningTypeNotDerivedFromToken) + return 1; + else + return -1; + } + + return comparer.Compare(OwningType, other.OwningType); } } @@ -224,7 +383,7 @@ public void CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode) try { - if (!ShouldSkipCompilation(MethodBeingCompiled)) + if (!ShouldSkipCompilation(MethodBeingCompiled) && !MethodSignatureIsUnstable(MethodBeingCompiled.Signature, out var _)) { MethodIL methodIL = _compilation.GetMethodIL(MethodBeingCompiled); if (methodIL != null) @@ -316,7 +475,9 @@ private bool getReadyToRunHelper(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref object helperArg = GetRuntimeDeterminedObjectForToken(ref pResolvedToken); if (helperArg is MethodDesc methodDesc) { - helperArg = new MethodWithToken(methodDesc, HandleToModuleToken(ref pResolvedToken), constrainedType, unboxing: false); + var methodIL = (MethodIL)HandleToObject((IntPtr)pResolvedToken.tokenScope); + MethodDesc sharedMethod = methodIL.OwningMethod.GetSharedRuntimeFormMethodTarget(); + helperArg = new MethodWithToken(methodDesc, HandleToModuleToken(ref pResolvedToken), constrainedType, unboxing: false, context: sharedMethod); } GenericContext methodContext = new GenericContext(entityFromContext(pResolvedToken.tokenContext)); @@ -346,7 +507,7 @@ private void getReadyToRunDelegateCtorHelper(ref CORINFO_RESOLVED_TOKEN pTargetM TypeDesc delegateTypeDesc = HandleToObject(delegateType); MethodDesc targetMethodDesc = HandleToObject(pTargetMethod.hMethod); Debug.Assert(!targetMethodDesc.IsUnboxingThunk()); - MethodWithToken targetMethod = new MethodWithToken(targetMethodDesc, HandleToModuleToken(ref pTargetMethod), constrainedType: null, unboxing: false); + MethodWithToken targetMethod = new MethodWithToken(targetMethodDesc, HandleToModuleToken(ref pTargetMethod), constrainedType: null, unboxing: false, context: entityFromContext(pTargetMethod.tokenContext)); pLookup.lookupKind.needsRuntimeLookup = false; pLookup.constLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.DelegateCtor(delegateTypeDesc, targetMethod)); @@ -670,7 +831,13 @@ private bool canTailCall(CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUC return false; } - private ModuleToken HandleToModuleToken(ref CORINFO_RESOLVED_TOKEN pResolvedToken, MethodDesc methodDesc) + private MethodWithToken ComputeMethodWithToken(MethodDesc method, ref CORINFO_RESOLVED_TOKEN pResolvedToken, TypeDesc constrainedType, bool unboxing) + { + ModuleToken token = HandleToModuleToken(ref pResolvedToken, method, out object context, ref constrainedType); + return new MethodWithToken(method, token, constrainedType: constrainedType, unboxing: unboxing, context: context); + } + + private ModuleToken HandleToModuleToken(ref CORINFO_RESOLVED_TOKEN pResolvedToken, MethodDesc methodDesc, out object context, ref TypeDesc constrainedType) { if (methodDesc != null && (_compilation.NodeFactory.CompilationModuleGroup.VersionsWithMethodBody(methodDesc) || methodDesc.IsPInvoke)) { @@ -678,12 +845,20 @@ private ModuleToken HandleToModuleToken(ref CORINFO_RESOLVED_TOKEN pResolvedToke methodDesc?.GetTypicalMethodDefinition() is EcmaMethod ecmaMethod) { mdToken token = (mdToken)MetadataTokens.GetToken(ecmaMethod.Handle); + + // This is used for de-virtualization of non-generic virtual methods, and should be treated + // as a the methodDesc parameter defining the exact OwningType, not doing resolution through the token. + context = null; + constrainedType = null; + return new ModuleToken(ecmaMethod.Module, token); } } + context = entityFromContext(pResolvedToken.tokenContext); return HandleToModuleToken(ref pResolvedToken); } + private ModuleToken HandleToModuleToken(ref CORINFO_RESOLVED_TOKEN pResolvedToken) { mdToken token = pResolvedToken.token; @@ -1012,7 +1187,7 @@ private void getFieldInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_MET CorInfoHelpFunc.CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE); } - if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout) + if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout && (fieldOffset <= FieldFixupSignature.MaxCheckableOffset)) { // ENCODE_CHECK_FIELD_OFFSET _methodCodeNode.Fixups.Add(_compilation.SymbolNodeFactory.CheckFieldOffset(field)); @@ -1066,7 +1241,7 @@ private void getFieldInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_MET else if (helperId != ReadyToRunHelperId.Invalid) { - if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout) + if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout && (fieldOffset <= FieldFixupSignature.MaxCheckableOffset)) { // ENCODE_CHECK_FIELD_OFFSET _methodCodeNode.Fixups.Add(_compilation.SymbolNodeFactory.CheckFieldOffset(field)); @@ -1509,6 +1684,42 @@ private void classMustBeLoadedBeforeCodeIsRun(TypeDesc type) _methodCodeNode.Fixups.Add(node); } + private static bool MethodSignatureIsUnstable(MethodSignature methodSig, out string unstableMessage) + { + foreach (TypeDesc t in methodSig) + { + DefType defType = t as DefType; + + if (defType != null) + { + if (!defType.LayoutAbiStable) + { + unstableMessage = $"Abi unstable type {defType}"; + return true; + } + } + } + unstableMessage = null; + return false; + } + + private void UpdateConstLookupWithRequiresRuntimeJitSymbolIfNeeded(ref CORINFO_CONST_LOOKUP constLookup, MethodDesc method) + { + if (MethodSignatureIsUnstable(method.Signature, out string unstableMessage)) + { + constLookup.addr = (void*)ObjectToHandle(new RequiresRuntimeJitIfUsedSymbol(unstableMessage + " calling " + method)); + constLookup.accessType = InfoAccessType.IAT_PVALUE; + } + } + + private void VerifyMethodSignatureIsStable(MethodSignature methodSig) + { + if (MethodSignatureIsUnstable(methodSig, out var unstableMessage)) + { + throw new RequiresRuntimeJitException(unstableMessage); + } + } + private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken, CORINFO_METHOD_STRUCT_* callerHandle, CORINFO_CALLINFO_FLAGS flags, CORINFO_CALL_INFO* pResult) { MethodDesc methodToCall; @@ -1567,14 +1778,19 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO pResult->codePointerOrStubLookup.constLookup = CreateConstLookupToSymbol( _compilation.SymbolNodeFactory.InterfaceDispatchCell( - new MethodWithToken(targetMethod, HandleToModuleToken(ref pResolvedToken, targetMethod), constrainedType: null, unboxing: false), + ComputeMethodWithToken(targetMethod, ref pResolvedToken, constrainedType: null, unboxing: false), MethodBeingCompiled)); + + // If the abi of the method isn't stable, this will cause a usage of the RequiresRuntimeJitSymbol, which will trigger a RequiresRuntimeJitException + UpdateConstLookupWithRequiresRuntimeJitSymbolIfNeeded(ref pResult->codePointerOrStubLookup.constLookup, targetMethod); } break; case CORINFO_CALL_KIND.CORINFO_CALL_CODE_POINTER: Debug.Assert(pResult->codePointerOrStubLookup.lookupKind.needsRuntimeLookup); + // Eagerly check abi stability here as no symbol usage can be used to delay the check + VerifyMethodSignatureIsStable(targetMethod.Signature); // There is no easy way to detect method referenced via generic lookups in generated code. // Report this method reference unconditionally. @@ -1601,15 +1817,21 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO // READYTORUN: FUTURE: Direct calls if possible pResult->codePointerOrStubLookup.constLookup = CreateConstLookupToSymbol( _compilation.NodeFactory.MethodEntrypoint( - new MethodWithToken(nonUnboxingMethod, HandleToModuleToken(ref pResolvedToken, nonUnboxingMethod), constrainedType, unboxing: isUnboxingStub), + ComputeMethodWithToken(nonUnboxingMethod, ref pResolvedToken, constrainedType, unboxing: isUnboxingStub), isInstantiatingStub: useInstantiatingStub, isPrecodeImportRequired: (flags & CORINFO_CALLINFO_FLAGS.CORINFO_CALLINFO_LDFTN) != 0)); + + // If the abi of the method isn't stable, this will cause a usage of the RequiresRuntimeJitSymbol, which will trigger a RequiresRuntimeJitException + UpdateConstLookupWithRequiresRuntimeJitSymbolIfNeeded(ref pResult->codePointerOrStubLookup.constLookup, targetMethod); } break; case CORINFO_CALL_KIND.CORINFO_VIRTUALCALL_VTABLE: // Only calls within the CoreLib version bubble support fragile NI codegen with vtable based calls, for better performance (because // CoreLib and the runtime will always be updated together anyways - this is a special case) + + // Eagerly check abi stability here as no symbol usage can be used to delay the check + VerifyMethodSignatureIsStable(targetMethod.Signature); break; case CORINFO_CALL_KIND.CORINFO_VIRTUALCALL_LDVIRTFTN: @@ -1618,7 +1840,7 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO bool atypicalCallsite = (flags & CORINFO_CALLINFO_FLAGS.CORINFO_CALLINFO_ATYPICAL_CALLSITE) != 0; pResult->codePointerOrStubLookup.constLookup = CreateConstLookupToSymbol( _compilation.NodeFactory.DynamicHelperCell( - new MethodWithToken(targetMethod, HandleToModuleToken(ref pResolvedToken, targetMethod), constrainedType: null, unboxing: false), + ComputeMethodWithToken(targetMethod, ref pResolvedToken, constrainedType: null, unboxing: false), useInstantiatingStub)); Debug.Assert(!pResult->sig.hasTypeArg()); @@ -1645,7 +1867,7 @@ private void getCallInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_RESO { pResult->instParamLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.CreateReadyToRunHelper( ReadyToRunHelperId.MethodDictionary, - new MethodWithToken(targetMethod, HandleToModuleToken(ref pResolvedToken, targetMethod), constrainedType, unboxing: false))); + ComputeMethodWithToken(targetMethod, ref pResolvedToken, constrainedType: constrainedType, unboxing: false))); } else { @@ -1884,7 +2106,7 @@ private void embedGenericHandle(ref CORINFO_RESOLVED_TOKEN pResolvedToken, bool symbolNode = _compilation.SymbolNodeFactory.CreateReadyToRunHelper( ReadyToRunHelperId.MethodHandle, - new MethodWithToken(md, HandleToModuleToken(ref pResolvedToken), constrainedType: null, unboxing: unboxingStub)); + ComputeMethodWithToken(md, ref pResolvedToken, constrainedType: null, unboxing: unboxingStub)); } break; @@ -1922,7 +2144,7 @@ private bool NeedsTypeLayoutCheck(TypeDesc type) if (!type.IsValueType) return false; - return !_compilation.IsLayoutFixedInCurrentVersionBubble(type) || _compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout; + return !_compilation.IsLayoutFixedInCurrentVersionBubble(type) || (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout && !((MetadataType)type).IsNonVersionable()); } private bool HasLayoutMetadata(TypeDesc type) @@ -1963,6 +2185,9 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult, if (pMT.IsValueType) { // ENCODE_CHECK_FIELD_OFFSET + if (pResult->offset > FieldFixupSignature.MaxCheckableOffset) + throw new RequiresRuntimeJitException(callerMethod.ToString() + " -> " + field.ToString()); + _methodCodeNode.Fixups.Add(_compilation.SymbolNodeFactory.CheckFieldOffset(field)); // No-op other than generating the check field offset fixup } @@ -1978,7 +2203,7 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult, } else if (pMT.IsValueType) { - if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout) + if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout && !callerMethod.IsNonVersionable() && (pResult->offset <= FieldFixupSignature.MaxCheckableOffset)) { // ENCODE_CHECK_FIELD_OFFSET _methodCodeNode.Fixups.Add(_compilation.SymbolNodeFactory.CheckFieldOffset(field)); @@ -1987,7 +2212,7 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult, } else if (_compilation.IsInheritanceChainLayoutFixedInCurrentVersionBubble(pMT.BaseType)) { - if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout) + if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout && !callerMethod.IsNonVersionable() && (pResult->offset <= FieldFixupSignature.MaxCheckableOffset)) { // ENCODE_CHECK_FIELD_OFFSET _methodCodeNode.Fixups.Add(_compilation.SymbolNodeFactory.CheckFieldOffset(field)); @@ -2009,15 +2234,16 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult, { PreventRecursiveFieldInlinesOutsideVersionBubble(field, callerMethod); - if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout) + if (_compilation.SymbolNodeFactory.VerifyTypeAndFieldLayout && !callerMethod.IsNonVersionable() && (pResult->offset <= FieldFixupSignature.MaxCheckableOffset)) { // ENCODE_CHECK_FIELD_OFFSET _methodCodeNode.Fixups.Add(_compilation.SymbolNodeFactory.CheckFieldOffset(field)); } // ENCODE_FIELD_BASE_OFFSET - Debug.Assert(pResult->offset >= (uint)pMT.BaseType.InstanceByteCount.AsInt); - pResult->offset -= (uint)pMT.BaseType.InstanceByteCount.AsInt; + int fieldBaseOffset = pMT.FieldBaseOffset().AsInt; + Debug.Assert(pResult->offset >= (uint)fieldBaseOffset); + pResult->offset -= (uint)fieldBaseOffset; pResult->fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_INSTANCE_WITH_BASE; pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldBaseOffset(field.OwningType)); } @@ -2118,7 +2344,7 @@ private void getAddressOfPInvokeTarget(CORINFO_METHOD_STRUCT_* method, ref CORIN methodDesc = rawPInvoke.Target; EcmaMethod ecmaMethod = (EcmaMethod)methodDesc; ModuleToken moduleToken = new ModuleToken(ecmaMethod.Module, ecmaMethod.Handle); - MethodWithToken methodWithToken = new MethodWithToken(ecmaMethod, moduleToken, constrainedType: null, unboxing: false); + MethodWithToken methodWithToken = new MethodWithToken(ecmaMethod, moduleToken, constrainedType: null, unboxing: false, context: null); if (ecmaMethod.IsSuppressGCTransition()) { diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/MapFileBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/MapFileBuilder.cs index 7c9be722af12..eb2b9e2a842d 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/MapFileBuilder.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/MapFileBuilder.cs @@ -170,7 +170,7 @@ public void SetFileSize(long fileSize) _fileSize = fileSize; } - public void Save(string mapFileName) + public void SaveMap(string mapFileName) { Console.WriteLine("Emitting map file: {0}", mapFileName); @@ -187,6 +187,24 @@ public void Save(string mapFileName) } } + public void SaveCsv(string nodeStatsCsvFileName, string mapCsvFileName) + { + Console.WriteLine("Emitting csv files: {0}, {1}", nodeStatsCsvFileName, mapCsvFileName); + + _nodes.Sort(MapFileItem.Comparer.Instance); + _symbols.Sort(MapFileItem.Comparer.Instance); + + using (StreamWriter nodeStatsWriter = new StreamWriter(nodeStatsCsvFileName)) + { + WriteNodeTypeStatisticsCsv(nodeStatsWriter); + } + + using (StreamWriter mapCsvWriter = new StreamWriter(mapCsvFileName)) + { + WriteMapCsv(mapCsvWriter); + } + } + private void WriteHeader(StreamWriter writer) { WriteTitle(writer, "Summary Info"); @@ -198,7 +216,7 @@ private void WriteHeader(StreamWriter writer) writer.WriteLine($"Relocation count: {_relocCounts.Values.Sum(),10}"); } - private void WriteNodeTypeStatistics(StreamWriter writer) + private IEnumerable GetNodeTypeStatistics() { List nodeTypeStats = new List(); Dictionary statsNameIndex = new Dictionary(); @@ -214,6 +232,13 @@ private void WriteNodeTypeStatistics(StreamWriter writer) } nodeTypeStats.Sort((a, b) => b.Length.CompareTo(a.Length)); + return nodeTypeStats; + } + + private void WriteNodeTypeStatistics(StreamWriter writer) + { + IEnumerable nodeTypeStats = GetNodeTypeStatistics(); + WriteTitle(writer, "Node Type Statistics"); WriteTitle(writer, " LENGTH | %FILE | AVERAGE | COUNT | NODETYPE"); foreach (NodeTypeStatistics nodeStats in nodeTypeStats) @@ -226,6 +251,21 @@ private void WriteNodeTypeStatistics(StreamWriter writer) } } + private void WriteNodeTypeStatisticsCsv(StreamWriter writer) + { + IEnumerable nodeTypeStats = GetNodeTypeStatistics(); + + writer.WriteLine("Length,% Of File,Average Size,Count,Node Type"); + foreach (NodeTypeStatistics nodeStats in nodeTypeStats) + { + writer.Write($"{nodeStats.Length},"); + writer.Write($"{(nodeStats.Length * 100.0 / _fileSize)},"); + writer.Write($"{(nodeStats.Length / (double)nodeStats.Count)},"); + writer.Write($"{nodeStats.Count},"); + writer.WriteLine(nodeStats.Name); + } + } + private void WriteRelocTypeStatistics(StreamWriter writer) { KeyValuePair[] relocTypeCounts = _relocCounts.ToArray(); @@ -313,6 +353,48 @@ private void WriteMap(StreamWriter writer) } } + private void WriteMapCsv(StreamWriter writer) + { + writer.WriteLine("Rva,Length,Relocs,Section,Symbol,Node Type"); + + int nodeIndex = 0; + int symbolIndex = 0; + + while (nodeIndex < _nodes.Count || symbolIndex < _symbols.Count) + { + if (nodeIndex >= _nodes.Count || symbolIndex < _symbols.Count && MapFileItem.Comparer.Instance.Compare(_symbols[symbolIndex], _nodes[nodeIndex]) < 0) + { + // No more nodes or next symbol is below next node - emit symbol + MapFileSymbol symbol = _symbols[symbolIndex++]; + Section section = _sections[symbol.SectionIndex]; + writer.Write($"0x{symbol.Offset + section.RVAWhenPlaced:X8},"); + writer.Write(","); + writer.Write(","); + writer.Write($"{section.Name},"); + writer.Write(","); + writer.WriteLine(symbol.Name); + } + else + { + // Emit node and optionally symbol + MapFileNode node = _nodes[nodeIndex++]; + Section section = _sections[node.SectionIndex]; + + writer.Write($"0x{node.Offset + section.RVAWhenPlaced:X8},"); + writer.Write($"{node.Length},"); + writer.Write($"{node.Relocations},"); + writer.Write($"{section.Name},"); + if (symbolIndex < _symbols.Count && MapFileItem.Comparer.Instance.Compare(node, _symbols[symbolIndex]) == 0) + { + MapFileSymbol symbol = _symbols[symbolIndex++]; + writer.Write($"{symbol.Name}"); + } + writer.Write(","); + writer.WriteLine($"{node.Name}"); + } + } + } + private static string GetNameHead(Section section) { string sectionNameHead = section.Name; diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs index 839b1f21d110..759fad4ac6fd 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs @@ -159,7 +159,7 @@ public SectionRVADelta(int startRVA, int endRVA, int deltaRVA) /// If non-null, the PE file will be laid out such that it can naturally be mapped with a higher alignment than 4KB /// This is used to support loading via large pages on Linux /// - private readonly int? _customPESectionAlignment; + private readonly int _customPESectionAlignment; /// /// Constructor initializes the various control structures and combines the section list. @@ -173,8 +173,9 @@ public R2RPEBuilder( ISymbolNode r2rHeaderExportSymbol, string outputFileSimpleName, Func getRuntimeFunctionsTable, - int? customPESectionAlignment) - : base(peHeaderBuilder, deterministicIdProvider: null) + int customPESectionAlignment, + Func, BlobContentId> deterministicIdProvider) + : base(peHeaderBuilder, deterministicIdProvider: deterministicIdProvider) { _target = target; _getRuntimeFunctionsTable = getRuntimeFunctionsTable; @@ -288,7 +289,7 @@ public int GetSymbolFilePosition(ISymbolNode symbol) /// /// Output stream for the final R2R PE file /// Timestamp to set in the PE header of the output R2R executable - public void Write(Stream outputStream, int timeDateStamp) + public void Write(Stream outputStream, int? timeDateStamp) { BlobBuilder outputPeFile = new BlobBuilder(); Serialize(outputPeFile); @@ -297,12 +298,13 @@ public void Write(Stream outputStream, int timeDateStamp) UpdateSectionRVAs(outputStream); - if (_customPESectionAlignment.HasValue) - SetPEHeaderSectionAlignment(outputStream, _customPESectionAlignment.Value); + if (_customPESectionAlignment != 0) + SetPEHeaderSectionAlignment(outputStream, _customPESectionAlignment); ApplyMachineOSOverride(outputStream); - SetPEHeaderTimeStamp(outputStream, timeDateStamp); + if (timeDateStamp.HasValue) + SetPEHeaderTimeStamp(outputStream, timeDateStamp.Value); _written = true; } @@ -401,7 +403,7 @@ private void UpdateSectionRVAs(Stream outputStream) int sectionCount = _sectionRVAs.Length; for (int sectionIndex = 0; sectionIndex < sectionCount; sectionIndex++) { - if (_customPESectionAlignment != null) + if (_customPESectionAlignment != 0) { // When _customPESectionAlignment is set, the physical and virtual sizes are the same byte[] sizeBytes = BitConverter.GetBytes(_sectionRawSizes[sectionIndex]); @@ -576,15 +578,15 @@ protected override BlobBuilder SerializeSection(string name, SectionLocation loc } int injectedPadding = 0; - if (_customPESectionAlignment.HasValue && _customPESectionAlignment.Value != 0) + if (_customPESectionAlignment != 0) { if (outputSectionIndex > 0) { sectionStartRva = Math.Max(sectionStartRva, _sectionRVAs[outputSectionIndex - 1] + _sectionRawSizes[outputSectionIndex - 1]); } - int newSectionStartRva = AlignmentHelper.AlignUp(sectionStartRva, _customPESectionAlignment.Value); - int newSectionPointerToRawData = AlignmentHelper.AlignUp(location.PointerToRawData, _customPESectionAlignment.Value); + int newSectionStartRva = AlignmentHelper.AlignUp(sectionStartRva, _customPESectionAlignment); + int newSectionPointerToRawData = AlignmentHelper.AlignUp(location.PointerToRawData, _customPESectionAlignment); if (newSectionPointerToRawData > location.PointerToRawData) { sectionDataBuilder = new BlobBuilder(); @@ -644,10 +646,10 @@ protected override BlobBuilder SerializeSection(string name, SectionLocation loc int sectionRawSize = sectionDataBuilder.Count - injectedPadding; - if (_customPESectionAlignment.HasValue && _customPESectionAlignment.Value != 0) + if (_customPESectionAlignment != 0) { // Align the end of the section to the padding offset - int count = AlignmentHelper.AlignUp(sectionRawSize, _customPESectionAlignment.Value); + int count = AlignmentHelper.AlignUp(sectionRawSize, _customPESectionAlignment); sectionDataBuilder.WriteBytes(0, count - sectionRawSize); sectionRawSize = count; } diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs index dd82ab79c76e..6ba8e5563683 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs @@ -756,6 +756,7 @@ private BlobBuilder SerializeExportSection(SectionLocation sectionLocation) // Emit the name pointer table; it should be alphabetically sorted. // Also, we can now fill in the export address table as we've detected its size // in the previous pass. + builder.Align(4); int namePointerTableRVA = sectionLocation.RelativeVirtualAddress + builder.Count; foreach (ExportSymbol symbol in _exportSymbols) { @@ -774,6 +775,7 @@ private BlobBuilder SerializeExportSection(SectionLocation sectionLocation) } // Emit the address table + builder.Align(4); int addressTableRVA = sectionLocation.RelativeVirtualAddress + builder.Count; foreach (int addressTableEntry in addressTable) { @@ -781,6 +783,7 @@ private BlobBuilder SerializeExportSection(SectionLocation sectionLocation) } // Emit the export directory table + builder.Align(4); int exportDirectoryTableRVA = sectionLocation.RelativeVirtualAddress + builder.Count; // +0x00: reserved builder.WriteInt32(0); diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs index 1c5150bcedaf..b4338ffef290 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/Amd64/UnwindInfo.cs @@ -42,8 +42,6 @@ public enum UnwindFlags /// public class UnwindCode { - public int Index { get; set; } - public byte CodeOffset { get; set; } public UnwindOpCodes UnwindOp { get; set; } //4 bits @@ -53,30 +51,101 @@ public class UnwindCode public byte OffsetLow { get; set; } public byte OffsetHigh { get; set; } //4 bits - public uint FrameOffset { get; set; } + public int FrameOffset { get; set; } public int NextFrameOffset { get; set; } public bool IsOpInfo { get; set; } public UnwindCode() { } - public UnwindCode(byte[] image, int index, ref int offset) + /// + /// Unwinde code parsing is based on src\jit\unwindamd64.cpp DumpUnwindInfo + /// + public UnwindCode(byte[] image, ref int frameOffset, ref int offset) { - Index = index; - - int off = offset; - CodeOffset = NativeReader.ReadByte(image, ref off); - byte op = NativeReader.ReadByte(image, ref off); + CodeOffset = NativeReader.ReadByte(image, ref offset); + byte op = NativeReader.ReadByte(image, ref offset); UnwindOp = (UnwindOpCodes)(op & 15); OpInfo = (byte)(op >> 4); OffsetLow = CodeOffset; OffsetHigh = OpInfo; - FrameOffset = NativeReader.ReadUInt16(image, ref offset); - NextFrameOffset = -1; + FrameOffset = frameOffset; - IsOpInfo = false; + switch (UnwindOp) + { + case UnwindOpCodes.UWOP_PUSH_NONVOL: + OpInfoStr = $"{(Registers)OpInfo}({OpInfo})"; + break; + case UnwindOpCodes.UWOP_ALLOC_LARGE: + OpInfoStr = $"{OpInfo} - "; + if (OpInfo == 0) + { + OpInfoStr += "Scaled small"; + NextFrameOffset = 8 * NativeReader.ReadUInt16(image, ref offset); + } + else if (OpInfo == 1) + { + OpInfoStr += "Unscaled large"; + uint nextOffset = NativeReader.ReadUInt16(image, ref offset); + NextFrameOffset = (int)((uint)(NativeReader.ReadUInt16(image, ref offset) << 16) | nextOffset); + } + else + { + throw new BadImageFormatException(); + } + break; + case UnwindOpCodes.UWOP_ALLOC_SMALL: + int opInfo = OpInfo * 8 + 8; + OpInfoStr = $"{opInfo}"; + break; + case UnwindOpCodes.UWOP_SET_FPREG: + OpInfoStr = $"Unused({OpInfo})"; + break; + case UnwindOpCodes.UWOP_SET_FPREG_LARGE: + { + OpInfoStr = $"Unused({OpInfo})"; + uint nextOffset = NativeReader.ReadUInt16(image, ref offset); + nextOffset = ((uint)(NativeReader.ReadUInt16(image, ref offset) << 16) | nextOffset); + NextFrameOffset = (int)nextOffset * 16; + if ((NextFrameOffset & 0xF0000000) != 0) + { + throw new BadImageFormatException("Warning: Illegal unwindInfo unscaled offset: too large"); + } + } + break; + case UnwindOpCodes.UWOP_SAVE_NONVOL: + { + OpInfoStr = $"{(Registers)OpInfo}({OpInfo})"; + NextFrameOffset = NativeReader.ReadUInt16(image, ref offset) * 8; + } + break; + case UnwindOpCodes.UWOP_SAVE_NONVOL_FAR: + { + OpInfoStr = $"{(Registers)OpInfo}({OpInfo})"; + uint nextOffset = NativeReader.ReadUInt16(image, ref offset); + NextFrameOffset = (int)((uint)(NativeReader.ReadUInt16(image, ref offset) << 16) | nextOffset); + } + break; + case UnwindOpCodes.UWOP_SAVE_XMM128: + { + OpInfoStr = $"XMM{OpInfo}({OpInfo})"; + NextFrameOffset = (int)NativeReader.ReadUInt16(image, ref offset) * 16; + } + break; + case UnwindOpCodes.UWOP_SAVE_XMM128_FAR: + { + OpInfoStr = $"XMM{OpInfo}({OpInfo})"; + uint nextOffset = NativeReader.ReadUInt16(image, ref offset); + NextFrameOffset = (int)((uint)(NativeReader.ReadUInt16(image, ref offset) << 16) | nextOffset); + } + break; + default: + throw new NotImplementedException(UnwindOp.ToString()); + } + + NextFrameOffset = frameOffset; } } @@ -94,8 +163,8 @@ public class UnwindInfo : BaseUnwindInfo public byte CountOfUnwindCodes { get; set; } public Registers FrameRegister { get; set; } //4 bits public byte FrameOffset { get; set; } //4 bits - public UnwindCode[] UnwindCodeArray { get; set; } - public Dictionary> UnwindCodes { get; set; } + public Dictionary CodeOffsetToUnwindCodeIndex { get; set; } + public List UnwindCodes { get; set; } public uint PersonalityRoutineRVA { get; set; } public UnwindInfo() { } @@ -114,23 +183,19 @@ public UnwindInfo(byte[] image, int offset) FrameRegister = (Registers)(frameRegisterAndOffset & 15); FrameOffset = (byte)(frameRegisterAndOffset >> 4); - UnwindCodeArray = new UnwindCode[CountOfUnwindCodes]; - UnwindCodes = new Dictionary>(); - for (int i = 0; i < CountOfUnwindCodes; i++) + UnwindCodes = new List(CountOfUnwindCodes); + CodeOffsetToUnwindCodeIndex = new Dictionary(); + int frameOffset = FrameOffset; + int sizeOfUnwindCodes = CountOfUnwindCodes * _sizeofUnwindCode; + int endOffset = offset + sizeOfUnwindCodes; + while (offset < endOffset) { - UnwindCodeArray[i] = new UnwindCode(image, i, ref offset); - } - for (int i = 0; i < CountOfUnwindCodes; i++) - { - ParseUnwindCode(ref i); - if (!UnwindCodes.ContainsKey(UnwindCodeArray[i].CodeOffset)) - { - UnwindCodes[UnwindCodeArray[i].CodeOffset] = new List(); - } - UnwindCodes[UnwindCodeArray[i].CodeOffset].Add(UnwindCodeArray[i]); + UnwindCode unwindCode = new UnwindCode(image, ref frameOffset, ref offset); + CodeOffsetToUnwindCodeIndex.Add(unwindCode.CodeOffset, UnwindCodes.Count); + UnwindCodes.Add(unwindCode); } - Size = _offsetofUnwindCode + CountOfUnwindCodes * _sizeofUnwindCode; + Size = _offsetofUnwindCode + sizeOfUnwindCodes; int alignmentPad = -Size & 3; Size += alignmentPad + sizeof(uint); @@ -166,16 +231,14 @@ public override string ToString() sb.AppendLine($" FrameOffset: {FrameOffset}"); sb.AppendLine($" Unwind Codes:"); sb.AppendLine($" ------------------"); - for (int i = 0; i < CountOfUnwindCodes; i++) + foreach (UnwindCode unwindCode in UnwindCodes) { - if (!UnwindCodeArray[i].IsOpInfo) - continue; - sb.AppendLine($" CodeOffset: 0x{UnwindCodeArray[i].CodeOffset:X2}"); - sb.AppendLine($" UnwindOp: {UnwindCodeArray[i].UnwindOp}({(byte)UnwindCodeArray[i].UnwindOp})"); - sb.AppendLine($" OpInfo: {UnwindCodeArray[i].OpInfoStr}"); - if (UnwindCodeArray[i].NextFrameOffset != -1) + sb.AppendLine($" CodeOffset: 0x{unwindCode.CodeOffset:X2}"); + sb.AppendLine($" UnwindOp: {unwindCode.UnwindOp}({(byte)unwindCode.UnwindOp})"); + sb.AppendLine($" OpInfo: {unwindCode.OpInfoStr}"); + if (unwindCode.NextFrameOffset != -1) { - sb.AppendLine($" FrameOffset: {UnwindCodeArray[i].NextFrameOffset}"); + sb.AppendLine($" FrameOffset: {unwindCode.NextFrameOffset}"); } sb.AppendLine($" ------------------"); } @@ -185,98 +248,5 @@ public override string ToString() return sb.ToString(); } - /// - /// based on src\jit\unwindamd64.cpp DumpUnwindInfo - /// - private void ParseUnwindCode(ref int i) - { - UnwindCode code = UnwindCodeArray[i]; - code.IsOpInfo = true; - switch (code.UnwindOp) - { - case UnwindOpCodes.UWOP_PUSH_NONVOL: - code.OpInfoStr = $"{(Registers)code.OpInfo}({code.OpInfo})"; - break; - case UnwindOpCodes.UWOP_ALLOC_LARGE: - code.OpInfoStr = $"{code.OpInfo} - "; - if (code.OpInfo == 0) - { - i++; - UnwindCodeArray[i].OpInfoStr += "Scaled small"; - code.NextFrameOffset = (int)UnwindCodeArray[i].FrameOffset * 8; - } - else if (code.OpInfo == 1) - { - i++; - UnwindCodeArray[i].OpInfoStr += "Unscaled large"; - uint offset = UnwindCodeArray[i].FrameOffset; - i++; - offset = ((UnwindCodeArray[i].FrameOffset << 16) | offset); - code.NextFrameOffset = (int)offset; - } - else - { - code.OpInfoStr += "Unknown"; - } - break; - case UnwindOpCodes.UWOP_ALLOC_SMALL: - int opInfo = code.OpInfo * 8 + 8; - code.OpInfoStr = $"{opInfo}"; - break; - case UnwindOpCodes.UWOP_SET_FPREG: - code.OpInfoStr = $"Unused({code.OpInfo})"; - break; - case UnwindOpCodes.UWOP_SET_FPREG_LARGE: - { - code.OpInfoStr = $"Unused({code.OpInfo})"; - i++; - uint offset = UnwindCodeArray[i].FrameOffset; - i++; - offset = ((UnwindCodeArray[i].FrameOffset << 16) | offset); - code.NextFrameOffset = (int)offset * 16; - if ((UnwindCodeArray[i].FrameOffset & 0xF0000000) != 0) - { - throw new BadImageFormatException("Warning: Illegal unwindInfo unscaled offset: too large"); - } - } - break; - case UnwindOpCodes.UWOP_SAVE_NONVOL: - { - code.OpInfoStr = $"{(Registers)code.OpInfo}({code.OpInfo})"; - i++; - uint offset = UnwindCodeArray[i].FrameOffset * 8; - code.NextFrameOffset = (int)offset; - } - break; - case UnwindOpCodes.UWOP_SAVE_NONVOL_FAR: - { - code.OpInfoStr = $"{(Registers)code.OpInfo}({code.OpInfo})"; - i++; - uint offset = UnwindCodeArray[i].FrameOffset; - i++; - offset = ((UnwindCodeArray[i].FrameOffset << 16) | offset); - code.NextFrameOffset = (int)offset; - } - break; - case UnwindOpCodes.UWOP_SAVE_XMM128: - { - code.OpInfoStr = $"XMM{code.OpInfo}({code.OpInfo})"; - i++; - uint offset = UnwindCodeArray[i].FrameOffset * 16; - code.NextFrameOffset = (int)offset; - } - break; - case UnwindOpCodes.UWOP_SAVE_XMM128_FAR: - { - code.OpInfoStr = $"XMM{code.OpInfo}({code.OpInfo})"; - i++; - uint offset = UnwindCodeArray[i].FrameOffset; - i++; - offset = ((UnwindCodeArray[i].FrameOffset << 16) | offset); - code.NextFrameOffset = (int)offset; - } - break; - } - } } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs index 706e98780acb..8a6766d42945 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs @@ -17,15 +17,15 @@ namespace ILCompiler.Reflection.ReadyToRun /// public class DebugInfo { - private readonly ReadyToRunReader _readyToRunReader; + private readonly RuntimeFunction _runtimeFunction; private readonly int _offset; private List _boundsList; private List _variablesList; private Machine _machine; - public DebugInfo(ReadyToRunReader readyToRunReader, int offset) + public DebugInfo(RuntimeFunction runtimeFunction, int offset) { - this._readyToRunReader = readyToRunReader; + this._runtimeFunction = runtimeFunction; this._offset = offset; } @@ -83,6 +83,7 @@ private void EnsureInitialized() { return; } + ReadyToRunReader _readyToRunReader = _runtimeFunction.ReadyToRunReader; int offset = _offset; _boundsList = new List(); _variablesList = new List(); @@ -156,6 +157,19 @@ private void ParseNativeVarInfo(byte[] image, int offset) entry.StartOffset = reader.ReadUInt(); entry.EndOffset = entry.StartOffset + reader.ReadUInt(); entry.VariableNumber = (uint)(reader.ReadUInt() + (int)ImplicitILArguments.Max); + entry.Variable = new Variable(); + // TODO: This is probably incomplete + // This does not handle any implicit arguments or var args + if (entry.VariableNumber < this._runtimeFunction.Method.Signature.ParameterTypes.Length) + { + entry.Variable.Type = VariableType.Parameter; + entry.Variable.Index = (int)entry.VariableNumber; + } + else + { + entry.Variable.Type = VariableType.Local; + entry.Variable.Index = (int)entry.VariableNumber - this._runtimeFunction.Method.Signature.ParameterTypes.Length; + } var varLoc = new VarLoc(); varLoc.VarLocType = (VarLocType)reader.ReadUInt(); diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfoTypes.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfoTypes.cs index 73782f2344c3..eef0ab4673cb 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfoTypes.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfoTypes.cs @@ -17,10 +17,25 @@ public struct NativeVarInfo { public uint StartOffset; public uint EndOffset; + // TODO: Eliminate this public uint VariableNumber; + public Variable Variable { get; internal set; } public VarLoc VariableLocation; } + public enum VariableType + { + Parameter, + Local, + // TODO: Special + } + + public class Variable + { + public VariableType Type { get; internal set; } + public int Index { get; internal set; } + } + [Flags] public enum SourceTypes { diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/EHInfo.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/EHInfo.cs index 32e4eab6d609..ccb3e0d9ba36 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/EHInfo.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/EHInfo.cs @@ -101,7 +101,7 @@ public EHClause(ReadyToRunReader reader, int offset) } else { - ClassName = MetadataNameFormatter.FormatHandle(reader.GetGlobalMetadataReader(), MetadataTokens.Handle((int)ClassTokenOrFilterOffset)); + ClassName = MetadataNameFormatter.FormatHandle(reader.GetGlobalMetadata()?.MetadataReader, MetadataTokens.Handle((int)ClassTokenOrFilterOffset)); } } } @@ -111,13 +111,21 @@ public EHClause(ReadyToRunReader reader, int offset) /// /// Output writer for the textual representation /// Starting RVA of the runtime function is used to display the try / handler info as RVA intervals - public void WriteTo(TextWriter writer, int methodRva) + public void WriteTo(TextWriter writer, int methodRva, bool dumpRva) { writer.Write($@"Flags {(uint)Flags:X2} "); - writer.Write($@"TryOff {TryOffset:X4} (RVA {(TryOffset + methodRva):X4}) "); - writer.Write($@"TryEnd {TryEnd:X4} (RVA {(TryEnd + methodRva):X4}) "); - writer.Write($@"HndOff {HandlerOffset:X4} (RVA {(HandlerOffset + methodRva):X4}) "); - writer.Write($@"HndEnd {HandlerEnd:X4} (RVA {(HandlerEnd + methodRva):X4}) "); + writer.Write($@"TryOff {TryOffset:X4} "); + if (dumpRva) + writer.Write(@"(RVA {(TryOffset + methodRva):X4}) "); + writer.Write($@"TryEnd {TryEnd:X4} "); + if (dumpRva) + writer.Write(@"(RVA {(TryEnd + methodRva):X4}) "); + writer.Write($@"HndOff {HandlerOffset:X4} "); + if (dumpRva) + writer.Write(@"(RVA {(HandlerOffset + methodRva):X4}) "); + writer.Write($@"HndEnd {HandlerEnd:X4} "); + if (dumpRva) + writer.Write(@"(RVA {(HandlerEnd + methodRva):X4}) "); writer.Write($@"ClsFlt {ClassTokenOrFilterOffset:X4}"); switch (Flags & CorExceptionFlag.COR_ILEXCEPTION_CLAUSE_KIND_MASK) @@ -220,11 +228,11 @@ private void EnsureClauses() /// /// Emit the textual representation of the EH info into a given writer. /// - public void WriteTo(TextWriter writer) + public void WriteTo(TextWriter writer, bool dumpRva) { foreach (EHClause ehClause in EHClauses) { - ehClause.WriteTo(writer, MethodRelativeVirtualAddress); + ehClause.WriteTo(writer, MethodRelativeVirtualAddress, dumpRva: dumpRva); writer.WriteLine(); } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/IAssemblyMetadata.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/IAssemblyMetadata.cs new file mode 100644 index 000000000000..5a49d9a06b82 --- /dev/null +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/IAssemblyMetadata.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.Reflection.Metadata; +using System.Reflection.PortableExecutable; + +namespace ILCompiler.Reflection.ReadyToRun +{ + /// + /// This interface represents MSIL information for a single component assembly. + /// + public interface IAssemblyMetadata + { + PEReader ImageReader { get; } + + MetadataReader MetadataReader { get; } + } +} diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/IAssemblyResolver.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/IAssemblyResolver.cs index 411aabe6e50a..c9f7ddcdd297 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/IAssemblyResolver.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/IAssemblyResolver.cs @@ -7,11 +7,14 @@ namespace ILCompiler.Reflection.ReadyToRun { public interface IAssemblyResolver { - MetadataReader FindAssembly(MetadataReader metadataReader, AssemblyReferenceHandle assemblyReferenceHandle, string parentFile); - MetadataReader FindAssembly(string simpleName, string parentFile); - // TODO (refactoring) - signature formatting options should be independent of assembly resolver - bool Naked { get; } - bool SignatureBinary { get; } - bool InlineSignatureBinary { get; } + IAssemblyMetadata FindAssembly(MetadataReader metadataReader, AssemblyReferenceHandle assemblyReferenceHandle, string parentFile); + IAssemblyMetadata FindAssembly(string simpleName, string parentFile); + } + + public class SignatureFormattingOptions + { + public bool Naked { get; set; } + public bool SignatureBinary { get; set; } + public bool InlineSignatureBinary { get; set; } } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj index 02f0d8e08038..d65d6047adeb 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ILCompiler.Reflection.ReadyToRun.csproj @@ -11,7 +11,7 @@ false 8002,NU1701 win-x64;win-x86 - $(BinDir) + $(RuntimeBinDir) AnyCPU;x64 AnyCPU 7.3 diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunImportSection.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunImportSection.cs index 771e6dd65817..782638b7983a 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunImportSection.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunImportSection.cs @@ -21,14 +21,14 @@ public class ImportSectionEntry public int StartRVA { get; set; } public long Section { get; set; } public uint SignatureRVA { get; set; } - public string Signature { get; set; } + public ReadyToRunSignature Signature { get; set; } public GCRefMap GCRefMap { get; set; } public ImportSectionEntry() { } - public ImportSectionEntry(int index, int startOffset, int startRVA, long section, uint signatureRVA, string signature) + public ImportSectionEntry(int index, int startOffset, int startRVA, long section, uint signatureRVA, ReadyToRunSignature signature) { Index = index; StartOffset = startOffset; diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs index a00419f212c4..10b4af9a61c2 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs @@ -22,25 +22,25 @@ namespace ILCompiler.Reflection.ReadyToRun /// public struct FixupCell { - public int Index { get; set; } + public int Index { get; } /// /// Zero-based index of the import table within the import tables section. /// - public uint TableIndex; + public uint TableIndex { get; } /// /// Zero-based offset of the entry in the import table; it must be a multiple /// of the target architecture pointer size. /// - public uint CellOffset; + public uint CellOffset { get; } /// - /// Fixup cell signature (textual representation of the typesystem object). + /// Fixup cell signature /// - public string Signature; + public ReadyToRunSignature Signature { get; } - public FixupCell(int index, uint tableIndex, uint cellOffset, string signature) + public FixupCell(int index, uint tableIndex, uint cellOffset, ReadyToRunSignature signature) { Index = index; TableIndex = tableIndex; @@ -144,12 +144,24 @@ public DebugInfo DebugInfo { if (_debugInfo == null) { - _readyToRunReader.RuntimeFunctionToDebugInfo.TryGetValue(Id, out _debugInfo); + int offset; + if (_readyToRunReader.RuntimeFunctionToDebugInfo.TryGetValue(Id, out offset)) + { + this._debugInfo = new DebugInfo(this, offset); + } } return _debugInfo; } } + internal ReadyToRunReader ReadyToRunReader + { + get + { + return _readyToRunReader; + } + } + public RuntimeFunction( ReadyToRunReader readyToRunReader, int id, @@ -202,9 +214,9 @@ public class ReadyToRunMethod private const int _mdtMethodDef = 0x06000000; /// - /// MetadataReader representing the method module. + /// MSIL module containing the method. /// - public MetadataReader MetadataReader { get; private set; } + public IAssemblyMetadata ComponentReader { get; private set; } /// /// The name of the method @@ -218,6 +230,8 @@ public class ReadyToRunMethod public MethodSignature Signature { get; } + public ImmutableArray LocalSignature { get; } + /// /// The type that the method belongs to /// @@ -282,7 +296,7 @@ public IReadOnlyList Fixups /// public ReadyToRunMethod( ReadyToRunReader readyToRunReader, - MetadataReader metadataReader, + IAssemblyMetadata componentReader, EntityHandle methodHandle, int entryPointId, string owningType, @@ -295,7 +309,7 @@ public ReadyToRunMethod( MethodHandle = methodHandle; EntryPointRuntimeFunctionId = entryPointId; - MetadataReader = metadataReader; + ComponentReader = componentReader; EntityHandle owningTypeHandle; GenericParameterHandleCollection genericParams = default(GenericParameterHandleCollection); @@ -308,8 +322,17 @@ public ReadyToRunMethod( { case HandleKind.MethodDefinition: { - MethodDefinition methodDef = MetadataReader.GetMethodDefinition((MethodDefinitionHandle)MethodHandle); - Name = MetadataReader.GetString(methodDef.Name); + MethodDefinition methodDef = ComponentReader.MetadataReader.GetMethodDefinition((MethodDefinitionHandle)MethodHandle); + if (methodDef.RelativeVirtualAddress != 0) + { + MethodBodyBlock mbb = ComponentReader.ImageReader.GetMethodBody(methodDef.RelativeVirtualAddress); + if (!mbb.LocalSignature.IsNil) + { + StandaloneSignature ss = ComponentReader.MetadataReader.GetStandaloneSignature(mbb.LocalSignature); + LocalSignature = ss.DecodeLocalSignature(typeProvider, genericContext); + } + } + Name = ComponentReader.MetadataReader.GetString(methodDef.Name); Signature = methodDef.DecodeSignature(typeProvider, genericContext); owningTypeHandle = methodDef.GetDeclaringType(); genericParams = methodDef.GetGenericParameters(); @@ -318,8 +341,8 @@ public ReadyToRunMethod( case HandleKind.MemberReference: { - MemberReference memberRef = MetadataReader.GetMemberReference((MemberReferenceHandle)MethodHandle); - Name = MetadataReader.GetString(memberRef.Name); + MemberReference memberRef = ComponentReader.MetadataReader.GetMemberReference((MemberReferenceHandle)MethodHandle); + Name = ComponentReader.MetadataReader.GetString(memberRef.Name); Signature = memberRef.DecodeMethodSignature(typeProvider, genericContext); owningTypeHandle = memberRef.Parent; } @@ -335,7 +358,7 @@ public ReadyToRunMethod( } else { - DeclaringType = MetadataNameFormatter.FormatHandle(MetadataReader, owningTypeHandle); + DeclaringType = MetadataNameFormatter.FormatHandle(ComponentReader.MetadataReader, owningTypeHandle); } StringBuilder sb = new StringBuilder(); @@ -435,20 +458,26 @@ private void ParseRuntimeFunctions() { int runtimeFunctionId = EntryPointRuntimeFunctionId; int runtimeFunctionSize = _readyToRunReader.CalculateRuntimeFunctionSize(); - int runtimeFunctionOffset = _readyToRunReader.PEReader.GetOffset(_readyToRunReader.ReadyToRunHeader.Sections[ReadyToRunSectionType.RuntimeFunctions].RelativeVirtualAddress); + int runtimeFunctionOffset = _readyToRunReader.CompositeReader.GetOffset(_readyToRunReader.ReadyToRunHeader.Sections[ReadyToRunSectionType.RuntimeFunctions].RelativeVirtualAddress); int curOffset = runtimeFunctionOffset + runtimeFunctionId * runtimeFunctionSize; BaseGcInfo gcInfo = null; int codeOffset = 0; for (int i = 0; i < RuntimeFunctionCount; i++) { int startRva = NativeReader.ReadInt32(_readyToRunReader.Image, ref curOffset); + if (_readyToRunReader.Machine == Machine.ArmThumb2) + { + // The low bit of this address is set since the function contains thumb code. + // Clear this bit in order to get the "real" RVA of the start of the function. + startRva = (int)(startRva & ~1); + } int endRva = -1; if (_readyToRunReader.Machine == Machine.Amd64) { endRva = NativeReader.ReadInt32(_readyToRunReader.Image, ref curOffset); } int unwindRva = NativeReader.ReadInt32(_readyToRunReader.Image, ref curOffset); - int unwindOffset = _readyToRunReader.PEReader.GetOffset(unwindRva); + int unwindOffset = _readyToRunReader.CompositeReader.GetOffset(unwindRva); BaseUnwindInfo unwindInfo = null; if (_readyToRunReader.Machine == Machine.Amd64) diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs index a829b58599e5..f0e843174c54 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunReader.cs @@ -54,19 +54,14 @@ public sealed class ReadyToRunReader /// /// MetadataReader for the system module (normally System.Private.CoreLib) /// - private MetadataReader _systemModuleReader; + private IAssemblyMetadata _systemModuleReader; private readonly IAssemblyResolver _assemblyResolver; /// /// Reference assembly cache indexed by module indices as used in signatures /// - private List _assemblyCache; - - /// - /// Assembly headers for composite R2R images - /// - private List _assemblyHeaders; + private List _assemblyCache; // Header private OperatingSystem _operatingSystem; @@ -80,7 +75,7 @@ public sealed class ReadyToRunReader private List _readyToRunAssemblyHeaders; // DebugInfo - private Dictionary _runtimeFunctionToDebugInfo; + private Dictionary _runtimeFunctionIdToDebugOffset; // ManifestReferences private MetadataReader _manifestReader; @@ -96,7 +91,6 @@ public sealed class ReadyToRunReader // ImportSections private List _importSections; - private Dictionary _importCellNames; private Dictionary _importSignatures; // AvailableType @@ -109,7 +103,7 @@ public sealed class ReadyToRunReader /// Underlying PE image reader is used to access raw PE structures like header /// or section list. /// - public PEReader PEReader { get; private set; } + public PEReader CompositeReader { get; private set; } /// /// Byte array containing the ReadyToRun image @@ -296,19 +290,6 @@ public IReadOnlyList ImportSections } } - /// - /// Map from import cell addresses to their symbolic names. - /// - public IReadOnlyDictionary ImportCellNames - { - get - { - EnsureImportSections(); - return _importCellNames; - } - - } - /// /// Map from import cell addresses to their symbolic names. /// @@ -322,12 +303,12 @@ public IReadOnlyDictionary ImportSignatures } - internal Dictionary RuntimeFunctionToDebugInfo + internal Dictionary RuntimeFunctionToDebugInfo { get { EnsureDebugInfo(); - return _runtimeFunctionToDebugInfo; + return _runtimeFunctionIdToDebugOffset; } } @@ -363,10 +344,10 @@ internal MetadataReader ManifestReader /// /// PE image /// The Cor header flag must be ILLibrary - public ReadyToRunReader(IAssemblyResolver assemblyResolver, MetadataReader metadata, PEReader peReader, string filename) + public ReadyToRunReader(IAssemblyResolver assemblyResolver, IAssemblyMetadata metadata, PEReader peReader, string filename) { _assemblyResolver = assemblyResolver; - PEReader = peReader; + CompositeReader = peReader; Filename = filename; Initialize(metadata); } @@ -383,32 +364,31 @@ public unsafe ReadyToRunReader(IAssemblyResolver assemblyResolver, string filena Initialize(metadata: null); } - private unsafe void Initialize(MetadataReader metadata) + private unsafe void Initialize(IAssemblyMetadata metadata) { - _assemblyCache = new List(); - _assemblyHeaders = new List(); + _assemblyCache = new List(); - if (PEReader == null) + if (CompositeReader == null) { byte[] image = File.ReadAllBytes(Filename); Image = image; - PEReader = new PEReader(Unsafe.As>(ref image)); + CompositeReader = new PEReader(Unsafe.As>(ref image)); } else { - ImmutableArray content = PEReader.GetEntireImage().GetContent(); + ImmutableArray content = CompositeReader.GetEntireImage().GetContent(); Image = Unsafe.As, byte[]>(ref content); } - if (metadata == null && PEReader.HasMetadata) + if (metadata == null && CompositeReader.HasMetadata) { - metadata = PEReader.GetMetadataReader(); + metadata = new StandaloneAssemblyMetadata(CompositeReader); } if (metadata != null) { - if ((PEReader.PEHeaders.CorHeader.Flags & CorFlags.ILLibrary) == 0) + if ((CompositeReader.PEHeaders.CorHeader.Flags & CorFlags.ILLibrary) == 0) { if (!TryLocateNativeReadyToRunHeader()) throw new BadImageFormatException("The file is not a ReadyToRun image"); @@ -419,7 +399,7 @@ private unsafe void Initialize(MetadataReader metadata) { _assemblyCache.Add(metadata); - DirectoryEntry r2rHeaderDirectory = PEReader.PEHeaders.CorHeader.ManagedNativeHeaderDirectory; + DirectoryEntry r2rHeaderDirectory = CompositeReader.PEHeaders.CorHeader.ManagedNativeHeaderDirectory; _readyToRunHeaderRVA = r2rHeaderDirectory.RelativeVirtualAddress; Debug.Assert(!Composite); } @@ -490,7 +470,7 @@ public IReadOnlyDictionary GetCustomMethodToRuntimeFu private bool TryLocateNativeReadyToRunHeader() { - PEExportTable exportTable = PEReader.GetExportTable(); + PEExportTable exportTable = CompositeReader.GetExportTable(); if (exportTable.TryGetValue("RTR_HEADER", out _readyToRunHeaderRVA)) { _composite = true; @@ -499,7 +479,7 @@ private bool TryLocateNativeReadyToRunHeader() return false; } - private MetadataReader GetSystemModuleMetadataReader() + private IAssemblyMetadata GetSystemModuleMetadataReader() { if (_systemModuleReader == null) { @@ -511,7 +491,7 @@ private MetadataReader GetSystemModuleMetadataReader() return _systemModuleReader; } - public MetadataReader GetGlobalMetadataReader() + public IAssemblyMetadata GetGlobalMetadata() { EnsureHeader(); return (_composite ? null : _assemblyCache[0]); @@ -523,7 +503,7 @@ private unsafe void EnsureHeader() { return; } - uint machine = (uint)PEReader.PEHeaders.CoffHeader.Machine; + uint machine = (uint)CompositeReader.PEHeaders.CoffHeader.Machine; _operatingSystem = OperatingSystem.Unknown; foreach (OperatingSystem os in Enum.GetValues(typeof(OperatingSystem))) { @@ -568,7 +548,7 @@ private unsafe void EnsureHeader() } - _imageBase = PEReader.PEHeaders.PEHeader.ImageBase; + _imageBase = CompositeReader.PEHeaders.PEHeader.ImageBase; // Initialize R2RHeader Debug.Assert(_readyToRunHeaderRVA != 0); @@ -583,11 +563,11 @@ private unsafe void EnsureHeader() private void EnsureDebugInfo() { - if (_runtimeFunctionToDebugInfo != null) + if (_runtimeFunctionIdToDebugOffset != null) { return; } - _runtimeFunctionToDebugInfo = new Dictionary(); + _runtimeFunctionIdToDebugOffset = new Dictionary(); if (!ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.DebugInfo, out ReadyToRunSection debugInfoSection)) { return; @@ -604,8 +584,7 @@ private void EnsureDebugInfo() continue; } - var debugInfo = new DebugInfo(this, offset); - _runtimeFunctionToDebugInfo.Add((int)i, debugInfo); + _runtimeFunctionIdToDebugOffset.Add((int)i, offset); } } @@ -671,20 +650,6 @@ private unsafe void EnsureExceptionInfo() } } - public bool InputArchitectureSupported() - { - return Machine != Machine.ArmThumb2; // CoreDisTools often fails to decode when disassembling ARM images (see https://github.com/dotnet/coreclr/issues/19637) - } - - // TODO: Fix R2RDump issue where an R2R image cannot be dissassembled with the x86 CoreDisTools - // For the short term, we want to error out with a decent message explaining the unexpected error - // Issue https://github.com/dotnet/coreclr/issues/19564 - public bool DisassemblerArchitectureSupported() - { - System.Runtime.InteropServices.Architecture val = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture; - return val != System.Runtime.InteropServices.Architecture.X86; - } - /// /// Each runtime function entry has 3 fields for Amd64 machines (StartAddress, EndAddress, UnwindRVA), otherwise 2 fields (StartAddress, UnwindRVA) /// @@ -700,12 +665,12 @@ internal int CalculateRuntimeFunctionSize() /// /// Initialize non-generic R2RMethods with method signatures from MethodDefHandle, and runtime function indices from MethodDefEntryPoints /// - private void ParseMethodDefEntrypoints(Action methodDefSectionReader) + private void ParseMethodDefEntrypoints(Action methodDefSectionReader) { ReadyToRunSection methodEntryPointSection; if (ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.MethodDefEntryPoints, out methodEntryPointSection)) { - methodDefSectionReader(methodEntryPointSection, GetGlobalMetadataReader()); + methodDefSectionReader(methodEntryPointSection, GetGlobalMetadata()); } else if (ReadyToRunAssemblyHeaders != null) { @@ -724,9 +689,9 @@ private void ParseMethodDefEntrypoints(Action /// are method entrypoints are stored separately for each component assembly of the composite R2R executable. /// /// Method entrypoint section to parse - /// ECMA metadata reader representing this method entrypoint section + /// Assembly metadata reader representing this method entrypoint section /// Set to true for each runtime function index representing a method entrypoint - private void ParseMethodDefEntrypointsSection(ReadyToRunSection section, MetadataReader metadataReader, bool[] isEntryPoint) + private void ParseMethodDefEntrypointsSection(ReadyToRunSection section, IAssemblyMetadata componentReader, bool[] isEntryPoint) { int methodDefEntryPointsOffset = GetOffset(section.RelativeVirtualAddress); NativeArray methodEntryPoints = new NativeArray(Image, (uint)methodDefEntryPointsOffset); @@ -741,7 +706,7 @@ private void ParseMethodDefEntrypointsSection(ReadyToRunSection section, Metadat int runtimeFunctionId; int? fixupOffset; GetRuntimeFunctionIndexFromOffset(offset, out runtimeFunctionId, out fixupOffset); - ReadyToRunMethod method = new ReadyToRunMethod(this, metadataReader, methodHandle, runtimeFunctionId, owningType: null, constrainedType: null, instanceArgs: null, fixupOffset: fixupOffset); + ReadyToRunMethod method = new ReadyToRunMethod(this, componentReader, methodHandle, runtimeFunctionId, owningType: null, constrainedType: null, instanceArgs: null, fixupOffset: fixupOffset); if (method.EntryPointRuntimeFunctionId < 0 || method.EntryPointRuntimeFunctionId >= isEntryPoint.Length) { @@ -757,7 +722,6 @@ private void ParseMethodDefEntrypointsSection(ReadyToRunSection section, Metadat } } } - /// /// Parse a single method def entrypoint section. For composite R2R images, this method is called multiple times /// are method entrypoints are stored separately for each component assembly of the composite R2R executable. @@ -765,7 +729,7 @@ private void ParseMethodDefEntrypointsSection(ReadyToRunSection section, Metadat /// Method entrypoint section to parse /// ECMA metadata reader representing this method entrypoint section /// Set to true for each runtime function index representing a method entrypoint - private void ParseMethodDefEntrypointsSectionCustom(IR2RSignatureTypeProvider provider, Dictionary foundMethods, ReadyToRunSection section, MetadataReader metadataReader) + private void ParseMethodDefEntrypointsSectionCustom(IR2RSignatureTypeProvider provider, Dictionary foundMethods, ReadyToRunSection section, IAssemblyMetadata metadataReader) { int methodDefEntryPointsOffset = GetOffset(section.RelativeVirtualAddress); NativeArray methodEntryPoints = new NativeArray(Image, (uint)methodDefEntryPointsOffset); @@ -781,7 +745,7 @@ private void ParseMethodDefEntrypointsSectionCustom(provider, default(TGenericContext), mdReader, this, (int)curParser.Offset); + IAssemblyMetadata mdReader = GetGlobalMetadata(); + var decoder = new R2RSignatureDecoder(provider, default(TGenericContext), mdReader.MetadataReader, this, (int)curParser.Offset); TMethod customMethod = decoder.ParseMethod(); @@ -837,8 +801,9 @@ private void ParseInstanceMethodEntrypoints(bool[] isEntryPoint) NativeParser curParser = allEntriesEnum.GetNext(); while (!curParser.IsNull()) { - MetadataReader mdReader = _composite ? null : _assemblyCache[0]; - SignatureDecoder decoder = new SignatureDecoder(_assemblyResolver, mdReader, this, (int)curParser.Offset); + IAssemblyMetadata mdReader = GetGlobalMetadata(); + SignatureFormattingOptions dummyOptions = new SignatureFormattingOptions(); + SignatureDecoder decoder = new SignatureDecoder(_assemblyResolver, dummyOptions, mdReader?.MetadataReader, this, (int)curParser.Offset); string owningType = null; @@ -943,7 +908,7 @@ private void EnsureAvailableTypes() ReadyToRunSection availableTypesSection; if (ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.AvailableTypes, out availableTypesSection)) { - ParseAvailableTypesSection(availableTypesSection, GetGlobalMetadataReader()); + ParseAvailableTypesSection(availableTypesSection, GetGlobalMetadata()); } else if (_readyToRunAssemblyHeaders != null) { @@ -963,7 +928,7 @@ private void EnsureAvailableTypes() /// as available types are stored separately for each component assembly of the composite R2R executable. /// /// - private void ParseAvailableTypesSection(ReadyToRunSection availableTypesSection, MetadataReader metadataReader) + private void ParseAvailableTypesSection(ReadyToRunSection availableTypesSection, IAssemblyMetadata metadataReader) { int availableTypesOffset = GetOffset(availableTypesSection.RelativeVirtualAddress); NativeParser parser = new NativeParser(Image, (uint)availableTypesOffset); @@ -980,7 +945,7 @@ private void ParseAvailableTypesSection(ReadyToRunSection availableTypesSection, if (isExportedType) { ExportedTypeHandle exportedTypeHandle = MetadataTokens.ExportedTypeHandle((int)rid); - string exportedTypeName = GetExportedTypeFullName(metadataReader, exportedTypeHandle); + string exportedTypeName = GetExportedTypeFullName(metadataReader.MetadataReader, exportedTypeHandle); if (!AvailableTypes.TryGetValue(availableTypesSection, out List sectionTypes)) { sectionTypes = new List(); @@ -991,7 +956,7 @@ private void ParseAvailableTypesSection(ReadyToRunSection availableTypesSection, else { TypeDefinitionHandle typeDefHandle = MetadataTokens.TypeDefinitionHandle((int)rid); - string typeDefName = MetadataNameFormatter.FormatHandle(metadataReader, typeDefHandle); + string typeDefName = MetadataNameFormatter.FormatHandle(metadataReader.MetadataReader, typeDefHandle); if (!AvailableTypes.TryGetValue(availableTypesSection, out List sectionTypes)) { sectionTypes = new List(); @@ -1060,7 +1025,6 @@ private void EnsureImportSections() return; } _importSections = new List(); - _importCellNames = new Dictionary(); _importSignatures = new Dictionary(); if (!ReadyToRunHeader.Sections.TryGetValue(ReadyToRunSectionType.ImportSections, out ReadyToRunSection importSectionsSection)) { @@ -1114,10 +1078,8 @@ private void EnsureImportSections() long section = NativeReader.ReadInt64(Image, ref sectionOffset); uint sigRva = NativeReader.ReadUInt32(Image, ref signatureOffset); int sigOffset = GetOffset((int)sigRva); - ReadyToRunSignature signature; - string cellName = MetadataNameFormatter.FormatSignature(_assemblyResolver, this, sigOffset, out signature); - entries.Add(new ReadyToRunImportSection.ImportSectionEntry(entries.Count, entryOffset, entryOffset + rva, section, sigRva, cellName)); - _importCellNames.Add(rva + entrySize * i, cellName); + ReadyToRunSignature signature = MetadataNameFormatter.FormatSignature(_assemblyResolver, this, sigOffset); + entries.Add(new ReadyToRunImportSection.ImportSectionEntry(entries.Count, entryOffset, entryOffset + rva, section, sigRva, signature)); _importSignatures.Add(rva + entrySize * i, signature); } @@ -1137,7 +1099,7 @@ private void EnsureImportSections() /// The relative virtual address public int GetOffset(int rva) { - return PEReader.GetOffset(rva); + return CompositeReader.GetOffset(rva); } /// @@ -1196,11 +1158,11 @@ private AssemblyReferenceHandle GetAssemblyAtIndex(int refAsmIndex, out Metadata { Debug.Assert(refAsmIndex != 0); - int assemblyRefCount = (_composite ? 0 : _assemblyCache[0].GetTableRowCount(TableIndex.AssemblyRef) + 1); + int assemblyRefCount = (_composite ? 0 : _assemblyCache[0].MetadataReader.GetTableRowCount(TableIndex.AssemblyRef) + 1); AssemblyReferenceHandle assemblyReferenceHandle; if (refAsmIndex < assemblyRefCount) { - metadataReader = _assemblyCache[0]; + metadataReader = _assemblyCache[0].MetadataReader; assemblyReferenceHandle = MetadataTokens.AssemblyReferenceHandle(refAsmIndex); } else @@ -1223,9 +1185,9 @@ internal string GetReferenceAssemblyName(int refAsmIndex) /// /// Reference assembly index /// MetadataReader instance representing the reference assembly - internal MetadataReader OpenReferenceAssembly(int refAsmIndex) + internal IAssemblyMetadata OpenReferenceAssembly(int refAsmIndex) { - MetadataReader result = (refAsmIndex < _assemblyCache.Count ? _assemblyCache[refAsmIndex] : null); + IAssemblyMetadata result = (refAsmIndex < _assemblyCache.Count ? _assemblyCache[refAsmIndex] : null); if (result == null) { AssemblyReferenceHandle assemblyReferenceHandle = GetAssemblyAtIndex(refAsmIndex, out MetadataReader metadataReader); diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs index c8fca51fa4be..a6ff0e78060e 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs @@ -16,8 +16,23 @@ namespace ILCompiler.Reflection.ReadyToRun /// /// This represents all possible signatures that is /// - public class ReadyToRunSignature + public abstract class ReadyToRunSignature { + private SignatureDecoder _decoder; + + public ReadyToRunSignature(SignatureDecoder decoder) + { + _decoder = decoder; + } + + public string ToString(SignatureFormattingOptions options) + { + StringBuilder builder = new StringBuilder(); + _decoder.Reset(); + _decoder.Context.Options = options; + _decoder.ReadR2RSignature(builder); + return builder.ToString(); + } } /// @@ -25,16 +40,27 @@ public class ReadyToRunSignature /// public class TodoSignature : ReadyToRunSignature { + public TodoSignature(SignatureDecoder decoder) : base(decoder) + { + } } public class MethodDefEntrySignature : ReadyToRunSignature { public uint MethodDefToken { get; set; } + + public MethodDefEntrySignature(SignatureDecoder decoder) : base(decoder) + { + } } public class MethodRefEntrySignature : ReadyToRunSignature { public uint MethodRefToken { get; set; } + + public MethodRefEntrySignature(SignatureDecoder decoder) : base(decoder) + { + } } /// @@ -64,11 +90,12 @@ public static string FormatHandle(MetadataReader metadataReader, Handle handle, return formatter.EmitHandleName(handle, namespaceQualified, owningTypeOverride, signaturePrefix); } - public static string FormatSignature(IAssemblyResolver assemblyResolver, ReadyToRunReader r2rReader, int imageOffset, out ReadyToRunSignature result) + public static ReadyToRunSignature FormatSignature(IAssemblyResolver assemblyResolver, ReadyToRunReader r2rReader, int imageOffset) { - SignatureDecoder decoder = new SignatureDecoder(assemblyResolver, r2rReader.GetGlobalMetadataReader(), r2rReader, imageOffset); - string answer = decoder.ReadR2RSignature(out result); - return answer; + SignatureFormattingOptions dummyOptions = new SignatureFormattingOptions(); + SignatureDecoder decoder = new SignatureDecoder(assemblyResolver, dummyOptions, r2rReader.GetGlobalMetadata()?.MetadataReader, r2rReader, imageOffset); + StringBuilder dummyBuilder = new StringBuilder(); + return decoder.ReadR2RSignature(dummyBuilder); } /// @@ -405,6 +432,11 @@ public class R2RSignatureDecoder /// private int _offset; + /// + /// Offset within the image file when the object is constructed. + /// + private readonly int _originalOffset; + /// /// Query signature parser for the current offset. /// @@ -431,7 +463,7 @@ public R2RSignatureDecoder(IR2RSignatureTypeProvider + /// Reset the offset back to the point where the decoder is constructed to allow re-decoding the same signature. + /// + internal void Reset() + { + this._offset = _originalOffset; + } + /// /// Read a single byte from the signature stream and advances the current offset. /// @@ -697,8 +737,8 @@ public TType ParseType() case CorElementType.ELEMENT_TYPE_MODULE_ZAPSIG: { int moduleIndex = (int)ReadUInt(); - MetadataReader refAsmReader = _contextReader.OpenReferenceAssembly(moduleIndex); - var refAsmDecoder = new R2RSignatureDecoder(_provider, Context, refAsmReader, _image, _offset, _outerReader, _contextReader); + IAssemblyMetadata refAsmReader = _contextReader.OpenReferenceAssembly(moduleIndex); + var refAsmDecoder = new R2RSignatureDecoder(_provider, Context, refAsmReader.MetadataReader, _image, _offset, _outerReader, _contextReader); var result = refAsmDecoder.ParseType(); _offset = refAsmDecoder.Offset; return result; @@ -819,15 +859,21 @@ private TMethod ParseMethodRefToken(TType owningTypeOverride) } public class TextSignatureDecoderContext { - public TextSignatureDecoderContext(IAssemblyResolver options) + public TextSignatureDecoderContext(IAssemblyResolver assemblyResolver, SignatureFormattingOptions options) { + AssemblyResolver = assemblyResolver; Options = options; } /// - /// Dump options are used to specify details of signature formatting. + /// AssemblyResolver is used to find where the dependent assembly are + /// + public IAssemblyResolver AssemblyResolver { get; } + + /// + /// SignatureFormattingOptions are used to specify details of signature formatting. /// - public IAssemblyResolver Options { get; } + public SignatureFormattingOptions Options { get; set; } } /// @@ -924,25 +970,27 @@ public string GetMethodWithFlags(ReadyToRunMethodSigFlags flags, string method) /// /// Construct the signature decoder by storing the image byte array and offset within the array. /// - /// Dump options and paths + /// Assembly Resolver used to locate dependent assembly + /// SignatureFormattingOptions for signature formatting /// R2RReader object representing the PE file containing the ECMA metadata /// Signature offset within the PE file byte array - public SignatureDecoder(IAssemblyResolver options, MetadataReader metadataReader, ReadyToRunReader r2rReader, int offset) : - base(TextTypeProvider.Singleton, new TextSignatureDecoderContext(options), metadataReader, r2rReader, offset) + public SignatureDecoder(IAssemblyResolver assemblyResolver, SignatureFormattingOptions options, MetadataReader metadataReader, ReadyToRunReader r2rReader, int offset) : + base(TextTypeProvider.Singleton, new TextSignatureDecoderContext(assemblyResolver, options), metadataReader, r2rReader, offset) { } /// /// Construct the signature decoder by storing the image byte array and offset within the array. /// - /// Dump options and paths + /// Assembly Resolver used to locate dependent assembly + /// SignatureFormattingOptions for signature formatting /// Metadata reader for the R2R image /// Signature to parse /// Signature offset within the signature byte array /// Metadata reader representing the outer signature context /// Top-level signature context reader - private SignatureDecoder(IAssemblyResolver options, MetadataReader metadataReader, byte[] signature, int offset, MetadataReader outerReader, ReadyToRunReader contextReader) : - base(TextTypeProvider.Singleton, new TextSignatureDecoderContext(options), metadataReader, signature, offset, outerReader, contextReader) + private SignatureDecoder(IAssemblyResolver assemblyResolver, SignatureFormattingOptions options, MetadataReader metadataReader, byte[] signature, int offset, MetadataReader outerReader, ReadyToRunReader contextReader) : + base(TextTypeProvider.Singleton, new TextSignatureDecoderContext(assemblyResolver, options), metadataReader, signature, offset, outerReader, contextReader) { } @@ -952,22 +1000,12 @@ private SignatureDecoder(IAssemblyResolver options, MetadataReader metadataReade /// by custom encoding per fixup type. /// /// - public string ReadR2RSignature(out ReadyToRunSignature result) + internal ReadyToRunSignature ReadR2RSignature(StringBuilder builder) { - result = null; - StringBuilder builder = new StringBuilder(); int startOffset = Offset; - try - { - result = ParseSignature(builder); - EmitSignatureBinaryFrom(builder, startOffset); - } - catch (Exception ex) - { - builder.Append(" - "); - builder.Append(ex.Message); - } - return builder.ToString(); + ReadyToRunSignature result = ParseSignature(builder); + EmitSignatureBinaryFrom(builder, startOffset); + return result; } public string ReadTypeSignature() @@ -1065,8 +1103,8 @@ private ReadyToRunSignature ParseSignature(StringBuilder builder) { fixupType &= ~(uint)ReadyToRunFixupKind.ModuleOverride; int moduleIndex = (int)ReadUIntAndEmitInlineSignatureBinary(builder); - MetadataReader refAsmEcmaReader = _contextReader.OpenReferenceAssembly(moduleIndex); - moduleDecoder = new SignatureDecoder(Context.Options, refAsmEcmaReader, _image, Offset, refAsmEcmaReader, _contextReader); + IAssemblyMetadata refAsmEcmaReader = _contextReader.OpenReferenceAssembly(moduleIndex); + moduleDecoder = new SignatureDecoder(Context.AssemblyResolver, Context.Options, refAsmEcmaReader.MetadataReader, _image, Offset, refAsmEcmaReader.MetadataReader, _contextReader); } ReadyToRunSignature result = moduleDecoder.ParseSignature((ReadyToRunFixupKind)fixupType, builder); @@ -1081,7 +1119,7 @@ private ReadyToRunSignature ParseSignature(StringBuilder builder) /// Output signature builder private ReadyToRunSignature ParseSignature(ReadyToRunFixupKind fixupType, StringBuilder builder) { - ReadyToRunSignature result = new TodoSignature(); + ReadyToRunSignature result = new TodoSignature(this); switch (fixupType) { case ReadyToRunFixupKind.ThisObjDictionaryLookup: @@ -1127,14 +1165,14 @@ private ReadyToRunSignature ParseSignature(ReadyToRunFixupKind fixupType, String uint methodDefToken = ParseMethodDefToken(builder, owningTypeOverride: null); builder.Append(" (METHOD_ENTRY"); builder.Append(Context.Options.Naked ? ")" : "_DEF_TOKEN)"); - result = new MethodDefEntrySignature { MethodDefToken = methodDefToken }; + result = new MethodDefEntrySignature(this) { MethodDefToken = methodDefToken }; break; case ReadyToRunFixupKind.MethodEntry_RefToken: uint methodRefToken = ParseMethodRefToken(builder, owningTypeOverride: null); builder.Append(" (METHOD_ENTRY"); builder.Append(Context.Options.Naked ? ")" : "_REF_TOKEN)"); - result = new MethodRefEntrySignature { MethodRefToken = methodRefToken }; + result = new MethodRefEntrySignature(this) { MethodRefToken = methodRefToken }; break; @@ -1341,8 +1379,7 @@ private ReadyToRunSignature ParseSignature(ReadyToRunFixupKind fixupType, String break; default: - builder.Append(string.Format("Unknown fixup type: {0:X2}", fixupType)); - break; + throw new BadImageFormatException(); } return result; } @@ -1356,7 +1393,7 @@ private void ParseType(StringBuilder builder) builder.Append(base.ParseType()); } - public MetadataReader GetMetadataReaderFromModuleOverride() + public IAssemblyMetadata GetMetadataReaderFromModuleOverride() { if (PeekElementType() == CorElementType.ELEMENT_TYPE_MODULE_ZAPSIG) { @@ -1364,7 +1401,7 @@ public MetadataReader GetMetadataReaderFromModuleOverride() ReadElementType(); int moduleIndex = (int)ReadUInt(); - MetadataReader refAsmReader = _contextReader.OpenReferenceAssembly(moduleIndex); + IAssemblyMetadata refAsmReader = _contextReader.OpenReferenceAssembly(moduleIndex); UpdateOffset(currentOffset); @@ -1838,6 +1875,7 @@ private void ParseHelper(StringBuilder builder) break; default: + // TODO: Something is wrong with helper signature parsing builder.Append(string.Format("Unknown helper: {0:X2}", helperType)); break; } diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/StandaloneAssemblyMetadata.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/StandaloneAssemblyMetadata.cs new file mode 100644 index 000000000000..a5ccea15f3d8 --- /dev/null +++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/StandaloneAssemblyMetadata.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 System.Reflection.Metadata; +using System.Reflection.PortableExecutable; + +namespace ILCompiler.Reflection.ReadyToRun +{ + /// + /// Metadata access interface for standalone assemblies represented by MSIL PE files. + /// + public class StandaloneAssemblyMetadata : IAssemblyMetadata + { + /// + /// Reader representing the MSIL assembly file. + /// + private readonly PEReader _peReader; + + /// + /// Metadata reader for the MSIL assembly. We create one upfront to avoid going + /// through the GetMetadataReader() helper and constructing a new instance every time. + /// + private readonly MetadataReader _metadataReader; + + public StandaloneAssemblyMetadata(PEReader peReader) + { + _peReader = peReader; + _metadataReader = _peReader.GetMetadataReader(); + } + + public PEReader ImageReader => _peReader; + + public MetadataReader MetadataReader => _metadataReader; + } +} diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ArchitectureSpecificFieldLayoutTests.cs b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ArchitectureSpecificFieldLayoutTests.cs index 1ea475cde7fb..067486f858c1 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ArchitectureSpecificFieldLayoutTests.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ArchitectureSpecificFieldLayoutTests.cs @@ -55,12 +55,12 @@ public void TestInstanceLayoutDoubleBool() Assert.Equal(0x4, tX86.InstanceByteAlignment.AsInt); Assert.Equal(0x11, tX64.InstanceByteCountUnaligned.AsInt); - Assert.Equal(0x11, tARM.InstanceByteCountUnaligned.AsInt); - Assert.Equal(0x11, tX86.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0xD, tARM.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0xD, tX86.InstanceByteCountUnaligned.AsInt); Assert.Equal(0x18, tX64.InstanceByteCount.AsInt); - Assert.Equal(0x18, tARM.InstanceByteCount.AsInt); - Assert.Equal(0x14, tX86.InstanceByteCount.AsInt); + Assert.Equal(0x10, tARM.InstanceByteCount.AsInt); + Assert.Equal(0x10, tX86.InstanceByteCount.AsInt); } [Fact] @@ -75,12 +75,344 @@ public void TestInstanceLayoutBoolDoubleBool() Assert.Equal(0x4, tX86.InstanceByteAlignment.AsInt); Assert.Equal(0x19, tX64.InstanceByteCountUnaligned.AsInt); - Assert.Equal(0x11, tARM.InstanceByteCountUnaligned.AsInt); - Assert.Equal(0x11, tX86.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x15, tARM.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x15, tX86.InstanceByteCountUnaligned.AsInt); Assert.Equal(0x20, tX64.InstanceByteCount.AsInt); Assert.Equal(0x18, tARM.InstanceByteCount.AsInt); - Assert.Equal(0x14, tX86.InstanceByteCount.AsInt); + Assert.Equal(0x18, tX86.InstanceByteCount.AsInt); + } + + [Fact] + public void TestAlignmentBehavior_LongIntEnumStruct() + { + string _namespace = "EnumAlignment"; + string _type = "LongIntEnumStruct"; + + MetadataType tX64 = _testModuleX64.GetType(_namespace, _type); + MetadataType tX86 = _testModuleX86.GetType(_namespace, _type); + MetadataType tARM = _testModuleARM.GetType(_namespace, _type); + + Assert.Equal(0x8, tX64.InstanceByteAlignment.AsInt); + Assert.Equal(0x8, tARM.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceByteAlignment.AsInt); + + Assert.Equal(0x20, tX64.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x20, tARM.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x20, tX86.InstanceByteCountUnaligned.AsInt); + + Assert.Equal(0x20, tX64.InstanceByteCount.AsInt); + Assert.Equal(0x20, tARM.InstanceByteCount.AsInt); + Assert.Equal(0x20, tX86.InstanceByteCount.AsInt); + + Assert.Equal(0x8, tX64.InstanceFieldAlignment.AsInt); + Assert.Equal(0x8, tARM.InstanceFieldAlignment.AsInt); + Assert.Equal(0x8, tX86.InstanceFieldAlignment.AsInt); + + Assert.Equal(0x20, tX64.InstanceFieldSize.AsInt); + Assert.Equal(0x20, tARM.InstanceFieldSize.AsInt); + Assert.Equal(0x20, tX86.InstanceFieldSize.AsInt); + + Assert.Equal(0x0, tX64.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tARM.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tX86.GetField("_1").Offset.AsInt); + + Assert.Equal(0x8, tX64.GetField("_2").Offset.AsInt); + Assert.Equal(0x8, tARM.GetField("_2").Offset.AsInt); + Assert.Equal(0x8, tX86.GetField("_2").Offset.AsInt); + + Assert.Equal(0x10, tX64.GetField("_3").Offset.AsInt); + Assert.Equal(0x10, tARM.GetField("_3").Offset.AsInt); + Assert.Equal(0x10, tX86.GetField("_3").Offset.AsInt); + + Assert.Equal(0x18, tX64.GetField("_4").Offset.AsInt); + Assert.Equal(0x18, tARM.GetField("_4").Offset.AsInt); + Assert.Equal(0x18, tX86.GetField("_4").Offset.AsInt); + + MetadataType tX64FieldStruct = _testModuleX64.GetType(_namespace, _type + "FieldStruct"); + MetadataType tX86FieldStruct = _testModuleX86.GetType(_namespace, _type + "FieldStruct"); + MetadataType tARMFieldStruct = _testModuleARM.GetType(_namespace, _type + "FieldStruct"); + + Assert.Equal(0x8, tX64FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x8, tX86FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x8, tARMFieldStruct.GetField("_struct").Offset.AsInt); + } + + [Fact] + public void TestAlignmentBehavior_IntShortEnumStruct() + { + string _namespace = "EnumAlignment"; + string _type = "IntShortEnumStruct"; + + MetadataType tX64 = _testModuleX64.GetType(_namespace, _type); + MetadataType tX86 = _testModuleX86.GetType(_namespace, _type); + MetadataType tARM = _testModuleARM.GetType(_namespace, _type); + + Assert.Equal(0x8, tX64.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tARM.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceByteAlignment.AsInt); + + Assert.Equal(0x10, tX64.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x10, tARM.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x10, tX86.InstanceByteCountUnaligned.AsInt); + + Assert.Equal(0x10, tX64.InstanceByteCount.AsInt); + Assert.Equal(0x10, tARM.InstanceByteCount.AsInt); + Assert.Equal(0x10, tX86.InstanceByteCount.AsInt); + + Assert.Equal(0x4, tX64.InstanceFieldAlignment.AsInt); + Assert.Equal(0x4, tARM.InstanceFieldAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceFieldAlignment.AsInt); + + Assert.Equal(0x10, tX64.InstanceFieldSize.AsInt); + Assert.Equal(0x10, tARM.InstanceFieldSize.AsInt); + Assert.Equal(0x10, tX86.InstanceFieldSize.AsInt); + + Assert.Equal(0x0, tX64.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tARM.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tX86.GetField("_1").Offset.AsInt); + + Assert.Equal(0x4, tX64.GetField("_2").Offset.AsInt); + Assert.Equal(0x4, tARM.GetField("_2").Offset.AsInt); + Assert.Equal(0x4, tX86.GetField("_2").Offset.AsInt); + + Assert.Equal(0x8, tX64.GetField("_3").Offset.AsInt); + Assert.Equal(0x8, tARM.GetField("_3").Offset.AsInt); + Assert.Equal(0x8, tX86.GetField("_3").Offset.AsInt); + + Assert.Equal(0xC, tX64.GetField("_4").Offset.AsInt); + Assert.Equal(0xC, tARM.GetField("_4").Offset.AsInt); + Assert.Equal(0xC, tX86.GetField("_4").Offset.AsInt); + + MetadataType tX64FieldStruct = _testModuleX64.GetType(_namespace, _type + "FieldStruct"); + MetadataType tX86FieldStruct = _testModuleX86.GetType(_namespace, _type + "FieldStruct"); + MetadataType tARMFieldStruct = _testModuleARM.GetType(_namespace, _type + "FieldStruct"); + + Assert.Equal(0x4, tX64FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x4, tX86FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x4, tARMFieldStruct.GetField("_struct").Offset.AsInt); + + } + + [Fact] + public void TestAlignmentBehavior_ShortByteEnumStruct() + { + string _namespace = "EnumAlignment"; + string _type = "ShortByteEnumStruct"; + + MetadataType tX64 = _testModuleX64.GetType(_namespace, _type); + MetadataType tX86 = _testModuleX86.GetType(_namespace, _type); + MetadataType tARM = _testModuleARM.GetType(_namespace, _type); + + Assert.Equal(0x8, tX64.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tARM.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceByteAlignment.AsInt); + + Assert.Equal(0x8, tX64.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x8, tARM.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x8, tX86.InstanceByteCountUnaligned.AsInt); + + Assert.Equal(0x8, tX64.InstanceByteCount.AsInt); + Assert.Equal(0x8, tARM.InstanceByteCount.AsInt); + Assert.Equal(0x8, tX86.InstanceByteCount.AsInt); + + Assert.Equal(0x2, tX64.InstanceFieldAlignment.AsInt); + Assert.Equal(0x2, tARM.InstanceFieldAlignment.AsInt); + Assert.Equal(0x2, tX86.InstanceFieldAlignment.AsInt); + + Assert.Equal(0x8, tX64.InstanceFieldSize.AsInt); + Assert.Equal(0x8, tARM.InstanceFieldSize.AsInt); + Assert.Equal(0x8, tX86.InstanceFieldSize.AsInt); + + Assert.Equal(0x0, tX64.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tARM.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tX86.GetField("_1").Offset.AsInt); + + Assert.Equal(0x2, tX64.GetField("_2").Offset.AsInt); + Assert.Equal(0x2, tARM.GetField("_2").Offset.AsInt); + Assert.Equal(0x2, tX86.GetField("_2").Offset.AsInt); + + Assert.Equal(0x4, tX64.GetField("_3").Offset.AsInt); + Assert.Equal(0x4, tARM.GetField("_3").Offset.AsInt); + Assert.Equal(0x4, tX86.GetField("_3").Offset.AsInt); + + Assert.Equal(0x6, tX64.GetField("_4").Offset.AsInt); + Assert.Equal(0x6, tARM.GetField("_4").Offset.AsInt); + Assert.Equal(0x6, tX86.GetField("_4").Offset.AsInt); + + MetadataType tX64FieldStruct = _testModuleX64.GetType(_namespace, _type + "FieldStruct"); + MetadataType tX86FieldStruct = _testModuleX86.GetType(_namespace, _type + "FieldStruct"); + MetadataType tARMFieldStruct = _testModuleARM.GetType(_namespace, _type + "FieldStruct"); + + Assert.Equal(0x2, tX64FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x2, tX86FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x2, tARMFieldStruct.GetField("_struct").Offset.AsInt); + } + + [Fact] + public void TestAlignmentBehavior_LongIntEnumStructAuto() + { + string _namespace = "EnumAlignment"; + string _type = "LongIntEnumStructAuto"; + + MetadataType tX64 = _testModuleX64.GetType(_namespace, _type); + MetadataType tX86 = _testModuleX86.GetType(_namespace, _type); + MetadataType tARM = _testModuleARM.GetType(_namespace, _type); + + Assert.Equal(0x8, tX64.InstanceByteAlignment.AsInt); + Assert.Equal(0x8, tARM.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceByteAlignment.AsInt); + + Assert.Equal(0x18, tX64.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x18, tARM.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x18, tX86.InstanceByteCountUnaligned.AsInt); + + Assert.Equal(0x18, tX64.InstanceByteCount.AsInt); + Assert.Equal(0x18, tARM.InstanceByteCount.AsInt); + Assert.Equal(0x18, tX86.InstanceByteCount.AsInt); + + Assert.Equal(0x8, tX64.InstanceFieldAlignment.AsInt); + Assert.Equal(0x8, tARM.InstanceFieldAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceFieldAlignment.AsInt); + + Assert.Equal(0x18, tX64.InstanceFieldSize.AsInt); + Assert.Equal(0x18, tARM.InstanceFieldSize.AsInt); + Assert.Equal(0x18, tX86.InstanceFieldSize.AsInt); + + Assert.Equal(0x0, tX64.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tARM.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tX86.GetField("_1").Offset.AsInt); + + Assert.Equal(0x10, tX64.GetField("_2").Offset.AsInt); + Assert.Equal(0x10, tARM.GetField("_2").Offset.AsInt); + Assert.Equal(0x10, tX86.GetField("_2").Offset.AsInt); + + Assert.Equal(0x8, tX64.GetField("_3").Offset.AsInt); + Assert.Equal(0x8, tARM.GetField("_3").Offset.AsInt); + Assert.Equal(0x8, tX86.GetField("_3").Offset.AsInt); + + Assert.Equal(0x14, tX64.GetField("_4").Offset.AsInt); + Assert.Equal(0x14, tARM.GetField("_4").Offset.AsInt); + Assert.Equal(0x14, tX86.GetField("_4").Offset.AsInt); + + MetadataType tX64FieldStruct = _testModuleX64.GetType(_namespace, _type + "FieldStruct"); + MetadataType tX86FieldStruct = _testModuleX86.GetType(_namespace, _type + "FieldStruct"); + MetadataType tARMFieldStruct = _testModuleARM.GetType(_namespace, _type + "FieldStruct"); + + Assert.Equal(0x8, tX64FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x4, tX86FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x8, tARMFieldStruct.GetField("_struct").Offset.AsInt); + } + + [Fact] + public void TestAlignmentBehavior_IntShortEnumStructAuto() + { + string _namespace = "EnumAlignment"; + string _type = "IntShortEnumStructAuto"; + + MetadataType tX64 = _testModuleX64.GetType(_namespace, _type); + MetadataType tX86 = _testModuleX86.GetType(_namespace, _type); + MetadataType tARM = _testModuleARM.GetType(_namespace, _type); + + Assert.Equal(0x8, tX64.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tARM.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceByteAlignment.AsInt); + + Assert.Equal(0x10, tX64.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0xC, tARM.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0xC, tX86.InstanceByteCountUnaligned.AsInt); + + Assert.Equal(0x10, tX64.InstanceByteCount.AsInt); + Assert.Equal(0xC, tARM.InstanceByteCount.AsInt); + Assert.Equal(0xC, tX86.InstanceByteCount.AsInt); + + Assert.Equal(0x8, tX64.InstanceFieldAlignment.AsInt); + Assert.Equal(0x4, tARM.InstanceFieldAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceFieldAlignment.AsInt); + + Assert.Equal(0x10, tX64.InstanceFieldSize.AsInt); + Assert.Equal(0xC, tARM.InstanceFieldSize.AsInt); + Assert.Equal(0xC, tX86.InstanceFieldSize.AsInt); + + Assert.Equal(0x0, tX64.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tARM.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tX86.GetField("_1").Offset.AsInt); + + Assert.Equal(0x8, tX64.GetField("_2").Offset.AsInt); + Assert.Equal(0x8, tARM.GetField("_2").Offset.AsInt); + Assert.Equal(0x8, tX86.GetField("_2").Offset.AsInt); + + Assert.Equal(0x4, tX64.GetField("_3").Offset.AsInt); + Assert.Equal(0x4, tARM.GetField("_3").Offset.AsInt); + Assert.Equal(0x4, tX86.GetField("_3").Offset.AsInt); + + Assert.Equal(0xA, tX64.GetField("_4").Offset.AsInt); + Assert.Equal(0xA, tARM.GetField("_4").Offset.AsInt); + Assert.Equal(0xA, tX86.GetField("_4").Offset.AsInt); + + MetadataType tX64FieldStruct = _testModuleX64.GetType(_namespace, _type + "FieldStruct"); + MetadataType tX86FieldStruct = _testModuleX86.GetType(_namespace, _type + "FieldStruct"); + MetadataType tARMFieldStruct = _testModuleARM.GetType(_namespace, _type + "FieldStruct"); + + Assert.Equal(0x8, tX64FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x4, tX86FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x4, tARMFieldStruct.GetField("_struct").Offset.AsInt); + + } + + [Fact] + public void TestAlignmentBehavior_ShortByteEnumStructAuto() + { + string _namespace = "EnumAlignment"; + string _type = "ShortByteEnumStructAuto"; + + MetadataType tX64 = _testModuleX64.GetType(_namespace, _type); + MetadataType tX86 = _testModuleX86.GetType(_namespace, _type); + MetadataType tARM = _testModuleARM.GetType(_namespace, _type); + + Assert.Equal(0x8, tX64.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tARM.InstanceByteAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceByteAlignment.AsInt); + + Assert.Equal(0x8, tX64.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x8, tARM.InstanceByteCountUnaligned.AsInt); + Assert.Equal(0x8, tX86.InstanceByteCountUnaligned.AsInt); + + Assert.Equal(0x8, tX64.InstanceByteCount.AsInt); + Assert.Equal(0x8, tARM.InstanceByteCount.AsInt); + Assert.Equal(0x8, tX86.InstanceByteCount.AsInt); + + Assert.Equal(0x8, tX64.InstanceFieldAlignment.AsInt); + Assert.Equal(0x4, tARM.InstanceFieldAlignment.AsInt); + Assert.Equal(0x4, tX86.InstanceFieldAlignment.AsInt); + + Assert.Equal(0x8, tX64.InstanceFieldSize.AsInt); + Assert.Equal(0x8, tARM.InstanceFieldSize.AsInt); + Assert.Equal(0x8, tX86.InstanceFieldSize.AsInt); + + Assert.Equal(0x0, tX64.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tARM.GetField("_1").Offset.AsInt); + Assert.Equal(0x0, tX86.GetField("_1").Offset.AsInt); + + Assert.Equal(0x4, tX64.GetField("_2").Offset.AsInt); + Assert.Equal(0x4, tARM.GetField("_2").Offset.AsInt); + Assert.Equal(0x4, tX86.GetField("_2").Offset.AsInt); + + Assert.Equal(0x2, tX64.GetField("_3").Offset.AsInt); + Assert.Equal(0x2, tARM.GetField("_3").Offset.AsInt); + Assert.Equal(0x2, tX86.GetField("_3").Offset.AsInt); + + Assert.Equal(0x5, tX64.GetField("_4").Offset.AsInt); + Assert.Equal(0x5, tARM.GetField("_4").Offset.AsInt); + Assert.Equal(0x5, tX86.GetField("_4").Offset.AsInt); + + MetadataType tX64FieldStruct = _testModuleX64.GetType(_namespace, _type + "FieldStruct"); + MetadataType tX86FieldStruct = _testModuleX86.GetType(_namespace, _type + "FieldStruct"); + MetadataType tARMFieldStruct = _testModuleARM.GetType(_namespace, _type + "FieldStruct"); + + Assert.Equal(0x8, tX64FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x4, tX86FieldStruct.GetField("_struct").Offset.AsInt); + Assert.Equal(0x4, tARMFieldStruct.GetField("_struct").Offset.AsInt); } } } diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InstanceFieldLayout.cs b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InstanceFieldLayout.cs index 24104346f629..656d07513522 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InstanceFieldLayout.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/CoreTestAssembly/InstanceFieldLayout.cs @@ -304,3 +304,98 @@ public struct NotByRefLike int X; } } + +namespace EnumAlignment +{ + public enum ByteEnum : byte {} + public enum ShortEnum : short {} + public enum IntEnum : int {} + public enum LongEnum : long {} + + public struct LongIntEnumStruct + { + public LongEnum _1; + public IntEnum _2; + public LongEnum _3; + public IntEnum _4; + } + + public struct LongIntEnumStructFieldStruct + { + public byte _0; + public LongIntEnumStruct _struct; + } + + public struct IntShortEnumStruct + { + public IntEnum _1; + public ShortEnum _2; + public IntEnum _3; + public ShortEnum _4; + } + + public struct IntShortEnumStructFieldStruct + { + public byte _0; + public IntShortEnumStruct _struct; + } + + public struct ShortByteEnumStruct + { + public ShortEnum _1; + public ByteEnum _2; + public ShortEnum _3; + public ByteEnum _4; + } + + public struct ShortByteEnumStructFieldStruct + { + public byte _0; + public ShortByteEnumStruct _struct; + } + + [StructLayout(LayoutKind.Auto)] + public struct LongIntEnumStructAuto + { + public LongEnum _1; + public IntEnum _2; + public LongEnum _3; + public IntEnum _4; + } + + public struct LongIntEnumStructAutoFieldStruct + { + public byte _0; + public LongIntEnumStructAuto _struct; + } + + [StructLayout(LayoutKind.Auto)] + public struct IntShortEnumStructAuto + { + public IntEnum _1; + public ShortEnum _2; + public IntEnum _3; + public ShortEnum _4; + } + + public struct IntShortEnumStructAutoFieldStruct + { + public byte _0; + public IntShortEnumStructAuto _struct; + } + + [StructLayout(LayoutKind.Auto)] + public struct ShortByteEnumStructAuto + { + public ShortEnum _1; + public ByteEnum _2; + public ShortEnum _3; + public ByteEnum _4; + } + + public struct ShortByteEnumStructAutoFieldStruct + { + public byte _0; + public ShortByteEnumStructAuto _struct; + } +} diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj index 7567ab173f5d..f26d0814f448 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILCompiler.TypeSystem.ReadyToRun.Tests.csproj @@ -1,7 +1,7 @@ ILCompiler.TypeSystem.ReadyToRun.Tests - $(NetCoreAppCurrent) + $(NetCoreAppToolCurrent) Debug;Release;Checked true diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il index b895be9b24f4..02f33b81f047 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/ILTestAssembly/Signature.il @@ -24,6 +24,11 @@ { ret } + + .method public hidebysig instance int32 modopt([CoreTestAssembly]System.Void) & Method3(int32 modopt(FooModifier)*, int32 modopt(FooModifier)*) cil managed + { + ret + } } .class private auto ansi beforefieldinit Atom diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs index e6a21525ee52..60d717291196 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/SignatureTests.cs @@ -69,6 +69,16 @@ public void TestSignatureMatchesModOptAtStartOfSigAndAfterByRef() Assert.Equal("OptionalCustomModifier0.1.1.1CharOptionalCustomModifier0.1.1.2.1.1VoidOptionalCustomModifier0.1.2.1FooModifier", GetModOptMethodSignatureInfo(methodWithModOptAtStartOfSigAndAfterByRef)); } + [Fact] + public void TestSignatureMatchesModoptOnPointerOrRefModifiedType() + { + MetadataType modOptTester = _testModule.GetType("", "ModOptTester"); + MethodSignature methodWithModOpt = modOptTester.GetMethods().Single(m => string.Equals(m.Name, "Method3")).Signature; + Assert.Equal(MethodSignature.GetIndexOfCustomModifierOnPointedAtTypeByParameterIndex(0), methodWithModOpt.GetEmbeddedSignatureData()[0].index); + Assert.Equal(MethodSignature.GetIndexOfCustomModifierOnPointedAtTypeByParameterIndex(1), methodWithModOpt.GetEmbeddedSignatureData()[1].index); + Assert.Equal(MethodSignature.GetIndexOfCustomModifierOnPointedAtTypeByParameterIndex(2), methodWithModOpt.GetEmbeddedSignatureData()[2].index); + } + [Fact] public void TestSignatureMatches() { diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/StaticFieldLayoutTests.cs b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/StaticFieldLayoutTests.cs index e0f5eef5e7a1..421313c8dc65 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/StaticFieldLayoutTests.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/StaticFieldLayoutTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Buffers.Binary; using System.Linq; using Internal.TypeSystem; @@ -280,10 +281,7 @@ public void TestRvaStatics() Assert.Equal(4, rvaData.Length); - int value = rvaData[0] | - rvaData[1] << 8 | - rvaData[2] << 16 | - rvaData[3] << 24; + int value = BinaryPrimitives.ReadInt32LittleEndian(rvaData); Assert.Equal(0x78563412, value); } diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/UniversalGenericFieldLayoutTests.cs b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/UniversalGenericFieldLayoutTests.cs index e1ce09f294ad..c0680f2ebbb2 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/UniversalGenericFieldLayoutTests.cs +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun.Tests/UniversalGenericFieldLayoutTests.cs @@ -444,10 +444,13 @@ public void TestClassLayout() out genOfUL); Assert.Equal(4, genOfIU.BaseType.GetFields().First().Offset.AsInt); - Assert.Equal(8, genOfLU.BaseType.GetFields().First().Offset.AsInt); - Assert.Equal(LayoutInt.Indeterminate, genOfUU.BaseType.GetFields().First().Offset); - Assert.Equal(LayoutInt.Indeterminate, genOfUI.BaseType.GetFields().First().Offset); - Assert.Equal(LayoutInt.Indeterminate, genOfUL.BaseType.GetFields().First().Offset); + Assert.Equal(4, genOfLU.BaseType.GetFields().First().Offset.AsInt); + + // Like X64, X86 first field location is always 4 bytes from start + // This results in 8 byte aligned quantities being aligned at unusual offsets + Assert.Equal(4, genOfUU.BaseType.GetFields().First().Offset.AsInt); + Assert.Equal(4, genOfUI.BaseType.GetFields().First().Offset.AsInt); + Assert.Equal(4, genOfUL.BaseType.GetFields().First().Offset.AsInt); if (context.Target.MaximumAlignment <= 8) { diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj index cea2c969468d..88400e87536f 100644 --- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj +++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj @@ -4,7 +4,7 @@ Internal.TypeSystem ILCompiler.TypeSystem.ReadyToRun true - netstandard1.3 + netstandard2.0 false x64;x86 AnyCPU diff --git a/src/coreclr/src/tools/aot/crossgen2/CommandLineOptions.cs b/src/coreclr/src/tools/aot/crossgen2/CommandLineOptions.cs index 5aeae5245e3e..1c8bcd4e63ed 100644 --- a/src/coreclr/src/tools/aot/crossgen2/CommandLineOptions.cs +++ b/src/coreclr/src/tools/aot/crossgen2/CommandLineOptions.cs @@ -2,207 +2,131 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.CommandLine; +using System.Collections.Generic; using System.IO; +using System.Reflection; + +using Internal.CommandLine; namespace ILCompiler { - public class CommandLineOptions + internal class CommandLineOptions { - public FileInfo[] InputFilePaths { get; set; } - public FileInfo[] UnrootedInputFilePaths { get; set; } - public FileInfo[] Mibc { get; set; } - public string[] Reference { get; set; } - public string InstructionSet { get; set; } - public FileInfo OutputFilePath { get; set; } - - public DirectoryInfo CompositeRootPath { get; set; } - public bool Optimize { get; set; } - public bool OptimizeSpace { get; set; } - public bool OptimizeTime { get; set; } - public bool InputBubble { get; set; } - public bool CompileBubbleGenerics { get; set; } - public bool Verbose { get; set; } - public bool Composite { get; set; } - public bool CompileNoMethods { get; set; } - - public FileInfo DgmlLogFileName { get; set; } - public bool GenerateFullDgmlLog { get; set; } - - public string TargetArch { get; set; } - public string TargetOS { get; set; } - public FileInfo JitPath { get; set; } - public string SystemModule { get; set; } - public bool WaitForDebugger { get; set; } - public bool Tuning { get; set; } - public bool Partial { get; set; } - public bool Resilient { get; set; } - public bool Map { get; set; } - public int Parallelism { get; set; } - public ReadyToRunMethodLayoutAlgorithm MethodLayout { get; set; } - public ReadyToRunFileLayoutAlgorithm FileLayout { get; set; } - public int? CustomPESectionAlignment { get; set; } - public bool VerifyTypeAndFieldLayout { get; set; } - - public string SingleMethodTypeName { get; set; } - public string SingleMethodName { get; set; } - public string[] SingleMethodGenericArg { get; set; } - - public string[] CodegenOptions { get; set; } + public bool Help; + public string HelpText; + + public IReadOnlyList InputFilePaths; + public IReadOnlyList UnrootedInputFilePaths; + public IReadOnlyList ReferenceFilePaths; + public IReadOnlyList MibcFilePaths; + public string InstructionSet; + public string OutputFilePath; + + public string CompositeRootPath; + public bool Optimize; + public bool OptimizeSpace; + public bool OptimizeTime; + public bool InputBubble; + public bool CompileBubbleGenerics; + public bool Verbose; + public bool Composite; + public bool CompileNoMethods; + + public string DgmlLogFileName; + public bool GenerateFullDgmlLog; + + public string TargetArch; + public string TargetOS; + public string JitPath; + public string SystemModule; + public bool WaitForDebugger; + public bool Tuning; + public bool Partial; + public bool Resilient; + public bool Map; + public bool MapCsv; + public int Parallelism; + public int CustomPESectionAlignment; + public string MethodLayout; + public string FileLayout; + public bool VerifyTypeAndFieldLayout; + + public string SingleMethodTypeName; + public string SingleMethodName; + public IReadOnlyList SingleMethodGenericArg; + + public IReadOnlyList CodegenOptions; public bool CompositeOrInputBubble => Composite || InputBubble; - public static Command RootCommand() + public CommandLineOptions(string[] args) { - // For some reason, arity caps at 255 by default - ArgumentArity arbitraryArity = new ArgumentArity(0, 100000); + InputFilePaths = Array.Empty(); + UnrootedInputFilePaths = Array.Empty(); + ReferenceFilePaths = Array.Empty(); + MibcFilePaths = Array.Empty(); + CodegenOptions = Array.Empty(); + + Parallelism = Environment.ProcessorCount; + SingleMethodGenericArg = null; + + ArgumentSyntax argSyntax = ArgumentSyntax.Parse(args, syntax => + { + syntax.ApplicationName = typeof(Program).Assembly.GetName().Name.ToString(); + + // HandleHelp writes to error, fails fast with crash dialog and lacks custom formatting. + syntax.HandleHelp = false; + syntax.HandleErrors = true; + + syntax.DefineOptionList("u|unrooted-input-file-paths", ref UnrootedInputFilePaths, SR.UnrootedInputFilesToCompile); + syntax.DefineOptionList("r|reference", ref ReferenceFilePaths, SR.ReferenceFiles); + syntax.DefineOption("instruction-set", ref InstructionSet, SR.InstructionSets); + syntax.DefineOptionList("m|mibc", ref MibcFilePaths, SR.MibcFiles); + syntax.DefineOption("o|out|outputfilepath", ref OutputFilePath, SR.OutputFilePath); + syntax.DefineOption("crp|compositerootpath", ref CompositeRootPath, SR.CompositeRootPath); + syntax.DefineOption("O|optimize", ref Optimize, SR.EnableOptimizationsOption); + syntax.DefineOption("Os|optimize-space", ref OptimizeSpace, SR.OptimizeSpaceOption); + syntax.DefineOption("Ot|optimize-time", ref OptimizeTime, SR.OptimizeSpeedOption); + syntax.DefineOption("inputbubble", ref InputBubble, SR.InputBubbleOption); + syntax.DefineOption("composite", ref Composite, SR.CompositeBuildMode); + syntax.DefineOption("compile-no-methods", ref CompileNoMethods, SR.CompileNoMethodsOption); + syntax.DefineOption("tuning", ref Tuning, SR.TuningImageOption); + syntax.DefineOption("partial", ref Partial, SR.PartialImageOption); + syntax.DefineOption("compilebubblegenerics", ref CompileBubbleGenerics, SR.BubbleGenericsOption); + syntax.DefineOption("dgmllog|dgml-log-file-name", ref DgmlLogFileName, SR.SaveDependencyLogOption); + syntax.DefineOption("fulllog|generate-full-dmgl-log", ref GenerateFullDgmlLog, SR.SaveDetailedLogOption); + syntax.DefineOption("verbose", ref Verbose, SR.VerboseLoggingOption); + syntax.DefineOption("systemmodule", ref SystemModule, SR.SystemModuleOverrideOption); + syntax.DefineOption("waitfordebugger", ref WaitForDebugger, SR.WaitForDebuggerOption); + syntax.DefineOptionList("codegenopt|codegen-options", ref CodegenOptions, SR.CodeGenOptions); + syntax.DefineOption("resilient", ref Resilient, SR.ResilientOption); + + syntax.DefineOption("targetarch", ref TargetArch, SR.TargetArchOption); + syntax.DefineOption("targetos", ref TargetOS, SR.TargetOSOption); + syntax.DefineOption("jitpath", ref JitPath, SR.JitPathOption); + + syntax.DefineOption("singlemethodtypename", ref SingleMethodTypeName, SR.SingleMethodTypeName); + syntax.DefineOption("singlemethodname", ref SingleMethodName, SR.SingleMethodMethodName); + syntax.DefineOptionList("singlemethodgenericarg", ref SingleMethodGenericArg, SR.SingleMethodGenericArgs); + + syntax.DefineOption("parallelism", ref Parallelism, SR.ParalellismOption); + syntax.DefineOption("custom-pe-section-alignment", ref CustomPESectionAlignment, SR.CustomPESectionAlignmentOption); + syntax.DefineOption("map", ref Map, SR.MapFileOption); + syntax.DefineOption("mapcsv", ref MapCsv, SR.MapCsvFileOption); + + syntax.DefineOption("method-layout", ref MethodLayout, SR.MethodLayoutOption); + syntax.DefineOption("file-layout", ref FileLayout, SR.FileLayoutOption); + syntax.DefineOption("verify-type-and-field-layout", ref VerifyTypeAndFieldLayout, SR.VerifyTypeAndFieldLayoutOption); + + syntax.DefineOption("h|help", ref Help, SR.HelpOption); + + syntax.DefineParameterList("in", ref InputFilePaths, SR.InputFilesToCompile); + }); - return new Command("Crossgen2Compilation") + if (Help) { - new Argument() - { - Name = "input-file-paths", - Description = SR.InputFilesToCompile, - Arity = arbitraryArity, - }, - new Option(new[] { "--unrooted-input-file-paths", "-u" }, SR.UnrootedInputFilesToCompile) - { - Argument = new Argument() - { - Arity = arbitraryArity - } - }, - new Option(new[] { "--reference", "-r" }, SR.ReferenceFiles) - { - Argument = new Argument() - { - Arity = arbitraryArity - } - }, - new Option(new[] { "--instruction-set" }, SR.InstructionSets) - { - Argument = new Argument() - }, - new Option(new[] { "--mibc", "-m" }, SR.MibcFiles) - { - Argument = new Argument() - { - Arity = arbitraryArity - } - }, - new Option(new[] { "--outputfilepath", "--out", "-o" }, SR.OutputFilePath) - { - Argument = new Argument() - }, - new Option(new[] { "--compositerootpath", "--crp" }, SR.CompositeRootPath) - { - Argument = new Argument() - }, - new Option(new[] { "--optimize", "-O" }, SR.EnableOptimizationsOption) - { - Argument = new Argument() - }, - new Option(new[] { "--optimize-space", "--Os" }, SR.OptimizeSpaceOption) - { - Argument = new Argument() - }, - new Option(new[] { "--optimize-time", "--Ot" }, SR.OptimizeSpeedOption), - new Option(new[] { "--inputbubble" }, SR.InputBubbleOption), - new Option(new[] { "--composite" }, SR.CompositeBuildMode), - new Option(new[] { "--compile-no-methods" }, SR.CompileNoMethodsOption), - new Option(new[] { "--tuning" }, SR.TuningImageOption) - { - Argument = new Argument() - }, - new Option(new[] { "--partial" }, SR.PartialImageOption) - { - Argument = new Argument() - }, - new Option(new[] { "--compilebubblegenerics" }, SR.BubbleGenericsOption) - { - Argument = new Argument() - }, - new Option(new[] { "--dgml-log-file-name", "--dmgllog" }, SR.SaveDependencyLogOption) - { - Argument = new Argument() - }, - new Option(new[] { "--generate-full-dmgl-log", "--fulllog" }, SR.SaveDetailedLogOption) - { - Argument = new Argument() - }, - new Option(new[] { "--verbose" }, SR.VerboseLoggingOption) - { - Argument = new Argument() - }, - new Option(new[] { "--systemmodule" }, SR.SystemModuleOverrideOption) - { - Argument = new Argument() - }, - new Option(new[] { "--waitfordebugger" }, SR.WaitForDebuggerOption) - { - Argument = new Argument() - }, - new Option(new[] { "--codegen-options", "--codegenopt" }, SR.CodeGenOptions) - { - Argument = new Argument() - { - Arity = arbitraryArity - } - }, - new Option(new[] { "--resilient" }, SR.ResilientOption) - { - Argument = new Argument() - }, - new Option(new[] { "--targetarch" }, SR.TargetArchOption) - { - Argument = new Argument() - }, - new Option(new[] { "--targetos" }, SR.TargetOSOption) - { - Argument = new Argument() - }, - new Option(new[] { "--jitpath" }, SR.JitPathOption) - { - Argument = new Argument() - }, - new Option(new[] { "--singlemethodtypename" }, SR.SingleMethodTypeName) - { - Argument = new Argument() - }, - new Option(new[] { "--singlemethodname" }, SR.SingleMethodMethodName) - { - Argument = new Argument() - }, - new Option(new[] { "--singlemethodgenericarg" }, SR.SingleMethodGenericArgs) - { - // We don't need to override arity here as 255 is the maximum number of generic arguments - Argument = new Argument() - }, - new Option(new[] { "--parallelism" }, SR.ParalellismOption) - { - Argument = new Argument(() => Environment.ProcessorCount) - }, - new Option(new[] { "--custom-pe-section-alignment" }, SR.CustomPESectionAlignmentOption) - { - Argument = new Argument() - }, - new Option(new[] { "--map" }, SR.MapFileOption) - { - Argument = new Argument() - }, - new Option(new[] { "--method-layout" }, SR.MethodLayoutOption) - { - Argument = new Argument() - }, - new Option(new[] { "--file-layout" }, SR.FileLayoutOption) - { - Argument = new Argument() - }, - new Option(new[] { "--verify-type-and-field-layout" }, SR.VerifyTypeAndFieldLayoutOption) - { - Argument = new Argument() - } - }; + HelpText = argSyntax.GetHelpText(); + } } } } diff --git a/src/coreclr/src/tools/aot/crossgen2/Program.cs b/src/coreclr/src/tools/aot/crossgen2/Program.cs index be483cbda481..86122bec482f 100644 --- a/src/coreclr/src/tools/aot/crossgen2/Program.cs +++ b/src/coreclr/src/tools/aot/crossgen2/Program.cs @@ -3,22 +3,15 @@ using System; using System.Collections.Generic; -using System.CommandLine; -using System.CommandLine.Invocation; -using System.Reflection; +using System.IO; using System.Reflection.PortableExecutable; using System.Runtime.InteropServices; -using System.Threading.Tasks; +using Internal.CommandLine; using Internal.IL; using Internal.TypeSystem; using Internal.TypeSystem.Ecma; -using Internal.CommandLine; -using System.Linq; -using System.IO; -using System.Reflection.Metadata; - namespace ILCompiler { internal class Program @@ -33,10 +26,11 @@ internal class Program private Dictionary _unrootedInputFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase); private Dictionary _referenceFilePaths = new Dictionary(StringComparer.OrdinalIgnoreCase); private CompilerTypeSystemContext _typeSystemContext; + private ReadyToRunMethodLayoutAlgorithm _methodLayout; + private ReadyToRunFileLayoutAlgorithm _fileLayout; - private Program(CommandLineOptions commandLineOptions) + private Program() { - _commandLineOptions = commandLineOptions; } private void InitializeDefaultOptions() @@ -71,9 +65,16 @@ private void InitializeDefaultOptions() } } - private void ProcessCommandLine() + private void ProcessCommandLine(string[] args) { - AssemblyName name = typeof(Program).GetTypeInfo().Assembly.GetName(); + PerfEventSource.StartStopEvents.CommandLineProcessingStart(); + _commandLineOptions = new CommandLineOptions(args); + PerfEventSource.StartStopEvents.CommandLineProcessingStop(); + + if (_commandLineOptions.Help) + { + return; + } if (_commandLineOptions.WaitForDebugger) { @@ -102,14 +103,46 @@ private void ProcessCommandLine() else if (_commandLineOptions.Optimize) _optimizationMode = OptimizationMode.Blended; - foreach (var input in _commandLineOptions.InputFilePaths ?? Enumerable.Empty()) - Helpers.AppendExpandedPaths(_inputFilePaths, input.FullName, true); + foreach (var input in _commandLineOptions.InputFilePaths) + Helpers.AppendExpandedPaths(_inputFilePaths, input, true); - foreach (var input in _commandLineOptions.UnrootedInputFilePaths ?? Enumerable.Empty()) - Helpers.AppendExpandedPaths(_unrootedInputFilePaths, input.FullName, true); + foreach (var input in _commandLineOptions.UnrootedInputFilePaths) + Helpers.AppendExpandedPaths(_unrootedInputFilePaths, input, true); - foreach (var reference in _commandLineOptions.Reference ?? Enumerable.Empty()) + foreach (var reference in _commandLineOptions.ReferenceFilePaths) Helpers.AppendExpandedPaths(_referenceFilePaths, reference, false); + + + int alignment = _commandLineOptions.CustomPESectionAlignment; + if (alignment != 0) + { + // Must be a power of two and >= 4096 + if (alignment < 4096 || (alignment & (alignment - 1)) != 0) + throw new CommandLineException(SR.InvalidCustomPESectionAlignment); + } + + if (_commandLineOptions.MethodLayout != null) + { + _methodLayout = _commandLineOptions.MethodLayout.ToLowerInvariant() switch + { + "defaultsort" => ReadyToRunMethodLayoutAlgorithm.DefaultSort, + "exclusiveweight" => ReadyToRunMethodLayoutAlgorithm.ExclusiveWeight, + "hotcold" => ReadyToRunMethodLayoutAlgorithm.HotCold, + "hotwarmcold" => ReadyToRunMethodLayoutAlgorithm.HotWarmCold, + _ => throw new CommandLineException(SR.InvalidMethodLayout) + }; + } + + if (_commandLineOptions.FileLayout != null) + { + _fileLayout = _commandLineOptions.FileLayout.ToLowerInvariant() switch + { + "defaultsort" => ReadyToRunFileLayoutAlgorithm.DefaultSort, + "methodorder" => ReadyToRunFileLayoutAlgorithm.MethodOrder, + _ => throw new CommandLineException(SR.InvalidFileLayout) + }; + } + } private void ConfigureTarget() @@ -223,7 +256,7 @@ private InstructionSetSupport ConfigureInstructionSetSupport() // support AVX instructions. As the jit generates logic that depends on these features it will call // notifyInstructionSetUsage, which will result in generation of a fixup to verify the behavior of // code. - // + // optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("sse"); optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("sse2"); optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("sse4.1"); @@ -234,7 +267,7 @@ private InstructionSetSupport ConfigureInstructionSetSupport() optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("lzcnt"); } - optimisticInstructionSetSupportBuilder.ComputeInstructionSetFlags(out var optimisticInstructionSet, out _, + optimisticInstructionSetSupportBuilder.ComputeInstructionSetFlags(out var optimisticInstructionSet, out _, (string specifiedInstructionSet, string impliedInstructionSet) => throw new NotSupportedException()); optimisticInstructionSet.Remove(unsupportedInstructionSet); optimisticInstructionSet.Add(supportedInstructionSet); @@ -246,27 +279,7 @@ private InstructionSetSupport ConfigureInstructionSetSupport() _targetArchitecture); } - private void CheckCustomPESectionAlignment() - { - if (_commandLineOptions.CustomPESectionAlignment != null) - { - int alignment = _commandLineOptions.CustomPESectionAlignment.Value; - bool invalidArgument = false; - if (alignment < 4096) - { - invalidArgument = true; - } - if ((alignment & (alignment - 1)) != 0) - { - invalidArgument = true; // Alignment not power of two - } - - if (invalidArgument) - throw new CommandLineException(SR.InvalidCustomPESectionAlignment); - } - } - - private int Run() + private int Run(string[] args) { using (PerfEventSource.StartStopEvents.CompilationEvents()) { @@ -275,12 +288,17 @@ private int Run() { InitializeDefaultOptions(); - ProcessCommandLine(); + ProcessCommandLine(args); + + if (_commandLineOptions.Help) + { + Console.WriteLine(_commandLineOptions.HelpText); + return 1; + } if (_commandLineOptions.OutputFilePath == null) throw new CommandLineException(SR.MissingOutputFile); - CheckCustomPESectionAlignment(); ConfigureTarget(); InstructionSetSupport instructionSetSupport = ConfigureInstructionSetSupport(); @@ -291,9 +309,38 @@ private int Run() SharedGenericsMode genericsMode = SharedGenericsMode.CanonicalReferenceTypes; var targetDetails = new TargetDetails(_targetArchitecture, _targetOS, TargetAbi.CoreRT, instructionSetSupport.GetVectorTSimdVector()); - _typeSystemContext = new ReadyToRunCompilerContext(targetDetails, genericsMode); - string compositeRootPath = _commandLineOptions.CompositeRootPath?.FullName; + bool versionBubbleIncludesCoreLib = false; + if (_commandLineOptions.InputBubble) + { + versionBubbleIncludesCoreLib = true; + } + else + { + foreach (var inputFile in _inputFilePaths) + { + if (String.Compare(inputFile.Key, "System.Private.CoreLib", StringComparison.OrdinalIgnoreCase) == 0) + { + versionBubbleIncludesCoreLib = true; + break; + } + } + if (!versionBubbleIncludesCoreLib) + { + foreach (var inputFile in _unrootedInputFilePaths) + { + if (String.Compare(inputFile.Key, "System.Private.CoreLib", StringComparison.OrdinalIgnoreCase) == 0) + { + versionBubbleIncludesCoreLib = true; + break; + } + } + } + } + + _typeSystemContext = new ReadyToRunCompilerContext(targetDetails, genericsMode, versionBubbleIncludesCoreLib); + + string compositeRootPath = _commandLineOptions.CompositeRootPath; // // TODO: To support our pre-compiled test tree, allow input files that aren't managed assemblies since @@ -383,7 +430,7 @@ private int Run() if (_typeSystemContext.InputFilePaths.Count == 0) { - if (_commandLineOptions.InputFilePaths.Count() > 0) + if (_commandLineOptions.InputFilePaths.Count > 0) { Console.WriteLine(SR.InputWasNotLoadable); return 2; @@ -401,12 +448,9 @@ private int Run() var logger = new Logger(Console.Out, _commandLineOptions.Verbose); List mibcFiles = new List(); - if (_commandLineOptions.Mibc != null) + foreach (var file in _commandLineOptions.MibcFilePaths) { - foreach (var file in _commandLineOptions.Mibc) - { - mibcFiles.Add(file.FullName); - } + mibcFiles.Add(file); } foreach (var referenceFile in _referenceFilePaths.Values) @@ -524,14 +568,15 @@ private int Run() .UseIbcTuning(_commandLineOptions.Tuning) .UseResilience(_commandLineOptions.Resilient) .UseMapFile(_commandLineOptions.Map) + .UseMapCsvFile(_commandLineOptions.MapCsv) .UseParallelism(_commandLineOptions.Parallelism) .UseProfileData(profileDataManager) - .FileLayoutAlgorithms(_commandLineOptions.MethodLayout, _commandLineOptions.FileLayout) + .FileLayoutAlgorithms(_methodLayout, _fileLayout) .UseJitPath(_commandLineOptions.JitPath) .UseInstructionSetSupport(instructionSetSupport) .UseCustomPESectionAlignment(_commandLineOptions.CustomPESectionAlignment) .UseVerifyTypeAndFieldLayout(_commandLineOptions.VerifyTypeAndFieldLayout) - .GenerateOutputFile(_commandLineOptions.OutputFilePath.FullName) + .GenerateOutputFile(_commandLineOptions.OutputFilePath) .UseILProvider(ilProvider) .UseBackendOptions(_commandLineOptions.CodegenOptions) .UseLogger(logger) @@ -542,10 +587,10 @@ private int Run() compilation = builder.ToCompilation(); } - compilation.Compile(_commandLineOptions.OutputFilePath.FullName); + compilation.Compile(_commandLineOptions.OutputFilePath); if (_commandLineOptions.DgmlLogFileName != null) - compilation.WriteDependencyLog(_commandLineOptions.DgmlLogFileName.FullName); + compilation.WriteDependencyLog(_commandLineOptions.DgmlLogFileName); } return 0; @@ -594,7 +639,7 @@ private MethodDesc CheckAndParseSingleMethodModeArguments(CompilerTypeSystemCont throw new CommandLineException(string.Format(SR.MethodNotFoundOnType, _commandLineOptions.SingleMethodName, _commandLineOptions.SingleMethodTypeName)); if (method.HasInstantiation != (_commandLineOptions.SingleMethodGenericArg != null) || - (method.HasInstantiation && (method.Instantiation.Length != _commandLineOptions.SingleMethodGenericArg.Length))) + (method.HasInstantiation && (method.Instantiation.Length != _commandLineOptions.SingleMethodGenericArg.Count))) { throw new CommandLineException( string.Format(SR.GenericArgCountMismatch, method.Instantiation.Length, _commandLineOptions.SingleMethodName, _commandLineOptions.SingleMethodTypeName)); @@ -629,21 +674,12 @@ private static bool DumpReproArguments(CodeGenerationFailedException ex) return false; } - public static async Task Main(string[] args) + private static int Main(string[] args) { - PerfEventSource.StartStopEvents.CommandLineProcessingStart(); - var command = CommandLineOptions.RootCommand(); - command.Handler = CommandHandler.Create((CommandLineOptions options) => InnerMain(options)); - return await command.InvokeAsync(args); - } - - private static int InnerMain(CommandLineOptions buildOptions) - { - PerfEventSource.StartStopEvents.CommandLineProcessingStop(); #if DEBUG try { - return new Program(buildOptions).Run(); + return new Program().Run(args); } catch (CodeGenerationFailedException ex) when (DumpReproArguments(ex)) { @@ -652,7 +688,7 @@ private static int InnerMain(CommandLineOptions buildOptions) #else try { - return new Program(buildOptions).Run(); + return new Program().Run(args); } catch (Exception e) { diff --git a/src/coreclr/src/tools/aot/crossgen2/Properties/Resources.resx b/src/coreclr/src/tools/aot/crossgen2/Properties/Resources.resx index c34c27bcad1f..687e7818f337 100644 --- a/src/coreclr/src/tools/aot/crossgen2/Properties/Resources.resx +++ b/src/coreclr/src/tools/aot/crossgen2/Properties/Resources.resx @@ -135,9 +135,18 @@ Expected {0} generic arguments for method '{1}' on type '{2}' + + Display this usage message + True when the entire input forms a version bubble (default = per-assembly bubble) + + Method layout must be either DefaultSort or MethodOrder. + + + Method layout must be either DefaultSort, ExclusiveWeight, HotCold, or HotWarmCold. + True to skip compiling methods into the R2R image (default = false) @@ -160,7 +169,7 @@ Instruction set '{0}' implies support for instruction set '{1}' - "Input files without automatic rooting of all methods + Input files without automatic rooting of all methods Path to JIT compiler library @@ -175,7 +184,7 @@ Mibc file(s) for profile guided optimization - Output filename must be specified (/out <file>) + Output filename must be specified (--out <file>) No input files are loadable @@ -265,16 +274,16 @@ Use custom alignment for PE sections in generated PE file - Custom PE Section Alignment must be a power of two greater than 4096. + Custom PE Section Alignment must be a power of two greater or equal to 4096. Error: multiple input files are only supported in composite build mode: {0} - Layout methods in file using profile driven optimization assuming the layout algorithm specified. The default value is DefaultSort, which indicates that complex layout is disabled + Layout algorithm used by profile-driven optimization for arranging methods in a file: DefaultSort, ExclusiveWeight, HotCold, or HotWarmCold). The default value is DefaultSort, which indicates that complex layout is disabled. - Layout non-method contents of file using profile driven optimization assuming the layout algorithm specified. The default value is DefaultSort, which indicates that complex layout is disabled + Layout algorithm used by profile-driven optimization for arranging non-method contents in a file: DefaultSort or MethodOrder. The default value is DefaultSort, which indicates that complex layout is disabled. Logical root folder for composite builds; defaults to directory of 1st input file. @@ -285,4 +294,7 @@ Verify that struct type layout and field offsets match between compile time and runtime. Use only for diagnostic purposes. + + Generate a CSV formatted map file + \ No newline at end of file diff --git a/src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj index 2de5f5682145..2d41acad35a5 100644 --- a/src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj @@ -3,13 +3,13 @@ crossgen2 true Exe - $(NetCoreAppCurrent) + $(NetCoreAppToolCurrent) 8002,NU1701 - x64;x86 + x64;x86;arm64;arm AnyCPU false true - $(BinDir)/crossgen2 + $(RuntimeBinDir)/crossgen2 true false linux-x64;linux-musl-x64;win-x64 @@ -21,6 +21,11 @@ true System.SR + + + true + Internal.CommandLine.Strings + @@ -30,23 +35,33 @@ + + + + + + + + + + + - - - - - $(SystemCommandLineVersion) - + + x64 + x64 + x64 unix win - $(TargetOSComponent)-$(TargetArchitecture) + $(TargetOSComponent)_$(TargetArchitecture)_$(TargetArchitecture) + $(TargetOSComponent)_$(TargetArchitecture)_$(CrossHostArch) lib @@ -54,33 +69,43 @@ .so .dylib - $(LibraryNamePrefix)jitinterface$(LibraryNameExtension) + $(LibraryNamePrefix)jitinterface_$(TargetArchitecture)$(LibraryNameExtension) - - + + + + + - $(BinDir)\$(CrossHostArch)\crossgen2 + $(RuntimeBinDir)\$(CrossHostArch)\crossgen2 - - + + @@ -91,8 +116,15 @@ /> + diff --git a/src/coreclr/src/tools/aot/jitinterface/CMakeLists.txt b/src/coreclr/src/tools/aot/jitinterface/CMakeLists.txt index db31bdaa3e82..faba8d685c9e 100644 --- a/src/coreclr/src/tools/aot/jitinterface/CMakeLists.txt +++ b/src/coreclr/src/tools/aot/jitinterface/CMakeLists.txt @@ -7,9 +7,9 @@ set(NATIVE_SOURCES corinfoexception.cpp ) -add_library_clr(jitinterface +add_library_clr(jitinterface_${ARCH_HOST_NAME} SHARED ${NATIVE_SOURCES} ) -install_clr(TARGETS jitinterface) +install_clr(TARGETS jitinterface_${ARCH_HOST_NAME}) diff --git a/src/coreclr/src/tools/aot/jitinterface/jitinterface.h b/src/coreclr/src/tools/aot/jitinterface/jitinterface.h index 70a85d3fa390..ecb7e88915b7 100644 --- a/src/coreclr/src/tools/aot/jitinterface/jitinterface.h +++ b/src/coreclr/src/tools/aot/jitinterface/jitinterface.h @@ -4,8 +4,6 @@ // DO NOT EDIT THIS FILE! It IS AUTOGENERATED #include "corinfoexception.h" -struct CORINFO_LOOKUP_KIND; - struct JitInterfaceCallbacks { unsigned int (* getMethodAttribs)(void * thisHandle, CorInfoException** ppException, void* ftn); diff --git a/src/coreclr/src/tools/aot/jitinterface/jitwrapper.cpp b/src/coreclr/src/tools/aot/jitinterface/jitwrapper.cpp index b4b51185a1f4..cf21e76952b2 100644 --- a/src/coreclr/src/tools/aot/jitinterface/jitwrapper.cpp +++ b/src/coreclr/src/tools/aot/jitinterface/jitwrapper.cpp @@ -26,11 +26,11 @@ class CORJIT_FLAGS uint64_t corJitFlags; }; -static const GUID JITEEVersionIdentifier = { /* 7af97117-55be-4c76-afb2-e26261cb140e */ - 0x7af97117, - 0x55be, - 0x4c76, - { 0xaf, 0xb2, 0xe2, 0x62, 0x61, 0xcb, 0x14, 0x0e } +static const GUID JITEEVersionIdentifier = { /* 062114d0-bd20-483f-8a3e-c4ee39706ae8 */ + 0x062114d0, + 0xbd20, + 0x483f, + {0x8a, 0x3e, 0xc4, 0xee, 0x39, 0x70, 0x6a, 0xe8} }; class Jit diff --git a/src/coreclr/src/tools/crossgen/CMakeLists.txt b/src/coreclr/src/tools/crossgen/CMakeLists.txt index bf37a9cc75e5..4af88ce4dc1f 100644 --- a/src/coreclr/src/tools/crossgen/CMakeLists.txt +++ b/src/coreclr/src/tools/crossgen/CMakeLists.txt @@ -50,7 +50,7 @@ target_link_libraries(crossgen ${CLRJIT_CROSSGEN} gcinfo_crossgen corzap_crossgen - mscorlib_crossgen + corelib_crossgen utilcode_crossgen ) @@ -80,4 +80,4 @@ add_subdirectory(../../zap ../../zap) add_subdirectory(../../vm/crossgen ../../vm/crossgen) # add the install targets -install_clr(TARGETS crossgen ADDITIONAL_DESTINATION sharedFramework) +install_clr(TARGETS crossgen ADDITIONAL_DESTINATIONS sharedFramework) diff --git a/src/coreclr/src/tools/crossgen/crossgen.cpp b/src/coreclr/src/tools/crossgen/crossgen.cpp index 41da650119d8..803ea5aff6e7 100644 --- a/src/coreclr/src/tools/crossgen/crossgen.cpp +++ b/src/coreclr/src/tools/crossgen/crossgen.cpp @@ -35,7 +35,7 @@ enum ReturnValues STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzAppNiPaths, LPCWSTR pwzPdbPath, BOOL fGeneratePDBLinesInfo, LPCWSTR pwzManagedPdbSearchPath, LPCWSTR pwzDiasymreaderPath); STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, SIZE_T customBaseAddress=0, ICorSvcLogger *pLogger = NULL, LPCWSTR pwszCLRJITPath = nullptr); void SetSvcLogger(ICorSvcLogger *pCorSvcLogger); -void SetMscorlibPath(LPCWSTR wzSystemDirectory); +void SetCoreLibPath(LPCWSTR wzSystemDirectory); /* --------------------------------------------------------------------------- * * Console stuff @@ -257,7 +257,7 @@ bool StringEndsWith(LPCWSTR pwzString, LPCWSTR pwzCandidate) // When using the Phone binding model (TrustedPlatformAssemblies), automatically // detect which path CoreLib.[ni.]dll lies in. // -bool ComputeMscorlibPathFromTrustedPlatformAssemblies(SString& pwzMscorlibPath, LPCWSTR pwzTrustedPlatformAssemblies) +bool ComputeCoreLibPathFromTrustedPlatformAssemblies(SString& pwzCoreLibPath, LPCWSTR pwzTrustedPlatformAssemblies) { LPWSTR wszTrustedPathCopy = new WCHAR[wcslen(pwzTrustedPlatformAssemblies) + 1]; wcscpy_s(wszTrustedPathCopy, wcslen(pwzTrustedPlatformAssemblies) + 1, pwzTrustedPlatformAssemblies); @@ -277,11 +277,11 @@ bool ComputeMscorlibPathFromTrustedPlatformAssemblies(SString& pwzMscorlibPath, if (StringEndsWith(wszSingleTrustedPath, DIRECTORY_SEPARATOR_STR_W CoreLibName_IL_W) || StringEndsWith(wszSingleTrustedPath, DIRECTORY_SEPARATOR_STR_W CoreLibName_NI_W)) { - pwzMscorlibPath.Set(wszSingleTrustedPath); - SString::Iterator pwzSeparator = pwzMscorlibPath.End(); + pwzCoreLibPath.Set(wszSingleTrustedPath); + SString::Iterator pwzSeparator = pwzCoreLibPath.End(); bool retval = true; - if (!SUCCEEDED(CopySystemDirectory(pwzMscorlibPath, pwzMscorlibPath))) + if (!SUCCEEDED(CopySystemDirectory(pwzCoreLibPath, pwzCoreLibPath))) { retval = false; } @@ -318,7 +318,7 @@ void PopulateTPAList(SString path, LPCWSTR pwszMask, SString &refTPAList, bool f // No NIs are supported when creating NI images (other than NI of System.Private.CoreLib.dll). if (!fCreatePDB) { - // Only CoreLib's ni.dll should be in the TPAList for the compilation of non-mscorlib assemblies. + // Only CoreLib's ni.dll should be in the TPAList for the compilation of non-CoreLib assemblies. if (StringEndsWith((LPWSTR)pwszFilename, W(".ni.dll"))) { fAddFileToTPAList = false; @@ -837,10 +837,10 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) if (pwzTrustedPlatformAssemblies != nullptr) { - if (ComputeMscorlibPathFromTrustedPlatformAssemblies(wzTrustedPathRoot, pwzTrustedPlatformAssemblies)) + if (ComputeCoreLibPathFromTrustedPlatformAssemblies(wzTrustedPathRoot, pwzTrustedPlatformAssemblies)) { pwzPlatformAssembliesPaths = wzTrustedPathRoot.GetUnicode(); - SetMscorlibPath(pwzPlatformAssembliesPaths); + SetCoreLibPath(pwzPlatformAssembliesPaths); } } diff --git a/src/coreclr/src/tools/dotnet-pgo/Program.cs b/src/coreclr/src/tools/dotnet-pgo/Program.cs index 96c346dd11ac..ee971bf5cf66 100644 --- a/src/coreclr/src/tools/dotnet-pgo/Program.cs +++ b/src/coreclr/src/tools/dotnet-pgo/Program.cs @@ -8,6 +8,7 @@ using Microsoft.Diagnostics.Tracing.Etlx; using Microsoft.Diagnostics.Tracing.Parsers.Clr; using System; +using System.Buffers.Binary; using System.Collections.Generic; using System.IO; using System.Reflection; @@ -1119,7 +1120,7 @@ static IEnumerable ReadMIbcGroup(TypeSystemContext tsc, EcmaMethod met switch (opcode) { case ILOpcode.ldtoken: - UInt32 token = (UInt32)(ilBytes[currentOffset + 1] + (ilBytes[currentOffset + 2] << 8) + (ilBytes[currentOffset + 3] << 16) + (ilBytes[currentOffset + 4] << 24)); + UInt32 token = BinaryPrimitives.ReadUInt32LittleEndian(ilBytes.AsSpan(currentOffset + 1)); if (metadataObject == null) metadataObject = ilBody.GetObject((int)token); @@ -1222,7 +1223,7 @@ static IEnumerable ReadMIbcData(TraceTypeSystemContext tsc, FileInfo o switch (opcode) { case ILOpcode.ldtoken: - UInt32 token = (UInt32)(ilBytes[currentOffset + 1] + (ilBytes[currentOffset + 2] << 8) + (ilBytes[currentOffset + 3] << 16) + (ilBytes[currentOffset + 4] << 24)); + UInt32 token = BinaryPrimitives.ReadUInt32LittleEndian(ilBytes.AsSpan(currentOffset + 1)); foreach (var data in ReadMIbcGroup(tsc, (EcmaMethod)ilBody.GetObject((int)token))) yield return data; break; diff --git a/src/coreclr/src/tools/dotnet-pgo/README.md b/src/coreclr/src/tools/dotnet-pgo/README.md index 60b7101ad0dd..a377bf1e4e23 100644 --- a/src/coreclr/src/tools/dotnet-pgo/README.md +++ b/src/coreclr/src/tools/dotnet-pgo/README.md @@ -32,7 +32,7 @@ Note, this tool requires MethodDetails events which are produced by the .NET 5.0 ``` "dotnet trace collect -p 73060 --providers Microsoft-Windows-DotNETRuntime:0x6000080018:5" ``` - + - Capture events from process 73060 where we capture only JIT events using EventPipe tracing ``` "dotnet trace collect -p 73060 --providers Microsoft-Windows-DotNETRuntime:0x4000080018:5" diff --git a/src/coreclr/src/tools/dotnet-pgo/TraceTypeSystemContext.cs b/src/coreclr/src/tools/dotnet-pgo/TraceTypeSystemContext.cs index 7371f92600c8..507b09dac740 100644 --- a/src/coreclr/src/tools/dotnet-pgo/TraceTypeSystemContext.cs +++ b/src/coreclr/src/tools/dotnet-pgo/TraceTypeSystemContext.cs @@ -360,21 +360,16 @@ public MetadataStringDecoder GetMetadataStringDecoder() return _metadataStringDecoder; } - MetadataReader IAssemblyResolver.FindAssembly(MetadataReader metadataReader, AssemblyReferenceHandle assemblyReferenceHandle, string parentFile) + IAssemblyMetadata IAssemblyResolver.FindAssembly(MetadataReader metadataReader, AssemblyReferenceHandle assemblyReferenceHandle, string parentFile) { - return ((EcmaAssembly)this.GetModuleForSimpleName(metadataReader.GetString(metadataReader.GetAssemblyReference(assemblyReferenceHandle).Name), false)).MetadataReader; + EcmaAssembly ecmaAssembly = (EcmaAssembly)this.GetModuleForSimpleName(metadataReader.GetString(metadataReader.GetAssemblyReference(assemblyReferenceHandle).Name), false); + return new StandaloneAssemblyMetadata(ecmaAssembly.PEReader); } - MetadataReader IAssemblyResolver.FindAssembly(string simpleName, string parentFile) + IAssemblyMetadata IAssemblyResolver.FindAssembly(string simpleName, string parentFile) { - return ((EcmaAssembly)this.GetModuleForSimpleName(simpleName, false)).MetadataReader; + EcmaAssembly ecmaAssembly = (EcmaAssembly)this.GetModuleForSimpleName(simpleName, false); + return new StandaloneAssemblyMetadata(ecmaAssembly.PEReader); } - bool IAssemblyResolver.Naked => false; - - bool IAssemblyResolver.SignatureBinary => false; - - bool IAssemblyResolver.InlineSignatureBinary => false; - - } } diff --git a/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo-experiment.md b/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo-experiment.md index c47d9d227b40..14f9c63bbe1c 100644 --- a/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo-experiment.md +++ b/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo-experiment.md @@ -1,7 +1,7 @@ # Experiments towards a Profile Data pipeline for .NET ----- -The .NET Runtime has a long history of providing instrumentation based profile guided optimization -for use internally at Microsoft, and for scenarios involving extremely high value customers. To +The .NET Runtime has a long history of providing instrumentation based profile guided optimization +for use internally at Microsoft, and for scenarios involving extremely high value customers. To this end the team built the IBC (instrumented block count) infrastructure into the runtime/ngen, and IBCMerge as a tool for manipulating .ibc files. Over the last few years, the structure of these technologies and tools has shown that they are not ideal for customer use or even internal use, and @@ -33,19 +33,19 @@ Profile guided optimization in .NET is used to provide benefits for 3 major conc Startup time for an application is primarily improved by avoiding the use of the JIT by ahead of time compiling methods in the application. In addition a profile can allow determination of which methods are hot vs cold, and group methods commonly used together with others. This has been the primary use -of pgo in .NET historically. +of pgo in .NET historically. Pgo is used to address size on disk concerns of R2R binaries where the default R2R strategy is too aggressive and produces binaries that are excessively large. The idea in that case is to only generate the functions specifically referenced in some profile instead of every method the heuristic indicates may be interesting. -Application throughput performance has historically been the primary use of pgo data for C++ compilers. +Application throughput performance has historically been the primary use of pgo data for C++ compilers. .NET has history with the use of instrumented per block counts, but this data is not generally processed in an effective manner by the JIT. This proposal aims to revitalize efforts to make good use of profile guided data to improve code quality. Over time, it is expected that not only will profile data be used at build time, but that it will also be used to do runtime profile instrumentation. - + # Proposal Contents Profile guided optimization is a combination of effort across a swath of components. @@ -59,7 +59,7 @@ And there are a series of components that need to be modified 2. Instrumenting jit (clrjit) 3. Trace processing tool (dotnet-pgo) 4. AOT compilation tool (crossgen2) -6. Consuming runtime (coreclr) +6. Consuming runtime (coreclr) 7. Diagnostic tools (r2rdump, dotnet-pgo) ## Conceptual model of `InstrumentationData` @@ -68,7 +68,7 @@ statically, and instead is determined through instrumentation of the code. The f is expected to be defined by the JIT team, and be specific to the probes inserted, and may very well change over time. It is composed of two sections -1. The descriptor used to describe the probes, this is fixed at JIT time, and describes the meaning of the data. +1. The descriptor used to describe the probes, this is fixed at JIT time, and describes the meaning of the data. 2. The data gathered as counts, and values that will be used to perform further optimization. Both of these data blocks are able to contain type and method data, where the concept is that it is @@ -78,7 +78,7 @@ but there are also plausible cases for gathering each kind of data in both secti 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 -compilation rejit scenarios with in process profiling. +compilation rejit scenarios with in process profiling. ## Trace data format Runtime instrumentation will be accomplished through 4 events, 2 of which are already existing @@ -149,7 +149,7 @@ Profile data shall be encoded into the R2R FileFormat in a new section named `RE This section shall hold a version number, and a single `NativeHashtable` that contains a mapping from type/method to the pair of Desc and Data. TODO define how Desc and Data are encoded. The intention is to store exactly the same data as is stored in the PGO data file, except that the instrumentation data version must be the same for -all data chunks. +all data chunks. ## Instrumenting Runtime The runtime shall be responsible for choosing when to execute instrumentation, allocating the tracing buffers @@ -197,7 +197,7 @@ data that may be embedded into the R2R file format for possible consumption by t ## Trace processing tool The trace processing tool is responsible for reading the trace files as produced by perfview/dotnet trace, and producing .MIBC files. The process should be a straightforward format translation for instrumentation data. The -`FunctionTouchOrder` and existence of the method shall be based on the `JitStarted` and `R2EEntryPoint` events. +`FunctionTouchOrder` and existence of the method shall be based on the `JitStarted` and `R2EEntryPoint` events. ## AOT Compilation tool AOT compilation shall use the profile guided data in several ways. @@ -210,7 +210,7 @@ data for the method being compiled, and for both the uninstantiated method and i as are present. The jit is responsible for merging these multiple data sources. In addition the JIT may optionally choose to generate a profile guided data block for association with the precompiled -code for use in re-jit scenarios, and information about related method code layout for the code, and optionally a +code for use in re-jit scenarios, and information about related method code layout for the code, and optionally a portion of the function body which is to be placed into a cold code section. The intention here it to allow some algorithm such as Pettis-Hansen or a more modern variant (eg https://research.fb.com/wp-content/uploads/2017/01/cgo2017-hfsort-final1.pdf) to be used to optimize code layout. @@ -219,7 +219,7 @@ to be used to optimize code layout. If present in an R2R file, when a method is rejitted, the runtime shall provide a means for the jit to see instrumentation data from either previous compiles in process, and/or from the R2R file. This shall provide a means for the JIT to choose whether or not the method should be recompiled, or possibly to inform it about optimization opportunities that are -too expensive to compute at jit time, but could be computed by the AOT compiler, or other such ideas. +too expensive to compute at jit time, but could be computed by the AOT compiler, or other such ideas. As a means of doing this, options such as the following will be given to the jit to provide custom behavior. 1. Ignore the profile data and rejit. @@ -235,4 +235,4 @@ would be to use this as a means for adaptive or speculative optimization. The tools r2rdump and dotnet-pgo shall provide a means for dumping their inputs. For most forms of data this is fairly straightforward, but for `InstrumentationData`, there shall be a common dump tool written in managed code that can provide a human readable dump of the data. r2rdump, dotnet-pgo, and possibly sos will all be able to share -this codebase for examination of the data structures in r2r files, traces, and runtime environments respectively. +this codebase for examination of the data structures in r2r files, traces, and runtime environments respectively. diff --git a/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo.csproj b/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo.csproj index c5c6745fda84..8dcb83dc3ec2 100644 --- a/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo.csproj +++ b/src/coreclr/src/tools/dotnet-pgo/dotnet-pgo.csproj @@ -3,10 +3,10 @@ dotnet-pgo Exe - $(NetCoreAppCurrent) + $(NetCoreAppToolCurrent) true 8.0 - $(BinDir)/dotnet-pgo + $(RuntimeBinDir)/dotnet-pgo true false linux-x64;linux-musl-x64;win-x64 diff --git a/src/coreclr/src/tools/metainfo/mdobj.cpp b/src/coreclr/src/tools/metainfo/mdobj.cpp index 7a2b39ac8184..c8851a85228f 100644 --- a/src/coreclr/src/tools/metainfo/mdobj.cpp +++ b/src/coreclr/src/tools/metainfo/mdobj.cpp @@ -81,10 +81,10 @@ void GetMapViewOfFile(__in WCHAR *szFile, PBYTE *ppbMap, DWORD *pdwFileSize) } _ASSERTE(dwHighSize == 0); - hMapFile = CreateFileMappingA(hFile, NULL, PAGE_READONLY, 0, 0, NULL); + hMapFile = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL); CloseHandle(hFile); if (!hMapFile) - MDInfo::Error("CreateFileMappingA failed!"); + MDInfo::Error("CreateFileMappingW failed!"); *ppbMap = (PBYTE) MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, 0); CloseHandle(hMapFile); diff --git a/src/coreclr/src/tools/metainfo/metainfo.cpp b/src/coreclr/src/tools/metainfo/metainfo.cpp deleted file mode 100644 index 38499bea47e1..000000000000 --- a/src/coreclr/src/tools/metainfo/metainfo.cpp +++ /dev/null @@ -1,167 +0,0 @@ -// 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 -#include -#include "mdinfo.h" - -// Global variables -bool g_bSchema = false; -bool g_bRaw = false; -bool g_bDebug = false; -bool g_bHeader = false; - -// Validator module type. -DWORD g_ValModuleType = ValidatorModuleTypeInvalid; - -IMetaDataImport2 *g_pImport = NULL; -IMetaDataDispenserEx *g_pDisp = NULL; - -void DisplayFile(__in_z __in WCHAR* szFile, BOOL isFile, ULONG DumpFilter, __in_z __in_opt WCHAR* szObjFile, strPassBackFn pDisplayString); -void DisplayArchive(__in_z __in WCHAR* szFile, ULONG DumpFilter, __in_z __in_opt WCHAR* szObjName, strPassBackFn pDisplayString); - -void PrintLogo() -{ - printf("Microsoft (R) .NET Runtime Meta Data Dump Utility Version %s\n", CLR_PRODUCT_VERSION); - printf("%S", VER_LEGALCOPYRIGHT_LOGO_STR_L); - printf("\n"); -}// PrintLogo - -void Usage() -{ - printf("\n"); - printf("metainfo [-? | -header | -schema | -raw | -validate] [-nologo] [-obj ] [ | ]\n"); - printf(" -? Displays this text.\n"); - printf(" -hex Prints more things in hex as well as words.\n"); - printf(" -header Prints MetaData header information and sizes.\n"); - printf(" -csv Prints the header sizes in Comma Separated format.\n"); - printf(" -unsat Prints unresolved externals.\n"); - printf(" -assem Prints only the Assembly information.\n"); - printf(" -schema Prints the MetaData schema information.\n"); - printf(" -raw Prints the raw MetaData tables.\n"); - printf(" -heaps Prints the raw heaps (only if -raw).\n"); - printf(" -names Prints string columns (only if -raw).\n"); - printf(" -validate Validate the consistency of the metadata.\n"); - printf(" -nologo Do not display the logo and MVID.\n"); - printf(" -obj \n"); - printf(" Prints the MetaData for the specified obj file in the given \n"); - printf(" archive(.lib) - e.g metainfo libc.lib -obj wMSILWinCRTStartup.obj\n"); - - MDInfo::Error(""); -} - -void DisplayString(__in_z __in const char *str) -{ - printf("%s", str); -} - -extern "C" int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) -{ - WCHAR *pArg = NULL; - WCHAR *szObjName = NULL; - ULONG DumpFilter = MDInfo::dumpDefault; - HRESULT hr = 0; - BOOL fWantHelp=FALSE; - - // Validate incoming arguments - for (int i=1; iRelease(); - return 0; -} diff --git a/src/coreclr/src/tools/r2rdump/CoreDisTools.cs b/src/coreclr/src/tools/r2rdump/CoreDisTools.cs index e21e87c4282f..2301080366fa 100644 --- a/src/coreclr/src/tools/r2rdump/CoreDisTools.cs +++ b/src/coreclr/src/tools/r2rdump/CoreDisTools.cs @@ -358,6 +358,18 @@ public int GetInstruction(RuntimeFunction rtf, int imageOffset, int rtfOffset, o return instrSize; } + private bool TryGetImportCellName(int target, out string targetName) + { + targetName = null; + _reader.ImportSignatures.TryGetValue(target, out ReadyToRunSignature targetSignature); + if (targetSignature != null) + { + targetName = targetSignature.ToString(_options.GetSignatureFormattingOptions()); + return true; + } + return false; + } + const string RelIPTag = "[rip "; /// @@ -379,7 +391,7 @@ private void ProbeX64Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffset, StringBuilder translated = new StringBuilder(); translated.Append(instruction, 0, leftBracket); - _reader.ImportCellNames.TryGetValue(target, out string targetName); + TryGetImportCellName(target, out string targetName); if (_options.Naked) { @@ -424,14 +436,15 @@ private void ProbeX86Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffset, int leftBracket; int rightBracketPlusOne; int absoluteAddress; - if (TryParseRipRelative(instruction, out leftBracket, out rightBracketPlusOne, out absoluteAddress)) + if (TryParseRipRelative(instruction, out leftBracket, out rightBracketPlusOne, out absoluteAddress) || + TryParseAbsoluteAddress(instruction, out leftBracket, out rightBracketPlusOne, out absoluteAddress)) { int target = absoluteAddress - (int)_reader.ImageBase; StringBuilder translated = new StringBuilder(); translated.Append(instruction, 0, leftBracket); - _reader.ImportCellNames.TryGetValue(target, out string targetName); + TryGetImportCellName(target, out string targetName); if (_options.Naked) { @@ -455,7 +468,6 @@ private void ProbeX86Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffset, } } - translated.Append(instruction, rightBracketPlusOne, instruction.Length - rightBracketPlusOne); instruction = translated.ToString(); } else @@ -495,7 +507,7 @@ private void ProbeCommonIntelQuirks(RuntimeFunction rtf, int imageOffset, int rt if (pointsOutsideRuntimeFunction && IsIntel2ByteIndirectJumpPCRelativeInstruction(targetImageOffset, out int instructionRelativeOffset)) { int thunkTargetRVA = targetRVA + instructionRelativeOffset; - bool haveImportCell = _reader.ImportCellNames.TryGetValue(thunkTargetRVA, out string importCellName); + bool haveImportCell = TryGetImportCellName(thunkTargetRVA, out string importCellName); ; if (_options.Naked && haveImportCell) { @@ -540,6 +552,38 @@ private void ProbeCommonIntelQuirks(RuntimeFunction rtf, int imageOffset, int rt } } + /// + /// Try to parse the [absoluteAddress] section in a disassembled instruction string. + /// + /// Disassembled instruction string + /// Index of the left bracket in the instruction + /// Index of the right bracket in the instruction plus one + /// Value of the absolute address + /// + private bool TryParseAbsoluteAddress(string instruction, out int leftBracket, out int rightBracketPlusOne, out int absoluteAddress) + { + int start = instruction.IndexOf('[', StringComparison.Ordinal); + int current = start + 1; + absoluteAddress = 0; + while (current < instruction.Length && IsDigit(instruction[current])) + { + absoluteAddress = 10 * absoluteAddress + (int)(instruction[current] - '0'); + current++; + } + + if (current < instruction.Length && instruction[current] == ']') + { + leftBracket = start; + rightBracketPlusOne = current + 1; + return true; + } + + leftBracket = 0; + rightBracketPlusOne = 0; + absoluteAddress = 0; + return false; + } + /// /// Try to parse the [rip +- displacement] section in a disassembled instruction string. /// @@ -687,6 +731,19 @@ private bool IsIntel2ByteJumpInstructionWithIntOffset(int imageOffset) (opCode2 >= 0x80 && opCode2 <= 0x8F); // near conditional jumps } + /// + /// Returns true when this is one of the x86 / amd64 conditional near jump + /// opcodes with signed 4-byte offset. + /// + /// Offset within the PE image byte array + private bool IsIntelCallAbsoluteAddress(int imageOffset) + { + byte opCode1 = _reader.Image[imageOffset]; + byte opCode2 = _reader.Image[imageOffset + 1]; + + return opCode1 == 0xFF && opCode2 == 0x15; + } + /// /// Returns true when this is the 2-byte instruction for indirect jump /// with RIP-relative offset. @@ -754,7 +811,7 @@ private void ProbeArm64Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffse var translated = new StringBuilder(); translated.Append(instruction, 0, hashPos); - _reader.ImportCellNames.TryGetValue(target, out string targetName); + TryGetImportCellName(target, out string targetName); if (_options.Naked && (targetName != null)) { @@ -779,7 +836,7 @@ private void ProbeArm64Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffse var translated = new StringBuilder(); translated.Append(instruction, 0, hashPos); - _reader.ImportCellNames.TryGetValue(target, out string targetName); + TryGetImportCellName(target, out string targetName); if (_options.Naked && (targetName != null)) { @@ -841,7 +898,7 @@ private void ProbeArm64Quirks(RuntimeFunction rtf, int imageOffset, int rtfOffse { int labelOffset = ldr1ImageOffset + ldr1Offset; int target = checked((int)(BitConverter.ToUInt64(_reader.Image, labelOffset) - _reader.ImageBase)); - _reader.ImportCellNames.TryGetValue(target, out string targetName); + TryGetImportCellName(target, out string targetName); var translated = new StringBuilder(); if (_options.Naked && (targetName != null)) diff --git a/src/coreclr/src/tools/r2rdump/Extensions.cs b/src/coreclr/src/tools/r2rdump/Extensions.cs index f8ca578f3325..3d297963a85b 100644 --- a/src/coreclr/src/tools/r2rdump/Extensions.cs +++ b/src/coreclr/src/tools/r2rdump/Extensions.cs @@ -8,6 +8,7 @@ using System.Reflection.Metadata.Ecma335; using ILCompiler.Reflection.ReadyToRun; +using ILCompiler.Reflection.ReadyToRun.Amd64; using Internal.Runtime; namespace R2RDump @@ -116,7 +117,7 @@ public static void WriteTo(this ReadyToRunImportSection.ImportSectionEntry theTh writer.Write($" SignatureRVA: 0x{theThis.SignatureRVA:X8}"); writer.Write(" "); } - writer.Write(theThis.Signature); + writer.Write(theThis.Signature.ToString(options.GetSignatureFormattingOptions())); if (theThis.GCRefMap != null) { writer.Write(" -- "); @@ -138,8 +139,8 @@ public static void WriteTo(this ReadyToRunMethod theThis, TextWriter writer, Dum { writer.WriteLine(theThis.SignatureString); - writer.WriteLine($"Handle: 0x{MetadataTokens.GetToken(theThis.MetadataReader, theThis.MethodHandle):X8}"); - writer.WriteLine($"Rid: {MetadataTokens.GetRowNumber(theThis.MetadataReader, theThis.MethodHandle)}"); + writer.WriteLine($"Handle: 0x{MetadataTokens.GetToken(theThis.ComponentReader.MetadataReader, theThis.MethodHandle):X8}"); + writer.WriteLine($"Rid: {MetadataTokens.GetRowNumber(theThis.ComponentReader.MetadataReader, theThis.MethodHandle)}"); if (!options.Naked) { writer.WriteLine($"EntryPointRuntimeFunctionId: {theThis.EntryPointRuntimeFunctionId}"); @@ -151,7 +152,7 @@ public static void WriteTo(this ReadyToRunMethod theThis, TextWriter writer, Dum IEnumerable fixups = theThis.Fixups; if (options.Normalize) { - fixups = fixups.OrderBy((fc) => fc.Signature); + fixups = fixups.OrderBy((fc) => fc.Signature.ToString(options.GetSignatureFormattingOptions())); } foreach (FixupCell cell in fixups) @@ -161,7 +162,7 @@ public static void WriteTo(this ReadyToRunMethod theThis, TextWriter writer, Dum { writer.Write($"TableIndex {cell.TableIndex}, Offset {cell.CellOffset:X4}: "); } - writer.WriteLine(cell.Signature); + writer.WriteLine(cell.Signature.ToString(options.GetSignatureFormattingOptions())); } } } @@ -215,23 +216,27 @@ public static void WriteTo(this RuntimeFunction theThis, TextWriter writer, Dump writer.WriteLine($"PersonalityRVA: 0x{amd64UnwindInfo.PersonalityRoutineRVA:X4}"); } - for (int unwindCodeIndex = 0; unwindCodeIndex < amd64UnwindInfo.CountOfUnwindCodes; unwindCodeIndex++) + for (int uwcIndex = 0; uwcIndex < amd64UnwindInfo.UnwindCodes.Count; uwcIndex++) { - ILCompiler.Reflection.ReadyToRun.Amd64.UnwindCode unwindCode = amd64UnwindInfo.UnwindCodeArray[unwindCodeIndex]; - writer.Write($"UnwindCode[{unwindCode.Index}]: "); + UnwindCode unwindCode = amd64UnwindInfo.UnwindCodes[uwcIndex]; + writer.Write($"UnwindCode[{uwcIndex}]: "); writer.Write($"CodeOffset 0x{unwindCode.CodeOffset:X4} "); writer.Write($"FrameOffset 0x{unwindCode.FrameOffset:X4} "); writer.Write($"NextOffset 0x{unwindCode.NextFrameOffset} "); writer.Write($"Op {unwindCode.OpInfoStr}"); writer.WriteLine(); + uwcIndex++; } } writer.WriteLine(); if (theThis.EHInfo != null) { - writer.WriteLine($@"EH info @ {theThis.EHInfo.RelativeVirtualAddress:X4}, #clauses = {theThis.EHInfo.EHClauses.Count}"); - theThis.EHInfo.WriteTo(writer); + if (options.Naked) + writer.WriteLine($@"EH info, #clauses = {theThis.EHInfo.EHClauses.Count}"); + else + writer.WriteLine($@"EH info @ {theThis.EHInfo.RelativeVirtualAddress:X4}, #clauses = {theThis.EHInfo.EHClauses.Count}"); + theThis.EHInfo.WriteTo(writer, !options.Naked); writer.WriteLine(); } diff --git a/src/coreclr/src/tools/r2rdump/R2RDiff.cs b/src/coreclr/src/tools/r2rdump/R2RDiff.cs index 4f3fd9fe11a8..25e6dd9d6a2d 100644 --- a/src/coreclr/src/tools/r2rdump/R2RDiff.cs +++ b/src/coreclr/src/tools/r2rdump/R2RDiff.cs @@ -255,7 +255,7 @@ private Dictionary GetPESectionMap(ReadyToRunReader reader) { Dictionary sectionMap = new Dictionary(); - foreach (SectionHeader sectionHeader in reader.PEReader.PEHeaders.SectionHeaders) + foreach (SectionHeader sectionHeader in reader.CompositeReader.PEHeaders.SectionHeaders) { sectionMap.Add(sectionHeader.Name, sectionHeader.SizeOfRawData); } @@ -371,7 +371,7 @@ private IEnumerable> HideMethodsWithSameDisasse { if (first) { - _writer.WriteLine("Methods with identical disasssbly skipped in common method diff:"); + _writer.WriteLine("Methods with identical disassembly skipped in common method diff:"); first = false; } _writer.WriteLine(commonMethod.Key); diff --git a/src/coreclr/src/tools/r2rdump/R2RDump.cs b/src/coreclr/src/tools/r2rdump/R2RDump.cs index 62f26189d243..fa21ad441827 100644 --- a/src/coreclr/src/tools/r2rdump/R2RDump.cs +++ b/src/coreclr/src/tools/r2rdump/R2RDump.cs @@ -18,6 +18,7 @@ using ILCompiler.PdbWriter; using Internal.Runtime; +using System.Runtime.InteropServices; namespace R2RDump { @@ -56,6 +57,8 @@ public class DumpOptions : IAssemblyResolver public bool SignatureBinary { get; set; } public bool InlineSignatureBinary { get; set; } + private SignatureFormattingOptions signatureFormattingOptions; + /// /// Probing extensions to use when looking up assemblies under reference paths. /// @@ -70,7 +73,7 @@ public class DumpOptions : IAssemblyResolver /// Name of assembly from which we're performing the lookup /// - public MetadataReader FindAssembly(MetadataReader metadataReader, AssemblyReferenceHandle assemblyReferenceHandle, string parentFile) + public IAssemblyMetadata FindAssembly(MetadataReader metadataReader, AssemblyReferenceHandle assemblyReferenceHandle, string parentFile) { string simpleName = metadataReader.GetString(metadataReader.GetAssemblyReference(assemblyReferenceHandle).Name); return FindAssembly(simpleName, parentFile); @@ -83,7 +86,7 @@ public MetadataReader FindAssembly(MetadataReader metadataReader, AssemblyRefere /// Simple name of the assembly to look up /// Name of assembly from which we're performing the lookup /// - public MetadataReader FindAssembly(string simpleName, string parentFile) + public IAssemblyMetadata FindAssembly(string simpleName, string parentFile) { foreach (FileInfo refAsm in Reference ?? Enumerable.Empty()) { @@ -117,7 +120,7 @@ public MetadataReader FindAssembly(string simpleName, string parentFile) return null; } - private static unsafe MetadataReader Open(string filename) + private static unsafe IAssemblyMetadata Open(string filename) { byte[] image = File.ReadAllBytes(filename); @@ -128,7 +131,21 @@ private static unsafe MetadataReader Open(string filename) throw new BadImageFormatException($"ECMA metadata not found in file '{filename}'"); } - return peReader.GetMetadataReader(); + return new StandaloneAssemblyMetadata(peReader); + } + + public SignatureFormattingOptions GetSignatureFormattingOptions() + { + if (signatureFormattingOptions == null) + { + signatureFormattingOptions = new SignatureFormattingOptions + { + Naked = this.Naked, + SignatureBinary = this.SignatureBinary, + InlineSignatureBinary = this.InlineSignatureBinary, + }; + } + return signatureFormattingOptions; } } @@ -395,7 +412,7 @@ public void Dump(ReadyToRunReader r2r) pdbWriter.WritePDBData(r2r.Filename, ProducePdbWriterMethods(r2r)); } - if (!_options.Header && standardDump) + if (standardDump) { _dumper.DumpAllMethods(); } @@ -411,8 +428,8 @@ IEnumerable ProducePdbWriterMethods(ReadyToRunReader r2r) MethodInfo mi = new MethodInfo(); mi.Name = method.SignatureString; mi.HotRVA = (uint)method.RuntimeFunctions[0].StartAddress; - mi.MethodToken = (uint)MetadataTokens.GetToken(method.MetadataReader, method.MethodHandle); - mi.AssemblyName = method.MetadataReader.GetString(method.MetadataReader.GetAssemblyDefinition().Name); + mi.MethodToken = (uint)MetadataTokens.GetToken(method.ComponentReader.MetadataReader, method.MethodHandle); + mi.AssemblyName = method.ComponentReader.MetadataReader.GetString(method.ComponentReader.MetadataReader.GetAssemblyDefinition().Name); mi.ColdRVA = 0; yield return mi; @@ -428,7 +445,7 @@ private bool Match(ReadyToRunMethod method, string query, bool exact) { int id; bool isNum = ArgStringToInt(query, out id); - bool idMatch = isNum && (method.Rid == id || MetadataTokens.GetRowNumber(method.MetadataReader, method.MethodHandle) == id); + bool idMatch = isNum && (method.Rid == id || MetadataTokens.GetRowNumber(method.ComponentReader.MetadataReader, method.MethodHandle) == id); bool sigMatch = false; if (exact) @@ -525,6 +542,14 @@ public RuntimeFunction FindRuntimeFunction(ReadyToRunReader r2r, int rtfQuery) return null; } + // TODO: Fix R2RDump issue where an R2R image cannot be dissassembled with the x86 CoreDisTools + // For the short term, we want to error out with a decent message explaining the unexpected error + // Issue https://github.com/dotnet/runtime/issues/10928 + private static bool DisassemblerArchitectureSupported() + { + return RuntimeInformation.ProcessArchitecture != Architecture.X86; + } + private int Run() { Disassembler disassembler = null; @@ -551,7 +576,7 @@ private int Run() if (_options.Disasm) { - if (r2r.InputArchitectureSupported() && r2r.DisassemblerArchitectureSupported()) + if (DisassemblerArchitectureSupported()) { disassembler = new Disassembler(r2r, _options); } diff --git a/src/coreclr/src/tools/r2rdump/R2RDump.csproj b/src/coreclr/src/tools/r2rdump/R2RDump.csproj index 133c5cc72c3d..0b575b257ff2 100644 --- a/src/coreclr/src/tools/r2rdump/R2RDump.csproj +++ b/src/coreclr/src/tools/r2rdump/R2RDump.csproj @@ -7,11 +7,11 @@ AnyCPU Open true - $(NetCoreAppCurrent) + $(NetCoreAppToolCurrent) false 8002,NU1701 win-x64;win-x86 - $(BinDir)/R2RDump + $(RuntimeBinDir)/R2RDump AnyCPU;x64 diff --git a/src/coreclr/src/tools/r2rdump/README.md b/src/coreclr/src/tools/r2rdump/README.md index 364cbc3ad581..5578ba4a3ea6 100644 --- a/src/coreclr/src/tools/r2rdump/README.md +++ b/src/coreclr/src/tools/r2rdump/README.md @@ -47,8 +47,8 @@ dotnet R2RDump.dll --in <path to ReadyToRun image> | | x64 | x86 | ARM | ARM64 | | ----------- | --- | --- | --------- | ----- | -| **Windows** | yes | yes | no disasm | yes | -| **Linux** | yes | yes | no disasm | | +| **Windows** | yes | yes | yes | yes | +| **Linux** | yes | yes | yes | yes | | **OSX** | yes | - | - | - | ## ReadyToRun Format @@ -130,12 +130,12 @@ In x64/Arm/Arm64, GcTransitions are grouped into chunks where each chunk covers ## Todo -* Support R2RDump on ARM and ARM64 (https://github.com/dotnet/coreclr/issues/19089) +* Support R2RDump on ARM and ARM64 (https://github.com/dotnet/runtime/issues/10753) -* Parse R2RSections: READYTORUN_SECTION_EXCEPTION_INFO, READYTORUN_SECTION_DEBUG_INFO, READYTORUN_SECTION_DELAYLOAD_METHODCALL_THUNKS, READYTORUN_SECTION_INLINING_INFO, READYTORUN_SECTION_PROFILEDATA_INFO (https://github.com/dotnet/coreclr/issues/19616) +* Parse R2RSections: READYTORUN_SECTION_EXCEPTION_INFO, READYTORUN_SECTION_DEBUG_INFO, READYTORUN_SECTION_DELAYLOAD_METHODCALL_THUNKS, READYTORUN_SECTION_INLINING_INFO, READYTORUN_SECTION_PROFILEDATA_INFO (https://github.com/dotnet/runtime/issues/10948) * Reenable R2RDumpTests after making it less fragile -* Fix issues with disasm on Arm (https://github.com/dotnet/coreclr/issues/19637) and disasm using x86 coredistools (https://github.com/dotnet/coreclr/issues/19564) +* Fix issues with disasm on Arm (https://github.com/dotnet/runtime/issues/10959) and disasm using x86 coredistools (https://github.com/dotnet/runtime/issues/10928) -* Test R2RDump on more test cases to make sure it runs reliably and verify that the output is accurate (list of failing inputs: https://github.com/dotnet/coreclr/issues/19642) +* Test R2RDump on more test cases to make sure it runs reliably and verify that the output is accurate (list of failing inputs: https://github.com/dotnet/runtime/issues/10961) diff --git a/src/coreclr/src/tools/r2rdump/TextDumper.cs b/src/coreclr/src/tools/r2rdump/TextDumper.cs index b3bf91845f38..dc0608b991ab 100644 --- a/src/coreclr/src/tools/r2rdump/TextDumper.cs +++ b/src/coreclr/src/tools/r2rdump/TextDumper.cs @@ -215,18 +215,15 @@ internal override void DumpDisasm(RuntimeFunction rtf, int imageOffset) string instr; int instrSize = _disassembler.GetInstruction(rtf, imageOffset, rtfOffset, out instr); - if (_r2r.Machine == Machine.Amd64 && ((ILCompiler.Reflection.ReadyToRun.Amd64.UnwindInfo)rtf.UnwindInfo).UnwindCodes.ContainsKey(codeOffset)) + if (_r2r.Machine == Machine.Amd64 && ((ILCompiler.Reflection.ReadyToRun.Amd64.UnwindInfo)rtf.UnwindInfo).CodeOffsetToUnwindCodeIndex.TryGetValue(codeOffset, out int unwindCodeIndex)) { - List codes = ((ILCompiler.Reflection.ReadyToRun.Amd64.UnwindInfo)rtf.UnwindInfo).UnwindCodes[codeOffset]; - foreach (ILCompiler.Reflection.ReadyToRun.Amd64.UnwindCode code in codes) + ILCompiler.Reflection.ReadyToRun.Amd64.UnwindCode code = ((ILCompiler.Reflection.ReadyToRun.Amd64.UnwindInfo)rtf.UnwindInfo).UnwindCodes[unwindCodeIndex]; + _writer.Write($"{indentString}{code.UnwindOp} {code.OpInfoStr}"); + if (code.NextFrameOffset != -1) { - _writer.Write($"{indentString}{code.UnwindOp} {code.OpInfoStr}"); - if (code.NextFrameOffset != -1) - { - _writer.WriteLine($"{indentString}{code.NextFrameOffset}"); - } - _writer.WriteLine(); + _writer.WriteLine($"{indentString}{code.NextFrameOffset}"); } + _writer.WriteLine(); } if (!_options.HideTransitions && rtf.Method.GcInfo?.Transitions != null && rtf.Method.GcInfo.Transitions.TryGetValue(codeOffset, out List transitionsForOffset)) @@ -348,6 +345,8 @@ internal override void DumpSectionContents(ReadyToRunSection section) int rtfOffset = _r2r.GetOffset(section.RelativeVirtualAddress); int rtfEndOffset = rtfOffset + section.Size; int rtfIndex = 0; + _writer.WriteLine(" Index | StartRVA | EndRVA | UnwindRVA"); + _writer.WriteLine("-----------------------------------------"); while (rtfOffset < rtfEndOffset) { int startRva = NativeReader.ReadInt32(_r2r.Image, ref rtfOffset); @@ -357,11 +356,8 @@ internal override void DumpSectionContents(ReadyToRunSection section) endRva = NativeReader.ReadInt32(_r2r.Image, ref rtfOffset); } int unwindRva = NativeReader.ReadInt32(_r2r.Image, ref rtfOffset); - _writer.WriteLine($"Index: {rtfIndex}"); - _writer.WriteLine($" StartRva: 0x{startRva:X8}"); - if (endRva != -1) - _writer.WriteLine($" EndRva: 0x{endRva:X8}"); - _writer.WriteLine($" UnwindRva: 0x{unwindRva:X8}"); + string endRvaText = (endRva != -1 ? endRva.ToString("x8") : " "); + _writer.WriteLine($"{rtfIndex,7} | {startRva:X8} | {endRvaText} | {unwindRva:X8}"); rtfIndex++; } break; @@ -409,7 +405,7 @@ internal override void DumpSectionContents(ReadyToRunSection section) int assemblyRefCount = 0; if (!_r2r.Composite) { - MetadataReader globalReader = _r2r.GetGlobalMetadataReader(); + MetadataReader globalReader = _r2r.GetGlobalMetadata().MetadataReader; assemblyRefCount = globalReader.GetTableRowCount(TableIndex.AssemblyRef) + 1; _writer.WriteLine($"MSIL AssemblyRef's ({assemblyRefCount} entries):"); for (int assemblyRefIndex = 1; assemblyRefIndex < assemblyRefCount; assemblyRefIndex++) @@ -466,7 +462,7 @@ private void DumpNakedImportSections() { entries.AddRange(importSection.Entries); } - entries.Sort((e1, e2) => e1.Signature.CompareTo(e2.Signature)); + entries.Sort((e1, e2) => e1.Signature.ToString(_options.GetSignatureFormattingOptions()).CompareTo(e2.Signature.ToString(_options.GetSignatureFormattingOptions()))); foreach (ReadyToRunImportSection.ImportSectionEntry entry in entries) { entry.WriteTo(_writer, _options); diff --git a/src/coreclr/src/tools/r2rtest/BuildFolderSet.cs b/src/coreclr/src/tools/r2rtest/BuildFolderSet.cs index e7e8bd415701..4a7c94d829b3 100644 --- a/src/coreclr/src/tools/r2rtest/BuildFolderSet.cs +++ b/src/coreclr/src/tools/r2rtest/BuildFolderSet.cs @@ -15,6 +15,8 @@ namespace R2RTest { public class BuildFolderSet { + const string FrameworkOutputFileName = "framework-r2r.dll"; + private readonly IEnumerable _buildFolders; private readonly IEnumerable _compilerRunners; @@ -221,9 +223,12 @@ public bool CompileFramework() Stopwatch stopwatch = Stopwatch.StartNew(); string coreRoot = _options.CoreRootDirectory.FullName; + + File.Delete(Path.Combine(coreRoot, FrameworkOutputFileName)); + string[] frameworkFolderFiles = Directory.GetFiles(coreRoot); - IEnumerable frameworkRunners = _options.CompilerRunners(isFramework: true); + IEnumerable frameworkRunners = _options.CompilerRunners(isFramework: true, overrideOutputPath: _options.OutputDirectory.FullName); // Pre-populate the output folders with the input files so that we have backdrops // for failing compilations. @@ -259,7 +264,7 @@ public bool CompileFramework() if (inputFrameworkDlls.Count > 0) { - string outputFileName = runner.GetOutputFileName(_options.CoreRootDirectory.FullName, "framework-r2r.dll"); + string outputFileName = runner.GetOutputFileName(_options.CoreRootDirectory.FullName, FrameworkOutputFileName); ProcessInfo compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, outputFileName, inputFrameworkDlls)); compilationsToRun.Add(compilationProcess); processes[(int)runner.Index] = compilationProcess; diff --git a/src/coreclr/src/tools/r2rtest/BuildOptions.cs b/src/coreclr/src/tools/r2rtest/BuildOptions.cs index cfa0bad14877..ed72c5c194ab 100644 --- a/src/coreclr/src/tools/r2rtest/BuildOptions.cs +++ b/src/coreclr/src/tools/r2rtest/BuildOptions.cs @@ -15,6 +15,9 @@ public class BuildOptions public DirectoryInfo CoreRootDirectory { get; set; } public bool Crossgen { get; set; } public FileInfo CrossgenPath { get; set; } + public FileInfo Crossgen2Path { get; set; } + public bool VerifyTypeAndFieldLayout { get; set; } + public string TargetArch { get; set; } public bool Exe { get; set; } public bool NoJit { get; set; } public bool NoCrossgen2 { get; set; } @@ -31,6 +34,7 @@ public class BuildOptions public bool LargeBubble { get; set; } public bool Composite { get; set; } public int Crossgen2Parallelism { get; set; } + public FileInfo Crossgen2JitPath { get; set; } public int CompilationTimeoutMinutes { get; set; } public int ExecutionTimeoutMinutes { get; set; } public DirectoryInfo[] ReferencePath { get; set; } @@ -107,7 +111,7 @@ public string CoreRootOutputPath(CompilerIndex index, bool isFramework) /// /// True if compiling the CoreFX framework assemblies /// Optional set of reference paths to use instead of BuildOptions.ReferencePaths() - public IEnumerable CompilerRunners(bool isFramework, IEnumerable overrideReferencePaths = null) + public IEnumerable CompilerRunners(bool isFramework, IEnumerable overrideReferencePaths = null, string overrideOutputPath = null) { List runners = new List(); @@ -116,7 +120,7 @@ public IEnumerable CompilerRunners(bool isFramework, IEnumerable List cpaotReferencePaths = new List(); cpaotReferencePaths.Add(CoreRootOutputPath(CompilerIndex.CPAOT, isFramework)); cpaotReferencePaths.AddRange(overrideReferencePaths != null ? overrideReferencePaths : ReferencePaths()); - runners.Add(new Crossgen2Runner(this, new Crossgen2RunnerOptions(), cpaotReferencePaths)); + runners.Add(new Crossgen2Runner(this, new Crossgen2RunnerOptions() { Composite = this.Composite }, cpaotReferencePaths, overrideOutputPath)); } if (Crossgen) @@ -124,7 +128,7 @@ public IEnumerable CompilerRunners(bool isFramework, IEnumerable List crossgenReferencePaths = new List(); crossgenReferencePaths.Add(CoreRootOutputPath(CompilerIndex.Crossgen, isFramework)); crossgenReferencePaths.AddRange(overrideReferencePaths != null ? overrideReferencePaths : ReferencePaths()); - runners.Add(new CrossgenRunner(this, crossgenReferencePaths)); + runners.Add(new CrossgenRunner(this, crossgenReferencePaths, overrideOutputPath)); } if (!NoJit) diff --git a/src/coreclr/src/tools/r2rtest/CommandLineOptions.cs b/src/coreclr/src/tools/r2rtest/CommandLineOptions.cs index 9f6e065565e9..b778264be5d7 100644 --- a/src/coreclr/src/tools/r2rtest/CommandLineOptions.cs +++ b/src/coreclr/src/tools/r2rtest/CommandLineOptions.cs @@ -43,6 +43,9 @@ Command CompileFolder() => OutputDirectory(), Crossgen(), CrossgenPath(), + Crossgen2Path(), + TargetArch(), + VerifyTypeAndFieldLayout(), NoJit(), NoCrossgen2(), Exe(), @@ -58,6 +61,7 @@ Command CompileFolder() => LargeBubble(), Composite(), Crossgen2Parallelism(), + Crossgen2JitPath(), ReferencePath(), IssuesPath(), CompilationTimeoutMinutes(), @@ -76,6 +80,9 @@ Command CompileSubtree() => OutputDirectory(), Crossgen(), CrossgenPath(), + Crossgen2Path(), + TargetArch(), + VerifyTypeAndFieldLayout(), NoJit(), NoCrossgen2(), Exe(), @@ -91,6 +98,7 @@ Command CompileSubtree() => LargeBubble(), Composite(), Crossgen2Parallelism(), + Crossgen2JitPath(), ReferencePath(), IssuesPath(), CompilationTimeoutMinutes(), @@ -106,8 +114,13 @@ Command CompileFramework() => { Crossgen(), CrossgenPath(), + Crossgen2Path(), + TargetArch(), + VerifyTypeAndFieldLayout(), NoCrossgen2(), NoCleanup(), + Crossgen2Parallelism(), + Crossgen2JitPath(), DegreeOfParallelism(), Sequential(), Release(), @@ -119,6 +132,7 @@ Command CompileFramework() => R2RDumpPath(), MeasurePerf(), InputFileSearchString(), + OutputDirectory(), }, CompileFrameworkCommand.CompileFramework); @@ -177,6 +191,12 @@ Option Crossgen() => Option CrossgenPath() => new Option(new[] { "--crossgen-path", "-cp" }, "Explicit Crossgen path (useful for cross-targeting)").ExistingOnly(); + Option Crossgen2Path() => + new Option(new[] { "--crossgen2-path", "-c2p" }, "Explicit Crossgen2 path (useful for cross-targeting)").ExistingOnly(); + + Option VerifyTypeAndFieldLayout() => + new Option(new[] { "--verify-type-and-field-layout" }, "Verify that struct type layout and field offsets match between compile time and runtime. Use only for diagnostic purposes."); + Option NoJit() => new Option(new[] { "--nojit" }, "Don't run tests in JITted mode"); @@ -221,6 +241,9 @@ Option Composite() => Option Crossgen2Parallelism() => new Option(new[] { "--crossgen2-parallelism" }, "Max number of threads to use in Crossgen2 (default = logical processor count)"); + + Option Crossgen2JitPath() => + new Option(new[] { "--crossgen2-jitpath" }, "Jit path to use for crossgen2"); Option IssuesPath() => new Option(new[] { "--issues-path", "-ip" }, "Path to issues.targets") @@ -246,7 +269,9 @@ Option GCStress() => Option DotNetCli() => new Option(new [] { "--dotnet-cli", "-cli" }, "For dev box testing, point at .NET 5 dotnet.exe or /dotnet.cmd."); - + + Option TargetArch() => + new Option(new[] { "--target-arch" }, "Target architecture for crossgen2"); // // compile-nuget specific options diff --git a/src/coreclr/src/tools/r2rtest/Commands/CompileFrameworkCommand.cs b/src/coreclr/src/tools/r2rtest/Commands/CompileFrameworkCommand.cs index fbce2e2fd833..2338bc570579 100644 --- a/src/coreclr/src/tools/r2rtest/Commands/CompileFrameworkCommand.cs +++ b/src/coreclr/src/tools/r2rtest/Commands/CompileFrameworkCommand.cs @@ -21,7 +21,10 @@ public static int CompileFramework(BuildOptions options) string logsFolder = Path.Combine(options.CoreRootDirectory.FullName, "logs"); Directory.CreateDirectory(logsFolder); - options.OutputDirectory = new DirectoryInfo(logsFolder); + if (options.OutputDirectory == null) + { + options.OutputDirectory = new DirectoryInfo(logsFolder); + } options.Framework = true; options.NoJit = true; options.NoEtw = true; diff --git a/src/coreclr/src/tools/r2rtest/CompilerRunner.cs b/src/coreclr/src/tools/r2rtest/CompilerRunner.cs index 206a46b3cf4b..aff944bf05ef 100644 --- a/src/coreclr/src/tools/r2rtest/CompilerRunner.cs +++ b/src/coreclr/src/tools/r2rtest/CompilerRunner.cs @@ -31,7 +31,6 @@ public sealed class FrameworkExclusion { new FrameworkExclusion(ExclusionType.Ignore, "CommandLine", "Not a framework assembly"), new FrameworkExclusion(ExclusionType.Ignore, "R2RDump", "Not a framework assembly"), - new FrameworkExclusion(ExclusionType.Ignore, "xunit.performance.api", "Not a framework assembly"), // TODO (DavidWr): IBC-related failures new FrameworkExclusion(ExclusionType.DontCrossgen2, "Microsoft.CodeAnalysis.CSharp", "Ibc TypeToken 6200019a has type token which resolves to a nil token"), @@ -65,11 +64,15 @@ public static bool Exclude(string simpleName, CompilerIndex index, out string re reason = exclusion.Reason; return true; } - else + + if (simpleName.StartsWith("xunit.", StringComparison.OrdinalIgnoreCase)) { - reason = null; - return false; + reason = "XUnit"; + return true; } + + reason = null; + return false; } } @@ -82,9 +85,12 @@ public abstract class CompilerRunner protected readonly BuildOptions _options; protected readonly List _referenceFolders = new List(); - public CompilerRunner(BuildOptions options, IEnumerable references) + protected readonly string _overrideOutputPath; + + public CompilerRunner(BuildOptions options, IEnumerable references, string overrideOutputPath = null) { _options = options; + _overrideOutputPath = overrideOutputPath; foreach (var reference in references) { @@ -298,7 +304,7 @@ protected void CreateResponseFile(string responseFile, IEnumerable comma } } - public string GetOutputPath(string outputRoot) => Path.Combine(outputRoot, CompilerName + _options.ConfigurationSuffix); + public string GetOutputPath(string outputRoot) => _overrideOutputPath ?? Path.Combine(outputRoot, CompilerName + _options.ConfigurationSuffix); // \a.dll -> \a.dll public string GetOutputFileName(string outputRoot, string fileName) => diff --git a/src/coreclr/src/tools/r2rtest/Crossgen2Runner.cs b/src/coreclr/src/tools/r2rtest/Crossgen2Runner.cs index 84bcef17d164..857f62364ccc 100644 --- a/src/coreclr/src/tools/r2rtest/Crossgen2Runner.cs +++ b/src/coreclr/src/tools/r2rtest/Crossgen2Runner.cs @@ -32,11 +32,11 @@ class Crossgen2Runner : CompilerRunner protected override string CompilerFileName => _options.DotNetCli; protected readonly List _referenceFiles = new List(); - private string Crossgen2Path => Path.Combine(_options.CoreRootDirectory.FullName, "crossgen2", "crossgen2.dll"); + private string Crossgen2Path => _options.Crossgen2Path != null ? _options.Crossgen2Path.FullName : Path.Combine(_options.CoreRootDirectory.FullName, "crossgen2", "crossgen2.dll"); private bool CompositeMode => Crossgen2RunnerOptions != null ? Crossgen2RunnerOptions.Composite : _options.Composite; - public Crossgen2Runner(BuildOptions options, Crossgen2RunnerOptions crossgen2RunnerOptions, IEnumerable references) - : base(options, references) + public Crossgen2Runner(BuildOptions options, Crossgen2RunnerOptions crossgen2RunnerOptions, IEnumerable references, string overrideOutputPath = null) + : base(options, references, overrideOutputPath) { Crossgen2RunnerOptions = crossgen2RunnerOptions; @@ -86,8 +86,15 @@ protected override IEnumerable BuildCommandLineArguments(IEnumerable BuildCommandLineArguments(IEnumerable referencePaths) - : base(options, referencePaths) { } + public CrossgenRunner(BuildOptions options, IEnumerable referencePaths, string overrideOutputPath = null) + : base(options, referencePaths, overrideOutputPath) { } protected override ProcessParameters ExecutionProcess(IEnumerable modules, IEnumerable folders, bool noEtw) { diff --git a/src/coreclr/src/tools/r2rtest/R2RTest.csproj b/src/coreclr/src/tools/r2rtest/R2RTest.csproj index 06db7cc4f2e9..a0900133f05c 100644 --- a/src/coreclr/src/tools/r2rtest/R2RTest.csproj +++ b/src/coreclr/src/tools/r2rtest/R2RTest.csproj @@ -3,10 +3,10 @@ R2RTest true Exe - $(NetCoreAppCurrent) + $(NetCoreAppToolCurrent) 8002,NU1701 - AnyCPU - $(BinDir)\R2RTest + AnyCPU + $(RuntimeBinDir)\R2RTest diff --git a/src/coreclr/src/tools/runincontext/runincontext.csproj b/src/coreclr/src/tools/runincontext/runincontext.csproj index 1005cdf74172..14a0a2cf3108 100644 --- a/src/coreclr/src/tools/runincontext/runincontext.csproj +++ b/src/coreclr/src/tools/runincontext/runincontext.csproj @@ -1,10 +1,10 @@ Exe - $(NetCoreAppCurrent) + $(NetCoreAppToolCurrent) $(MicrosoftNETCoreAppVersion) false BuildOnly - $(BinDir) + $(RuntimeBinDir) diff --git a/src/coreclr/src/tools/util/file_can.h b/src/coreclr/src/tools/util/file_can.h deleted file mode 100644 index bfa2b50c5961..000000000000 --- a/src/coreclr/src/tools/util/file_can.h +++ /dev/null @@ -1,68 +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 __FILE_CAN_H__ -#define __FILE_CAN_H__ - -class CFileChecksum; - -enum FileType -{ - ftUnknown = 0, - ftUnicode, - ftSwappedUnicode, - ftUTF8, - ftASCII, - ftBinary -}; - -HANDLE OpenFileEx( LPCWSTR filename, DWORD *fileLen, LPCWSTR relPath = NULL, bool bWrite = false); -HRESULT ReadTextFile (PCWSTR pszFileName, UINT uiCodePage, WCAllocBuffer & textBuffer, FileType *fileType); -#if !defined(TARGET_UNIX) && !defined(CSEE) -// If you call ReadTextFile a lot you should create one HCRYPTPROV and pass it in to every call, otherwise -// ReadTextFile indirectly creates and destroys a new HCRYPTPROV for every call, which is slow and unnecessary. -// You can use CryptProvider to manage an HCRYPTPROV for you. -HRESULT ReadTextFile (PCWSTR pszFileName, UINT uiCodePage, WCAllocBuffer & textBuffer, FileType *fileType, CFileChecksum *pChecksum, HCRYPTPROV hCryptProv = NULL); -#endif - -// Src and Dest may be the same buffer -// Returns 0 for error (check via GetLastError()) or count of characters -// (not including NULL) copied to Dest. -// if fPreserveSrcCasing is set, ignores on-disk casing of filename (but still gets on-disk casing of directories) -// if fPreserveSrcCasing is set and and existing file matches with different short/longness it will fail -// and set the error code to ERROR_FILE_EXISTS -DWORD GetCanonFilePath(LPCWSTR wszSrcFileName, WCBuffer outBuffer, bool fPreserveSrcCasing); - -// GetCanonFilePath uses a cache to eliminate redundant calls to FindFirstFile. This cache -// is global and is thus long lived. The IDE would like to minimize memory impact, so -// ClearGetCanonFilePathCache is provided here for them to clear the cache when appropriate. -void ClearGetCanonFilePathCache(); - -// Remove quote marks from a string. -// Translation is done in-place -LPWSTR RemoveQuotes(WCBuffer textBuffer); - -// Remove quote marks from a string. -// Replace various characters with other illegal characters if unquoted. -// Translation is done in-place. -LPWSTR RemoveQuotesAndReplaceComma(WCBuffer textBuffer); // "," -> "|" -LPWSTR RemoveQuotesAndReplacePathDelim(WCBuffer textBuffer); // ",;" -> "|" -LPWSTR RemoveQuotesAndReplaceAlias(WCBuffer textBuffer); // ",;" -> "|" and "=" -> "\x1" - -// Safe version of ToLowerCase -// Gaurantees null termination even if buffer size is too small -inline PWSTR WINAPI SafeToLowerCase (PCWSTR pSrc, WCBuffer textBuffer) -{ - PWSTR returnValue = ToLowerCase(pSrc, textBuffer.GetData(), textBuffer.Count()); - if (textBuffer.Count() > 0) - { - textBuffer.SetAt(textBuffer.Count() - 1, 0); - } - return returnValue; -} - -// Joins a relative or absolute filename to the given path and stores the new -// filename in lpBuffer -bool MakePath( /*[in]*/LPCWSTR lpPath, /*[in]*/LPCWSTR lpFileName, WCBuffer pathBuffer); - -#endif // __FILE_CAN_H__ diff --git a/src/coreclr/src/unwinder/CMakeLists.txt b/src/coreclr/src/unwinder/CMakeLists.txt index 98cdb0c0b7a8..e9af2458140d 100644 --- a/src/coreclr/src/unwinder/CMakeLists.txt +++ b/src/coreclr/src/unwinder/CMakeLists.txt @@ -20,8 +20,10 @@ list(APPEND UNWINDER_SOURCES convert_to_absolute_path(UNWINDER_SOURCES ${UNWINDER_SOURCES}) if(CLR_CMAKE_HOST_UNIX) - add_library_clr(unwinder_wks OBJECT ${UNWINDER_SOURCES}) - add_dependencies(unwinder_wks eventing_headers) + add_library_clr(unwinder_wks_obj OBJECT ${UNWINDER_SOURCES}) + add_dependencies(unwinder_wks_obj eventing_headers) + add_library(unwinder_wks INTERFACE) + target_sources(unwinder_wks INTERFACE $) endif(CLR_CMAKE_HOST_UNIX) add_library_clr(unwinder_dac ${UNWINDER_SOURCES}) diff --git a/src/coreclr/src/utilcode/CMakeLists.txt b/src/coreclr/src/utilcode/CMakeLists.txt index 4c1ce806b651..c7c5861f129b 100644 --- a/src/coreclr/src/utilcode/CMakeLists.txt +++ b/src/coreclr/src/utilcode/CMakeLists.txt @@ -26,7 +26,6 @@ set(UTILCODE_COMMON_SOURCES arraylist.cpp bitvector.cpp comex.cpp - delayloadhelpers.cpp guidfromname.cpp memorypool.cpp iallocator.cpp @@ -97,7 +96,9 @@ convert_to_absolute_path(UTILCODE_CROSSGEN_SOURCES ${UTILCODE_CROSSGEN_SOURCES}) convert_to_absolute_path(UTILCODE_STATICNOHOST_SOURCES ${UTILCODE_STATICNOHOST_SOURCES}) add_library_clr(utilcode_dac STATIC ${UTILCODE_DAC_SOURCES}) -add_library_clr(utilcode OBJECT ${UTILCODE_SOURCES}) +add_library_clr(utilcode_obj OBJECT ${UTILCODE_SOURCES}) +add_library(utilcode INTERFACE) +target_sources(utilcode INTERFACE $) add_library_clr(utilcodestaticnohost STATIC ${UTILCODE_STATICNOHOST_SOURCES}) add_library_clr(utilcode_crossgen STATIC ${UTILCODE_CROSSGEN_SOURCES}) @@ -105,9 +106,9 @@ if(CLR_CMAKE_HOST_UNIX) target_link_libraries(utilcodestaticnohost nativeresourcestring) target_link_libraries(utilcode_crossgen nativeresourcestring) target_link_libraries(utilcode_dac nativeresourcestring) - target_link_libraries(utilcode nativeresourcestring) + target_link_libraries(utilcode INTERFACE nativeresourcestring) add_dependencies(utilcode_dac coreclrpal) - add_dependencies(utilcode coreclrpal) + add_dependencies(utilcode_obj coreclrpal) endif(CLR_CMAKE_HOST_UNIX) @@ -120,10 +121,10 @@ set_target_properties(utilcode_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE) target_compile_definitions(utilcode_dac PRIVATE SELF_NO_HOST) target_compile_definitions(utilcodestaticnohost PRIVATE SELF_NO_HOST) add_dependencies(utilcode_dac ${UTILCODE_DEPENDENCIES}) -add_dependencies(utilcode ${UTILCODE_DEPENDENCIES}) +add_dependencies(utilcode_obj ${UTILCODE_DEPENDENCIES}) add_dependencies(utilcode_crossgen ${UTILCODE_DEPENDENCIES}) add_dependencies(utilcodestaticnohost ${UTILCODE_DEPENDENCIES}) -target_precompile_header(TARGET utilcode_dac HEADER stdafx.h) -target_precompile_header(TARGET utilcode HEADER stdafx.h) -target_precompile_header(TARGET utilcode_crossgen HEADER stdafx.h) -target_precompile_header(TARGET utilcodestaticnohost HEADER stdafx.h) +target_precompile_headers(utilcode_dac PRIVATE [["stdafx.h"]]) +target_precompile_headers(utilcode_obj PRIVATE [["stdafx.h"]]) +target_precompile_headers(utilcode_crossgen PRIVATE [["stdafx.h"]]) +target_precompile_headers(utilcodestaticnohost PRIVATE [["stdafx.h"]]) diff --git a/src/coreclr/src/utilcode/ccomprc.cpp b/src/coreclr/src/utilcode/ccomprc.cpp index 8555d57725d3..a3d669bcb949 100644 --- a/src/coreclr/src/utilcode/ccomprc.cpp +++ b/src/coreclr/src/utilcode/ccomprc.cpp @@ -296,6 +296,8 @@ CCompRC* CCompRC::GetDefaultResourceDll() //***************************************************************************** //***************************************************************************** +// String resouces packaged as PE files only exist on Windows +#ifdef HOST_WINDOWS HRESULT CCompRC::GetLibrary(LocaleID langId, HRESOURCEDLL* phInst) { CONTRACTL @@ -452,6 +454,7 @@ HRESULT CCompRC::GetLibrary(LocaleID langId, HRESOURCEDLL* phInst) *phInst = hInst; return hr; } +#endif // HOST_WINDOWS //***************************************************************************** // Load the string @@ -536,21 +539,24 @@ HRESULT CCompRC::LoadString(ResourceCategory eCategory, LocaleID langId, UINT iR #ifndef DACCESS_COMPILE +// String resouces packaged as PE files only exist on Windows +#ifdef HOST_WINDOWS HRESULT CCompRC::LoadResourceFile(HRESOURCEDLL * pHInst, LPCWSTR lpFileName) { -#ifdef HOST_WINDOWS DWORD dwLoadLibraryFlags; if(m_pResourceFile == m_pDefaultResource) + { dwLoadLibraryFlags = LOAD_LIBRARY_AS_DATAFILE; + } else + { dwLoadLibraryFlags = 0; + } - if ((*pHInst = WszLoadLibraryEx(lpFileName, NULL, dwLoadLibraryFlags)) == NULL) { + if((*pHInst = WszLoadLibraryEx(lpFileName, NULL, dwLoadLibraryFlags)) == NULL) + { return HRESULT_FROM_GetLastError(); } -#else // HOST_WINDOWS - PORTABILITY_ASSERT("UNIXTODO: Implement resource loading - use peimagedecoder?"); -#endif // HOST_WINDOWS return S_OK; } @@ -635,14 +641,16 @@ HRESULT CCompRC::LoadLibraryHelper(HRESOURCEDLL *pHInst, // only strings. hr = LoadResourceFile(pHInst, rcPathName); if (SUCCEEDED(hr)) + { break; - + } } } EX_CATCH_HRESULT(hr); // Last ditch search effort in current directory - if (FAILED(hr)) { + if (FAILED(hr)) + { hr = LoadResourceFile(pHInst, m_pResourceFile); } @@ -675,7 +683,7 @@ HRESULT CCompRC::LoadLibraryThrows(HRESOURCEDLL * pHInst) #ifdef SELF_NO_HOST _ASSERTE(!"CCompRC::LoadLibraryThrows not implemented for SELF_NO_HOST"); hr = E_NOTIMPL; -#else +#else // SELF_NO_HOST PathString rcPath; // Path to resource DLL. // Try first in the same directory as this dll. @@ -691,6 +699,7 @@ HRESULT CCompRC::LoadLibraryThrows(HRESOURCEDLL * pHInst) return hr; } + HRESULT CCompRC::LoadLibrary(HRESOURCEDLL * pHInst) { CONTRACTL @@ -713,3 +722,4 @@ HRESULT CCompRC::LoadLibrary(HRESOURCEDLL * pHInst) return hr; } #endif // DACCESS_COMPILE +#endif //HOST_WINDOWS diff --git a/src/coreclr/src/utilcode/clrconfig.cpp b/src/coreclr/src/utilcode/clrconfig.cpp index 12e7f9db5218..5142e395ac0e 100644 --- a/src/coreclr/src/utilcode/clrconfig.cpp +++ b/src/coreclr/src/utilcode/clrconfig.cpp @@ -82,43 +82,6 @@ #undef CONFIG_STRING_INFO_DIRECT_ACCESS - - -// Return if a quirk is a enabled. -// This will also return enabled as true when the quirk has a value set. -BOOL CLRConfig::IsConfigEnabled(const ConfigDWORDInfo & info) -{ - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - FORBID_FAULT; - } - CONTRACTL_END; - - DWORD result = info.defaultValue; - - // - // Set up REGUTIL options. - // - REGUTIL::CORConfigLevel level = GetConfigLevel(info.options); - BOOL prependCOMPlus = !CheckLookupOption(info, DontPrependCOMPlus_); - - REGUTIL::GetConfigDWORD_DontUse_(info.name, info.defaultValue, &result, level, prependCOMPlus); - if(result>0) - return TRUE; - LPWSTR result2 = REGUTIL::GetConfigString_DontUse_(info.name, prependCOMPlus, level); - if(result2 != NULL && result2[0] != 0) - { - return TRUE; - } - - if(info.defaultValue>0) - return TRUE; - else - return FALSE; -} - // // Look up a DWORD config value. // @@ -418,11 +381,5 @@ REGUTIL::CORConfigLevel CLRConfig::GetConfigLevel(LookupOptions options) if(CheckLookupOption(options, IgnoreEnv) == FALSE) level = static_cast(level | REGUTIL::COR_CONFIG_ENV); - if(CheckLookupOption(options, IgnoreHKCU) == FALSE) - level = static_cast(level | REGUTIL::COR_CONFIG_USER); - - if(CheckLookupOption(options, IgnoreHKLM) == FALSE) - level = static_cast(level | REGUTIL::COR_CONFIG_MACHINE); - - return level; + return static_cast(level | REGUTIL::COR_CONFIG_USER | REGUTIL::COR_CONFIG_MACHINE); } diff --git a/src/coreclr/src/utilcode/debug.cpp b/src/coreclr/src/utilcode/debug.cpp index d6c2c4a4b1ad..b4f44dc989d6 100644 --- a/src/coreclr/src/utilcode/debug.cpp +++ b/src/coreclr/src/utilcode/debug.cpp @@ -23,7 +23,7 @@ extern "C" _CRTIMP int __cdecl _flushall(void); #ifdef HOST_WINDOWS -void CreateCrashDumpIfEnabled(); +void CreateCrashDumpIfEnabled(bool stackoverflow = false); #endif // Global state counter to implement SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE. diff --git a/src/coreclr/src/utilcode/defaultallocator.cpp b/src/coreclr/src/utilcode/defaultallocator.cpp deleted file mode 100644 index 1c6e2d522919..000000000000 --- a/src/coreclr/src/utilcode/defaultallocator.cpp +++ /dev/null @@ -1,7 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include "stdafx.h" -#include "defaultallocator.h" - -DefaultAllocator DefaultAllocator::s_singleton; diff --git a/src/coreclr/src/utilcode/delayloadhelpers.cpp b/src/coreclr/src/utilcode/delayloadhelpers.cpp deleted file mode 100644 index 90936ccbcfc0..000000000000 --- a/src/coreclr/src/utilcode/delayloadhelpers.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// Contains convenience functionality for lazily loading modules -// and getting entrypoints within them. -// - -#include "stdafx.h" - -#include "crtwrap.h" -#include "winwrap.h" -#include "utilcode.h" -#include "clrhost.h" -#include "holder.h" -#include "delayloadhelpers.h" - -namespace DelayLoad -{ - //================================================================================================================= - // Used to synchronize initialization. Is not used when initialization has already taken place. - - static CRITSEC_COOKIE g_pLock = nullptr; - - //================================================================================================================= - // Creates and initializes g_pLock when first used. - - static HRESULT InitializeLock() - { - STATIC_CONTRACT_LIMITED_METHOD; - HRESULT hr = S_OK; - - CRITSEC_COOKIE pLock = ClrCreateCriticalSection(CrstLeafLock, CRST_REENTRANCY); - IfNullRet(pLock); - if (InterlockedCompareExchangeT(&g_pLock, pLock, nullptr) != nullptr) - { - ClrDeleteCriticalSection(pLock); - } - - return S_OK; - } - - //================================================================================================================= - HRESULT Module::GetValue(HMODULE *pHMODULE) - { - STATIC_CONTRACT_LIMITED_METHOD; - HRESULT hr = S_OK; - - if (pHMODULE == nullptr) - { - return E_INVALIDARG; - } - - if (!m_fInitialized) - { - IfFailRet(InitializeLock()); - - HModuleHolder hMod = ::LoadLibraryW(m_wzDllName); - hr = (hMod == nullptr) ? HRESULT_FROM_GetLastError() : S_OK; - _ASSERTE(FAILED(hr) == (hMod == nullptr)); - - { // Lock scope - CRITSEC_Holder lock(g_pLock); - if (!m_fInitialized) - { - m_hr = hr; - m_hMod = hMod.Extract(); - m_fInitialized = true; - } - } - } - - _ASSERTE(m_fInitialized); - *pHMODULE = m_hMod; - return m_hr; - } - - //================================================================================================================= - HRESULT Function::GetValue(LPVOID * ppvFunc) - { - STATIC_CONTRACT_LIMITED_METHOD; - HRESULT hr = S_OK; - - if (ppvFunc == nullptr) - { - return E_INVALIDARG; - } - - if (!m_fInitialized) - { - HMODULE hMod = nullptr; - IfFailRet(m_pModule->GetValue(&hMod)); - - LPVOID pvFunc = reinterpret_cast(::GetProcAddress(hMod, m_szFunctionName)); - hr = (pvFunc == nullptr) ? HRESULT_FROM_GetLastError() : S_OK; - - { // Lock scope - CRITSEC_Holder lock(g_pLock); - if (!m_fInitialized) - { - m_hr = hr; - m_pvFunction = pvFunc; - m_fInitialized = true; - } - } - } - - _ASSERTE(m_fInitialized); - *ppvFunc = m_pvFunction; - return m_hr; - } -} diff --git a/src/coreclr/src/utilcode/hostimpl.cpp b/src/coreclr/src/utilcode/hostimpl.cpp index 31d38df70636..c1e4b53b065a 100644 --- a/src/coreclr/src/utilcode/hostimpl.cpp +++ b/src/coreclr/src/utilcode/hostimpl.cpp @@ -76,7 +76,7 @@ void GetLastThrownObjectExceptionFromThread(Exception** ppException) } #ifdef HOST_WINDOWS -void CreateCrashDumpIfEnabled() +void CreateCrashDumpIfEnabled(bool stackoverflow) { } #endif diff --git a/src/coreclr/src/utilcode/ilformatter.cpp b/src/coreclr/src/utilcode/ilformatter.cpp index f22cb0a4582b..9c8011dc666f 100644 --- a/src/coreclr/src/utilcode/ilformatter.cpp +++ b/src/coreclr/src/utilcode/ilformatter.cpp @@ -242,7 +242,7 @@ void ILFormatter::formatInstrArgs(OpInfo op, OpArgsVal arg, OutString* out, size hr = meta->GetNameFromToken(mdType, &typeName); } } - // FALL THROUGH + FALLTHROUGH; case InlineType: { // FIX handle case if (TypeFromToken(arg.i) == mdtTypeSpec) MDUTF8CSTR name; @@ -400,7 +400,7 @@ const BYTE* ILFormatter::formatStatement(const BYTE* instrPtr, OutString* out) { case CEE_LDC_I4_7: case CEE_LDC_I4_8: inlineArg.i = op.getOpcode() - CEE_LDC_I4_0; - // FALL THROUGH + FALLTHROUGH; case CEE_LDC_I4: case CEE_LDC_I4_S: result << inlineArg.i; @@ -472,7 +472,7 @@ const BYTE* ILFormatter::formatStatement(const BYTE* instrPtr, OutString* out) { *lhs << '\n' << result; // put the result in front of anything else result.swap(*lhs); } - /* fall through */ + FALLTHROUGH; case CEE_BR_S: case CEE_BR: DO_BR: { @@ -621,7 +621,7 @@ const BYTE* ILFormatter::formatStatement(const BYTE* instrPtr, OutString* out) { case CEE_NEWOBJ: result << "new "; - // FALL THROUGH + FALLTHROUGH; case CEE_CALL: case CEE_CALLVIRT: { formatInstrArgs(op, inlineArg, &result); diff --git a/src/coreclr/src/utilcode/loaderheap.cpp b/src/coreclr/src/utilcode/loaderheap.cpp index 37d1e2f4ce56..8cfbba756592 100644 --- a/src/coreclr/src/utilcode/loaderheap.cpp +++ b/src/coreclr/src/utilcode/loaderheap.cpp @@ -1159,6 +1159,11 @@ BOOL UnlockedLoaderHeap::UnlockedReservePages(size_t dwSizeToCommit) LoaderHeapBlock *pNewBlock; +#if defined(HOST_OSX) && defined(HOST_ARM64) + // Always assume we are touching executable heap + auto jitWriteEnableHolder = PAL_JITWriteEnable(true); +#endif // defined(HOST_OSX) && defined(HOST_ARM64) + pNewBlock = (LoaderHeapBlock *) pData; pNewBlock->dwVirtualSize = dwSizeToReserve; diff --git a/src/coreclr/src/utilcode/makepath.cpp b/src/coreclr/src/utilcode/makepath.cpp index 93914472f3d0..374cda432dba 100644 --- a/src/coreclr/src/utilcode/makepath.cpp +++ b/src/coreclr/src/utilcode/makepath.cpp @@ -100,16 +100,12 @@ void MakePath ( _ASSERTE(count < maxCount); } -#ifdef _MBCS - if (*(p=_mbsdec(dir,p)) != _T('/') && *p != _T('\\')) { -#else /* _MBCS */ // suppress warning for the following line; this is safe but would require significant code // delta for prefast to understand. #ifdef _PREFAST_ #pragma warning( suppress: 26001 ) #endif if (*(p-1) != _T('/') && *(p-1) != _T('\\')) { -#endif /* _MBCS */ *path++ = _T('\\'); count++; diff --git a/src/coreclr/src/utilcode/pedecoder.cpp b/src/coreclr/src/utilcode/pedecoder.cpp index d0854bbc043f..91fde64d297c 100644 --- a/src/coreclr/src/utilcode/pedecoder.cpp +++ b/src/coreclr/src/utilcode/pedecoder.cpp @@ -1770,20 +1770,29 @@ void PEDecoder::LayoutILOnly(void *base, BOOL allowFullPE) const PAGE_READONLY, &oldProtection)) ThrowLastError(); - // Finally, apply proper protection to copied sections - section = sectionStart; - while (section < sectionEnd) + // Finally, apply proper protection to copied sections + for (section = sectionStart; section < sectionEnd; section++) { // Add appropriate page protection. - if ((section->Characteristics & VAL32(IMAGE_SCN_MEM_WRITE)) == 0) +#if defined(CROSSGEN_COMPILE) || defined(TARGET_UNIX) + if (section->Characteristics & IMAGE_SCN_MEM_WRITE) + continue; + + DWORD newProtection = PAGE_READONLY; +#else + DWORD newProtection = section->Characteristics & IMAGE_SCN_MEM_EXECUTE ? + PAGE_EXECUTE_READ : + section->Characteristics & IMAGE_SCN_MEM_WRITE ? + PAGE_READWRITE : + PAGE_READONLY; +#endif + + if (!ClrVirtualProtect((void*)((BYTE*)base + VAL32(section->VirtualAddress)), + VAL32(section->Misc.VirtualSize), + newProtection, &oldProtection)) { - if (!ClrVirtualProtect((void *) ((BYTE *)base + VAL32(section->VirtualAddress)), - VAL32(section->Misc.VirtualSize), - PAGE_READONLY, &oldProtection)) - ThrowLastError(); + ThrowLastError(); } - - section++; } RETURN; diff --git a/src/coreclr/src/utilcode/rangetree.cpp b/src/coreclr/src/utilcode/rangetree.cpp deleted file mode 100644 index 3fea4c731888..000000000000 --- a/src/coreclr/src/utilcode/rangetree.cpp +++ /dev/null @@ -1,518 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include "stdafx.h" - -#include "rangetree.h" - -#ifndef DACCESS_COMPILE - -void RangeTree::Node::Init(SIZE_T rangeStart, SIZE_T rangeEnd - DEBUGARG(DWORD ord)) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - _ASSERTE(rangeEnd >= rangeStart); - - start = rangeStart; - end = rangeEnd; - - mask = GetRangeCommonMask(start, end); - - IsIntermediate(FALSE); -#ifdef _DEBUG - ordinal = ord; -#endif - - children[0] = NULL; - children[1] = NULL; -} - - -RangeTree::RangeTree() : - m_root(NULL), m_pool(sizeof(Node), 16, 16) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - -#ifdef _DEBUG - m_nodeCount = 0; -#endif -} - -RangeTree::Node *RangeTree::Lookup(SIZE_T address) const -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - Node *node = m_root; - - // - // When comparing an address to a node, - // there are 5 possibilities: - // * the node is null - no match - // * the address doesn't contain the prefix m - no match - // * the address is inside the node's range (and necessarily - // contains the prefix m) - match - // * the address is less than the range (and necessarily - // has the prefix m0) - traverse the zero child - // * the address is greater than the range (and necessarily - // has the prefix m1) - traverse the one child - // - - while (node != NULL - && (address < node->start || address >= node->end)) - { - // - // See if the address has prefix m. - // - - if ((address & node->mask) != (node->start & node->mask)) - return NULL; - - // - // Determine which subnode to look in. - // - - node = *node->Child(address); - } - - if (node != NULL && node->IsIntermediate()) - node = NULL; - - return node; -} - -RangeTree::Node *RangeTree::LookupEndInclusive(SIZE_T address) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - // - // Lookup an address which may be the ending range - // of a node. In order for this to make sense, it - // must be the case that address is never the starting - // address of the node. (Otherwise there is an - // ambiguity when 2 nodes are adjacent.) - // - - Node *result = Lookup(address-1); - - if ((result != NULL) && (address >= result->start) - && (address <= result->end)) - return result; - else - return NULL; -} - -HRESULT RangeTree::AddNode(Node *addNode, SIZE_T start, SIZE_T end) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - INJECT_FAULT(return E_OUTOFMEMORY;); - } CONTRACTL_END; - - addNode->Init(start, end DEBUGARG(++m_nodeCount)); - - Node **nodePtr = &m_root; - - while (TRUE) - { - Node *node = *nodePtr; - - // - // See if we can live here - // - - if (node == NULL) - { - *nodePtr = addNode; - return S_OK; - } - - // - // Decide if we are a child of the - // current node, or it is a child - // of us, or neither. - // - - SIZE_T diffBits = start ^ node->start; - - // See if the nodes are disjoint - if (diffBits & (node->mask & addNode->mask)) - { - // We need to construct a intermediate node to be the parent of these two. - - // AddIntermediateNode throws to indicate OOM. We need to either - // propagate this behavior upward or convert the exception here. - CONTRACT_VIOLATION(ThrowsViolation); - *nodePtr = AddIntermediateNode(node, addNode); - // data structure is hosed at this point if we get an exception - should - // we undo the operation? - - return S_OK; - } - else - { - SIZE_T maskDiff = node->mask ^ addNode->mask; - - if (maskDiff == 0) - { - // Masks are the same size, ranges overlap. - // This must be an intermediate node or we have a problem. - if (!node->IsIntermediate()) - return E_INVALIDARG; - - // Replace the intermediate node with this one. - addNode->children[0] = node->children[0]; - addNode->children[1] = node->children[1]; - *nodePtr = addNode; - FreeIntermediate(node); - - return S_OK; - } - - // Make sure the range doesn't intersect. - if (end > node->start && start < node->end) - return E_INVALIDARG; - - else if (addNode->mask & maskDiff) - { - // added node's mask is bigger - it should be the child - nodePtr = node->Child(start); - } - else - { - // existing node's mask is bigger - it should be the child - *nodePtr = addNode; - nodePtr = addNode->Child(node->start); - addNode = node; - } - } - } -} - -HRESULT RangeTree::RemoveNode(Node *removeNode) -{ - CONTRACTL { - THROWS; - GC_NOTRIGGER; - } CONTRACTL_END; - - Node **nodePtr = &m_root; - - while (TRUE) - { - Node *node = *nodePtr; - - _ASSERTE(node != NULL); - - if (node == removeNode) - { - if (node->children[0] == NULL) - *nodePtr = node->children[1]; - else if (node->children[1] == NULL) - *nodePtr = node->children[0]; - else - { - *nodePtr = AddIntermediateNode(node->children[0], - node->children[1]); - } - - return S_OK; - } - else if (node->IsIntermediate()) - { - if (node->children[0] == removeNode) - { - if (removeNode->children[0] == NULL && removeNode->children[1] == NULL) - { - *nodePtr = node->children[1]; - FreeIntermediate(node); - return S_OK; - } - } - else if (node->children[1] == removeNode) - { - if (removeNode->children[0] == NULL && removeNode->children[1] == NULL) - { - *nodePtr = node->children[0]; - FreeIntermediate(node); - return S_OK; - } - } - } - - nodePtr = node->Child(removeNode->start); - } -} - -void RangeTree::Iterate(IterationCallback pCallback, void *context) -{ - WRAPPER_NO_CONTRACT; - - if (m_root != NULL) - IterateNode(m_root, pCallback, context); -} - -void RangeTree::IterateNode(Node *node, IterationCallback pCallback, void *context) -{ - WRAPPER_NO_CONTRACT; - - if (node->children[0] != NULL) - IterateNode(node->children[0], pCallback, context); - - if (!node->IsIntermediate()) - pCallback(node, context); - - if (node->children[1] != NULL) - IterateNode(node->children[1], pCallback, context); -} - -void RangeTree::IterateRange(SIZE_T start, SIZE_T end, IterationCallback pCallback, void *context) -{ - WRAPPER_NO_CONTRACT; - - if (m_root != NULL) - IterateRangeNode(m_root, start, end, GetRangeCommonMask(start, end), - pCallback, context); -} - -void RangeTree::IterateRangeNode(Node *node, SIZE_T start, SIZE_T end, - SIZE_T mask, IterationCallback pCallback, void *context) -{ - WRAPPER_NO_CONTRACT; - - // Compute which bits are different between the two start ranges - SIZE_T diffBits = start ^ node->start; - - // See if the nodes are disjoint - if (diffBits & (node->mask & mask)) - { - return; - } - else - { - if (node->children[0] != NULL) - IterateRangeNode(node->children[0], start, end, mask, pCallback, context); - - if (!node->IsIntermediate() - && (end > node->start && start < node->end)) - (*pCallback)(node, context); - - if (node->children[1] != NULL) - IterateRangeNode(node->children[1], start, end, mask, pCallback, context); - } -} - - -BOOL RangeTree::Overlaps(SIZE_T start, SIZE_T end) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - if (m_root != NULL) - return OverlapsNode(m_root, start, end, GetRangeCommonMask(start, end)); - else - return FALSE; -} - -BOOL RangeTree::OverlapsNode(Node *node, SIZE_T start, SIZE_T end, SIZE_T mask) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - // - // Decide if we are a child of the - // current node, or it is a child - // of us, or neither. - // - - SIZE_T diffBits = start ^ node->start; - - // See if the nodes are disjoint - if (diffBits & (node->mask & mask)) - { - return FALSE; - } - else - { - if (!node->IsIntermediate() - && (end > node->start && start < node->end)) - return TRUE; - - if ((node->children[0] != NULL && OverlapsNode(node->children[0], start, end, mask)) - || (node->children[1] != NULL && OverlapsNode(node->children[1], start, end, mask))) - return TRUE; - - return FALSE; - } -} - - -void RangeTree::RemoveRange(SIZE_T start, SIZE_T end) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - if (m_root != NULL) - RemoveRangeNode(&m_root, start, end, GetRangeCommonMask(start, end)); -} - - -void RangeTree::RemoveRangeNode(Node **nodePtr, SIZE_T start, SIZE_T end, SIZE_T mask) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - Node *node = *nodePtr; - - // Compute which bits are different between the two start ranges - SIZE_T diffBits = start ^ node->start; - - // See if the nodes are disjoint - if (diffBits & (node->mask & mask)) - { - // do nothing - } - else - { - // First, remove from children - if (node->children[0] != NULL) - RemoveRangeNode(&node->children[0], start, end, mask); - if (node->children[1] != NULL) - RemoveRangeNode(&node->children[1], start, end, mask); - - // Now, remove this node if necessary. - if (node->IsIntermediate()) - { - if (node->children[0] == NULL) - { - *nodePtr = node->children[0]; - FreeIntermediate(node); - } - else if (node->children[1] == NULL) - { - *nodePtr = node->children[1]; - FreeIntermediate(node); - } - } - else if (end > node->start && start < node->end) - { - if (node->children[0] == NULL) - *nodePtr = node->children[1]; - else if (node->children[1] == NULL) - *nodePtr = node->children[0]; - else - { - - // AddIntermediateNode throws to indicate OOM. We need to either - // propagate this behavior upward or convert the exception here. - CONTRACT_VIOLATION(ThrowsViolation); - *nodePtr = AddIntermediateNode(node->children[0], - node->children[1]); - } - } - } -} - - -SIZE_T RangeTree::GetRangeCommonMask(SIZE_T start, SIZE_T end) -{ - LIMITED_METHOD_CONTRACT; - - // Compute which bits are the different - - SIZE_T diff = start ^ end; - - // Fill up bits to the right until all are set - - diff |= (diff>>1); - diff |= (diff>>2); - diff |= (diff>>4); - diff |= (diff>>8); - diff |= (diff>>16); - -#if (POINTER_BITS > 32) - diff |= (diff>>32); -#endif - - // flip bits to form high mask - return ~diff; -} - -RangeTree::Node *RangeTree::AddIntermediateNode(Node *node0, - Node *node1) -{ - CONTRACTL { - THROWS; - GC_NOTRIGGER; - } CONTRACTL_END; - - SIZE_T mask = GetRangeCommonMask(node0->start, - node1->start); - - _ASSERTE((mask & ~node0->mask) == 0); - _ASSERTE((mask & ~node1->mask) == 0); - _ASSERTE((node0->start & mask) == (node1->start & mask)); - _ASSERTE((node0->start & mask) == (node1->start & mask)); - - SIZE_T middle = (node0->start & mask) + (~mask>>1); - - Node *intermediate = AllocateIntermediate(); - - intermediate->start = middle; - intermediate->end = middle+1; - intermediate->mask = mask; - intermediate->IsIntermediate(TRUE); -#ifdef _DEBUG - intermediate->ordinal = ++m_nodeCount; -#endif - - int less = (node0->start < node1->start); - - intermediate->children[!less] = node0; - intermediate->children[less] = node1; - - return intermediate; -} - -RangeTree::Node *RangeTree::AllocateIntermediate() -{ - CONTRACTL { - THROWS; - GC_NOTRIGGER; - } CONTRACTL_END; - - return (RangeTree::Node *) m_pool.AllocateElement(); -} - -void RangeTree::FreeIntermediate(Node *node) -{ - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - m_pool.FreeElement(node); -} - -#endif diff --git a/src/coreclr/src/utilcode/regutilformac.cpp b/src/coreclr/src/utilcode/regutilformac.cpp deleted file mode 100644 index e48fc9eb3552..000000000000 --- a/src/coreclr/src/utilcode/regutilformac.cpp +++ /dev/null @@ -1,11 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// - -// -//***************************************************************************** - -/* The mac build does not like filenames with .CPP (in capitals) for an extension, so we need this workaround - so we can include REGUTIL.CPP. */ -#include "REGUTIL.CPP" diff --git a/src/coreclr/src/utilcode/sigbuilder.cpp b/src/coreclr/src/utilcode/sigbuilder.cpp index 111164149e7e..368815c55b5d 100644 --- a/src/coreclr/src/utilcode/sigbuilder.cpp +++ b/src/coreclr/src/utilcode/sigbuilder.cpp @@ -82,22 +82,22 @@ void SigBuilder::AppendToken(mdToken tk) // TypeSpec is encoded with low bits 10 // BaseType is encoded with low bit 11 // - if (ulTyp == g_tkCorEncodeToken[0]) + if (ulTyp == CorSigDecodeTokenType(0)) { // make the last two bits 00 // nothing to do } - else if (ulTyp == g_tkCorEncodeToken[1]) + else if (ulTyp == CorSigDecodeTokenType(1)) { // make the last two bits 01 rid |= 0x1; } - else if (ulTyp == g_tkCorEncodeToken[2]) + else if (ulTyp == CorSigDecodeTokenType(2)) { // make last two bits 0 rid |= 0x2; } - else if (ulTyp == g_tkCorEncodeToken[3]) + else if (ulTyp == CorSigDecodeTokenType(3)) { rid |= 0x3; } diff --git a/src/coreclr/src/utilcode/splitpath.cpp b/src/coreclr/src/utilcode/splitpath.cpp index 9e56b6b0cff3..b087e6cd3d12 100644 --- a/src/coreclr/src/utilcode/splitpath.cpp +++ b/src/coreclr/src/utilcode/splitpath.cpp @@ -137,26 +137,18 @@ void SplitPathInterior( /* extract path string, if any. Path now points to the first character * of the path, if any, or the filename or extension, if no path was - * specified. Scan ahead for the last occurence, if any, of a '/' or + * specified. Scan ahead for the last occurrence, if any, of a '/' or * '\' path separator character. If none is found, there is no path. * We will also note the last '.' character found, if any, to aid in * handling the extension. */ for (last_slash = NULL, p = (WCHAR *)wszPath; *p; p++) { -#ifdef _MBCS - if (_ISLEADBYTE (*p)) - p++; - else { -#endif /* _MBCS */ if (*p == _T('/') || *p == _T('\\')) /* point to one beyond for later copy */ last_slash = p + 1; else if (*p == _T('.')) dot = p; -#ifdef _MBCS - } -#endif /* _MBCS */ } if (last_slash) { diff --git a/src/coreclr/src/utilcode/sstring.cpp b/src/coreclr/src/utilcode/sstring.cpp index 1647a9ee4151..a0017a5a003f 100644 --- a/src/coreclr/src/utilcode/sstring.cpp +++ b/src/coreclr/src/utilcode/sstring.cpp @@ -155,34 +155,6 @@ int SString::CaseCompareHelper(const WCHAR *buffer1, const WCHAR *buffer2, COUNT #define CAN_SIMPLE_UPCASE_ANSI(x) (((x) >= 0x20) && ((x) <= 0x7f)) #define SIMPLE_UPCASE_ANSI(x) (IS_LOWER_A_TO_Z(x) ? ((x) - 'a' + 'A') : (x)) -int GetCaseInsensitiveValueA(const CHAR *buffer, int length) { - LIMITED_METHOD_CONTRACT; - _ASSERTE(buffer != NULL); - _ASSERTE(length == 1 || ((length == 2) && IsDBCSLeadByte(*buffer))); - - WCHAR wideCh; - int sortValue; - int conversionReturn = MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, buffer, length, &wideCh, 1); - if (conversionReturn == 0) - { - // An invalid sequence should only compare equal to itself, so use a negative mapping. - if (length == 1) - { - sortValue = -((int)((unsigned char)(*buffer))); - } - else - { - sortValue = -(((((int)((unsigned char)(*buffer))) << 8) | ((int)((unsigned char)(*(buffer + 1)))))); - } - } - else - { - _ASSERTE(conversionReturn == 1); - sortValue = MapChar(wideCh, LCMAP_UPPERCASE); - } - return sortValue; -} - /* static */ int SString::CaseCompareHelperA(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count, BOOL stopOnNull, BOOL stopOnCount) { @@ -197,49 +169,21 @@ int SString::CaseCompareHelperA(const CHAR *buffer1, const CHAR *buffer2, COUNT_ { CHAR ch1 = *buffer1; CHAR ch2 = *buffer2; - if ((ch1 == 0) || (ch2 == 0)) + diff = ch1 - ch2; + if (diff != 0 || stopOnNull) { - diff = ch1 - ch2; - if (diff != 0 || stopOnNull) + if (ch1 == 0 || ch2 == 0) { break; } - buffer1++; - buffer2++; - } - else if (CAN_SIMPLE_UPCASE_ANSI(ch1) && CAN_SIMPLE_UPCASE_ANSI(ch2)) - { - diff = ch1 - ch2; - if (diff != 0) - { - diff = (SIMPLE_UPCASE_ANSI(ch1) - SIMPLE_UPCASE_ANSI(ch2)); - if (diff != 0) - { - break; - } - } - buffer1++; - buffer2++; - } - else - { - int length = 1; - if (IsDBCSLeadByte(ch1) - && IsDBCSLeadByte(ch2) - && (!stopOnCount || ((buffer1 + 1) < buffer1End))) - { - length = 2; - } - int sortValue1 = GetCaseInsensitiveValueA(buffer1, length); - int sortValue2 = GetCaseInsensitiveValueA(buffer2, length); - diff = sortValue1 - sortValue2; + diff = (SIMPLE_UPCASE_ANSI(ch1) - SIMPLE_UPCASE_ANSI(ch2)); if (diff != 0) { break; } - buffer1 += length; - buffer2 += length; } + buffer1++; + buffer2++; } return diff; } @@ -917,7 +861,7 @@ void SString::ConvertToANSI(SString &s) const case REPRESENTATION_UTF8: // No direct conversion to ANSI ConvertToUnicode(); - // fall through + FALLTHROUGH; case REPRESENTATION_UNICODE: break; @@ -969,7 +913,7 @@ COUNT_T SString::ConvertToUTF8(SString &s) const case REPRESENTATION_ANSI: // No direct conversion from ANSI to UTF8 ConvertToUnicode(); - // fall through + FALLTHROUGH; case REPRESENTATION_UNICODE: break; @@ -1517,11 +1461,11 @@ int SString::CompareCaseInsensitive(const SString &s) const switch (GetRepresentation()) { case REPRESENTATION_UNICODE: + case REPRESENTATION_ANSI: result = CaseCompareHelper(GetRawUnicode(), source.GetRawUnicode(), smaller, FALSE, TRUE); break; case REPRESENTATION_ASCII: - case REPRESENTATION_ANSI: result = CaseCompareHelperA(GetRawASCII(), source.GetRawASCII(), smaller, FALSE, TRUE); break; @@ -1612,10 +1556,10 @@ BOOL SString::EqualsCaseInsensitive(const SString &s) const switch (GetRepresentation()) { case REPRESENTATION_UNICODE: + case REPRESENTATION_ANSI: RETURN (CaseCompareHelper(GetRawUnicode(), source.GetRawUnicode(), count, FALSE, TRUE) == 0); case REPRESENTATION_ASCII: - case REPRESENTATION_ANSI: RETURN (CaseCompareHelperA(GetRawASCII(), source.GetRawASCII(), count, FALSE, TRUE) == 0); case REPRESENTATION_EMPTY: @@ -2481,7 +2425,7 @@ const SString &SString::GetCompatibleString(const SString &s, SString &scratch, // We can't in general convert to ASCII, so try unicode. ConvertToUnicode(i); - // fall through + FALLTHROUGH; case REPRESENTATION_UNICODE: if (s.IsRepresentation(REPRESENTATION_UNICODE)) @@ -2540,7 +2484,7 @@ const SString &SString::GetCompatibleString(const SString &s, SString &scratch) // We can't in general convert to ASCII, so try unicode. ConvertToUnicode(); - // fall through + FALLTHROUGH; case REPRESENTATION_UNICODE: if (s.IsRepresentation(REPRESENTATION_UNICODE)) @@ -2818,6 +2762,7 @@ bool SString::DacGetUnicode(COUNT_T cBufChars, case REPRESENTATION_UTF8: iPage = CP_UTF8; + FALLTHROUGH; case REPRESENTATION_ASCII: case REPRESENTATION_ANSI: // iPage defaults to CP_ACP. diff --git a/src/coreclr/src/utilcode/stacktrace.cpp b/src/coreclr/src/utilcode/stacktrace.cpp index 57b4ee5f2828..9cab6ee2d1f0 100644 --- a/src/coreclr/src/utilcode/stacktrace.cpp +++ b/src/coreclr/src/utilcode/stacktrace.cpp @@ -740,7 +740,7 @@ CONTEXT * pContext // Context to use (or NULL to use current) stkfrm.AddrFrame.Offset = context.Ebp; // Frame Pointer #endif -#ifndef TARGET_X86 +#ifndef HOST_X86 // If we don't have a user-supplied context, then don't skip any frames. // So ignore this function (GetStackBackTrace) // ClrCaptureContext on x86 gives us the ESP/EBP/EIP of its caller's caller @@ -749,7 +749,7 @@ CONTEXT * pContext // Context to use (or NULL to use current) { ifrStart += 1; } -#endif // !TARGET_X86 +#endif // !HOST_X86 for (UINT i = 0; i < ifrStart + cfrTotal; i++) { @@ -948,7 +948,7 @@ void MagicDeinit(void) } } -#if defined(TARGET_X86) +#if defined(HOST_X86) /**************************************************************************** * ClrCaptureContext * *-------------------* @@ -988,4 +988,4 @@ ClrCaptureContext(__out PCONTEXT ctx) ret 4 } } -#endif // _TARGET_X86 +#endif // HOST_X86 diff --git a/src/coreclr/src/utilcode/stresslog.cpp b/src/coreclr/src/utilcode/stresslog.cpp index 27906b5e9bcc..7d5562bef51f 100644 --- a/src/coreclr/src/utilcode/stresslog.cpp +++ b/src/coreclr/src/utilcode/stresslog.cpp @@ -24,7 +24,7 @@ thread_local ThreadStressLog* StressLog::t_pCurrentThreadLog; #endif // !STRESS_LOG_READONLY /*********************************************************************************/ -#if defined(TARGET_X86) +#if defined(HOST_X86) /* This is like QueryPerformanceCounter but a lot faster. On machines with variable-speed CPUs (for power management), this is not accurate, but may @@ -39,7 +39,7 @@ __forceinline __declspec(naked) unsigned __int64 getTimeStamp() { }; } -#else // TARGET_X86 +#else // HOST_X86 unsigned __int64 getTimeStamp() { STATIC_CONTRACT_LEAF; @@ -51,9 +51,9 @@ unsigned __int64 getTimeStamp() { return ret.QuadPart; } -#endif // TARGET_X86 +#endif // HOST_X86 -#if defined(TARGET_X86) && !defined(HOST_UNIX) +#if defined(HOST_X86) && !defined(HOST_UNIX) /*********************************************************************************/ /* Get the the frequency cooresponding to 'getTimeStamp'. For x86, this is the @@ -100,7 +100,7 @@ unsigned __int64 getTickFrequency() return hz; } -#else // TARGET_X86 +#else // HOST_X86 /*********************************************************************************/ @@ -115,7 +115,7 @@ unsigned __int64 getTickFrequency() return ret.QuadPart; } -#endif // TARGET_X86 +#endif // HOST_X86 #ifdef STRESS_LOG diff --git a/src/coreclr/src/utilcode/util.cpp b/src/coreclr/src/utilcode/util.cpp index d697946beb8f..d9cdedbd7f4f 100644 --- a/src/coreclr/src/utilcode/util.cpp +++ b/src/coreclr/src/utilcode/util.cpp @@ -416,7 +416,7 @@ void InitCodeAllocHint(SIZE_T base, SIZE_T size, int randomPageOffset) pStart = (BYTE *)(base + size); } - // Randomize the adddress space + // Randomize the address space pStart += GetOsPageSize() * randomPageOffset; s_CodeAllocStart = pStart; @@ -850,6 +850,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, /*static*/ BOOL CPUGroupInfo::m_enableGCCPUGroups = FALSE; /*static*/ BOOL CPUGroupInfo::m_threadUseAllCpuGroups = FALSE; +/*static*/ BOOL CPUGroupInfo::m_threadAssignCpuGroups = FALSE; /*static*/ WORD CPUGroupInfo::m_nGroups = 0; /*static*/ WORD CPUGroupInfo::m_nProcessors = 0; /*static*/ WORD CPUGroupInfo::m_initialGroup = 0; @@ -991,6 +992,7 @@ DWORD LCM(DWORD u, DWORD v) #if !defined(FEATURE_REDHAWK) && (defined(TARGET_AMD64) || defined(TARGET_ARM64)) BOOL enableGCCPUGroups = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_GCCpuGroup) != 0; BOOL threadUseAllCpuGroups = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_Thread_UseAllCpuGroups) != 0; + BOOL threadAssignCpuGroups = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_Thread_AssignCpuGroups) != 0; if (!enableGCCPUGroups) return; @@ -1006,10 +1008,11 @@ DWORD LCM(DWORD u, DWORD v) CPUGroupInfo::GetThreadGroupAffinity(GetCurrentThread(), &groupAffinity); m_initialGroup = groupAffinity.Group; - // only enable CPU groups if more than one group exists - BOOL hasMultipleGroups = m_nGroups > 1; - m_enableGCCPUGroups = enableGCCPUGroups && hasMultipleGroups; - m_threadUseAllCpuGroups = threadUseAllCpuGroups && hasMultipleGroups; + // only enable CPU groups if more than one group exists + BOOL hasMultipleGroups = m_nGroups > 1; + m_enableGCCPUGroups = enableGCCPUGroups && hasMultipleGroups; + m_threadUseAllCpuGroups = threadUseAllCpuGroups && hasMultipleGroups; + m_threadAssignCpuGroups = threadAssignCpuGroups && hasMultipleGroups; #endif // TARGET_AMD64 || TARGET_ARM64 // Determine if the process is affinitized to a single processor (or if the system has a single processor) @@ -1164,8 +1167,8 @@ DWORD LCM(DWORD u, DWORD v) WORD i, minGroup = 0; DWORD minWeight = 0; - // m_enableGCCPUGroups and m_threadUseAllCpuGroups must be TRUE - _ASSERTE(m_enableGCCPUGroups && m_threadUseAllCpuGroups); + // m_enableGCCPUGroups, m_threadUseAllCpuGroups, and m_threadAssignCpuGroups must be TRUE + _ASSERTE(m_enableGCCPUGroups && m_threadUseAllCpuGroups && m_threadAssignCpuGroups); for (i = 0; i < m_nGroups; i++) { @@ -1204,8 +1207,8 @@ DWORD LCM(DWORD u, DWORD v) { LIMITED_METHOD_CONTRACT; #if (defined(TARGET_AMD64) || defined(TARGET_ARM64)) - // m_enableGCCPUGroups and m_threadUseAllCpuGroups must be TRUE - _ASSERTE(m_enableGCCPUGroups && m_threadUseAllCpuGroups); + // m_enableGCCPUGroups, m_threadUseAllCpuGroups, and m_threadAssignCpuGroups must be TRUE + _ASSERTE(m_enableGCCPUGroups && m_threadUseAllCpuGroups && m_threadAssignCpuGroups); WORD group = gf->Group; m_CPUGroupInfoArray[group].activeThreadWeight -= m_CPUGroupInfoArray[group].groupWeight; @@ -1238,6 +1241,12 @@ BOOL CPUGroupInfo::GetCPUGroupRange(WORD group_number, WORD* group_begin, WORD* LIMITED_METHOD_CONTRACT; return m_threadUseAllCpuGroups; } + +/*static*/ BOOL CPUGroupInfo::CanAssignCpuGroupsToThreads() +{ + LIMITED_METHOD_CONTRACT; + return m_threadAssignCpuGroups; +} #endif // HOST_WINDOWS //****************************************************************************** @@ -1893,6 +1902,7 @@ HRESULT validateOneArg( { case ELEMENT_TYPE_VOID: if(bNoVoidAllowed) IfFailGo(VLDTR_E_SIG_BADVOID); + FALLTHROUGH; case ELEMENT_TYPE_BOOLEAN: case ELEMENT_TYPE_CHAR: @@ -1918,6 +1928,7 @@ HRESULT validateOneArg( break; case ELEMENT_TYPE_BYREF: //fallthru if(TypeFromToken(tk)==mdtFieldDef) IfFailGo(VLDTR_E_SIG_BYREFINFIELD); + FALLTHROUGH; case ELEMENT_TYPE_PINNED: case ELEMENT_TYPE_SZARRAY: // Validate the referenced type. @@ -1926,6 +1937,7 @@ HRESULT validateOneArg( case ELEMENT_TYPE_CMOD_OPT: case ELEMENT_TYPE_CMOD_REQD: bRepeat = TRUE; // go on validating, we're not done with this arg + FALLTHROUGH; case ELEMENT_TYPE_VALUETYPE: //fallthru case ELEMENT_TYPE_CLASS: // See if the token is missing. @@ -2111,6 +2123,7 @@ HRESULT validateTokenSig( if (!(ulCallConv & IMAGE_CEE_CS_CALLCONV_HASTHIS) && !IsMdStatic(dwFlags)) return VLDTR_E_MD_NOTTHISNOTSTATIC; // fall thru to callconv check; + FALLTHROUGH; case mdtMemberRef: if(i == IMAGE_CEE_CS_CALLCONV_FIELD) return validateOneArg(tk, &sig, NULL, pImport, TRUE); diff --git a/src/coreclr/src/vm/CMakeLists.txt b/src/coreclr/src/vm/CMakeLists.txt index fb36f5ca9b6e..42da88eb4088 100644 --- a/src/coreclr/src/vm/CMakeLists.txt +++ b/src/coreclr/src/vm/CMakeLists.txt @@ -9,18 +9,12 @@ add_definitions(-DUNICODE) add_definitions(-D_UNICODE) if(FEATURE_AUTO_TRACE) - add_definitions(-DFEATURE_AUTO_TRACE) + add_definitions(-DFEATURE_AUTO_TRACE) endif(FEATURE_AUTO_TRACE) -if(CMAKE_CONFIGURATION_TYPES) # multi-configuration generator? - foreach (Config DEBUG CHECKED) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$:WRITE_BARRIER_CHECK=1>) - endforeach (Config) -else() - if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED) - add_definitions(-DWRITE_BARRIER_CHECK) - endif(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL CHECKED) -endif(CMAKE_CONFIGURATION_TYPES) +foreach (Config DEBUG CHECKED) + add_compile_definitions($<$:WRITE_BARRIER_CHECK>) +endforeach (Config) if(FEATURE_GDBJIT) set(VM_SOURCES_GDBJIT @@ -316,6 +310,7 @@ set(VM_SOURCES_WKS comthreadpool.cpp comutilnative.cpp comwaithandle.cpp + corelib.cpp # true customattribute.cpp custommarshalerinfo.cpp autotrace.cpp @@ -356,6 +351,7 @@ set(VM_SOURCES_WKS gcenv.ee.common.cpp gcenv.os.cpp gchelpers.cpp + genanalysis.cpp genmeth.cpp hosting.cpp ibclogger.cpp @@ -370,7 +366,6 @@ set(VM_SOURCES_WKS marshalnative.cpp methodtablebuilder.cpp mlinfo.cpp - mscorlib.cpp # true multicorejit.cpp # Condition="'$(FeatureMulticoreJIT)' == 'true' multicorejitplayer.cpp # Condition="'$(FeatureMulticoreJIT)' == 'true' nativeeventsource.cpp @@ -491,7 +486,7 @@ set(VM_HEADERS_WKS marshalnative.h methodtablebuilder.h mlinfo.h - mscorlib.h + corelib.h multicorejit.h multicorejitimpl.h nativeeventsource.h @@ -557,6 +552,7 @@ if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) ../gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp ../gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp ../gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp + ../gc/vxsort/smallsort/avx2_load_mask_tables.cpp ) endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32) @@ -923,7 +919,7 @@ list(APPEND VM_HEADERS_DAC if (CLR_CMAKE_TARGET_WIN32) list(APPEND VM_SOURCES_WKS ${VM_HEADERS_WKS}) - list(APPEND VM_SOURCES_WKS_ARCH_ASM ${VM_HEADERS_WKS_ARCH_ASM}) + list(APPEND VM_SOURCES_WKS ${VM_HEADERS_WKS_ARCH_ASM}) list(APPEND VM_SOURCES_DAC ${VM_HEADERS_DAC}) endif(CLR_CMAKE_TARGET_WIN32) @@ -938,12 +934,14 @@ convert_to_absolute_path(VM_SOURCES_WKS_ARCH_ASM ${VM_SOURCES_WKS_ARCH_ASM}) convert_to_absolute_path(VM_SOURCES_DAC ${VM_SOURCES_DAC}) convert_to_absolute_path(VM_SOURCES_WKS_SPECIAL ${VM_SOURCES_WKS_SPECIAL}) -add_library_clr(cee_dac ${VM_SOURCES_DAC}) -add_dependencies(cee_dac eventing_headers) -set_target_properties(cee_dac PROPERTIES DAC_COMPONENT TRUE) -target_precompile_header(TARGET cee_dac HEADER common.h) +if (CLR_CMAKE_BUILD_SUBSET_RUNTIME) + add_library_clr(cee_dac ${VM_SOURCES_DAC}) + add_dependencies(cee_dac eventing_headers) + set_target_properties(cee_dac PROPERTIES DAC_COMPONENT TRUE) + target_precompile_headers(cee_dac PRIVATE [["common.h"]]) -add_subdirectory(wks) + add_subdirectory(wks) +endif(CLR_CMAKE_BUILD_SUBSET_RUNTIME) if(FEATURE_PERFTRACING) add_subdirectory(eventing) diff --git a/src/coreclr/src/vm/ClrEtwAll.man b/src/coreclr/src/vm/ClrEtwAll.man index c68eac52ac28..f7fdca03d6b8 100644 --- a/src/coreclr/src/vm/ClrEtwAll.man +++ b/src/coreclr/src/vm/ClrEtwAll.man @@ -83,6 +83,8 @@ message="$(string.RuntimePublisher.CompilationDiagnosticKeywordMessage)" symbol="CLR_COMPILATIONDIAGNOSTIC_KEYWORD" /> + @@ -131,6 +133,8 @@ + + @@ -401,7 +405,14 @@ - + + + + + + @@ -983,6 +994,17 @@ + + + + + + + +